ornladios / ADIOS2

Next generation of ADIOS developed in the Exascale Computing Program
https://adios2.readthedocs.io/en/latest/index.html
Apache License 2.0
271 stars 126 forks source link

Installed binaries are broken on macOS #1040

Closed keichi closed 5 years ago

keichi commented 5 years ago

Installed binaries fail to find the ADIOS library. Binaries under the build directory do work. Might be related to #348?

ADIOS2 build configuration:
  ADIOS Version: 2.2.0
  C++ Compiler : AppleClang 10.0.0.10001145
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++

  Fortran Compiler : GNU 8.2.0
    /usr/local/bin/gfortran

  Installation prefix: /usr/local
        bin: bin
        lib: lib
    include: include
      cmake: lib/cmake/adios2
     python: lib/python3.7/site-packages

  Features:
    Library Type: shared
    Build Type:   Release
    Testing: ON
    Build Options:
      BZip2    : ON
      ZFP      : ON
      SZ       : ON
      MGARD    : OFF
      MPI      : ON
      DataMan  : ON
      SST      : ON
      ZeroMQ   : ON
      HDF5     : OFF
      Python   : ON
      Fortran  : ON
      SysVShMem: ON
      Endian_Reverse: OFF
$ bpls
dyld: Library not loaded: @rpath/libadios2.2.dylib
  Referenced from: /usr/local/bin/bpls
  Reason: image not found
Abort trap: 6
williamfgc commented 5 years ago

@keichi is the same issue, after install make sure adios2-install/lib is in DYLD_LIBRARY_PATH on Mac

keichi commented 5 years ago

It does work if I set DYLD_LIBRARY_PATH, but I've installed ADIOS under /usr/local. Why do I need to set DYLD_LIBRARY_PATH?

williamfgc commented 5 years ago

I am not familiar with Xcode ld on Mac, but this link might help: https://stackoverflow.com/questions/27314733/make-usr-local-lib-a-default-library-search-path-for-ld-on-mac-os-x

keichi commented 5 years ago

All the binaries under /usr/local/bin that I've installed using Homebrew run fine without changing any environment variable. I think ADIOS2 should also work out of the box.

williamfgc commented 5 years ago

If libadios2.dylib is in a reachable ld location it should work. Is /usr/local/lib always reachable by ld? What does otool - L bpls tell you?

keichi commented 5 years ago
/usr/local/bin/bpls:
    @rpath/libadios2.2.dylib (compatibility version 2.0.0, current version 2.2.0)
    /Users/keichi/.spack/opt/spack/darwin-mojave-x86_64/clang-10.0.0-apple/openmpi-3.1.3-6owrpmticip3filnaljkrsyl3zlonwea/lib/libmpi.40.dylib (compatibility version 51.0.0, current version 51.3.0)
    /usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 400.9.4)
    /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1252.200.5)
keichi commented 5 years ago

The linker does find the libraries under /usr/local/lib since mpic++ -std=c++11 -ladios2 foo.cpp succeeds.

williamfgc commented 5 years ago

@keichi Does ./bin/adios-reorganize have the same problem?

keichi commented 5 years ago

@williamfgc Yes, it does. Same with adios_iotest.

williamfgc commented 5 years ago

@keichi, thanks. @chuckatkins how can we strip @rpath from the installed libraries as in #348 ?

chuckatkins commented 5 years ago

Fixed in current master.