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

Commit

Permalink
Merge branch 'debug'
Browse files Browse the repository at this point in the history
  • Loading branch information
daminton committed Nov 17, 2022
2 parents 47423d6 + e6319df commit 4d7a721
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 15 deletions.
5 changes: 2 additions & 3 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 All @@ -54,7 +53,7 @@ ENDIF(FCNAME STREQUAL "pgf90")
############################################################

# Define the executable name
SET(FOOEXE swiftest_driver)
SET(SWIFTEST_DRIVER swiftest_driver)

# Define some directories
SET(SRC ${CMAKE_SOURCE_DIR}/src)
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
12 changes: 6 additions & 6 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -104,26 +104,26 @@ SET(FOO_src
)

# Define the executable in terms of the source files
ADD_EXECUTABLE(${FOOEXE} ${FOO_src})
ADD_EXECUTABLE(${SWIFTEST_DRIVER} ${FOO_src})

#####################################################
# Add the needed libraries and special compiler flags
#####################################################

# Uncomment if you need to link to BLAS and LAPACK
TARGET_LINK_LIBRARIES(${FOOEXE} ${NETCDF_LIBRARIES} ${NETCDF_FORTRAN_LIBRARIES})
TARGET_LINK_LIBRARIES(${SWIFTEST_DRIVER} ${NETCDF_LIBRARIES} ${NETCDF_FORTRAN_LIBRARIES})

# Uncomment if you have parallization
IF(USE_OPENMP)
SET_TARGET_PROPERTIES(${FOOEXE} PROPERTIES
SET_TARGET_PROPERTIES(${SWIFTEST_DRIVER} PROPERTIES
COMPILE_FLAGS "${OpenMP_Fortran_FLAGS}"
LINK_FLAGS "${OpenMP_Fortran_FLAGS}")
ELSEIF(USE_MPI)
SET_TARGET_PROPERTIES(${FOOEXE} PROPERTIES
SET_TARGET_PROPERTIES(${SWIFTEST_DRIVER} PROPERTIES
COMPILE_FLAGS "${MPI_Fortran_COMPILE_FLAGS}"
LINK_FLAGS "${MPI_Fortran_LINK_FLAGS}")
INCLUDE_DIRECTORIES(${MPI_Fortran_INCLUDE_PATH})
TARGET_LINK_LIBRARIES(${FOOEXE} ${MPI_Fortran_LIBRARIES})
TARGET_LINK_LIBRARIES(${SWIFTEST_DRIVER} ${MPI_Fortran_LIBRARIES})
ENDIF(USE_OPENMP)


Expand All @@ -137,4 +137,4 @@ IF(WIN32)
ELSE()
SET(CMAKE_INSTALL_PREFIX /usr/local)
ENDIF(WIN32)
INSTALL(TARGETS ${FOOEXE} RUNTIME DESTINATION bin)
INSTALL(TARGETS ${SWIFTEST_DRIVER} RUNTIME DESTINATION bin)

0 comments on commit 4d7a721

Please sign in to comment.