From 8b15d09868340b645cea38901c5c7109bd2dc6f9 Mon Sep 17 00:00:00 2001 From: Dawid Jagiela Date: Wed, 7 Nov 2012 15:05:22 +0100 Subject: [PATCH] force legacy standard for gfortran --- source/cluster/unres/src/CMakeLists.txt | 2 +- source/cluster/wham/src-M/CMakeLists.txt | 2 +- source/cluster/wham/src/CMakeLists.txt | 2 +- source/maxlik/src_CSA/CMakeLists.txt | 29 ++++++++++++++++++++--------- source/unres/src_CSA/CMakeLists.txt | 7 +++---- source/unres/src_CSA_DiL/CMakeLists.txt | 9 ++++----- source/unres/src_MD-M/CMakeLists.txt | 10 ++++------ source/unres/src_MIN/CMakeLists.txt | 8 ++++---- source/wham/src-M/CMakeLists.txt | 2 +- source/wham/src/CMakeLists.txt | 2 +- 10 files changed, 40 insertions(+), 33 deletions(-) diff --git a/source/cluster/unres/src/CMakeLists.txt b/source/cluster/unres/src/CMakeLists.txt index fa3c5f5..e4e43fc 100644 --- a/source/cluster/unres/src/CMakeLists.txt +++ b/source/cluster/unres/src/CMakeLists.txt @@ -46,7 +46,7 @@ set(UNRES_CLUSTER_PP_SRC if (Fortran_COMPILER_NAME STREQUAL "ifort") set(FFLAGS0 "-ip -w -I." ) elseif (Fortran_COMPILER_NAME STREQUAL "gfortran") - set(FFLAGS0 "-I. " ) + set(FFLAGS0 "-std=legacy -I. " ) endif (Fortran_COMPILER_NAME STREQUAL "ifort") diff --git a/source/cluster/wham/src-M/CMakeLists.txt b/source/cluster/wham/src-M/CMakeLists.txt index cd8871c..ddd438c 100644 --- a/source/cluster/wham/src-M/CMakeLists.txt +++ b/source/cluster/wham/src-M/CMakeLists.txt @@ -64,7 +64,7 @@ set(UNRES_CLUSTER_WHAM_M_PP_SRC if (Fortran_COMPILER_NAME STREQUAL "ifort") set(FFLAGS0 "-ip -w -I. -I${CMAKE_CURRENT_SOURCE_DIR}/include_unres" ) elseif (Fortran_COMPILER_NAME STREQUAL "gfortran") - set(FFLAGS0 "-I. -I${CMAKE_CURRENT_SOURCE_DIR}/include_unres" ) + set(FFLAGS0 "-std=legacy -I. -I${CMAKE_CURRENT_SOURCE_DIR}/include_unres" ) endif (Fortran_COMPILER_NAME STREQUAL "ifort") # Add MPI compiler flags diff --git a/source/cluster/wham/src/CMakeLists.txt b/source/cluster/wham/src/CMakeLists.txt index 500144b..17a7ef6 100644 --- a/source/cluster/wham/src/CMakeLists.txt +++ b/source/cluster/wham/src/CMakeLists.txt @@ -62,7 +62,7 @@ set(UNRES_CLUSTER_WHAM_PP_SRC if (Fortran_COMPILER_NAME STREQUAL "ifort") set(FFLAGS0 "-ip -w -I. -I${CMAKE_CURRENT_SOURCE_DIR}/include_unres " ) elseif (Fortran_COMPILER_NAME STREQUAL "gfortran") - set(FFLAGS0 "-I. -I${CMAKE_CURRENT_SOURCE_DIR}/include_unres " ) + set(FFLAGS0 "-std=legacy -I. -I${CMAKE_CURRENT_SOURCE_DIR}/include_unres " ) endif (Fortran_COMPILER_NAME STREQUAL "ifort") # Add MPI compiler flags diff --git a/source/maxlik/src_CSA/CMakeLists.txt b/source/maxlik/src_CSA/CMakeLists.txt index f87497f..933c70f 100644 --- a/source/maxlik/src_CSA/CMakeLists.txt +++ b/source/maxlik/src_CSA/CMakeLists.txt @@ -10,24 +10,35 @@ enable_language (Fortran) #================================ set(MAXLIK_SRC0 cored.f -# maxlik-opt-el.f -# maxlik-opt.f maxlik-opt-multprot.f -# maxlik-opt-tmscore.f minsumsl.f rmdd.f sumsld.f ) -set(MAXLIK_BIN "maxlik-opt-multprot") -set(OPT "-g -fbounds-check") -set(OPT1"-O") -set(FFLAGS "-c ${OPT} -I.") -set(FFLAGS1 "-c ${OPT1} -I.") +#================================================ +# Set comipiler flags for different sourcefiles +#================================================ + if (Fortran_COMPILER_NAME STREQUAL "ifort") + set(FFLAGS0 "-c -g -fbounds-check -I." ) + set(FFLAGS1 "-c -I." ) + elseif (Fortran_COMPILER_NAME STREQUAL "gfortran") + set(FFLAGS0 "-std=legacy -c -g -fbounds-check -I." ) + set(FFLAGS1 "-std=legacy -c -I." ) +endif (Fortran_COMPILER_NAME STREQUAL "ifort") +#========================================= +# System specific flags +#========================================= +if(${CMAKE_SYSTEM_NAME} MATCHES "Linux") + set(CPPFLAGS "${CPPFLAGS} -DLINUX") +endif(${CMAKE_SYSTEM_NAME} MATCHES "Linux") -set(CPPFLAGS "-DLINUX") +#========================================= +# Set binary name +#========================================= +set(MAXLIK_BIN "maxlik-opt-multprot") #========================================= diff --git a/source/unres/src_CSA/CMakeLists.txt b/source/unres/src_CSA/CMakeLists.txt index e5adc02..c48ae1e 100644 --- a/source/unres/src_CSA/CMakeLists.txt +++ b/source/unres/src_CSA/CMakeLists.txt @@ -109,10 +109,9 @@ if (Fortran_COMPILER_NAME STREQUAL "ifort") #set(FFLAGS3 "-c -w -O3 -ipo -ipo_obj -opt_report" ) set(FFLAGS3 "-c -w -ipo " ) elseif (Fortran_COMPILER_NAME STREQUAL "gfortran") - set(FFLAGS0 "-cpp -c -I. ") - set(FFLAGS1 "-cpp -c -g -I. " ) - set(FFLAGS2 "-cpp -c -I. ") - #set(FFLAGS3 "-c -w -O3 -ipo -ipo_obj -opt_report" ) + set(FFLAGS0 "-std=legacy -cpp -c -I. ") + set(FFLAGS1 "-std=legacy -cpp -c -g -I. " ) + set(FFLAGS2 "-std=legacy -cpp -c -I. ") set(FFLAGS3 "-cpp -c -I. " ) endif (Fortran_COMPILER_NAME STREQUAL "ifort") diff --git a/source/unres/src_CSA_DiL/CMakeLists.txt b/source/unres/src_CSA_DiL/CMakeLists.txt index b394f5c..66451c1 100644 --- a/source/unres/src_CSA_DiL/CMakeLists.txt +++ b/source/unres/src_CSA_DiL/CMakeLists.txt @@ -109,11 +109,10 @@ if (Fortran_COMPILER_NAME STREQUAL "ifort") #set(FFLAGS3 "-c -w -O3 -ipo -ipo_obj -opt_report" ) set(FFLAGS3 "-c -w -ipo " ) elseif (Fortran_COMPILER_NAME STREQUAL "gfortran") - set(FFLAGS0 "-cpp -c -I. ") - set(FFLAGS1 "-cpp -c -g -I. " ) - set(FFLAGS2 "-cpp -c -I. ") - #set(FFLAGS3 "-c -w -O3 -ipo -ipo_obj -opt_report" ) - set(FFLAGS3 "-cpp -c -I. " ) + set(FFLAGS0 "-std=legacy -cpp -c -I. ") + set(FFLAGS1 "-std=legacy -cpp -c -g -I. " ) + set(FFLAGS2 "-std=legacy -cpp -c -I. ") + set(FFLAGS3 "-std=legacy -cpp -c -I. " ) endif (Fortran_COMPILER_NAME STREQUAL "ifort") diff --git a/source/unres/src_MD-M/CMakeLists.txt b/source/unres/src_MD-M/CMakeLists.txt index 22829b6..63137a5 100644 --- a/source/unres/src_MD-M/CMakeLists.txt +++ b/source/unres/src_MD-M/CMakeLists.txt @@ -176,14 +176,12 @@ if (Fortran_COMPILER_NAME STREQUAL "ifort") set(FFLAGS0 "-ip -w" ) set(FFLAGS1 "-w -g -d2 -CA -CB" ) set(FFLAGS2 "-w -g -00 ") - #set(FFLAGS3 "-c -w -O3 -ipo -ipo_obj -opt_report" ) set(FFLAGS3 "-w -ipo " ) elseif (Fortran_COMPILER_NAME STREQUAL "gfortran") - set(FFLAGS0 "-I. " ) - set(FFLAGS1 "-g -I. " ) - set(FFLAGS2 "-I. ") - #set(FFLAGS3 "-c -w -O3 -ipo -ipo_obj -opt_report" ) - set(FFLAGS3 "-I. " ) + set(FFLAGS0 "-std=legacy -I. " ) + set(FFLAGS1 "-std=legacy -g -I. " ) + set(FFLAGS2 "-std=legacy -I. ") + set(FFLAGS3 "-std=legacy -I. " ) endif (Fortran_COMPILER_NAME STREQUAL "ifort") diff --git a/source/unres/src_MIN/CMakeLists.txt b/source/unres/src_MIN/CMakeLists.txt index ba79e61..37a2683 100644 --- a/source/unres/src_MIN/CMakeLists.txt +++ b/source/unres/src_MIN/CMakeLists.txt @@ -125,10 +125,10 @@ if (Fortran_COMPILER_NAME STREQUAL "ifort") set(FFLAGS2 "-w -g -00 ") set(FFLAGS3 "-g -w -ipo " ) elseif (Fortran_COMPILER_NAME STREQUAL "gfortran") - set(FFLAGS0 "-O" ) - set(FFLAGS1 "-g -C" ) - set(FFLAGS2 "-g -O0 ") - set(FFLAGS3 "-O3" ) + set(FFLAGS0 "-std=legacy -O " ) + set(FFLAGS1 "-std=legacy -g -C" ) + set(FFLAGS2 "-std=legacy -g -O0 ") + set(FFLAGS3 "-std=legacy -O3" ) endif (Fortran_COMPILER_NAME STREQUAL "ifort") diff --git a/source/wham/src-M/CMakeLists.txt b/source/wham/src-M/CMakeLists.txt index a91829e..c788207 100644 --- a/source/wham/src-M/CMakeLists.txt +++ b/source/wham/src-M/CMakeLists.txt @@ -98,7 +98,7 @@ set(UNRES_WHAM_M_PP_SRC if (Fortran_COMPILER_NAME STREQUAL "ifort") set(FFLAGS0 "-g -CB -I. -I${CMAKE_CURRENT_SOURCE_DIR}/include_unres -I${MPIF_INCLUDE_DIRECTORIES}" ) elseif (Fortran_COMPILER_NAME STREQUAL "gfortran") - set(FFLAGS0 "-g -I. -I${CMAKE_CURRENT_SOURCE_DIR}/include_unres -I${MPIF_INCLUDE_DIRECTORIES}" ) + set(FFLAGS0 "-std=legacy -g -I. -I${CMAKE_CURRENT_SOURCE_DIR}/include_unres -I${MPIF_INCLUDE_DIRECTORIES}" ) endif (Fortran_COMPILER_NAME STREQUAL "ifort") diff --git a/source/wham/src/CMakeLists.txt b/source/wham/src/CMakeLists.txt index 5565fff..aca8eb4 100644 --- a/source/wham/src/CMakeLists.txt +++ b/source/wham/src/CMakeLists.txt @@ -94,7 +94,7 @@ set(UNRES_WHAM_PP_SRC if (Fortran_COMPILER_NAME STREQUAL "ifort") set(FFLAGS0 "-mcmodel=medium -g -CB -I. -I${CMAKE_CURRENT_SOURCE_DIR}/include_unres" ) elseif (Fortran_COMPILER_NAME STREQUAL "gfortran") - set(FFLAGS0 "-g -I. -I${CMAKE_CURRENT_SOURCE_DIR}/include_unres" ) + set(FFLAGS0 "-std=legacy -g -I. -I${CMAKE_CURRENT_SOURCE_DIR}/include_unres" ) endif (Fortran_COMPILER_NAME STREQUAL "ifort") -- 1.7.9.5