[petsc-users] [3.7.5] strange config error on macOS with XCode 8.3 and Clang 8.1.0

Barry Smith bsmith at mcs.anl.gov
Tue Mar 28 18:15:07 CDT 2017


  
   I can reproduce the problem. Cannot understand it.

Executing: gfortran  -o /var/folders/c1/ldz_dt8n2r3dtwv_chp5pfr40000gn/T/petsc-YTTzYM/config.setCompilers/conftest  -Wl,-multiply_defined,suppress -Wl,-multiply_defined -Wl,suppress -Wl,-commons,use_dylibs -Wl,-search_paths_first -Wl,-no_compact_unwind   -Wall -ffree-line-length-0 -Wno-unused-dummy-argument -g /var/folders/c1/ldz_dt8n2r3dtwv_chp5pfr40000gn/T/petsc-YTTzYM/config.setCompilers/conftest.o -lto_library -Wl,-rpath,/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib -L/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib -lLTO -ldl -lSystem -Wl,-rpath,/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/8.1.0/lib/darwin -L/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/8.1.0/lib/darwin -lclang_rt.osx -ldl 
Possible ERROR while running linker: exit code 256
stderr:
ld: can't map file, errno=22 file '/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib' for architecture x86_64
collect2: error: ld returned 1 exit status

If I remove the one -Wl,-rpath,/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib   then it links ok. 

If I run with -v to see the actual ld line it is 

/usr/bin/ld -dynamic  -macosx_version_min 10.12.4 -weak_reference_mismatches non-weak -o conftest -L/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib -L/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/8.1.0/lib/darwin -L/usr/local/Cellar/gcc/6.3.0_1/lib/gcc/6/gcc/x86_64-apple-darwin16.3.0/6.3.0 -L/usr/local/Cellar/gcc/6.3.0_1/lib/gcc/6/gcc/x86_64-apple-darwin16.3.0/6.3.0/../../.. -multiply_defined suppress -multiply_defined suppress -commons use_dylibs -search_paths_first -no_compact_unwind program.o -lto_library -rpath /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain -lSystem -rpath /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/8.1.0/lib -lgfortran -no_compact_unwind -lSystem -lgcc_ext.10.5 -lgcc -lquadmath -lm -lgcc_ext.10.5 -lgcc -lSystem -v

and does not work with the same error but if I remove the -rpath /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain it works.

Now I flip the position of the two paths

/usr/bin/ld -dynamic  -macosx_version_min 10.12.4 -weak_reference_mismatches non-weak -o conftest -L/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib -L/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/8.1.0/lib/darwin -L/usr/local/Cellar/gcc/6.3.0_1/lib/gcc/6/gcc/x86_64-apple-darwin16.3.0/6.3.0 -L/usr/local/Cellar/gcc/6.3.0_1/lib/gcc/6/gcc/x86_64-apple-darwin16.3.0/6.3.0/../../.. -multiply_defined suppress -multiply_defined suppress -commons use_dylibs -search_paths_first -no_compact_unwind program.o -lto_library -rpath  /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/8.1.0/lib  -lSystem -rpath /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain -lgfortran -no_compact_unwind -lSystem -lgcc_ext.10.5 -lgcc -lquadmath -lm -lgcc_ext.10.5 -lgcc -lSystem -v


and it now complains about the other directory !

ld: can't map file, errno=22 file '/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/8.1.0/lib' for inferred architecture x86_64


If I list three -rpath it complains about the first (just like with two)

It's like ld is wonky



> On Mar 28, 2017, at 4:31 PM, Denis Davydov <davydden at gmail.com> wrote:
> 
> @Satish
> 
> please find the log attached:
> 
> 
> @Matt
> 
> >> but then you are responsible for putting any compiler libraries in LIBS
> >> that we needed to make Fortran and C work together.
> 
> hopefully we can find another solution to this issue.
> 
> 
> @Bary
> 
> Thanks for trying to reproduce the issue, if you will be trying Spack, be aware that you need to do:
> 
>   ncurses:
>     version: [6.0]
>     paths:
>       ncurses at 6.0: /usr
>     buildable: False
>   openblas:
>     version: [develop] 
>   python:
>     version: [2.7.10]
>     paths:
>       python at 2.7.10: /usr
>     buildable: False
> 
> 
> Regards,
> Denis
> 
> <configure.log.zip>



More information about the petsc-users mailing list