Skip to content

Commit

Permalink
add debug option CMakeList
Browse files Browse the repository at this point in the history
  • Loading branch information
imronuke committed Sep 21, 2022
1 parent c326ebe commit f4711be
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,14 +1,20 @@
cmake_minimum_required(VERSION 3.15)

option(GPU "Use OpenACC GPU " OFF)
option(GPU "Use OpenACC GPU " OFF)
option(DEBUG "DEBUGGING MODE " OFF)

# Set for debug only
if(GPU)
set(CMAKE_Fortran_FLAGS "-fast -ta=tesla:lineinfo -Minfo=accel,ccff -Mfree -Mpreprocess -Mbackslash")
set(CMAKE_Fortran_COMPILER nvfortran )
else()
set(CMAKE_Fortran_FLAGS "-cpp -O3")
set(CMAKE_Fortran_COMPILER gfortran )
if(DEBUG)
set(CMAKE_Fortran_FLAGS "-cpp -fbacktrace -g -pedantic -fbounds-check -ffpe-trap=invalid,overflow,underflow")
set(CMAKE_Fortran_COMPILER gfortran )
else()
set(CMAKE_Fortran_FLAGS "-cpp -O4")
set(CMAKE_Fortran_COMPILER gfortran )
endif()
endif()

project(komodo Fortran)
Expand Down

0 comments on commit f4711be

Please sign in to comment.