-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgnu_espresso.cmake
51 lines (49 loc) · 1.63 KB
/
gnu_espresso.cmake
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
string(APPEND CFLAGS " -std=gnu99 -mcmodel=small")
if (compile_threaded)
string(APPEND CFLAGS " -fopenmp")
endif()
if (DEBUG)
string(APPEND CFLAGS " -g -Wall -Og -fbacktrace -ffpe-trap=invalid,zero,overflow -fcheck=bounds")
endif()
if (NOT DEBUG)
string(APPEND CFLAGS " -O2")
endif()
string(APPEND CPPDEFS " -DFORTRANUNDERSCORE -DNO_R16 -DCPRGNU")
set(CXX_LINKER "FORTRAN")
set(FC_AUTO_R8 "-fdefault-real-8 -fdefault-double-8")
string(APPEND FFLAGS " -fconvert=big-endian -ffree-line-length-none -ffixed-line-length-none -mcmodel=small")
if (compile_threaded)
string(APPEND FFLAGS " -fopenmp")
endif()
if (DEBUG)
string(APPEND FFLAGS " -g -Wall -Og -fbacktrace -ffpe-trap=zero,overflow -fcheck=bounds")
endif()
if (NOT DEBUG)
string(APPEND FFLAGS " -O2")
endif()
set(FFLAGS_NOOPT "-O0")
set(FIXEDFLAGS "-ffixed-form")
set(FREEFLAGS "-ffree-form")
set(HAS_F2008_CONTIGUOUS "FALSE")
if (compile_threaded)
string(APPEND LDFLAGS " -fopenmp")
endif()
set(MPICC "mpicc")
set(MPICXX "mpicxx")
set(MPIFC "mpif90")
set(SCC "gcc")
set(SCXX "g++")
set(SFC "gfortran")
set(SUPPORTS_CXX "TRUE")
set(NETCDF_PATH "/usr/local/netcdf")
set(PNETCDF_PATH "/usr/local/pnetcdf")
set(LIBSCI_PATH "/usr/local/anaconda")
set(PIO_FILESYSTEM_HINTS "lustre")
set(SLIBS "-L${NETCDF_PATH}/lib -lnetcdf -lnetcdff")
set(SLIBS "-L${PNETCDF_PATH}/lib -lpnetcdf")
set(SLIBS "-L${LIBSCI_PATH}/lib -lopenblas")
message("C compiler version is ${CMAKE_C_COMPILER_VERSION}")
message("Fortran compiler version is ${CMAKE_Fortran_COMPILER_VERSION}")
if (CMAKE_Fortran_COMPILER_VERSION VERSION_GREATER_EQUAL 10)
string(APPEND FFLAGS " -fallow-argument-mismatch -fallow-invalid-boz ")
endif()