Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Linking fails with clang 12 #3

Open
awvwgk opened this issue Apr 11, 2022 · 2 comments
Open

Linking fails with clang 12 #3

awvwgk opened this issue Apr 11, 2022 · 2 comments

Comments

@awvwgk
Copy link

awvwgk commented Apr 11, 2022

Another issue with the LLVM toolchain, linking with the clang and the ld on MacOS (LLVM based) I get an error because the --no-as-needed option is unknown.

[8/8] Linking CXX shared library src/Xtb/xtb.module.dylib
FAILED: src/Xtb/xtb.module.dylib 
: && $BUILD_PREFIX/bin/x86_64-apple-darwin13.4.0-clang++ -march=core2 -mtune=haswell -mssse3 -ftree-vectorize -fPIC -fPIE -fstack-protector-strong -O2 -pipe -stdlib=libc++ -fvisibility-inlines-hidden -fmessage-length=0 -isystem $PREFIX/include -fdebug-prefix-map=$SRC_DIR=/usr/local/src/conda/scine-xtb-1.0.0 -fdebug-prefix-map=$PREFIX=/usr/local/src/conda-prefix -Wall -Wextra -Wpedantic -O3 -DNDEBUG -isysroot /Applications/Xcode_12.4.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk -mmacosx-version-min=10.9 -dynamiclib -Wl,-headerpad_max_install_names -Wl,-pie -Wl,-headerpad_max_install_names -Wl,-dead_strip_dylibs -Wl,-rpath,$PREFIX/lib -L$PREFIX/lib  -Wl,--no-as-needed -o src/Xtb/xtb.module.dylib -install_name @rpath/xtb.module.dylib src/Xtb/CMakeFiles/Xtb.dir/Xtb/Wrapper/GFN0Wrapper.cpp.o src/Xtb/CMakeFiles/Xtb.dir/Xtb/Wrapper/GFN1Wrapper.cpp.o src/Xtb/CMakeFiles/Xtb.dir/Xtb/Wrapper/GFN2Wrapper.cpp.o src/Xtb/CMakeFiles/Xtb.dir/Xtb/Wrapper/GFNFFWrapper.cpp.o src/Xtb/CMakeFiles/Xtb.dir/Xtb/Wrapper/XtbCalculatorBase.cpp.o src/Xtb/CMakeFiles/Xtb.dir/Xtb/Wrapper/XtbSettings.cpp.o src/Xtb/CMakeFiles/Xtb.dir/Xtb/XtbModule.cpp.o  $PREFIX/lib/libutilsos.dylib  -lgfortran  $PREFIX/lib/libboost_filesystem.dylib  $PREFIX/lib/libboost_system.dylib  -framework  Accelerate  $PREFIX/lib/libxtb.dylib && :
ld: unknown option: --no-as-needed
clang-12: error: linker command failed with exit code 1 (use -v to see invocation)
ninja: build stopped: subcommand failed.
System info

     active environment : base
    active env location : /Users/runner/mambaforge
            shell level : 1
       user config file : /Users/runner/.condarc
 populated config files : /Users/runner/mambaforge/.condarc
          conda version : 4.12.0
    conda-build version : 3.21.8
         python version : 3.9.10.final.0
       virtual packages : __osx=10.15.7=0
                          __unix=0=0
                          __archspec=1=x86_64
       base environment : /Users/runner/mambaforge  (writable)
      conda av data dir : /Users/runner/mambaforge/etc/conda
  conda av metadata url : None
           channel URLs : https://conda.anaconda.org/conda-forge/osx-64
                          https://conda.anaconda.org/conda-forge/noarch
          package cache : /Users/runner/mambaforge/pkgs
                          /Users/runner/.conda/pkgs
       envs directories : /Users/runner/mambaforge/envs
                          /Users/runner/.conda/envs
               platform : osx-64
             user-agent : conda/4.12.0 requests/2.27.1 CPython/3.9.10 Darwin/19.6.0 OSX/10.15.7
                UID:GID : 501:20
             netrc file : None
           offline mode : False

@weymutht
Copy link
Member

Thanks for reporting this. Maybe we can find a way to work around this, but please note that we cannot really offer support for OSX.

@awvwgk
Copy link
Author

awvwgk commented Aug 12, 2022

This line should be removed for building with clang on OSX:

set_target_properties(Xtb PROPERTIES LINK_FLAGS "-Wl,--no-as-needed")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants