1

I want to load a module on a server using SSH

ssh server.university.com "module load moduleX"

but I'm getting the following error:

/usr/local/Modules/default/bin/modulecmd: error while loading shared` libraries: libtclx8.4.so: cannot open shared object file: No such file or directory

I tried the solutions of this thread:

How to use environment modules in a ssh command line?

That is,

 ssh server.university.com "bash -lc 'module load moduleX'" 

 bash: module: command not found

and

ssh server.university.com "source /etc/profile; module load moduleX"

/usr/local/Modules/default/bin/modulecmd: error while loading shared libraries: libtclx8.4.so: cannot open shared object file: No such file or directory 

I can load the module when I've already signed into the server. The reason for why I want to load it in the same command is that I in a pipeline want to do some estimations on the server, the rest on my computer.

Can someone please find a solution?

Here is the way I solved it:

It seems like the case I had a .bash_profile file prohibited the .profile file to be read. Took the .bash_profile file away and now it is working. I also added the following lines to the start of the .bashrc file which also was a part of the solution:

MODULE_VERSION=default
export MODULE_VERSION
LD_LIBRARY_PATH=/usr/local/pkg/tcltk/8.6.0/lib/:/usr/local/pkg/tcltk/8.6.0/lib/tclx8.4/
export LD_LIBRARY_PATH
saken
  • 21
  • 6
  • Couldn't you enter normally and then load it? – Jonatan Öström Jul 22 '16 at 16:58
  • Do you know what specific environment variable is missing, and what value it should be set to? – Kenster Jul 22 '16 at 17:00
  • Thanks for your replies @Jonatan and @Kenster! Jonatan, yes I can enter it normally and load it. I've added the reason for why I want to load it from the ssh to the question. Kenster, no I don't know. Do you know how to get this information? – saken Jul 25 '16 at 08:08
  • I don't know anything more, but check the ssh man page, and try fiddling around until it works :) for example, I don't know what the c stands for in the flag -lc may be something should be changed. – Jonatan Öström Jul 25 '16 at 17:26
  • Thank you! Now I've fiddled around a little bit ;-) See question for answer. – saken Aug 02 '16 at 08:06
  • Looked all over for the answer to this. Found it here: https://stackoverflow.com/a/36728686/1707865 – Robert Bain Apr 19 '21 at 08:05

0 Answers0