make run error: "dyld: Library not loaded"

1,696 views
Skip to first unread message

Zhibo Luo

unread,
Aug 22, 2018, 3:30:39 PM8/22/18
to deal.II User Group

Hi all,

I recently update my MacOs system to latest macOS High Sierra (10.13.6) and crash my dealii. so I decide to reinstall dealii through candi script. The installation works fine except some warnings. The problem is that when I cd to step-1, cmake and make command get passed, however, when I make run, error comes:

[ 66%] Built target step-1

[100%] Run step-1 with Debug configuration

dyld: Library not loaded: libsuperlu_dist.5.dylib

  Referenced from: /Users/zhiboluo/deal.ii-candi/deal.II-v9.0.0/examples/step-1/./step-1

  Reason: image not found

make[3]: *** [CMakeFiles/run] Abort trap: 6

make[2]: *** [CMakeFiles/run.dir/all] Error 2

make[1]: *** [CMakeFiles/run.dir/rule] Error 2



And I tried the suggested method by export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:~/deal.ii-candi/superlu_dist_5.1.2/lib, but it doesn't work for me. 

I used otool command to output the link libraries:

zhiboluo$ otool -L step-1

step-1:

/Users/zhiboluo/deal.ii-candi/deal.II-v9.0.0/lib/libdeal_II.g.9.0.0.dylib (compatibility version 9.0.0, current version 9.0.0)

/Users/zhiboluo/deal.ii-candi/p4est-2.0/DEBUG/lib/libp4est-2.0.dylib (compatibility version 0.0.0, current version 0.0.0)

/Users/zhiboluo/deal.ii-candi/p4est-2.0/DEBUG/lib/libsc-2.0.dylib (compatibility version 0.0.0, current version 0.0.0)

/usr/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.11)

@rpath/libmuelu-adapters.12.dylib (compatibility version 12.0.0, current version 12.10.1)

@rpath/libmuelu-interface.12.dylib (compatibility version 12.0.0, current version 12.10.1)

@rpath/libmuelu.12.dylib (compatibility version 12.0.0, current version 12.10.1)

@rpath/libteko.12.dylib (compatibility version 12.0.0, current version 12.10.1)

@rpath/libstratimikos.12.dylib (compatibility version 12.0.0, current version 12.10.1)

@rpath/libstratimikosbelos.12.dylib (compatibility version 12.0.0, current version 12.10.1)

@rpath/libstratimikosaztecoo.12.dylib (compatibility version 12.0.0, current version 12.10.1)

@rpath/libstratimikosamesos.12.dylib (compatibility version 12.0.0, current version 12.10.1)

@rpath/libstratimikosml.12.dylib (compatibility version 12.0.0, current version 12.10.1)

@rpath/libstratimikosifpack.12.dylib (compatibility version 12.0.0, current version 12.10.1)

@rpath/libifpack2-adapters.12.dylib (compatibility version 12.0.0, current version 12.10.1)

@rpath/libifpack2.12.dylib (compatibility version 12.0.0, current version 12.10.1)

@rpath/libanasazitpetra.12.dylib (compatibility version 12.0.0, current version 12.10.1)

@rpath/libModeLaplace.12.dylib (compatibility version 12.0.0, current version 12.10.1)

@rpath/libanasaziepetra.12.dylib (compatibility version 12.0.0, current version 12.10.1)

@rpath/libanasazi.12.dylib (compatibility version 12.0.0, current version 12.10.1)

@rpath/libamesos2.12.dylib (compatibility version 12.0.0, current version 12.10.1)

@rpath/libbelostpetra.12.dylib (compatibility version 12.0.0, current version 12.10.1)

@rpath/libbelosepetra.12.dylib (compatibility version 12.0.0, current version 12.10.1)

@rpath/libbelos.12.dylib (compatibility version 12.0.0, current version 12.10.1)

@rpath/libml.12.dylib (compatibility version 12.0.0, current version 12.10.1)

@rpath/libifpack.12.dylib (compatibility version 12.0.0, current version 12.10.1)

@rpath/libzoltan2.12.dylib (compatibility version 12.0.0, current version 12.10.1)

@rpath/libpamgen_extras.12.dylib (compatibility version 12.0.0, current version 12.10.1)

@rpath/libpamgen.12.dylib (compatibility version 12.0.0, current version 12.10.1)

@rpath/libamesos.12.dylib (compatibility version 12.0.0, current version 12.10.1)

@rpath/libgaleri-xpetra.12.dylib (compatibility version 12.0.0, current version 12.10.1)

@rpath/libgaleri-epetra.12.dylib (compatibility version 12.0.0, current version 12.10.1)

@rpath/libaztecoo.12.dylib (compatibility version 12.0.0, current version 12.10.1)

