CASMcode icon indicating copy to clipboard operation
CASMcode copied to clipboard

Linux conda install cannot find libcasm

Open Dongsheng-Wen opened this issue 1 year ago • 1 comments

Hi, I recently tried to install CASM on my linux machines, using the installation guide on conda environment. The ccasm was successfully install but when I typed casm, it looks like the api didn't find the path of the libcasm. Here is the traceback error:

  File "/home/e720/e720/wen94/anaconda3/envs/casm_1_2_0/bin/casm", line 8, in <module>
    sys.exit(main())
  File "/home/e720/e720/wen94/anaconda3/envs/casm_1_2_0/lib/python3.9/site-packages/casm/scripts/casm.py", line 38, in main
    libcasm_commands = json.loads(command_list())
  File "/home/e720/e720/wen94/anaconda3/envs/casm_1_2_0/lib/python3.9/site-packages/casm/api/api.py", line 481, in command_list
    _api = API()
  File "/home/e720/e720/wen94/anaconda3/envs/casm_1_2_0/lib/python3.9/site-packages/casm/api/api.py", line 181, in __init__
    API.__api = API.__API()
  File "/home/e720/e720/wen94/anaconda3/envs/casm_1_2_0/lib/python3.9/site-packages/casm/api/api.py", line 117, in __init__
    raise e
  File "/home/e720/e720/wen94/anaconda3/envs/casm_1_2_0/lib/python3.9/site-packages/casm/api/api.py", line 55, in __init__
    libcasm_path = sh.grep(sh.ldd(casm_path),
  File "/home/e720/e720/wen94/anaconda3/envs/casm_1_2_0/lib/python3.9/site-packages/sh.py", line 1524, in __call__
    rc = self.__class__.RunningCommandCls(cmd, call_args, stdin, stdout, stderr)
  File "/home/e720/e720/wen94/anaconda3/envs/casm_1_2_0/lib/python3.9/site-packages/sh.py", line 750, in __init__
    self.wait()
  File "/home/e720/e720/wen94/anaconda3/envs/casm_1_2_0/lib/python3.9/site-packages/sh.py", line 812, in wait
    self.handle_command_exit_code(exit_code)
  File "/home/e720/e720/wen94/anaconda3/envs/casm_1_2_0/lib/python3.9/site-packages/sh.py", line 839, in handle_command_exit_code
    raise exc
sh.ErrorReturnCode_2: 

  RAN: /usr/bin/grep '	linux-vdso.so.1 (0x00007fff99152000)
	libcasm.so => /home/e720/e720/wen94/anaconda3/envs/casm_1_2_0/bin/../lib/libcasm.so (0x00007ff417380000)
	libboost_regex.so.1.66.0 => /home/e720/e720/wen94/anaconda3/envs/casm_1_2_0/bin/../lib/libboost_regex.so.1.66.0 (0x00007ff418174000)
	libboost_system.so.1.66.0 => /home/e720/e720/wen94/anaconda3/envs/casm_1_2_0/bin/../lib/libboost_system.so.1.66.0 (0x00007ff41816d000)
	libboost_filesystem.so.1.66.0 => /home/e720/e720/wen94/anaconda3/envs/casm_1_2_0/bin/../lib/libboost_filesystem.so.1.66.0 (0x00007ff418150000)
	libboost_program_options.so.1.66.0 => /home/e720/e720/wen94/anaconda3/envs/casm_1_2_0/bin/../lib/libboost_program_options.so.1.66.0 (0x00007ff4180c2000)
	libboost_chrono.so.1.66.0 => /home/e720/e720/wen94/anaconda3/envs/casm_1_2_0/bin/../lib/libboost_chrono.so.1.66.0 (0x00007ff4180b5000)
	libz.so.1 => /home/e720/e720/wen94/anaconda3/envs/casm_1_2_0/bin/../lib/libz.so.1 (0x00007ff41809b000)
	libdl.so.2 => /lib64/libdl.so.2 (0x00007ff41717c000)
	libstdc++.so.6 => /home/e720/e720/wen94/anaconda3/envs/casm_1_2_0/bin/../lib/libstdc++.so.6 (0x00007ff416fc8000)
	libm.so.6 => /lib64/libm.so.6 (0x00007ff416c46000)
	libgcc_s.so.1 => /home/e720/e720/wen94/anaconda3/envs/casm_1_2_0/bin/../lib/libgcc_s.so.1 (0x00007ff416c2d000)
	libc.so.6 => /lib64/libc.so.6 (0x00007ff416868000)
	librt.so.1 => /lib64/librt.so.1 (0x00007ff416660000)
	libpthread.so.0 => /lib64/libpthread.so.0 (0x00007ff416440000)
	/lib64/ld-linux-x86-64.so.2 (0x00007ff418059000)
' libcasm

  STDOUT:


  STDERR:
/usr/bin/grep: libcasm: No such file or directory

What I think it is related to the api.py in which the 'libcasm' wasn't found from the line:

libcasm_path = sh.grep(sh.ldd(casm_path),
                                               'libcasm').split()[2]

Any ideas of a quick fix?

Best, Dongsheng

Dongsheng-Wen avatar May 26 '23 18:05 Dongsheng-Wen

  • The latest version of sh seems to have some issues with casm-python
  • Installing an older version like pip3 install sh=1.14.2 --user should fix the issue.

seshasaibehara avatar May 26 '23 19:05 seshasaibehara