[AMBER] Defining/Selecting BLAS with cmake

From: Gustaf Olsson <gustaf.olsson.lnu.se>
Date: Mon, 10 Aug 2020 10:19:03 +0000

So, I have for some time tried to do a full gnu gcc build on macOS to get openmpi support. I am using the homebrew package manager on macOS.

I kept running into an error:

[ 3%] Performing build step for 'xblas_build'
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

I could not figure out why Xcode was being called, though finally a slight light came on somewhere. It fails on “blas”. I assume that the “macAccelerate” files are auto-detected instead of the “brew installed” OpenBLAS files. I am guessing that the FindBLAS/FindLAPACK might be involved at some stage though I am too much of a novice to have any real idea on how to solve this.

Installing OpenBLAS with homebrew will not “link” them, meaning they are installed but not used unless specifically defined. As suggested I tried

    $ export LDFLAGS="-L/usr/local/opt/openblas/lib" && export CPPFLAGS="-I/usr/local/opt/openblas/include"

Though this did not solve the issue. I also tried specifying “Generic/OpenBLAS/All” in run_cmake which did not work wither.

So I am now curious if there is any way to specifically (with some -D option) point cmake to BLAS during cmake configuration? I am likely missing something like “BLAS_HOME” or something.

Or potentially use something like this (https://stackoverflow.com/questions/39748767/find-blas-include-directory-with-cmake) to identify alternative BLAS installs? If these are found, should you not be able to use -DBLA_VENDOR=OpenBLAS in “run_cmake"?

Best regards
// Gustaf

AMBER mailing list
Received on Mon Aug 10 2020 - 03:30:02 PDT
Custom Search