[AMBER] Setting compiler flags w/cmake build? Amber20/AmberTools21

From: Ryan Novosielski <novosirj.rutgers.edu>
Date: Sat, 18 Sep 2021 23:41:49 +0000

Hi all,

Trying to build with the Intel compilers and wanted to use auto vectorization, so I set:


But I ended up with this, which is definitely wrong:

-- **************************************************************************
-- Build Report
-- Compiler Flags:
-- C No-Opt: -O3 -xAVX -axCORE-AVX2 -O0
-- C Optimized: -O3 -xAVX -axCORE-AVX2 -ip -O3 -xHost
-- CXX No-Opt: -O3 -xAVX -axCORE-AVX2 -O0
-- CXX Optimized: -O3 -xAVX -axCORE-AVX2 -O3
-- Fortran No-Opt: -O3 -xAVX -axCORE-AVX2 -warn all -warn nounused -warn nointerfaces -O0
-- Fortran Optimized: -O3 -xAVX -axCORE-AVX2 -warn all -warn nounused -warn nointerfaces -ip -O3 -xHost

From looking at config.h, it seems like there’s a concept of CFLAGS vs. COPTFLAGS, etc. I definitely don’t want -xHost anywhere, because I’m trying to specify instruction sets explicitly, and I definitely don’t want to be adding optimizations to the non-optimized compiles.

Having read the manual, I can’t see anything about how to do this properly. Should I revert to the older “configure” style build, or have I just not found the right docs yet?

This is for CPU builds; I’m following the docs re: building the GPU builds with GCC. BTW, probably not worth an entire thread about this, but is that supposed to work reliably with GCC 11.x? I get failures on some builds on GCC >10.

|| \\UTGERS, |---------------------------*O*---------------------------
||_// the State | Ryan Novosielski - novosirj.rutgers.edu
|| \\ University | Sr. Technologist - 973/972.0922 (2x0922) ~*~ RBHS Campus
|| \\ of NJ | Office of Advanced Research Computing - MSB C630, Newark

AMBER mailing list
Received on Sat Sep 18 2021 - 17:00:02 PDT
Custom Search