Undefined symbols error building on macOS with clang 11
The following build error occurs when attempting to build gwollum-3.0.0 on macOS using conda-forge:
[ 26%] Linking CXX shared library libRootUtils.dylib
cd $SRC_DIR/_build/src/Utils && $BUILD_PREFIX/bin/cmake -E cmake_link_script CMakeFiles/RootUtils.dir/link.txt --verbose=1
$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 -std=c++14 -fmessage-length=0 -isystem $PREFIX/include -fdebug-prefix-map=$SRC_DIR=/usr/local/src/conda/gwollum-3.0.0 -fdebug-prefix-map=$PREFIX=/usr/local/src/conda-prefix -march=core2 -mtune=haswell -mssse3 -ftree-vectorize -fPIC -fPIE -fstack-protector-strong -O2 -pipe -stdlib=libc++ -fvisibility-inlines-hidden -fmessage-length=0 -I$PREFIX/include -fdebug-prefix-map=/Users/runner/miniforge3/conda-bld/root_base_1622810034106/work=/usr/local/src/conda/root_base-6.24.0 -fdebug-prefix-map=$PREFIX=/usr/local/src/conda-prefix -std=c++17 -m64 -pipe -fsigned-char -fno-common -Qunused-arguments -pthread -stdlib=libc++ -O2 -g -DNDEBUG -isysroot /opt/MacOSX10.12.sdk -mmacosx-version-min=10.13 -dynamiclib -Wl,-headerpad_max_install_names -Wl,-pie -Wl,-headerpad_max_install_names -Wl,-dead_strip_dylibs -Wl,-rpath,$PREFIX/lib -L$PREFIX/lib -o libRootUtils.dylib -install_name @rpath/libRootUtils.dylib CMakeFiles/RootUtils.dir/Chain.cc.o CMakeFiles/RootUtils.dir/GwollumPlot.cc.o CMakeFiles/RootUtils.dir/RootUtilsDict.cxx.o -Wl,-rpath,$SRC_DIR/_build/src/Utils libCUtils.dylib $PREFIX/lib/libCore.so $PREFIX/lib/libGpad.so $PREFIX/lib/libGraf.so $PREFIX/lib/libHist.so $PREFIX/lib/libRIO.so $PREFIX/lib/libTree.so -lfftw3
ld: warning: -pie being ignored. It is only used when linking a main executable
Undefined symbols for architecture x86_64:
"Vc_1::Common::checkLibraryAbi(unsigned int, unsigned int, char const*)", referenced from:
__GLOBAL__sub_I_GwollumPlot.cc in GwollumPlot.cc.o
__GLOBAL__sub_I_RootUtilsDict.cxx in RootUtilsDict.cxx.o
ld: symbol(s) not found for architecture x86_64
clang-11: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [src/Utils/CMakeFiles/RootUtils.dir/build.make:150: src/Utils/libRootUtils.dylib] Error 1
make[2]: Leaving directory '$SRC_DIR/_build'
make[1]: *** [CMakeFiles/Makefile2:379: src/Utils/CMakeFiles/RootUtils.dir/all] Error 2
make[1]: Leaving directory '$SRC_DIR/_build'
make: *** [Makefile:159: all] Error 2
The cmake configuration outputs the following, which might help with diagnostics:
-- The C compiler identification is Clang 11.1.0
-- The CXX compiler identification is Clang 11.1.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: $BUILD_PREFIX/bin/x86_64-apple-darwin13.4.0-clang - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: $BUILD_PREFIX/bin/x86_64-apple-darwin13.4.0-clang++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found PkgConfig: $BUILD_PREFIX/bin/pkg-config (found version "0.29.2")
-- Checking for module 'fftw3'
-- Found fftw3, version 3.3.9
-- Checking for module 'framel>=8.40.5'
-- Found framel, version 8.41.3
-- FrameL libraries: framel
-- HDF5 CXX compiler wrapper is unable to compile a minimal HDF5 program.
-- Found HDF5: $PREFIX/lib/libhdf5_cpp.dylib;$PREFIX/lib/libhdf5.dylib (found version "1.10.6") found components: CXX
-- Found nlohmann_json: $PREFIX/lib/cmake/nlohmann_json/nlohmann_jsonConfig.cmake (found suitable version "3.9.1", minimum required is "3.9.1")
-- Found ROOT libraries in $PREFIX/lib
-- ROOT libraries: $PREFIX/lib/libCore.so;$PREFIX/lib/libImt.so;$PREFIX/lib/libRIO.so;$PREFIX/lib/libNet.so;$PREFIX/lib/libHist.so;$PREFIX/lib/libGraf.so;$PREFIX/lib/libGraf3d.so;$PREFIX/lib/libGpad.so;$PREFIX/lib/libROOTDataFrame.so;$PREFIX/lib/libTree.so;$PREFIX/lib/libTreePlayer.so;$PREFIX/lib/libRint.so;$PREFIX/lib/libPostscript.so;$PREFIX/lib/libMatrix.so;$PREFIX/lib/libPhysics.so;$PREFIX/lib/libMathCore.so;$PREFIX/lib/libThread.so;$PREFIX/lib/libMultiProc.so;$PREFIX/lib/libROOTVecOps.so
-- Found LATEX: /opt/local/bin/latex found components: PDFLATEX MAKEINDEX DVIPDF BIBTEX
Doxygen need to be installed to generate the doxygen documentation
-- Configuring done
-- Generating done
CMake Warning:
Manually-specified variables were not used by the project:
CMAKE_LIBTOOL
-- Build files have been written to: $SRC_DIR/_build
Edited by Duncan Macleod