@rpath/libisorropia.12.dylib (compatibility version 12.0.0, current version 12.10.1)

@rpath/libxpetra-sup.12.dylib (compatibility version 12.0.0, current version 12.10.1)

@rpath/libxpetra.12.dylib (compatibility version 12.0.0, current version 12.10.1)

@rpath/libthyratpetra.12.dylib (compatibility version 12.0.0, current version 12.10.1)

@rpath/libthyraepetraext.12.dylib (compatibility version 12.0.0, current version 12.10.1)

@rpath/libthyraepetra.12.dylib (compatibility version 12.0.0, current version 12.10.1)

@rpath/libthyracore.12.dylib (compatibility version 12.0.0, current version 12.10.1)

@rpath/libepetraext.12.dylib (compatibility version 12.0.0, current version 12.10.1)

@rpath/libtpetraext.12.dylib (compatibility version 12.0.0, current version 12.10.1)

@rpath/libtpetrainout.12.dylib (compatibility version 12.0.0, current version 12.10.1)

@rpath/libtpetra.12.dylib (compatibility version 12.0.0, current version 12.10.1)

@rpath/libkokkostsqr.12.dylib (compatibility version 12.0.0, current version 12.10.1)

@rpath/libtpetrakernels.12.dylib (compatibility version 12.0.0, current version 12.10.1)

@rpath/libtpetraclassiclinalg.12.dylib (compatibility version 12.0.0, current version 12.10.1)

@rpath/libtpetraclassicnodeapi.12.dylib (compatibility version 12.0.0, current version 12.10.1)

@rpath/libtpetraclassic.12.dylib (compatibility version 12.0.0, current version 12.10.1)

@rpath/libtriutils.12.dylib (compatibility version 12.0.0, current version 12.10.1)

@rpath/libzoltan.12.dylib (compatibility version 12.0.0, current version 12.10.1)

@rpath/libepetra.12.dylib (compatibility version 12.0.0, current version 12.10.1)

@rpath/libsacado.12.dylib (compatibility version 12.0.0, current version 12.10.1)

@rpath/librtop.12.dylib (compatibility version 12.0.0, current version 12.10.1)

@rpath/libteuchoskokkoscomm.12.dylib (compatibility version 12.0.0, current version 12.10.1)

@rpath/libteuchoskokkoscompat.12.dylib (compatibility version 12.0.0, current version 12.10.1)

@rpath/libteuchosremainder.12.dylib (compatibility version 12.0.0, current version 12.10.1)

@rpath/libteuchosnumerics.12.dylib (compatibility version 12.0.0, current version 12.10.1)

@rpath/libteuchoscomm.12.dylib (compatibility version 12.0.0, current version 12.10.1)

@rpath/libteuchosparameterlist.12.dylib (compatibility version 12.0.0, current version 12.10.1)

@rpath/libteuchoscore.12.dylib (compatibility version 12.0.0, current version 12.10.1)

@rpath/libkokkosalgorithms.12.dylib (compatibility version 12.0.0, current version 12.10.1)

@rpath/libkokkoscontainers.12.dylib (compatibility version 12.0.0, current version 12.10.1)

@rpath/libkokkoscore.12.dylib (compatibility version 12.0.0, current version 12.10.1)

libsuperlu_dist.5.dylib (compatibility version 5.0.0, current version 5.1.0)

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

/Users/zhiboluo/deal.ii-candi/hdf5-1.10.1/lib/libhdf5_hl.100.dylib (compatibility version 101.0.0, current version 101.1.0)

/Users/zhiboluo/deal.ii-candi/hdf5-1.10.1/lib/libhdf5.101.dylib (compatibility version 102.0.0, current version 102.0.0)

libTKBO.11.dylib (compatibility version 11.0.0, current version 11.0.0)

libTKBool.11.dylib (compatibility version 11.0.0, current version 11.0.0)

libTKBRep.11.dylib (compatibility version 11.0.0, current version 11.0.0)

libTKernel.11.dylib (compatibility version 11.0.0, current version 11.0.0)

libTKFeat.11.dylib (compatibility version 11.0.0, current version 11.0.0)

libTKFillet.11.dylib (compatibility version 11.0.0, current version 11.0.0)

libTKG2d.11.dylib (compatibility version 11.0.0, current version 11.0.0)

libTKG3d.11.dylib (compatibility version 11.0.0, current version 11.0.0)

libTKGeomAlgo.11.dylib (compatibility version 11.0.0, current version 11.0.0)

libTKGeomBase.11.dylib (compatibility version 11.0.0, current version 11.0.0)

libTKHLR.11.dylib (compatibility version 11.0.0, current version 11.0.0)

libTKIGES.11.dylib (compatibility version 11.0.0, current version 11.0.0)

