Skip to content

Linking fails with clang 12 #3

@awvwgk

Description

@awvwgk

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions