-
Notifications
You must be signed in to change notification settings - Fork 99
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
53 lines (50 loc) · 2 KB
/
Copy pathCMakeLists.txt
File metadata and controls
53 lines (50 loc) · 2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# Add example executable
link_directories(/data/OpenCMISS/install/x86_64_linux/intel-C17.0-intel-F17.0/intel_release/lib)
add_executable(MonodomainFortran src/FortranExample.f90)
# Turn on Fortran preprocessing (#include directives)
if (MSVC)
set(PROC_OPT "/fpp")
else()
set(PROC_OPT "-cpp")
endif()
target_compile_options(MonodomainFortran PRIVATE ${PROC_OPT})
# Link to opencmiss
# -----------------
#
# This simply uses the opencmiss target created by OC_INIT() above.
#
# Alternatively, you can also directly invoke 'find_package(Iron <IRON_VERSION>)' to explicitly
# require that version. But then you have to deal with setting up the correct MPI include directives and library paths.
#
# If required, add any other required link libraries (cellml, petsc ..) here, too.
# For example, if you needed PetSC functionality, issue
#
# find_package(PETSC <PETSC_VERSION> REQUIRED)
# target_link_libraries(${EXAMPLE_BINARY} PRIVATE petsc)
#
# All the OpenCMISS dependencies provide a target you can link against corresponding to the (lowercase) component name.
target_link_libraries(MonodomainFortran PRIVATE libirond.so)
target_include_directories(MonodomainFortran
PRIVATE /data/OpenCMISS/install/x86_64_linux/intel-C17.0-intel-F17.0/intel_release/include/opencmiss)
target_include_directories(MonodomainFortran PRIVATE /opt/intel/compilers_and_libraries_2017.1.132/linux/mpi/intel64/include)
# Add a simple test that runs the executable
add_test(NAME MonodomainFortranTest COMMAND MonodomainFortran)
#add_opencmiss_environment(MonodomainFortranTest)
###################
# Developer notice!
#
# If you write Fortran code and use MPI, you need to use the following MPI directives:
#
# #ifndef NOMPIMOD
# USE MPI
# #endif
# [...]
# IMPLICIT NONE
# [...]
# #ifdef NOMPIMOD
# #include "mpif.h"
# #endif
#
# Reasoning: In some cases like Windows/MPICH2 there sometimes is no mpi.mod file. In order to yet make
# the example work the build system adds the definition 'NOMPIMOD', which can be checked and acted to accordingly.
#