2

In UNIX, i am trying to modify the LD_LIBRARY_PATH to make it include some libraries i can't add to the regular libraries of the system( I don't have root permission it's a university server...), at this point I have used many ways that I came across the web to do this but could not modify it neither can i see what is the PATH .. I have tried using:

LD_LIBRARY_PATH="path-to-lib"

but got :command not found.

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/path-to-lib

but got: bad modifier in $ (/)

export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/path-to-lib

but got: command not found

setenv LD_LIBRARY_PATH ${LD_LIBRARY_PATH}:/path-to-lib

but got:LD_LIBRARY_PATH: Undefined variable.

I have got this solutions from: LD_LIBRARY_PATH without export and: How to set the environmental variable LD_LIBRARY_PATH in linux and the comments.

As recommended: my shell is -tcsh

After countless attempts to see my LD_LIBRARY_PATH using all sorts of guides on web i used the printenv command and this is my output:

USER=ravid
LOGNAME=ravid
HOME=/home/ls/ravid
PATH=/usr/lib64/qt-3.3/bin:/usr/local/bin:/bin:/usr/bin:/usr/X11R6/bin:/sbin:/usr/sbin:/home/ls/ravid/bin:.
MAIL=/var/mail/ravid
SHELL=/bin/tcsh
SSH_CLIENT=132.70.42.111 58552 22
SSH_CONNECTION=132.70.42.111 58552 132.70.61.42 22
SSH_TTY=/dev/pts/0
TERM=xterm
HOSTTYPE=x86_64-linux
VENDOR=unknown
OSTYPE=linux
MACHTYPE=x86_64
SHLVL=1
PWD=/home/ls/ravid/cluster_Try/temp/logs
GROUP=ls
HOST=immsilico4
REMOTEHOST=mehr11.ad.biu.ac.il
LS_COLORS=rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=01;05;37;41:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.dz=01;31:*.gz=01;31:*.lz=01;31:*.xz=01;31:*.bz2=01;31:*.tbz=01;31:*.tbz2=01;31:*.bz=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.rar=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.axv=01;35:*.anx=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=01;36:*.au=01;36:*.flac=01;36:*.mid=01;36:*.midi=01;36:*.mka=01;36:*.mp3=01;36:*.mpc=01;36:*.ogg=01;36:*.ra=01;36:*.wav=01;36:*.axa=01;36:*.oga=01;36:*.spx=01;36:*.xspf=01;36:
CVS_RSH=ssh
G_BROKEN_FILENAMES=1
SSH_ASKPASS=/usr/libexec/openssh/gnome-ssh-askpass
KDEDIRS=/usr
KDE_IS_PRELINKED=1
LANG=en_US.UTF-8
LESSOPEN=||/usr/bin/lesspipe.sh %s
MODULESHOME=/usr/share/Modules
MODULEPATH=/usr/share/Modules/modulefiles:/etc/modulefiles
LOADEDMODULES=
QTDIR=/usr/lib64/qt-3.3
QTINC=/usr/lib64/qt-3.3/include
QTLIB=/usr/lib64/qt-3.3/lib
HOSTNAME=immsilico4
MANPATH=/usr/local/man:/usr/share/man:/usr/X11R6/man
COMPILER_VARS=/opt/intel/bin/compilervars.csh
Lic_File=/opt/intel/licenses

I can't find my LD_LIBRARY_PATH in here, is it not supposed to be specified here?

Thanks for your time!

Community
  • 1
  • 1
Ravid Goldenberg
  • 2,119
  • 4
  • 39
  • 59
  • 1
    The second is almost there: `export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/path-to-lib`. The braces ensure the `$` only uses the part inside them as the variable name. It may depend on the shell used whether a variable name can contain further characters, or that the colon `:` automatically stops the variable name. Best to edit the question and add the shell you're using. –  Nov 25 '14 at 10:09
  • How do i know what is my shell version? – Ravid Goldenberg Nov 25 '14 at 10:14
  • 1
    `echo $0` or `echo $SHELL` tends to work for me. –  Nov 25 '14 at 10:16
  • 2
    `export` doesn't work in `tcsh`. You need `setenv LD_LIBRARY_PATH ${LD_LIBRARY_PATH}:/path-to-lib`. Since most *nix OSes come with bash shell as default, most searching will lead you to bash solutions. You'll need to search with "tcsh" explicitly as one of the search terms. –  Nov 25 '14 at 11:05
  • @Evert Pleas review my latest updates and see if u can help me in some way. – Ravid Goldenberg Dec 01 '14 at 09:54
  • Have you *read* my previous comment: `setenv LD_LIBRARY_PATH ${LD_LIBRARY_PATH}:/path-to-lib` or variants thereof. –  Dec 01 '14 at 09:55
  • I have and i followed it, still got many vareints of the errors i posted in my last updaets... – Ravid Goldenberg Dec 01 '14 at 10:36
  • Sorry, but your updates only list examples with `export`, not with `setenv`. I don't understand why you keep using `export ...` when my comments above tell you to use `setenv ...` in `tcsh`. –  Dec 01 '14 at 12:20
  • As for why you don't find `LD_LIBRARY_PATH`; lots of shell variables are optional: if they don't exist, that practically means they are empty. –  Dec 01 '14 at 12:21
  • @Evert i have updated my post. using setenv says : LD_LIBRARY_PATH does not exist. In this case how am i to modify it? – Ravid Goldenberg Dec 01 '14 at 16:17
  • 2
    `setenv LD_LIBRARY_PATH /path-to-lib`. –  Dec 01 '14 at 17:11

0 Answers0