When I try to start Slicer on my UNIX system, I get an error: "can't find package vtkSlicerBase" or "Word too long".
The most common cause of this problem is that your environment
variable LD_LIBRARY_PATH
has become too long for your shell.
This can be triggered when adding a lot of custom modules, as Slicer
is launched using the csh
script (for versions between February 19,
2003 and March 2004, before we switched to sh
), which silently
truncates environment variables if they are too long.
You can edit the following line in slicer2/launch.tcl
which originally
reads:
set fp [open "| csh -c \"$env(VTK_DIR)/bin/vtk $mainscript $argv \" |& cat" r]
set fp [open "| /bin/sh -c \"$env(VTK_DIR)/bin/vtk $mainscript $argv \" |& cat" r]
.cshrc
or .tcshrc
that append to LD_LIBRARY_PATH
, since these commands are executed
every time you open a new shell. If you spawn shells off from old
shells, the environment variable will keep growing as directories are
added again and again. Type "echo $LD_LIBRARY_PATH
" and check the
output for multiple instances of directories. Also if you have a lot
of Modules in your version of Slicer, each one will add a directory to
your LD_LIBRARY_PATH
and you may run up against the system limit.
set
or setenv
or export
commands dealing with your
LD_LIBRARY_PATH
into your .login
(csh
or tcsh
) or .bash_login
file
(bash
). This file is only executed once, when you log in, and this
method will avoid the concatenation problem. You will need to log out
and log back in for this to take effect.LD_LIBRARY_PATH
environment variable.