From e6319df7091ae9a19cba17b7f9d501fe5014601b Mon Sep 17 00:00:00 2001 From: David A Minton Date: Thu, 17 Nov 2022 11:01:40 -0500 Subject: [PATCH] Fixed parallelization flag generation so code can compile with OpenMP --- CMakeLists.txt | 3 +-- cmake/Modules/FindOpenMP_Fortran.cmake | 10 ++++------ 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 255faac9c..3125fc3e2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -30,7 +30,7 @@ ENDIF(NOT CMAKE_Fortran_COMPILER_SUPPORTS_F90) # Set some options the user may choose # Uncomment the below if you want the user to choose a parallelization library OPTION(USE_MPI "Use the MPI library for parallelization" OFF) -OPTION(USE_OPENMP "Use OpenMP for parallelization" OFF) +OPTION(USE_OPENMP "Use OpenMP for parallelization" ON) # This INCLUDE statement executes code that sets the compile flags for DEBUG, # RELEASE, and TESTING. You should review this file and make sure the flags @@ -40,7 +40,6 @@ INCLUDE(${CMAKE_MODULE_PATH}/SetFortranFlags.cmake) # taken care of here, such as the fact that the FindOpenMP routine doesn't know # about Fortran. INCLUDE(${CMAKE_MODULE_PATH}/SetParallelizationLibrary.cmake) - INCLUDE(${CMAKE_MODULE_PATH}/SetUpNetCDF.cmake) # There is an error in CMAKE with this flag for pgf90. Unset it diff --git a/cmake/Modules/FindOpenMP_Fortran.cmake b/cmake/Modules/FindOpenMP_Fortran.cmake index c8e0ca2b4..32777569e 100644 --- a/cmake/Modules/FindOpenMP_Fortran.cmake +++ b/cmake/Modules/FindOpenMP_Fortran.cmake @@ -26,14 +26,14 @@ INCLUDE (${CMAKE_ROOT}/Modules/FindPackageHandleStandardArgs.cmake) SET (OpenMP_Fortran_FLAG_CANDIDATES - #Microsoft Visual Studio - "/openmp" - #Intel windows - "/Qopenmp" #Intel "-qopenmp" + #Intel windows + "/Qopenmp" #Gnu "-fopenmp" + #Portland Group + "-mp" #Empty, if compiler automatically accepts openmp " " #Sun @@ -42,8 +42,6 @@ SET (OpenMP_Fortran_FLAG_CANDIDATES "+Oopenmp" #IBM XL C/c++ "-qsmp" - #Portland Group - "-mp" ) IF (DEFINED OpenMP_Fortran_FLAGS)