Skip to content
Snippets Groups Projects
Commit 0a75c1eb authored by Rene Halver's avatar Rene Halver
Browse files

fixed some Fortran related bugs

parent 76d05d6c
No related branches found
No related tags found
1 merge request!8Refactor
Pipeline #53755 failed
......@@ -15,15 +15,16 @@ option(CM_ALL_AUTO_DOC "Enables creation of auto-documentation")
cmake_policy(SET CMP0004 OLD)
enable_language(CXX)
enable_language(C)
if (CM_ALL_USE_F08)
if (CM_ALL_FORTRAN)
enable_language(Fortran)
message(FATAL_ERROR "Flag for Fortran 08 MPI interface set, while Fortran interface is not enabled!")
endif (CM_ALL_FORTRAN)
endif (CM_ALL_USE_F08)
# set standards compliance flags
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
if (CM_ALL_FORTRAN)
enable_language(Fortran)
# todo(s.schulz): This should be extended for other compilers, if they
# support standard checking. The Intel Fortran compiler
# does not.
......@@ -34,7 +35,15 @@ else()
endif()
add_compile_options($<$<AND:$<COMPILE_LANGUAGE:Fortran>,$<Fortran_COMPILER_ID:GNU>>:-fbacktrace>)
add_compile_options($<$<AND:$<COMPILE_LANGUAGE:Fortran>,$<Fortran_COMPILER_ID:Intel>>:-traceback>)
endif (CM_ALL_FORTRAN)
# set standards compliance flags
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
if (CM_ALL_FORTRAN)
add_compile_options("$<$<AND:$<CONFIG:Debug>,$<COMPILE_LANGUAGE:Fortran>,$<Fortran_COMPILER_ID:GNU>>:-Wall;-Wextra>")
endif (CM_ALL_FORTRAN)
add_compile_options("$<$<AND:$<CONFIG:Debug>,$<COMPILE_LANGUAGE:C>,$<C_COMPILER_ID:GNU>>:-Wall;-Wextra>")
add_compile_options("$<$<AND:$<CONFIG:Debug>,$<COMPILE_LANGUAGE:CXX>,$<CXX_COMPILER_ID:GNU>>:-Wall;-Wextra>")
......@@ -46,7 +55,12 @@ project(ALL
# add custom find-scripts to module path
set(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake" ${CMAKE_MODULE_PATH})
find_package(MPI REQUIRED)
if (CM_ALL_FORTRAN)
find_package(MPI REQUIRED COMPONENTS CXX Fortran)
else()
find_package(MPI REQUIRED COMPONENTS CXX)
endif (CM_ALL_FORTRAN)
if(CM_ALL_VTK_OUTPUT)
message("Using VTK output")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment