Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Beginner
11 Views

macOS Dynamic/Static Library Issues

Jump to solution

Hi,

I have just installed the Intel Fortran compiler and libraries on my iMac (High Sierra) but I am having issues calling an executable from within an executable via the systtemqq line, say x=systemqq('./executable.x'). So, the call.x program below simply tells the command line to run executable.x

I consistently get the error:

dyld: Library not loaded: @rpath/libiomp5.dylib

 

  Referenced from: /Users/username/folder/./call.x

  Reason: image not found

 

However, if I check what libraries call.x and executable.x are both searching for, via 'stool -L xxxxx' they are exactly the same:

@rpath/libiomp5.dylib (compatibility version 5.0.0, current version 5.0.0)

    /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1252.50.4)

 

 

Now, the fun part, if I simply do: ./executable.x from the terminal, it runs fine, no issues. 

Clearly there is something strange occurring with calling the system. There is a workaround, but I do not see the logical sense in typing:

install_name_tool -change @rpath/libiomp5.dylib /opt/intel/compilers_and_libraries_2018.2.xxx/mac/compiler/lib/libiomp5.dylib executable.x

install_name_tool -change @rpath/libiomp5.dylib /opt/intel/compilers_and_libraries_2018.2.xxx/mac/compiler/lib/libiomp5.dylib call.x

every time I need to run a program. 

There are no issues given out with compiling these. My bash_profile has already been edited to include the compiler and mkl libraries. 

export DYLD_LIBRARY_PATH=/opt/intel/compilers_and_libraries_2018.2.164/mac/compiler/lib:/opt/intel/compilers_and_libraries_    2018.2.xxx/mac/mkl/lib:$DYLD_LIBRARY_PATH

Surely there is a better option than manually redefining the location of @rpath/libiomp5.dylib every time.

I would be extremely grateful for any insight or help on this. 

Best,

Eamon.

 

 

 

0 Kudos

Accepted Solutions
Highlighted
Valued Contributor I
11 Views

Do you have the Security Integrity Protocol (SIP) of High Sierra switched on? You can check this with `csrutil status`. SIP disallows any environment variables to be transferred to subprocesses spawned by a main program. 

View solution in original post

0 Kudos
2 Replies
Highlighted
Valued Contributor I
12 Views

Do you have the Security Integrity Protocol (SIP) of High Sierra switched on? You can check this with `csrutil status`. SIP disallows any environment variables to be transferred to subprocesses spawned by a main program. 

View solution in original post

0 Kudos
Highlighted
Beginner
11 Views

Juergen R. wrote:

Do you have the Security Integrity Protocol (SIP) of High Sierra switched on? You can check this with `csrutil status`. SIP disallows any environment variables to be transferred to subprocesses spawned by a main program. 

Ahhh, yes. I do indeed have it switched on, although it seems to be on by default. This fixed the problem. 

Thank you!

Regards,

Eamon.

0 Kudos