conda-forge / ambertools-feedstock

A conda-smithy repository for ambertools.
BSD 3-Clause "New" or "Revised" License
8 stars 14 forks source link

Locally build the conda package in an OSX platform #131

Closed xiki-tempula closed 6 months ago

xiki-tempula commented 11 months ago

Comment:

Hi, I wonder if you guys have any experience with regard to do a local build of the OSX-64 conda package? I have been using build-locally.py script to build the package for linux-64 on a linux machine and it worked fine. But if I tried to do the same thing on my MacOS laptop, I got the following error.

-- The C compiler identification is Clang 15.0.7
-- The CXX compiler identification is Clang 15.0.7
-- The Fortran compiler identification is GNU 12.3.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - failed
-- Check for working C compiler: $BUILD_PREFIX/bin/x86_64-apple-darwin13.4.0-clang
-- Check for working C compiler: $BUILD_PREFIX/bin/x86_64-apple-darwin13.4.0-clang - broken
CMake Error at /Users/zwu/src/amber-feedstock/miniforge3/conda-bld/ambertools_1698769639923/_build_env/share/cmake-3.20/Modules/CMakeTestCCompiler.cmake:66 (message):
  The C compiler

    "/Users/zwu/src/amber-feedstock/miniforge3/conda-bld/ambertools_1698769639923/_build_env/bin/x86_64-apple-darwin13.4.0-clang"

  is not able to compile a simple test program.

  It fails with the following output:

    Change Dir: /Users/zwu/src/amber-feedstock/miniforge3/conda-bld/ambertools_1698769639923/work/build/CMakeFiles/CMakeTmp

    Run Build Command(s):/Users/zwu/src/amber-feedstock/miniforge3/conda-bld/ambertools_1698769639923/_build_env/bin/make -f Makefile cmTC_f9850/fast && /Users/zwu/src/amber-feedstock/miniforge3/conda-bld/ambertools_1698769639923/_build_env/bin/make  -f CMakeFiles/cmTC_f9850.dir/build.make CMakeFiles/cmTC_f9850.dir/build
    make[1]: Entering directory '/Users/zwu/src/amber-feedstock/miniforge3/conda-bld/ambertools_1698769639923/work/build/CMakeFiles/CMakeTmp'
    Building C object CMakeFiles/cmTC_f9850.dir/testCCompiler.c.o
    /Users/zwu/src/amber-feedstock/miniforge3/conda-bld/ambertools_1698769639923/_build_env/bin/x86_64-apple-darwin13.4.0-clang   -march=core2 -mtune=haswell -mssse3 -ftree-vectorize -fPIC -fPIE -fstack-protector-strong -O2 -pipe -isystem /Users/zwu/src/amber-feedstock/miniforge3/conda-bld/ambertools_1698769639923/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_p/include -fdebug-prefix-map=/Users/zwu/src/amber-feedstock/miniforge3/conda-bld/ambertools_1698769639923/work=/usr/local/src/conda/ambertools-23.3 -fdebug-prefix-map=/Users/zwu/src/amber-feedstock/miniforge3/conda-bld/ambertools_1698769639923/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_p=/usr/local/src/conda-prefix  -arch x86_64 -mmacosx-version-min=10.9 -MD -MT CMakeFiles/cmTC_f9850.dir/testCCompiler.c.o -MF CMakeFiles/cmTC_f9850.dir/testCCompiler.c.o.d -o CMakeFiles/cmTC_f9850.dir/testCCompiler.c.o -c /Users/zwu/src/amber-feedstock/miniforge3/conda-bld/ambertools_1698769639923/work/build/CMakeFiles/CMakeTmp/testCCompiler.c
    Linking C executable cmTC_f9850
    /Users/zwu/src/amber-feedstock/miniforge3/conda-bld/ambertools_1698769639923/_build_env/bin/cmake -E cmake_link_script CMakeFiles/cmTC_f9850.dir/link.txt --verbose=1
    /Users/zwu/src/amber-feedstock/miniforge3/conda-bld/ambertools_1698769639923/_build_env/bin/x86_64-apple-darwin13.4.0-clang -march=core2 -mtune=haswell -mssse3 -ftree-vectorize -fPIC -fPIE -fstack-protector-strong -O2 -pipe -isystem /Users/zwu/src/amber-feedstock/miniforge3/conda-bld/ambertools_1698769639923/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_p/include -fdebug-prefix-map=/Users/zwu/src/amber-feedstock/miniforge3/conda-bld/ambertools_1698769639923/work=/usr/local/src/conda/ambertools-23.3 -fdebug-prefix-map=/Users/zwu/src/amber-feedstock/miniforge3/conda-bld/ambertools_1698769639923/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_p=/usr/local/src/conda-prefix  -arch x86_64 -mmacosx-version-min=10.9 -Wl,-search_paths_first -Wl,-headerpad_max_install_names -Wl,-pie -Wl,-headerpad_max_install_names -Wl,-dead_strip_dylibs -Wl,-rpath,/Users/zwu/src/amber-feedstock/miniforge3/conda-bld/ambertools_1698769639923/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_p/lib -L/Users/zwu/src/amber-feedstock/miniforge3/conda-bld/ambertools_1698769639923/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_p/lib  CMakeFiles/cmTC_f9850.dir/testCCompiler.c.o -o cmTC_f9850 
    ld: library not found for -lSystem
    clang-15: error: linker command failed with exit code 1 (use -v to see invocation)
    make[1]: *** [CMakeFiles/cmTC_f9850.dir/build.make:100: cmTC_f9850] Error 1
    make[1]: Leaving directory '/Users/zwu/src/amber-feedstock/miniforge3/conda-bld/ambertools_1698769639923/work/build/CMakeFiles/CMakeTmp'
    make: *** [Makefile:127: cmTC_f9850/fast] Error 2
jaimergp commented 11 months ago

Do you have xcode installed in your machine?

xiki-tempula commented 11 months ago

Yes, I think so

(base) zwu@OXFHCW936KX2W amber-feedstock % xcode-select --install  
xcode-select: error: command line tools are already installed, use "Software Update" in System Settings to install updates
xiki-tempula commented 6 months ago

Ok, apparently the OSX_SDK_DIR has to be absolute path