libTKMath.11.dylib (compatibility version 11.0.0, current version 11.0.0)

libTKMesh.11.dylib (compatibility version 11.0.0, current version 11.0.0)

libTKOffset.11.dylib (compatibility version 11.0.0, current version 11.0.0)

libTKPrim.11.dylib (compatibility version 11.0.0, current version 11.0.0)

libTKShHealing.11.dylib (compatibility version 11.0.0, current version 11.0.0)

libTKSTEP.11.dylib (compatibility version 11.0.0, current version 11.0.0)

libTKSTEPAttr.11.dylib (compatibility version 11.0.0, current version 11.0.0)

libTKSTEPBase.11.dylib (compatibility version 11.0.0, current version 11.0.0)

libTKSTEP209.11.dylib (compatibility version 11.0.0, current version 11.0.0)

libTKSTL.11.dylib (compatibility version 11.0.0, current version 11.0.0)

libTKTopAlgo.11.dylib (compatibility version 11.0.0, current version 11.0.0)

libTKXSBase.11.dylib (compatibility version 11.0.0, current version 11.0.0)

/System/Library/Frameworks/Accelerate.framework/Versions/A/Accelerate (compatibility version 1.0.0, current version 4.0.0)

/usr/local/opt/open-mpi/lib/libmpi_usempif08.40.dylib (compatibility version 51.0.0, current version 51.1.0)

/usr/local/opt/open-mpi/lib/libmpi_usempi_ignore_tkr.40.dylib (compatibility version 51.0.0, current version 51.1.0)

/usr/local/opt/open-mpi/lib/libmpi_mpifh.40.dylib (compatibility version 51.0.0, current version 51.1.0)

/usr/local/opt/open-mpi/lib/libmpi.40.dylib (compatibility version 51.0.0, current version 51.1.0)

/Users/zhiboluo/deal.ii-candi/slepc-3.7.3/lib/libslepc.3.7.dylib (compatibility version 3.7.0, current version 3.7.3)

/Users/zhiboluo/deal.ii-candi/petsc-3.7.6/lib/libpetsc.3.7.dylib (compatibility version 3.7.0, current version 3.7.6)

libparmetis.dylib (compatibility version 0.0.0, current version 0.0.0)

libmetis.dylib (compatibility version 0.0.0, current version 0.0.0)

/System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libLAPACK.dylib (compatibility version 1.0.0, current version 1.0.0)

/System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib (compatibility version 1.0.0, current version 1.0.0)

/usr/local/opt/openssl/lib/libssl.1.0.0.dylib (compatibility version 1.0.0, current version 1.0.0)

/usr/local/opt/openssl/lib/libcrypto.1.0.0.dylib (compatibility version 1.0.0, current version 1.0.0)

/usr/local/lib/gcc/8/libgcc_s.1.dylib (compatibility version 1.0.0, current version 1.0.0)

/usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 400.9.0)

@rpath/libLTO.dylib (compatibility version 1.0.0, current version 3902.0.39)


I found that some other libraries path (like p4est, slepc, and petsc) are set correctly. However, the library path of superlu_dist, parmetis, and oce are not set correctly. The generated object try to find "libsuperlu_dist.5.dylib" in the current path, but actually this library is installed in /Users/zhiboluo/deal.ii-candi/superlu_dist_5.1.2/lib. Then I copy these libraries to current folder, "make run" works! But I don't want to copy these libraries everytime I go to compile another project. 

Any suggestions to solve this dynamic library link problems?

Thanks~



Jean-Paul Pelteret

unread,
Aug 24, 2018, 2:13:09 AM8/24/18
to dea...@googlegroups.com
Dear Zhibo,

I guess that this could be fixed in Candi (? ping Uwe, Timo). As of the El Capitan release (I think), its not possible to use DYLD_LIBRARY_PATH anymore if SIP (System Integrity Protection) is enabled. For an immediate solution I would suggest trying to use install_name_tool to add the full path of (or an @rpath to) these problematic libraries. Here’s a link to a StackOverflow post that has more details. I hope that using this tool to direct to the location of the linked in library will resolve the issue.

Best,
Jean-Paul

-- 
The deal.II project is located at http://www.dealii.org/
For mailing list/forum options, see https://groups.google.com/d/forum/dealii?hl=en
--- 
You received this message because you are subscribed to the Google Groups "deal.II User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dealii+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Zhibo Luo

unread,
Sep 3, 2018, 4:05:06 PM9/3/18
to deal.II User Group
Dear Jean-Paul,

Thank you for your reply. I was on vacation in the past week. so I reply you late. I tried the method according to your suggestions. Now my dealii finally works. The following method I summarized for other people who also have those dynamic library link errors.

installation Error type:

