Skip to content

Commit

Permalink
Correcting OpenMp flag : pull request #5
Browse files Browse the repository at this point in the history
  • Loading branch information
Goul-tard committed Nov 8, 2024
1 parent 734fc7f commit b2e333a
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,15 +1,7 @@
cmake_minimum_required(VERSION 3.4...3.31) # specifying a minimum CMake version
project(demeter) # set the project name

set(CMAKE_CXX_STANDARD 14) # specifying the C++ Standard
set(GCC_COVERAGE_COMPILE_FLAGS "-Wall -Wextra -pedantic") # probably not the best variable name
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${GCC_COVERAGE_COMPILE_FLAGS} ${OpenMP_CXX_FLAGS} ${OpenMP_CXX_LIB_NAMES}")

set(CMAKE_CXX_FLAGS_RELEASE "-O3 -march=native -DNDEBUG")
set(CMAKE_CXX_FLAGS_DEBUG "-g -fsanitize=address,undefined")

# include_directories(include)

# OpenMP
find_package(OpenMP)
set(LINK_LIBS ${LINK_LIBS} ${OpenMP_CXX_LIBRARIES})
Expand All @@ -18,6 +10,12 @@ set(LINK_LIBS ${LINK_LIBS} ${OpenMP_CXX_LIBRARIES})
find_package(Eigen3 3.3 REQUIRED NO_MODULE)
set(LINK_LIBS ${LINK_LIBS} Eigen3::Eigen)

set(CMAKE_CXX_STANDARD 14) # specifying the C++ Standard
set(GCC_COVERAGE_COMPILE_FLAGS "-Wall -Wextra -pedantic") # probably not the best variable name
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${GCC_COVERAGE_COMPILE_FLAGS} ${OpenMP_CXX_FLAGS} ${OpenMP_CXX_LIB_NAMES}")

set(CMAKE_CXX_FLAGS_RELEASE "-O3 -march=native -DNDEBUG")
set(CMAKE_CXX_FLAGS_DEBUG "-g -fsanitize=address,undefined")

# Executables
add_executable(main examples/main.cpp) # create an executable using the specified file
Expand Down

0 comments on commit b2e333a

Please sign in to comment.