KCL-BMEIS / niftyreg

This project contains command line tools to perform rigid, affine and non-linear registration of nifti or analyse images as well as utilities
BSD 3-Clause "New" or "Revised" License
141 stars 42 forks source link

Compiling fails on macOS b/c of dynamic library not found #69

Closed vigji closed 4 years ago

vigji commented 4 years ago

I have been trying to follow instructions in https://github.com/KCL-BMEIS/niftyreg/wiki/install to compile NiftyReg on a macOS catalina.

I have done everything as required: I have the folders /Users/username/niftyreg_install and build; i enter /Users/username/niftyreg_install in the configuration window; everything runs; and when trying reg_f3d -h I get the following error:

dyld: Library not loaded: lib_reg_f3d.dylib
  Referenced from: /Users/username/niftyreg_install/bin/reg_f3d
  Reason: image not found
Abort trap: 6

Do you have any idea about what could I be doing wrong?

fepegar commented 4 years ago

I added this to my .bashrc, not sure if it's needed:

export NIFTYREG_INSTALL=/Users/fernando/git/niftyreg/install
PATH=${NIFTYREG_INSTALL}/bin:$PATH
LD_LIBRARY_PATH={NIFTYREG_INSTALL}/lib:${LD_LIBRARY_PATH}
export PATH
export LD_LIBRARY_PATH
vigji commented 4 years ago

Thank for the reply! Unfortunately, either I am doing something wrong or it does not seem to be working...

vigji commented 4 years ago

Ok, I got the problem. Configuring the .bash_profile with those line solves the problem when running from a shell, but when I try to run commands through python subprocess.check_callit does not recognise the configured LD_LIBRARY_PATH, I needed to prepend it again in the string with the other commands. Thanks for the help!