dyld: Library not loaded: libXXX.dylib

  Referenced from: username/deal.ii-candi/petsc-3.7.6/lib/libXXX.dylib

  Reason: image not found


if you also encounter the above error when using candi stript to install dealii and other denpendent libraries, the error means when you run the executable file, the executable file cannot find the dynamic library. You can use "otool -L libXXX.dylib" command to check the link path of dependent libraries. If you cannot see the link path of libXXX.dylib, you may need to change the link path by yourself.

Steps to solve the installation error:

1. go the library folder and change the id of libXXX.dylib     
           install_name_tool -id "@rpath/libXXX.dylib" libXXX.dylib
2. go the executable folder (), change the link path and add path to the executable file (libYYY.dylib)
  install_name_tool -change libXXX.dylib @rpath/libXXX.dylib libYYY.dylib
  install_name_tool -add_rpath "@rpath/libXXX.dylib" libYYY.dylib

You may need to use otool -L command to find out which path need to change and need to change a lot of dynamic libraries.


Cheers,
Zhibo




在 2018年8月24日星期五 UTC-4上午2:13:09,Jean-Paul Pelteret写道:

Uwe Köcher

unread,
Sep 4, 2018, 8:32:58 AM9/4/18
to deal.II User Group
Dear Jean-Paul and Zhibo,

curious. We use modulefiles with "prepend-path" as of

#%Module 1.0
#
#  deal.II module for use with 'environment-modules' package:
#


module-whatis          "Provides the deal.II toolbox."


#module load mpi/mpich-x86_64


setenv                  DEAL_II_DIR        
/apps/candi/deal.II-v8.5.0
setenv                  TRILINOS_DIR        
/apps/candi/trilinos-release-12-10-1


prepend
-path            DYLD_LIBRARY_PATH   /apps/candi/parmetis-4.0.3/lib
prepend
-path            DYLD_LIBRARY_PATH   /apps/candi/superlu_dist_5.1.2/lib


prepend
-path            DYLD_LIBRARY_PATH   /apps/candi/OCE-0.18/lib
prepend
-path            DYLD_LIBRARY_PATH   /apps/candi/deal.II-v8.5.0/lib
prepend
-path            DYLD_LIBRARY_PATH   /apps/candi/hdf5-1.10.0-patch1/lib
#prepend-path            DYLD_LIBRARY_PATH   /apps/candi/deal.II-toolchain/v8.5.0/brew-openmpi/p4est-2.0/FAST/lib
#prepend-path            DYLD_LIBRARY_PATH   /apps/candi/deal.II-toolchain/v8.5.0/brew-openmpi/p4est-2.0/DEBUG/lib
prepend
-path            DYLD_LIBRARY_PATH   /apps/candi/petsc-3.7.6/lib
prepend
-path            DYLD_LIBRARY_PATH   /apps/candi/slepc-3.7.3/lib
prepend
-path            DYLD_LIBRARY_PATH   /apps/candi/trilinos-release-12-10-1/lib

together with the environment modules package from Homebrew.

Currently this approach is still working (at least what we have checked 5 minutes ago,
but maybe we don't have the latest patch level). It is also possible that we don't use SIP,
I don't know.

From candi site, we have the configuration files located in some install path and one
can activate it by calling the respective "enable.sh" script, but it is possible that we have
forgotten to update them accordingly, regarding your post
 
"However, the library path of superlu_dist, parmetis, and oce are not set correctly.
The generated object try to find "libsuperlu_dist.5.dylib" in the current path,
but actually this library is installed in /Users/zhiboluo/deal.ii-candi/superlu_dist_5.1.2/lib."

I'll will take a look into this in the forthcoming days (I'm also just arrived back from summer vacation).

Best
  Uwe
 

NGC

unread,
Mar 14, 2020, 5:01:11 PM3/14/20
to deal.II User Group
I apologie -- but I still am having issues. But I am very much a newbie. Is someone able to expand this explanation a bit?
Steps to solve the installation error:

1. go the library folder and change the id of libXXX.dylib     
           install_name_tool -id "@rpath/libXXX.dylib" libXXX.dylib
2. go the executable folder (), change the link path and add path to the executable file (libYYY.dylib)
  install_name_tool -change libXXX.dylib @rpath/libXXX.dylib libYYY.dylib
  install_name_tool -add_rpath "@rpath/libXXX.dylib" libYYY.dylib

You may need to use otool -L command to find out which path need to change and need to change a lot of dynamic libraries.

Is it possible for someone to point to the folder paths (when I go to the /lib folder I don't have a lib***.dylib file anywhere. Also, do I need to add the path for each folder that has an executable? Can't I put this in my .bashrc file or some other method? Thanks for any help.
Reply all
Reply to author
Forward
0 new messages