Skip to content
This repository was archived by the owner on Aug 28, 2024. It is now read-only.

Commit

Permalink
Fixed parallelization flag generation so code can compile with OpenMP
Browse files Browse the repository at this point in the history
  • Loading branch information
daminton committed Nov 17, 2022
1 parent c24116b commit e6319df
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
3 changes: 1 addition & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
10 changes: 4 additions & 6 deletions cmake/Modules/FindOpenMP_Fortran.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -42,8 +42,6 @@ SET (OpenMP_Fortran_FLAG_CANDIDATES
"+Oopenmp"
#IBM XL C/c++
"-qsmp"
#Portland Group
"-mp"
)

IF (DEFINED OpenMP_Fortran_FLAGS)
Expand Down

0 comments on commit e6319df

Please sign in to comment.