Skip to content

CMake support added #105

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 28 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
b2b4f34
Added missing CMake files for Classical Field Laplace example
NewfieBullet Sep 17, 2016
93553a8
Fortran Classical Field Laplace example modified to work with MPI dec…
NewfieBullet Sep 18, 2016
1cc1df9
C version of Classical Field Laplace example enabled
NewfieBullet Sep 18, 2016
d90c386
renamed Fsi_Fortran environment variable to Laplace_Fortran
NewfieBullet Sep 18, 2016
aa8f744
fixed import opencmiss.iron call
Oct 10, 2016
9b2b8c4
Cmake build added for Bioelectrics/Monodomain example. Python example…
Oct 14, 2016
bf3180a
added CMAKE support to CellML and Bioelectrics examples
Oct 14, 2016
e3c231d
modified CellML Python examples to get them running again
Oct 14, 2016
f849779
added CMake support to Classical/AdvectionDiffusion examples
Oct 16, 2016
5b7db24
added CMAKE support for ClassicalField/Diffusion examples
Oct 16, 2016
7261ddb
Added CMake support to ClassicalField/Helmholtz example
Oct 16, 2016
dd47240
added CMake support for ClassicalField/Laplace examples
Oct 16, 2016
3d9f17f
added CMake support for ClassicalField/Poisson examples
Oct 17, 2016
2bb3abd
Added CMake support for ClassicalField/ReactionDiffusion examples
Oct 17, 2016
ec00df1
added CMake support for DataProjection examples
Oct 17, 2016
e250a7f
Added CMake support for EmbeddedMesh examples
Oct 17, 2016
99df08b
added CMake support for LinearElasticity example
Oct 17, 2016
17b4fc8
Added CMake support for DataAssimilation, TwoRegions, define-geometry…
Oct 17, 2016
ef8e7cc
Added CMake support for the FiniteElasticity examples
Oct 17, 2016
dceaa69
modified Fitting example to use current OpenCMISS build structure
Oct 17, 2016
a3255a1
added CMake support for the Fluid Dynamics examples
Oct 18, 2016
e4b99e6
added CMake support for the Interface examples
Oct 18, 2016
dd773a9
added CMake support for Meshes examples
Oct 18, 2016
1a0ff23
added CMake support for Multiphysics examples
Oct 18, 2016
91bfd17
moved input files for Laplace and Monodomain example to central direc…
Oct 20, 2016
aff9594
added corrected Guccione Cube example
Oct 31, 2016
7636f18
modified FiniteElasticity example to use multiple elements
Nov 1, 2016
5337f7d
added updated example SLURM job submission file
Nov 2, 2016
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 50 additions & 0 deletions Bioelectrics/Bidomain/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# Add example executable
add_executable(bidomain.x src/BidomainExample.f90)

# Turn on Fortran preprocessing (#include directives)
if (MSVC)
set(PROC_OPT "/fpp")
else()
set(PROC_OPT "-cpp")
endif()
target_compile_options(bidomain.x 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(bidomain.x PRIVATE opencmiss)

# Add a simple test that runs the executable
add_test(NAME BiDomain COMMAND bidomain.x)
add_opencmiss_environment(BiDomain)

###################
# 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.
#
71 changes: 0 additions & 71 deletions Bioelectrics/Bidomain/Makefile

This file was deleted.

File renamed without changes.
37 changes: 37 additions & 0 deletions Bioelectrics/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# OpenCMISS (Open Continuum Mechanics, Imaging, Signal processing and System identification)
# is a mathematical modelling environment that enables the application of finite element
# analysis techniques to a variety of complex bioengineering problems.
#
# The OpenCMISS project website can be found at http://www.opencmiss.org
# For more information see http://www.opencmiss.org/documentation

# Include the OpenCMISS initalisation & macro definition file.
include(../OpenCMISS.cmake)

# Project setup
# -------------
cmake_minimum_required(VERSION 3.3 FATAL_ERROR)
project(OpenCMISS-Example VERSION 1.0 LANGUAGES Fortran C)
enable_testing()

# Find OpenCMISS
# --------------
#
# This call tries to find a matching OpenCMISS (SDK) installation for your (default) Toolchain and MPI choice.
# Currently available OpenCMISS package components: Iron Zinc
# Requiring Iron will also include the iron_c bindings target if available.
#
# This function creates a link target 'opencmiss' that contains references to the requested OpenCMISS components.
# For Iron, it also adds the necessary MPI information - no further find_package(MPI ..) and setting of extra include
# paths needed!
find_package(OpenCMISS 1.1 REQUIRED COMPONENTS Iron CONFIG)

# CMake application code
# ----------------------
if (CMAKE_Fortran_COMPILER)
add_subdirectory(Bidomain)
add_subdirectory(Monodomain)
add_subdirectory(Monodomain_Shiqiang)
add_subdirectory(MonodomainTP06)
add_subdirectory(MonodomainBuenoOrovio)
endif()
50 changes: 50 additions & 0 deletions Bioelectrics/Monodomain/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# Add example executable
add_executable(monodomain.x Fortran/src/FortranExample.f90)

# Turn on Fortran preprocessing (#include directives)
if (MSVC)
set(PROC_OPT "/fpp")
else()
set(PROC_OPT "-cpp")
endif()
target_compile_options(monodomain.x 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(monodomain.x PRIVATE opencmiss)

# Add a simple test that runs the executable
add_test(NAME MonoDomain COMMAND monodomain.x)
add_opencmiss_environment(MonoDomain)

###################
# 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.
#
71 changes: 0 additions & 71 deletions Bioelectrics/Monodomain/Fortran/Makefile

This file was deleted.

Loading