[AMBER] Compiling AmberTools on macOS

From: Gustaf Olsson <gustaf.olsson.lnu.se>
Date: Wed, 12 Aug 2020 14:08:23 +0000

So, for personal “safekeeping” and general information. As far as I can se, the method below is reproducible for compiling (AmberTools20) AT20 (and I’m guessing amber20 as well as I do not yet have a licence) on:

    macOS Mojave Version 10.14.6 (18G4032)
    Xcode Version 11.3.1 (11C504)

As well as the latest

    macOS Catalina Version 10.15.6 (19G73) and whatever the most recent Xcode version is as of August 2020.

Using the Homebrew package manager. I suppose it is important to mention that you follow these instructions on your own risk. I have tested this several times though I take no responsibility for the outcome and can leave no guarantees that it will work for you and will not cause any problems.



First, check out: http://ambermd.org/InstMacOS.php

Then, get a hold of the AT20 tarball.

Install the homebrew package manager

Regardless of what you do already have installed regarding alternative gfortran/gcc packages, you must make sure you have installed gcc9

    brew install gcc.9

Wherever you plan on compiling AT, place the tarball and:
    tar xvf AmberTools20.tar.bz2
    cd amber20_src/build

Edit the "../cmake/LibraryUtils.cmake” file replacing:

    75 message(FATAL_ERROR "Could not determine whether \"${LIBRARY}\" is a static or shared library, it does not have a known suffix.")
    -->
    75 set(LIB_TYPE SHARED)

With an editor of your choice.

For the serial version, edit the “run_cmake” file

     28 $cmake $AMBER_PREFIX/amber20_src \
     29 -DCMAKE_INSTALL_PREFIX=$AMBER_PREFIX/amber20 \
     30 -DCOMPILER=CLANG -DBLA_VENDOR=Apple \
     31 -DMPI=FALSE -DCUDA=FALSE -DINSTALL_TESTS=TRUE \
     32 -DDOWNLOAD_MINICONDA=TRUE -DMINICONDA_USE_PY3=TRUE \
     33 2>&1 | tee cmake.log
—>
     28 $cmake $AMBER_PREFIX/amber20_src \
     29 -DCMAKE_INSTALL_PREFIX=$AMBER_PREFIX/amber20 \
     30 -DCOMPILER=MANUAL -DBLA_VENDOR=Apple \
     31 -DMPI=FALSE -DCUDA=FALSE -DINSTALL_TESTS=TRUE \
     32 -DDOWNLOAD_MINICONDA=TRUE -DMINICONDA_USE_PY3=TRUE \
     33 -DCMAKE_C_COMPILER=/usr/bin/clang \
     34 -DCMAKE_CXX_COMPILER=/usr/bin/clang++ \
     35 -DCMAKE_Fortran_COMPILER=/usr/local/bin/gfortran-9 \
     36 2>&1 | tee cmake.log

With the editor of your choice. Change whatever other things you feel comfortable with of course. This will install amber20 in the same directory as where you extracted the tarball. Then

    ./run_cmake

Hopefully done. For parallel compilation:

    brew install open-mpi

This is the stable 4.0.4 version, no other version is available currently.

This time, with you favourite editor, edit line 31 of your already modified “run_cmake” file

    31 -DMPI=FALSE -DCUDA=FALSE -DINSTALL_TESTS=TRUE \
—>
    31 -DMPI=TRUE -DCUDA=FALSE -DINSTALL_TESTS=TRUE \

And then

    ./run_cmake

There still is no support for the openmpi features of, amongst others, cpptraj with clang on macOS.

I have done this twice on two different systems although there might be conflicts or I might have different dependencies already installed and so fort. If you try this and it works for you, please do me a big favour and confirm here.

Next challenge will apparently be “macOS 11 ‘Big Sur’” so let's se what that update breaks. If nothing in between I guess the switch to ARM will be the next hurdle after that.

Best regards
// Gustaf
_______________________________________________
AMBER mailing list
AMBER.ambermd.org
http://lists.ambermd.org/mailman/listinfo/amber
Received on Wed Aug 12 2020 - 07:30:02 PDT
Custom Search