Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

macOS Dynamic/Static Library Issues

Conway__Eamon
Beginner
511 Views

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
1 Solution
Juergen_R_R
Valued Contributor I
511 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
Juergen_R_R
Valued Contributor I
512 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. 

0 Kudos
Conway__Eamon
Beginner
511 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
Reply