Re: [AMBER] AmberTools20 comilation on macOS

From: Gustaf Olsson <gustaf.olsson.lnu.se>
Date: Tue, 5 May 2020 09:33:42 +0000

OK, so a bigger issue then suspected


./quick_cmake_install -mpi -openmp GNU


Using gcc9 produced an error:


In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include/stdlib.h:61,
                 from blas_malloc.c:1:
/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include/Availability.h:257:22: error: missing binary operator before token "("
  257 | #if __has_builtin(__is_target_arch)
      | ^
make[4]: *** [blas_malloc.o] Error 1
make[3]: *** [common-lib] Error 2
make[2]: *** [AmberTools/src/xblas/src/xblas_build-stamp/xblas_build-build] Error 2
make[1]: *** [AmberTools/src/xblas/CMakeFiles/xblas_build.dir/all] Error 2
make: *** [all] Error 2


Which seems to have something to do with the GCC build from homebrew, as my path is set up for GNU GCC, however the search path for includes still has /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include with higher priority.


Trying with gcc8 instead, turns out that /usr/bin/cc is now protected and cannot be renamed/moved even as sudo. This is a problem since this gets priority over gcc even if /usr/local/bin occurs prior to /usr/bin in my path. This means the configuration fails as it finds "clang" even though I specified "gcc". So that does not work.


So I decided to go back and try CLANG again:


./quick_cmake_install -mpi -openmp CLANG

[ 2%] Built target netcdff
[ 2%] Creating directories for 'xblas_build'
[ 2%] Performing download step for 'xblas_build'
[ 2%] No patch step for 'xblas_build'
[ 2%] No update step for 'xblas_build'
[ 2%] No configure step for 'xblas_build'
[ 2%] Performing build step for 'xblas_build'
BLAS_error.c:1:10: fatal error: 'stdio.h' file not found
#include <stdio.h>
         ^~~~~~~~~
1 error generated.
make[4]: *** [BLAS_error.o] Error 1
make[3]: *** [common-lib] Error 2
make[2]: *** [AmberTools/src/xblas/src/xblas_build-stamp/xblas_build-build] Error 2
make[1]: *** [AmberTools/src/xblas/CMakeFiles/xblas_build.dir/all] Error 2
make: *** [all] Error 2

Which turns out to be the the old deprecated /usr/inlcude fodler, which is now "unpatchable" with the new Xcode as there has been major deprecation.

So it seems that I cannot manage to compile amber20 at the moment and there needs to be some additional energy put into getting it to work, on my system at least. Potentially I'll install llvm to get another clang version which might have the correct include files.

// Gustaf


________________________________
Från: Gustaf Olsson
Skickat: den 5 maj 2020 10:38:13
Till: AMBER Mailing List
Ämne: SV: AmberTools20 comilation on macOS


So it was really not that complicated


"On another note, is there any way to define which compilers to use on the CLI (like before with configure gnu)? I assume I could remove the " For macOS:" check (or uninstall in run-cmake and the assumption will be that I am building under linux? It would be nice to try to build using gnu gcc if clang keeps failing."


./quick_cmake_install -mpi -openmp GNU


Trying this now


// Gus

________________________________
Från: Gustaf Olsson
Skickat: den 5 maj 2020 10:22:42
Till: AMBER Mailing List
Ämne: SV: AmberTools20 comilation on macOS


No dice, still failing on metatwist

________________________________
Från: Gustaf Olsson <gustaf.olsson.lnu.se>
Skickat: den 5 maj 2020 10:07:11
Till: AMBER Mailing List
Ämne: [AMBER] AmberTools20 comilation on macOS

So it's that time of the year again! New amber release, exciting.


Sadly, I am already running into problems though this is part of the fun isn't it?


Im currently installing on:

    macOS Mojave 10.14.6
    Xcode 11.3.1 (11C504)

Following the manual produces an error for metatwist


    Undefined symbols for architecture x86_64:



    "boost::re_detail_107200::raw_storage::insert(unsigned long, unsigned long)", referenced from:
          boost::re_detail_107200::basic_regex_parser<char, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::parse_repeat(unsigned long, unsigned long) in metatwist.cpp.o
    ....
    ....
    ld: symbol(s) not found for architecture x86_64
    clang: error: linker command failed with exit code 1 (use -v to see invocation)
    make[2]: *** [AmberTools/src/moft/metatwist] Error 1
    make[1]: *** [AmberTools/src/moft/CMakeFiles/metatwist.dir/all] Error 2
    make: *** [all] Error 2

This is using the built in (xcode) compilers. There seems to be a problem with "boost" and if I am not mistaken, there was a problem with boost and the mac GCC (clang) compiler earlier?

Checking the run_cmake file provided some additional insight:

    # For macOS:

      if [ -x /Applications/CMake.app/Contents/bin/cmake ]; then
         cmake=/Applications/CMake.app/Contents/bin/cmake
      else
         cmake=cmake
      fi

Applications/CMake.app is not present by default. Hence this test "fails" and sets cmake=cmake. Using a package manager (for me homebrew) I have cmake in /usr/local/bin/. This might create further problems as I suspect this package may not have been built with mac clang.

I do not have a running VM or "virgin macOS" so I cannot confirm if cmake is installed at all with xcode and the GUI cmake that run_cmake checks for is not there by default. This might be a problem and the "prerequisites" should likely indicate that you need to install CMake.app (https://cmake.org/install/) or using macports or homebrew.<https://cmake.org/install/>

Maybe the test for OS could use something like "sw_vers" or "system_profiler SPSoftwareDataType" to find not only of it is macOS (OS X) though even the version of the OS?


I'll try to install CMake.app and attempt to compile again though I suspect that the boost issue will not be solved by having CMake.app installed.

During the configuration stage, I also notice that the script does not find open-mpi or mkl libraries, even if these are installed. I assume there might be a need for some "hands on" convincing regarding parallelization.

On another note, is there any way to define which compilers to use on the CLI (like before with configure gnu)? I assume I could remove the " For macOS:" check (or uninstall in run-cmake and the assumption will be that I am building under linux? It would be nice to try to build using gnu gcc if clang keeps failing.

Best regards
// Gustaf

_______________________________________________
AMBER mailing list
AMBER.ambermd.org
http://lists.ambermd.org/mailman/listinfo/amber
_______________________________________________
AMBER mailing list
AMBER.ambermd.org
http://lists.ambermd.org/mailman/listinfo/amber
Received on Tue May 05 2020 - 03:00:02 PDT
Custom Search