Re: [AMBER] Probmlems compiling under macOS

From: Gustaf Olsson <gustaf.olsson.lnu.se>
Date: Wed, 10 Feb 2021 10:32:47 +0000

I’m just submitting this for “safekeeping” so I can find it next time I run into problems, this concerns amber compile on macOS using the homebrew package manager

Install prerequisites:
    brew install gcc.9 gsed open-mpi

Important! If boost/netcdf is installed using brew:
    brew unlink boost netcdf

Most important is boost as it uses gcc10 and breaks compilation using gcc9, where amber/ambertools is not yet gcc10 compatible

    tar xvf AmberTools20.tar.bz2
    cd amber20_src
    ./update_amber --update
    gsed -i '/\extern int yyparse();/a int yyerror( char *sStr );\nint yylex();' AmberTools/src/leap/src/leap/parser.y
    cd build

## SERIAL
Edit amber20_src/build/run_cmake:
 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

    ./run_cmake
    make install

## PARALLELL
In the edited amber20_src/build/run_cmake, switch:
-DMPI=FALSE to -DMPI=TRUE

    ./run_cmake
    make install

Best regards
// Gustaf

> On 9 Feb 2021, at 16:42, Gustaf Olsson <gustaf.olsson.lnu.se> wrote:
>
> Serial compilation finished, parallel compilation running now. Seems to have done the trick.
>
> Thank you very much
> Best regards
> Gustaf
> ________________________________
> Från: David A Case <david.case.rutgers.edu>
> Skickat: den 9 februari 2021 14:30:57
> Till: AMBER Mailing List
> Ämne: Re: [AMBER] Probmlems compiling under macOS
>
> On Tue, Feb 09, 2021, Gustaf Olsson wrote:
>> In a freshly extracted tarball with all the updates applied: ./AmberTools/src/leap/src/leap/parser.y
>>
>> 196
>> 197
>> 198 extern OBJEKT oGetObject( char *sName );
>> 199 extern int yyparse();
>> 200 %}
>> 201
>
> Sorry that I was looking at the development branch code. Still, try adding
> the following two lines right after line 199 above:
>
> int yyerror( char *sStr );
> int yylex();
>
> ...thx...dac
>
>
> _______________________________________________
> 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

_______________________________________________
AMBER mailing list
AMBER.ambermd.org
http://lists.ambermd.org/mailman/listinfo/amber
Received on Wed Feb 10 2021 - 03:00:02 PST
Custom Search