diff --git a/42TestingPoints/SinglePhysics/LinearProblems/StaticProblems/Stokes/3D/HEX/QuadraticVelocityLinearPressure/LEVEL_3/100k/CMakeLists.txt b/42TestingPoints/SinglePhysics/LinearProblems/StaticProblems/Stokes/3D/HEX/QuadraticVelocityLinearPressure/LEVEL_3/100k/CMakeLists.txt new file mode 100644 index 00000000..a22b61ee --- /dev/null +++ b/42TestingPoints/SinglePhysics/LinearProblems/StaticProblems/Stokes/3D/HEX/QuadraticVelocityLinearPressure/LEVEL_3/100k/CMakeLists.txt @@ -0,0 +1,35 @@ +# 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 C) +enable_language(Fortran OPTIONAL) +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 +# ---------------------- +#add_subdirectory(C) +if (CMAKE_Fortran_COMPILER) + add_subdirectory(Fortran) +endif() diff --git a/42TestingPoints/SinglePhysics/LinearProblems/StaticProblems/Stokes/3D/HEX/QuadraticVelocityLinearPressure/LEVEL_3/100k/Fortran/CMakeLists.txt b/42TestingPoints/SinglePhysics/LinearProblems/StaticProblems/Stokes/3D/HEX/QuadraticVelocityLinearPressure/LEVEL_3/100k/Fortran/CMakeLists.txt new file mode 100644 index 00000000..807ede3e --- /dev/null +++ b/42TestingPoints/SinglePhysics/LinearProblems/StaticProblems/Stokes/3D/HEX/QuadraticVelocityLinearPressure/LEVEL_3/100k/Fortran/CMakeLists.txt @@ -0,0 +1,60 @@ + +# Add example executable +add_executable(100k src/100kExample.f90) + +# Turn on Fortran preprocessing (#include directives) +if (MSVC) + set(PROC_OPT "/fpp") +else() + set(PROC_OPT "-cpp") +endif() + +# in debug mode, add flag that make Floating point exceptions fatal +set(OPT "") +if (FALSE) + if(CMAKE_BUILD_TYPE MATCHES DEBUG) + set(OPT "-ffpe-trap=invalid,zero,underflow,overflow,denormal") # GCC: make floating point exceptions fatal + endif() +endif() + +target_compile_options(100k PRIVATE ${PROC_OPT} ${OPT} "-fbacktrace") + +# Link to opencmiss +# ----------------- +# +# This simply uses the opencmiss target created by OC_INIT() above. +# +# Alternatively, you can also directly invoke 'find_package(Iron )' 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 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(100k PRIVATE opencmiss) + +# Add a simple test that runs the executable +add_test(NAME test_100k COMMAND 100k) +add_opencmiss_environment(test_100k) + +################### +# 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. +# diff --git a/42TestingPoints/SinglePhysics/LinearProblems/StaticProblems/Stokes/3D/HEX/QuadraticVelocityLinearPressure/LEVEL_3/100k/src/100kExample.f90 b/42TestingPoints/SinglePhysics/LinearProblems/StaticProblems/Stokes/3D/HEX/QuadraticVelocityLinearPressure/LEVEL_3/100k/Fortran/src/100kExample.f90 similarity index 100% rename from 42TestingPoints/SinglePhysics/LinearProblems/StaticProblems/Stokes/3D/HEX/QuadraticVelocityLinearPressure/LEVEL_3/100k/src/100kExample.f90 rename to 42TestingPoints/SinglePhysics/LinearProblems/StaticProblems/Stokes/3D/HEX/QuadraticVelocityLinearPressure/LEVEL_3/100k/Fortran/src/100kExample.f90 diff --git a/42TestingPoints/SinglePhysics/LinearProblems/StaticProblems/Stokes/3D/HEX/QuadraticVelocityLinearPressure/LEVEL_3/100k/OpenCMISS.cmake b/42TestingPoints/SinglePhysics/LinearProblems/StaticProblems/Stokes/3D/HEX/QuadraticVelocityLinearPressure/LEVEL_3/100k/OpenCMISS.cmake new file mode 100644 index 00000000..3d6cf515 --- /dev/null +++ b/42TestingPoints/SinglePhysics/LinearProblems/StaticProblems/Stokes/3D/HEX/QuadraticVelocityLinearPressure/LEVEL_3/100k/OpenCMISS.cmake @@ -0,0 +1,95 @@ +########################### +# *DO NOT CHANGE THIS FILE* +########################### +# +# Prepares the use of OpenCMISS by scanning at various path locations for OpenCMISS (SDK) installations. +# +# Search order: +# - OPENCMISS_INSTALL_DIR variable +# - OPENCMISS_INSTALL_DIR environment variable +# - OPENCMISS_SDK_DIR variable +# - OPENCMISS_SDK_DIR environment variable +# - [Windows only] The Registry is searched additionally for installed SDKs. +# +# If found +# - Includes the toolchain config script of the found opencmiss installation to enable toolchain selection logic (non-windows) + +# Convenience: The OPENCMISS_INSTALL_DIR may also be defined in the environment and various other places +if (DEFINED OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using specified installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The specified OPENCMISS_INSTALL_DIR '${OPENCMISS_INSTALL_DIR}' does not exist. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_INSTALL_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_INSTALL_DIR}" OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using environment installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The environment variable OPENCMISS_INSTALL_DIR='${OPENCMISS_INSTALL_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if (NOT OPENCMISS_INSTALL_DIR AND DEFINED OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The specified OPENCMISS_SDK_DIR '${OPENCMISS_SDK_DIR}' does not exist. Skipping.") + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_SDK_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_SDK_DIR}" OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using environment SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The environment variable OPENCMISS_SDK_DIR='${OPENCMISS_SDK_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_SDK_DIR) + endif() +endif() +# On windows: check the registry for installed OpenCMISS SDKs +if(NOT OPENCMISS_INSTALL_DIR AND WIN32) + foreach(ROOT HKEY_CURRENT_USER HKEY_LOCAL_MACHINE) + foreach(PACKAGE OpenCMISSUserSDK OpenCMISSDeveloperSDK) + set(_REG_KEY "[${ROOT}\\Software\\Auckland Bioengineering Institute\\${PACKAGE}]") + get_filename_component(OPENCMISS_INSTALL_DIR "${_REG_KEY}" ABSOLUTE) + #message(STATUS "Trying registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Found ${PACKAGE} in Windows registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + break() + else() + unset(OPENCMISS_INSTALL_DIR) + endif() + endforeach() + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + break() + endif() + endforeach() +endif() + +if(OPENCMISS_INSTALL_DIR) + message(STATUS "OPENCMISS_INSTALL_DIR=${OPENCMISS_INSTALL_DIR}") + # Use the OpenCMISS scripts to also allow choosing a separate toolchain + # This file is located at the opencmiss installation rather than the local example + # as it avoids file replication and makes maintenance much easier + if (TOOLCHAIN) + set(_OCTC ${OPENCMISS_INSTALL_DIR}/cmake/OCToolchainCompilers.cmake) + if (EXISTS "${_OCTC}") + include(${_OCTC}) + else() + message(WARNING "TOOLCHAIN specified but OpenCMISS config script could not be found at ${_OCTC}. Trying CMake defaults.") + endif() + unset(_OCTC) + endif() + set(OpenCMISS_DIR "${OPENCMISS_INSTALL_DIR}" CACHE PATH "Path to the found OpenCMISS (SDK) installation") +else() + message(WARNING "No OpenCMISS (SDK) installation directory detected. Using default system environment.") +endif() + \ No newline at end of file diff --git a/42TestingPoints/SinglePhysics/LinearProblems/StaticProblems/Stokes/3D/HEX/QuadraticVelocityLinearPressure/LEVEL_3/100k/build_debug/build.sh b/42TestingPoints/SinglePhysics/LinearProblems/StaticProblems/Stokes/3D/HEX/QuadraticVelocityLinearPressure/LEVEL_3/100k/build_debug/build.sh new file mode 100644 index 00000000..e6624bac --- /dev/null +++ b/42TestingPoints/SinglePhysics/LinearProblems/StaticProblems/Stokes/3D/HEX/QuadraticVelocityLinearPressure/LEVEL_3/100k/build_debug/build.sh @@ -0,0 +1,2 @@ +#ccc && cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all +cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all diff --git a/42TestingPoints/SinglePhysics/LinearProblems/StaticProblems/Stokes/3D/HEX/QuadraticVelocityLinearPressure/LEVEL_3/10k/CMakeLists.txt b/42TestingPoints/SinglePhysics/LinearProblems/StaticProblems/Stokes/3D/HEX/QuadraticVelocityLinearPressure/LEVEL_3/10k/CMakeLists.txt new file mode 100644 index 00000000..a22b61ee --- /dev/null +++ b/42TestingPoints/SinglePhysics/LinearProblems/StaticProblems/Stokes/3D/HEX/QuadraticVelocityLinearPressure/LEVEL_3/10k/CMakeLists.txt @@ -0,0 +1,35 @@ +# 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 C) +enable_language(Fortran OPTIONAL) +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 +# ---------------------- +#add_subdirectory(C) +if (CMAKE_Fortran_COMPILER) + add_subdirectory(Fortran) +endif() diff --git a/42TestingPoints/SinglePhysics/LinearProblems/StaticProblems/Stokes/3D/HEX/QuadraticVelocityLinearPressure/LEVEL_3/10k/Fortran/CMakeLists.txt b/42TestingPoints/SinglePhysics/LinearProblems/StaticProblems/Stokes/3D/HEX/QuadraticVelocityLinearPressure/LEVEL_3/10k/Fortran/CMakeLists.txt new file mode 100644 index 00000000..f07a9d89 --- /dev/null +++ b/42TestingPoints/SinglePhysics/LinearProblems/StaticProblems/Stokes/3D/HEX/QuadraticVelocityLinearPressure/LEVEL_3/10k/Fortran/CMakeLists.txt @@ -0,0 +1,60 @@ + +# Add example executable +add_executable(10k src/10kExample.f90) + +# Turn on Fortran preprocessing (#include directives) +if (MSVC) + set(PROC_OPT "/fpp") +else() + set(PROC_OPT "-cpp") +endif() + +# in debug mode, add flag that make Floating point exceptions fatal +set(OPT "") +if (FALSE) + if(CMAKE_BUILD_TYPE MATCHES DEBUG) + set(OPT "-ffpe-trap=invalid,zero,underflow,overflow,denormal") # GCC: make floating point exceptions fatal + endif() +endif() + +target_compile_options(10k PRIVATE ${PROC_OPT} ${OPT} "-fbacktrace") + +# Link to opencmiss +# ----------------- +# +# This simply uses the opencmiss target created by OC_INIT() above. +# +# Alternatively, you can also directly invoke 'find_package(Iron )' 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 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(10k PRIVATE opencmiss) + +# Add a simple test that runs the executable +add_test(NAME test_10k COMMAND 10k) +add_opencmiss_environment(test_10k) + +################### +# 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. +# diff --git a/42TestingPoints/SinglePhysics/LinearProblems/StaticProblems/Stokes/3D/HEX/QuadraticVelocityLinearPressure/LEVEL_3/10k/src/10kExample.f90 b/42TestingPoints/SinglePhysics/LinearProblems/StaticProblems/Stokes/3D/HEX/QuadraticVelocityLinearPressure/LEVEL_3/10k/Fortran/src/10kExample.f90 similarity index 100% rename from 42TestingPoints/SinglePhysics/LinearProblems/StaticProblems/Stokes/3D/HEX/QuadraticVelocityLinearPressure/LEVEL_3/10k/src/10kExample.f90 rename to 42TestingPoints/SinglePhysics/LinearProblems/StaticProblems/Stokes/3D/HEX/QuadraticVelocityLinearPressure/LEVEL_3/10k/Fortran/src/10kExample.f90 diff --git a/42TestingPoints/SinglePhysics/LinearProblems/StaticProblems/Stokes/3D/HEX/QuadraticVelocityLinearPressure/LEVEL_3/10k/OpenCMISS.cmake b/42TestingPoints/SinglePhysics/LinearProblems/StaticProblems/Stokes/3D/HEX/QuadraticVelocityLinearPressure/LEVEL_3/10k/OpenCMISS.cmake new file mode 100644 index 00000000..3d6cf515 --- /dev/null +++ b/42TestingPoints/SinglePhysics/LinearProblems/StaticProblems/Stokes/3D/HEX/QuadraticVelocityLinearPressure/LEVEL_3/10k/OpenCMISS.cmake @@ -0,0 +1,95 @@ +########################### +# *DO NOT CHANGE THIS FILE* +########################### +# +# Prepares the use of OpenCMISS by scanning at various path locations for OpenCMISS (SDK) installations. +# +# Search order: +# - OPENCMISS_INSTALL_DIR variable +# - OPENCMISS_INSTALL_DIR environment variable +# - OPENCMISS_SDK_DIR variable +# - OPENCMISS_SDK_DIR environment variable +# - [Windows only] The Registry is searched additionally for installed SDKs. +# +# If found +# - Includes the toolchain config script of the found opencmiss installation to enable toolchain selection logic (non-windows) + +# Convenience: The OPENCMISS_INSTALL_DIR may also be defined in the environment and various other places +if (DEFINED OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using specified installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The specified OPENCMISS_INSTALL_DIR '${OPENCMISS_INSTALL_DIR}' does not exist. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_INSTALL_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_INSTALL_DIR}" OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using environment installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The environment variable OPENCMISS_INSTALL_DIR='${OPENCMISS_INSTALL_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if (NOT OPENCMISS_INSTALL_DIR AND DEFINED OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The specified OPENCMISS_SDK_DIR '${OPENCMISS_SDK_DIR}' does not exist. Skipping.") + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_SDK_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_SDK_DIR}" OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using environment SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The environment variable OPENCMISS_SDK_DIR='${OPENCMISS_SDK_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_SDK_DIR) + endif() +endif() +# On windows: check the registry for installed OpenCMISS SDKs +if(NOT OPENCMISS_INSTALL_DIR AND WIN32) + foreach(ROOT HKEY_CURRENT_USER HKEY_LOCAL_MACHINE) + foreach(PACKAGE OpenCMISSUserSDK OpenCMISSDeveloperSDK) + set(_REG_KEY "[${ROOT}\\Software\\Auckland Bioengineering Institute\\${PACKAGE}]") + get_filename_component(OPENCMISS_INSTALL_DIR "${_REG_KEY}" ABSOLUTE) + #message(STATUS "Trying registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Found ${PACKAGE} in Windows registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + break() + else() + unset(OPENCMISS_INSTALL_DIR) + endif() + endforeach() + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + break() + endif() + endforeach() +endif() + +if(OPENCMISS_INSTALL_DIR) + message(STATUS "OPENCMISS_INSTALL_DIR=${OPENCMISS_INSTALL_DIR}") + # Use the OpenCMISS scripts to also allow choosing a separate toolchain + # This file is located at the opencmiss installation rather than the local example + # as it avoids file replication and makes maintenance much easier + if (TOOLCHAIN) + set(_OCTC ${OPENCMISS_INSTALL_DIR}/cmake/OCToolchainCompilers.cmake) + if (EXISTS "${_OCTC}") + include(${_OCTC}) + else() + message(WARNING "TOOLCHAIN specified but OpenCMISS config script could not be found at ${_OCTC}. Trying CMake defaults.") + endif() + unset(_OCTC) + endif() + set(OpenCMISS_DIR "${OPENCMISS_INSTALL_DIR}" CACHE PATH "Path to the found OpenCMISS (SDK) installation") +else() + message(WARNING "No OpenCMISS (SDK) installation directory detected. Using default system environment.") +endif() + \ No newline at end of file diff --git a/42TestingPoints/SinglePhysics/LinearProblems/StaticProblems/Stokes/3D/HEX/QuadraticVelocityLinearPressure/LEVEL_3/10k/build_debug/build.sh b/42TestingPoints/SinglePhysics/LinearProblems/StaticProblems/Stokes/3D/HEX/QuadraticVelocityLinearPressure/LEVEL_3/10k/build_debug/build.sh new file mode 100644 index 00000000..e6624bac --- /dev/null +++ b/42TestingPoints/SinglePhysics/LinearProblems/StaticProblems/Stokes/3D/HEX/QuadraticVelocityLinearPressure/LEVEL_3/10k/build_debug/build.sh @@ -0,0 +1,2 @@ +#ccc && cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all +cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all diff --git a/42TestingPoints/SinglePhysics/LinearProblems/StaticProblems/Stokes/3D/HEX/QuadraticVelocityLinearPressure/LEVEL_3/1k/CMakeLists.txt b/42TestingPoints/SinglePhysics/LinearProblems/StaticProblems/Stokes/3D/HEX/QuadraticVelocityLinearPressure/LEVEL_3/1k/CMakeLists.txt new file mode 100644 index 00000000..a22b61ee --- /dev/null +++ b/42TestingPoints/SinglePhysics/LinearProblems/StaticProblems/Stokes/3D/HEX/QuadraticVelocityLinearPressure/LEVEL_3/1k/CMakeLists.txt @@ -0,0 +1,35 @@ +# 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 C) +enable_language(Fortran OPTIONAL) +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 +# ---------------------- +#add_subdirectory(C) +if (CMAKE_Fortran_COMPILER) + add_subdirectory(Fortran) +endif() diff --git a/42TestingPoints/SinglePhysics/LinearProblems/StaticProblems/Stokes/3D/HEX/QuadraticVelocityLinearPressure/LEVEL_3/1k/Fortran/CMakeLists.txt b/42TestingPoints/SinglePhysics/LinearProblems/StaticProblems/Stokes/3D/HEX/QuadraticVelocityLinearPressure/LEVEL_3/1k/Fortran/CMakeLists.txt new file mode 100644 index 00000000..4b3dc8ce --- /dev/null +++ b/42TestingPoints/SinglePhysics/LinearProblems/StaticProblems/Stokes/3D/HEX/QuadraticVelocityLinearPressure/LEVEL_3/1k/Fortran/CMakeLists.txt @@ -0,0 +1,60 @@ + +# Add example executable +add_executable(1k src/1kExample.f90) + +# Turn on Fortran preprocessing (#include directives) +if (MSVC) + set(PROC_OPT "/fpp") +else() + set(PROC_OPT "-cpp") +endif() + +# in debug mode, add flag that make Floating point exceptions fatal +set(OPT "") +if (FALSE) + if(CMAKE_BUILD_TYPE MATCHES DEBUG) + set(OPT "-ffpe-trap=invalid,zero,underflow,overflow,denormal") # GCC: make floating point exceptions fatal + endif() +endif() + +target_compile_options(1k PRIVATE ${PROC_OPT} ${OPT} "-fbacktrace") + +# Link to opencmiss +# ----------------- +# +# This simply uses the opencmiss target created by OC_INIT() above. +# +# Alternatively, you can also directly invoke 'find_package(Iron )' 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 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(1k PRIVATE opencmiss) + +# Add a simple test that runs the executable +add_test(NAME test_1k COMMAND 1k) +add_opencmiss_environment(test_1k) + +################### +# 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. +# diff --git a/42TestingPoints/SinglePhysics/LinearProblems/StaticProblems/Stokes/3D/HEX/QuadraticVelocityLinearPressure/LEVEL_3/1k/src/1kExample.f90 b/42TestingPoints/SinglePhysics/LinearProblems/StaticProblems/Stokes/3D/HEX/QuadraticVelocityLinearPressure/LEVEL_3/1k/Fortran/src/1kExample.f90 similarity index 100% rename from 42TestingPoints/SinglePhysics/LinearProblems/StaticProblems/Stokes/3D/HEX/QuadraticVelocityLinearPressure/LEVEL_3/1k/src/1kExample.f90 rename to 42TestingPoints/SinglePhysics/LinearProblems/StaticProblems/Stokes/3D/HEX/QuadraticVelocityLinearPressure/LEVEL_3/1k/Fortran/src/1kExample.f90 diff --git a/42TestingPoints/SinglePhysics/LinearProblems/StaticProblems/Stokes/3D/HEX/QuadraticVelocityLinearPressure/LEVEL_3/1k/OpenCMISS.cmake b/42TestingPoints/SinglePhysics/LinearProblems/StaticProblems/Stokes/3D/HEX/QuadraticVelocityLinearPressure/LEVEL_3/1k/OpenCMISS.cmake new file mode 100644 index 00000000..3d6cf515 --- /dev/null +++ b/42TestingPoints/SinglePhysics/LinearProblems/StaticProblems/Stokes/3D/HEX/QuadraticVelocityLinearPressure/LEVEL_3/1k/OpenCMISS.cmake @@ -0,0 +1,95 @@ +########################### +# *DO NOT CHANGE THIS FILE* +########################### +# +# Prepares the use of OpenCMISS by scanning at various path locations for OpenCMISS (SDK) installations. +# +# Search order: +# - OPENCMISS_INSTALL_DIR variable +# - OPENCMISS_INSTALL_DIR environment variable +# - OPENCMISS_SDK_DIR variable +# - OPENCMISS_SDK_DIR environment variable +# - [Windows only] The Registry is searched additionally for installed SDKs. +# +# If found +# - Includes the toolchain config script of the found opencmiss installation to enable toolchain selection logic (non-windows) + +# Convenience: The OPENCMISS_INSTALL_DIR may also be defined in the environment and various other places +if (DEFINED OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using specified installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The specified OPENCMISS_INSTALL_DIR '${OPENCMISS_INSTALL_DIR}' does not exist. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_INSTALL_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_INSTALL_DIR}" OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using environment installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The environment variable OPENCMISS_INSTALL_DIR='${OPENCMISS_INSTALL_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if (NOT OPENCMISS_INSTALL_DIR AND DEFINED OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The specified OPENCMISS_SDK_DIR '${OPENCMISS_SDK_DIR}' does not exist. Skipping.") + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_SDK_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_SDK_DIR}" OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using environment SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The environment variable OPENCMISS_SDK_DIR='${OPENCMISS_SDK_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_SDK_DIR) + endif() +endif() +# On windows: check the registry for installed OpenCMISS SDKs +if(NOT OPENCMISS_INSTALL_DIR AND WIN32) + foreach(ROOT HKEY_CURRENT_USER HKEY_LOCAL_MACHINE) + foreach(PACKAGE OpenCMISSUserSDK OpenCMISSDeveloperSDK) + set(_REG_KEY "[${ROOT}\\Software\\Auckland Bioengineering Institute\\${PACKAGE}]") + get_filename_component(OPENCMISS_INSTALL_DIR "${_REG_KEY}" ABSOLUTE) + #message(STATUS "Trying registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Found ${PACKAGE} in Windows registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + break() + else() + unset(OPENCMISS_INSTALL_DIR) + endif() + endforeach() + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + break() + endif() + endforeach() +endif() + +if(OPENCMISS_INSTALL_DIR) + message(STATUS "OPENCMISS_INSTALL_DIR=${OPENCMISS_INSTALL_DIR}") + # Use the OpenCMISS scripts to also allow choosing a separate toolchain + # This file is located at the opencmiss installation rather than the local example + # as it avoids file replication and makes maintenance much easier + if (TOOLCHAIN) + set(_OCTC ${OPENCMISS_INSTALL_DIR}/cmake/OCToolchainCompilers.cmake) + if (EXISTS "${_OCTC}") + include(${_OCTC}) + else() + message(WARNING "TOOLCHAIN specified but OpenCMISS config script could not be found at ${_OCTC}. Trying CMake defaults.") + endif() + unset(_OCTC) + endif() + set(OpenCMISS_DIR "${OPENCMISS_INSTALL_DIR}" CACHE PATH "Path to the found OpenCMISS (SDK) installation") +else() + message(WARNING "No OpenCMISS (SDK) installation directory detected. Using default system environment.") +endif() + \ No newline at end of file diff --git a/42TestingPoints/SinglePhysics/LinearProblems/StaticProblems/Stokes/3D/HEX/QuadraticVelocityLinearPressure/LEVEL_3/1k/build_debug/build.sh b/42TestingPoints/SinglePhysics/LinearProblems/StaticProblems/Stokes/3D/HEX/QuadraticVelocityLinearPressure/LEVEL_3/1k/build_debug/build.sh new file mode 100644 index 00000000..e6624bac --- /dev/null +++ b/42TestingPoints/SinglePhysics/LinearProblems/StaticProblems/Stokes/3D/HEX/QuadraticVelocityLinearPressure/LEVEL_3/1k/build_debug/build.sh @@ -0,0 +1,2 @@ +#ccc && cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all +cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all diff --git a/42TestingPoints/SinglePhysics/NonlinearProblems/DynamicProblems/NavierStokes/2D/QUAD/CubicVelocityLinearPressure/LEVEL_2/CMakeLists.txt b/42TestingPoints/SinglePhysics/NonlinearProblems/DynamicProblems/NavierStokes/2D/QUAD/CubicVelocityLinearPressure/LEVEL_2/CMakeLists.txt new file mode 100644 index 00000000..a22b61ee --- /dev/null +++ b/42TestingPoints/SinglePhysics/NonlinearProblems/DynamicProblems/NavierStokes/2D/QUAD/CubicVelocityLinearPressure/LEVEL_2/CMakeLists.txt @@ -0,0 +1,35 @@ +# 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 C) +enable_language(Fortran OPTIONAL) +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 +# ---------------------- +#add_subdirectory(C) +if (CMAKE_Fortran_COMPILER) + add_subdirectory(Fortran) +endif() diff --git a/42TestingPoints/SinglePhysics/NonlinearProblems/DynamicProblems/NavierStokes/2D/QUAD/CubicVelocityLinearPressure/LEVEL_2/Fortran/CMakeLists.txt b/42TestingPoints/SinglePhysics/NonlinearProblems/DynamicProblems/NavierStokes/2D/QUAD/CubicVelocityLinearPressure/LEVEL_2/Fortran/CMakeLists.txt new file mode 100644 index 00000000..1a8325a2 --- /dev/null +++ b/42TestingPoints/SinglePhysics/NonlinearProblems/DynamicProblems/NavierStokes/2D/QUAD/CubicVelocityLinearPressure/LEVEL_2/Fortran/CMakeLists.txt @@ -0,0 +1,60 @@ + +# Add example executable +add_executable(LEVEL_2 src/LEVEL_2Example.f90) + +# Turn on Fortran preprocessing (#include directives) +if (MSVC) + set(PROC_OPT "/fpp") +else() + set(PROC_OPT "-cpp") +endif() + +# in debug mode, add flag that make Floating point exceptions fatal +set(OPT "") +if (FALSE) + if(CMAKE_BUILD_TYPE MATCHES DEBUG) + set(OPT "-ffpe-trap=invalid,zero,underflow,overflow,denormal") # GCC: make floating point exceptions fatal + endif() +endif() + +target_compile_options(LEVEL_2 PRIVATE ${PROC_OPT} ${OPT} "-fbacktrace") + +# Link to opencmiss +# ----------------- +# +# This simply uses the opencmiss target created by OC_INIT() above. +# +# Alternatively, you can also directly invoke 'find_package(Iron )' 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 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(LEVEL_2 PRIVATE opencmiss) + +# Add a simple test that runs the executable +add_test(NAME test_LEVEL_2 COMMAND LEVEL_2) +add_opencmiss_environment(test_LEVEL_2) + +################### +# 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. +# diff --git a/42TestingPoints/SinglePhysics/NonlinearProblems/DynamicProblems/NavierStokes/2D/QUAD/CubicVelocityLinearPressure/LEVEL_2/src/LEVEL_2Example.f90 b/42TestingPoints/SinglePhysics/NonlinearProblems/DynamicProblems/NavierStokes/2D/QUAD/CubicVelocityLinearPressure/LEVEL_2/Fortran/src/LEVEL_2Example.f90 similarity index 100% rename from 42TestingPoints/SinglePhysics/NonlinearProblems/DynamicProblems/NavierStokes/2D/QUAD/CubicVelocityLinearPressure/LEVEL_2/src/LEVEL_2Example.f90 rename to 42TestingPoints/SinglePhysics/NonlinearProblems/DynamicProblems/NavierStokes/2D/QUAD/CubicVelocityLinearPressure/LEVEL_2/Fortran/src/LEVEL_2Example.f90 diff --git a/42TestingPoints/SinglePhysics/NonlinearProblems/DynamicProblems/NavierStokes/2D/QUAD/CubicVelocityLinearPressure/LEVEL_2/OpenCMISS.cmake b/42TestingPoints/SinglePhysics/NonlinearProblems/DynamicProblems/NavierStokes/2D/QUAD/CubicVelocityLinearPressure/LEVEL_2/OpenCMISS.cmake new file mode 100644 index 00000000..3d6cf515 --- /dev/null +++ b/42TestingPoints/SinglePhysics/NonlinearProblems/DynamicProblems/NavierStokes/2D/QUAD/CubicVelocityLinearPressure/LEVEL_2/OpenCMISS.cmake @@ -0,0 +1,95 @@ +########################### +# *DO NOT CHANGE THIS FILE* +########################### +# +# Prepares the use of OpenCMISS by scanning at various path locations for OpenCMISS (SDK) installations. +# +# Search order: +# - OPENCMISS_INSTALL_DIR variable +# - OPENCMISS_INSTALL_DIR environment variable +# - OPENCMISS_SDK_DIR variable +# - OPENCMISS_SDK_DIR environment variable +# - [Windows only] The Registry is searched additionally for installed SDKs. +# +# If found +# - Includes the toolchain config script of the found opencmiss installation to enable toolchain selection logic (non-windows) + +# Convenience: The OPENCMISS_INSTALL_DIR may also be defined in the environment and various other places +if (DEFINED OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using specified installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The specified OPENCMISS_INSTALL_DIR '${OPENCMISS_INSTALL_DIR}' does not exist. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_INSTALL_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_INSTALL_DIR}" OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using environment installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The environment variable OPENCMISS_INSTALL_DIR='${OPENCMISS_INSTALL_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if (NOT OPENCMISS_INSTALL_DIR AND DEFINED OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The specified OPENCMISS_SDK_DIR '${OPENCMISS_SDK_DIR}' does not exist. Skipping.") + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_SDK_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_SDK_DIR}" OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using environment SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The environment variable OPENCMISS_SDK_DIR='${OPENCMISS_SDK_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_SDK_DIR) + endif() +endif() +# On windows: check the registry for installed OpenCMISS SDKs +if(NOT OPENCMISS_INSTALL_DIR AND WIN32) + foreach(ROOT HKEY_CURRENT_USER HKEY_LOCAL_MACHINE) + foreach(PACKAGE OpenCMISSUserSDK OpenCMISSDeveloperSDK) + set(_REG_KEY "[${ROOT}\\Software\\Auckland Bioengineering Institute\\${PACKAGE}]") + get_filename_component(OPENCMISS_INSTALL_DIR "${_REG_KEY}" ABSOLUTE) + #message(STATUS "Trying registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Found ${PACKAGE} in Windows registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + break() + else() + unset(OPENCMISS_INSTALL_DIR) + endif() + endforeach() + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + break() + endif() + endforeach() +endif() + +if(OPENCMISS_INSTALL_DIR) + message(STATUS "OPENCMISS_INSTALL_DIR=${OPENCMISS_INSTALL_DIR}") + # Use the OpenCMISS scripts to also allow choosing a separate toolchain + # This file is located at the opencmiss installation rather than the local example + # as it avoids file replication and makes maintenance much easier + if (TOOLCHAIN) + set(_OCTC ${OPENCMISS_INSTALL_DIR}/cmake/OCToolchainCompilers.cmake) + if (EXISTS "${_OCTC}") + include(${_OCTC}) + else() + message(WARNING "TOOLCHAIN specified but OpenCMISS config script could not be found at ${_OCTC}. Trying CMake defaults.") + endif() + unset(_OCTC) + endif() + set(OpenCMISS_DIR "${OPENCMISS_INSTALL_DIR}" CACHE PATH "Path to the found OpenCMISS (SDK) installation") +else() + message(WARNING "No OpenCMISS (SDK) installation directory detected. Using default system environment.") +endif() + \ No newline at end of file diff --git a/42TestingPoints/SinglePhysics/NonlinearProblems/DynamicProblems/NavierStokes/2D/QUAD/CubicVelocityLinearPressure/LEVEL_2/build_debug/build.sh b/42TestingPoints/SinglePhysics/NonlinearProblems/DynamicProblems/NavierStokes/2D/QUAD/CubicVelocityLinearPressure/LEVEL_2/build_debug/build.sh new file mode 100644 index 00000000..e6624bac --- /dev/null +++ b/42TestingPoints/SinglePhysics/NonlinearProblems/DynamicProblems/NavierStokes/2D/QUAD/CubicVelocityLinearPressure/LEVEL_2/build_debug/build.sh @@ -0,0 +1,2 @@ +#ccc && cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all +cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all diff --git a/42TestingPoints/SinglePhysics/NonlinearProblems/DynamicProblems/NavierStokes/2D/QUAD/CubicVelocityQuadraticPressure/LEVEL_2/CMakeLists.txt b/42TestingPoints/SinglePhysics/NonlinearProblems/DynamicProblems/NavierStokes/2D/QUAD/CubicVelocityQuadraticPressure/LEVEL_2/CMakeLists.txt new file mode 100644 index 00000000..a22b61ee --- /dev/null +++ b/42TestingPoints/SinglePhysics/NonlinearProblems/DynamicProblems/NavierStokes/2D/QUAD/CubicVelocityQuadraticPressure/LEVEL_2/CMakeLists.txt @@ -0,0 +1,35 @@ +# 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 C) +enable_language(Fortran OPTIONAL) +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 +# ---------------------- +#add_subdirectory(C) +if (CMAKE_Fortran_COMPILER) + add_subdirectory(Fortran) +endif() diff --git a/42TestingPoints/SinglePhysics/NonlinearProblems/DynamicProblems/NavierStokes/2D/QUAD/CubicVelocityQuadraticPressure/LEVEL_2/Fortran/CMakeLists.txt b/42TestingPoints/SinglePhysics/NonlinearProblems/DynamicProblems/NavierStokes/2D/QUAD/CubicVelocityQuadraticPressure/LEVEL_2/Fortran/CMakeLists.txt new file mode 100644 index 00000000..1a8325a2 --- /dev/null +++ b/42TestingPoints/SinglePhysics/NonlinearProblems/DynamicProblems/NavierStokes/2D/QUAD/CubicVelocityQuadraticPressure/LEVEL_2/Fortran/CMakeLists.txt @@ -0,0 +1,60 @@ + +# Add example executable +add_executable(LEVEL_2 src/LEVEL_2Example.f90) + +# Turn on Fortran preprocessing (#include directives) +if (MSVC) + set(PROC_OPT "/fpp") +else() + set(PROC_OPT "-cpp") +endif() + +# in debug mode, add flag that make Floating point exceptions fatal +set(OPT "") +if (FALSE) + if(CMAKE_BUILD_TYPE MATCHES DEBUG) + set(OPT "-ffpe-trap=invalid,zero,underflow,overflow,denormal") # GCC: make floating point exceptions fatal + endif() +endif() + +target_compile_options(LEVEL_2 PRIVATE ${PROC_OPT} ${OPT} "-fbacktrace") + +# Link to opencmiss +# ----------------- +# +# This simply uses the opencmiss target created by OC_INIT() above. +# +# Alternatively, you can also directly invoke 'find_package(Iron )' 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 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(LEVEL_2 PRIVATE opencmiss) + +# Add a simple test that runs the executable +add_test(NAME test_LEVEL_2 COMMAND LEVEL_2) +add_opencmiss_environment(test_LEVEL_2) + +################### +# 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. +# diff --git a/42TestingPoints/SinglePhysics/NonlinearProblems/DynamicProblems/NavierStokes/2D/QUAD/CubicVelocityQuadraticPressure/LEVEL_2/src/LEVEL_2Example.f90 b/42TestingPoints/SinglePhysics/NonlinearProblems/DynamicProblems/NavierStokes/2D/QUAD/CubicVelocityQuadraticPressure/LEVEL_2/Fortran/src/LEVEL_2Example.f90 similarity index 100% rename from 42TestingPoints/SinglePhysics/NonlinearProblems/DynamicProblems/NavierStokes/2D/QUAD/CubicVelocityQuadraticPressure/LEVEL_2/src/LEVEL_2Example.f90 rename to 42TestingPoints/SinglePhysics/NonlinearProblems/DynamicProblems/NavierStokes/2D/QUAD/CubicVelocityQuadraticPressure/LEVEL_2/Fortran/src/LEVEL_2Example.f90 diff --git a/42TestingPoints/SinglePhysics/NonlinearProblems/DynamicProblems/NavierStokes/2D/QUAD/CubicVelocityQuadraticPressure/LEVEL_2/OpenCMISS.cmake b/42TestingPoints/SinglePhysics/NonlinearProblems/DynamicProblems/NavierStokes/2D/QUAD/CubicVelocityQuadraticPressure/LEVEL_2/OpenCMISS.cmake new file mode 100644 index 00000000..3d6cf515 --- /dev/null +++ b/42TestingPoints/SinglePhysics/NonlinearProblems/DynamicProblems/NavierStokes/2D/QUAD/CubicVelocityQuadraticPressure/LEVEL_2/OpenCMISS.cmake @@ -0,0 +1,95 @@ +########################### +# *DO NOT CHANGE THIS FILE* +########################### +# +# Prepares the use of OpenCMISS by scanning at various path locations for OpenCMISS (SDK) installations. +# +# Search order: +# - OPENCMISS_INSTALL_DIR variable +# - OPENCMISS_INSTALL_DIR environment variable +# - OPENCMISS_SDK_DIR variable +# - OPENCMISS_SDK_DIR environment variable +# - [Windows only] The Registry is searched additionally for installed SDKs. +# +# If found +# - Includes the toolchain config script of the found opencmiss installation to enable toolchain selection logic (non-windows) + +# Convenience: The OPENCMISS_INSTALL_DIR may also be defined in the environment and various other places +if (DEFINED OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using specified installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The specified OPENCMISS_INSTALL_DIR '${OPENCMISS_INSTALL_DIR}' does not exist. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_INSTALL_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_INSTALL_DIR}" OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using environment installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The environment variable OPENCMISS_INSTALL_DIR='${OPENCMISS_INSTALL_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if (NOT OPENCMISS_INSTALL_DIR AND DEFINED OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The specified OPENCMISS_SDK_DIR '${OPENCMISS_SDK_DIR}' does not exist. Skipping.") + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_SDK_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_SDK_DIR}" OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using environment SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The environment variable OPENCMISS_SDK_DIR='${OPENCMISS_SDK_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_SDK_DIR) + endif() +endif() +# On windows: check the registry for installed OpenCMISS SDKs +if(NOT OPENCMISS_INSTALL_DIR AND WIN32) + foreach(ROOT HKEY_CURRENT_USER HKEY_LOCAL_MACHINE) + foreach(PACKAGE OpenCMISSUserSDK OpenCMISSDeveloperSDK) + set(_REG_KEY "[${ROOT}\\Software\\Auckland Bioengineering Institute\\${PACKAGE}]") + get_filename_component(OPENCMISS_INSTALL_DIR "${_REG_KEY}" ABSOLUTE) + #message(STATUS "Trying registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Found ${PACKAGE} in Windows registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + break() + else() + unset(OPENCMISS_INSTALL_DIR) + endif() + endforeach() + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + break() + endif() + endforeach() +endif() + +if(OPENCMISS_INSTALL_DIR) + message(STATUS "OPENCMISS_INSTALL_DIR=${OPENCMISS_INSTALL_DIR}") + # Use the OpenCMISS scripts to also allow choosing a separate toolchain + # This file is located at the opencmiss installation rather than the local example + # as it avoids file replication and makes maintenance much easier + if (TOOLCHAIN) + set(_OCTC ${OPENCMISS_INSTALL_DIR}/cmake/OCToolchainCompilers.cmake) + if (EXISTS "${_OCTC}") + include(${_OCTC}) + else() + message(WARNING "TOOLCHAIN specified but OpenCMISS config script could not be found at ${_OCTC}. Trying CMake defaults.") + endif() + unset(_OCTC) + endif() + set(OpenCMISS_DIR "${OPENCMISS_INSTALL_DIR}" CACHE PATH "Path to the found OpenCMISS (SDK) installation") +else() + message(WARNING "No OpenCMISS (SDK) installation directory detected. Using default system environment.") +endif() + \ No newline at end of file diff --git a/42TestingPoints/SinglePhysics/NonlinearProblems/DynamicProblems/NavierStokes/2D/QUAD/CubicVelocityQuadraticPressure/LEVEL_2/build_debug/build.sh b/42TestingPoints/SinglePhysics/NonlinearProblems/DynamicProblems/NavierStokes/2D/QUAD/CubicVelocityQuadraticPressure/LEVEL_2/build_debug/build.sh new file mode 100644 index 00000000..e6624bac --- /dev/null +++ b/42TestingPoints/SinglePhysics/NonlinearProblems/DynamicProblems/NavierStokes/2D/QUAD/CubicVelocityQuadraticPressure/LEVEL_2/build_debug/build.sh @@ -0,0 +1,2 @@ +#ccc && cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all +cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all diff --git a/42TestingPoints/SinglePhysics/NonlinearProblems/DynamicProblems/NavierStokes/2D/QUAD/QuadraticVelocityLinearPressure/LEVEL_2/CMakeLists.txt b/42TestingPoints/SinglePhysics/NonlinearProblems/DynamicProblems/NavierStokes/2D/QUAD/QuadraticVelocityLinearPressure/LEVEL_2/CMakeLists.txt new file mode 100644 index 00000000..a22b61ee --- /dev/null +++ b/42TestingPoints/SinglePhysics/NonlinearProblems/DynamicProblems/NavierStokes/2D/QUAD/QuadraticVelocityLinearPressure/LEVEL_2/CMakeLists.txt @@ -0,0 +1,35 @@ +# 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 C) +enable_language(Fortran OPTIONAL) +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 +# ---------------------- +#add_subdirectory(C) +if (CMAKE_Fortran_COMPILER) + add_subdirectory(Fortran) +endif() diff --git a/42TestingPoints/SinglePhysics/NonlinearProblems/DynamicProblems/NavierStokes/2D/QUAD/QuadraticVelocityLinearPressure/LEVEL_2/Fortran/CMakeLists.txt b/42TestingPoints/SinglePhysics/NonlinearProblems/DynamicProblems/NavierStokes/2D/QUAD/QuadraticVelocityLinearPressure/LEVEL_2/Fortran/CMakeLists.txt new file mode 100644 index 00000000..1a8325a2 --- /dev/null +++ b/42TestingPoints/SinglePhysics/NonlinearProblems/DynamicProblems/NavierStokes/2D/QUAD/QuadraticVelocityLinearPressure/LEVEL_2/Fortran/CMakeLists.txt @@ -0,0 +1,60 @@ + +# Add example executable +add_executable(LEVEL_2 src/LEVEL_2Example.f90) + +# Turn on Fortran preprocessing (#include directives) +if (MSVC) + set(PROC_OPT "/fpp") +else() + set(PROC_OPT "-cpp") +endif() + +# in debug mode, add flag that make Floating point exceptions fatal +set(OPT "") +if (FALSE) + if(CMAKE_BUILD_TYPE MATCHES DEBUG) + set(OPT "-ffpe-trap=invalid,zero,underflow,overflow,denormal") # GCC: make floating point exceptions fatal + endif() +endif() + +target_compile_options(LEVEL_2 PRIVATE ${PROC_OPT} ${OPT} "-fbacktrace") + +# Link to opencmiss +# ----------------- +# +# This simply uses the opencmiss target created by OC_INIT() above. +# +# Alternatively, you can also directly invoke 'find_package(Iron )' 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 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(LEVEL_2 PRIVATE opencmiss) + +# Add a simple test that runs the executable +add_test(NAME test_LEVEL_2 COMMAND LEVEL_2) +add_opencmiss_environment(test_LEVEL_2) + +################### +# 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. +# diff --git a/42TestingPoints/SinglePhysics/NonlinearProblems/DynamicProblems/NavierStokes/2D/QUAD/QuadraticVelocityLinearPressure/LEVEL_2/src/LEVEL_2Example.f90 b/42TestingPoints/SinglePhysics/NonlinearProblems/DynamicProblems/NavierStokes/2D/QUAD/QuadraticVelocityLinearPressure/LEVEL_2/Fortran/src/LEVEL_2Example.f90 similarity index 100% rename from 42TestingPoints/SinglePhysics/NonlinearProblems/DynamicProblems/NavierStokes/2D/QUAD/QuadraticVelocityLinearPressure/LEVEL_2/src/LEVEL_2Example.f90 rename to 42TestingPoints/SinglePhysics/NonlinearProblems/DynamicProblems/NavierStokes/2D/QUAD/QuadraticVelocityLinearPressure/LEVEL_2/Fortran/src/LEVEL_2Example.f90 diff --git a/42TestingPoints/SinglePhysics/NonlinearProblems/DynamicProblems/NavierStokes/2D/QUAD/QuadraticVelocityLinearPressure/LEVEL_2/OpenCMISS.cmake b/42TestingPoints/SinglePhysics/NonlinearProblems/DynamicProblems/NavierStokes/2D/QUAD/QuadraticVelocityLinearPressure/LEVEL_2/OpenCMISS.cmake new file mode 100644 index 00000000..3d6cf515 --- /dev/null +++ b/42TestingPoints/SinglePhysics/NonlinearProblems/DynamicProblems/NavierStokes/2D/QUAD/QuadraticVelocityLinearPressure/LEVEL_2/OpenCMISS.cmake @@ -0,0 +1,95 @@ +########################### +# *DO NOT CHANGE THIS FILE* +########################### +# +# Prepares the use of OpenCMISS by scanning at various path locations for OpenCMISS (SDK) installations. +# +# Search order: +# - OPENCMISS_INSTALL_DIR variable +# - OPENCMISS_INSTALL_DIR environment variable +# - OPENCMISS_SDK_DIR variable +# - OPENCMISS_SDK_DIR environment variable +# - [Windows only] The Registry is searched additionally for installed SDKs. +# +# If found +# - Includes the toolchain config script of the found opencmiss installation to enable toolchain selection logic (non-windows) + +# Convenience: The OPENCMISS_INSTALL_DIR may also be defined in the environment and various other places +if (DEFINED OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using specified installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The specified OPENCMISS_INSTALL_DIR '${OPENCMISS_INSTALL_DIR}' does not exist. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_INSTALL_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_INSTALL_DIR}" OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using environment installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The environment variable OPENCMISS_INSTALL_DIR='${OPENCMISS_INSTALL_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if (NOT OPENCMISS_INSTALL_DIR AND DEFINED OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The specified OPENCMISS_SDK_DIR '${OPENCMISS_SDK_DIR}' does not exist. Skipping.") + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_SDK_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_SDK_DIR}" OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using environment SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The environment variable OPENCMISS_SDK_DIR='${OPENCMISS_SDK_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_SDK_DIR) + endif() +endif() +# On windows: check the registry for installed OpenCMISS SDKs +if(NOT OPENCMISS_INSTALL_DIR AND WIN32) + foreach(ROOT HKEY_CURRENT_USER HKEY_LOCAL_MACHINE) + foreach(PACKAGE OpenCMISSUserSDK OpenCMISSDeveloperSDK) + set(_REG_KEY "[${ROOT}\\Software\\Auckland Bioengineering Institute\\${PACKAGE}]") + get_filename_component(OPENCMISS_INSTALL_DIR "${_REG_KEY}" ABSOLUTE) + #message(STATUS "Trying registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Found ${PACKAGE} in Windows registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + break() + else() + unset(OPENCMISS_INSTALL_DIR) + endif() + endforeach() + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + break() + endif() + endforeach() +endif() + +if(OPENCMISS_INSTALL_DIR) + message(STATUS "OPENCMISS_INSTALL_DIR=${OPENCMISS_INSTALL_DIR}") + # Use the OpenCMISS scripts to also allow choosing a separate toolchain + # This file is located at the opencmiss installation rather than the local example + # as it avoids file replication and makes maintenance much easier + if (TOOLCHAIN) + set(_OCTC ${OPENCMISS_INSTALL_DIR}/cmake/OCToolchainCompilers.cmake) + if (EXISTS "${_OCTC}") + include(${_OCTC}) + else() + message(WARNING "TOOLCHAIN specified but OpenCMISS config script could not be found at ${_OCTC}. Trying CMake defaults.") + endif() + unset(_OCTC) + endif() + set(OpenCMISS_DIR "${OPENCMISS_INSTALL_DIR}" CACHE PATH "Path to the found OpenCMISS (SDK) installation") +else() + message(WARNING "No OpenCMISS (SDK) installation directory detected. Using default system environment.") +endif() + \ No newline at end of file diff --git a/42TestingPoints/SinglePhysics/NonlinearProblems/DynamicProblems/NavierStokes/2D/QUAD/QuadraticVelocityLinearPressure/LEVEL_2/build_debug/build.sh b/42TestingPoints/SinglePhysics/NonlinearProblems/DynamicProblems/NavierStokes/2D/QUAD/QuadraticVelocityLinearPressure/LEVEL_2/build_debug/build.sh new file mode 100644 index 00000000..e6624bac --- /dev/null +++ b/42TestingPoints/SinglePhysics/NonlinearProblems/DynamicProblems/NavierStokes/2D/QUAD/QuadraticVelocityLinearPressure/LEVEL_2/build_debug/build.sh @@ -0,0 +1,2 @@ +#ccc && cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all +cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all diff --git a/42TestingPoints/SinglePhysics/NonlinearProblems/DynamicProblems/NavierStokes/2D/TRI/CubicVelocityLinearPressure/LEVEL_2/CMakeLists.txt b/42TestingPoints/SinglePhysics/NonlinearProblems/DynamicProblems/NavierStokes/2D/TRI/CubicVelocityLinearPressure/LEVEL_2/CMakeLists.txt new file mode 100644 index 00000000..a22b61ee --- /dev/null +++ b/42TestingPoints/SinglePhysics/NonlinearProblems/DynamicProblems/NavierStokes/2D/TRI/CubicVelocityLinearPressure/LEVEL_2/CMakeLists.txt @@ -0,0 +1,35 @@ +# 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 C) +enable_language(Fortran OPTIONAL) +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 +# ---------------------- +#add_subdirectory(C) +if (CMAKE_Fortran_COMPILER) + add_subdirectory(Fortran) +endif() diff --git a/42TestingPoints/SinglePhysics/NonlinearProblems/DynamicProblems/NavierStokes/2D/TRI/CubicVelocityLinearPressure/LEVEL_2/Fortran/CMakeLists.txt b/42TestingPoints/SinglePhysics/NonlinearProblems/DynamicProblems/NavierStokes/2D/TRI/CubicVelocityLinearPressure/LEVEL_2/Fortran/CMakeLists.txt new file mode 100644 index 00000000..1a8325a2 --- /dev/null +++ b/42TestingPoints/SinglePhysics/NonlinearProblems/DynamicProblems/NavierStokes/2D/TRI/CubicVelocityLinearPressure/LEVEL_2/Fortran/CMakeLists.txt @@ -0,0 +1,60 @@ + +# Add example executable +add_executable(LEVEL_2 src/LEVEL_2Example.f90) + +# Turn on Fortran preprocessing (#include directives) +if (MSVC) + set(PROC_OPT "/fpp") +else() + set(PROC_OPT "-cpp") +endif() + +# in debug mode, add flag that make Floating point exceptions fatal +set(OPT "") +if (FALSE) + if(CMAKE_BUILD_TYPE MATCHES DEBUG) + set(OPT "-ffpe-trap=invalid,zero,underflow,overflow,denormal") # GCC: make floating point exceptions fatal + endif() +endif() + +target_compile_options(LEVEL_2 PRIVATE ${PROC_OPT} ${OPT} "-fbacktrace") + +# Link to opencmiss +# ----------------- +# +# This simply uses the opencmiss target created by OC_INIT() above. +# +# Alternatively, you can also directly invoke 'find_package(Iron )' 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 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(LEVEL_2 PRIVATE opencmiss) + +# Add a simple test that runs the executable +add_test(NAME test_LEVEL_2 COMMAND LEVEL_2) +add_opencmiss_environment(test_LEVEL_2) + +################### +# 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. +# diff --git a/42TestingPoints/SinglePhysics/NonlinearProblems/DynamicProblems/NavierStokes/2D/TRI/CubicVelocityLinearPressure/LEVEL_2/src/LEVEL_2Example.f90 b/42TestingPoints/SinglePhysics/NonlinearProblems/DynamicProblems/NavierStokes/2D/TRI/CubicVelocityLinearPressure/LEVEL_2/Fortran/src/LEVEL_2Example.f90 similarity index 100% rename from 42TestingPoints/SinglePhysics/NonlinearProblems/DynamicProblems/NavierStokes/2D/TRI/CubicVelocityLinearPressure/LEVEL_2/src/LEVEL_2Example.f90 rename to 42TestingPoints/SinglePhysics/NonlinearProblems/DynamicProblems/NavierStokes/2D/TRI/CubicVelocityLinearPressure/LEVEL_2/Fortran/src/LEVEL_2Example.f90 diff --git a/42TestingPoints/SinglePhysics/NonlinearProblems/DynamicProblems/NavierStokes/2D/TRI/CubicVelocityLinearPressure/LEVEL_2/OpenCMISS.cmake b/42TestingPoints/SinglePhysics/NonlinearProblems/DynamicProblems/NavierStokes/2D/TRI/CubicVelocityLinearPressure/LEVEL_2/OpenCMISS.cmake new file mode 100644 index 00000000..3d6cf515 --- /dev/null +++ b/42TestingPoints/SinglePhysics/NonlinearProblems/DynamicProblems/NavierStokes/2D/TRI/CubicVelocityLinearPressure/LEVEL_2/OpenCMISS.cmake @@ -0,0 +1,95 @@ +########################### +# *DO NOT CHANGE THIS FILE* +########################### +# +# Prepares the use of OpenCMISS by scanning at various path locations for OpenCMISS (SDK) installations. +# +# Search order: +# - OPENCMISS_INSTALL_DIR variable +# - OPENCMISS_INSTALL_DIR environment variable +# - OPENCMISS_SDK_DIR variable +# - OPENCMISS_SDK_DIR environment variable +# - [Windows only] The Registry is searched additionally for installed SDKs. +# +# If found +# - Includes the toolchain config script of the found opencmiss installation to enable toolchain selection logic (non-windows) + +# Convenience: The OPENCMISS_INSTALL_DIR may also be defined in the environment and various other places +if (DEFINED OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using specified installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The specified OPENCMISS_INSTALL_DIR '${OPENCMISS_INSTALL_DIR}' does not exist. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_INSTALL_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_INSTALL_DIR}" OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using environment installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The environment variable OPENCMISS_INSTALL_DIR='${OPENCMISS_INSTALL_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if (NOT OPENCMISS_INSTALL_DIR AND DEFINED OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The specified OPENCMISS_SDK_DIR '${OPENCMISS_SDK_DIR}' does not exist. Skipping.") + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_SDK_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_SDK_DIR}" OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using environment SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The environment variable OPENCMISS_SDK_DIR='${OPENCMISS_SDK_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_SDK_DIR) + endif() +endif() +# On windows: check the registry for installed OpenCMISS SDKs +if(NOT OPENCMISS_INSTALL_DIR AND WIN32) + foreach(ROOT HKEY_CURRENT_USER HKEY_LOCAL_MACHINE) + foreach(PACKAGE OpenCMISSUserSDK OpenCMISSDeveloperSDK) + set(_REG_KEY "[${ROOT}\\Software\\Auckland Bioengineering Institute\\${PACKAGE}]") + get_filename_component(OPENCMISS_INSTALL_DIR "${_REG_KEY}" ABSOLUTE) + #message(STATUS "Trying registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Found ${PACKAGE} in Windows registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + break() + else() + unset(OPENCMISS_INSTALL_DIR) + endif() + endforeach() + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + break() + endif() + endforeach() +endif() + +if(OPENCMISS_INSTALL_DIR) + message(STATUS "OPENCMISS_INSTALL_DIR=${OPENCMISS_INSTALL_DIR}") + # Use the OpenCMISS scripts to also allow choosing a separate toolchain + # This file is located at the opencmiss installation rather than the local example + # as it avoids file replication and makes maintenance much easier + if (TOOLCHAIN) + set(_OCTC ${OPENCMISS_INSTALL_DIR}/cmake/OCToolchainCompilers.cmake) + if (EXISTS "${_OCTC}") + include(${_OCTC}) + else() + message(WARNING "TOOLCHAIN specified but OpenCMISS config script could not be found at ${_OCTC}. Trying CMake defaults.") + endif() + unset(_OCTC) + endif() + set(OpenCMISS_DIR "${OPENCMISS_INSTALL_DIR}" CACHE PATH "Path to the found OpenCMISS (SDK) installation") +else() + message(WARNING "No OpenCMISS (SDK) installation directory detected. Using default system environment.") +endif() + \ No newline at end of file diff --git a/42TestingPoints/SinglePhysics/NonlinearProblems/DynamicProblems/NavierStokes/2D/TRI/CubicVelocityLinearPressure/LEVEL_2/build_debug/build.sh b/42TestingPoints/SinglePhysics/NonlinearProblems/DynamicProblems/NavierStokes/2D/TRI/CubicVelocityLinearPressure/LEVEL_2/build_debug/build.sh new file mode 100644 index 00000000..e6624bac --- /dev/null +++ b/42TestingPoints/SinglePhysics/NonlinearProblems/DynamicProblems/NavierStokes/2D/TRI/CubicVelocityLinearPressure/LEVEL_2/build_debug/build.sh @@ -0,0 +1,2 @@ +#ccc && cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all +cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all diff --git a/42TestingPoints/SinglePhysics/NonlinearProblems/DynamicProblems/NavierStokes/2D/TRI/CubicVelocityQuadraticPressure/LEVEL_2/CMakeLists.txt b/42TestingPoints/SinglePhysics/NonlinearProblems/DynamicProblems/NavierStokes/2D/TRI/CubicVelocityQuadraticPressure/LEVEL_2/CMakeLists.txt new file mode 100644 index 00000000..a22b61ee --- /dev/null +++ b/42TestingPoints/SinglePhysics/NonlinearProblems/DynamicProblems/NavierStokes/2D/TRI/CubicVelocityQuadraticPressure/LEVEL_2/CMakeLists.txt @@ -0,0 +1,35 @@ +# 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 C) +enable_language(Fortran OPTIONAL) +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 +# ---------------------- +#add_subdirectory(C) +if (CMAKE_Fortran_COMPILER) + add_subdirectory(Fortran) +endif() diff --git a/42TestingPoints/SinglePhysics/NonlinearProblems/DynamicProblems/NavierStokes/2D/TRI/CubicVelocityQuadraticPressure/LEVEL_2/Fortran/CMakeLists.txt b/42TestingPoints/SinglePhysics/NonlinearProblems/DynamicProblems/NavierStokes/2D/TRI/CubicVelocityQuadraticPressure/LEVEL_2/Fortran/CMakeLists.txt new file mode 100644 index 00000000..1a8325a2 --- /dev/null +++ b/42TestingPoints/SinglePhysics/NonlinearProblems/DynamicProblems/NavierStokes/2D/TRI/CubicVelocityQuadraticPressure/LEVEL_2/Fortran/CMakeLists.txt @@ -0,0 +1,60 @@ + +# Add example executable +add_executable(LEVEL_2 src/LEVEL_2Example.f90) + +# Turn on Fortran preprocessing (#include directives) +if (MSVC) + set(PROC_OPT "/fpp") +else() + set(PROC_OPT "-cpp") +endif() + +# in debug mode, add flag that make Floating point exceptions fatal +set(OPT "") +if (FALSE) + if(CMAKE_BUILD_TYPE MATCHES DEBUG) + set(OPT "-ffpe-trap=invalid,zero,underflow,overflow,denormal") # GCC: make floating point exceptions fatal + endif() +endif() + +target_compile_options(LEVEL_2 PRIVATE ${PROC_OPT} ${OPT} "-fbacktrace") + +# Link to opencmiss +# ----------------- +# +# This simply uses the opencmiss target created by OC_INIT() above. +# +# Alternatively, you can also directly invoke 'find_package(Iron )' 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 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(LEVEL_2 PRIVATE opencmiss) + +# Add a simple test that runs the executable +add_test(NAME test_LEVEL_2 COMMAND LEVEL_2) +add_opencmiss_environment(test_LEVEL_2) + +################### +# 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. +# diff --git a/42TestingPoints/SinglePhysics/NonlinearProblems/DynamicProblems/NavierStokes/2D/TRI/CubicVelocityQuadraticPressure/LEVEL_2/src/LEVEL_2Example.f90 b/42TestingPoints/SinglePhysics/NonlinearProblems/DynamicProblems/NavierStokes/2D/TRI/CubicVelocityQuadraticPressure/LEVEL_2/Fortran/src/LEVEL_2Example.f90 similarity index 100% rename from 42TestingPoints/SinglePhysics/NonlinearProblems/DynamicProblems/NavierStokes/2D/TRI/CubicVelocityQuadraticPressure/LEVEL_2/src/LEVEL_2Example.f90 rename to 42TestingPoints/SinglePhysics/NonlinearProblems/DynamicProblems/NavierStokes/2D/TRI/CubicVelocityQuadraticPressure/LEVEL_2/Fortran/src/LEVEL_2Example.f90 diff --git a/42TestingPoints/SinglePhysics/NonlinearProblems/DynamicProblems/NavierStokes/2D/TRI/CubicVelocityQuadraticPressure/LEVEL_2/OpenCMISS.cmake b/42TestingPoints/SinglePhysics/NonlinearProblems/DynamicProblems/NavierStokes/2D/TRI/CubicVelocityQuadraticPressure/LEVEL_2/OpenCMISS.cmake new file mode 100644 index 00000000..3d6cf515 --- /dev/null +++ b/42TestingPoints/SinglePhysics/NonlinearProblems/DynamicProblems/NavierStokes/2D/TRI/CubicVelocityQuadraticPressure/LEVEL_2/OpenCMISS.cmake @@ -0,0 +1,95 @@ +########################### +# *DO NOT CHANGE THIS FILE* +########################### +# +# Prepares the use of OpenCMISS by scanning at various path locations for OpenCMISS (SDK) installations. +# +# Search order: +# - OPENCMISS_INSTALL_DIR variable +# - OPENCMISS_INSTALL_DIR environment variable +# - OPENCMISS_SDK_DIR variable +# - OPENCMISS_SDK_DIR environment variable +# - [Windows only] The Registry is searched additionally for installed SDKs. +# +# If found +# - Includes the toolchain config script of the found opencmiss installation to enable toolchain selection logic (non-windows) + +# Convenience: The OPENCMISS_INSTALL_DIR may also be defined in the environment and various other places +if (DEFINED OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using specified installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The specified OPENCMISS_INSTALL_DIR '${OPENCMISS_INSTALL_DIR}' does not exist. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_INSTALL_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_INSTALL_DIR}" OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using environment installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The environment variable OPENCMISS_INSTALL_DIR='${OPENCMISS_INSTALL_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if (NOT OPENCMISS_INSTALL_DIR AND DEFINED OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The specified OPENCMISS_SDK_DIR '${OPENCMISS_SDK_DIR}' does not exist. Skipping.") + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_SDK_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_SDK_DIR}" OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using environment SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The environment variable OPENCMISS_SDK_DIR='${OPENCMISS_SDK_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_SDK_DIR) + endif() +endif() +# On windows: check the registry for installed OpenCMISS SDKs +if(NOT OPENCMISS_INSTALL_DIR AND WIN32) + foreach(ROOT HKEY_CURRENT_USER HKEY_LOCAL_MACHINE) + foreach(PACKAGE OpenCMISSUserSDK OpenCMISSDeveloperSDK) + set(_REG_KEY "[${ROOT}\\Software\\Auckland Bioengineering Institute\\${PACKAGE}]") + get_filename_component(OPENCMISS_INSTALL_DIR "${_REG_KEY}" ABSOLUTE) + #message(STATUS "Trying registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Found ${PACKAGE} in Windows registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + break() + else() + unset(OPENCMISS_INSTALL_DIR) + endif() + endforeach() + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + break() + endif() + endforeach() +endif() + +if(OPENCMISS_INSTALL_DIR) + message(STATUS "OPENCMISS_INSTALL_DIR=${OPENCMISS_INSTALL_DIR}") + # Use the OpenCMISS scripts to also allow choosing a separate toolchain + # This file is located at the opencmiss installation rather than the local example + # as it avoids file replication and makes maintenance much easier + if (TOOLCHAIN) + set(_OCTC ${OPENCMISS_INSTALL_DIR}/cmake/OCToolchainCompilers.cmake) + if (EXISTS "${_OCTC}") + include(${_OCTC}) + else() + message(WARNING "TOOLCHAIN specified but OpenCMISS config script could not be found at ${_OCTC}. Trying CMake defaults.") + endif() + unset(_OCTC) + endif() + set(OpenCMISS_DIR "${OPENCMISS_INSTALL_DIR}" CACHE PATH "Path to the found OpenCMISS (SDK) installation") +else() + message(WARNING "No OpenCMISS (SDK) installation directory detected. Using default system environment.") +endif() + \ No newline at end of file diff --git a/42TestingPoints/SinglePhysics/NonlinearProblems/DynamicProblems/NavierStokes/2D/TRI/CubicVelocityQuadraticPressure/LEVEL_2/build_debug/build.sh b/42TestingPoints/SinglePhysics/NonlinearProblems/DynamicProblems/NavierStokes/2D/TRI/CubicVelocityQuadraticPressure/LEVEL_2/build_debug/build.sh new file mode 100644 index 00000000..e6624bac --- /dev/null +++ b/42TestingPoints/SinglePhysics/NonlinearProblems/DynamicProblems/NavierStokes/2D/TRI/CubicVelocityQuadraticPressure/LEVEL_2/build_debug/build.sh @@ -0,0 +1,2 @@ +#ccc && cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all +cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all diff --git a/42TestingPoints/SinglePhysics/NonlinearProblems/DynamicProblems/NavierStokes/2D/TRI/QuadraticVelocityLinearPressure/LEVEL_2/CMakeLists.txt b/42TestingPoints/SinglePhysics/NonlinearProblems/DynamicProblems/NavierStokes/2D/TRI/QuadraticVelocityLinearPressure/LEVEL_2/CMakeLists.txt new file mode 100644 index 00000000..a22b61ee --- /dev/null +++ b/42TestingPoints/SinglePhysics/NonlinearProblems/DynamicProblems/NavierStokes/2D/TRI/QuadraticVelocityLinearPressure/LEVEL_2/CMakeLists.txt @@ -0,0 +1,35 @@ +# 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 C) +enable_language(Fortran OPTIONAL) +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 +# ---------------------- +#add_subdirectory(C) +if (CMAKE_Fortran_COMPILER) + add_subdirectory(Fortran) +endif() diff --git a/42TestingPoints/SinglePhysics/NonlinearProblems/DynamicProblems/NavierStokes/2D/TRI/QuadraticVelocityLinearPressure/LEVEL_2/Fortran/CMakeLists.txt b/42TestingPoints/SinglePhysics/NonlinearProblems/DynamicProblems/NavierStokes/2D/TRI/QuadraticVelocityLinearPressure/LEVEL_2/Fortran/CMakeLists.txt new file mode 100644 index 00000000..1a8325a2 --- /dev/null +++ b/42TestingPoints/SinglePhysics/NonlinearProblems/DynamicProblems/NavierStokes/2D/TRI/QuadraticVelocityLinearPressure/LEVEL_2/Fortran/CMakeLists.txt @@ -0,0 +1,60 @@ + +# Add example executable +add_executable(LEVEL_2 src/LEVEL_2Example.f90) + +# Turn on Fortran preprocessing (#include directives) +if (MSVC) + set(PROC_OPT "/fpp") +else() + set(PROC_OPT "-cpp") +endif() + +# in debug mode, add flag that make Floating point exceptions fatal +set(OPT "") +if (FALSE) + if(CMAKE_BUILD_TYPE MATCHES DEBUG) + set(OPT "-ffpe-trap=invalid,zero,underflow,overflow,denormal") # GCC: make floating point exceptions fatal + endif() +endif() + +target_compile_options(LEVEL_2 PRIVATE ${PROC_OPT} ${OPT} "-fbacktrace") + +# Link to opencmiss +# ----------------- +# +# This simply uses the opencmiss target created by OC_INIT() above. +# +# Alternatively, you can also directly invoke 'find_package(Iron )' 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 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(LEVEL_2 PRIVATE opencmiss) + +# Add a simple test that runs the executable +add_test(NAME test_LEVEL_2 COMMAND LEVEL_2) +add_opencmiss_environment(test_LEVEL_2) + +################### +# 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. +# diff --git a/42TestingPoints/SinglePhysics/NonlinearProblems/DynamicProblems/NavierStokes/2D/TRI/QuadraticVelocityLinearPressure/LEVEL_2/src/LEVEL_2Example.f90 b/42TestingPoints/SinglePhysics/NonlinearProblems/DynamicProblems/NavierStokes/2D/TRI/QuadraticVelocityLinearPressure/LEVEL_2/Fortran/src/LEVEL_2Example.f90 similarity index 100% rename from 42TestingPoints/SinglePhysics/NonlinearProblems/DynamicProblems/NavierStokes/2D/TRI/QuadraticVelocityLinearPressure/LEVEL_2/src/LEVEL_2Example.f90 rename to 42TestingPoints/SinglePhysics/NonlinearProblems/DynamicProblems/NavierStokes/2D/TRI/QuadraticVelocityLinearPressure/LEVEL_2/Fortran/src/LEVEL_2Example.f90 diff --git a/42TestingPoints/SinglePhysics/NonlinearProblems/DynamicProblems/NavierStokes/2D/TRI/QuadraticVelocityLinearPressure/LEVEL_2/OpenCMISS.cmake b/42TestingPoints/SinglePhysics/NonlinearProblems/DynamicProblems/NavierStokes/2D/TRI/QuadraticVelocityLinearPressure/LEVEL_2/OpenCMISS.cmake new file mode 100644 index 00000000..3d6cf515 --- /dev/null +++ b/42TestingPoints/SinglePhysics/NonlinearProblems/DynamicProblems/NavierStokes/2D/TRI/QuadraticVelocityLinearPressure/LEVEL_2/OpenCMISS.cmake @@ -0,0 +1,95 @@ +########################### +# *DO NOT CHANGE THIS FILE* +########################### +# +# Prepares the use of OpenCMISS by scanning at various path locations for OpenCMISS (SDK) installations. +# +# Search order: +# - OPENCMISS_INSTALL_DIR variable +# - OPENCMISS_INSTALL_DIR environment variable +# - OPENCMISS_SDK_DIR variable +# - OPENCMISS_SDK_DIR environment variable +# - [Windows only] The Registry is searched additionally for installed SDKs. +# +# If found +# - Includes the toolchain config script of the found opencmiss installation to enable toolchain selection logic (non-windows) + +# Convenience: The OPENCMISS_INSTALL_DIR may also be defined in the environment and various other places +if (DEFINED OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using specified installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The specified OPENCMISS_INSTALL_DIR '${OPENCMISS_INSTALL_DIR}' does not exist. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_INSTALL_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_INSTALL_DIR}" OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using environment installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The environment variable OPENCMISS_INSTALL_DIR='${OPENCMISS_INSTALL_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if (NOT OPENCMISS_INSTALL_DIR AND DEFINED OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The specified OPENCMISS_SDK_DIR '${OPENCMISS_SDK_DIR}' does not exist. Skipping.") + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_SDK_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_SDK_DIR}" OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using environment SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The environment variable OPENCMISS_SDK_DIR='${OPENCMISS_SDK_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_SDK_DIR) + endif() +endif() +# On windows: check the registry for installed OpenCMISS SDKs +if(NOT OPENCMISS_INSTALL_DIR AND WIN32) + foreach(ROOT HKEY_CURRENT_USER HKEY_LOCAL_MACHINE) + foreach(PACKAGE OpenCMISSUserSDK OpenCMISSDeveloperSDK) + set(_REG_KEY "[${ROOT}\\Software\\Auckland Bioengineering Institute\\${PACKAGE}]") + get_filename_component(OPENCMISS_INSTALL_DIR "${_REG_KEY}" ABSOLUTE) + #message(STATUS "Trying registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Found ${PACKAGE} in Windows registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + break() + else() + unset(OPENCMISS_INSTALL_DIR) + endif() + endforeach() + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + break() + endif() + endforeach() +endif() + +if(OPENCMISS_INSTALL_DIR) + message(STATUS "OPENCMISS_INSTALL_DIR=${OPENCMISS_INSTALL_DIR}") + # Use the OpenCMISS scripts to also allow choosing a separate toolchain + # This file is located at the opencmiss installation rather than the local example + # as it avoids file replication and makes maintenance much easier + if (TOOLCHAIN) + set(_OCTC ${OPENCMISS_INSTALL_DIR}/cmake/OCToolchainCompilers.cmake) + if (EXISTS "${_OCTC}") + include(${_OCTC}) + else() + message(WARNING "TOOLCHAIN specified but OpenCMISS config script could not be found at ${_OCTC}. Trying CMake defaults.") + endif() + unset(_OCTC) + endif() + set(OpenCMISS_DIR "${OPENCMISS_INSTALL_DIR}" CACHE PATH "Path to the found OpenCMISS (SDK) installation") +else() + message(WARNING "No OpenCMISS (SDK) installation directory detected. Using default system environment.") +endif() + \ No newline at end of file diff --git a/42TestingPoints/SinglePhysics/NonlinearProblems/DynamicProblems/NavierStokes/2D/TRI/QuadraticVelocityLinearPressure/LEVEL_2/build_debug/build.sh b/42TestingPoints/SinglePhysics/NonlinearProblems/DynamicProblems/NavierStokes/2D/TRI/QuadraticVelocityLinearPressure/LEVEL_2/build_debug/build.sh new file mode 100644 index 00000000..e6624bac --- /dev/null +++ b/42TestingPoints/SinglePhysics/NonlinearProblems/DynamicProblems/NavierStokes/2D/TRI/QuadraticVelocityLinearPressure/LEVEL_2/build_debug/build.sh @@ -0,0 +1,2 @@ +#ccc && cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all +cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all diff --git a/42TestingPoints/SinglePhysics/NonlinearProblems/DynamicProblems/NavierStokes/3D/HEX/CubicVelocityLinearPressure/LEVEL_2/CMakeLists.txt b/42TestingPoints/SinglePhysics/NonlinearProblems/DynamicProblems/NavierStokes/3D/HEX/CubicVelocityLinearPressure/LEVEL_2/CMakeLists.txt new file mode 100644 index 00000000..a22b61ee --- /dev/null +++ b/42TestingPoints/SinglePhysics/NonlinearProblems/DynamicProblems/NavierStokes/3D/HEX/CubicVelocityLinearPressure/LEVEL_2/CMakeLists.txt @@ -0,0 +1,35 @@ +# 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 C) +enable_language(Fortran OPTIONAL) +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 +# ---------------------- +#add_subdirectory(C) +if (CMAKE_Fortran_COMPILER) + add_subdirectory(Fortran) +endif() diff --git a/42TestingPoints/SinglePhysics/NonlinearProblems/DynamicProblems/NavierStokes/3D/HEX/CubicVelocityLinearPressure/LEVEL_2/Fortran/CMakeLists.txt b/42TestingPoints/SinglePhysics/NonlinearProblems/DynamicProblems/NavierStokes/3D/HEX/CubicVelocityLinearPressure/LEVEL_2/Fortran/CMakeLists.txt new file mode 100644 index 00000000..1a8325a2 --- /dev/null +++ b/42TestingPoints/SinglePhysics/NonlinearProblems/DynamicProblems/NavierStokes/3D/HEX/CubicVelocityLinearPressure/LEVEL_2/Fortran/CMakeLists.txt @@ -0,0 +1,60 @@ + +# Add example executable +add_executable(LEVEL_2 src/LEVEL_2Example.f90) + +# Turn on Fortran preprocessing (#include directives) +if (MSVC) + set(PROC_OPT "/fpp") +else() + set(PROC_OPT "-cpp") +endif() + +# in debug mode, add flag that make Floating point exceptions fatal +set(OPT "") +if (FALSE) + if(CMAKE_BUILD_TYPE MATCHES DEBUG) + set(OPT "-ffpe-trap=invalid,zero,underflow,overflow,denormal") # GCC: make floating point exceptions fatal + endif() +endif() + +target_compile_options(LEVEL_2 PRIVATE ${PROC_OPT} ${OPT} "-fbacktrace") + +# Link to opencmiss +# ----------------- +# +# This simply uses the opencmiss target created by OC_INIT() above. +# +# Alternatively, you can also directly invoke 'find_package(Iron )' 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 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(LEVEL_2 PRIVATE opencmiss) + +# Add a simple test that runs the executable +add_test(NAME test_LEVEL_2 COMMAND LEVEL_2) +add_opencmiss_environment(test_LEVEL_2) + +################### +# 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. +# diff --git a/42TestingPoints/SinglePhysics/NonlinearProblems/DynamicProblems/NavierStokes/3D/HEX/CubicVelocityLinearPressure/LEVEL_2/src/LEVEL_2Example.f90 b/42TestingPoints/SinglePhysics/NonlinearProblems/DynamicProblems/NavierStokes/3D/HEX/CubicVelocityLinearPressure/LEVEL_2/Fortran/src/LEVEL_2Example.f90 similarity index 100% rename from 42TestingPoints/SinglePhysics/NonlinearProblems/DynamicProblems/NavierStokes/3D/HEX/CubicVelocityLinearPressure/LEVEL_2/src/LEVEL_2Example.f90 rename to 42TestingPoints/SinglePhysics/NonlinearProblems/DynamicProblems/NavierStokes/3D/HEX/CubicVelocityLinearPressure/LEVEL_2/Fortran/src/LEVEL_2Example.f90 diff --git a/42TestingPoints/SinglePhysics/NonlinearProblems/DynamicProblems/NavierStokes/3D/HEX/CubicVelocityLinearPressure/LEVEL_2/OpenCMISS.cmake b/42TestingPoints/SinglePhysics/NonlinearProblems/DynamicProblems/NavierStokes/3D/HEX/CubicVelocityLinearPressure/LEVEL_2/OpenCMISS.cmake new file mode 100644 index 00000000..3d6cf515 --- /dev/null +++ b/42TestingPoints/SinglePhysics/NonlinearProblems/DynamicProblems/NavierStokes/3D/HEX/CubicVelocityLinearPressure/LEVEL_2/OpenCMISS.cmake @@ -0,0 +1,95 @@ +########################### +# *DO NOT CHANGE THIS FILE* +########################### +# +# Prepares the use of OpenCMISS by scanning at various path locations for OpenCMISS (SDK) installations. +# +# Search order: +# - OPENCMISS_INSTALL_DIR variable +# - OPENCMISS_INSTALL_DIR environment variable +# - OPENCMISS_SDK_DIR variable +# - OPENCMISS_SDK_DIR environment variable +# - [Windows only] The Registry is searched additionally for installed SDKs. +# +# If found +# - Includes the toolchain config script of the found opencmiss installation to enable toolchain selection logic (non-windows) + +# Convenience: The OPENCMISS_INSTALL_DIR may also be defined in the environment and various other places +if (DEFINED OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using specified installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The specified OPENCMISS_INSTALL_DIR '${OPENCMISS_INSTALL_DIR}' does not exist. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_INSTALL_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_INSTALL_DIR}" OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using environment installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The environment variable OPENCMISS_INSTALL_DIR='${OPENCMISS_INSTALL_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if (NOT OPENCMISS_INSTALL_DIR AND DEFINED OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The specified OPENCMISS_SDK_DIR '${OPENCMISS_SDK_DIR}' does not exist. Skipping.") + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_SDK_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_SDK_DIR}" OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using environment SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The environment variable OPENCMISS_SDK_DIR='${OPENCMISS_SDK_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_SDK_DIR) + endif() +endif() +# On windows: check the registry for installed OpenCMISS SDKs +if(NOT OPENCMISS_INSTALL_DIR AND WIN32) + foreach(ROOT HKEY_CURRENT_USER HKEY_LOCAL_MACHINE) + foreach(PACKAGE OpenCMISSUserSDK OpenCMISSDeveloperSDK) + set(_REG_KEY "[${ROOT}\\Software\\Auckland Bioengineering Institute\\${PACKAGE}]") + get_filename_component(OPENCMISS_INSTALL_DIR "${_REG_KEY}" ABSOLUTE) + #message(STATUS "Trying registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Found ${PACKAGE} in Windows registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + break() + else() + unset(OPENCMISS_INSTALL_DIR) + endif() + endforeach() + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + break() + endif() + endforeach() +endif() + +if(OPENCMISS_INSTALL_DIR) + message(STATUS "OPENCMISS_INSTALL_DIR=${OPENCMISS_INSTALL_DIR}") + # Use the OpenCMISS scripts to also allow choosing a separate toolchain + # This file is located at the opencmiss installation rather than the local example + # as it avoids file replication and makes maintenance much easier + if (TOOLCHAIN) + set(_OCTC ${OPENCMISS_INSTALL_DIR}/cmake/OCToolchainCompilers.cmake) + if (EXISTS "${_OCTC}") + include(${_OCTC}) + else() + message(WARNING "TOOLCHAIN specified but OpenCMISS config script could not be found at ${_OCTC}. Trying CMake defaults.") + endif() + unset(_OCTC) + endif() + set(OpenCMISS_DIR "${OPENCMISS_INSTALL_DIR}" CACHE PATH "Path to the found OpenCMISS (SDK) installation") +else() + message(WARNING "No OpenCMISS (SDK) installation directory detected. Using default system environment.") +endif() + \ No newline at end of file diff --git a/42TestingPoints/SinglePhysics/NonlinearProblems/DynamicProblems/NavierStokes/3D/HEX/CubicVelocityLinearPressure/LEVEL_2/build_debug/build.sh b/42TestingPoints/SinglePhysics/NonlinearProblems/DynamicProblems/NavierStokes/3D/HEX/CubicVelocityLinearPressure/LEVEL_2/build_debug/build.sh new file mode 100644 index 00000000..e6624bac --- /dev/null +++ b/42TestingPoints/SinglePhysics/NonlinearProblems/DynamicProblems/NavierStokes/3D/HEX/CubicVelocityLinearPressure/LEVEL_2/build_debug/build.sh @@ -0,0 +1,2 @@ +#ccc && cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all +cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all diff --git a/42TestingPoints/SinglePhysics/NonlinearProblems/DynamicProblems/NavierStokes/3D/HEX/CubicVelocityQuadraticPressure/LEVEL_2/CMakeLists.txt b/42TestingPoints/SinglePhysics/NonlinearProblems/DynamicProblems/NavierStokes/3D/HEX/CubicVelocityQuadraticPressure/LEVEL_2/CMakeLists.txt new file mode 100644 index 00000000..a22b61ee --- /dev/null +++ b/42TestingPoints/SinglePhysics/NonlinearProblems/DynamicProblems/NavierStokes/3D/HEX/CubicVelocityQuadraticPressure/LEVEL_2/CMakeLists.txt @@ -0,0 +1,35 @@ +# 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 C) +enable_language(Fortran OPTIONAL) +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 +# ---------------------- +#add_subdirectory(C) +if (CMAKE_Fortran_COMPILER) + add_subdirectory(Fortran) +endif() diff --git a/42TestingPoints/SinglePhysics/NonlinearProblems/DynamicProblems/NavierStokes/3D/HEX/CubicVelocityQuadraticPressure/LEVEL_2/Fortran/CMakeLists.txt b/42TestingPoints/SinglePhysics/NonlinearProblems/DynamicProblems/NavierStokes/3D/HEX/CubicVelocityQuadraticPressure/LEVEL_2/Fortran/CMakeLists.txt new file mode 100644 index 00000000..1a8325a2 --- /dev/null +++ b/42TestingPoints/SinglePhysics/NonlinearProblems/DynamicProblems/NavierStokes/3D/HEX/CubicVelocityQuadraticPressure/LEVEL_2/Fortran/CMakeLists.txt @@ -0,0 +1,60 @@ + +# Add example executable +add_executable(LEVEL_2 src/LEVEL_2Example.f90) + +# Turn on Fortran preprocessing (#include directives) +if (MSVC) + set(PROC_OPT "/fpp") +else() + set(PROC_OPT "-cpp") +endif() + +# in debug mode, add flag that make Floating point exceptions fatal +set(OPT "") +if (FALSE) + if(CMAKE_BUILD_TYPE MATCHES DEBUG) + set(OPT "-ffpe-trap=invalid,zero,underflow,overflow,denormal") # GCC: make floating point exceptions fatal + endif() +endif() + +target_compile_options(LEVEL_2 PRIVATE ${PROC_OPT} ${OPT} "-fbacktrace") + +# Link to opencmiss +# ----------------- +# +# This simply uses the opencmiss target created by OC_INIT() above. +# +# Alternatively, you can also directly invoke 'find_package(Iron )' 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 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(LEVEL_2 PRIVATE opencmiss) + +# Add a simple test that runs the executable +add_test(NAME test_LEVEL_2 COMMAND LEVEL_2) +add_opencmiss_environment(test_LEVEL_2) + +################### +# 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. +# diff --git a/42TestingPoints/SinglePhysics/NonlinearProblems/DynamicProblems/NavierStokes/3D/HEX/CubicVelocityQuadraticPressure/LEVEL_2/src/LEVEL_2Example.f90 b/42TestingPoints/SinglePhysics/NonlinearProblems/DynamicProblems/NavierStokes/3D/HEX/CubicVelocityQuadraticPressure/LEVEL_2/Fortran/src/LEVEL_2Example.f90 similarity index 100% rename from 42TestingPoints/SinglePhysics/NonlinearProblems/DynamicProblems/NavierStokes/3D/HEX/CubicVelocityQuadraticPressure/LEVEL_2/src/LEVEL_2Example.f90 rename to 42TestingPoints/SinglePhysics/NonlinearProblems/DynamicProblems/NavierStokes/3D/HEX/CubicVelocityQuadraticPressure/LEVEL_2/Fortran/src/LEVEL_2Example.f90 diff --git a/42TestingPoints/SinglePhysics/NonlinearProblems/DynamicProblems/NavierStokes/3D/HEX/CubicVelocityQuadraticPressure/LEVEL_2/OpenCMISS.cmake b/42TestingPoints/SinglePhysics/NonlinearProblems/DynamicProblems/NavierStokes/3D/HEX/CubicVelocityQuadraticPressure/LEVEL_2/OpenCMISS.cmake new file mode 100644 index 00000000..3d6cf515 --- /dev/null +++ b/42TestingPoints/SinglePhysics/NonlinearProblems/DynamicProblems/NavierStokes/3D/HEX/CubicVelocityQuadraticPressure/LEVEL_2/OpenCMISS.cmake @@ -0,0 +1,95 @@ +########################### +# *DO NOT CHANGE THIS FILE* +########################### +# +# Prepares the use of OpenCMISS by scanning at various path locations for OpenCMISS (SDK) installations. +# +# Search order: +# - OPENCMISS_INSTALL_DIR variable +# - OPENCMISS_INSTALL_DIR environment variable +# - OPENCMISS_SDK_DIR variable +# - OPENCMISS_SDK_DIR environment variable +# - [Windows only] The Registry is searched additionally for installed SDKs. +# +# If found +# - Includes the toolchain config script of the found opencmiss installation to enable toolchain selection logic (non-windows) + +# Convenience: The OPENCMISS_INSTALL_DIR may also be defined in the environment and various other places +if (DEFINED OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using specified installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The specified OPENCMISS_INSTALL_DIR '${OPENCMISS_INSTALL_DIR}' does not exist. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_INSTALL_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_INSTALL_DIR}" OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using environment installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The environment variable OPENCMISS_INSTALL_DIR='${OPENCMISS_INSTALL_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if (NOT OPENCMISS_INSTALL_DIR AND DEFINED OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The specified OPENCMISS_SDK_DIR '${OPENCMISS_SDK_DIR}' does not exist. Skipping.") + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_SDK_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_SDK_DIR}" OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using environment SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The environment variable OPENCMISS_SDK_DIR='${OPENCMISS_SDK_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_SDK_DIR) + endif() +endif() +# On windows: check the registry for installed OpenCMISS SDKs +if(NOT OPENCMISS_INSTALL_DIR AND WIN32) + foreach(ROOT HKEY_CURRENT_USER HKEY_LOCAL_MACHINE) + foreach(PACKAGE OpenCMISSUserSDK OpenCMISSDeveloperSDK) + set(_REG_KEY "[${ROOT}\\Software\\Auckland Bioengineering Institute\\${PACKAGE}]") + get_filename_component(OPENCMISS_INSTALL_DIR "${_REG_KEY}" ABSOLUTE) + #message(STATUS "Trying registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Found ${PACKAGE} in Windows registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + break() + else() + unset(OPENCMISS_INSTALL_DIR) + endif() + endforeach() + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + break() + endif() + endforeach() +endif() + +if(OPENCMISS_INSTALL_DIR) + message(STATUS "OPENCMISS_INSTALL_DIR=${OPENCMISS_INSTALL_DIR}") + # Use the OpenCMISS scripts to also allow choosing a separate toolchain + # This file is located at the opencmiss installation rather than the local example + # as it avoids file replication and makes maintenance much easier + if (TOOLCHAIN) + set(_OCTC ${OPENCMISS_INSTALL_DIR}/cmake/OCToolchainCompilers.cmake) + if (EXISTS "${_OCTC}") + include(${_OCTC}) + else() + message(WARNING "TOOLCHAIN specified but OpenCMISS config script could not be found at ${_OCTC}. Trying CMake defaults.") + endif() + unset(_OCTC) + endif() + set(OpenCMISS_DIR "${OPENCMISS_INSTALL_DIR}" CACHE PATH "Path to the found OpenCMISS (SDK) installation") +else() + message(WARNING "No OpenCMISS (SDK) installation directory detected. Using default system environment.") +endif() + \ No newline at end of file diff --git a/42TestingPoints/SinglePhysics/NonlinearProblems/DynamicProblems/NavierStokes/3D/HEX/CubicVelocityQuadraticPressure/LEVEL_2/build_debug/build.sh b/42TestingPoints/SinglePhysics/NonlinearProblems/DynamicProblems/NavierStokes/3D/HEX/CubicVelocityQuadraticPressure/LEVEL_2/build_debug/build.sh new file mode 100644 index 00000000..e6624bac --- /dev/null +++ b/42TestingPoints/SinglePhysics/NonlinearProblems/DynamicProblems/NavierStokes/3D/HEX/CubicVelocityQuadraticPressure/LEVEL_2/build_debug/build.sh @@ -0,0 +1,2 @@ +#ccc && cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all +cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all diff --git a/42TestingPoints/SinglePhysics/NonlinearProblems/DynamicProblems/NavierStokes/3D/HEX/QuadraticVelocityLinearPressure/LEVEL_2/CMakeLists.txt b/42TestingPoints/SinglePhysics/NonlinearProblems/DynamicProblems/NavierStokes/3D/HEX/QuadraticVelocityLinearPressure/LEVEL_2/CMakeLists.txt new file mode 100644 index 00000000..a22b61ee --- /dev/null +++ b/42TestingPoints/SinglePhysics/NonlinearProblems/DynamicProblems/NavierStokes/3D/HEX/QuadraticVelocityLinearPressure/LEVEL_2/CMakeLists.txt @@ -0,0 +1,35 @@ +# 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 C) +enable_language(Fortran OPTIONAL) +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 +# ---------------------- +#add_subdirectory(C) +if (CMAKE_Fortran_COMPILER) + add_subdirectory(Fortran) +endif() diff --git a/42TestingPoints/SinglePhysics/NonlinearProblems/DynamicProblems/NavierStokes/3D/HEX/QuadraticVelocityLinearPressure/LEVEL_2/Fortran/CMakeLists.txt b/42TestingPoints/SinglePhysics/NonlinearProblems/DynamicProblems/NavierStokes/3D/HEX/QuadraticVelocityLinearPressure/LEVEL_2/Fortran/CMakeLists.txt new file mode 100644 index 00000000..1a8325a2 --- /dev/null +++ b/42TestingPoints/SinglePhysics/NonlinearProblems/DynamicProblems/NavierStokes/3D/HEX/QuadraticVelocityLinearPressure/LEVEL_2/Fortran/CMakeLists.txt @@ -0,0 +1,60 @@ + +# Add example executable +add_executable(LEVEL_2 src/LEVEL_2Example.f90) + +# Turn on Fortran preprocessing (#include directives) +if (MSVC) + set(PROC_OPT "/fpp") +else() + set(PROC_OPT "-cpp") +endif() + +# in debug mode, add flag that make Floating point exceptions fatal +set(OPT "") +if (FALSE) + if(CMAKE_BUILD_TYPE MATCHES DEBUG) + set(OPT "-ffpe-trap=invalid,zero,underflow,overflow,denormal") # GCC: make floating point exceptions fatal + endif() +endif() + +target_compile_options(LEVEL_2 PRIVATE ${PROC_OPT} ${OPT} "-fbacktrace") + +# Link to opencmiss +# ----------------- +# +# This simply uses the opencmiss target created by OC_INIT() above. +# +# Alternatively, you can also directly invoke 'find_package(Iron )' 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 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(LEVEL_2 PRIVATE opencmiss) + +# Add a simple test that runs the executable +add_test(NAME test_LEVEL_2 COMMAND LEVEL_2) +add_opencmiss_environment(test_LEVEL_2) + +################### +# 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. +# diff --git a/42TestingPoints/SinglePhysics/NonlinearProblems/DynamicProblems/NavierStokes/3D/HEX/QuadraticVelocityLinearPressure/LEVEL_2/src/LEVEL_2Example.f90 b/42TestingPoints/SinglePhysics/NonlinearProblems/DynamicProblems/NavierStokes/3D/HEX/QuadraticVelocityLinearPressure/LEVEL_2/Fortran/src/LEVEL_2Example.f90 similarity index 100% rename from 42TestingPoints/SinglePhysics/NonlinearProblems/DynamicProblems/NavierStokes/3D/HEX/QuadraticVelocityLinearPressure/LEVEL_2/src/LEVEL_2Example.f90 rename to 42TestingPoints/SinglePhysics/NonlinearProblems/DynamicProblems/NavierStokes/3D/HEX/QuadraticVelocityLinearPressure/LEVEL_2/Fortran/src/LEVEL_2Example.f90 diff --git a/42TestingPoints/SinglePhysics/NonlinearProblems/DynamicProblems/NavierStokes/3D/HEX/QuadraticVelocityLinearPressure/LEVEL_2/OpenCMISS.cmake b/42TestingPoints/SinglePhysics/NonlinearProblems/DynamicProblems/NavierStokes/3D/HEX/QuadraticVelocityLinearPressure/LEVEL_2/OpenCMISS.cmake new file mode 100644 index 00000000..3d6cf515 --- /dev/null +++ b/42TestingPoints/SinglePhysics/NonlinearProblems/DynamicProblems/NavierStokes/3D/HEX/QuadraticVelocityLinearPressure/LEVEL_2/OpenCMISS.cmake @@ -0,0 +1,95 @@ +########################### +# *DO NOT CHANGE THIS FILE* +########################### +# +# Prepares the use of OpenCMISS by scanning at various path locations for OpenCMISS (SDK) installations. +# +# Search order: +# - OPENCMISS_INSTALL_DIR variable +# - OPENCMISS_INSTALL_DIR environment variable +# - OPENCMISS_SDK_DIR variable +# - OPENCMISS_SDK_DIR environment variable +# - [Windows only] The Registry is searched additionally for installed SDKs. +# +# If found +# - Includes the toolchain config script of the found opencmiss installation to enable toolchain selection logic (non-windows) + +# Convenience: The OPENCMISS_INSTALL_DIR may also be defined in the environment and various other places +if (DEFINED OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using specified installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The specified OPENCMISS_INSTALL_DIR '${OPENCMISS_INSTALL_DIR}' does not exist. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_INSTALL_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_INSTALL_DIR}" OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using environment installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The environment variable OPENCMISS_INSTALL_DIR='${OPENCMISS_INSTALL_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if (NOT OPENCMISS_INSTALL_DIR AND DEFINED OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The specified OPENCMISS_SDK_DIR '${OPENCMISS_SDK_DIR}' does not exist. Skipping.") + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_SDK_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_SDK_DIR}" OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using environment SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The environment variable OPENCMISS_SDK_DIR='${OPENCMISS_SDK_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_SDK_DIR) + endif() +endif() +# On windows: check the registry for installed OpenCMISS SDKs +if(NOT OPENCMISS_INSTALL_DIR AND WIN32) + foreach(ROOT HKEY_CURRENT_USER HKEY_LOCAL_MACHINE) + foreach(PACKAGE OpenCMISSUserSDK OpenCMISSDeveloperSDK) + set(_REG_KEY "[${ROOT}\\Software\\Auckland Bioengineering Institute\\${PACKAGE}]") + get_filename_component(OPENCMISS_INSTALL_DIR "${_REG_KEY}" ABSOLUTE) + #message(STATUS "Trying registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Found ${PACKAGE} in Windows registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + break() + else() + unset(OPENCMISS_INSTALL_DIR) + endif() + endforeach() + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + break() + endif() + endforeach() +endif() + +if(OPENCMISS_INSTALL_DIR) + message(STATUS "OPENCMISS_INSTALL_DIR=${OPENCMISS_INSTALL_DIR}") + # Use the OpenCMISS scripts to also allow choosing a separate toolchain + # This file is located at the opencmiss installation rather than the local example + # as it avoids file replication and makes maintenance much easier + if (TOOLCHAIN) + set(_OCTC ${OPENCMISS_INSTALL_DIR}/cmake/OCToolchainCompilers.cmake) + if (EXISTS "${_OCTC}") + include(${_OCTC}) + else() + message(WARNING "TOOLCHAIN specified but OpenCMISS config script could not be found at ${_OCTC}. Trying CMake defaults.") + endif() + unset(_OCTC) + endif() + set(OpenCMISS_DIR "${OPENCMISS_INSTALL_DIR}" CACHE PATH "Path to the found OpenCMISS (SDK) installation") +else() + message(WARNING "No OpenCMISS (SDK) installation directory detected. Using default system environment.") +endif() + \ No newline at end of file diff --git a/42TestingPoints/SinglePhysics/NonlinearProblems/DynamicProblems/NavierStokes/3D/HEX/QuadraticVelocityLinearPressure/LEVEL_2/build_debug/build.sh b/42TestingPoints/SinglePhysics/NonlinearProblems/DynamicProblems/NavierStokes/3D/HEX/QuadraticVelocityLinearPressure/LEVEL_2/build_debug/build.sh new file mode 100644 index 00000000..e6624bac --- /dev/null +++ b/42TestingPoints/SinglePhysics/NonlinearProblems/DynamicProblems/NavierStokes/3D/HEX/QuadraticVelocityLinearPressure/LEVEL_2/build_debug/build.sh @@ -0,0 +1,2 @@ +#ccc && cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all +cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all diff --git a/42TestingPoints/SinglePhysics/NonlinearProblems/DynamicProblems/NavierStokes/3D/TET/CubicVelocityLinearPressure/LEVEL_2/CMakeLists.txt b/42TestingPoints/SinglePhysics/NonlinearProblems/DynamicProblems/NavierStokes/3D/TET/CubicVelocityLinearPressure/LEVEL_2/CMakeLists.txt new file mode 100644 index 00000000..a22b61ee --- /dev/null +++ b/42TestingPoints/SinglePhysics/NonlinearProblems/DynamicProblems/NavierStokes/3D/TET/CubicVelocityLinearPressure/LEVEL_2/CMakeLists.txt @@ -0,0 +1,35 @@ +# 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 C) +enable_language(Fortran OPTIONAL) +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 +# ---------------------- +#add_subdirectory(C) +if (CMAKE_Fortran_COMPILER) + add_subdirectory(Fortran) +endif() diff --git a/42TestingPoints/SinglePhysics/NonlinearProblems/DynamicProblems/NavierStokes/3D/TET/CubicVelocityLinearPressure/LEVEL_2/Fortran/CMakeLists.txt b/42TestingPoints/SinglePhysics/NonlinearProblems/DynamicProblems/NavierStokes/3D/TET/CubicVelocityLinearPressure/LEVEL_2/Fortran/CMakeLists.txt new file mode 100644 index 00000000..1a8325a2 --- /dev/null +++ b/42TestingPoints/SinglePhysics/NonlinearProblems/DynamicProblems/NavierStokes/3D/TET/CubicVelocityLinearPressure/LEVEL_2/Fortran/CMakeLists.txt @@ -0,0 +1,60 @@ + +# Add example executable +add_executable(LEVEL_2 src/LEVEL_2Example.f90) + +# Turn on Fortran preprocessing (#include directives) +if (MSVC) + set(PROC_OPT "/fpp") +else() + set(PROC_OPT "-cpp") +endif() + +# in debug mode, add flag that make Floating point exceptions fatal +set(OPT "") +if (FALSE) + if(CMAKE_BUILD_TYPE MATCHES DEBUG) + set(OPT "-ffpe-trap=invalid,zero,underflow,overflow,denormal") # GCC: make floating point exceptions fatal + endif() +endif() + +target_compile_options(LEVEL_2 PRIVATE ${PROC_OPT} ${OPT} "-fbacktrace") + +# Link to opencmiss +# ----------------- +# +# This simply uses the opencmiss target created by OC_INIT() above. +# +# Alternatively, you can also directly invoke 'find_package(Iron )' 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 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(LEVEL_2 PRIVATE opencmiss) + +# Add a simple test that runs the executable +add_test(NAME test_LEVEL_2 COMMAND LEVEL_2) +add_opencmiss_environment(test_LEVEL_2) + +################### +# 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. +# diff --git a/42TestingPoints/SinglePhysics/NonlinearProblems/DynamicProblems/NavierStokes/3D/TET/CubicVelocityLinearPressure/LEVEL_2/src/LEVEL_2Example.f90 b/42TestingPoints/SinglePhysics/NonlinearProblems/DynamicProblems/NavierStokes/3D/TET/CubicVelocityLinearPressure/LEVEL_2/Fortran/src/LEVEL_2Example.f90 similarity index 100% rename from 42TestingPoints/SinglePhysics/NonlinearProblems/DynamicProblems/NavierStokes/3D/TET/CubicVelocityLinearPressure/LEVEL_2/src/LEVEL_2Example.f90 rename to 42TestingPoints/SinglePhysics/NonlinearProblems/DynamicProblems/NavierStokes/3D/TET/CubicVelocityLinearPressure/LEVEL_2/Fortran/src/LEVEL_2Example.f90 diff --git a/42TestingPoints/SinglePhysics/NonlinearProblems/DynamicProblems/NavierStokes/3D/TET/CubicVelocityLinearPressure/LEVEL_2/OpenCMISS.cmake b/42TestingPoints/SinglePhysics/NonlinearProblems/DynamicProblems/NavierStokes/3D/TET/CubicVelocityLinearPressure/LEVEL_2/OpenCMISS.cmake new file mode 100644 index 00000000..3d6cf515 --- /dev/null +++ b/42TestingPoints/SinglePhysics/NonlinearProblems/DynamicProblems/NavierStokes/3D/TET/CubicVelocityLinearPressure/LEVEL_2/OpenCMISS.cmake @@ -0,0 +1,95 @@ +########################### +# *DO NOT CHANGE THIS FILE* +########################### +# +# Prepares the use of OpenCMISS by scanning at various path locations for OpenCMISS (SDK) installations. +# +# Search order: +# - OPENCMISS_INSTALL_DIR variable +# - OPENCMISS_INSTALL_DIR environment variable +# - OPENCMISS_SDK_DIR variable +# - OPENCMISS_SDK_DIR environment variable +# - [Windows only] The Registry is searched additionally for installed SDKs. +# +# If found +# - Includes the toolchain config script of the found opencmiss installation to enable toolchain selection logic (non-windows) + +# Convenience: The OPENCMISS_INSTALL_DIR may also be defined in the environment and various other places +if (DEFINED OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using specified installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The specified OPENCMISS_INSTALL_DIR '${OPENCMISS_INSTALL_DIR}' does not exist. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_INSTALL_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_INSTALL_DIR}" OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using environment installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The environment variable OPENCMISS_INSTALL_DIR='${OPENCMISS_INSTALL_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if (NOT OPENCMISS_INSTALL_DIR AND DEFINED OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The specified OPENCMISS_SDK_DIR '${OPENCMISS_SDK_DIR}' does not exist. Skipping.") + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_SDK_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_SDK_DIR}" OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using environment SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The environment variable OPENCMISS_SDK_DIR='${OPENCMISS_SDK_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_SDK_DIR) + endif() +endif() +# On windows: check the registry for installed OpenCMISS SDKs +if(NOT OPENCMISS_INSTALL_DIR AND WIN32) + foreach(ROOT HKEY_CURRENT_USER HKEY_LOCAL_MACHINE) + foreach(PACKAGE OpenCMISSUserSDK OpenCMISSDeveloperSDK) + set(_REG_KEY "[${ROOT}\\Software\\Auckland Bioengineering Institute\\${PACKAGE}]") + get_filename_component(OPENCMISS_INSTALL_DIR "${_REG_KEY}" ABSOLUTE) + #message(STATUS "Trying registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Found ${PACKAGE} in Windows registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + break() + else() + unset(OPENCMISS_INSTALL_DIR) + endif() + endforeach() + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + break() + endif() + endforeach() +endif() + +if(OPENCMISS_INSTALL_DIR) + message(STATUS "OPENCMISS_INSTALL_DIR=${OPENCMISS_INSTALL_DIR}") + # Use the OpenCMISS scripts to also allow choosing a separate toolchain + # This file is located at the opencmiss installation rather than the local example + # as it avoids file replication and makes maintenance much easier + if (TOOLCHAIN) + set(_OCTC ${OPENCMISS_INSTALL_DIR}/cmake/OCToolchainCompilers.cmake) + if (EXISTS "${_OCTC}") + include(${_OCTC}) + else() + message(WARNING "TOOLCHAIN specified but OpenCMISS config script could not be found at ${_OCTC}. Trying CMake defaults.") + endif() + unset(_OCTC) + endif() + set(OpenCMISS_DIR "${OPENCMISS_INSTALL_DIR}" CACHE PATH "Path to the found OpenCMISS (SDK) installation") +else() + message(WARNING "No OpenCMISS (SDK) installation directory detected. Using default system environment.") +endif() + \ No newline at end of file diff --git a/42TestingPoints/SinglePhysics/NonlinearProblems/DynamicProblems/NavierStokes/3D/TET/CubicVelocityLinearPressure/LEVEL_2/build_debug/build.sh b/42TestingPoints/SinglePhysics/NonlinearProblems/DynamicProblems/NavierStokes/3D/TET/CubicVelocityLinearPressure/LEVEL_2/build_debug/build.sh new file mode 100644 index 00000000..e6624bac --- /dev/null +++ b/42TestingPoints/SinglePhysics/NonlinearProblems/DynamicProblems/NavierStokes/3D/TET/CubicVelocityLinearPressure/LEVEL_2/build_debug/build.sh @@ -0,0 +1,2 @@ +#ccc && cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all +cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all diff --git a/42TestingPoints/SinglePhysics/NonlinearProblems/DynamicProblems/NavierStokes/3D/TET/CubicVelocityQuadraticPressure/LEVEL_2/CMakeLists.txt b/42TestingPoints/SinglePhysics/NonlinearProblems/DynamicProblems/NavierStokes/3D/TET/CubicVelocityQuadraticPressure/LEVEL_2/CMakeLists.txt new file mode 100644 index 00000000..a22b61ee --- /dev/null +++ b/42TestingPoints/SinglePhysics/NonlinearProblems/DynamicProblems/NavierStokes/3D/TET/CubicVelocityQuadraticPressure/LEVEL_2/CMakeLists.txt @@ -0,0 +1,35 @@ +# 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 C) +enable_language(Fortran OPTIONAL) +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 +# ---------------------- +#add_subdirectory(C) +if (CMAKE_Fortran_COMPILER) + add_subdirectory(Fortran) +endif() diff --git a/42TestingPoints/SinglePhysics/NonlinearProblems/DynamicProblems/NavierStokes/3D/TET/CubicVelocityQuadraticPressure/LEVEL_2/Fortran/CMakeLists.txt b/42TestingPoints/SinglePhysics/NonlinearProblems/DynamicProblems/NavierStokes/3D/TET/CubicVelocityQuadraticPressure/LEVEL_2/Fortran/CMakeLists.txt new file mode 100644 index 00000000..1a8325a2 --- /dev/null +++ b/42TestingPoints/SinglePhysics/NonlinearProblems/DynamicProblems/NavierStokes/3D/TET/CubicVelocityQuadraticPressure/LEVEL_2/Fortran/CMakeLists.txt @@ -0,0 +1,60 @@ + +# Add example executable +add_executable(LEVEL_2 src/LEVEL_2Example.f90) + +# Turn on Fortran preprocessing (#include directives) +if (MSVC) + set(PROC_OPT "/fpp") +else() + set(PROC_OPT "-cpp") +endif() + +# in debug mode, add flag that make Floating point exceptions fatal +set(OPT "") +if (FALSE) + if(CMAKE_BUILD_TYPE MATCHES DEBUG) + set(OPT "-ffpe-trap=invalid,zero,underflow,overflow,denormal") # GCC: make floating point exceptions fatal + endif() +endif() + +target_compile_options(LEVEL_2 PRIVATE ${PROC_OPT} ${OPT} "-fbacktrace") + +# Link to opencmiss +# ----------------- +# +# This simply uses the opencmiss target created by OC_INIT() above. +# +# Alternatively, you can also directly invoke 'find_package(Iron )' 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 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(LEVEL_2 PRIVATE opencmiss) + +# Add a simple test that runs the executable +add_test(NAME test_LEVEL_2 COMMAND LEVEL_2) +add_opencmiss_environment(test_LEVEL_2) + +################### +# 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. +# diff --git a/42TestingPoints/SinglePhysics/NonlinearProblems/DynamicProblems/NavierStokes/3D/TET/CubicVelocityQuadraticPressure/LEVEL_2/src/LEVEL_2Example.f90 b/42TestingPoints/SinglePhysics/NonlinearProblems/DynamicProblems/NavierStokes/3D/TET/CubicVelocityQuadraticPressure/LEVEL_2/Fortran/src/LEVEL_2Example.f90 similarity index 100% rename from 42TestingPoints/SinglePhysics/NonlinearProblems/DynamicProblems/NavierStokes/3D/TET/CubicVelocityQuadraticPressure/LEVEL_2/src/LEVEL_2Example.f90 rename to 42TestingPoints/SinglePhysics/NonlinearProblems/DynamicProblems/NavierStokes/3D/TET/CubicVelocityQuadraticPressure/LEVEL_2/Fortran/src/LEVEL_2Example.f90 diff --git a/42TestingPoints/SinglePhysics/NonlinearProblems/DynamicProblems/NavierStokes/3D/TET/CubicVelocityQuadraticPressure/LEVEL_2/OpenCMISS.cmake b/42TestingPoints/SinglePhysics/NonlinearProblems/DynamicProblems/NavierStokes/3D/TET/CubicVelocityQuadraticPressure/LEVEL_2/OpenCMISS.cmake new file mode 100644 index 00000000..3d6cf515 --- /dev/null +++ b/42TestingPoints/SinglePhysics/NonlinearProblems/DynamicProblems/NavierStokes/3D/TET/CubicVelocityQuadraticPressure/LEVEL_2/OpenCMISS.cmake @@ -0,0 +1,95 @@ +########################### +# *DO NOT CHANGE THIS FILE* +########################### +# +# Prepares the use of OpenCMISS by scanning at various path locations for OpenCMISS (SDK) installations. +# +# Search order: +# - OPENCMISS_INSTALL_DIR variable +# - OPENCMISS_INSTALL_DIR environment variable +# - OPENCMISS_SDK_DIR variable +# - OPENCMISS_SDK_DIR environment variable +# - [Windows only] The Registry is searched additionally for installed SDKs. +# +# If found +# - Includes the toolchain config script of the found opencmiss installation to enable toolchain selection logic (non-windows) + +# Convenience: The OPENCMISS_INSTALL_DIR may also be defined in the environment and various other places +if (DEFINED OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using specified installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The specified OPENCMISS_INSTALL_DIR '${OPENCMISS_INSTALL_DIR}' does not exist. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_INSTALL_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_INSTALL_DIR}" OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using environment installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The environment variable OPENCMISS_INSTALL_DIR='${OPENCMISS_INSTALL_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if (NOT OPENCMISS_INSTALL_DIR AND DEFINED OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The specified OPENCMISS_SDK_DIR '${OPENCMISS_SDK_DIR}' does not exist. Skipping.") + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_SDK_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_SDK_DIR}" OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using environment SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The environment variable OPENCMISS_SDK_DIR='${OPENCMISS_SDK_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_SDK_DIR) + endif() +endif() +# On windows: check the registry for installed OpenCMISS SDKs +if(NOT OPENCMISS_INSTALL_DIR AND WIN32) + foreach(ROOT HKEY_CURRENT_USER HKEY_LOCAL_MACHINE) + foreach(PACKAGE OpenCMISSUserSDK OpenCMISSDeveloperSDK) + set(_REG_KEY "[${ROOT}\\Software\\Auckland Bioengineering Institute\\${PACKAGE}]") + get_filename_component(OPENCMISS_INSTALL_DIR "${_REG_KEY}" ABSOLUTE) + #message(STATUS "Trying registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Found ${PACKAGE} in Windows registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + break() + else() + unset(OPENCMISS_INSTALL_DIR) + endif() + endforeach() + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + break() + endif() + endforeach() +endif() + +if(OPENCMISS_INSTALL_DIR) + message(STATUS "OPENCMISS_INSTALL_DIR=${OPENCMISS_INSTALL_DIR}") + # Use the OpenCMISS scripts to also allow choosing a separate toolchain + # This file is located at the opencmiss installation rather than the local example + # as it avoids file replication and makes maintenance much easier + if (TOOLCHAIN) + set(_OCTC ${OPENCMISS_INSTALL_DIR}/cmake/OCToolchainCompilers.cmake) + if (EXISTS "${_OCTC}") + include(${_OCTC}) + else() + message(WARNING "TOOLCHAIN specified but OpenCMISS config script could not be found at ${_OCTC}. Trying CMake defaults.") + endif() + unset(_OCTC) + endif() + set(OpenCMISS_DIR "${OPENCMISS_INSTALL_DIR}" CACHE PATH "Path to the found OpenCMISS (SDK) installation") +else() + message(WARNING "No OpenCMISS (SDK) installation directory detected. Using default system environment.") +endif() + \ No newline at end of file diff --git a/42TestingPoints/SinglePhysics/NonlinearProblems/DynamicProblems/NavierStokes/3D/TET/CubicVelocityQuadraticPressure/LEVEL_2/build_debug/build.sh b/42TestingPoints/SinglePhysics/NonlinearProblems/DynamicProblems/NavierStokes/3D/TET/CubicVelocityQuadraticPressure/LEVEL_2/build_debug/build.sh new file mode 100644 index 00000000..e6624bac --- /dev/null +++ b/42TestingPoints/SinglePhysics/NonlinearProblems/DynamicProblems/NavierStokes/3D/TET/CubicVelocityQuadraticPressure/LEVEL_2/build_debug/build.sh @@ -0,0 +1,2 @@ +#ccc && cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all +cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all diff --git a/42TestingPoints/SinglePhysics/NonlinearProblems/DynamicProblems/NavierStokes/3D/TET/QuadraticVelocityLinearPressure/LEVEL_2/CMakeLists.txt b/42TestingPoints/SinglePhysics/NonlinearProblems/DynamicProblems/NavierStokes/3D/TET/QuadraticVelocityLinearPressure/LEVEL_2/CMakeLists.txt new file mode 100644 index 00000000..a22b61ee --- /dev/null +++ b/42TestingPoints/SinglePhysics/NonlinearProblems/DynamicProblems/NavierStokes/3D/TET/QuadraticVelocityLinearPressure/LEVEL_2/CMakeLists.txt @@ -0,0 +1,35 @@ +# 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 C) +enable_language(Fortran OPTIONAL) +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 +# ---------------------- +#add_subdirectory(C) +if (CMAKE_Fortran_COMPILER) + add_subdirectory(Fortran) +endif() diff --git a/42TestingPoints/SinglePhysics/NonlinearProblems/DynamicProblems/NavierStokes/3D/TET/QuadraticVelocityLinearPressure/LEVEL_2/Fortran/CMakeLists.txt b/42TestingPoints/SinglePhysics/NonlinearProblems/DynamicProblems/NavierStokes/3D/TET/QuadraticVelocityLinearPressure/LEVEL_2/Fortran/CMakeLists.txt new file mode 100644 index 00000000..1a8325a2 --- /dev/null +++ b/42TestingPoints/SinglePhysics/NonlinearProblems/DynamicProblems/NavierStokes/3D/TET/QuadraticVelocityLinearPressure/LEVEL_2/Fortran/CMakeLists.txt @@ -0,0 +1,60 @@ + +# Add example executable +add_executable(LEVEL_2 src/LEVEL_2Example.f90) + +# Turn on Fortran preprocessing (#include directives) +if (MSVC) + set(PROC_OPT "/fpp") +else() + set(PROC_OPT "-cpp") +endif() + +# in debug mode, add flag that make Floating point exceptions fatal +set(OPT "") +if (FALSE) + if(CMAKE_BUILD_TYPE MATCHES DEBUG) + set(OPT "-ffpe-trap=invalid,zero,underflow,overflow,denormal") # GCC: make floating point exceptions fatal + endif() +endif() + +target_compile_options(LEVEL_2 PRIVATE ${PROC_OPT} ${OPT} "-fbacktrace") + +# Link to opencmiss +# ----------------- +# +# This simply uses the opencmiss target created by OC_INIT() above. +# +# Alternatively, you can also directly invoke 'find_package(Iron )' 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 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(LEVEL_2 PRIVATE opencmiss) + +# Add a simple test that runs the executable +add_test(NAME test_LEVEL_2 COMMAND LEVEL_2) +add_opencmiss_environment(test_LEVEL_2) + +################### +# 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. +# diff --git a/42TestingPoints/SinglePhysics/NonlinearProblems/DynamicProblems/NavierStokes/3D/TET/QuadraticVelocityLinearPressure/LEVEL_2/src/LEVEL_2Example.f90 b/42TestingPoints/SinglePhysics/NonlinearProblems/DynamicProblems/NavierStokes/3D/TET/QuadraticVelocityLinearPressure/LEVEL_2/Fortran/src/LEVEL_2Example.f90 similarity index 100% rename from 42TestingPoints/SinglePhysics/NonlinearProblems/DynamicProblems/NavierStokes/3D/TET/QuadraticVelocityLinearPressure/LEVEL_2/src/LEVEL_2Example.f90 rename to 42TestingPoints/SinglePhysics/NonlinearProblems/DynamicProblems/NavierStokes/3D/TET/QuadraticVelocityLinearPressure/LEVEL_2/Fortran/src/LEVEL_2Example.f90 diff --git a/42TestingPoints/SinglePhysics/NonlinearProblems/DynamicProblems/NavierStokes/3D/TET/QuadraticVelocityLinearPressure/LEVEL_2/OpenCMISS.cmake b/42TestingPoints/SinglePhysics/NonlinearProblems/DynamicProblems/NavierStokes/3D/TET/QuadraticVelocityLinearPressure/LEVEL_2/OpenCMISS.cmake new file mode 100644 index 00000000..3d6cf515 --- /dev/null +++ b/42TestingPoints/SinglePhysics/NonlinearProblems/DynamicProblems/NavierStokes/3D/TET/QuadraticVelocityLinearPressure/LEVEL_2/OpenCMISS.cmake @@ -0,0 +1,95 @@ +########################### +# *DO NOT CHANGE THIS FILE* +########################### +# +# Prepares the use of OpenCMISS by scanning at various path locations for OpenCMISS (SDK) installations. +# +# Search order: +# - OPENCMISS_INSTALL_DIR variable +# - OPENCMISS_INSTALL_DIR environment variable +# - OPENCMISS_SDK_DIR variable +# - OPENCMISS_SDK_DIR environment variable +# - [Windows only] The Registry is searched additionally for installed SDKs. +# +# If found +# - Includes the toolchain config script of the found opencmiss installation to enable toolchain selection logic (non-windows) + +# Convenience: The OPENCMISS_INSTALL_DIR may also be defined in the environment and various other places +if (DEFINED OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using specified installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The specified OPENCMISS_INSTALL_DIR '${OPENCMISS_INSTALL_DIR}' does not exist. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_INSTALL_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_INSTALL_DIR}" OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using environment installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The environment variable OPENCMISS_INSTALL_DIR='${OPENCMISS_INSTALL_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if (NOT OPENCMISS_INSTALL_DIR AND DEFINED OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The specified OPENCMISS_SDK_DIR '${OPENCMISS_SDK_DIR}' does not exist. Skipping.") + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_SDK_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_SDK_DIR}" OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using environment SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The environment variable OPENCMISS_SDK_DIR='${OPENCMISS_SDK_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_SDK_DIR) + endif() +endif() +# On windows: check the registry for installed OpenCMISS SDKs +if(NOT OPENCMISS_INSTALL_DIR AND WIN32) + foreach(ROOT HKEY_CURRENT_USER HKEY_LOCAL_MACHINE) + foreach(PACKAGE OpenCMISSUserSDK OpenCMISSDeveloperSDK) + set(_REG_KEY "[${ROOT}\\Software\\Auckland Bioengineering Institute\\${PACKAGE}]") + get_filename_component(OPENCMISS_INSTALL_DIR "${_REG_KEY}" ABSOLUTE) + #message(STATUS "Trying registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Found ${PACKAGE} in Windows registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + break() + else() + unset(OPENCMISS_INSTALL_DIR) + endif() + endforeach() + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + break() + endif() + endforeach() +endif() + +if(OPENCMISS_INSTALL_DIR) + message(STATUS "OPENCMISS_INSTALL_DIR=${OPENCMISS_INSTALL_DIR}") + # Use the OpenCMISS scripts to also allow choosing a separate toolchain + # This file is located at the opencmiss installation rather than the local example + # as it avoids file replication and makes maintenance much easier + if (TOOLCHAIN) + set(_OCTC ${OPENCMISS_INSTALL_DIR}/cmake/OCToolchainCompilers.cmake) + if (EXISTS "${_OCTC}") + include(${_OCTC}) + else() + message(WARNING "TOOLCHAIN specified but OpenCMISS config script could not be found at ${_OCTC}. Trying CMake defaults.") + endif() + unset(_OCTC) + endif() + set(OpenCMISS_DIR "${OPENCMISS_INSTALL_DIR}" CACHE PATH "Path to the found OpenCMISS (SDK) installation") +else() + message(WARNING "No OpenCMISS (SDK) installation directory detected. Using default system environment.") +endif() + \ No newline at end of file diff --git a/42TestingPoints/SinglePhysics/NonlinearProblems/DynamicProblems/NavierStokes/3D/TET/QuadraticVelocityLinearPressure/LEVEL_2/build_debug/build.sh b/42TestingPoints/SinglePhysics/NonlinearProblems/DynamicProblems/NavierStokes/3D/TET/QuadraticVelocityLinearPressure/LEVEL_2/build_debug/build.sh new file mode 100644 index 00000000..e6624bac --- /dev/null +++ b/42TestingPoints/SinglePhysics/NonlinearProblems/DynamicProblems/NavierStokes/3D/TET/QuadraticVelocityLinearPressure/LEVEL_2/build_debug/build.sh @@ -0,0 +1,2 @@ +#ccc && cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all +cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all diff --git a/42TestingPoints/SinglePhysics/NonlinearProblems/StaticProblems/NavierStokes/3D/HEX/QuadraticVelocityLinearPressure/LEVEL_3/100k/CMakeLists.txt b/42TestingPoints/SinglePhysics/NonlinearProblems/StaticProblems/NavierStokes/3D/HEX/QuadraticVelocityLinearPressure/LEVEL_3/100k/CMakeLists.txt new file mode 100644 index 00000000..a22b61ee --- /dev/null +++ b/42TestingPoints/SinglePhysics/NonlinearProblems/StaticProblems/NavierStokes/3D/HEX/QuadraticVelocityLinearPressure/LEVEL_3/100k/CMakeLists.txt @@ -0,0 +1,35 @@ +# 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 C) +enable_language(Fortran OPTIONAL) +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 +# ---------------------- +#add_subdirectory(C) +if (CMAKE_Fortran_COMPILER) + add_subdirectory(Fortran) +endif() diff --git a/42TestingPoints/SinglePhysics/NonlinearProblems/StaticProblems/NavierStokes/3D/HEX/QuadraticVelocityLinearPressure/LEVEL_3/100k/Fortran/CMakeLists.txt b/42TestingPoints/SinglePhysics/NonlinearProblems/StaticProblems/NavierStokes/3D/HEX/QuadraticVelocityLinearPressure/LEVEL_3/100k/Fortran/CMakeLists.txt new file mode 100644 index 00000000..807ede3e --- /dev/null +++ b/42TestingPoints/SinglePhysics/NonlinearProblems/StaticProblems/NavierStokes/3D/HEX/QuadraticVelocityLinearPressure/LEVEL_3/100k/Fortran/CMakeLists.txt @@ -0,0 +1,60 @@ + +# Add example executable +add_executable(100k src/100kExample.f90) + +# Turn on Fortran preprocessing (#include directives) +if (MSVC) + set(PROC_OPT "/fpp") +else() + set(PROC_OPT "-cpp") +endif() + +# in debug mode, add flag that make Floating point exceptions fatal +set(OPT "") +if (FALSE) + if(CMAKE_BUILD_TYPE MATCHES DEBUG) + set(OPT "-ffpe-trap=invalid,zero,underflow,overflow,denormal") # GCC: make floating point exceptions fatal + endif() +endif() + +target_compile_options(100k PRIVATE ${PROC_OPT} ${OPT} "-fbacktrace") + +# Link to opencmiss +# ----------------- +# +# This simply uses the opencmiss target created by OC_INIT() above. +# +# Alternatively, you can also directly invoke 'find_package(Iron )' 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 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(100k PRIVATE opencmiss) + +# Add a simple test that runs the executable +add_test(NAME test_100k COMMAND 100k) +add_opencmiss_environment(test_100k) + +################### +# 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. +# diff --git a/42TestingPoints/SinglePhysics/NonlinearProblems/StaticProblems/NavierStokes/3D/HEX/QuadraticVelocityLinearPressure/LEVEL_3/100k/src/100kExample.f90 b/42TestingPoints/SinglePhysics/NonlinearProblems/StaticProblems/NavierStokes/3D/HEX/QuadraticVelocityLinearPressure/LEVEL_3/100k/Fortran/src/100kExample.f90 similarity index 100% rename from 42TestingPoints/SinglePhysics/NonlinearProblems/StaticProblems/NavierStokes/3D/HEX/QuadraticVelocityLinearPressure/LEVEL_3/100k/src/100kExample.f90 rename to 42TestingPoints/SinglePhysics/NonlinearProblems/StaticProblems/NavierStokes/3D/HEX/QuadraticVelocityLinearPressure/LEVEL_3/100k/Fortran/src/100kExample.f90 diff --git a/42TestingPoints/SinglePhysics/NonlinearProblems/StaticProblems/NavierStokes/3D/HEX/QuadraticVelocityLinearPressure/LEVEL_3/100k/OpenCMISS.cmake b/42TestingPoints/SinglePhysics/NonlinearProblems/StaticProblems/NavierStokes/3D/HEX/QuadraticVelocityLinearPressure/LEVEL_3/100k/OpenCMISS.cmake new file mode 100644 index 00000000..3d6cf515 --- /dev/null +++ b/42TestingPoints/SinglePhysics/NonlinearProblems/StaticProblems/NavierStokes/3D/HEX/QuadraticVelocityLinearPressure/LEVEL_3/100k/OpenCMISS.cmake @@ -0,0 +1,95 @@ +########################### +# *DO NOT CHANGE THIS FILE* +########################### +# +# Prepares the use of OpenCMISS by scanning at various path locations for OpenCMISS (SDK) installations. +# +# Search order: +# - OPENCMISS_INSTALL_DIR variable +# - OPENCMISS_INSTALL_DIR environment variable +# - OPENCMISS_SDK_DIR variable +# - OPENCMISS_SDK_DIR environment variable +# - [Windows only] The Registry is searched additionally for installed SDKs. +# +# If found +# - Includes the toolchain config script of the found opencmiss installation to enable toolchain selection logic (non-windows) + +# Convenience: The OPENCMISS_INSTALL_DIR may also be defined in the environment and various other places +if (DEFINED OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using specified installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The specified OPENCMISS_INSTALL_DIR '${OPENCMISS_INSTALL_DIR}' does not exist. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_INSTALL_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_INSTALL_DIR}" OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using environment installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The environment variable OPENCMISS_INSTALL_DIR='${OPENCMISS_INSTALL_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if (NOT OPENCMISS_INSTALL_DIR AND DEFINED OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The specified OPENCMISS_SDK_DIR '${OPENCMISS_SDK_DIR}' does not exist. Skipping.") + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_SDK_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_SDK_DIR}" OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using environment SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The environment variable OPENCMISS_SDK_DIR='${OPENCMISS_SDK_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_SDK_DIR) + endif() +endif() +# On windows: check the registry for installed OpenCMISS SDKs +if(NOT OPENCMISS_INSTALL_DIR AND WIN32) + foreach(ROOT HKEY_CURRENT_USER HKEY_LOCAL_MACHINE) + foreach(PACKAGE OpenCMISSUserSDK OpenCMISSDeveloperSDK) + set(_REG_KEY "[${ROOT}\\Software\\Auckland Bioengineering Institute\\${PACKAGE}]") + get_filename_component(OPENCMISS_INSTALL_DIR "${_REG_KEY}" ABSOLUTE) + #message(STATUS "Trying registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Found ${PACKAGE} in Windows registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + break() + else() + unset(OPENCMISS_INSTALL_DIR) + endif() + endforeach() + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + break() + endif() + endforeach() +endif() + +if(OPENCMISS_INSTALL_DIR) + message(STATUS "OPENCMISS_INSTALL_DIR=${OPENCMISS_INSTALL_DIR}") + # Use the OpenCMISS scripts to also allow choosing a separate toolchain + # This file is located at the opencmiss installation rather than the local example + # as it avoids file replication and makes maintenance much easier + if (TOOLCHAIN) + set(_OCTC ${OPENCMISS_INSTALL_DIR}/cmake/OCToolchainCompilers.cmake) + if (EXISTS "${_OCTC}") + include(${_OCTC}) + else() + message(WARNING "TOOLCHAIN specified but OpenCMISS config script could not be found at ${_OCTC}. Trying CMake defaults.") + endif() + unset(_OCTC) + endif() + set(OpenCMISS_DIR "${OPENCMISS_INSTALL_DIR}" CACHE PATH "Path to the found OpenCMISS (SDK) installation") +else() + message(WARNING "No OpenCMISS (SDK) installation directory detected. Using default system environment.") +endif() + \ No newline at end of file diff --git a/42TestingPoints/SinglePhysics/NonlinearProblems/StaticProblems/NavierStokes/3D/HEX/QuadraticVelocityLinearPressure/LEVEL_3/100k/build_debug/build.sh b/42TestingPoints/SinglePhysics/NonlinearProblems/StaticProblems/NavierStokes/3D/HEX/QuadraticVelocityLinearPressure/LEVEL_3/100k/build_debug/build.sh new file mode 100644 index 00000000..e6624bac --- /dev/null +++ b/42TestingPoints/SinglePhysics/NonlinearProblems/StaticProblems/NavierStokes/3D/HEX/QuadraticVelocityLinearPressure/LEVEL_3/100k/build_debug/build.sh @@ -0,0 +1,2 @@ +#ccc && cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all +cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all diff --git a/42TestingPoints/SinglePhysics/NonlinearProblems/StaticProblems/NavierStokes/3D/HEX/QuadraticVelocityLinearPressure/LEVEL_3/10k/CMakeLists.txt b/42TestingPoints/SinglePhysics/NonlinearProblems/StaticProblems/NavierStokes/3D/HEX/QuadraticVelocityLinearPressure/LEVEL_3/10k/CMakeLists.txt new file mode 100644 index 00000000..a22b61ee --- /dev/null +++ b/42TestingPoints/SinglePhysics/NonlinearProblems/StaticProblems/NavierStokes/3D/HEX/QuadraticVelocityLinearPressure/LEVEL_3/10k/CMakeLists.txt @@ -0,0 +1,35 @@ +# 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 C) +enable_language(Fortran OPTIONAL) +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 +# ---------------------- +#add_subdirectory(C) +if (CMAKE_Fortran_COMPILER) + add_subdirectory(Fortran) +endif() diff --git a/42TestingPoints/SinglePhysics/NonlinearProblems/StaticProblems/NavierStokes/3D/HEX/QuadraticVelocityLinearPressure/LEVEL_3/10k/Fortran/CMakeLists.txt b/42TestingPoints/SinglePhysics/NonlinearProblems/StaticProblems/NavierStokes/3D/HEX/QuadraticVelocityLinearPressure/LEVEL_3/10k/Fortran/CMakeLists.txt new file mode 100644 index 00000000..f07a9d89 --- /dev/null +++ b/42TestingPoints/SinglePhysics/NonlinearProblems/StaticProblems/NavierStokes/3D/HEX/QuadraticVelocityLinearPressure/LEVEL_3/10k/Fortran/CMakeLists.txt @@ -0,0 +1,60 @@ + +# Add example executable +add_executable(10k src/10kExample.f90) + +# Turn on Fortran preprocessing (#include directives) +if (MSVC) + set(PROC_OPT "/fpp") +else() + set(PROC_OPT "-cpp") +endif() + +# in debug mode, add flag that make Floating point exceptions fatal +set(OPT "") +if (FALSE) + if(CMAKE_BUILD_TYPE MATCHES DEBUG) + set(OPT "-ffpe-trap=invalid,zero,underflow,overflow,denormal") # GCC: make floating point exceptions fatal + endif() +endif() + +target_compile_options(10k PRIVATE ${PROC_OPT} ${OPT} "-fbacktrace") + +# Link to opencmiss +# ----------------- +# +# This simply uses the opencmiss target created by OC_INIT() above. +# +# Alternatively, you can also directly invoke 'find_package(Iron )' 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 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(10k PRIVATE opencmiss) + +# Add a simple test that runs the executable +add_test(NAME test_10k COMMAND 10k) +add_opencmiss_environment(test_10k) + +################### +# 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. +# diff --git a/42TestingPoints/SinglePhysics/NonlinearProblems/StaticProblems/NavierStokes/3D/HEX/QuadraticVelocityLinearPressure/LEVEL_3/10k/src/10kExample.f90 b/42TestingPoints/SinglePhysics/NonlinearProblems/StaticProblems/NavierStokes/3D/HEX/QuadraticVelocityLinearPressure/LEVEL_3/10k/Fortran/src/10kExample.f90 similarity index 100% rename from 42TestingPoints/SinglePhysics/NonlinearProblems/StaticProblems/NavierStokes/3D/HEX/QuadraticVelocityLinearPressure/LEVEL_3/10k/src/10kExample.f90 rename to 42TestingPoints/SinglePhysics/NonlinearProblems/StaticProblems/NavierStokes/3D/HEX/QuadraticVelocityLinearPressure/LEVEL_3/10k/Fortran/src/10kExample.f90 diff --git a/42TestingPoints/SinglePhysics/NonlinearProblems/StaticProblems/NavierStokes/3D/HEX/QuadraticVelocityLinearPressure/LEVEL_3/10k/OpenCMISS.cmake b/42TestingPoints/SinglePhysics/NonlinearProblems/StaticProblems/NavierStokes/3D/HEX/QuadraticVelocityLinearPressure/LEVEL_3/10k/OpenCMISS.cmake new file mode 100644 index 00000000..3d6cf515 --- /dev/null +++ b/42TestingPoints/SinglePhysics/NonlinearProblems/StaticProblems/NavierStokes/3D/HEX/QuadraticVelocityLinearPressure/LEVEL_3/10k/OpenCMISS.cmake @@ -0,0 +1,95 @@ +########################### +# *DO NOT CHANGE THIS FILE* +########################### +# +# Prepares the use of OpenCMISS by scanning at various path locations for OpenCMISS (SDK) installations. +# +# Search order: +# - OPENCMISS_INSTALL_DIR variable +# - OPENCMISS_INSTALL_DIR environment variable +# - OPENCMISS_SDK_DIR variable +# - OPENCMISS_SDK_DIR environment variable +# - [Windows only] The Registry is searched additionally for installed SDKs. +# +# If found +# - Includes the toolchain config script of the found opencmiss installation to enable toolchain selection logic (non-windows) + +# Convenience: The OPENCMISS_INSTALL_DIR may also be defined in the environment and various other places +if (DEFINED OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using specified installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The specified OPENCMISS_INSTALL_DIR '${OPENCMISS_INSTALL_DIR}' does not exist. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_INSTALL_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_INSTALL_DIR}" OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using environment installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The environment variable OPENCMISS_INSTALL_DIR='${OPENCMISS_INSTALL_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if (NOT OPENCMISS_INSTALL_DIR AND DEFINED OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The specified OPENCMISS_SDK_DIR '${OPENCMISS_SDK_DIR}' does not exist. Skipping.") + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_SDK_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_SDK_DIR}" OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using environment SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The environment variable OPENCMISS_SDK_DIR='${OPENCMISS_SDK_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_SDK_DIR) + endif() +endif() +# On windows: check the registry for installed OpenCMISS SDKs +if(NOT OPENCMISS_INSTALL_DIR AND WIN32) + foreach(ROOT HKEY_CURRENT_USER HKEY_LOCAL_MACHINE) + foreach(PACKAGE OpenCMISSUserSDK OpenCMISSDeveloperSDK) + set(_REG_KEY "[${ROOT}\\Software\\Auckland Bioengineering Institute\\${PACKAGE}]") + get_filename_component(OPENCMISS_INSTALL_DIR "${_REG_KEY}" ABSOLUTE) + #message(STATUS "Trying registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Found ${PACKAGE} in Windows registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + break() + else() + unset(OPENCMISS_INSTALL_DIR) + endif() + endforeach() + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + break() + endif() + endforeach() +endif() + +if(OPENCMISS_INSTALL_DIR) + message(STATUS "OPENCMISS_INSTALL_DIR=${OPENCMISS_INSTALL_DIR}") + # Use the OpenCMISS scripts to also allow choosing a separate toolchain + # This file is located at the opencmiss installation rather than the local example + # as it avoids file replication and makes maintenance much easier + if (TOOLCHAIN) + set(_OCTC ${OPENCMISS_INSTALL_DIR}/cmake/OCToolchainCompilers.cmake) + if (EXISTS "${_OCTC}") + include(${_OCTC}) + else() + message(WARNING "TOOLCHAIN specified but OpenCMISS config script could not be found at ${_OCTC}. Trying CMake defaults.") + endif() + unset(_OCTC) + endif() + set(OpenCMISS_DIR "${OPENCMISS_INSTALL_DIR}" CACHE PATH "Path to the found OpenCMISS (SDK) installation") +else() + message(WARNING "No OpenCMISS (SDK) installation directory detected. Using default system environment.") +endif() + \ No newline at end of file diff --git a/42TestingPoints/SinglePhysics/NonlinearProblems/StaticProblems/NavierStokes/3D/HEX/QuadraticVelocityLinearPressure/LEVEL_3/10k/build_debug/build.sh b/42TestingPoints/SinglePhysics/NonlinearProblems/StaticProblems/NavierStokes/3D/HEX/QuadraticVelocityLinearPressure/LEVEL_3/10k/build_debug/build.sh new file mode 100644 index 00000000..e6624bac --- /dev/null +++ b/42TestingPoints/SinglePhysics/NonlinearProblems/StaticProblems/NavierStokes/3D/HEX/QuadraticVelocityLinearPressure/LEVEL_3/10k/build_debug/build.sh @@ -0,0 +1,2 @@ +#ccc && cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all +cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all diff --git a/42TestingPoints/SinglePhysics/NonlinearProblems/StaticProblems/NavierStokes/3D/HEX/QuadraticVelocityLinearPressure/LEVEL_3/1k/CMakeLists.txt b/42TestingPoints/SinglePhysics/NonlinearProblems/StaticProblems/NavierStokes/3D/HEX/QuadraticVelocityLinearPressure/LEVEL_3/1k/CMakeLists.txt new file mode 100644 index 00000000..a22b61ee --- /dev/null +++ b/42TestingPoints/SinglePhysics/NonlinearProblems/StaticProblems/NavierStokes/3D/HEX/QuadraticVelocityLinearPressure/LEVEL_3/1k/CMakeLists.txt @@ -0,0 +1,35 @@ +# 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 C) +enable_language(Fortran OPTIONAL) +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 +# ---------------------- +#add_subdirectory(C) +if (CMAKE_Fortran_COMPILER) + add_subdirectory(Fortran) +endif() diff --git a/42TestingPoints/SinglePhysics/NonlinearProblems/StaticProblems/NavierStokes/3D/HEX/QuadraticVelocityLinearPressure/LEVEL_3/1k/Fortran/CMakeLists.txt b/42TestingPoints/SinglePhysics/NonlinearProblems/StaticProblems/NavierStokes/3D/HEX/QuadraticVelocityLinearPressure/LEVEL_3/1k/Fortran/CMakeLists.txt new file mode 100644 index 00000000..4b3dc8ce --- /dev/null +++ b/42TestingPoints/SinglePhysics/NonlinearProblems/StaticProblems/NavierStokes/3D/HEX/QuadraticVelocityLinearPressure/LEVEL_3/1k/Fortran/CMakeLists.txt @@ -0,0 +1,60 @@ + +# Add example executable +add_executable(1k src/1kExample.f90) + +# Turn on Fortran preprocessing (#include directives) +if (MSVC) + set(PROC_OPT "/fpp") +else() + set(PROC_OPT "-cpp") +endif() + +# in debug mode, add flag that make Floating point exceptions fatal +set(OPT "") +if (FALSE) + if(CMAKE_BUILD_TYPE MATCHES DEBUG) + set(OPT "-ffpe-trap=invalid,zero,underflow,overflow,denormal") # GCC: make floating point exceptions fatal + endif() +endif() + +target_compile_options(1k PRIVATE ${PROC_OPT} ${OPT} "-fbacktrace") + +# Link to opencmiss +# ----------------- +# +# This simply uses the opencmiss target created by OC_INIT() above. +# +# Alternatively, you can also directly invoke 'find_package(Iron )' 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 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(1k PRIVATE opencmiss) + +# Add a simple test that runs the executable +add_test(NAME test_1k COMMAND 1k) +add_opencmiss_environment(test_1k) + +################### +# 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. +# diff --git a/42TestingPoints/SinglePhysics/NonlinearProblems/StaticProblems/NavierStokes/3D/HEX/QuadraticVelocityLinearPressure/LEVEL_3/1k/src/1kExample.f90 b/42TestingPoints/SinglePhysics/NonlinearProblems/StaticProblems/NavierStokes/3D/HEX/QuadraticVelocityLinearPressure/LEVEL_3/1k/Fortran/src/1kExample.f90 similarity index 100% rename from 42TestingPoints/SinglePhysics/NonlinearProblems/StaticProblems/NavierStokes/3D/HEX/QuadraticVelocityLinearPressure/LEVEL_3/1k/src/1kExample.f90 rename to 42TestingPoints/SinglePhysics/NonlinearProblems/StaticProblems/NavierStokes/3D/HEX/QuadraticVelocityLinearPressure/LEVEL_3/1k/Fortran/src/1kExample.f90 diff --git a/42TestingPoints/SinglePhysics/NonlinearProblems/StaticProblems/NavierStokes/3D/HEX/QuadraticVelocityLinearPressure/LEVEL_3/1k/OpenCMISS.cmake b/42TestingPoints/SinglePhysics/NonlinearProblems/StaticProblems/NavierStokes/3D/HEX/QuadraticVelocityLinearPressure/LEVEL_3/1k/OpenCMISS.cmake new file mode 100644 index 00000000..3d6cf515 --- /dev/null +++ b/42TestingPoints/SinglePhysics/NonlinearProblems/StaticProblems/NavierStokes/3D/HEX/QuadraticVelocityLinearPressure/LEVEL_3/1k/OpenCMISS.cmake @@ -0,0 +1,95 @@ +########################### +# *DO NOT CHANGE THIS FILE* +########################### +# +# Prepares the use of OpenCMISS by scanning at various path locations for OpenCMISS (SDK) installations. +# +# Search order: +# - OPENCMISS_INSTALL_DIR variable +# - OPENCMISS_INSTALL_DIR environment variable +# - OPENCMISS_SDK_DIR variable +# - OPENCMISS_SDK_DIR environment variable +# - [Windows only] The Registry is searched additionally for installed SDKs. +# +# If found +# - Includes the toolchain config script of the found opencmiss installation to enable toolchain selection logic (non-windows) + +# Convenience: The OPENCMISS_INSTALL_DIR may also be defined in the environment and various other places +if (DEFINED OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using specified installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The specified OPENCMISS_INSTALL_DIR '${OPENCMISS_INSTALL_DIR}' does not exist. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_INSTALL_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_INSTALL_DIR}" OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using environment installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The environment variable OPENCMISS_INSTALL_DIR='${OPENCMISS_INSTALL_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if (NOT OPENCMISS_INSTALL_DIR AND DEFINED OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The specified OPENCMISS_SDK_DIR '${OPENCMISS_SDK_DIR}' does not exist. Skipping.") + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_SDK_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_SDK_DIR}" OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using environment SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The environment variable OPENCMISS_SDK_DIR='${OPENCMISS_SDK_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_SDK_DIR) + endif() +endif() +# On windows: check the registry for installed OpenCMISS SDKs +if(NOT OPENCMISS_INSTALL_DIR AND WIN32) + foreach(ROOT HKEY_CURRENT_USER HKEY_LOCAL_MACHINE) + foreach(PACKAGE OpenCMISSUserSDK OpenCMISSDeveloperSDK) + set(_REG_KEY "[${ROOT}\\Software\\Auckland Bioengineering Institute\\${PACKAGE}]") + get_filename_component(OPENCMISS_INSTALL_DIR "${_REG_KEY}" ABSOLUTE) + #message(STATUS "Trying registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Found ${PACKAGE} in Windows registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + break() + else() + unset(OPENCMISS_INSTALL_DIR) + endif() + endforeach() + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + break() + endif() + endforeach() +endif() + +if(OPENCMISS_INSTALL_DIR) + message(STATUS "OPENCMISS_INSTALL_DIR=${OPENCMISS_INSTALL_DIR}") + # Use the OpenCMISS scripts to also allow choosing a separate toolchain + # This file is located at the opencmiss installation rather than the local example + # as it avoids file replication and makes maintenance much easier + if (TOOLCHAIN) + set(_OCTC ${OPENCMISS_INSTALL_DIR}/cmake/OCToolchainCompilers.cmake) + if (EXISTS "${_OCTC}") + include(${_OCTC}) + else() + message(WARNING "TOOLCHAIN specified but OpenCMISS config script could not be found at ${_OCTC}. Trying CMake defaults.") + endif() + unset(_OCTC) + endif() + set(OpenCMISS_DIR "${OPENCMISS_INSTALL_DIR}" CACHE PATH "Path to the found OpenCMISS (SDK) installation") +else() + message(WARNING "No OpenCMISS (SDK) installation directory detected. Using default system environment.") +endif() + \ No newline at end of file diff --git a/42TestingPoints/SinglePhysics/NonlinearProblems/StaticProblems/NavierStokes/3D/HEX/QuadraticVelocityLinearPressure/LEVEL_3/1k/build_debug/build.sh b/42TestingPoints/SinglePhysics/NonlinearProblems/StaticProblems/NavierStokes/3D/HEX/QuadraticVelocityLinearPressure/LEVEL_3/1k/build_debug/build.sh new file mode 100644 index 00000000..e6624bac --- /dev/null +++ b/42TestingPoints/SinglePhysics/NonlinearProblems/StaticProblems/NavierStokes/3D/HEX/QuadraticVelocityLinearPressure/LEVEL_3/1k/build_debug/build.sh @@ -0,0 +1,2 @@ +#ccc && cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all +cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all diff --git a/Bioelectrics/Bidomain/CMakeLists.txt b/Bioelectrics/Bidomain/CMakeLists.txt new file mode 100644 index 00000000..a22b61ee --- /dev/null +++ b/Bioelectrics/Bidomain/CMakeLists.txt @@ -0,0 +1,35 @@ +# 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 C) +enable_language(Fortran OPTIONAL) +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 +# ---------------------- +#add_subdirectory(C) +if (CMAKE_Fortran_COMPILER) + add_subdirectory(Fortran) +endif() diff --git a/Bioelectrics/Bidomain/Fortran/CMakeLists.txt b/Bioelectrics/Bidomain/Fortran/CMakeLists.txt new file mode 100644 index 00000000..c036db49 --- /dev/null +++ b/Bioelectrics/Bidomain/Fortran/CMakeLists.txt @@ -0,0 +1,60 @@ + +# Add example executable +add_executable(Bidomain src/BidomainExample.f90) + +# Turn on Fortran preprocessing (#include directives) +if (MSVC) + set(PROC_OPT "/fpp") +else() + set(PROC_OPT "-cpp") +endif() + +# in debug mode, add flag that make Floating point exceptions fatal +set(OPT "") +if (FALSE) + if(CMAKE_BUILD_TYPE MATCHES DEBUG) + set(OPT "-ffpe-trap=invalid,zero,underflow,overflow,denormal") # GCC: make floating point exceptions fatal + endif() +endif() + +target_compile_options(Bidomain PRIVATE ${PROC_OPT} ${OPT} "-fbacktrace") + +# Link to opencmiss +# ----------------- +# +# This simply uses the opencmiss target created by OC_INIT() above. +# +# Alternatively, you can also directly invoke 'find_package(Iron )' 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 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 PRIVATE opencmiss) + +# Add a simple test that runs the executable +add_test(NAME test_Bidomain COMMAND Bidomain) +add_opencmiss_environment(test_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. +# diff --git a/Bioelectrics/Bidomain/src/BidomainExample.f90 b/Bioelectrics/Bidomain/Fortran/src/BidomainExample.f90 similarity index 100% rename from Bioelectrics/Bidomain/src/BidomainExample.f90 rename to Bioelectrics/Bidomain/Fortran/src/BidomainExample.f90 diff --git a/Bioelectrics/Bidomain/OpenCMISS.cmake b/Bioelectrics/Bidomain/OpenCMISS.cmake new file mode 100644 index 00000000..3d6cf515 --- /dev/null +++ b/Bioelectrics/Bidomain/OpenCMISS.cmake @@ -0,0 +1,95 @@ +########################### +# *DO NOT CHANGE THIS FILE* +########################### +# +# Prepares the use of OpenCMISS by scanning at various path locations for OpenCMISS (SDK) installations. +# +# Search order: +# - OPENCMISS_INSTALL_DIR variable +# - OPENCMISS_INSTALL_DIR environment variable +# - OPENCMISS_SDK_DIR variable +# - OPENCMISS_SDK_DIR environment variable +# - [Windows only] The Registry is searched additionally for installed SDKs. +# +# If found +# - Includes the toolchain config script of the found opencmiss installation to enable toolchain selection logic (non-windows) + +# Convenience: The OPENCMISS_INSTALL_DIR may also be defined in the environment and various other places +if (DEFINED OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using specified installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The specified OPENCMISS_INSTALL_DIR '${OPENCMISS_INSTALL_DIR}' does not exist. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_INSTALL_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_INSTALL_DIR}" OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using environment installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The environment variable OPENCMISS_INSTALL_DIR='${OPENCMISS_INSTALL_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if (NOT OPENCMISS_INSTALL_DIR AND DEFINED OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The specified OPENCMISS_SDK_DIR '${OPENCMISS_SDK_DIR}' does not exist. Skipping.") + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_SDK_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_SDK_DIR}" OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using environment SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The environment variable OPENCMISS_SDK_DIR='${OPENCMISS_SDK_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_SDK_DIR) + endif() +endif() +# On windows: check the registry for installed OpenCMISS SDKs +if(NOT OPENCMISS_INSTALL_DIR AND WIN32) + foreach(ROOT HKEY_CURRENT_USER HKEY_LOCAL_MACHINE) + foreach(PACKAGE OpenCMISSUserSDK OpenCMISSDeveloperSDK) + set(_REG_KEY "[${ROOT}\\Software\\Auckland Bioengineering Institute\\${PACKAGE}]") + get_filename_component(OPENCMISS_INSTALL_DIR "${_REG_KEY}" ABSOLUTE) + #message(STATUS "Trying registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Found ${PACKAGE} in Windows registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + break() + else() + unset(OPENCMISS_INSTALL_DIR) + endif() + endforeach() + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + break() + endif() + endforeach() +endif() + +if(OPENCMISS_INSTALL_DIR) + message(STATUS "OPENCMISS_INSTALL_DIR=${OPENCMISS_INSTALL_DIR}") + # Use the OpenCMISS scripts to also allow choosing a separate toolchain + # This file is located at the opencmiss installation rather than the local example + # as it avoids file replication and makes maintenance much easier + if (TOOLCHAIN) + set(_OCTC ${OPENCMISS_INSTALL_DIR}/cmake/OCToolchainCompilers.cmake) + if (EXISTS "${_OCTC}") + include(${_OCTC}) + else() + message(WARNING "TOOLCHAIN specified but OpenCMISS config script could not be found at ${_OCTC}. Trying CMake defaults.") + endif() + unset(_OCTC) + endif() + set(OpenCMISS_DIR "${OPENCMISS_INSTALL_DIR}" CACHE PATH "Path to the found OpenCMISS (SDK) installation") +else() + message(WARNING "No OpenCMISS (SDK) installation directory detected. Using default system environment.") +endif() + \ No newline at end of file diff --git a/Bioelectrics/Bidomain/build_debug/build.sh b/Bioelectrics/Bidomain/build_debug/build.sh new file mode 100644 index 00000000..e6624bac --- /dev/null +++ b/Bioelectrics/Bidomain/build_debug/build.sh @@ -0,0 +1,2 @@ +#ccc && cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all +cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all diff --git a/Bioelectrics/Monodomain/CMakeLists.txt b/Bioelectrics/Monodomain/CMakeLists.txt new file mode 100644 index 00000000..a22b61ee --- /dev/null +++ b/Bioelectrics/Monodomain/CMakeLists.txt @@ -0,0 +1,35 @@ +# 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 C) +enable_language(Fortran OPTIONAL) +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 +# ---------------------- +#add_subdirectory(C) +if (CMAKE_Fortran_COMPILER) + add_subdirectory(Fortran) +endif() diff --git a/Bioelectrics/Monodomain/Fortran/CMakeLists.txt b/Bioelectrics/Monodomain/Fortran/CMakeLists.txt new file mode 100644 index 00000000..cdcf3c22 --- /dev/null +++ b/Bioelectrics/Monodomain/Fortran/CMakeLists.txt @@ -0,0 +1,60 @@ + +# Add example executable +add_executable(Monodomain src/FortranExample.f90) + +# Turn on Fortran preprocessing (#include directives) +if (MSVC) + set(PROC_OPT "/fpp") +else() + set(PROC_OPT "-cpp") +endif() + +# in debug mode, add flag that make Floating point exceptions fatal +set(OPT "") +if (FALSE) + if(CMAKE_BUILD_TYPE MATCHES DEBUG) + set(OPT "-ffpe-trap=invalid,zero,underflow,overflow,denormal") # GCC: make floating point exceptions fatal + endif() +endif() + +target_compile_options(Monodomain PRIVATE ${PROC_OPT} ${OPT} "-fbacktrace") + +# Link to opencmiss +# ----------------- +# +# This simply uses the opencmiss target created by OC_INIT() above. +# +# Alternatively, you can also directly invoke 'find_package(Iron )' 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 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 PRIVATE opencmiss) + +# Add a simple test that runs the executable +add_test(NAME test_Monodomain COMMAND Monodomain) +add_opencmiss_environment(test_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. +# diff --git a/Bioelectrics/Monodomain/OpenCMISS.cmake b/Bioelectrics/Monodomain/OpenCMISS.cmake new file mode 100644 index 00000000..3d6cf515 --- /dev/null +++ b/Bioelectrics/Monodomain/OpenCMISS.cmake @@ -0,0 +1,95 @@ +########################### +# *DO NOT CHANGE THIS FILE* +########################### +# +# Prepares the use of OpenCMISS by scanning at various path locations for OpenCMISS (SDK) installations. +# +# Search order: +# - OPENCMISS_INSTALL_DIR variable +# - OPENCMISS_INSTALL_DIR environment variable +# - OPENCMISS_SDK_DIR variable +# - OPENCMISS_SDK_DIR environment variable +# - [Windows only] The Registry is searched additionally for installed SDKs. +# +# If found +# - Includes the toolchain config script of the found opencmiss installation to enable toolchain selection logic (non-windows) + +# Convenience: The OPENCMISS_INSTALL_DIR may also be defined in the environment and various other places +if (DEFINED OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using specified installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The specified OPENCMISS_INSTALL_DIR '${OPENCMISS_INSTALL_DIR}' does not exist. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_INSTALL_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_INSTALL_DIR}" OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using environment installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The environment variable OPENCMISS_INSTALL_DIR='${OPENCMISS_INSTALL_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if (NOT OPENCMISS_INSTALL_DIR AND DEFINED OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The specified OPENCMISS_SDK_DIR '${OPENCMISS_SDK_DIR}' does not exist. Skipping.") + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_SDK_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_SDK_DIR}" OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using environment SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The environment variable OPENCMISS_SDK_DIR='${OPENCMISS_SDK_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_SDK_DIR) + endif() +endif() +# On windows: check the registry for installed OpenCMISS SDKs +if(NOT OPENCMISS_INSTALL_DIR AND WIN32) + foreach(ROOT HKEY_CURRENT_USER HKEY_LOCAL_MACHINE) + foreach(PACKAGE OpenCMISSUserSDK OpenCMISSDeveloperSDK) + set(_REG_KEY "[${ROOT}\\Software\\Auckland Bioengineering Institute\\${PACKAGE}]") + get_filename_component(OPENCMISS_INSTALL_DIR "${_REG_KEY}" ABSOLUTE) + #message(STATUS "Trying registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Found ${PACKAGE} in Windows registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + break() + else() + unset(OPENCMISS_INSTALL_DIR) + endif() + endforeach() + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + break() + endif() + endforeach() +endif() + +if(OPENCMISS_INSTALL_DIR) + message(STATUS "OPENCMISS_INSTALL_DIR=${OPENCMISS_INSTALL_DIR}") + # Use the OpenCMISS scripts to also allow choosing a separate toolchain + # This file is located at the opencmiss installation rather than the local example + # as it avoids file replication and makes maintenance much easier + if (TOOLCHAIN) + set(_OCTC ${OPENCMISS_INSTALL_DIR}/cmake/OCToolchainCompilers.cmake) + if (EXISTS "${_OCTC}") + include(${_OCTC}) + else() + message(WARNING "TOOLCHAIN specified but OpenCMISS config script could not be found at ${_OCTC}. Trying CMake defaults.") + endif() + unset(_OCTC) + endif() + set(OpenCMISS_DIR "${OPENCMISS_INSTALL_DIR}" CACHE PATH "Path to the found OpenCMISS (SDK) installation") +else() + message(WARNING "No OpenCMISS (SDK) installation directory detected. Using default system environment.") +endif() + \ No newline at end of file diff --git a/Bioelectrics/Monodomain/build_debug/build.sh b/Bioelectrics/Monodomain/build_debug/build.sh new file mode 100644 index 00000000..e6624bac --- /dev/null +++ b/Bioelectrics/Monodomain/build_debug/build.sh @@ -0,0 +1,2 @@ +#ccc && cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all +cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all diff --git a/Bioelectrics/MonodomainBuenoOrovio/CMakeLists.txt b/Bioelectrics/MonodomainBuenoOrovio/CMakeLists.txt new file mode 100644 index 00000000..a22b61ee --- /dev/null +++ b/Bioelectrics/MonodomainBuenoOrovio/CMakeLists.txt @@ -0,0 +1,35 @@ +# 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 C) +enable_language(Fortran OPTIONAL) +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 +# ---------------------- +#add_subdirectory(C) +if (CMAKE_Fortran_COMPILER) + add_subdirectory(Fortran) +endif() diff --git a/Bioelectrics/MonodomainBuenoOrovio/Fortran/CMakeLists.txt b/Bioelectrics/MonodomainBuenoOrovio/Fortran/CMakeLists.txt new file mode 100644 index 00000000..eec7de1b --- /dev/null +++ b/Bioelectrics/MonodomainBuenoOrovio/Fortran/CMakeLists.txt @@ -0,0 +1,60 @@ + +# Add example executable +add_executable(MonodomainBuenoOrovio src/MonodomainBuenoOrovioExample.f90) + +# Turn on Fortran preprocessing (#include directives) +if (MSVC) + set(PROC_OPT "/fpp") +else() + set(PROC_OPT "-cpp") +endif() + +# in debug mode, add flag that make Floating point exceptions fatal +set(OPT "") +if (FALSE) + if(CMAKE_BUILD_TYPE MATCHES DEBUG) + set(OPT "-ffpe-trap=invalid,zero,underflow,overflow,denormal") # GCC: make floating point exceptions fatal + endif() +endif() + +target_compile_options(MonodomainBuenoOrovio PRIVATE ${PROC_OPT} ${OPT} "-fbacktrace") + +# Link to opencmiss +# ----------------- +# +# This simply uses the opencmiss target created by OC_INIT() above. +# +# Alternatively, you can also directly invoke 'find_package(Iron )' 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 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(MonodomainBuenoOrovio PRIVATE opencmiss) + +# Add a simple test that runs the executable +add_test(NAME test_MonodomainBuenoOrovio COMMAND MonodomainBuenoOrovio) +add_opencmiss_environment(test_MonodomainBuenoOrovio) + +################### +# 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. +# diff --git a/Bioelectrics/MonodomainBuenoOrovio/src/MonodomainBuenoOrovioExample.f90 b/Bioelectrics/MonodomainBuenoOrovio/Fortran/src/MonodomainBuenoOrovioExample.f90 similarity index 100% rename from Bioelectrics/MonodomainBuenoOrovio/src/MonodomainBuenoOrovioExample.f90 rename to Bioelectrics/MonodomainBuenoOrovio/Fortran/src/MonodomainBuenoOrovioExample.f90 diff --git a/Bioelectrics/MonodomainBuenoOrovio/OpenCMISS.cmake b/Bioelectrics/MonodomainBuenoOrovio/OpenCMISS.cmake new file mode 100644 index 00000000..3d6cf515 --- /dev/null +++ b/Bioelectrics/MonodomainBuenoOrovio/OpenCMISS.cmake @@ -0,0 +1,95 @@ +########################### +# *DO NOT CHANGE THIS FILE* +########################### +# +# Prepares the use of OpenCMISS by scanning at various path locations for OpenCMISS (SDK) installations. +# +# Search order: +# - OPENCMISS_INSTALL_DIR variable +# - OPENCMISS_INSTALL_DIR environment variable +# - OPENCMISS_SDK_DIR variable +# - OPENCMISS_SDK_DIR environment variable +# - [Windows only] The Registry is searched additionally for installed SDKs. +# +# If found +# - Includes the toolchain config script of the found opencmiss installation to enable toolchain selection logic (non-windows) + +# Convenience: The OPENCMISS_INSTALL_DIR may also be defined in the environment and various other places +if (DEFINED OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using specified installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The specified OPENCMISS_INSTALL_DIR '${OPENCMISS_INSTALL_DIR}' does not exist. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_INSTALL_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_INSTALL_DIR}" OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using environment installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The environment variable OPENCMISS_INSTALL_DIR='${OPENCMISS_INSTALL_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if (NOT OPENCMISS_INSTALL_DIR AND DEFINED OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The specified OPENCMISS_SDK_DIR '${OPENCMISS_SDK_DIR}' does not exist. Skipping.") + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_SDK_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_SDK_DIR}" OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using environment SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The environment variable OPENCMISS_SDK_DIR='${OPENCMISS_SDK_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_SDK_DIR) + endif() +endif() +# On windows: check the registry for installed OpenCMISS SDKs +if(NOT OPENCMISS_INSTALL_DIR AND WIN32) + foreach(ROOT HKEY_CURRENT_USER HKEY_LOCAL_MACHINE) + foreach(PACKAGE OpenCMISSUserSDK OpenCMISSDeveloperSDK) + set(_REG_KEY "[${ROOT}\\Software\\Auckland Bioengineering Institute\\${PACKAGE}]") + get_filename_component(OPENCMISS_INSTALL_DIR "${_REG_KEY}" ABSOLUTE) + #message(STATUS "Trying registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Found ${PACKAGE} in Windows registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + break() + else() + unset(OPENCMISS_INSTALL_DIR) + endif() + endforeach() + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + break() + endif() + endforeach() +endif() + +if(OPENCMISS_INSTALL_DIR) + message(STATUS "OPENCMISS_INSTALL_DIR=${OPENCMISS_INSTALL_DIR}") + # Use the OpenCMISS scripts to also allow choosing a separate toolchain + # This file is located at the opencmiss installation rather than the local example + # as it avoids file replication and makes maintenance much easier + if (TOOLCHAIN) + set(_OCTC ${OPENCMISS_INSTALL_DIR}/cmake/OCToolchainCompilers.cmake) + if (EXISTS "${_OCTC}") + include(${_OCTC}) + else() + message(WARNING "TOOLCHAIN specified but OpenCMISS config script could not be found at ${_OCTC}. Trying CMake defaults.") + endif() + unset(_OCTC) + endif() + set(OpenCMISS_DIR "${OPENCMISS_INSTALL_DIR}" CACHE PATH "Path to the found OpenCMISS (SDK) installation") +else() + message(WARNING "No OpenCMISS (SDK) installation directory detected. Using default system environment.") +endif() + \ No newline at end of file diff --git a/Bioelectrics/MonodomainBuenoOrovio/build_debug/build.sh b/Bioelectrics/MonodomainBuenoOrovio/build_debug/build.sh new file mode 100644 index 00000000..e6624bac --- /dev/null +++ b/Bioelectrics/MonodomainBuenoOrovio/build_debug/build.sh @@ -0,0 +1,2 @@ +#ccc && cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all +cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all diff --git a/Bioelectrics/MonodomainCUDA/CMakeLists.txt b/Bioelectrics/MonodomainCUDA/CMakeLists.txt new file mode 100644 index 00000000..a22b61ee --- /dev/null +++ b/Bioelectrics/MonodomainCUDA/CMakeLists.txt @@ -0,0 +1,35 @@ +# 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 C) +enable_language(Fortran OPTIONAL) +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 +# ---------------------- +#add_subdirectory(C) +if (CMAKE_Fortran_COMPILER) + add_subdirectory(Fortran) +endif() diff --git a/Bioelectrics/MonodomainCUDA/Fortran/CMakeLists.txt b/Bioelectrics/MonodomainCUDA/Fortran/CMakeLists.txt new file mode 100644 index 00000000..7e8c3759 --- /dev/null +++ b/Bioelectrics/MonodomainCUDA/Fortran/CMakeLists.txt @@ -0,0 +1,60 @@ + +# Add example executable +add_executable(MonodomainCUDA src/MonodomainCUDAExample.f90) + +# Turn on Fortran preprocessing (#include directives) +if (MSVC) + set(PROC_OPT "/fpp") +else() + set(PROC_OPT "-cpp") +endif() + +# in debug mode, add flag that make Floating point exceptions fatal +set(OPT "") +if (FALSE) + if(CMAKE_BUILD_TYPE MATCHES DEBUG) + set(OPT "-ffpe-trap=invalid,zero,underflow,overflow,denormal") # GCC: make floating point exceptions fatal + endif() +endif() + +target_compile_options(MonodomainCUDA PRIVATE ${PROC_OPT} ${OPT} "-fbacktrace") + +# Link to opencmiss +# ----------------- +# +# This simply uses the opencmiss target created by OC_INIT() above. +# +# Alternatively, you can also directly invoke 'find_package(Iron )' 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 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(MonodomainCUDA PRIVATE opencmiss) + +# Add a simple test that runs the executable +add_test(NAME test_MonodomainCUDA COMMAND MonodomainCUDA) +add_opencmiss_environment(test_MonodomainCUDA) + +################### +# 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. +# diff --git a/Bioelectrics/MonodomainCUDA/src/MonodomainCUDAExample.f90 b/Bioelectrics/MonodomainCUDA/Fortran/src/MonodomainCUDAExample.f90 similarity index 100% rename from Bioelectrics/MonodomainCUDA/src/MonodomainCUDAExample.f90 rename to Bioelectrics/MonodomainCUDA/Fortran/src/MonodomainCUDAExample.f90 diff --git a/Bioelectrics/MonodomainCUDA/OpenCMISS.cmake b/Bioelectrics/MonodomainCUDA/OpenCMISS.cmake new file mode 100644 index 00000000..3d6cf515 --- /dev/null +++ b/Bioelectrics/MonodomainCUDA/OpenCMISS.cmake @@ -0,0 +1,95 @@ +########################### +# *DO NOT CHANGE THIS FILE* +########################### +# +# Prepares the use of OpenCMISS by scanning at various path locations for OpenCMISS (SDK) installations. +# +# Search order: +# - OPENCMISS_INSTALL_DIR variable +# - OPENCMISS_INSTALL_DIR environment variable +# - OPENCMISS_SDK_DIR variable +# - OPENCMISS_SDK_DIR environment variable +# - [Windows only] The Registry is searched additionally for installed SDKs. +# +# If found +# - Includes the toolchain config script of the found opencmiss installation to enable toolchain selection logic (non-windows) + +# Convenience: The OPENCMISS_INSTALL_DIR may also be defined in the environment and various other places +if (DEFINED OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using specified installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The specified OPENCMISS_INSTALL_DIR '${OPENCMISS_INSTALL_DIR}' does not exist. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_INSTALL_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_INSTALL_DIR}" OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using environment installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The environment variable OPENCMISS_INSTALL_DIR='${OPENCMISS_INSTALL_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if (NOT OPENCMISS_INSTALL_DIR AND DEFINED OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The specified OPENCMISS_SDK_DIR '${OPENCMISS_SDK_DIR}' does not exist. Skipping.") + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_SDK_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_SDK_DIR}" OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using environment SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The environment variable OPENCMISS_SDK_DIR='${OPENCMISS_SDK_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_SDK_DIR) + endif() +endif() +# On windows: check the registry for installed OpenCMISS SDKs +if(NOT OPENCMISS_INSTALL_DIR AND WIN32) + foreach(ROOT HKEY_CURRENT_USER HKEY_LOCAL_MACHINE) + foreach(PACKAGE OpenCMISSUserSDK OpenCMISSDeveloperSDK) + set(_REG_KEY "[${ROOT}\\Software\\Auckland Bioengineering Institute\\${PACKAGE}]") + get_filename_component(OPENCMISS_INSTALL_DIR "${_REG_KEY}" ABSOLUTE) + #message(STATUS "Trying registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Found ${PACKAGE} in Windows registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + break() + else() + unset(OPENCMISS_INSTALL_DIR) + endif() + endforeach() + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + break() + endif() + endforeach() +endif() + +if(OPENCMISS_INSTALL_DIR) + message(STATUS "OPENCMISS_INSTALL_DIR=${OPENCMISS_INSTALL_DIR}") + # Use the OpenCMISS scripts to also allow choosing a separate toolchain + # This file is located at the opencmiss installation rather than the local example + # as it avoids file replication and makes maintenance much easier + if (TOOLCHAIN) + set(_OCTC ${OPENCMISS_INSTALL_DIR}/cmake/OCToolchainCompilers.cmake) + if (EXISTS "${_OCTC}") + include(${_OCTC}) + else() + message(WARNING "TOOLCHAIN specified but OpenCMISS config script could not be found at ${_OCTC}. Trying CMake defaults.") + endif() + unset(_OCTC) + endif() + set(OpenCMISS_DIR "${OPENCMISS_INSTALL_DIR}" CACHE PATH "Path to the found OpenCMISS (SDK) installation") +else() + message(WARNING "No OpenCMISS (SDK) installation directory detected. Using default system environment.") +endif() + \ No newline at end of file diff --git a/Bioelectrics/MonodomainCUDA/build_debug/build.sh b/Bioelectrics/MonodomainCUDA/build_debug/build.sh new file mode 100644 index 00000000..e6624bac --- /dev/null +++ b/Bioelectrics/MonodomainCUDA/build_debug/build.sh @@ -0,0 +1,2 @@ +#ccc && cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all +cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all diff --git a/Bioelectrics/MonodomainTP06/CMakeLists.txt b/Bioelectrics/MonodomainTP06/CMakeLists.txt new file mode 100644 index 00000000..a22b61ee --- /dev/null +++ b/Bioelectrics/MonodomainTP06/CMakeLists.txt @@ -0,0 +1,35 @@ +# 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 C) +enable_language(Fortran OPTIONAL) +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 +# ---------------------- +#add_subdirectory(C) +if (CMAKE_Fortran_COMPILER) + add_subdirectory(Fortran) +endif() diff --git a/Bioelectrics/MonodomainTP06/Fortran/CMakeLists.txt b/Bioelectrics/MonodomainTP06/Fortran/CMakeLists.txt new file mode 100644 index 00000000..c0587c94 --- /dev/null +++ b/Bioelectrics/MonodomainTP06/Fortran/CMakeLists.txt @@ -0,0 +1,60 @@ + +# Add example executable +add_executable(MonodomainTP06 src/MonodomainTP06Example.f90) + +# Turn on Fortran preprocessing (#include directives) +if (MSVC) + set(PROC_OPT "/fpp") +else() + set(PROC_OPT "-cpp") +endif() + +# in debug mode, add flag that make Floating point exceptions fatal +set(OPT "") +if (FALSE) + if(CMAKE_BUILD_TYPE MATCHES DEBUG) + set(OPT "-ffpe-trap=invalid,zero,underflow,overflow,denormal") # GCC: make floating point exceptions fatal + endif() +endif() + +target_compile_options(MonodomainTP06 PRIVATE ${PROC_OPT} ${OPT} "-fbacktrace") + +# Link to opencmiss +# ----------------- +# +# This simply uses the opencmiss target created by OC_INIT() above. +# +# Alternatively, you can also directly invoke 'find_package(Iron )' 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 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(MonodomainTP06 PRIVATE opencmiss) + +# Add a simple test that runs the executable +add_test(NAME test_MonodomainTP06 COMMAND MonodomainTP06) +add_opencmiss_environment(test_MonodomainTP06) + +################### +# 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. +# diff --git a/Bioelectrics/MonodomainTP06/src/MonodomainTP06Example.f90 b/Bioelectrics/MonodomainTP06/Fortran/src/MonodomainTP06Example.f90 similarity index 100% rename from Bioelectrics/MonodomainTP06/src/MonodomainTP06Example.f90 rename to Bioelectrics/MonodomainTP06/Fortran/src/MonodomainTP06Example.f90 diff --git a/Bioelectrics/MonodomainTP06/OpenCMISS.cmake b/Bioelectrics/MonodomainTP06/OpenCMISS.cmake new file mode 100644 index 00000000..3d6cf515 --- /dev/null +++ b/Bioelectrics/MonodomainTP06/OpenCMISS.cmake @@ -0,0 +1,95 @@ +########################### +# *DO NOT CHANGE THIS FILE* +########################### +# +# Prepares the use of OpenCMISS by scanning at various path locations for OpenCMISS (SDK) installations. +# +# Search order: +# - OPENCMISS_INSTALL_DIR variable +# - OPENCMISS_INSTALL_DIR environment variable +# - OPENCMISS_SDK_DIR variable +# - OPENCMISS_SDK_DIR environment variable +# - [Windows only] The Registry is searched additionally for installed SDKs. +# +# If found +# - Includes the toolchain config script of the found opencmiss installation to enable toolchain selection logic (non-windows) + +# Convenience: The OPENCMISS_INSTALL_DIR may also be defined in the environment and various other places +if (DEFINED OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using specified installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The specified OPENCMISS_INSTALL_DIR '${OPENCMISS_INSTALL_DIR}' does not exist. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_INSTALL_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_INSTALL_DIR}" OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using environment installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The environment variable OPENCMISS_INSTALL_DIR='${OPENCMISS_INSTALL_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if (NOT OPENCMISS_INSTALL_DIR AND DEFINED OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The specified OPENCMISS_SDK_DIR '${OPENCMISS_SDK_DIR}' does not exist. Skipping.") + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_SDK_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_SDK_DIR}" OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using environment SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The environment variable OPENCMISS_SDK_DIR='${OPENCMISS_SDK_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_SDK_DIR) + endif() +endif() +# On windows: check the registry for installed OpenCMISS SDKs +if(NOT OPENCMISS_INSTALL_DIR AND WIN32) + foreach(ROOT HKEY_CURRENT_USER HKEY_LOCAL_MACHINE) + foreach(PACKAGE OpenCMISSUserSDK OpenCMISSDeveloperSDK) + set(_REG_KEY "[${ROOT}\\Software\\Auckland Bioengineering Institute\\${PACKAGE}]") + get_filename_component(OPENCMISS_INSTALL_DIR "${_REG_KEY}" ABSOLUTE) + #message(STATUS "Trying registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Found ${PACKAGE} in Windows registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + break() + else() + unset(OPENCMISS_INSTALL_DIR) + endif() + endforeach() + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + break() + endif() + endforeach() +endif() + +if(OPENCMISS_INSTALL_DIR) + message(STATUS "OPENCMISS_INSTALL_DIR=${OPENCMISS_INSTALL_DIR}") + # Use the OpenCMISS scripts to also allow choosing a separate toolchain + # This file is located at the opencmiss installation rather than the local example + # as it avoids file replication and makes maintenance much easier + if (TOOLCHAIN) + set(_OCTC ${OPENCMISS_INSTALL_DIR}/cmake/OCToolchainCompilers.cmake) + if (EXISTS "${_OCTC}") + include(${_OCTC}) + else() + message(WARNING "TOOLCHAIN specified but OpenCMISS config script could not be found at ${_OCTC}. Trying CMake defaults.") + endif() + unset(_OCTC) + endif() + set(OpenCMISS_DIR "${OPENCMISS_INSTALL_DIR}" CACHE PATH "Path to the found OpenCMISS (SDK) installation") +else() + message(WARNING "No OpenCMISS (SDK) installation directory detected. Using default system environment.") +endif() + \ No newline at end of file diff --git a/Bioelectrics/MonodomainTP06/build_debug/build.sh b/Bioelectrics/MonodomainTP06/build_debug/build.sh new file mode 100644 index 00000000..e6624bac --- /dev/null +++ b/Bioelectrics/MonodomainTP06/build_debug/build.sh @@ -0,0 +1,2 @@ +#ccc && cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all +cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all diff --git a/Bioelectrics/Monodomain_Shiqiang/CMakeLists.txt b/Bioelectrics/Monodomain_Shiqiang/CMakeLists.txt new file mode 100644 index 00000000..a22b61ee --- /dev/null +++ b/Bioelectrics/Monodomain_Shiqiang/CMakeLists.txt @@ -0,0 +1,35 @@ +# 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 C) +enable_language(Fortran OPTIONAL) +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 +# ---------------------- +#add_subdirectory(C) +if (CMAKE_Fortran_COMPILER) + add_subdirectory(Fortran) +endif() diff --git a/Bioelectrics/Monodomain_Shiqiang/Fortran/CMakeLists.txt b/Bioelectrics/Monodomain_Shiqiang/Fortran/CMakeLists.txt new file mode 100644 index 00000000..4ee983a9 --- /dev/null +++ b/Bioelectrics/Monodomain_Shiqiang/Fortran/CMakeLists.txt @@ -0,0 +1,60 @@ + +# Add example executable +add_executable(Monodomain_Shiqiang src/Monodomain_ShiqiangExample.f90) + +# Turn on Fortran preprocessing (#include directives) +if (MSVC) + set(PROC_OPT "/fpp") +else() + set(PROC_OPT "-cpp") +endif() + +# in debug mode, add flag that make Floating point exceptions fatal +set(OPT "") +if (FALSE) + if(CMAKE_BUILD_TYPE MATCHES DEBUG) + set(OPT "-ffpe-trap=invalid,zero,underflow,overflow,denormal") # GCC: make floating point exceptions fatal + endif() +endif() + +target_compile_options(Monodomain_Shiqiang PRIVATE ${PROC_OPT} ${OPT} "-fbacktrace") + +# Link to opencmiss +# ----------------- +# +# This simply uses the opencmiss target created by OC_INIT() above. +# +# Alternatively, you can also directly invoke 'find_package(Iron )' 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 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_Shiqiang PRIVATE opencmiss) + +# Add a simple test that runs the executable +add_test(NAME test_Monodomain_Shiqiang COMMAND Monodomain_Shiqiang) +add_opencmiss_environment(test_Monodomain_Shiqiang) + +################### +# 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. +# diff --git a/Bioelectrics/Monodomain_Shiqiang/src/Monodomain_ShiqiangExample.f90 b/Bioelectrics/Monodomain_Shiqiang/Fortran/src/Monodomain_ShiqiangExample.f90 similarity index 100% rename from Bioelectrics/Monodomain_Shiqiang/src/Monodomain_ShiqiangExample.f90 rename to Bioelectrics/Monodomain_Shiqiang/Fortran/src/Monodomain_ShiqiangExample.f90 diff --git a/Bioelectrics/Monodomain_Shiqiang/OpenCMISS.cmake b/Bioelectrics/Monodomain_Shiqiang/OpenCMISS.cmake new file mode 100644 index 00000000..3d6cf515 --- /dev/null +++ b/Bioelectrics/Monodomain_Shiqiang/OpenCMISS.cmake @@ -0,0 +1,95 @@ +########################### +# *DO NOT CHANGE THIS FILE* +########################### +# +# Prepares the use of OpenCMISS by scanning at various path locations for OpenCMISS (SDK) installations. +# +# Search order: +# - OPENCMISS_INSTALL_DIR variable +# - OPENCMISS_INSTALL_DIR environment variable +# - OPENCMISS_SDK_DIR variable +# - OPENCMISS_SDK_DIR environment variable +# - [Windows only] The Registry is searched additionally for installed SDKs. +# +# If found +# - Includes the toolchain config script of the found opencmiss installation to enable toolchain selection logic (non-windows) + +# Convenience: The OPENCMISS_INSTALL_DIR may also be defined in the environment and various other places +if (DEFINED OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using specified installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The specified OPENCMISS_INSTALL_DIR '${OPENCMISS_INSTALL_DIR}' does not exist. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_INSTALL_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_INSTALL_DIR}" OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using environment installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The environment variable OPENCMISS_INSTALL_DIR='${OPENCMISS_INSTALL_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if (NOT OPENCMISS_INSTALL_DIR AND DEFINED OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The specified OPENCMISS_SDK_DIR '${OPENCMISS_SDK_DIR}' does not exist. Skipping.") + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_SDK_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_SDK_DIR}" OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using environment SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The environment variable OPENCMISS_SDK_DIR='${OPENCMISS_SDK_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_SDK_DIR) + endif() +endif() +# On windows: check the registry for installed OpenCMISS SDKs +if(NOT OPENCMISS_INSTALL_DIR AND WIN32) + foreach(ROOT HKEY_CURRENT_USER HKEY_LOCAL_MACHINE) + foreach(PACKAGE OpenCMISSUserSDK OpenCMISSDeveloperSDK) + set(_REG_KEY "[${ROOT}\\Software\\Auckland Bioengineering Institute\\${PACKAGE}]") + get_filename_component(OPENCMISS_INSTALL_DIR "${_REG_KEY}" ABSOLUTE) + #message(STATUS "Trying registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Found ${PACKAGE} in Windows registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + break() + else() + unset(OPENCMISS_INSTALL_DIR) + endif() + endforeach() + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + break() + endif() + endforeach() +endif() + +if(OPENCMISS_INSTALL_DIR) + message(STATUS "OPENCMISS_INSTALL_DIR=${OPENCMISS_INSTALL_DIR}") + # Use the OpenCMISS scripts to also allow choosing a separate toolchain + # This file is located at the opencmiss installation rather than the local example + # as it avoids file replication and makes maintenance much easier + if (TOOLCHAIN) + set(_OCTC ${OPENCMISS_INSTALL_DIR}/cmake/OCToolchainCompilers.cmake) + if (EXISTS "${_OCTC}") + include(${_OCTC}) + else() + message(WARNING "TOOLCHAIN specified but OpenCMISS config script could not be found at ${_OCTC}. Trying CMake defaults.") + endif() + unset(_OCTC) + endif() + set(OpenCMISS_DIR "${OPENCMISS_INSTALL_DIR}" CACHE PATH "Path to the found OpenCMISS (SDK) installation") +else() + message(WARNING "No OpenCMISS (SDK) installation directory detected. Using default system environment.") +endif() + \ No newline at end of file diff --git a/Bioelectrics/Monodomain_Shiqiang/build_debug/build.sh b/Bioelectrics/Monodomain_Shiqiang/build_debug/build.sh new file mode 100644 index 00000000..e6624bac --- /dev/null +++ b/Bioelectrics/Monodomain_Shiqiang/build_debug/build.sh @@ -0,0 +1,2 @@ +#ccc && cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all +cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all diff --git a/ClassicalField/AdvectionDiffusion/AdvectionDiffusionIO/CMakeLists.txt b/ClassicalField/AdvectionDiffusion/AdvectionDiffusionIO/CMakeLists.txt new file mode 100644 index 00000000..a22b61ee --- /dev/null +++ b/ClassicalField/AdvectionDiffusion/AdvectionDiffusionIO/CMakeLists.txt @@ -0,0 +1,35 @@ +# 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 C) +enable_language(Fortran OPTIONAL) +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 +# ---------------------- +#add_subdirectory(C) +if (CMAKE_Fortran_COMPILER) + add_subdirectory(Fortran) +endif() diff --git a/ClassicalField/AdvectionDiffusion/AdvectionDiffusionIO/Fortran/CMakeLists.txt b/ClassicalField/AdvectionDiffusion/AdvectionDiffusionIO/Fortran/CMakeLists.txt new file mode 100644 index 00000000..eb11cbf1 --- /dev/null +++ b/ClassicalField/AdvectionDiffusion/AdvectionDiffusionIO/Fortran/CMakeLists.txt @@ -0,0 +1,60 @@ + +# Add example executable +add_executable(AdvectionDiffusionIO src/AdvectionDiffusionIOExample.f90) + +# Turn on Fortran preprocessing (#include directives) +if (MSVC) + set(PROC_OPT "/fpp") +else() + set(PROC_OPT "-cpp") +endif() + +# in debug mode, add flag that make Floating point exceptions fatal +set(OPT "") +if (FALSE) + if(CMAKE_BUILD_TYPE MATCHES DEBUG) + set(OPT "-ffpe-trap=invalid,zero,underflow,overflow,denormal") # GCC: make floating point exceptions fatal + endif() +endif() + +target_compile_options(AdvectionDiffusionIO PRIVATE ${PROC_OPT} ${OPT} "-fbacktrace") + +# Link to opencmiss +# ----------------- +# +# This simply uses the opencmiss target created by OC_INIT() above. +# +# Alternatively, you can also directly invoke 'find_package(Iron )' 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 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(AdvectionDiffusionIO PRIVATE opencmiss) + +# Add a simple test that runs the executable +add_test(NAME test_AdvectionDiffusionIO COMMAND AdvectionDiffusionIO) +add_opencmiss_environment(test_AdvectionDiffusionIO) + +################### +# 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. +# diff --git a/ClassicalField/AdvectionDiffusion/AdvectionDiffusionIO/src/AdvectionDiffusionIOExample.f90 b/ClassicalField/AdvectionDiffusion/AdvectionDiffusionIO/Fortran/src/AdvectionDiffusionIOExample.f90 similarity index 100% rename from ClassicalField/AdvectionDiffusion/AdvectionDiffusionIO/src/AdvectionDiffusionIOExample.f90 rename to ClassicalField/AdvectionDiffusion/AdvectionDiffusionIO/Fortran/src/AdvectionDiffusionIOExample.f90 diff --git a/ClassicalField/AdvectionDiffusion/AdvectionDiffusionIO/OpenCMISS.cmake b/ClassicalField/AdvectionDiffusion/AdvectionDiffusionIO/OpenCMISS.cmake new file mode 100644 index 00000000..3d6cf515 --- /dev/null +++ b/ClassicalField/AdvectionDiffusion/AdvectionDiffusionIO/OpenCMISS.cmake @@ -0,0 +1,95 @@ +########################### +# *DO NOT CHANGE THIS FILE* +########################### +# +# Prepares the use of OpenCMISS by scanning at various path locations for OpenCMISS (SDK) installations. +# +# Search order: +# - OPENCMISS_INSTALL_DIR variable +# - OPENCMISS_INSTALL_DIR environment variable +# - OPENCMISS_SDK_DIR variable +# - OPENCMISS_SDK_DIR environment variable +# - [Windows only] The Registry is searched additionally for installed SDKs. +# +# If found +# - Includes the toolchain config script of the found opencmiss installation to enable toolchain selection logic (non-windows) + +# Convenience: The OPENCMISS_INSTALL_DIR may also be defined in the environment and various other places +if (DEFINED OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using specified installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The specified OPENCMISS_INSTALL_DIR '${OPENCMISS_INSTALL_DIR}' does not exist. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_INSTALL_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_INSTALL_DIR}" OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using environment installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The environment variable OPENCMISS_INSTALL_DIR='${OPENCMISS_INSTALL_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if (NOT OPENCMISS_INSTALL_DIR AND DEFINED OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The specified OPENCMISS_SDK_DIR '${OPENCMISS_SDK_DIR}' does not exist. Skipping.") + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_SDK_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_SDK_DIR}" OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using environment SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The environment variable OPENCMISS_SDK_DIR='${OPENCMISS_SDK_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_SDK_DIR) + endif() +endif() +# On windows: check the registry for installed OpenCMISS SDKs +if(NOT OPENCMISS_INSTALL_DIR AND WIN32) + foreach(ROOT HKEY_CURRENT_USER HKEY_LOCAL_MACHINE) + foreach(PACKAGE OpenCMISSUserSDK OpenCMISSDeveloperSDK) + set(_REG_KEY "[${ROOT}\\Software\\Auckland Bioengineering Institute\\${PACKAGE}]") + get_filename_component(OPENCMISS_INSTALL_DIR "${_REG_KEY}" ABSOLUTE) + #message(STATUS "Trying registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Found ${PACKAGE} in Windows registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + break() + else() + unset(OPENCMISS_INSTALL_DIR) + endif() + endforeach() + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + break() + endif() + endforeach() +endif() + +if(OPENCMISS_INSTALL_DIR) + message(STATUS "OPENCMISS_INSTALL_DIR=${OPENCMISS_INSTALL_DIR}") + # Use the OpenCMISS scripts to also allow choosing a separate toolchain + # This file is located at the opencmiss installation rather than the local example + # as it avoids file replication and makes maintenance much easier + if (TOOLCHAIN) + set(_OCTC ${OPENCMISS_INSTALL_DIR}/cmake/OCToolchainCompilers.cmake) + if (EXISTS "${_OCTC}") + include(${_OCTC}) + else() + message(WARNING "TOOLCHAIN specified but OpenCMISS config script could not be found at ${_OCTC}. Trying CMake defaults.") + endif() + unset(_OCTC) + endif() + set(OpenCMISS_DIR "${OPENCMISS_INSTALL_DIR}" CACHE PATH "Path to the found OpenCMISS (SDK) installation") +else() + message(WARNING "No OpenCMISS (SDK) installation directory detected. Using default system environment.") +endif() + \ No newline at end of file diff --git a/ClassicalField/AdvectionDiffusion/AdvectionDiffusionIO/build_debug/build.sh b/ClassicalField/AdvectionDiffusion/AdvectionDiffusionIO/build_debug/build.sh new file mode 100644 index 00000000..e6624bac --- /dev/null +++ b/ClassicalField/AdvectionDiffusion/AdvectionDiffusionIO/build_debug/build.sh @@ -0,0 +1,2 @@ +#ccc && cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all +cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all diff --git a/ClassicalField/AdvectionDiffusion/AdvectionDiffusionIO_ALE/CMakeLists.txt b/ClassicalField/AdvectionDiffusion/AdvectionDiffusionIO_ALE/CMakeLists.txt new file mode 100644 index 00000000..a22b61ee --- /dev/null +++ b/ClassicalField/AdvectionDiffusion/AdvectionDiffusionIO_ALE/CMakeLists.txt @@ -0,0 +1,35 @@ +# 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 C) +enable_language(Fortran OPTIONAL) +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 +# ---------------------- +#add_subdirectory(C) +if (CMAKE_Fortran_COMPILER) + add_subdirectory(Fortran) +endif() diff --git a/ClassicalField/AdvectionDiffusion/AdvectionDiffusionIO_ALE/Fortran/CMakeLists.txt b/ClassicalField/AdvectionDiffusion/AdvectionDiffusionIO_ALE/Fortran/CMakeLists.txt new file mode 100644 index 00000000..a04371db --- /dev/null +++ b/ClassicalField/AdvectionDiffusion/AdvectionDiffusionIO_ALE/Fortran/CMakeLists.txt @@ -0,0 +1,60 @@ + +# Add example executable +add_executable(AdvectionDiffusionIO_ALE src/AdvectionDiffusionIO_ALEExample.f90) + +# Turn on Fortran preprocessing (#include directives) +if (MSVC) + set(PROC_OPT "/fpp") +else() + set(PROC_OPT "-cpp") +endif() + +# in debug mode, add flag that make Floating point exceptions fatal +set(OPT "") +if (FALSE) + if(CMAKE_BUILD_TYPE MATCHES DEBUG) + set(OPT "-ffpe-trap=invalid,zero,underflow,overflow,denormal") # GCC: make floating point exceptions fatal + endif() +endif() + +target_compile_options(AdvectionDiffusionIO_ALE PRIVATE ${PROC_OPT} ${OPT} "-fbacktrace") + +# Link to opencmiss +# ----------------- +# +# This simply uses the opencmiss target created by OC_INIT() above. +# +# Alternatively, you can also directly invoke 'find_package(Iron )' 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 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(AdvectionDiffusionIO_ALE PRIVATE opencmiss) + +# Add a simple test that runs the executable +add_test(NAME test_AdvectionDiffusionIO_ALE COMMAND AdvectionDiffusionIO_ALE) +add_opencmiss_environment(test_AdvectionDiffusionIO_ALE) + +################### +# 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. +# diff --git a/ClassicalField/AdvectionDiffusion/AdvectionDiffusionIO_ALE/src/AdvectionDiffusionIO_ALEExample.f90 b/ClassicalField/AdvectionDiffusion/AdvectionDiffusionIO_ALE/Fortran/src/AdvectionDiffusionIO_ALEExample.f90 similarity index 100% rename from ClassicalField/AdvectionDiffusion/AdvectionDiffusionIO_ALE/src/AdvectionDiffusionIO_ALEExample.f90 rename to ClassicalField/AdvectionDiffusion/AdvectionDiffusionIO_ALE/Fortran/src/AdvectionDiffusionIO_ALEExample.f90 diff --git a/ClassicalField/AdvectionDiffusion/AdvectionDiffusionIO_ALE/OpenCMISS.cmake b/ClassicalField/AdvectionDiffusion/AdvectionDiffusionIO_ALE/OpenCMISS.cmake new file mode 100644 index 00000000..3d6cf515 --- /dev/null +++ b/ClassicalField/AdvectionDiffusion/AdvectionDiffusionIO_ALE/OpenCMISS.cmake @@ -0,0 +1,95 @@ +########################### +# *DO NOT CHANGE THIS FILE* +########################### +# +# Prepares the use of OpenCMISS by scanning at various path locations for OpenCMISS (SDK) installations. +# +# Search order: +# - OPENCMISS_INSTALL_DIR variable +# - OPENCMISS_INSTALL_DIR environment variable +# - OPENCMISS_SDK_DIR variable +# - OPENCMISS_SDK_DIR environment variable +# - [Windows only] The Registry is searched additionally for installed SDKs. +# +# If found +# - Includes the toolchain config script of the found opencmiss installation to enable toolchain selection logic (non-windows) + +# Convenience: The OPENCMISS_INSTALL_DIR may also be defined in the environment and various other places +if (DEFINED OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using specified installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The specified OPENCMISS_INSTALL_DIR '${OPENCMISS_INSTALL_DIR}' does not exist. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_INSTALL_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_INSTALL_DIR}" OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using environment installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The environment variable OPENCMISS_INSTALL_DIR='${OPENCMISS_INSTALL_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if (NOT OPENCMISS_INSTALL_DIR AND DEFINED OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The specified OPENCMISS_SDK_DIR '${OPENCMISS_SDK_DIR}' does not exist. Skipping.") + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_SDK_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_SDK_DIR}" OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using environment SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The environment variable OPENCMISS_SDK_DIR='${OPENCMISS_SDK_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_SDK_DIR) + endif() +endif() +# On windows: check the registry for installed OpenCMISS SDKs +if(NOT OPENCMISS_INSTALL_DIR AND WIN32) + foreach(ROOT HKEY_CURRENT_USER HKEY_LOCAL_MACHINE) + foreach(PACKAGE OpenCMISSUserSDK OpenCMISSDeveloperSDK) + set(_REG_KEY "[${ROOT}\\Software\\Auckland Bioengineering Institute\\${PACKAGE}]") + get_filename_component(OPENCMISS_INSTALL_DIR "${_REG_KEY}" ABSOLUTE) + #message(STATUS "Trying registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Found ${PACKAGE} in Windows registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + break() + else() + unset(OPENCMISS_INSTALL_DIR) + endif() + endforeach() + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + break() + endif() + endforeach() +endif() + +if(OPENCMISS_INSTALL_DIR) + message(STATUS "OPENCMISS_INSTALL_DIR=${OPENCMISS_INSTALL_DIR}") + # Use the OpenCMISS scripts to also allow choosing a separate toolchain + # This file is located at the opencmiss installation rather than the local example + # as it avoids file replication and makes maintenance much easier + if (TOOLCHAIN) + set(_OCTC ${OPENCMISS_INSTALL_DIR}/cmake/OCToolchainCompilers.cmake) + if (EXISTS "${_OCTC}") + include(${_OCTC}) + else() + message(WARNING "TOOLCHAIN specified but OpenCMISS config script could not be found at ${_OCTC}. Trying CMake defaults.") + endif() + unset(_OCTC) + endif() + set(OpenCMISS_DIR "${OPENCMISS_INSTALL_DIR}" CACHE PATH "Path to the found OpenCMISS (SDK) installation") +else() + message(WARNING "No OpenCMISS (SDK) installation directory detected. Using default system environment.") +endif() + \ No newline at end of file diff --git a/ClassicalField/AdvectionDiffusion/AdvectionDiffusionIO_ALE/build_debug/build.sh b/ClassicalField/AdvectionDiffusion/AdvectionDiffusionIO_ALE/build_debug/build.sh new file mode 100644 index 00000000..e6624bac --- /dev/null +++ b/ClassicalField/AdvectionDiffusion/AdvectionDiffusionIO_ALE/build_debug/build.sh @@ -0,0 +1,2 @@ +#ccc && cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all +cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all diff --git a/ClassicalField/AdvectionDiffusion/AdvectionDiffusionIO_BCs/CMakeLists.txt b/ClassicalField/AdvectionDiffusion/AdvectionDiffusionIO_BCs/CMakeLists.txt new file mode 100644 index 00000000..a22b61ee --- /dev/null +++ b/ClassicalField/AdvectionDiffusion/AdvectionDiffusionIO_BCs/CMakeLists.txt @@ -0,0 +1,35 @@ +# 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 C) +enable_language(Fortran OPTIONAL) +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 +# ---------------------- +#add_subdirectory(C) +if (CMAKE_Fortran_COMPILER) + add_subdirectory(Fortran) +endif() diff --git a/ClassicalField/AdvectionDiffusion/AdvectionDiffusionIO_BCs/Fortran/CMakeLists.txt b/ClassicalField/AdvectionDiffusion/AdvectionDiffusionIO_BCs/Fortran/CMakeLists.txt new file mode 100644 index 00000000..363a7601 --- /dev/null +++ b/ClassicalField/AdvectionDiffusion/AdvectionDiffusionIO_BCs/Fortran/CMakeLists.txt @@ -0,0 +1,60 @@ + +# Add example executable +add_executable(AdvectionDiffusionIO_BCs src/AdvectionDiffusionIO_BCsExample.f90) + +# Turn on Fortran preprocessing (#include directives) +if (MSVC) + set(PROC_OPT "/fpp") +else() + set(PROC_OPT "-cpp") +endif() + +# in debug mode, add flag that make Floating point exceptions fatal +set(OPT "") +if (FALSE) + if(CMAKE_BUILD_TYPE MATCHES DEBUG) + set(OPT "-ffpe-trap=invalid,zero,underflow,overflow,denormal") # GCC: make floating point exceptions fatal + endif() +endif() + +target_compile_options(AdvectionDiffusionIO_BCs PRIVATE ${PROC_OPT} ${OPT} "-fbacktrace") + +# Link to opencmiss +# ----------------- +# +# This simply uses the opencmiss target created by OC_INIT() above. +# +# Alternatively, you can also directly invoke 'find_package(Iron )' 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 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(AdvectionDiffusionIO_BCs PRIVATE opencmiss) + +# Add a simple test that runs the executable +add_test(NAME test_AdvectionDiffusionIO_BCs COMMAND AdvectionDiffusionIO_BCs) +add_opencmiss_environment(test_AdvectionDiffusionIO_BCs) + +################### +# 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. +# diff --git a/ClassicalField/AdvectionDiffusion/AdvectionDiffusionIO_BCs/src/AdvectionDiffusionIO_BCsExample.f90 b/ClassicalField/AdvectionDiffusion/AdvectionDiffusionIO_BCs/Fortran/src/AdvectionDiffusionIO_BCsExample.f90 similarity index 100% rename from ClassicalField/AdvectionDiffusion/AdvectionDiffusionIO_BCs/src/AdvectionDiffusionIO_BCsExample.f90 rename to ClassicalField/AdvectionDiffusion/AdvectionDiffusionIO_BCs/Fortran/src/AdvectionDiffusionIO_BCsExample.f90 diff --git a/ClassicalField/AdvectionDiffusion/AdvectionDiffusionIO_BCs/OpenCMISS.cmake b/ClassicalField/AdvectionDiffusion/AdvectionDiffusionIO_BCs/OpenCMISS.cmake new file mode 100644 index 00000000..3d6cf515 --- /dev/null +++ b/ClassicalField/AdvectionDiffusion/AdvectionDiffusionIO_BCs/OpenCMISS.cmake @@ -0,0 +1,95 @@ +########################### +# *DO NOT CHANGE THIS FILE* +########################### +# +# Prepares the use of OpenCMISS by scanning at various path locations for OpenCMISS (SDK) installations. +# +# Search order: +# - OPENCMISS_INSTALL_DIR variable +# - OPENCMISS_INSTALL_DIR environment variable +# - OPENCMISS_SDK_DIR variable +# - OPENCMISS_SDK_DIR environment variable +# - [Windows only] The Registry is searched additionally for installed SDKs. +# +# If found +# - Includes the toolchain config script of the found opencmiss installation to enable toolchain selection logic (non-windows) + +# Convenience: The OPENCMISS_INSTALL_DIR may also be defined in the environment and various other places +if (DEFINED OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using specified installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The specified OPENCMISS_INSTALL_DIR '${OPENCMISS_INSTALL_DIR}' does not exist. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_INSTALL_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_INSTALL_DIR}" OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using environment installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The environment variable OPENCMISS_INSTALL_DIR='${OPENCMISS_INSTALL_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if (NOT OPENCMISS_INSTALL_DIR AND DEFINED OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The specified OPENCMISS_SDK_DIR '${OPENCMISS_SDK_DIR}' does not exist. Skipping.") + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_SDK_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_SDK_DIR}" OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using environment SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The environment variable OPENCMISS_SDK_DIR='${OPENCMISS_SDK_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_SDK_DIR) + endif() +endif() +# On windows: check the registry for installed OpenCMISS SDKs +if(NOT OPENCMISS_INSTALL_DIR AND WIN32) + foreach(ROOT HKEY_CURRENT_USER HKEY_LOCAL_MACHINE) + foreach(PACKAGE OpenCMISSUserSDK OpenCMISSDeveloperSDK) + set(_REG_KEY "[${ROOT}\\Software\\Auckland Bioengineering Institute\\${PACKAGE}]") + get_filename_component(OPENCMISS_INSTALL_DIR "${_REG_KEY}" ABSOLUTE) + #message(STATUS "Trying registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Found ${PACKAGE} in Windows registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + break() + else() + unset(OPENCMISS_INSTALL_DIR) + endif() + endforeach() + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + break() + endif() + endforeach() +endif() + +if(OPENCMISS_INSTALL_DIR) + message(STATUS "OPENCMISS_INSTALL_DIR=${OPENCMISS_INSTALL_DIR}") + # Use the OpenCMISS scripts to also allow choosing a separate toolchain + # This file is located at the opencmiss installation rather than the local example + # as it avoids file replication and makes maintenance much easier + if (TOOLCHAIN) + set(_OCTC ${OPENCMISS_INSTALL_DIR}/cmake/OCToolchainCompilers.cmake) + if (EXISTS "${_OCTC}") + include(${_OCTC}) + else() + message(WARNING "TOOLCHAIN specified but OpenCMISS config script could not be found at ${_OCTC}. Trying CMake defaults.") + endif() + unset(_OCTC) + endif() + set(OpenCMISS_DIR "${OPENCMISS_INSTALL_DIR}" CACHE PATH "Path to the found OpenCMISS (SDK) installation") +else() + message(WARNING "No OpenCMISS (SDK) installation directory detected. Using default system environment.") +endif() + \ No newline at end of file diff --git a/ClassicalField/AdvectionDiffusion/AdvectionDiffusionIO_BCs/build_debug/build.sh b/ClassicalField/AdvectionDiffusion/AdvectionDiffusionIO_BCs/build_debug/build.sh new file mode 100644 index 00000000..e6624bac --- /dev/null +++ b/ClassicalField/AdvectionDiffusion/AdvectionDiffusionIO_BCs/build_debug/build.sh @@ -0,0 +1,2 @@ +#ccc && cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all +cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all diff --git a/ClassicalField/AdvectionDiffusion/StaticAdvectionDiffusion/CMakeLists.txt b/ClassicalField/AdvectionDiffusion/StaticAdvectionDiffusion/CMakeLists.txt new file mode 100644 index 00000000..a22b61ee --- /dev/null +++ b/ClassicalField/AdvectionDiffusion/StaticAdvectionDiffusion/CMakeLists.txt @@ -0,0 +1,35 @@ +# 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 C) +enable_language(Fortran OPTIONAL) +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 +# ---------------------- +#add_subdirectory(C) +if (CMAKE_Fortran_COMPILER) + add_subdirectory(Fortran) +endif() diff --git a/ClassicalField/AdvectionDiffusion/StaticAdvectionDiffusion/Fortran/CMakeLists.txt b/ClassicalField/AdvectionDiffusion/StaticAdvectionDiffusion/Fortran/CMakeLists.txt new file mode 100644 index 00000000..8456f6ce --- /dev/null +++ b/ClassicalField/AdvectionDiffusion/StaticAdvectionDiffusion/Fortran/CMakeLists.txt @@ -0,0 +1,60 @@ + +# Add example executable +add_executable(StaticAdvectionDiffusion src/StaticAdvectionDiffusionExample.f90) + +# Turn on Fortran preprocessing (#include directives) +if (MSVC) + set(PROC_OPT "/fpp") +else() + set(PROC_OPT "-cpp") +endif() + +# in debug mode, add flag that make Floating point exceptions fatal +set(OPT "") +if (FALSE) + if(CMAKE_BUILD_TYPE MATCHES DEBUG) + set(OPT "-ffpe-trap=invalid,zero,underflow,overflow,denormal") # GCC: make floating point exceptions fatal + endif() +endif() + +target_compile_options(StaticAdvectionDiffusion PRIVATE ${PROC_OPT} ${OPT} "-fbacktrace") + +# Link to opencmiss +# ----------------- +# +# This simply uses the opencmiss target created by OC_INIT() above. +# +# Alternatively, you can also directly invoke 'find_package(Iron )' 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 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(StaticAdvectionDiffusion PRIVATE opencmiss) + +# Add a simple test that runs the executable +add_test(NAME test_StaticAdvectionDiffusion COMMAND StaticAdvectionDiffusion) +add_opencmiss_environment(test_StaticAdvectionDiffusion) + +################### +# 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. +# diff --git a/ClassicalField/AdvectionDiffusion/StaticAdvectionDiffusion/src/StaticAdvectionDiffusionExample.f90 b/ClassicalField/AdvectionDiffusion/StaticAdvectionDiffusion/Fortran/src/StaticAdvectionDiffusionExample.f90 similarity index 100% rename from ClassicalField/AdvectionDiffusion/StaticAdvectionDiffusion/src/StaticAdvectionDiffusionExample.f90 rename to ClassicalField/AdvectionDiffusion/StaticAdvectionDiffusion/Fortran/src/StaticAdvectionDiffusionExample.f90 diff --git a/ClassicalField/AdvectionDiffusion/StaticAdvectionDiffusion/OpenCMISS.cmake b/ClassicalField/AdvectionDiffusion/StaticAdvectionDiffusion/OpenCMISS.cmake new file mode 100644 index 00000000..3d6cf515 --- /dev/null +++ b/ClassicalField/AdvectionDiffusion/StaticAdvectionDiffusion/OpenCMISS.cmake @@ -0,0 +1,95 @@ +########################### +# *DO NOT CHANGE THIS FILE* +########################### +# +# Prepares the use of OpenCMISS by scanning at various path locations for OpenCMISS (SDK) installations. +# +# Search order: +# - OPENCMISS_INSTALL_DIR variable +# - OPENCMISS_INSTALL_DIR environment variable +# - OPENCMISS_SDK_DIR variable +# - OPENCMISS_SDK_DIR environment variable +# - [Windows only] The Registry is searched additionally for installed SDKs. +# +# If found +# - Includes the toolchain config script of the found opencmiss installation to enable toolchain selection logic (non-windows) + +# Convenience: The OPENCMISS_INSTALL_DIR may also be defined in the environment and various other places +if (DEFINED OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using specified installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The specified OPENCMISS_INSTALL_DIR '${OPENCMISS_INSTALL_DIR}' does not exist. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_INSTALL_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_INSTALL_DIR}" OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using environment installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The environment variable OPENCMISS_INSTALL_DIR='${OPENCMISS_INSTALL_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if (NOT OPENCMISS_INSTALL_DIR AND DEFINED OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The specified OPENCMISS_SDK_DIR '${OPENCMISS_SDK_DIR}' does not exist. Skipping.") + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_SDK_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_SDK_DIR}" OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using environment SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The environment variable OPENCMISS_SDK_DIR='${OPENCMISS_SDK_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_SDK_DIR) + endif() +endif() +# On windows: check the registry for installed OpenCMISS SDKs +if(NOT OPENCMISS_INSTALL_DIR AND WIN32) + foreach(ROOT HKEY_CURRENT_USER HKEY_LOCAL_MACHINE) + foreach(PACKAGE OpenCMISSUserSDK OpenCMISSDeveloperSDK) + set(_REG_KEY "[${ROOT}\\Software\\Auckland Bioengineering Institute\\${PACKAGE}]") + get_filename_component(OPENCMISS_INSTALL_DIR "${_REG_KEY}" ABSOLUTE) + #message(STATUS "Trying registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Found ${PACKAGE} in Windows registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + break() + else() + unset(OPENCMISS_INSTALL_DIR) + endif() + endforeach() + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + break() + endif() + endforeach() +endif() + +if(OPENCMISS_INSTALL_DIR) + message(STATUS "OPENCMISS_INSTALL_DIR=${OPENCMISS_INSTALL_DIR}") + # Use the OpenCMISS scripts to also allow choosing a separate toolchain + # This file is located at the opencmiss installation rather than the local example + # as it avoids file replication and makes maintenance much easier + if (TOOLCHAIN) + set(_OCTC ${OPENCMISS_INSTALL_DIR}/cmake/OCToolchainCompilers.cmake) + if (EXISTS "${_OCTC}") + include(${_OCTC}) + else() + message(WARNING "TOOLCHAIN specified but OpenCMISS config script could not be found at ${_OCTC}. Trying CMake defaults.") + endif() + unset(_OCTC) + endif() + set(OpenCMISS_DIR "${OPENCMISS_INSTALL_DIR}" CACHE PATH "Path to the found OpenCMISS (SDK) installation") +else() + message(WARNING "No OpenCMISS (SDK) installation directory detected. Using default system environment.") +endif() + \ No newline at end of file diff --git a/ClassicalField/AdvectionDiffusion/StaticAdvectionDiffusion/build_debug/build.sh b/ClassicalField/AdvectionDiffusion/StaticAdvectionDiffusion/build_debug/build.sh new file mode 100644 index 00000000..e6624bac --- /dev/null +++ b/ClassicalField/AdvectionDiffusion/StaticAdvectionDiffusion/build_debug/build.sh @@ -0,0 +1,2 @@ +#ccc && cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all +cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all diff --git a/ClassicalField/AdvectionDiffusion/StaticAdvectionDiffusionSUPG/CMakeLists.txt b/ClassicalField/AdvectionDiffusion/StaticAdvectionDiffusionSUPG/CMakeLists.txt new file mode 100644 index 00000000..a22b61ee --- /dev/null +++ b/ClassicalField/AdvectionDiffusion/StaticAdvectionDiffusionSUPG/CMakeLists.txt @@ -0,0 +1,35 @@ +# 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 C) +enable_language(Fortran OPTIONAL) +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 +# ---------------------- +#add_subdirectory(C) +if (CMAKE_Fortran_COMPILER) + add_subdirectory(Fortran) +endif() diff --git a/ClassicalField/AdvectionDiffusion/StaticAdvectionDiffusionSUPG/Fortran/CMakeLists.txt b/ClassicalField/AdvectionDiffusion/StaticAdvectionDiffusionSUPG/Fortran/CMakeLists.txt new file mode 100644 index 00000000..b7247c3f --- /dev/null +++ b/ClassicalField/AdvectionDiffusion/StaticAdvectionDiffusionSUPG/Fortran/CMakeLists.txt @@ -0,0 +1,60 @@ + +# Add example executable +add_executable(StaticAdvectionDiffusionSUPG src/StaticAdvectionDiffusionSUPGExample.f90) + +# Turn on Fortran preprocessing (#include directives) +if (MSVC) + set(PROC_OPT "/fpp") +else() + set(PROC_OPT "-cpp") +endif() + +# in debug mode, add flag that make Floating point exceptions fatal +set(OPT "") +if (FALSE) + if(CMAKE_BUILD_TYPE MATCHES DEBUG) + set(OPT "-ffpe-trap=invalid,zero,underflow,overflow,denormal") # GCC: make floating point exceptions fatal + endif() +endif() + +target_compile_options(StaticAdvectionDiffusionSUPG PRIVATE ${PROC_OPT} ${OPT} "-fbacktrace") + +# Link to opencmiss +# ----------------- +# +# This simply uses the opencmiss target created by OC_INIT() above. +# +# Alternatively, you can also directly invoke 'find_package(Iron )' 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 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(StaticAdvectionDiffusionSUPG PRIVATE opencmiss) + +# Add a simple test that runs the executable +add_test(NAME test_StaticAdvectionDiffusionSUPG COMMAND StaticAdvectionDiffusionSUPG) +add_opencmiss_environment(test_StaticAdvectionDiffusionSUPG) + +################### +# 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. +# diff --git a/ClassicalField/AdvectionDiffusion/StaticAdvectionDiffusionSUPG/src/StaticAdvectionDiffusionSUPGExample.f90 b/ClassicalField/AdvectionDiffusion/StaticAdvectionDiffusionSUPG/Fortran/src/StaticAdvectionDiffusionSUPGExample.f90 similarity index 100% rename from ClassicalField/AdvectionDiffusion/StaticAdvectionDiffusionSUPG/src/StaticAdvectionDiffusionSUPGExample.f90 rename to ClassicalField/AdvectionDiffusion/StaticAdvectionDiffusionSUPG/Fortran/src/StaticAdvectionDiffusionSUPGExample.f90 diff --git a/ClassicalField/AdvectionDiffusion/StaticAdvectionDiffusionSUPG/OpenCMISS.cmake b/ClassicalField/AdvectionDiffusion/StaticAdvectionDiffusionSUPG/OpenCMISS.cmake new file mode 100644 index 00000000..3d6cf515 --- /dev/null +++ b/ClassicalField/AdvectionDiffusion/StaticAdvectionDiffusionSUPG/OpenCMISS.cmake @@ -0,0 +1,95 @@ +########################### +# *DO NOT CHANGE THIS FILE* +########################### +# +# Prepares the use of OpenCMISS by scanning at various path locations for OpenCMISS (SDK) installations. +# +# Search order: +# - OPENCMISS_INSTALL_DIR variable +# - OPENCMISS_INSTALL_DIR environment variable +# - OPENCMISS_SDK_DIR variable +# - OPENCMISS_SDK_DIR environment variable +# - [Windows only] The Registry is searched additionally for installed SDKs. +# +# If found +# - Includes the toolchain config script of the found opencmiss installation to enable toolchain selection logic (non-windows) + +# Convenience: The OPENCMISS_INSTALL_DIR may also be defined in the environment and various other places +if (DEFINED OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using specified installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The specified OPENCMISS_INSTALL_DIR '${OPENCMISS_INSTALL_DIR}' does not exist. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_INSTALL_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_INSTALL_DIR}" OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using environment installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The environment variable OPENCMISS_INSTALL_DIR='${OPENCMISS_INSTALL_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if (NOT OPENCMISS_INSTALL_DIR AND DEFINED OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The specified OPENCMISS_SDK_DIR '${OPENCMISS_SDK_DIR}' does not exist. Skipping.") + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_SDK_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_SDK_DIR}" OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using environment SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The environment variable OPENCMISS_SDK_DIR='${OPENCMISS_SDK_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_SDK_DIR) + endif() +endif() +# On windows: check the registry for installed OpenCMISS SDKs +if(NOT OPENCMISS_INSTALL_DIR AND WIN32) + foreach(ROOT HKEY_CURRENT_USER HKEY_LOCAL_MACHINE) + foreach(PACKAGE OpenCMISSUserSDK OpenCMISSDeveloperSDK) + set(_REG_KEY "[${ROOT}\\Software\\Auckland Bioengineering Institute\\${PACKAGE}]") + get_filename_component(OPENCMISS_INSTALL_DIR "${_REG_KEY}" ABSOLUTE) + #message(STATUS "Trying registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Found ${PACKAGE} in Windows registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + break() + else() + unset(OPENCMISS_INSTALL_DIR) + endif() + endforeach() + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + break() + endif() + endforeach() +endif() + +if(OPENCMISS_INSTALL_DIR) + message(STATUS "OPENCMISS_INSTALL_DIR=${OPENCMISS_INSTALL_DIR}") + # Use the OpenCMISS scripts to also allow choosing a separate toolchain + # This file is located at the opencmiss installation rather than the local example + # as it avoids file replication and makes maintenance much easier + if (TOOLCHAIN) + set(_OCTC ${OPENCMISS_INSTALL_DIR}/cmake/OCToolchainCompilers.cmake) + if (EXISTS "${_OCTC}") + include(${_OCTC}) + else() + message(WARNING "TOOLCHAIN specified but OpenCMISS config script could not be found at ${_OCTC}. Trying CMake defaults.") + endif() + unset(_OCTC) + endif() + set(OpenCMISS_DIR "${OPENCMISS_INSTALL_DIR}" CACHE PATH "Path to the found OpenCMISS (SDK) installation") +else() + message(WARNING "No OpenCMISS (SDK) installation directory detected. Using default system environment.") +endif() + \ No newline at end of file diff --git a/ClassicalField/AdvectionDiffusion/StaticAdvectionDiffusionSUPG/build_debug/build.sh b/ClassicalField/AdvectionDiffusion/StaticAdvectionDiffusionSUPG/build_debug/build.sh new file mode 100644 index 00000000..e6624bac --- /dev/null +++ b/ClassicalField/AdvectionDiffusion/StaticAdvectionDiffusionSUPG/build_debug/build.sh @@ -0,0 +1,2 @@ +#ccc && cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all +cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all diff --git a/ClassicalField/AdvectionDiffusion/StaticAdvectionDiffusion_FieldML/CMakeLists.txt b/ClassicalField/AdvectionDiffusion/StaticAdvectionDiffusion_FieldML/CMakeLists.txt new file mode 100644 index 00000000..a22b61ee --- /dev/null +++ b/ClassicalField/AdvectionDiffusion/StaticAdvectionDiffusion_FieldML/CMakeLists.txt @@ -0,0 +1,35 @@ +# 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 C) +enable_language(Fortran OPTIONAL) +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 +# ---------------------- +#add_subdirectory(C) +if (CMAKE_Fortran_COMPILER) + add_subdirectory(Fortran) +endif() diff --git a/ClassicalField/AdvectionDiffusion/StaticAdvectionDiffusion_FieldML/Fortran/CMakeLists.txt b/ClassicalField/AdvectionDiffusion/StaticAdvectionDiffusion_FieldML/Fortran/CMakeLists.txt new file mode 100644 index 00000000..1079cd81 --- /dev/null +++ b/ClassicalField/AdvectionDiffusion/StaticAdvectionDiffusion_FieldML/Fortran/CMakeLists.txt @@ -0,0 +1,60 @@ + +# Add example executable +add_executable(StaticAdvectionDiffusion_FieldML src/StaticAdvectionDiffusion_FieldMLExample.f90) + +# Turn on Fortran preprocessing (#include directives) +if (MSVC) + set(PROC_OPT "/fpp") +else() + set(PROC_OPT "-cpp") +endif() + +# in debug mode, add flag that make Floating point exceptions fatal +set(OPT "") +if (FALSE) + if(CMAKE_BUILD_TYPE MATCHES DEBUG) + set(OPT "-ffpe-trap=invalid,zero,underflow,overflow,denormal") # GCC: make floating point exceptions fatal + endif() +endif() + +target_compile_options(StaticAdvectionDiffusion_FieldML PRIVATE ${PROC_OPT} ${OPT} "-fbacktrace") + +# Link to opencmiss +# ----------------- +# +# This simply uses the opencmiss target created by OC_INIT() above. +# +# Alternatively, you can also directly invoke 'find_package(Iron )' 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 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(StaticAdvectionDiffusion_FieldML PRIVATE opencmiss) + +# Add a simple test that runs the executable +add_test(NAME test_StaticAdvectionDiffusion_FieldML COMMAND StaticAdvectionDiffusion_FieldML) +add_opencmiss_environment(test_StaticAdvectionDiffusion_FieldML) + +################### +# 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. +# diff --git a/ClassicalField/AdvectionDiffusion/StaticAdvectionDiffusion_FieldML/src/StaticAdvectionDiffusion_FieldMLExample.f90 b/ClassicalField/AdvectionDiffusion/StaticAdvectionDiffusion_FieldML/Fortran/src/StaticAdvectionDiffusion_FieldMLExample.f90 similarity index 100% rename from ClassicalField/AdvectionDiffusion/StaticAdvectionDiffusion_FieldML/src/StaticAdvectionDiffusion_FieldMLExample.f90 rename to ClassicalField/AdvectionDiffusion/StaticAdvectionDiffusion_FieldML/Fortran/src/StaticAdvectionDiffusion_FieldMLExample.f90 diff --git a/ClassicalField/AdvectionDiffusion/StaticAdvectionDiffusion_FieldML/OpenCMISS.cmake b/ClassicalField/AdvectionDiffusion/StaticAdvectionDiffusion_FieldML/OpenCMISS.cmake new file mode 100644 index 00000000..3d6cf515 --- /dev/null +++ b/ClassicalField/AdvectionDiffusion/StaticAdvectionDiffusion_FieldML/OpenCMISS.cmake @@ -0,0 +1,95 @@ +########################### +# *DO NOT CHANGE THIS FILE* +########################### +# +# Prepares the use of OpenCMISS by scanning at various path locations for OpenCMISS (SDK) installations. +# +# Search order: +# - OPENCMISS_INSTALL_DIR variable +# - OPENCMISS_INSTALL_DIR environment variable +# - OPENCMISS_SDK_DIR variable +# - OPENCMISS_SDK_DIR environment variable +# - [Windows only] The Registry is searched additionally for installed SDKs. +# +# If found +# - Includes the toolchain config script of the found opencmiss installation to enable toolchain selection logic (non-windows) + +# Convenience: The OPENCMISS_INSTALL_DIR may also be defined in the environment and various other places +if (DEFINED OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using specified installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The specified OPENCMISS_INSTALL_DIR '${OPENCMISS_INSTALL_DIR}' does not exist. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_INSTALL_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_INSTALL_DIR}" OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using environment installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The environment variable OPENCMISS_INSTALL_DIR='${OPENCMISS_INSTALL_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if (NOT OPENCMISS_INSTALL_DIR AND DEFINED OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The specified OPENCMISS_SDK_DIR '${OPENCMISS_SDK_DIR}' does not exist. Skipping.") + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_SDK_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_SDK_DIR}" OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using environment SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The environment variable OPENCMISS_SDK_DIR='${OPENCMISS_SDK_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_SDK_DIR) + endif() +endif() +# On windows: check the registry for installed OpenCMISS SDKs +if(NOT OPENCMISS_INSTALL_DIR AND WIN32) + foreach(ROOT HKEY_CURRENT_USER HKEY_LOCAL_MACHINE) + foreach(PACKAGE OpenCMISSUserSDK OpenCMISSDeveloperSDK) + set(_REG_KEY "[${ROOT}\\Software\\Auckland Bioengineering Institute\\${PACKAGE}]") + get_filename_component(OPENCMISS_INSTALL_DIR "${_REG_KEY}" ABSOLUTE) + #message(STATUS "Trying registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Found ${PACKAGE} in Windows registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + break() + else() + unset(OPENCMISS_INSTALL_DIR) + endif() + endforeach() + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + break() + endif() + endforeach() +endif() + +if(OPENCMISS_INSTALL_DIR) + message(STATUS "OPENCMISS_INSTALL_DIR=${OPENCMISS_INSTALL_DIR}") + # Use the OpenCMISS scripts to also allow choosing a separate toolchain + # This file is located at the opencmiss installation rather than the local example + # as it avoids file replication and makes maintenance much easier + if (TOOLCHAIN) + set(_OCTC ${OPENCMISS_INSTALL_DIR}/cmake/OCToolchainCompilers.cmake) + if (EXISTS "${_OCTC}") + include(${_OCTC}) + else() + message(WARNING "TOOLCHAIN specified but OpenCMISS config script could not be found at ${_OCTC}. Trying CMake defaults.") + endif() + unset(_OCTC) + endif() + set(OpenCMISS_DIR "${OPENCMISS_INSTALL_DIR}" CACHE PATH "Path to the found OpenCMISS (SDK) installation") +else() + message(WARNING "No OpenCMISS (SDK) installation directory detected. Using default system environment.") +endif() + \ No newline at end of file diff --git a/ClassicalField/AdvectionDiffusion/StaticAdvectionDiffusion_FieldML/build_debug/build.sh b/ClassicalField/AdvectionDiffusion/StaticAdvectionDiffusion_FieldML/build_debug/build.sh new file mode 100644 index 00000000..e6624bac --- /dev/null +++ b/ClassicalField/AdvectionDiffusion/StaticAdvectionDiffusion_FieldML/build_debug/build.sh @@ -0,0 +1,2 @@ +#ccc && cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all +cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all diff --git a/ClassicalField/Diffusion/Analytic1DDiffusion/CMakeLists.txt b/ClassicalField/Diffusion/Analytic1DDiffusion/CMakeLists.txt new file mode 100644 index 00000000..a22b61ee --- /dev/null +++ b/ClassicalField/Diffusion/Analytic1DDiffusion/CMakeLists.txt @@ -0,0 +1,35 @@ +# 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 C) +enable_language(Fortran OPTIONAL) +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 +# ---------------------- +#add_subdirectory(C) +if (CMAKE_Fortran_COMPILER) + add_subdirectory(Fortran) +endif() diff --git a/ClassicalField/Diffusion/Analytic1DDiffusion/Fortran/CMakeLists.txt b/ClassicalField/Diffusion/Analytic1DDiffusion/Fortran/CMakeLists.txt new file mode 100644 index 00000000..c25b7b0e --- /dev/null +++ b/ClassicalField/Diffusion/Analytic1DDiffusion/Fortran/CMakeLists.txt @@ -0,0 +1,60 @@ + +# Add example executable +add_executable(Analytic1DDiffusion src/Analytic1DDiffusionExample.f90) + +# Turn on Fortran preprocessing (#include directives) +if (MSVC) + set(PROC_OPT "/fpp") +else() + set(PROC_OPT "-cpp") +endif() + +# in debug mode, add flag that make Floating point exceptions fatal +set(OPT "") +if (FALSE) + if(CMAKE_BUILD_TYPE MATCHES DEBUG) + set(OPT "-ffpe-trap=invalid,zero,underflow,overflow,denormal") # GCC: make floating point exceptions fatal + endif() +endif() + +target_compile_options(Analytic1DDiffusion PRIVATE ${PROC_OPT} ${OPT} "-fbacktrace") + +# Link to opencmiss +# ----------------- +# +# This simply uses the opencmiss target created by OC_INIT() above. +# +# Alternatively, you can also directly invoke 'find_package(Iron )' 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 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(Analytic1DDiffusion PRIVATE opencmiss) + +# Add a simple test that runs the executable +add_test(NAME test_Analytic1DDiffusion COMMAND Analytic1DDiffusion) +add_opencmiss_environment(test_Analytic1DDiffusion) + +################### +# 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. +# diff --git a/ClassicalField/Diffusion/Analytic1DDiffusion/src/Analytic1DDiffusionExample.f90 b/ClassicalField/Diffusion/Analytic1DDiffusion/Fortran/src/Analytic1DDiffusionExample.f90 similarity index 100% rename from ClassicalField/Diffusion/Analytic1DDiffusion/src/Analytic1DDiffusionExample.f90 rename to ClassicalField/Diffusion/Analytic1DDiffusion/Fortran/src/Analytic1DDiffusionExample.f90 diff --git a/ClassicalField/Diffusion/Analytic1DDiffusion/OpenCMISS.cmake b/ClassicalField/Diffusion/Analytic1DDiffusion/OpenCMISS.cmake new file mode 100644 index 00000000..3d6cf515 --- /dev/null +++ b/ClassicalField/Diffusion/Analytic1DDiffusion/OpenCMISS.cmake @@ -0,0 +1,95 @@ +########################### +# *DO NOT CHANGE THIS FILE* +########################### +# +# Prepares the use of OpenCMISS by scanning at various path locations for OpenCMISS (SDK) installations. +# +# Search order: +# - OPENCMISS_INSTALL_DIR variable +# - OPENCMISS_INSTALL_DIR environment variable +# - OPENCMISS_SDK_DIR variable +# - OPENCMISS_SDK_DIR environment variable +# - [Windows only] The Registry is searched additionally for installed SDKs. +# +# If found +# - Includes the toolchain config script of the found opencmiss installation to enable toolchain selection logic (non-windows) + +# Convenience: The OPENCMISS_INSTALL_DIR may also be defined in the environment and various other places +if (DEFINED OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using specified installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The specified OPENCMISS_INSTALL_DIR '${OPENCMISS_INSTALL_DIR}' does not exist. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_INSTALL_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_INSTALL_DIR}" OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using environment installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The environment variable OPENCMISS_INSTALL_DIR='${OPENCMISS_INSTALL_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if (NOT OPENCMISS_INSTALL_DIR AND DEFINED OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The specified OPENCMISS_SDK_DIR '${OPENCMISS_SDK_DIR}' does not exist. Skipping.") + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_SDK_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_SDK_DIR}" OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using environment SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The environment variable OPENCMISS_SDK_DIR='${OPENCMISS_SDK_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_SDK_DIR) + endif() +endif() +# On windows: check the registry for installed OpenCMISS SDKs +if(NOT OPENCMISS_INSTALL_DIR AND WIN32) + foreach(ROOT HKEY_CURRENT_USER HKEY_LOCAL_MACHINE) + foreach(PACKAGE OpenCMISSUserSDK OpenCMISSDeveloperSDK) + set(_REG_KEY "[${ROOT}\\Software\\Auckland Bioengineering Institute\\${PACKAGE}]") + get_filename_component(OPENCMISS_INSTALL_DIR "${_REG_KEY}" ABSOLUTE) + #message(STATUS "Trying registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Found ${PACKAGE} in Windows registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + break() + else() + unset(OPENCMISS_INSTALL_DIR) + endif() + endforeach() + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + break() + endif() + endforeach() +endif() + +if(OPENCMISS_INSTALL_DIR) + message(STATUS "OPENCMISS_INSTALL_DIR=${OPENCMISS_INSTALL_DIR}") + # Use the OpenCMISS scripts to also allow choosing a separate toolchain + # This file is located at the opencmiss installation rather than the local example + # as it avoids file replication and makes maintenance much easier + if (TOOLCHAIN) + set(_OCTC ${OPENCMISS_INSTALL_DIR}/cmake/OCToolchainCompilers.cmake) + if (EXISTS "${_OCTC}") + include(${_OCTC}) + else() + message(WARNING "TOOLCHAIN specified but OpenCMISS config script could not be found at ${_OCTC}. Trying CMake defaults.") + endif() + unset(_OCTC) + endif() + set(OpenCMISS_DIR "${OPENCMISS_INSTALL_DIR}" CACHE PATH "Path to the found OpenCMISS (SDK) installation") +else() + message(WARNING "No OpenCMISS (SDK) installation directory detected. Using default system environment.") +endif() + \ No newline at end of file diff --git a/ClassicalField/Diffusion/Analytic1DDiffusion/build_debug/build.sh b/ClassicalField/Diffusion/Analytic1DDiffusion/build_debug/build.sh new file mode 100644 index 00000000..e6624bac --- /dev/null +++ b/ClassicalField/Diffusion/Analytic1DDiffusion/build_debug/build.sh @@ -0,0 +1,2 @@ +#ccc && cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all +cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all diff --git a/ClassicalField/Diffusion/CubicConvergenceTest/CMakeLists.txt b/ClassicalField/Diffusion/CubicConvergenceTest/CMakeLists.txt new file mode 100644 index 00000000..a22b61ee --- /dev/null +++ b/ClassicalField/Diffusion/CubicConvergenceTest/CMakeLists.txt @@ -0,0 +1,35 @@ +# 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 C) +enable_language(Fortran OPTIONAL) +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 +# ---------------------- +#add_subdirectory(C) +if (CMAKE_Fortran_COMPILER) + add_subdirectory(Fortran) +endif() diff --git a/ClassicalField/Diffusion/CubicConvergenceTest/Fortran/CMakeLists.txt b/ClassicalField/Diffusion/CubicConvergenceTest/Fortran/CMakeLists.txt new file mode 100644 index 00000000..f3ed6db8 --- /dev/null +++ b/ClassicalField/Diffusion/CubicConvergenceTest/Fortran/CMakeLists.txt @@ -0,0 +1,60 @@ + +# Add example executable +add_executable(CubicConvergenceTest src/CubicConvergenceTestExample.f90) + +# Turn on Fortran preprocessing (#include directives) +if (MSVC) + set(PROC_OPT "/fpp") +else() + set(PROC_OPT "-cpp") +endif() + +# in debug mode, add flag that make Floating point exceptions fatal +set(OPT "") +if (FALSE) + if(CMAKE_BUILD_TYPE MATCHES DEBUG) + set(OPT "-ffpe-trap=invalid,zero,underflow,overflow,denormal") # GCC: make floating point exceptions fatal + endif() +endif() + +target_compile_options(CubicConvergenceTest PRIVATE ${PROC_OPT} ${OPT} "-fbacktrace") + +# Link to opencmiss +# ----------------- +# +# This simply uses the opencmiss target created by OC_INIT() above. +# +# Alternatively, you can also directly invoke 'find_package(Iron )' 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 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(CubicConvergenceTest PRIVATE opencmiss) + +# Add a simple test that runs the executable +add_test(NAME test_CubicConvergenceTest COMMAND CubicConvergenceTest) +add_opencmiss_environment(test_CubicConvergenceTest) + +################### +# 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. +# diff --git a/ClassicalField/Diffusion/CubicConvergenceTest/src/CubicConvergenceTestExample.f90 b/ClassicalField/Diffusion/CubicConvergenceTest/Fortran/src/CubicConvergenceTestExample.f90 similarity index 100% rename from ClassicalField/Diffusion/CubicConvergenceTest/src/CubicConvergenceTestExample.f90 rename to ClassicalField/Diffusion/CubicConvergenceTest/Fortran/src/CubicConvergenceTestExample.f90 diff --git a/ClassicalField/Diffusion/CubicConvergenceTest/OpenCMISS.cmake b/ClassicalField/Diffusion/CubicConvergenceTest/OpenCMISS.cmake new file mode 100644 index 00000000..3d6cf515 --- /dev/null +++ b/ClassicalField/Diffusion/CubicConvergenceTest/OpenCMISS.cmake @@ -0,0 +1,95 @@ +########################### +# *DO NOT CHANGE THIS FILE* +########################### +# +# Prepares the use of OpenCMISS by scanning at various path locations for OpenCMISS (SDK) installations. +# +# Search order: +# - OPENCMISS_INSTALL_DIR variable +# - OPENCMISS_INSTALL_DIR environment variable +# - OPENCMISS_SDK_DIR variable +# - OPENCMISS_SDK_DIR environment variable +# - [Windows only] The Registry is searched additionally for installed SDKs. +# +# If found +# - Includes the toolchain config script of the found opencmiss installation to enable toolchain selection logic (non-windows) + +# Convenience: The OPENCMISS_INSTALL_DIR may also be defined in the environment and various other places +if (DEFINED OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using specified installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The specified OPENCMISS_INSTALL_DIR '${OPENCMISS_INSTALL_DIR}' does not exist. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_INSTALL_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_INSTALL_DIR}" OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using environment installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The environment variable OPENCMISS_INSTALL_DIR='${OPENCMISS_INSTALL_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if (NOT OPENCMISS_INSTALL_DIR AND DEFINED OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The specified OPENCMISS_SDK_DIR '${OPENCMISS_SDK_DIR}' does not exist. Skipping.") + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_SDK_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_SDK_DIR}" OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using environment SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The environment variable OPENCMISS_SDK_DIR='${OPENCMISS_SDK_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_SDK_DIR) + endif() +endif() +# On windows: check the registry for installed OpenCMISS SDKs +if(NOT OPENCMISS_INSTALL_DIR AND WIN32) + foreach(ROOT HKEY_CURRENT_USER HKEY_LOCAL_MACHINE) + foreach(PACKAGE OpenCMISSUserSDK OpenCMISSDeveloperSDK) + set(_REG_KEY "[${ROOT}\\Software\\Auckland Bioengineering Institute\\${PACKAGE}]") + get_filename_component(OPENCMISS_INSTALL_DIR "${_REG_KEY}" ABSOLUTE) + #message(STATUS "Trying registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Found ${PACKAGE} in Windows registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + break() + else() + unset(OPENCMISS_INSTALL_DIR) + endif() + endforeach() + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + break() + endif() + endforeach() +endif() + +if(OPENCMISS_INSTALL_DIR) + message(STATUS "OPENCMISS_INSTALL_DIR=${OPENCMISS_INSTALL_DIR}") + # Use the OpenCMISS scripts to also allow choosing a separate toolchain + # This file is located at the opencmiss installation rather than the local example + # as it avoids file replication and makes maintenance much easier + if (TOOLCHAIN) + set(_OCTC ${OPENCMISS_INSTALL_DIR}/cmake/OCToolchainCompilers.cmake) + if (EXISTS "${_OCTC}") + include(${_OCTC}) + else() + message(WARNING "TOOLCHAIN specified but OpenCMISS config script could not be found at ${_OCTC}. Trying CMake defaults.") + endif() + unset(_OCTC) + endif() + set(OpenCMISS_DIR "${OPENCMISS_INSTALL_DIR}" CACHE PATH "Path to the found OpenCMISS (SDK) installation") +else() + message(WARNING "No OpenCMISS (SDK) installation directory detected. Using default system environment.") +endif() + \ No newline at end of file diff --git a/ClassicalField/Diffusion/CubicConvergenceTest/build_debug/build.sh b/ClassicalField/Diffusion/CubicConvergenceTest/build_debug/build.sh new file mode 100644 index 00000000..e6624bac --- /dev/null +++ b/ClassicalField/Diffusion/CubicConvergenceTest/build_debug/build.sh @@ -0,0 +1,2 @@ +#ccc && cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all +cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all diff --git a/ClassicalField/Diffusion/Diffusion/CMakeLists.txt b/ClassicalField/Diffusion/Diffusion/CMakeLists.txt new file mode 100644 index 00000000..a22b61ee --- /dev/null +++ b/ClassicalField/Diffusion/Diffusion/CMakeLists.txt @@ -0,0 +1,35 @@ +# 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 C) +enable_language(Fortran OPTIONAL) +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 +# ---------------------- +#add_subdirectory(C) +if (CMAKE_Fortran_COMPILER) + add_subdirectory(Fortran) +endif() diff --git a/ClassicalField/Diffusion/Diffusion/Fortran/CMakeLists.txt b/ClassicalField/Diffusion/Diffusion/Fortran/CMakeLists.txt new file mode 100644 index 00000000..df74638a --- /dev/null +++ b/ClassicalField/Diffusion/Diffusion/Fortran/CMakeLists.txt @@ -0,0 +1,60 @@ + +# Add example executable +add_executable(Diffusion src/DiffusionExample.f90) + +# Turn on Fortran preprocessing (#include directives) +if (MSVC) + set(PROC_OPT "/fpp") +else() + set(PROC_OPT "-cpp") +endif() + +# in debug mode, add flag that make Floating point exceptions fatal +set(OPT "") +if (FALSE) + if(CMAKE_BUILD_TYPE MATCHES DEBUG) + set(OPT "-ffpe-trap=invalid,zero,underflow,overflow,denormal") # GCC: make floating point exceptions fatal + endif() +endif() + +target_compile_options(Diffusion PRIVATE ${PROC_OPT} ${OPT} "-fbacktrace") + +# Link to opencmiss +# ----------------- +# +# This simply uses the opencmiss target created by OC_INIT() above. +# +# Alternatively, you can also directly invoke 'find_package(Iron )' 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 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(Diffusion PRIVATE opencmiss) + +# Add a simple test that runs the executable +add_test(NAME test_Diffusion COMMAND Diffusion) +add_opencmiss_environment(test_Diffusion) + +################### +# 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. +# diff --git a/ClassicalField/Diffusion/Diffusion/src/DiffusionExample.f90 b/ClassicalField/Diffusion/Diffusion/Fortran/src/DiffusionExample.f90 similarity index 100% rename from ClassicalField/Diffusion/Diffusion/src/DiffusionExample.f90 rename to ClassicalField/Diffusion/Diffusion/Fortran/src/DiffusionExample.f90 diff --git a/ClassicalField/Diffusion/Diffusion/OpenCMISS.cmake b/ClassicalField/Diffusion/Diffusion/OpenCMISS.cmake new file mode 100644 index 00000000..3d6cf515 --- /dev/null +++ b/ClassicalField/Diffusion/Diffusion/OpenCMISS.cmake @@ -0,0 +1,95 @@ +########################### +# *DO NOT CHANGE THIS FILE* +########################### +# +# Prepares the use of OpenCMISS by scanning at various path locations for OpenCMISS (SDK) installations. +# +# Search order: +# - OPENCMISS_INSTALL_DIR variable +# - OPENCMISS_INSTALL_DIR environment variable +# - OPENCMISS_SDK_DIR variable +# - OPENCMISS_SDK_DIR environment variable +# - [Windows only] The Registry is searched additionally for installed SDKs. +# +# If found +# - Includes the toolchain config script of the found opencmiss installation to enable toolchain selection logic (non-windows) + +# Convenience: The OPENCMISS_INSTALL_DIR may also be defined in the environment and various other places +if (DEFINED OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using specified installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The specified OPENCMISS_INSTALL_DIR '${OPENCMISS_INSTALL_DIR}' does not exist. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_INSTALL_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_INSTALL_DIR}" OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using environment installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The environment variable OPENCMISS_INSTALL_DIR='${OPENCMISS_INSTALL_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if (NOT OPENCMISS_INSTALL_DIR AND DEFINED OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The specified OPENCMISS_SDK_DIR '${OPENCMISS_SDK_DIR}' does not exist. Skipping.") + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_SDK_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_SDK_DIR}" OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using environment SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The environment variable OPENCMISS_SDK_DIR='${OPENCMISS_SDK_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_SDK_DIR) + endif() +endif() +# On windows: check the registry for installed OpenCMISS SDKs +if(NOT OPENCMISS_INSTALL_DIR AND WIN32) + foreach(ROOT HKEY_CURRENT_USER HKEY_LOCAL_MACHINE) + foreach(PACKAGE OpenCMISSUserSDK OpenCMISSDeveloperSDK) + set(_REG_KEY "[${ROOT}\\Software\\Auckland Bioengineering Institute\\${PACKAGE}]") + get_filename_component(OPENCMISS_INSTALL_DIR "${_REG_KEY}" ABSOLUTE) + #message(STATUS "Trying registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Found ${PACKAGE} in Windows registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + break() + else() + unset(OPENCMISS_INSTALL_DIR) + endif() + endforeach() + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + break() + endif() + endforeach() +endif() + +if(OPENCMISS_INSTALL_DIR) + message(STATUS "OPENCMISS_INSTALL_DIR=${OPENCMISS_INSTALL_DIR}") + # Use the OpenCMISS scripts to also allow choosing a separate toolchain + # This file is located at the opencmiss installation rather than the local example + # as it avoids file replication and makes maintenance much easier + if (TOOLCHAIN) + set(_OCTC ${OPENCMISS_INSTALL_DIR}/cmake/OCToolchainCompilers.cmake) + if (EXISTS "${_OCTC}") + include(${_OCTC}) + else() + message(WARNING "TOOLCHAIN specified but OpenCMISS config script could not be found at ${_OCTC}. Trying CMake defaults.") + endif() + unset(_OCTC) + endif() + set(OpenCMISS_DIR "${OPENCMISS_INSTALL_DIR}" CACHE PATH "Path to the found OpenCMISS (SDK) installation") +else() + message(WARNING "No OpenCMISS (SDK) installation directory detected. Using default system environment.") +endif() + \ No newline at end of file diff --git a/ClassicalField/Diffusion/Diffusion/build_debug/build.sh b/ClassicalField/Diffusion/Diffusion/build_debug/build.sh new file mode 100644 index 00000000..e6624bac --- /dev/null +++ b/ClassicalField/Diffusion/Diffusion/build_debug/build.sh @@ -0,0 +1,2 @@ +#ccc && cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all +cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all diff --git a/ClassicalField/Diffusion/DiffusionConstantSource/CMakeLists.txt b/ClassicalField/Diffusion/DiffusionConstantSource/CMakeLists.txt new file mode 100644 index 00000000..a22b61ee --- /dev/null +++ b/ClassicalField/Diffusion/DiffusionConstantSource/CMakeLists.txt @@ -0,0 +1,35 @@ +# 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 C) +enable_language(Fortran OPTIONAL) +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 +# ---------------------- +#add_subdirectory(C) +if (CMAKE_Fortran_COMPILER) + add_subdirectory(Fortran) +endif() diff --git a/ClassicalField/Diffusion/DiffusionConstantSource/Fortran/CMakeLists.txt b/ClassicalField/Diffusion/DiffusionConstantSource/Fortran/CMakeLists.txt new file mode 100644 index 00000000..90d28956 --- /dev/null +++ b/ClassicalField/Diffusion/DiffusionConstantSource/Fortran/CMakeLists.txt @@ -0,0 +1,60 @@ + +# Add example executable +add_executable(DiffusionConstantSource src/DiffusionConstantSourceExample.f90) + +# Turn on Fortran preprocessing (#include directives) +if (MSVC) + set(PROC_OPT "/fpp") +else() + set(PROC_OPT "-cpp") +endif() + +# in debug mode, add flag that make Floating point exceptions fatal +set(OPT "") +if (FALSE) + if(CMAKE_BUILD_TYPE MATCHES DEBUG) + set(OPT "-ffpe-trap=invalid,zero,underflow,overflow,denormal") # GCC: make floating point exceptions fatal + endif() +endif() + +target_compile_options(DiffusionConstantSource PRIVATE ${PROC_OPT} ${OPT} "-fbacktrace") + +# Link to opencmiss +# ----------------- +# +# This simply uses the opencmiss target created by OC_INIT() above. +# +# Alternatively, you can also directly invoke 'find_package(Iron )' 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 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(DiffusionConstantSource PRIVATE opencmiss) + +# Add a simple test that runs the executable +add_test(NAME test_DiffusionConstantSource COMMAND DiffusionConstantSource) +add_opencmiss_environment(test_DiffusionConstantSource) + +################### +# 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. +# diff --git a/ClassicalField/Diffusion/DiffusionConstantSource/src/DiffusionConstantSourceExample.f90 b/ClassicalField/Diffusion/DiffusionConstantSource/Fortran/src/DiffusionConstantSourceExample.f90 similarity index 100% rename from ClassicalField/Diffusion/DiffusionConstantSource/src/DiffusionConstantSourceExample.f90 rename to ClassicalField/Diffusion/DiffusionConstantSource/Fortran/src/DiffusionConstantSourceExample.f90 diff --git a/ClassicalField/Diffusion/DiffusionConstantSource/OpenCMISS.cmake b/ClassicalField/Diffusion/DiffusionConstantSource/OpenCMISS.cmake new file mode 100644 index 00000000..3d6cf515 --- /dev/null +++ b/ClassicalField/Diffusion/DiffusionConstantSource/OpenCMISS.cmake @@ -0,0 +1,95 @@ +########################### +# *DO NOT CHANGE THIS FILE* +########################### +# +# Prepares the use of OpenCMISS by scanning at various path locations for OpenCMISS (SDK) installations. +# +# Search order: +# - OPENCMISS_INSTALL_DIR variable +# - OPENCMISS_INSTALL_DIR environment variable +# - OPENCMISS_SDK_DIR variable +# - OPENCMISS_SDK_DIR environment variable +# - [Windows only] The Registry is searched additionally for installed SDKs. +# +# If found +# - Includes the toolchain config script of the found opencmiss installation to enable toolchain selection logic (non-windows) + +# Convenience: The OPENCMISS_INSTALL_DIR may also be defined in the environment and various other places +if (DEFINED OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using specified installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The specified OPENCMISS_INSTALL_DIR '${OPENCMISS_INSTALL_DIR}' does not exist. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_INSTALL_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_INSTALL_DIR}" OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using environment installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The environment variable OPENCMISS_INSTALL_DIR='${OPENCMISS_INSTALL_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if (NOT OPENCMISS_INSTALL_DIR AND DEFINED OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The specified OPENCMISS_SDK_DIR '${OPENCMISS_SDK_DIR}' does not exist. Skipping.") + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_SDK_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_SDK_DIR}" OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using environment SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The environment variable OPENCMISS_SDK_DIR='${OPENCMISS_SDK_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_SDK_DIR) + endif() +endif() +# On windows: check the registry for installed OpenCMISS SDKs +if(NOT OPENCMISS_INSTALL_DIR AND WIN32) + foreach(ROOT HKEY_CURRENT_USER HKEY_LOCAL_MACHINE) + foreach(PACKAGE OpenCMISSUserSDK OpenCMISSDeveloperSDK) + set(_REG_KEY "[${ROOT}\\Software\\Auckland Bioengineering Institute\\${PACKAGE}]") + get_filename_component(OPENCMISS_INSTALL_DIR "${_REG_KEY}" ABSOLUTE) + #message(STATUS "Trying registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Found ${PACKAGE} in Windows registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + break() + else() + unset(OPENCMISS_INSTALL_DIR) + endif() + endforeach() + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + break() + endif() + endforeach() +endif() + +if(OPENCMISS_INSTALL_DIR) + message(STATUS "OPENCMISS_INSTALL_DIR=${OPENCMISS_INSTALL_DIR}") + # Use the OpenCMISS scripts to also allow choosing a separate toolchain + # This file is located at the opencmiss installation rather than the local example + # as it avoids file replication and makes maintenance much easier + if (TOOLCHAIN) + set(_OCTC ${OPENCMISS_INSTALL_DIR}/cmake/OCToolchainCompilers.cmake) + if (EXISTS "${_OCTC}") + include(${_OCTC}) + else() + message(WARNING "TOOLCHAIN specified but OpenCMISS config script could not be found at ${_OCTC}. Trying CMake defaults.") + endif() + unset(_OCTC) + endif() + set(OpenCMISS_DIR "${OPENCMISS_INSTALL_DIR}" CACHE PATH "Path to the found OpenCMISS (SDK) installation") +else() + message(WARNING "No OpenCMISS (SDK) installation directory detected. Using default system environment.") +endif() + \ No newline at end of file diff --git a/ClassicalField/Diffusion/DiffusionConstantSource/build_debug/build.sh b/ClassicalField/Diffusion/DiffusionConstantSource/build_debug/build.sh new file mode 100644 index 00000000..e6624bac --- /dev/null +++ b/ClassicalField/Diffusion/DiffusionConstantSource/build_debug/build.sh @@ -0,0 +1,2 @@ +#ccc && cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all +cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all diff --git a/ClassicalField/Diffusion/DiffusionExponentialSource/CMakeLists.txt b/ClassicalField/Diffusion/DiffusionExponentialSource/CMakeLists.txt new file mode 100644 index 00000000..a22b61ee --- /dev/null +++ b/ClassicalField/Diffusion/DiffusionExponentialSource/CMakeLists.txt @@ -0,0 +1,35 @@ +# 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 C) +enable_language(Fortran OPTIONAL) +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 +# ---------------------- +#add_subdirectory(C) +if (CMAKE_Fortran_COMPILER) + add_subdirectory(Fortran) +endif() diff --git a/ClassicalField/Diffusion/DiffusionExponentialSource/Fortran/CMakeLists.txt b/ClassicalField/Diffusion/DiffusionExponentialSource/Fortran/CMakeLists.txt new file mode 100644 index 00000000..4bc39499 --- /dev/null +++ b/ClassicalField/Diffusion/DiffusionExponentialSource/Fortran/CMakeLists.txt @@ -0,0 +1,60 @@ + +# Add example executable +add_executable(DiffusionExponentialSource src/DiffusionExponentialSourceExample.f90) + +# Turn on Fortran preprocessing (#include directives) +if (MSVC) + set(PROC_OPT "/fpp") +else() + set(PROC_OPT "-cpp") +endif() + +# in debug mode, add flag that make Floating point exceptions fatal +set(OPT "") +if (FALSE) + if(CMAKE_BUILD_TYPE MATCHES DEBUG) + set(OPT "-ffpe-trap=invalid,zero,underflow,overflow,denormal") # GCC: make floating point exceptions fatal + endif() +endif() + +target_compile_options(DiffusionExponentialSource PRIVATE ${PROC_OPT} ${OPT} "-fbacktrace") + +# Link to opencmiss +# ----------------- +# +# This simply uses the opencmiss target created by OC_INIT() above. +# +# Alternatively, you can also directly invoke 'find_package(Iron )' 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 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(DiffusionExponentialSource PRIVATE opencmiss) + +# Add a simple test that runs the executable +add_test(NAME test_DiffusionExponentialSource COMMAND DiffusionExponentialSource) +add_opencmiss_environment(test_DiffusionExponentialSource) + +################### +# 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. +# diff --git a/ClassicalField/Diffusion/DiffusionExponentialSource/src/DiffusionExponentialSourceExample.f90 b/ClassicalField/Diffusion/DiffusionExponentialSource/Fortran/src/DiffusionExponentialSourceExample.f90 similarity index 100% rename from ClassicalField/Diffusion/DiffusionExponentialSource/src/DiffusionExponentialSourceExample.f90 rename to ClassicalField/Diffusion/DiffusionExponentialSource/Fortran/src/DiffusionExponentialSourceExample.f90 diff --git a/ClassicalField/Diffusion/DiffusionExponentialSource/OpenCMISS.cmake b/ClassicalField/Diffusion/DiffusionExponentialSource/OpenCMISS.cmake new file mode 100644 index 00000000..3d6cf515 --- /dev/null +++ b/ClassicalField/Diffusion/DiffusionExponentialSource/OpenCMISS.cmake @@ -0,0 +1,95 @@ +########################### +# *DO NOT CHANGE THIS FILE* +########################### +# +# Prepares the use of OpenCMISS by scanning at various path locations for OpenCMISS (SDK) installations. +# +# Search order: +# - OPENCMISS_INSTALL_DIR variable +# - OPENCMISS_INSTALL_DIR environment variable +# - OPENCMISS_SDK_DIR variable +# - OPENCMISS_SDK_DIR environment variable +# - [Windows only] The Registry is searched additionally for installed SDKs. +# +# If found +# - Includes the toolchain config script of the found opencmiss installation to enable toolchain selection logic (non-windows) + +# Convenience: The OPENCMISS_INSTALL_DIR may also be defined in the environment and various other places +if (DEFINED OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using specified installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The specified OPENCMISS_INSTALL_DIR '${OPENCMISS_INSTALL_DIR}' does not exist. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_INSTALL_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_INSTALL_DIR}" OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using environment installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The environment variable OPENCMISS_INSTALL_DIR='${OPENCMISS_INSTALL_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if (NOT OPENCMISS_INSTALL_DIR AND DEFINED OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The specified OPENCMISS_SDK_DIR '${OPENCMISS_SDK_DIR}' does not exist. Skipping.") + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_SDK_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_SDK_DIR}" OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using environment SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The environment variable OPENCMISS_SDK_DIR='${OPENCMISS_SDK_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_SDK_DIR) + endif() +endif() +# On windows: check the registry for installed OpenCMISS SDKs +if(NOT OPENCMISS_INSTALL_DIR AND WIN32) + foreach(ROOT HKEY_CURRENT_USER HKEY_LOCAL_MACHINE) + foreach(PACKAGE OpenCMISSUserSDK OpenCMISSDeveloperSDK) + set(_REG_KEY "[${ROOT}\\Software\\Auckland Bioengineering Institute\\${PACKAGE}]") + get_filename_component(OPENCMISS_INSTALL_DIR "${_REG_KEY}" ABSOLUTE) + #message(STATUS "Trying registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Found ${PACKAGE} in Windows registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + break() + else() + unset(OPENCMISS_INSTALL_DIR) + endif() + endforeach() + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + break() + endif() + endforeach() +endif() + +if(OPENCMISS_INSTALL_DIR) + message(STATUS "OPENCMISS_INSTALL_DIR=${OPENCMISS_INSTALL_DIR}") + # Use the OpenCMISS scripts to also allow choosing a separate toolchain + # This file is located at the opencmiss installation rather than the local example + # as it avoids file replication and makes maintenance much easier + if (TOOLCHAIN) + set(_OCTC ${OPENCMISS_INSTALL_DIR}/cmake/OCToolchainCompilers.cmake) + if (EXISTS "${_OCTC}") + include(${_OCTC}) + else() + message(WARNING "TOOLCHAIN specified but OpenCMISS config script could not be found at ${_OCTC}. Trying CMake defaults.") + endif() + unset(_OCTC) + endif() + set(OpenCMISS_DIR "${OPENCMISS_INSTALL_DIR}" CACHE PATH "Path to the found OpenCMISS (SDK) installation") +else() + message(WARNING "No OpenCMISS (SDK) installation directory detected. Using default system environment.") +endif() + \ No newline at end of file diff --git a/ClassicalField/Diffusion/DiffusionExponentialSource/build_debug/build.sh b/ClassicalField/Diffusion/DiffusionExponentialSource/build_debug/build.sh new file mode 100644 index 00000000..e6624bac --- /dev/null +++ b/ClassicalField/Diffusion/DiffusionExponentialSource/build_debug/build.sh @@ -0,0 +1,2 @@ +#ccc && cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all +cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all diff --git a/ClassicalField/Diffusion/DiffusionIO_ALE/CMakeLists.txt b/ClassicalField/Diffusion/DiffusionIO_ALE/CMakeLists.txt new file mode 100644 index 00000000..a22b61ee --- /dev/null +++ b/ClassicalField/Diffusion/DiffusionIO_ALE/CMakeLists.txt @@ -0,0 +1,35 @@ +# 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 C) +enable_language(Fortran OPTIONAL) +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 +# ---------------------- +#add_subdirectory(C) +if (CMAKE_Fortran_COMPILER) + add_subdirectory(Fortran) +endif() diff --git a/ClassicalField/Diffusion/DiffusionIO_ALE/Fortran/CMakeLists.txt b/ClassicalField/Diffusion/DiffusionIO_ALE/Fortran/CMakeLists.txt new file mode 100644 index 00000000..0c2691d0 --- /dev/null +++ b/ClassicalField/Diffusion/DiffusionIO_ALE/Fortran/CMakeLists.txt @@ -0,0 +1,60 @@ + +# Add example executable +add_executable(DiffusionIO_ALE src/DiffusionIO_ALEExample.f90) + +# Turn on Fortran preprocessing (#include directives) +if (MSVC) + set(PROC_OPT "/fpp") +else() + set(PROC_OPT "-cpp") +endif() + +# in debug mode, add flag that make Floating point exceptions fatal +set(OPT "") +if (FALSE) + if(CMAKE_BUILD_TYPE MATCHES DEBUG) + set(OPT "-ffpe-trap=invalid,zero,underflow,overflow,denormal") # GCC: make floating point exceptions fatal + endif() +endif() + +target_compile_options(DiffusionIO_ALE PRIVATE ${PROC_OPT} ${OPT} "-fbacktrace") + +# Link to opencmiss +# ----------------- +# +# This simply uses the opencmiss target created by OC_INIT() above. +# +# Alternatively, you can also directly invoke 'find_package(Iron )' 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 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(DiffusionIO_ALE PRIVATE opencmiss) + +# Add a simple test that runs the executable +add_test(NAME test_DiffusionIO_ALE COMMAND DiffusionIO_ALE) +add_opencmiss_environment(test_DiffusionIO_ALE) + +################### +# 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. +# diff --git a/ClassicalField/Diffusion/DiffusionIO_ALE/src/DiffusionIO_ALEExample.f90 b/ClassicalField/Diffusion/DiffusionIO_ALE/Fortran/src/DiffusionIO_ALEExample.f90 similarity index 100% rename from ClassicalField/Diffusion/DiffusionIO_ALE/src/DiffusionIO_ALEExample.f90 rename to ClassicalField/Diffusion/DiffusionIO_ALE/Fortran/src/DiffusionIO_ALEExample.f90 diff --git a/ClassicalField/Diffusion/DiffusionIO_ALE/OpenCMISS.cmake b/ClassicalField/Diffusion/DiffusionIO_ALE/OpenCMISS.cmake new file mode 100644 index 00000000..3d6cf515 --- /dev/null +++ b/ClassicalField/Diffusion/DiffusionIO_ALE/OpenCMISS.cmake @@ -0,0 +1,95 @@ +########################### +# *DO NOT CHANGE THIS FILE* +########################### +# +# Prepares the use of OpenCMISS by scanning at various path locations for OpenCMISS (SDK) installations. +# +# Search order: +# - OPENCMISS_INSTALL_DIR variable +# - OPENCMISS_INSTALL_DIR environment variable +# - OPENCMISS_SDK_DIR variable +# - OPENCMISS_SDK_DIR environment variable +# - [Windows only] The Registry is searched additionally for installed SDKs. +# +# If found +# - Includes the toolchain config script of the found opencmiss installation to enable toolchain selection logic (non-windows) + +# Convenience: The OPENCMISS_INSTALL_DIR may also be defined in the environment and various other places +if (DEFINED OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using specified installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The specified OPENCMISS_INSTALL_DIR '${OPENCMISS_INSTALL_DIR}' does not exist. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_INSTALL_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_INSTALL_DIR}" OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using environment installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The environment variable OPENCMISS_INSTALL_DIR='${OPENCMISS_INSTALL_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if (NOT OPENCMISS_INSTALL_DIR AND DEFINED OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The specified OPENCMISS_SDK_DIR '${OPENCMISS_SDK_DIR}' does not exist. Skipping.") + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_SDK_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_SDK_DIR}" OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using environment SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The environment variable OPENCMISS_SDK_DIR='${OPENCMISS_SDK_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_SDK_DIR) + endif() +endif() +# On windows: check the registry for installed OpenCMISS SDKs +if(NOT OPENCMISS_INSTALL_DIR AND WIN32) + foreach(ROOT HKEY_CURRENT_USER HKEY_LOCAL_MACHINE) + foreach(PACKAGE OpenCMISSUserSDK OpenCMISSDeveloperSDK) + set(_REG_KEY "[${ROOT}\\Software\\Auckland Bioengineering Institute\\${PACKAGE}]") + get_filename_component(OPENCMISS_INSTALL_DIR "${_REG_KEY}" ABSOLUTE) + #message(STATUS "Trying registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Found ${PACKAGE} in Windows registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + break() + else() + unset(OPENCMISS_INSTALL_DIR) + endif() + endforeach() + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + break() + endif() + endforeach() +endif() + +if(OPENCMISS_INSTALL_DIR) + message(STATUS "OPENCMISS_INSTALL_DIR=${OPENCMISS_INSTALL_DIR}") + # Use the OpenCMISS scripts to also allow choosing a separate toolchain + # This file is located at the opencmiss installation rather than the local example + # as it avoids file replication and makes maintenance much easier + if (TOOLCHAIN) + set(_OCTC ${OPENCMISS_INSTALL_DIR}/cmake/OCToolchainCompilers.cmake) + if (EXISTS "${_OCTC}") + include(${_OCTC}) + else() + message(WARNING "TOOLCHAIN specified but OpenCMISS config script could not be found at ${_OCTC}. Trying CMake defaults.") + endif() + unset(_OCTC) + endif() + set(OpenCMISS_DIR "${OPENCMISS_INSTALL_DIR}" CACHE PATH "Path to the found OpenCMISS (SDK) installation") +else() + message(WARNING "No OpenCMISS (SDK) installation directory detected. Using default system environment.") +endif() + \ No newline at end of file diff --git a/ClassicalField/Diffusion/DiffusionIO_ALE/build_debug/build.sh b/ClassicalField/Diffusion/DiffusionIO_ALE/build_debug/build.sh new file mode 100644 index 00000000..e6624bac --- /dev/null +++ b/ClassicalField/Diffusion/DiffusionIO_ALE/build_debug/build.sh @@ -0,0 +1,2 @@ +#ccc && cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all +cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all diff --git a/ClassicalField/Diffusion/DiffusionLinearSource/CMakeLists.txt b/ClassicalField/Diffusion/DiffusionLinearSource/CMakeLists.txt new file mode 100644 index 00000000..a22b61ee --- /dev/null +++ b/ClassicalField/Diffusion/DiffusionLinearSource/CMakeLists.txt @@ -0,0 +1,35 @@ +# 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 C) +enable_language(Fortran OPTIONAL) +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 +# ---------------------- +#add_subdirectory(C) +if (CMAKE_Fortran_COMPILER) + add_subdirectory(Fortran) +endif() diff --git a/ClassicalField/Diffusion/DiffusionLinearSource/Fortran/CMakeLists.txt b/ClassicalField/Diffusion/DiffusionLinearSource/Fortran/CMakeLists.txt new file mode 100644 index 00000000..4f07318d --- /dev/null +++ b/ClassicalField/Diffusion/DiffusionLinearSource/Fortran/CMakeLists.txt @@ -0,0 +1,60 @@ + +# Add example executable +add_executable(DiffusionLinearSource src/DiffusionLinearSourceExample.f90) + +# Turn on Fortran preprocessing (#include directives) +if (MSVC) + set(PROC_OPT "/fpp") +else() + set(PROC_OPT "-cpp") +endif() + +# in debug mode, add flag that make Floating point exceptions fatal +set(OPT "") +if (FALSE) + if(CMAKE_BUILD_TYPE MATCHES DEBUG) + set(OPT "-ffpe-trap=invalid,zero,underflow,overflow,denormal") # GCC: make floating point exceptions fatal + endif() +endif() + +target_compile_options(DiffusionLinearSource PRIVATE ${PROC_OPT} ${OPT} "-fbacktrace") + +# Link to opencmiss +# ----------------- +# +# This simply uses the opencmiss target created by OC_INIT() above. +# +# Alternatively, you can also directly invoke 'find_package(Iron )' 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 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(DiffusionLinearSource PRIVATE opencmiss) + +# Add a simple test that runs the executable +add_test(NAME test_DiffusionLinearSource COMMAND DiffusionLinearSource) +add_opencmiss_environment(test_DiffusionLinearSource) + +################### +# 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. +# diff --git a/ClassicalField/Diffusion/DiffusionLinearSource/src/DiffusionLinearSourceExample.f90 b/ClassicalField/Diffusion/DiffusionLinearSource/Fortran/src/DiffusionLinearSourceExample.f90 similarity index 100% rename from ClassicalField/Diffusion/DiffusionLinearSource/src/DiffusionLinearSourceExample.f90 rename to ClassicalField/Diffusion/DiffusionLinearSource/Fortran/src/DiffusionLinearSourceExample.f90 diff --git a/ClassicalField/Diffusion/DiffusionLinearSource/OpenCMISS.cmake b/ClassicalField/Diffusion/DiffusionLinearSource/OpenCMISS.cmake new file mode 100644 index 00000000..3d6cf515 --- /dev/null +++ b/ClassicalField/Diffusion/DiffusionLinearSource/OpenCMISS.cmake @@ -0,0 +1,95 @@ +########################### +# *DO NOT CHANGE THIS FILE* +########################### +# +# Prepares the use of OpenCMISS by scanning at various path locations for OpenCMISS (SDK) installations. +# +# Search order: +# - OPENCMISS_INSTALL_DIR variable +# - OPENCMISS_INSTALL_DIR environment variable +# - OPENCMISS_SDK_DIR variable +# - OPENCMISS_SDK_DIR environment variable +# - [Windows only] The Registry is searched additionally for installed SDKs. +# +# If found +# - Includes the toolchain config script of the found opencmiss installation to enable toolchain selection logic (non-windows) + +# Convenience: The OPENCMISS_INSTALL_DIR may also be defined in the environment and various other places +if (DEFINED OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using specified installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The specified OPENCMISS_INSTALL_DIR '${OPENCMISS_INSTALL_DIR}' does not exist. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_INSTALL_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_INSTALL_DIR}" OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using environment installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The environment variable OPENCMISS_INSTALL_DIR='${OPENCMISS_INSTALL_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if (NOT OPENCMISS_INSTALL_DIR AND DEFINED OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The specified OPENCMISS_SDK_DIR '${OPENCMISS_SDK_DIR}' does not exist. Skipping.") + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_SDK_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_SDK_DIR}" OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using environment SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The environment variable OPENCMISS_SDK_DIR='${OPENCMISS_SDK_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_SDK_DIR) + endif() +endif() +# On windows: check the registry for installed OpenCMISS SDKs +if(NOT OPENCMISS_INSTALL_DIR AND WIN32) + foreach(ROOT HKEY_CURRENT_USER HKEY_LOCAL_MACHINE) + foreach(PACKAGE OpenCMISSUserSDK OpenCMISSDeveloperSDK) + set(_REG_KEY "[${ROOT}\\Software\\Auckland Bioengineering Institute\\${PACKAGE}]") + get_filename_component(OPENCMISS_INSTALL_DIR "${_REG_KEY}" ABSOLUTE) + #message(STATUS "Trying registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Found ${PACKAGE} in Windows registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + break() + else() + unset(OPENCMISS_INSTALL_DIR) + endif() + endforeach() + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + break() + endif() + endforeach() +endif() + +if(OPENCMISS_INSTALL_DIR) + message(STATUS "OPENCMISS_INSTALL_DIR=${OPENCMISS_INSTALL_DIR}") + # Use the OpenCMISS scripts to also allow choosing a separate toolchain + # This file is located at the opencmiss installation rather than the local example + # as it avoids file replication and makes maintenance much easier + if (TOOLCHAIN) + set(_OCTC ${OPENCMISS_INSTALL_DIR}/cmake/OCToolchainCompilers.cmake) + if (EXISTS "${_OCTC}") + include(${_OCTC}) + else() + message(WARNING "TOOLCHAIN specified but OpenCMISS config script could not be found at ${_OCTC}. Trying CMake defaults.") + endif() + unset(_OCTC) + endif() + set(OpenCMISS_DIR "${OPENCMISS_INSTALL_DIR}" CACHE PATH "Path to the found OpenCMISS (SDK) installation") +else() + message(WARNING "No OpenCMISS (SDK) installation directory detected. Using default system environment.") +endif() + \ No newline at end of file diff --git a/ClassicalField/Diffusion/DiffusionLinearSource/build_debug/build.sh b/ClassicalField/Diffusion/DiffusionLinearSource/build_debug/build.sh new file mode 100644 index 00000000..e6624bac --- /dev/null +++ b/ClassicalField/Diffusion/DiffusionLinearSource/build_debug/build.sh @@ -0,0 +1,2 @@ +#ccc && cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all +cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all diff --git a/ClassicalField/Diffusion/DiffusionQuadraticSource/CMakeLists.txt b/ClassicalField/Diffusion/DiffusionQuadraticSource/CMakeLists.txt new file mode 100644 index 00000000..a22b61ee --- /dev/null +++ b/ClassicalField/Diffusion/DiffusionQuadraticSource/CMakeLists.txt @@ -0,0 +1,35 @@ +# 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 C) +enable_language(Fortran OPTIONAL) +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 +# ---------------------- +#add_subdirectory(C) +if (CMAKE_Fortran_COMPILER) + add_subdirectory(Fortran) +endif() diff --git a/ClassicalField/Diffusion/DiffusionQuadraticSource/Fortran/CMakeLists.txt b/ClassicalField/Diffusion/DiffusionQuadraticSource/Fortran/CMakeLists.txt new file mode 100644 index 00000000..47b09a3b --- /dev/null +++ b/ClassicalField/Diffusion/DiffusionQuadraticSource/Fortran/CMakeLists.txt @@ -0,0 +1,60 @@ + +# Add example executable +add_executable(DiffusionQuadraticSource src/DiffusionQuadraticSourceExample.f90) + +# Turn on Fortran preprocessing (#include directives) +if (MSVC) + set(PROC_OPT "/fpp") +else() + set(PROC_OPT "-cpp") +endif() + +# in debug mode, add flag that make Floating point exceptions fatal +set(OPT "") +if (FALSE) + if(CMAKE_BUILD_TYPE MATCHES DEBUG) + set(OPT "-ffpe-trap=invalid,zero,underflow,overflow,denormal") # GCC: make floating point exceptions fatal + endif() +endif() + +target_compile_options(DiffusionQuadraticSource PRIVATE ${PROC_OPT} ${OPT} "-fbacktrace") + +# Link to opencmiss +# ----------------- +# +# This simply uses the opencmiss target created by OC_INIT() above. +# +# Alternatively, you can also directly invoke 'find_package(Iron )' 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 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(DiffusionQuadraticSource PRIVATE opencmiss) + +# Add a simple test that runs the executable +add_test(NAME test_DiffusionQuadraticSource COMMAND DiffusionQuadraticSource) +add_opencmiss_environment(test_DiffusionQuadraticSource) + +################### +# 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. +# diff --git a/ClassicalField/Diffusion/DiffusionQuadraticSource/src/DiffusionQuadraticSourceExample.f90 b/ClassicalField/Diffusion/DiffusionQuadraticSource/Fortran/src/DiffusionQuadraticSourceExample.f90 similarity index 100% rename from ClassicalField/Diffusion/DiffusionQuadraticSource/src/DiffusionQuadraticSourceExample.f90 rename to ClassicalField/Diffusion/DiffusionQuadraticSource/Fortran/src/DiffusionQuadraticSourceExample.f90 diff --git a/ClassicalField/Diffusion/DiffusionQuadraticSource/OpenCMISS.cmake b/ClassicalField/Diffusion/DiffusionQuadraticSource/OpenCMISS.cmake new file mode 100644 index 00000000..3d6cf515 --- /dev/null +++ b/ClassicalField/Diffusion/DiffusionQuadraticSource/OpenCMISS.cmake @@ -0,0 +1,95 @@ +########################### +# *DO NOT CHANGE THIS FILE* +########################### +# +# Prepares the use of OpenCMISS by scanning at various path locations for OpenCMISS (SDK) installations. +# +# Search order: +# - OPENCMISS_INSTALL_DIR variable +# - OPENCMISS_INSTALL_DIR environment variable +# - OPENCMISS_SDK_DIR variable +# - OPENCMISS_SDK_DIR environment variable +# - [Windows only] The Registry is searched additionally for installed SDKs. +# +# If found +# - Includes the toolchain config script of the found opencmiss installation to enable toolchain selection logic (non-windows) + +# Convenience: The OPENCMISS_INSTALL_DIR may also be defined in the environment and various other places +if (DEFINED OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using specified installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The specified OPENCMISS_INSTALL_DIR '${OPENCMISS_INSTALL_DIR}' does not exist. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_INSTALL_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_INSTALL_DIR}" OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using environment installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The environment variable OPENCMISS_INSTALL_DIR='${OPENCMISS_INSTALL_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if (NOT OPENCMISS_INSTALL_DIR AND DEFINED OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The specified OPENCMISS_SDK_DIR '${OPENCMISS_SDK_DIR}' does not exist. Skipping.") + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_SDK_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_SDK_DIR}" OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using environment SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The environment variable OPENCMISS_SDK_DIR='${OPENCMISS_SDK_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_SDK_DIR) + endif() +endif() +# On windows: check the registry for installed OpenCMISS SDKs +if(NOT OPENCMISS_INSTALL_DIR AND WIN32) + foreach(ROOT HKEY_CURRENT_USER HKEY_LOCAL_MACHINE) + foreach(PACKAGE OpenCMISSUserSDK OpenCMISSDeveloperSDK) + set(_REG_KEY "[${ROOT}\\Software\\Auckland Bioengineering Institute\\${PACKAGE}]") + get_filename_component(OPENCMISS_INSTALL_DIR "${_REG_KEY}" ABSOLUTE) + #message(STATUS "Trying registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Found ${PACKAGE} in Windows registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + break() + else() + unset(OPENCMISS_INSTALL_DIR) + endif() + endforeach() + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + break() + endif() + endforeach() +endif() + +if(OPENCMISS_INSTALL_DIR) + message(STATUS "OPENCMISS_INSTALL_DIR=${OPENCMISS_INSTALL_DIR}") + # Use the OpenCMISS scripts to also allow choosing a separate toolchain + # This file is located at the opencmiss installation rather than the local example + # as it avoids file replication and makes maintenance much easier + if (TOOLCHAIN) + set(_OCTC ${OPENCMISS_INSTALL_DIR}/cmake/OCToolchainCompilers.cmake) + if (EXISTS "${_OCTC}") + include(${_OCTC}) + else() + message(WARNING "TOOLCHAIN specified but OpenCMISS config script could not be found at ${_OCTC}. Trying CMake defaults.") + endif() + unset(_OCTC) + endif() + set(OpenCMISS_DIR "${OPENCMISS_INSTALL_DIR}" CACHE PATH "Path to the found OpenCMISS (SDK) installation") +else() + message(WARNING "No OpenCMISS (SDK) installation directory detected. Using default system environment.") +endif() + \ No newline at end of file diff --git a/ClassicalField/Diffusion/DiffusionQuadraticSource/build_debug/build.sh b/ClassicalField/Diffusion/DiffusionQuadraticSource/build_debug/build.sh new file mode 100644 index 00000000..e6624bac --- /dev/null +++ b/ClassicalField/Diffusion/DiffusionQuadraticSource/build_debug/build.sh @@ -0,0 +1,2 @@ +#ccc && cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all +cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all diff --git a/ClassicalField/Diffusion/LinearConvergenceTest/CMakeLists.txt b/ClassicalField/Diffusion/LinearConvergenceTest/CMakeLists.txt new file mode 100644 index 00000000..a22b61ee --- /dev/null +++ b/ClassicalField/Diffusion/LinearConvergenceTest/CMakeLists.txt @@ -0,0 +1,35 @@ +# 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 C) +enable_language(Fortran OPTIONAL) +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 +# ---------------------- +#add_subdirectory(C) +if (CMAKE_Fortran_COMPILER) + add_subdirectory(Fortran) +endif() diff --git a/ClassicalField/Diffusion/LinearConvergenceTest/Fortran/CMakeLists.txt b/ClassicalField/Diffusion/LinearConvergenceTest/Fortran/CMakeLists.txt new file mode 100644 index 00000000..0c32f271 --- /dev/null +++ b/ClassicalField/Diffusion/LinearConvergenceTest/Fortran/CMakeLists.txt @@ -0,0 +1,60 @@ + +# Add example executable +add_executable(LinearConvergenceTest src/LinearConvergenceTestExample.f90) + +# Turn on Fortran preprocessing (#include directives) +if (MSVC) + set(PROC_OPT "/fpp") +else() + set(PROC_OPT "-cpp") +endif() + +# in debug mode, add flag that make Floating point exceptions fatal +set(OPT "") +if (FALSE) + if(CMAKE_BUILD_TYPE MATCHES DEBUG) + set(OPT "-ffpe-trap=invalid,zero,underflow,overflow,denormal") # GCC: make floating point exceptions fatal + endif() +endif() + +target_compile_options(LinearConvergenceTest PRIVATE ${PROC_OPT} ${OPT} "-fbacktrace") + +# Link to opencmiss +# ----------------- +# +# This simply uses the opencmiss target created by OC_INIT() above. +# +# Alternatively, you can also directly invoke 'find_package(Iron )' 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 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(LinearConvergenceTest PRIVATE opencmiss) + +# Add a simple test that runs the executable +add_test(NAME test_LinearConvergenceTest COMMAND LinearConvergenceTest) +add_opencmiss_environment(test_LinearConvergenceTest) + +################### +# 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. +# diff --git a/ClassicalField/Diffusion/LinearConvergenceTest/src/LinearConvergenceTestExample.f90 b/ClassicalField/Diffusion/LinearConvergenceTest/Fortran/src/LinearConvergenceTestExample.f90 similarity index 100% rename from ClassicalField/Diffusion/LinearConvergenceTest/src/LinearConvergenceTestExample.f90 rename to ClassicalField/Diffusion/LinearConvergenceTest/Fortran/src/LinearConvergenceTestExample.f90 diff --git a/ClassicalField/Diffusion/LinearConvergenceTest/OpenCMISS.cmake b/ClassicalField/Diffusion/LinearConvergenceTest/OpenCMISS.cmake new file mode 100644 index 00000000..3d6cf515 --- /dev/null +++ b/ClassicalField/Diffusion/LinearConvergenceTest/OpenCMISS.cmake @@ -0,0 +1,95 @@ +########################### +# *DO NOT CHANGE THIS FILE* +########################### +# +# Prepares the use of OpenCMISS by scanning at various path locations for OpenCMISS (SDK) installations. +# +# Search order: +# - OPENCMISS_INSTALL_DIR variable +# - OPENCMISS_INSTALL_DIR environment variable +# - OPENCMISS_SDK_DIR variable +# - OPENCMISS_SDK_DIR environment variable +# - [Windows only] The Registry is searched additionally for installed SDKs. +# +# If found +# - Includes the toolchain config script of the found opencmiss installation to enable toolchain selection logic (non-windows) + +# Convenience: The OPENCMISS_INSTALL_DIR may also be defined in the environment and various other places +if (DEFINED OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using specified installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The specified OPENCMISS_INSTALL_DIR '${OPENCMISS_INSTALL_DIR}' does not exist. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_INSTALL_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_INSTALL_DIR}" OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using environment installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The environment variable OPENCMISS_INSTALL_DIR='${OPENCMISS_INSTALL_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if (NOT OPENCMISS_INSTALL_DIR AND DEFINED OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The specified OPENCMISS_SDK_DIR '${OPENCMISS_SDK_DIR}' does not exist. Skipping.") + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_SDK_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_SDK_DIR}" OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using environment SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The environment variable OPENCMISS_SDK_DIR='${OPENCMISS_SDK_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_SDK_DIR) + endif() +endif() +# On windows: check the registry for installed OpenCMISS SDKs +if(NOT OPENCMISS_INSTALL_DIR AND WIN32) + foreach(ROOT HKEY_CURRENT_USER HKEY_LOCAL_MACHINE) + foreach(PACKAGE OpenCMISSUserSDK OpenCMISSDeveloperSDK) + set(_REG_KEY "[${ROOT}\\Software\\Auckland Bioengineering Institute\\${PACKAGE}]") + get_filename_component(OPENCMISS_INSTALL_DIR "${_REG_KEY}" ABSOLUTE) + #message(STATUS "Trying registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Found ${PACKAGE} in Windows registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + break() + else() + unset(OPENCMISS_INSTALL_DIR) + endif() + endforeach() + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + break() + endif() + endforeach() +endif() + +if(OPENCMISS_INSTALL_DIR) + message(STATUS "OPENCMISS_INSTALL_DIR=${OPENCMISS_INSTALL_DIR}") + # Use the OpenCMISS scripts to also allow choosing a separate toolchain + # This file is located at the opencmiss installation rather than the local example + # as it avoids file replication and makes maintenance much easier + if (TOOLCHAIN) + set(_OCTC ${OPENCMISS_INSTALL_DIR}/cmake/OCToolchainCompilers.cmake) + if (EXISTS "${_OCTC}") + include(${_OCTC}) + else() + message(WARNING "TOOLCHAIN specified but OpenCMISS config script could not be found at ${_OCTC}. Trying CMake defaults.") + endif() + unset(_OCTC) + endif() + set(OpenCMISS_DIR "${OPENCMISS_INSTALL_DIR}" CACHE PATH "Path to the found OpenCMISS (SDK) installation") +else() + message(WARNING "No OpenCMISS (SDK) installation directory detected. Using default system environment.") +endif() + \ No newline at end of file diff --git a/ClassicalField/Diffusion/LinearConvergenceTest/build_debug/build.sh b/ClassicalField/Diffusion/LinearConvergenceTest/build_debug/build.sh new file mode 100644 index 00000000..e6624bac --- /dev/null +++ b/ClassicalField/Diffusion/LinearConvergenceTest/build_debug/build.sh @@ -0,0 +1,2 @@ +#ccc && cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all +cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all diff --git a/ClassicalField/Diffusion/QuadraticConvergenceTest/CMakeLists.txt b/ClassicalField/Diffusion/QuadraticConvergenceTest/CMakeLists.txt new file mode 100644 index 00000000..a22b61ee --- /dev/null +++ b/ClassicalField/Diffusion/QuadraticConvergenceTest/CMakeLists.txt @@ -0,0 +1,35 @@ +# 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 C) +enable_language(Fortran OPTIONAL) +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 +# ---------------------- +#add_subdirectory(C) +if (CMAKE_Fortran_COMPILER) + add_subdirectory(Fortran) +endif() diff --git a/ClassicalField/Diffusion/QuadraticConvergenceTest/Fortran/CMakeLists.txt b/ClassicalField/Diffusion/QuadraticConvergenceTest/Fortran/CMakeLists.txt new file mode 100644 index 00000000..0b008dd7 --- /dev/null +++ b/ClassicalField/Diffusion/QuadraticConvergenceTest/Fortran/CMakeLists.txt @@ -0,0 +1,60 @@ + +# Add example executable +add_executable(QuadraticConvergenceTest src/QuadraticConvergenceTestExample.f90) + +# Turn on Fortran preprocessing (#include directives) +if (MSVC) + set(PROC_OPT "/fpp") +else() + set(PROC_OPT "-cpp") +endif() + +# in debug mode, add flag that make Floating point exceptions fatal +set(OPT "") +if (FALSE) + if(CMAKE_BUILD_TYPE MATCHES DEBUG) + set(OPT "-ffpe-trap=invalid,zero,underflow,overflow,denormal") # GCC: make floating point exceptions fatal + endif() +endif() + +target_compile_options(QuadraticConvergenceTest PRIVATE ${PROC_OPT} ${OPT} "-fbacktrace") + +# Link to opencmiss +# ----------------- +# +# This simply uses the opencmiss target created by OC_INIT() above. +# +# Alternatively, you can also directly invoke 'find_package(Iron )' 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 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(QuadraticConvergenceTest PRIVATE opencmiss) + +# Add a simple test that runs the executable +add_test(NAME test_QuadraticConvergenceTest COMMAND QuadraticConvergenceTest) +add_opencmiss_environment(test_QuadraticConvergenceTest) + +################### +# 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. +# diff --git a/ClassicalField/Diffusion/QuadraticConvergenceTest/src/QuadraticConvergenceTestExample.f90 b/ClassicalField/Diffusion/QuadraticConvergenceTest/Fortran/src/QuadraticConvergenceTestExample.f90 similarity index 100% rename from ClassicalField/Diffusion/QuadraticConvergenceTest/src/QuadraticConvergenceTestExample.f90 rename to ClassicalField/Diffusion/QuadraticConvergenceTest/Fortran/src/QuadraticConvergenceTestExample.f90 diff --git a/ClassicalField/Diffusion/QuadraticConvergenceTest/OpenCMISS.cmake b/ClassicalField/Diffusion/QuadraticConvergenceTest/OpenCMISS.cmake new file mode 100644 index 00000000..3d6cf515 --- /dev/null +++ b/ClassicalField/Diffusion/QuadraticConvergenceTest/OpenCMISS.cmake @@ -0,0 +1,95 @@ +########################### +# *DO NOT CHANGE THIS FILE* +########################### +# +# Prepares the use of OpenCMISS by scanning at various path locations for OpenCMISS (SDK) installations. +# +# Search order: +# - OPENCMISS_INSTALL_DIR variable +# - OPENCMISS_INSTALL_DIR environment variable +# - OPENCMISS_SDK_DIR variable +# - OPENCMISS_SDK_DIR environment variable +# - [Windows only] The Registry is searched additionally for installed SDKs. +# +# If found +# - Includes the toolchain config script of the found opencmiss installation to enable toolchain selection logic (non-windows) + +# Convenience: The OPENCMISS_INSTALL_DIR may also be defined in the environment and various other places +if (DEFINED OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using specified installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The specified OPENCMISS_INSTALL_DIR '${OPENCMISS_INSTALL_DIR}' does not exist. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_INSTALL_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_INSTALL_DIR}" OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using environment installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The environment variable OPENCMISS_INSTALL_DIR='${OPENCMISS_INSTALL_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if (NOT OPENCMISS_INSTALL_DIR AND DEFINED OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The specified OPENCMISS_SDK_DIR '${OPENCMISS_SDK_DIR}' does not exist. Skipping.") + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_SDK_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_SDK_DIR}" OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using environment SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The environment variable OPENCMISS_SDK_DIR='${OPENCMISS_SDK_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_SDK_DIR) + endif() +endif() +# On windows: check the registry for installed OpenCMISS SDKs +if(NOT OPENCMISS_INSTALL_DIR AND WIN32) + foreach(ROOT HKEY_CURRENT_USER HKEY_LOCAL_MACHINE) + foreach(PACKAGE OpenCMISSUserSDK OpenCMISSDeveloperSDK) + set(_REG_KEY "[${ROOT}\\Software\\Auckland Bioengineering Institute\\${PACKAGE}]") + get_filename_component(OPENCMISS_INSTALL_DIR "${_REG_KEY}" ABSOLUTE) + #message(STATUS "Trying registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Found ${PACKAGE} in Windows registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + break() + else() + unset(OPENCMISS_INSTALL_DIR) + endif() + endforeach() + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + break() + endif() + endforeach() +endif() + +if(OPENCMISS_INSTALL_DIR) + message(STATUS "OPENCMISS_INSTALL_DIR=${OPENCMISS_INSTALL_DIR}") + # Use the OpenCMISS scripts to also allow choosing a separate toolchain + # This file is located at the opencmiss installation rather than the local example + # as it avoids file replication and makes maintenance much easier + if (TOOLCHAIN) + set(_OCTC ${OPENCMISS_INSTALL_DIR}/cmake/OCToolchainCompilers.cmake) + if (EXISTS "${_OCTC}") + include(${_OCTC}) + else() + message(WARNING "TOOLCHAIN specified but OpenCMISS config script could not be found at ${_OCTC}. Trying CMake defaults.") + endif() + unset(_OCTC) + endif() + set(OpenCMISS_DIR "${OPENCMISS_INSTALL_DIR}" CACHE PATH "Path to the found OpenCMISS (SDK) installation") +else() + message(WARNING "No OpenCMISS (SDK) installation directory detected. Using default system environment.") +endif() + \ No newline at end of file diff --git a/ClassicalField/Diffusion/QuadraticConvergenceTest/build_debug/build.sh b/ClassicalField/Diffusion/QuadraticConvergenceTest/build_debug/build.sh new file mode 100644 index 00000000..e6624bac --- /dev/null +++ b/ClassicalField/Diffusion/QuadraticConvergenceTest/build_debug/build.sh @@ -0,0 +1,2 @@ +#ccc && cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all +cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all diff --git a/ClassicalField/Hamilton_Jacobi/GeodesicEx1/CMakeLists.txt b/ClassicalField/Hamilton_Jacobi/GeodesicEx1/CMakeLists.txt new file mode 100644 index 00000000..a22b61ee --- /dev/null +++ b/ClassicalField/Hamilton_Jacobi/GeodesicEx1/CMakeLists.txt @@ -0,0 +1,35 @@ +# 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 C) +enable_language(Fortran OPTIONAL) +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 +# ---------------------- +#add_subdirectory(C) +if (CMAKE_Fortran_COMPILER) + add_subdirectory(Fortran) +endif() diff --git a/ClassicalField/Hamilton_Jacobi/GeodesicEx1/Fortran/CMakeLists.txt b/ClassicalField/Hamilton_Jacobi/GeodesicEx1/Fortran/CMakeLists.txt new file mode 100644 index 00000000..a1d587e4 --- /dev/null +++ b/ClassicalField/Hamilton_Jacobi/GeodesicEx1/Fortran/CMakeLists.txt @@ -0,0 +1,60 @@ + +# Add example executable +add_executable(GeodesicEx1 src/GeodesicEx1.ele src/GeodesicEx1Example.f90 src/GeodesicEx1.node) + +# Turn on Fortran preprocessing (#include directives) +if (MSVC) + set(PROC_OPT "/fpp") +else() + set(PROC_OPT "-cpp") +endif() + +# in debug mode, add flag that make Floating point exceptions fatal +set(OPT "") +if (FALSE) + if(CMAKE_BUILD_TYPE MATCHES DEBUG) + set(OPT "-ffpe-trap=invalid,zero,underflow,overflow,denormal") # GCC: make floating point exceptions fatal + endif() +endif() + +target_compile_options(GeodesicEx1 PRIVATE ${PROC_OPT} ${OPT} "-fbacktrace") + +# Link to opencmiss +# ----------------- +# +# This simply uses the opencmiss target created by OC_INIT() above. +# +# Alternatively, you can also directly invoke 'find_package(Iron )' 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 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(GeodesicEx1 PRIVATE opencmiss) + +# Add a simple test that runs the executable +add_test(NAME test_GeodesicEx1 COMMAND GeodesicEx1) +add_opencmiss_environment(test_GeodesicEx1) + +################### +# 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. +# diff --git a/ClassicalField/Hamilton_Jacobi/GeodesicEx1/src/GeodesicEx1.ele b/ClassicalField/Hamilton_Jacobi/GeodesicEx1/Fortran/src/GeodesicEx1.ele similarity index 100% rename from ClassicalField/Hamilton_Jacobi/GeodesicEx1/src/GeodesicEx1.ele rename to ClassicalField/Hamilton_Jacobi/GeodesicEx1/Fortran/src/GeodesicEx1.ele diff --git a/ClassicalField/Hamilton_Jacobi/GeodesicEx1/src/GeodesicEx1.node b/ClassicalField/Hamilton_Jacobi/GeodesicEx1/Fortran/src/GeodesicEx1.node similarity index 100% rename from ClassicalField/Hamilton_Jacobi/GeodesicEx1/src/GeodesicEx1.node rename to ClassicalField/Hamilton_Jacobi/GeodesicEx1/Fortran/src/GeodesicEx1.node diff --git a/ClassicalField/Hamilton_Jacobi/GeodesicEx1/src/GeodesicEx1Example.f90 b/ClassicalField/Hamilton_Jacobi/GeodesicEx1/Fortran/src/GeodesicEx1Example.f90 similarity index 100% rename from ClassicalField/Hamilton_Jacobi/GeodesicEx1/src/GeodesicEx1Example.f90 rename to ClassicalField/Hamilton_Jacobi/GeodesicEx1/Fortran/src/GeodesicEx1Example.f90 diff --git a/ClassicalField/Hamilton_Jacobi/GeodesicEx1/OpenCMISS.cmake b/ClassicalField/Hamilton_Jacobi/GeodesicEx1/OpenCMISS.cmake new file mode 100644 index 00000000..3d6cf515 --- /dev/null +++ b/ClassicalField/Hamilton_Jacobi/GeodesicEx1/OpenCMISS.cmake @@ -0,0 +1,95 @@ +########################### +# *DO NOT CHANGE THIS FILE* +########################### +# +# Prepares the use of OpenCMISS by scanning at various path locations for OpenCMISS (SDK) installations. +# +# Search order: +# - OPENCMISS_INSTALL_DIR variable +# - OPENCMISS_INSTALL_DIR environment variable +# - OPENCMISS_SDK_DIR variable +# - OPENCMISS_SDK_DIR environment variable +# - [Windows only] The Registry is searched additionally for installed SDKs. +# +# If found +# - Includes the toolchain config script of the found opencmiss installation to enable toolchain selection logic (non-windows) + +# Convenience: The OPENCMISS_INSTALL_DIR may also be defined in the environment and various other places +if (DEFINED OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using specified installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The specified OPENCMISS_INSTALL_DIR '${OPENCMISS_INSTALL_DIR}' does not exist. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_INSTALL_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_INSTALL_DIR}" OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using environment installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The environment variable OPENCMISS_INSTALL_DIR='${OPENCMISS_INSTALL_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if (NOT OPENCMISS_INSTALL_DIR AND DEFINED OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The specified OPENCMISS_SDK_DIR '${OPENCMISS_SDK_DIR}' does not exist. Skipping.") + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_SDK_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_SDK_DIR}" OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using environment SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The environment variable OPENCMISS_SDK_DIR='${OPENCMISS_SDK_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_SDK_DIR) + endif() +endif() +# On windows: check the registry for installed OpenCMISS SDKs +if(NOT OPENCMISS_INSTALL_DIR AND WIN32) + foreach(ROOT HKEY_CURRENT_USER HKEY_LOCAL_MACHINE) + foreach(PACKAGE OpenCMISSUserSDK OpenCMISSDeveloperSDK) + set(_REG_KEY "[${ROOT}\\Software\\Auckland Bioengineering Institute\\${PACKAGE}]") + get_filename_component(OPENCMISS_INSTALL_DIR "${_REG_KEY}" ABSOLUTE) + #message(STATUS "Trying registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Found ${PACKAGE} in Windows registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + break() + else() + unset(OPENCMISS_INSTALL_DIR) + endif() + endforeach() + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + break() + endif() + endforeach() +endif() + +if(OPENCMISS_INSTALL_DIR) + message(STATUS "OPENCMISS_INSTALL_DIR=${OPENCMISS_INSTALL_DIR}") + # Use the OpenCMISS scripts to also allow choosing a separate toolchain + # This file is located at the opencmiss installation rather than the local example + # as it avoids file replication and makes maintenance much easier + if (TOOLCHAIN) + set(_OCTC ${OPENCMISS_INSTALL_DIR}/cmake/OCToolchainCompilers.cmake) + if (EXISTS "${_OCTC}") + include(${_OCTC}) + else() + message(WARNING "TOOLCHAIN specified but OpenCMISS config script could not be found at ${_OCTC}. Trying CMake defaults.") + endif() + unset(_OCTC) + endif() + set(OpenCMISS_DIR "${OPENCMISS_INSTALL_DIR}" CACHE PATH "Path to the found OpenCMISS (SDK) installation") +else() + message(WARNING "No OpenCMISS (SDK) installation directory detected. Using default system environment.") +endif() + \ No newline at end of file diff --git a/ClassicalField/Hamilton_Jacobi/GeodesicEx1/build_debug/build.sh b/ClassicalField/Hamilton_Jacobi/GeodesicEx1/build_debug/build.sh new file mode 100644 index 00000000..e6624bac --- /dev/null +++ b/ClassicalField/Hamilton_Jacobi/GeodesicEx1/build_debug/build.sh @@ -0,0 +1,2 @@ +#ccc && cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all +cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all diff --git a/ClassicalField/Hamilton_Jacobi/TwoElmnTet/CMakeLists.txt b/ClassicalField/Hamilton_Jacobi/TwoElmnTet/CMakeLists.txt new file mode 100644 index 00000000..a22b61ee --- /dev/null +++ b/ClassicalField/Hamilton_Jacobi/TwoElmnTet/CMakeLists.txt @@ -0,0 +1,35 @@ +# 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 C) +enable_language(Fortran OPTIONAL) +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 +# ---------------------- +#add_subdirectory(C) +if (CMAKE_Fortran_COMPILER) + add_subdirectory(Fortran) +endif() diff --git a/ClassicalField/Hamilton_Jacobi/TwoElmnTet/Fortran/CMakeLists.txt b/ClassicalField/Hamilton_Jacobi/TwoElmnTet/Fortran/CMakeLists.txt new file mode 100644 index 00000000..7e15ee00 --- /dev/null +++ b/ClassicalField/Hamilton_Jacobi/TwoElmnTet/Fortran/CMakeLists.txt @@ -0,0 +1,60 @@ + +# Add example executable +add_executable(TwoElmnTet src/TwoElmnTet.estm src/TwoElmnTet.cond src/TwoElmnTet.node src/TwoElmnTet.ele src/TwoElmnTetExample.f90 src/TwoElmnTet.fiber) + +# Turn on Fortran preprocessing (#include directives) +if (MSVC) + set(PROC_OPT "/fpp") +else() + set(PROC_OPT "-cpp") +endif() + +# in debug mode, add flag that make Floating point exceptions fatal +set(OPT "") +if (FALSE) + if(CMAKE_BUILD_TYPE MATCHES DEBUG) + set(OPT "-ffpe-trap=invalid,zero,underflow,overflow,denormal") # GCC: make floating point exceptions fatal + endif() +endif() + +target_compile_options(TwoElmnTet PRIVATE ${PROC_OPT} ${OPT} "-fbacktrace") + +# Link to opencmiss +# ----------------- +# +# This simply uses the opencmiss target created by OC_INIT() above. +# +# Alternatively, you can also directly invoke 'find_package(Iron )' 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 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(TwoElmnTet PRIVATE opencmiss) + +# Add a simple test that runs the executable +add_test(NAME test_TwoElmnTet COMMAND TwoElmnTet) +add_opencmiss_environment(test_TwoElmnTet) + +################### +# 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. +# diff --git a/ClassicalField/Hamilton_Jacobi/TwoElmnTet/src/TwoElmnTet.cond b/ClassicalField/Hamilton_Jacobi/TwoElmnTet/Fortran/src/TwoElmnTet.cond similarity index 100% rename from ClassicalField/Hamilton_Jacobi/TwoElmnTet/src/TwoElmnTet.cond rename to ClassicalField/Hamilton_Jacobi/TwoElmnTet/Fortran/src/TwoElmnTet.cond diff --git a/ClassicalField/Hamilton_Jacobi/TwoElmnTet/src/TwoElmnTet.ele b/ClassicalField/Hamilton_Jacobi/TwoElmnTet/Fortran/src/TwoElmnTet.ele similarity index 100% rename from ClassicalField/Hamilton_Jacobi/TwoElmnTet/src/TwoElmnTet.ele rename to ClassicalField/Hamilton_Jacobi/TwoElmnTet/Fortran/src/TwoElmnTet.ele diff --git a/ClassicalField/Hamilton_Jacobi/TwoElmnTet/src/TwoElmnTet.estm b/ClassicalField/Hamilton_Jacobi/TwoElmnTet/Fortran/src/TwoElmnTet.estm similarity index 100% rename from ClassicalField/Hamilton_Jacobi/TwoElmnTet/src/TwoElmnTet.estm rename to ClassicalField/Hamilton_Jacobi/TwoElmnTet/Fortran/src/TwoElmnTet.estm diff --git a/ClassicalField/Hamilton_Jacobi/TwoElmnTet/src/TwoElmnTet.fiber b/ClassicalField/Hamilton_Jacobi/TwoElmnTet/Fortran/src/TwoElmnTet.fiber similarity index 100% rename from ClassicalField/Hamilton_Jacobi/TwoElmnTet/src/TwoElmnTet.fiber rename to ClassicalField/Hamilton_Jacobi/TwoElmnTet/Fortran/src/TwoElmnTet.fiber diff --git a/ClassicalField/Hamilton_Jacobi/TwoElmnTet/src/TwoElmnTet.node b/ClassicalField/Hamilton_Jacobi/TwoElmnTet/Fortran/src/TwoElmnTet.node similarity index 100% rename from ClassicalField/Hamilton_Jacobi/TwoElmnTet/src/TwoElmnTet.node rename to ClassicalField/Hamilton_Jacobi/TwoElmnTet/Fortran/src/TwoElmnTet.node diff --git a/ClassicalField/Hamilton_Jacobi/TwoElmnTet/src/TwoElmnTetExample.f90 b/ClassicalField/Hamilton_Jacobi/TwoElmnTet/Fortran/src/TwoElmnTetExample.f90 similarity index 100% rename from ClassicalField/Hamilton_Jacobi/TwoElmnTet/src/TwoElmnTetExample.f90 rename to ClassicalField/Hamilton_Jacobi/TwoElmnTet/Fortran/src/TwoElmnTetExample.f90 diff --git a/ClassicalField/Hamilton_Jacobi/TwoElmnTet/OpenCMISS.cmake b/ClassicalField/Hamilton_Jacobi/TwoElmnTet/OpenCMISS.cmake new file mode 100644 index 00000000..3d6cf515 --- /dev/null +++ b/ClassicalField/Hamilton_Jacobi/TwoElmnTet/OpenCMISS.cmake @@ -0,0 +1,95 @@ +########################### +# *DO NOT CHANGE THIS FILE* +########################### +# +# Prepares the use of OpenCMISS by scanning at various path locations for OpenCMISS (SDK) installations. +# +# Search order: +# - OPENCMISS_INSTALL_DIR variable +# - OPENCMISS_INSTALL_DIR environment variable +# - OPENCMISS_SDK_DIR variable +# - OPENCMISS_SDK_DIR environment variable +# - [Windows only] The Registry is searched additionally for installed SDKs. +# +# If found +# - Includes the toolchain config script of the found opencmiss installation to enable toolchain selection logic (non-windows) + +# Convenience: The OPENCMISS_INSTALL_DIR may also be defined in the environment and various other places +if (DEFINED OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using specified installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The specified OPENCMISS_INSTALL_DIR '${OPENCMISS_INSTALL_DIR}' does not exist. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_INSTALL_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_INSTALL_DIR}" OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using environment installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The environment variable OPENCMISS_INSTALL_DIR='${OPENCMISS_INSTALL_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if (NOT OPENCMISS_INSTALL_DIR AND DEFINED OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The specified OPENCMISS_SDK_DIR '${OPENCMISS_SDK_DIR}' does not exist. Skipping.") + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_SDK_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_SDK_DIR}" OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using environment SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The environment variable OPENCMISS_SDK_DIR='${OPENCMISS_SDK_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_SDK_DIR) + endif() +endif() +# On windows: check the registry for installed OpenCMISS SDKs +if(NOT OPENCMISS_INSTALL_DIR AND WIN32) + foreach(ROOT HKEY_CURRENT_USER HKEY_LOCAL_MACHINE) + foreach(PACKAGE OpenCMISSUserSDK OpenCMISSDeveloperSDK) + set(_REG_KEY "[${ROOT}\\Software\\Auckland Bioengineering Institute\\${PACKAGE}]") + get_filename_component(OPENCMISS_INSTALL_DIR "${_REG_KEY}" ABSOLUTE) + #message(STATUS "Trying registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Found ${PACKAGE} in Windows registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + break() + else() + unset(OPENCMISS_INSTALL_DIR) + endif() + endforeach() + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + break() + endif() + endforeach() +endif() + +if(OPENCMISS_INSTALL_DIR) + message(STATUS "OPENCMISS_INSTALL_DIR=${OPENCMISS_INSTALL_DIR}") + # Use the OpenCMISS scripts to also allow choosing a separate toolchain + # This file is located at the opencmiss installation rather than the local example + # as it avoids file replication and makes maintenance much easier + if (TOOLCHAIN) + set(_OCTC ${OPENCMISS_INSTALL_DIR}/cmake/OCToolchainCompilers.cmake) + if (EXISTS "${_OCTC}") + include(${_OCTC}) + else() + message(WARNING "TOOLCHAIN specified but OpenCMISS config script could not be found at ${_OCTC}. Trying CMake defaults.") + endif() + unset(_OCTC) + endif() + set(OpenCMISS_DIR "${OPENCMISS_INSTALL_DIR}" CACHE PATH "Path to the found OpenCMISS (SDK) installation") +else() + message(WARNING "No OpenCMISS (SDK) installation directory detected. Using default system environment.") +endif() + \ No newline at end of file diff --git a/ClassicalField/Hamilton_Jacobi/TwoElmnTet/build_debug/build.sh b/ClassicalField/Hamilton_Jacobi/TwoElmnTet/build_debug/build.sh new file mode 100644 index 00000000..e6624bac --- /dev/null +++ b/ClassicalField/Hamilton_Jacobi/TwoElmnTet/build_debug/build.sh @@ -0,0 +1,2 @@ +#ccc && cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all +cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all diff --git a/ClassicalField/Helmholtz/AnalyticHelmholtz/CMakeLists.txt b/ClassicalField/Helmholtz/AnalyticHelmholtz/CMakeLists.txt new file mode 100644 index 00000000..a22b61ee --- /dev/null +++ b/ClassicalField/Helmholtz/AnalyticHelmholtz/CMakeLists.txt @@ -0,0 +1,35 @@ +# 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 C) +enable_language(Fortran OPTIONAL) +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 +# ---------------------- +#add_subdirectory(C) +if (CMAKE_Fortran_COMPILER) + add_subdirectory(Fortran) +endif() diff --git a/ClassicalField/Helmholtz/AnalyticHelmholtz/Fortran/CMakeLists.txt b/ClassicalField/Helmholtz/AnalyticHelmholtz/Fortran/CMakeLists.txt new file mode 100644 index 00000000..f9a7c650 --- /dev/null +++ b/ClassicalField/Helmholtz/AnalyticHelmholtz/Fortran/CMakeLists.txt @@ -0,0 +1,60 @@ + +# Add example executable +add_executable(AnalyticHelmholtz src/AnalyticHelmholtzExample.f90) + +# Turn on Fortran preprocessing (#include directives) +if (MSVC) + set(PROC_OPT "/fpp") +else() + set(PROC_OPT "-cpp") +endif() + +# in debug mode, add flag that make Floating point exceptions fatal +set(OPT "") +if (FALSE) + if(CMAKE_BUILD_TYPE MATCHES DEBUG) + set(OPT "-ffpe-trap=invalid,zero,underflow,overflow,denormal") # GCC: make floating point exceptions fatal + endif() +endif() + +target_compile_options(AnalyticHelmholtz PRIVATE ${PROC_OPT} ${OPT} "-fbacktrace") + +# Link to opencmiss +# ----------------- +# +# This simply uses the opencmiss target created by OC_INIT() above. +# +# Alternatively, you can also directly invoke 'find_package(Iron )' 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 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(AnalyticHelmholtz PRIVATE opencmiss) + +# Add a simple test that runs the executable +add_test(NAME test_AnalyticHelmholtz COMMAND AnalyticHelmholtz) +add_opencmiss_environment(test_AnalyticHelmholtz) + +################### +# 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. +# diff --git a/ClassicalField/Helmholtz/AnalyticHelmholtz/src/AnalyticHelmholtzExample.f90 b/ClassicalField/Helmholtz/AnalyticHelmholtz/Fortran/src/AnalyticHelmholtzExample.f90 similarity index 100% rename from ClassicalField/Helmholtz/AnalyticHelmholtz/src/AnalyticHelmholtzExample.f90 rename to ClassicalField/Helmholtz/AnalyticHelmholtz/Fortran/src/AnalyticHelmholtzExample.f90 diff --git a/ClassicalField/Helmholtz/AnalyticHelmholtz/OpenCMISS.cmake b/ClassicalField/Helmholtz/AnalyticHelmholtz/OpenCMISS.cmake new file mode 100644 index 00000000..3d6cf515 --- /dev/null +++ b/ClassicalField/Helmholtz/AnalyticHelmholtz/OpenCMISS.cmake @@ -0,0 +1,95 @@ +########################### +# *DO NOT CHANGE THIS FILE* +########################### +# +# Prepares the use of OpenCMISS by scanning at various path locations for OpenCMISS (SDK) installations. +# +# Search order: +# - OPENCMISS_INSTALL_DIR variable +# - OPENCMISS_INSTALL_DIR environment variable +# - OPENCMISS_SDK_DIR variable +# - OPENCMISS_SDK_DIR environment variable +# - [Windows only] The Registry is searched additionally for installed SDKs. +# +# If found +# - Includes the toolchain config script of the found opencmiss installation to enable toolchain selection logic (non-windows) + +# Convenience: The OPENCMISS_INSTALL_DIR may also be defined in the environment and various other places +if (DEFINED OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using specified installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The specified OPENCMISS_INSTALL_DIR '${OPENCMISS_INSTALL_DIR}' does not exist. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_INSTALL_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_INSTALL_DIR}" OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using environment installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The environment variable OPENCMISS_INSTALL_DIR='${OPENCMISS_INSTALL_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if (NOT OPENCMISS_INSTALL_DIR AND DEFINED OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The specified OPENCMISS_SDK_DIR '${OPENCMISS_SDK_DIR}' does not exist. Skipping.") + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_SDK_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_SDK_DIR}" OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using environment SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The environment variable OPENCMISS_SDK_DIR='${OPENCMISS_SDK_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_SDK_DIR) + endif() +endif() +# On windows: check the registry for installed OpenCMISS SDKs +if(NOT OPENCMISS_INSTALL_DIR AND WIN32) + foreach(ROOT HKEY_CURRENT_USER HKEY_LOCAL_MACHINE) + foreach(PACKAGE OpenCMISSUserSDK OpenCMISSDeveloperSDK) + set(_REG_KEY "[${ROOT}\\Software\\Auckland Bioengineering Institute\\${PACKAGE}]") + get_filename_component(OPENCMISS_INSTALL_DIR "${_REG_KEY}" ABSOLUTE) + #message(STATUS "Trying registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Found ${PACKAGE} in Windows registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + break() + else() + unset(OPENCMISS_INSTALL_DIR) + endif() + endforeach() + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + break() + endif() + endforeach() +endif() + +if(OPENCMISS_INSTALL_DIR) + message(STATUS "OPENCMISS_INSTALL_DIR=${OPENCMISS_INSTALL_DIR}") + # Use the OpenCMISS scripts to also allow choosing a separate toolchain + # This file is located at the opencmiss installation rather than the local example + # as it avoids file replication and makes maintenance much easier + if (TOOLCHAIN) + set(_OCTC ${OPENCMISS_INSTALL_DIR}/cmake/OCToolchainCompilers.cmake) + if (EXISTS "${_OCTC}") + include(${_OCTC}) + else() + message(WARNING "TOOLCHAIN specified but OpenCMISS config script could not be found at ${_OCTC}. Trying CMake defaults.") + endif() + unset(_OCTC) + endif() + set(OpenCMISS_DIR "${OPENCMISS_INSTALL_DIR}" CACHE PATH "Path to the found OpenCMISS (SDK) installation") +else() + message(WARNING "No OpenCMISS (SDK) installation directory detected. Using default system environment.") +endif() + \ No newline at end of file diff --git a/ClassicalField/Helmholtz/AnalyticHelmholtz/build_debug/build.sh b/ClassicalField/Helmholtz/AnalyticHelmholtz/build_debug/build.sh new file mode 100644 index 00000000..e6624bac --- /dev/null +++ b/ClassicalField/Helmholtz/AnalyticHelmholtz/build_debug/build.sh @@ -0,0 +1,2 @@ +#ccc && cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all +cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all diff --git a/ClassicalField/Helmholtz/Helmholtz/CMakeLists.txt b/ClassicalField/Helmholtz/Helmholtz/CMakeLists.txt new file mode 100644 index 00000000..a22b61ee --- /dev/null +++ b/ClassicalField/Helmholtz/Helmholtz/CMakeLists.txt @@ -0,0 +1,35 @@ +# 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 C) +enable_language(Fortran OPTIONAL) +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 +# ---------------------- +#add_subdirectory(C) +if (CMAKE_Fortran_COMPILER) + add_subdirectory(Fortran) +endif() diff --git a/ClassicalField/Helmholtz/Helmholtz/Fortran/CMakeLists.txt b/ClassicalField/Helmholtz/Helmholtz/Fortran/CMakeLists.txt new file mode 100644 index 00000000..bd9cb32a --- /dev/null +++ b/ClassicalField/Helmholtz/Helmholtz/Fortran/CMakeLists.txt @@ -0,0 +1,60 @@ + +# Add example executable +add_executable(Helmholtz src/HelmholtzExample.f90) + +# Turn on Fortran preprocessing (#include directives) +if (MSVC) + set(PROC_OPT "/fpp") +else() + set(PROC_OPT "-cpp") +endif() + +# in debug mode, add flag that make Floating point exceptions fatal +set(OPT "") +if (FALSE) + if(CMAKE_BUILD_TYPE MATCHES DEBUG) + set(OPT "-ffpe-trap=invalid,zero,underflow,overflow,denormal") # GCC: make floating point exceptions fatal + endif() +endif() + +target_compile_options(Helmholtz PRIVATE ${PROC_OPT} ${OPT} "-fbacktrace") + +# Link to opencmiss +# ----------------- +# +# This simply uses the opencmiss target created by OC_INIT() above. +# +# Alternatively, you can also directly invoke 'find_package(Iron )' 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 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(Helmholtz PRIVATE opencmiss) + +# Add a simple test that runs the executable +add_test(NAME test_Helmholtz COMMAND Helmholtz) +add_opencmiss_environment(test_Helmholtz) + +################### +# 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. +# diff --git a/ClassicalField/Helmholtz/Helmholtz/src/HelmholtzExample.f90 b/ClassicalField/Helmholtz/Helmholtz/Fortran/src/HelmholtzExample.f90 similarity index 100% rename from ClassicalField/Helmholtz/Helmholtz/src/HelmholtzExample.f90 rename to ClassicalField/Helmholtz/Helmholtz/Fortran/src/HelmholtzExample.f90 diff --git a/ClassicalField/Helmholtz/Helmholtz/OpenCMISS.cmake b/ClassicalField/Helmholtz/Helmholtz/OpenCMISS.cmake new file mode 100644 index 00000000..3d6cf515 --- /dev/null +++ b/ClassicalField/Helmholtz/Helmholtz/OpenCMISS.cmake @@ -0,0 +1,95 @@ +########################### +# *DO NOT CHANGE THIS FILE* +########################### +# +# Prepares the use of OpenCMISS by scanning at various path locations for OpenCMISS (SDK) installations. +# +# Search order: +# - OPENCMISS_INSTALL_DIR variable +# - OPENCMISS_INSTALL_DIR environment variable +# - OPENCMISS_SDK_DIR variable +# - OPENCMISS_SDK_DIR environment variable +# - [Windows only] The Registry is searched additionally for installed SDKs. +# +# If found +# - Includes the toolchain config script of the found opencmiss installation to enable toolchain selection logic (non-windows) + +# Convenience: The OPENCMISS_INSTALL_DIR may also be defined in the environment and various other places +if (DEFINED OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using specified installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The specified OPENCMISS_INSTALL_DIR '${OPENCMISS_INSTALL_DIR}' does not exist. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_INSTALL_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_INSTALL_DIR}" OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using environment installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The environment variable OPENCMISS_INSTALL_DIR='${OPENCMISS_INSTALL_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if (NOT OPENCMISS_INSTALL_DIR AND DEFINED OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The specified OPENCMISS_SDK_DIR '${OPENCMISS_SDK_DIR}' does not exist. Skipping.") + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_SDK_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_SDK_DIR}" OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using environment SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The environment variable OPENCMISS_SDK_DIR='${OPENCMISS_SDK_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_SDK_DIR) + endif() +endif() +# On windows: check the registry for installed OpenCMISS SDKs +if(NOT OPENCMISS_INSTALL_DIR AND WIN32) + foreach(ROOT HKEY_CURRENT_USER HKEY_LOCAL_MACHINE) + foreach(PACKAGE OpenCMISSUserSDK OpenCMISSDeveloperSDK) + set(_REG_KEY "[${ROOT}\\Software\\Auckland Bioengineering Institute\\${PACKAGE}]") + get_filename_component(OPENCMISS_INSTALL_DIR "${_REG_KEY}" ABSOLUTE) + #message(STATUS "Trying registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Found ${PACKAGE} in Windows registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + break() + else() + unset(OPENCMISS_INSTALL_DIR) + endif() + endforeach() + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + break() + endif() + endforeach() +endif() + +if(OPENCMISS_INSTALL_DIR) + message(STATUS "OPENCMISS_INSTALL_DIR=${OPENCMISS_INSTALL_DIR}") + # Use the OpenCMISS scripts to also allow choosing a separate toolchain + # This file is located at the opencmiss installation rather than the local example + # as it avoids file replication and makes maintenance much easier + if (TOOLCHAIN) + set(_OCTC ${OPENCMISS_INSTALL_DIR}/cmake/OCToolchainCompilers.cmake) + if (EXISTS "${_OCTC}") + include(${_OCTC}) + else() + message(WARNING "TOOLCHAIN specified but OpenCMISS config script could not be found at ${_OCTC}. Trying CMake defaults.") + endif() + unset(_OCTC) + endif() + set(OpenCMISS_DIR "${OPENCMISS_INSTALL_DIR}" CACHE PATH "Path to the found OpenCMISS (SDK) installation") +else() + message(WARNING "No OpenCMISS (SDK) installation directory detected. Using default system environment.") +endif() + \ No newline at end of file diff --git a/ClassicalField/Helmholtz/Helmholtz/build_debug/build.sh b/ClassicalField/Helmholtz/Helmholtz/build_debug/build.sh new file mode 100644 index 00000000..e6624bac --- /dev/null +++ b/ClassicalField/Helmholtz/Helmholtz/build_debug/build.sh @@ -0,0 +1,2 @@ +#ccc && cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all +cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all diff --git a/ClassicalField/Laplace/42Master/CMakeLists.txt b/ClassicalField/Laplace/42Master/CMakeLists.txt new file mode 100644 index 00000000..a22b61ee --- /dev/null +++ b/ClassicalField/Laplace/42Master/CMakeLists.txt @@ -0,0 +1,35 @@ +# 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 C) +enable_language(Fortran OPTIONAL) +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 +# ---------------------- +#add_subdirectory(C) +if (CMAKE_Fortran_COMPILER) + add_subdirectory(Fortran) +endif() diff --git a/ClassicalField/Laplace/42Master/Fortran/CMakeLists.txt b/ClassicalField/Laplace/42Master/Fortran/CMakeLists.txt new file mode 100644 index 00000000..20e09803 --- /dev/null +++ b/ClassicalField/Laplace/42Master/Fortran/CMakeLists.txt @@ -0,0 +1,60 @@ + +# Add example executable +add_executable(42Master src/42MasterExample.f90) + +# Turn on Fortran preprocessing (#include directives) +if (MSVC) + set(PROC_OPT "/fpp") +else() + set(PROC_OPT "-cpp") +endif() + +# in debug mode, add flag that make Floating point exceptions fatal +set(OPT "") +if (FALSE) + if(CMAKE_BUILD_TYPE MATCHES DEBUG) + set(OPT "-ffpe-trap=invalid,zero,underflow,overflow,denormal") # GCC: make floating point exceptions fatal + endif() +endif() + +target_compile_options(42Master PRIVATE ${PROC_OPT} ${OPT} "-fbacktrace") + +# Link to opencmiss +# ----------------- +# +# This simply uses the opencmiss target created by OC_INIT() above. +# +# Alternatively, you can also directly invoke 'find_package(Iron )' 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 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(42Master PRIVATE opencmiss) + +# Add a simple test that runs the executable +add_test(NAME test_42Master COMMAND 42Master) +add_opencmiss_environment(test_42Master) + +################### +# 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. +# diff --git a/ClassicalField/Laplace/42Master/src/42MasterExample.f90 b/ClassicalField/Laplace/42Master/Fortran/src/42MasterExample.f90 similarity index 100% rename from ClassicalField/Laplace/42Master/src/42MasterExample.f90 rename to ClassicalField/Laplace/42Master/Fortran/src/42MasterExample.f90 diff --git a/ClassicalField/Laplace/42Master/OpenCMISS.cmake b/ClassicalField/Laplace/42Master/OpenCMISS.cmake new file mode 100644 index 00000000..3d6cf515 --- /dev/null +++ b/ClassicalField/Laplace/42Master/OpenCMISS.cmake @@ -0,0 +1,95 @@ +########################### +# *DO NOT CHANGE THIS FILE* +########################### +# +# Prepares the use of OpenCMISS by scanning at various path locations for OpenCMISS (SDK) installations. +# +# Search order: +# - OPENCMISS_INSTALL_DIR variable +# - OPENCMISS_INSTALL_DIR environment variable +# - OPENCMISS_SDK_DIR variable +# - OPENCMISS_SDK_DIR environment variable +# - [Windows only] The Registry is searched additionally for installed SDKs. +# +# If found +# - Includes the toolchain config script of the found opencmiss installation to enable toolchain selection logic (non-windows) + +# Convenience: The OPENCMISS_INSTALL_DIR may also be defined in the environment and various other places +if (DEFINED OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using specified installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The specified OPENCMISS_INSTALL_DIR '${OPENCMISS_INSTALL_DIR}' does not exist. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_INSTALL_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_INSTALL_DIR}" OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using environment installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The environment variable OPENCMISS_INSTALL_DIR='${OPENCMISS_INSTALL_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if (NOT OPENCMISS_INSTALL_DIR AND DEFINED OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The specified OPENCMISS_SDK_DIR '${OPENCMISS_SDK_DIR}' does not exist. Skipping.") + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_SDK_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_SDK_DIR}" OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using environment SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The environment variable OPENCMISS_SDK_DIR='${OPENCMISS_SDK_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_SDK_DIR) + endif() +endif() +# On windows: check the registry for installed OpenCMISS SDKs +if(NOT OPENCMISS_INSTALL_DIR AND WIN32) + foreach(ROOT HKEY_CURRENT_USER HKEY_LOCAL_MACHINE) + foreach(PACKAGE OpenCMISSUserSDK OpenCMISSDeveloperSDK) + set(_REG_KEY "[${ROOT}\\Software\\Auckland Bioengineering Institute\\${PACKAGE}]") + get_filename_component(OPENCMISS_INSTALL_DIR "${_REG_KEY}" ABSOLUTE) + #message(STATUS "Trying registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Found ${PACKAGE} in Windows registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + break() + else() + unset(OPENCMISS_INSTALL_DIR) + endif() + endforeach() + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + break() + endif() + endforeach() +endif() + +if(OPENCMISS_INSTALL_DIR) + message(STATUS "OPENCMISS_INSTALL_DIR=${OPENCMISS_INSTALL_DIR}") + # Use the OpenCMISS scripts to also allow choosing a separate toolchain + # This file is located at the opencmiss installation rather than the local example + # as it avoids file replication and makes maintenance much easier + if (TOOLCHAIN) + set(_OCTC ${OPENCMISS_INSTALL_DIR}/cmake/OCToolchainCompilers.cmake) + if (EXISTS "${_OCTC}") + include(${_OCTC}) + else() + message(WARNING "TOOLCHAIN specified but OpenCMISS config script could not be found at ${_OCTC}. Trying CMake defaults.") + endif() + unset(_OCTC) + endif() + set(OpenCMISS_DIR "${OPENCMISS_INSTALL_DIR}" CACHE PATH "Path to the found OpenCMISS (SDK) installation") +else() + message(WARNING "No OpenCMISS (SDK) installation directory detected. Using default system environment.") +endif() + \ No newline at end of file diff --git a/ClassicalField/Laplace/42Master/build_debug/build.sh b/ClassicalField/Laplace/42Master/build_debug/build.sh new file mode 100644 index 00000000..e6624bac --- /dev/null +++ b/ClassicalField/Laplace/42Master/build_debug/build.sh @@ -0,0 +1,2 @@ +#ccc && cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all +cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all diff --git a/ClassicalField/Laplace/AnalyticLaplace/CMakeLists.txt b/ClassicalField/Laplace/AnalyticLaplace/CMakeLists.txt new file mode 100644 index 00000000..a22b61ee --- /dev/null +++ b/ClassicalField/Laplace/AnalyticLaplace/CMakeLists.txt @@ -0,0 +1,35 @@ +# 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 C) +enable_language(Fortran OPTIONAL) +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 +# ---------------------- +#add_subdirectory(C) +if (CMAKE_Fortran_COMPILER) + add_subdirectory(Fortran) +endif() diff --git a/ClassicalField/Laplace/AnalyticLaplace/Fortran/CMakeLists.txt b/ClassicalField/Laplace/AnalyticLaplace/Fortran/CMakeLists.txt new file mode 100644 index 00000000..637d0827 --- /dev/null +++ b/ClassicalField/Laplace/AnalyticLaplace/Fortran/CMakeLists.txt @@ -0,0 +1,60 @@ + +# Add example executable +add_executable(AnalyticLaplace src/AnalyticLaplaceExample.f90) + +# Turn on Fortran preprocessing (#include directives) +if (MSVC) + set(PROC_OPT "/fpp") +else() + set(PROC_OPT "-cpp") +endif() + +# in debug mode, add flag that make Floating point exceptions fatal +set(OPT "") +if (FALSE) + if(CMAKE_BUILD_TYPE MATCHES DEBUG) + set(OPT "-ffpe-trap=invalid,zero,underflow,overflow,denormal") # GCC: make floating point exceptions fatal + endif() +endif() + +target_compile_options(AnalyticLaplace PRIVATE ${PROC_OPT} ${OPT} "-fbacktrace") + +# Link to opencmiss +# ----------------- +# +# This simply uses the opencmiss target created by OC_INIT() above. +# +# Alternatively, you can also directly invoke 'find_package(Iron )' 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 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(AnalyticLaplace PRIVATE opencmiss) + +# Add a simple test that runs the executable +add_test(NAME test_AnalyticLaplace COMMAND AnalyticLaplace) +add_opencmiss_environment(test_AnalyticLaplace) + +################### +# 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. +# diff --git a/ClassicalField/Laplace/AnalyticLaplace/src/AnalyticLaplaceExample.f90 b/ClassicalField/Laplace/AnalyticLaplace/Fortran/src/AnalyticLaplaceExample.f90 similarity index 100% rename from ClassicalField/Laplace/AnalyticLaplace/src/AnalyticLaplaceExample.f90 rename to ClassicalField/Laplace/AnalyticLaplace/Fortran/src/AnalyticLaplaceExample.f90 diff --git a/ClassicalField/Laplace/AnalyticLaplace/OpenCMISS.cmake b/ClassicalField/Laplace/AnalyticLaplace/OpenCMISS.cmake new file mode 100644 index 00000000..3d6cf515 --- /dev/null +++ b/ClassicalField/Laplace/AnalyticLaplace/OpenCMISS.cmake @@ -0,0 +1,95 @@ +########################### +# *DO NOT CHANGE THIS FILE* +########################### +# +# Prepares the use of OpenCMISS by scanning at various path locations for OpenCMISS (SDK) installations. +# +# Search order: +# - OPENCMISS_INSTALL_DIR variable +# - OPENCMISS_INSTALL_DIR environment variable +# - OPENCMISS_SDK_DIR variable +# - OPENCMISS_SDK_DIR environment variable +# - [Windows only] The Registry is searched additionally for installed SDKs. +# +# If found +# - Includes the toolchain config script of the found opencmiss installation to enable toolchain selection logic (non-windows) + +# Convenience: The OPENCMISS_INSTALL_DIR may also be defined in the environment and various other places +if (DEFINED OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using specified installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The specified OPENCMISS_INSTALL_DIR '${OPENCMISS_INSTALL_DIR}' does not exist. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_INSTALL_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_INSTALL_DIR}" OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using environment installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The environment variable OPENCMISS_INSTALL_DIR='${OPENCMISS_INSTALL_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if (NOT OPENCMISS_INSTALL_DIR AND DEFINED OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The specified OPENCMISS_SDK_DIR '${OPENCMISS_SDK_DIR}' does not exist. Skipping.") + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_SDK_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_SDK_DIR}" OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using environment SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The environment variable OPENCMISS_SDK_DIR='${OPENCMISS_SDK_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_SDK_DIR) + endif() +endif() +# On windows: check the registry for installed OpenCMISS SDKs +if(NOT OPENCMISS_INSTALL_DIR AND WIN32) + foreach(ROOT HKEY_CURRENT_USER HKEY_LOCAL_MACHINE) + foreach(PACKAGE OpenCMISSUserSDK OpenCMISSDeveloperSDK) + set(_REG_KEY "[${ROOT}\\Software\\Auckland Bioengineering Institute\\${PACKAGE}]") + get_filename_component(OPENCMISS_INSTALL_DIR "${_REG_KEY}" ABSOLUTE) + #message(STATUS "Trying registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Found ${PACKAGE} in Windows registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + break() + else() + unset(OPENCMISS_INSTALL_DIR) + endif() + endforeach() + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + break() + endif() + endforeach() +endif() + +if(OPENCMISS_INSTALL_DIR) + message(STATUS "OPENCMISS_INSTALL_DIR=${OPENCMISS_INSTALL_DIR}") + # Use the OpenCMISS scripts to also allow choosing a separate toolchain + # This file is located at the opencmiss installation rather than the local example + # as it avoids file replication and makes maintenance much easier + if (TOOLCHAIN) + set(_OCTC ${OPENCMISS_INSTALL_DIR}/cmake/OCToolchainCompilers.cmake) + if (EXISTS "${_OCTC}") + include(${_OCTC}) + else() + message(WARNING "TOOLCHAIN specified but OpenCMISS config script could not be found at ${_OCTC}. Trying CMake defaults.") + endif() + unset(_OCTC) + endif() + set(OpenCMISS_DIR "${OPENCMISS_INSTALL_DIR}" CACHE PATH "Path to the found OpenCMISS (SDK) installation") +else() + message(WARNING "No OpenCMISS (SDK) installation directory detected. Using default system environment.") +endif() + \ No newline at end of file diff --git a/ClassicalField/Laplace/AnalyticLaplace/build_debug/build.sh b/ClassicalField/Laplace/AnalyticLaplace/build_debug/build.sh new file mode 100644 index 00000000..e6624bac --- /dev/null +++ b/ClassicalField/Laplace/AnalyticLaplace/build_debug/build.sh @@ -0,0 +1,2 @@ +#ccc && cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all +cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all diff --git a/ClassicalField/Laplace/Embedded1DLaplace/CMakeLists.txt b/ClassicalField/Laplace/Embedded1DLaplace/CMakeLists.txt new file mode 100644 index 00000000..a22b61ee --- /dev/null +++ b/ClassicalField/Laplace/Embedded1DLaplace/CMakeLists.txt @@ -0,0 +1,35 @@ +# 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 C) +enable_language(Fortran OPTIONAL) +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 +# ---------------------- +#add_subdirectory(C) +if (CMAKE_Fortran_COMPILER) + add_subdirectory(Fortran) +endif() diff --git a/ClassicalField/Laplace/Embedded1DLaplace/Fortran/CMakeLists.txt b/ClassicalField/Laplace/Embedded1DLaplace/Fortran/CMakeLists.txt new file mode 100644 index 00000000..3381efd4 --- /dev/null +++ b/ClassicalField/Laplace/Embedded1DLaplace/Fortran/CMakeLists.txt @@ -0,0 +1,60 @@ + +# Add example executable +add_executable(Embedded1DLaplace src/Embedded1DLaplaceExample.f90) + +# Turn on Fortran preprocessing (#include directives) +if (MSVC) + set(PROC_OPT "/fpp") +else() + set(PROC_OPT "-cpp") +endif() + +# in debug mode, add flag that make Floating point exceptions fatal +set(OPT "") +if (FALSE) + if(CMAKE_BUILD_TYPE MATCHES DEBUG) + set(OPT "-ffpe-trap=invalid,zero,underflow,overflow,denormal") # GCC: make floating point exceptions fatal + endif() +endif() + +target_compile_options(Embedded1DLaplace PRIVATE ${PROC_OPT} ${OPT} "-fbacktrace") + +# Link to opencmiss +# ----------------- +# +# This simply uses the opencmiss target created by OC_INIT() above. +# +# Alternatively, you can also directly invoke 'find_package(Iron )' 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 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(Embedded1DLaplace PRIVATE opencmiss) + +# Add a simple test that runs the executable +add_test(NAME test_Embedded1DLaplace COMMAND Embedded1DLaplace) +add_opencmiss_environment(test_Embedded1DLaplace) + +################### +# 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. +# diff --git a/ClassicalField/Laplace/Embedded1DLaplace/src/Embedded1DLaplaceExample.f90 b/ClassicalField/Laplace/Embedded1DLaplace/Fortran/src/Embedded1DLaplaceExample.f90 similarity index 100% rename from ClassicalField/Laplace/Embedded1DLaplace/src/Embedded1DLaplaceExample.f90 rename to ClassicalField/Laplace/Embedded1DLaplace/Fortran/src/Embedded1DLaplaceExample.f90 diff --git a/ClassicalField/Laplace/Embedded1DLaplace/OpenCMISS.cmake b/ClassicalField/Laplace/Embedded1DLaplace/OpenCMISS.cmake new file mode 100644 index 00000000..3d6cf515 --- /dev/null +++ b/ClassicalField/Laplace/Embedded1DLaplace/OpenCMISS.cmake @@ -0,0 +1,95 @@ +########################### +# *DO NOT CHANGE THIS FILE* +########################### +# +# Prepares the use of OpenCMISS by scanning at various path locations for OpenCMISS (SDK) installations. +# +# Search order: +# - OPENCMISS_INSTALL_DIR variable +# - OPENCMISS_INSTALL_DIR environment variable +# - OPENCMISS_SDK_DIR variable +# - OPENCMISS_SDK_DIR environment variable +# - [Windows only] The Registry is searched additionally for installed SDKs. +# +# If found +# - Includes the toolchain config script of the found opencmiss installation to enable toolchain selection logic (non-windows) + +# Convenience: The OPENCMISS_INSTALL_DIR may also be defined in the environment and various other places +if (DEFINED OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using specified installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The specified OPENCMISS_INSTALL_DIR '${OPENCMISS_INSTALL_DIR}' does not exist. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_INSTALL_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_INSTALL_DIR}" OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using environment installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The environment variable OPENCMISS_INSTALL_DIR='${OPENCMISS_INSTALL_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if (NOT OPENCMISS_INSTALL_DIR AND DEFINED OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The specified OPENCMISS_SDK_DIR '${OPENCMISS_SDK_DIR}' does not exist. Skipping.") + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_SDK_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_SDK_DIR}" OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using environment SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The environment variable OPENCMISS_SDK_DIR='${OPENCMISS_SDK_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_SDK_DIR) + endif() +endif() +# On windows: check the registry for installed OpenCMISS SDKs +if(NOT OPENCMISS_INSTALL_DIR AND WIN32) + foreach(ROOT HKEY_CURRENT_USER HKEY_LOCAL_MACHINE) + foreach(PACKAGE OpenCMISSUserSDK OpenCMISSDeveloperSDK) + set(_REG_KEY "[${ROOT}\\Software\\Auckland Bioengineering Institute\\${PACKAGE}]") + get_filename_component(OPENCMISS_INSTALL_DIR "${_REG_KEY}" ABSOLUTE) + #message(STATUS "Trying registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Found ${PACKAGE} in Windows registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + break() + else() + unset(OPENCMISS_INSTALL_DIR) + endif() + endforeach() + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + break() + endif() + endforeach() +endif() + +if(OPENCMISS_INSTALL_DIR) + message(STATUS "OPENCMISS_INSTALL_DIR=${OPENCMISS_INSTALL_DIR}") + # Use the OpenCMISS scripts to also allow choosing a separate toolchain + # This file is located at the opencmiss installation rather than the local example + # as it avoids file replication and makes maintenance much easier + if (TOOLCHAIN) + set(_OCTC ${OPENCMISS_INSTALL_DIR}/cmake/OCToolchainCompilers.cmake) + if (EXISTS "${_OCTC}") + include(${_OCTC}) + else() + message(WARNING "TOOLCHAIN specified but OpenCMISS config script could not be found at ${_OCTC}. Trying CMake defaults.") + endif() + unset(_OCTC) + endif() + set(OpenCMISS_DIR "${OPENCMISS_INSTALL_DIR}" CACHE PATH "Path to the found OpenCMISS (SDK) installation") +else() + message(WARNING "No OpenCMISS (SDK) installation directory detected. Using default system environment.") +endif() + \ No newline at end of file diff --git a/ClassicalField/Laplace/Embedded1DLaplace/build_debug/build.sh b/ClassicalField/Laplace/Embedded1DLaplace/build_debug/build.sh new file mode 100644 index 00000000..e6624bac --- /dev/null +++ b/ClassicalField/Laplace/Embedded1DLaplace/build_debug/build.sh @@ -0,0 +1,2 @@ +#ccc && cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all +cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all diff --git a/ClassicalField/Laplace/Embedded2DLaplace/CMakeLists.txt b/ClassicalField/Laplace/Embedded2DLaplace/CMakeLists.txt new file mode 100644 index 00000000..a22b61ee --- /dev/null +++ b/ClassicalField/Laplace/Embedded2DLaplace/CMakeLists.txt @@ -0,0 +1,35 @@ +# 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 C) +enable_language(Fortran OPTIONAL) +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 +# ---------------------- +#add_subdirectory(C) +if (CMAKE_Fortran_COMPILER) + add_subdirectory(Fortran) +endif() diff --git a/ClassicalField/Laplace/Embedded2DLaplace/Fortran/CMakeLists.txt b/ClassicalField/Laplace/Embedded2DLaplace/Fortran/CMakeLists.txt new file mode 100644 index 00000000..b13fe299 --- /dev/null +++ b/ClassicalField/Laplace/Embedded2DLaplace/Fortran/CMakeLists.txt @@ -0,0 +1,60 @@ + +# Add example executable +add_executable(Embedded2DLaplace src/Embedded2DLaplaceExample.f90) + +# Turn on Fortran preprocessing (#include directives) +if (MSVC) + set(PROC_OPT "/fpp") +else() + set(PROC_OPT "-cpp") +endif() + +# in debug mode, add flag that make Floating point exceptions fatal +set(OPT "") +if (FALSE) + if(CMAKE_BUILD_TYPE MATCHES DEBUG) + set(OPT "-ffpe-trap=invalid,zero,underflow,overflow,denormal") # GCC: make floating point exceptions fatal + endif() +endif() + +target_compile_options(Embedded2DLaplace PRIVATE ${PROC_OPT} ${OPT} "-fbacktrace") + +# Link to opencmiss +# ----------------- +# +# This simply uses the opencmiss target created by OC_INIT() above. +# +# Alternatively, you can also directly invoke 'find_package(Iron )' 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 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(Embedded2DLaplace PRIVATE opencmiss) + +# Add a simple test that runs the executable +add_test(NAME test_Embedded2DLaplace COMMAND Embedded2DLaplace) +add_opencmiss_environment(test_Embedded2DLaplace) + +################### +# 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. +# diff --git a/ClassicalField/Laplace/Embedded2DLaplace/src/Embedded2DLaplaceExample.f90 b/ClassicalField/Laplace/Embedded2DLaplace/Fortran/src/Embedded2DLaplaceExample.f90 similarity index 100% rename from ClassicalField/Laplace/Embedded2DLaplace/src/Embedded2DLaplaceExample.f90 rename to ClassicalField/Laplace/Embedded2DLaplace/Fortran/src/Embedded2DLaplaceExample.f90 diff --git a/ClassicalField/Laplace/Embedded2DLaplace/OpenCMISS.cmake b/ClassicalField/Laplace/Embedded2DLaplace/OpenCMISS.cmake new file mode 100644 index 00000000..3d6cf515 --- /dev/null +++ b/ClassicalField/Laplace/Embedded2DLaplace/OpenCMISS.cmake @@ -0,0 +1,95 @@ +########################### +# *DO NOT CHANGE THIS FILE* +########################### +# +# Prepares the use of OpenCMISS by scanning at various path locations for OpenCMISS (SDK) installations. +# +# Search order: +# - OPENCMISS_INSTALL_DIR variable +# - OPENCMISS_INSTALL_DIR environment variable +# - OPENCMISS_SDK_DIR variable +# - OPENCMISS_SDK_DIR environment variable +# - [Windows only] The Registry is searched additionally for installed SDKs. +# +# If found +# - Includes the toolchain config script of the found opencmiss installation to enable toolchain selection logic (non-windows) + +# Convenience: The OPENCMISS_INSTALL_DIR may also be defined in the environment and various other places +if (DEFINED OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using specified installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The specified OPENCMISS_INSTALL_DIR '${OPENCMISS_INSTALL_DIR}' does not exist. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_INSTALL_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_INSTALL_DIR}" OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using environment installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The environment variable OPENCMISS_INSTALL_DIR='${OPENCMISS_INSTALL_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if (NOT OPENCMISS_INSTALL_DIR AND DEFINED OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The specified OPENCMISS_SDK_DIR '${OPENCMISS_SDK_DIR}' does not exist. Skipping.") + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_SDK_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_SDK_DIR}" OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using environment SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The environment variable OPENCMISS_SDK_DIR='${OPENCMISS_SDK_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_SDK_DIR) + endif() +endif() +# On windows: check the registry for installed OpenCMISS SDKs +if(NOT OPENCMISS_INSTALL_DIR AND WIN32) + foreach(ROOT HKEY_CURRENT_USER HKEY_LOCAL_MACHINE) + foreach(PACKAGE OpenCMISSUserSDK OpenCMISSDeveloperSDK) + set(_REG_KEY "[${ROOT}\\Software\\Auckland Bioengineering Institute\\${PACKAGE}]") + get_filename_component(OPENCMISS_INSTALL_DIR "${_REG_KEY}" ABSOLUTE) + #message(STATUS "Trying registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Found ${PACKAGE} in Windows registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + break() + else() + unset(OPENCMISS_INSTALL_DIR) + endif() + endforeach() + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + break() + endif() + endforeach() +endif() + +if(OPENCMISS_INSTALL_DIR) + message(STATUS "OPENCMISS_INSTALL_DIR=${OPENCMISS_INSTALL_DIR}") + # Use the OpenCMISS scripts to also allow choosing a separate toolchain + # This file is located at the opencmiss installation rather than the local example + # as it avoids file replication and makes maintenance much easier + if (TOOLCHAIN) + set(_OCTC ${OPENCMISS_INSTALL_DIR}/cmake/OCToolchainCompilers.cmake) + if (EXISTS "${_OCTC}") + include(${_OCTC}) + else() + message(WARNING "TOOLCHAIN specified but OpenCMISS config script could not be found at ${_OCTC}. Trying CMake defaults.") + endif() + unset(_OCTC) + endif() + set(OpenCMISS_DIR "${OPENCMISS_INSTALL_DIR}" CACHE PATH "Path to the found OpenCMISS (SDK) installation") +else() + message(WARNING "No OpenCMISS (SDK) installation directory detected. Using default system environment.") +endif() + \ No newline at end of file diff --git a/ClassicalField/Laplace/Embedded2DLaplace/build_debug/build.sh b/ClassicalField/Laplace/Embedded2DLaplace/build_debug/build.sh new file mode 100644 index 00000000..e6624bac --- /dev/null +++ b/ClassicalField/Laplace/Embedded2DLaplace/build_debug/build.sh @@ -0,0 +1,2 @@ +#ccc && cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all +cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all diff --git a/ClassicalField/Laplace/GeneralisedLaplace/CMakeLists.txt b/ClassicalField/Laplace/GeneralisedLaplace/CMakeLists.txt new file mode 100644 index 00000000..a22b61ee --- /dev/null +++ b/ClassicalField/Laplace/GeneralisedLaplace/CMakeLists.txt @@ -0,0 +1,35 @@ +# 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 C) +enable_language(Fortran OPTIONAL) +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 +# ---------------------- +#add_subdirectory(C) +if (CMAKE_Fortran_COMPILER) + add_subdirectory(Fortran) +endif() diff --git a/ClassicalField/Laplace/GeneralisedLaplace/Fortran/CMakeLists.txt b/ClassicalField/Laplace/GeneralisedLaplace/Fortran/CMakeLists.txt new file mode 100644 index 00000000..5ba57d29 --- /dev/null +++ b/ClassicalField/Laplace/GeneralisedLaplace/Fortran/CMakeLists.txt @@ -0,0 +1,60 @@ + +# Add example executable +add_executable(GeneralisedLaplace src/FortranExample.f90 src/FortranExample_2D_testproblem.f90 src/FortranExample_3D_tests.f90 src/FortranExample_3D_testproblem.f90) + +# Turn on Fortran preprocessing (#include directives) +if (MSVC) + set(PROC_OPT "/fpp") +else() + set(PROC_OPT "-cpp") +endif() + +# in debug mode, add flag that make Floating point exceptions fatal +set(OPT "") +if (FALSE) + if(CMAKE_BUILD_TYPE MATCHES DEBUG) + set(OPT "-ffpe-trap=invalid,zero,underflow,overflow,denormal") # GCC: make floating point exceptions fatal + endif() +endif() + +target_compile_options(GeneralisedLaplace PRIVATE ${PROC_OPT} ${OPT} "-fbacktrace") + +# Link to opencmiss +# ----------------- +# +# This simply uses the opencmiss target created by OC_INIT() above. +# +# Alternatively, you can also directly invoke 'find_package(Iron )' 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 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(GeneralisedLaplace PRIVATE opencmiss) + +# Add a simple test that runs the executable +add_test(NAME test_GeneralisedLaplace COMMAND GeneralisedLaplace) +add_opencmiss_environment(test_GeneralisedLaplace) + +################### +# 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. +# diff --git a/ClassicalField/Laplace/GeneralisedLaplace/OpenCMISS.cmake b/ClassicalField/Laplace/GeneralisedLaplace/OpenCMISS.cmake new file mode 100644 index 00000000..3d6cf515 --- /dev/null +++ b/ClassicalField/Laplace/GeneralisedLaplace/OpenCMISS.cmake @@ -0,0 +1,95 @@ +########################### +# *DO NOT CHANGE THIS FILE* +########################### +# +# Prepares the use of OpenCMISS by scanning at various path locations for OpenCMISS (SDK) installations. +# +# Search order: +# - OPENCMISS_INSTALL_DIR variable +# - OPENCMISS_INSTALL_DIR environment variable +# - OPENCMISS_SDK_DIR variable +# - OPENCMISS_SDK_DIR environment variable +# - [Windows only] The Registry is searched additionally for installed SDKs. +# +# If found +# - Includes the toolchain config script of the found opencmiss installation to enable toolchain selection logic (non-windows) + +# Convenience: The OPENCMISS_INSTALL_DIR may also be defined in the environment and various other places +if (DEFINED OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using specified installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The specified OPENCMISS_INSTALL_DIR '${OPENCMISS_INSTALL_DIR}' does not exist. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_INSTALL_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_INSTALL_DIR}" OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using environment installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The environment variable OPENCMISS_INSTALL_DIR='${OPENCMISS_INSTALL_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if (NOT OPENCMISS_INSTALL_DIR AND DEFINED OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The specified OPENCMISS_SDK_DIR '${OPENCMISS_SDK_DIR}' does not exist. Skipping.") + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_SDK_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_SDK_DIR}" OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using environment SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The environment variable OPENCMISS_SDK_DIR='${OPENCMISS_SDK_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_SDK_DIR) + endif() +endif() +# On windows: check the registry for installed OpenCMISS SDKs +if(NOT OPENCMISS_INSTALL_DIR AND WIN32) + foreach(ROOT HKEY_CURRENT_USER HKEY_LOCAL_MACHINE) + foreach(PACKAGE OpenCMISSUserSDK OpenCMISSDeveloperSDK) + set(_REG_KEY "[${ROOT}\\Software\\Auckland Bioengineering Institute\\${PACKAGE}]") + get_filename_component(OPENCMISS_INSTALL_DIR "${_REG_KEY}" ABSOLUTE) + #message(STATUS "Trying registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Found ${PACKAGE} in Windows registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + break() + else() + unset(OPENCMISS_INSTALL_DIR) + endif() + endforeach() + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + break() + endif() + endforeach() +endif() + +if(OPENCMISS_INSTALL_DIR) + message(STATUS "OPENCMISS_INSTALL_DIR=${OPENCMISS_INSTALL_DIR}") + # Use the OpenCMISS scripts to also allow choosing a separate toolchain + # This file is located at the opencmiss installation rather than the local example + # as it avoids file replication and makes maintenance much easier + if (TOOLCHAIN) + set(_OCTC ${OPENCMISS_INSTALL_DIR}/cmake/OCToolchainCompilers.cmake) + if (EXISTS "${_OCTC}") + include(${_OCTC}) + else() + message(WARNING "TOOLCHAIN specified but OpenCMISS config script could not be found at ${_OCTC}. Trying CMake defaults.") + endif() + unset(_OCTC) + endif() + set(OpenCMISS_DIR "${OPENCMISS_INSTALL_DIR}" CACHE PATH "Path to the found OpenCMISS (SDK) installation") +else() + message(WARNING "No OpenCMISS (SDK) installation directory detected. Using default system environment.") +endif() + \ No newline at end of file diff --git a/ClassicalField/Laplace/GeneralisedLaplace/build_debug/build.sh b/ClassicalField/Laplace/GeneralisedLaplace/build_debug/build.sh new file mode 100644 index 00000000..e6624bac --- /dev/null +++ b/ClassicalField/Laplace/GeneralisedLaplace/build_debug/build.sh @@ -0,0 +1,2 @@ +#ccc && cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all +cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all diff --git a/ClassicalField/Laplace/Laplace/C/CMakeLists.txt b/ClassicalField/Laplace/Laplace/C/CMakeLists.txt new file mode 100644 index 00000000..a22b61ee --- /dev/null +++ b/ClassicalField/Laplace/Laplace/C/CMakeLists.txt @@ -0,0 +1,35 @@ +# 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 C) +enable_language(Fortran OPTIONAL) +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 +# ---------------------- +#add_subdirectory(C) +if (CMAKE_Fortran_COMPILER) + add_subdirectory(Fortran) +endif() diff --git a/ClassicalField/Laplace/Laplace/C/Fortran/CMakeLists.txt b/ClassicalField/Laplace/Laplace/C/Fortran/CMakeLists.txt new file mode 100644 index 00000000..e36192d0 --- /dev/null +++ b/ClassicalField/Laplace/Laplace/C/Fortran/CMakeLists.txt @@ -0,0 +1,60 @@ + +# Add example executable +add_executable(C src/CExample.c) + +# Turn on Fortran preprocessing (#include directives) +if (MSVC) + set(PROC_OPT "/fpp") +else() + set(PROC_OPT "-cpp") +endif() + +# in debug mode, add flag that make Floating point exceptions fatal +set(OPT "") +if (FALSE) + if(CMAKE_BUILD_TYPE MATCHES DEBUG) + set(OPT "-ffpe-trap=invalid,zero,underflow,overflow,denormal") # GCC: make floating point exceptions fatal + endif() +endif() + +target_compile_options(C PRIVATE ${PROC_OPT} ${OPT} "-fbacktrace") + +# Link to opencmiss +# ----------------- +# +# This simply uses the opencmiss target created by OC_INIT() above. +# +# Alternatively, you can also directly invoke 'find_package(Iron )' 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 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(C PRIVATE opencmiss) + +# Add a simple test that runs the executable +add_test(NAME test_C COMMAND C) +add_opencmiss_environment(test_C) + +################### +# 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. +# diff --git a/ClassicalField/Laplace/Laplace/C/src/CExample.c b/ClassicalField/Laplace/Laplace/C/Fortran/src/CExample.c similarity index 100% rename from ClassicalField/Laplace/Laplace/C/src/CExample.c rename to ClassicalField/Laplace/Laplace/C/Fortran/src/CExample.c diff --git a/ClassicalField/Laplace/Laplace/C/OpenCMISS.cmake b/ClassicalField/Laplace/Laplace/C/OpenCMISS.cmake new file mode 100644 index 00000000..3d6cf515 --- /dev/null +++ b/ClassicalField/Laplace/Laplace/C/OpenCMISS.cmake @@ -0,0 +1,95 @@ +########################### +# *DO NOT CHANGE THIS FILE* +########################### +# +# Prepares the use of OpenCMISS by scanning at various path locations for OpenCMISS (SDK) installations. +# +# Search order: +# - OPENCMISS_INSTALL_DIR variable +# - OPENCMISS_INSTALL_DIR environment variable +# - OPENCMISS_SDK_DIR variable +# - OPENCMISS_SDK_DIR environment variable +# - [Windows only] The Registry is searched additionally for installed SDKs. +# +# If found +# - Includes the toolchain config script of the found opencmiss installation to enable toolchain selection logic (non-windows) + +# Convenience: The OPENCMISS_INSTALL_DIR may also be defined in the environment and various other places +if (DEFINED OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using specified installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The specified OPENCMISS_INSTALL_DIR '${OPENCMISS_INSTALL_DIR}' does not exist. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_INSTALL_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_INSTALL_DIR}" OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using environment installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The environment variable OPENCMISS_INSTALL_DIR='${OPENCMISS_INSTALL_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if (NOT OPENCMISS_INSTALL_DIR AND DEFINED OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The specified OPENCMISS_SDK_DIR '${OPENCMISS_SDK_DIR}' does not exist. Skipping.") + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_SDK_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_SDK_DIR}" OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using environment SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The environment variable OPENCMISS_SDK_DIR='${OPENCMISS_SDK_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_SDK_DIR) + endif() +endif() +# On windows: check the registry for installed OpenCMISS SDKs +if(NOT OPENCMISS_INSTALL_DIR AND WIN32) + foreach(ROOT HKEY_CURRENT_USER HKEY_LOCAL_MACHINE) + foreach(PACKAGE OpenCMISSUserSDK OpenCMISSDeveloperSDK) + set(_REG_KEY "[${ROOT}\\Software\\Auckland Bioengineering Institute\\${PACKAGE}]") + get_filename_component(OPENCMISS_INSTALL_DIR "${_REG_KEY}" ABSOLUTE) + #message(STATUS "Trying registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Found ${PACKAGE} in Windows registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + break() + else() + unset(OPENCMISS_INSTALL_DIR) + endif() + endforeach() + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + break() + endif() + endforeach() +endif() + +if(OPENCMISS_INSTALL_DIR) + message(STATUS "OPENCMISS_INSTALL_DIR=${OPENCMISS_INSTALL_DIR}") + # Use the OpenCMISS scripts to also allow choosing a separate toolchain + # This file is located at the opencmiss installation rather than the local example + # as it avoids file replication and makes maintenance much easier + if (TOOLCHAIN) + set(_OCTC ${OPENCMISS_INSTALL_DIR}/cmake/OCToolchainCompilers.cmake) + if (EXISTS "${_OCTC}") + include(${_OCTC}) + else() + message(WARNING "TOOLCHAIN specified but OpenCMISS config script could not be found at ${_OCTC}. Trying CMake defaults.") + endif() + unset(_OCTC) + endif() + set(OpenCMISS_DIR "${OPENCMISS_INSTALL_DIR}" CACHE PATH "Path to the found OpenCMISS (SDK) installation") +else() + message(WARNING "No OpenCMISS (SDK) installation directory detected. Using default system environment.") +endif() + \ No newline at end of file diff --git a/ClassicalField/Laplace/Laplace/C/build_debug/build.sh b/ClassicalField/Laplace/Laplace/C/build_debug/build.sh new file mode 100644 index 00000000..e6624bac --- /dev/null +++ b/ClassicalField/Laplace/Laplace/C/build_debug/build.sh @@ -0,0 +1,2 @@ +#ccc && cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all +cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all diff --git a/ClassicalField/Laplace/Laplace/CMakeLists.txt b/ClassicalField/Laplace/Laplace/CMakeLists.txt new file mode 100644 index 00000000..a22b61ee --- /dev/null +++ b/ClassicalField/Laplace/Laplace/CMakeLists.txt @@ -0,0 +1,35 @@ +# 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 C) +enable_language(Fortran OPTIONAL) +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 +# ---------------------- +#add_subdirectory(C) +if (CMAKE_Fortran_COMPILER) + add_subdirectory(Fortran) +endif() diff --git a/ClassicalField/Laplace/Laplace/Fortran/CMakeLists.txt b/ClassicalField/Laplace/Laplace/Fortran/CMakeLists.txt new file mode 100644 index 00000000..cae95104 --- /dev/null +++ b/ClassicalField/Laplace/Laplace/Fortran/CMakeLists.txt @@ -0,0 +1,60 @@ + +# Add example executable +add_executable(Laplace src/FortranExample.f90) + +# Turn on Fortran preprocessing (#include directives) +if (MSVC) + set(PROC_OPT "/fpp") +else() + set(PROC_OPT "-cpp") +endif() + +# in debug mode, add flag that make Floating point exceptions fatal +set(OPT "") +if (FALSE) + if(CMAKE_BUILD_TYPE MATCHES DEBUG) + set(OPT "-ffpe-trap=invalid,zero,underflow,overflow,denormal") # GCC: make floating point exceptions fatal + endif() +endif() + +target_compile_options(Laplace PRIVATE ${PROC_OPT} ${OPT} "-fbacktrace") + +# Link to opencmiss +# ----------------- +# +# This simply uses the opencmiss target created by OC_INIT() above. +# +# Alternatively, you can also directly invoke 'find_package(Iron )' 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 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(Laplace PRIVATE opencmiss) + +# Add a simple test that runs the executable +add_test(NAME test_Laplace COMMAND Laplace) +add_opencmiss_environment(test_Laplace) + +################### +# 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. +# diff --git a/ClassicalField/Laplace/Laplace/OpenCMISS.cmake b/ClassicalField/Laplace/Laplace/OpenCMISS.cmake new file mode 100644 index 00000000..3d6cf515 --- /dev/null +++ b/ClassicalField/Laplace/Laplace/OpenCMISS.cmake @@ -0,0 +1,95 @@ +########################### +# *DO NOT CHANGE THIS FILE* +########################### +# +# Prepares the use of OpenCMISS by scanning at various path locations for OpenCMISS (SDK) installations. +# +# Search order: +# - OPENCMISS_INSTALL_DIR variable +# - OPENCMISS_INSTALL_DIR environment variable +# - OPENCMISS_SDK_DIR variable +# - OPENCMISS_SDK_DIR environment variable +# - [Windows only] The Registry is searched additionally for installed SDKs. +# +# If found +# - Includes the toolchain config script of the found opencmiss installation to enable toolchain selection logic (non-windows) + +# Convenience: The OPENCMISS_INSTALL_DIR may also be defined in the environment and various other places +if (DEFINED OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using specified installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The specified OPENCMISS_INSTALL_DIR '${OPENCMISS_INSTALL_DIR}' does not exist. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_INSTALL_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_INSTALL_DIR}" OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using environment installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The environment variable OPENCMISS_INSTALL_DIR='${OPENCMISS_INSTALL_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if (NOT OPENCMISS_INSTALL_DIR AND DEFINED OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The specified OPENCMISS_SDK_DIR '${OPENCMISS_SDK_DIR}' does not exist. Skipping.") + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_SDK_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_SDK_DIR}" OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using environment SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The environment variable OPENCMISS_SDK_DIR='${OPENCMISS_SDK_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_SDK_DIR) + endif() +endif() +# On windows: check the registry for installed OpenCMISS SDKs +if(NOT OPENCMISS_INSTALL_DIR AND WIN32) + foreach(ROOT HKEY_CURRENT_USER HKEY_LOCAL_MACHINE) + foreach(PACKAGE OpenCMISSUserSDK OpenCMISSDeveloperSDK) + set(_REG_KEY "[${ROOT}\\Software\\Auckland Bioengineering Institute\\${PACKAGE}]") + get_filename_component(OPENCMISS_INSTALL_DIR "${_REG_KEY}" ABSOLUTE) + #message(STATUS "Trying registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Found ${PACKAGE} in Windows registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + break() + else() + unset(OPENCMISS_INSTALL_DIR) + endif() + endforeach() + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + break() + endif() + endforeach() +endif() + +if(OPENCMISS_INSTALL_DIR) + message(STATUS "OPENCMISS_INSTALL_DIR=${OPENCMISS_INSTALL_DIR}") + # Use the OpenCMISS scripts to also allow choosing a separate toolchain + # This file is located at the opencmiss installation rather than the local example + # as it avoids file replication and makes maintenance much easier + if (TOOLCHAIN) + set(_OCTC ${OPENCMISS_INSTALL_DIR}/cmake/OCToolchainCompilers.cmake) + if (EXISTS "${_OCTC}") + include(${_OCTC}) + else() + message(WARNING "TOOLCHAIN specified but OpenCMISS config script could not be found at ${_OCTC}. Trying CMake defaults.") + endif() + unset(_OCTC) + endif() + set(OpenCMISS_DIR "${OPENCMISS_INSTALL_DIR}" CACHE PATH "Path to the found OpenCMISS (SDK) installation") +else() + message(WARNING "No OpenCMISS (SDK) installation directory detected. Using default system environment.") +endif() + \ No newline at end of file diff --git a/ClassicalField/Laplace/Laplace/build_debug/build.sh b/ClassicalField/Laplace/Laplace/build_debug/build.sh new file mode 100644 index 00000000..e6624bac --- /dev/null +++ b/ClassicalField/Laplace/Laplace/build_debug/build.sh @@ -0,0 +1,2 @@ +#ccc && cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all +cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all diff --git a/ClassicalField/Laplace/LaplaceEllipsoid/CMakeLists.txt b/ClassicalField/Laplace/LaplaceEllipsoid/CMakeLists.txt new file mode 100644 index 00000000..a22b61ee --- /dev/null +++ b/ClassicalField/Laplace/LaplaceEllipsoid/CMakeLists.txt @@ -0,0 +1,35 @@ +# 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 C) +enable_language(Fortran OPTIONAL) +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 +# ---------------------- +#add_subdirectory(C) +if (CMAKE_Fortran_COMPILER) + add_subdirectory(Fortran) +endif() diff --git a/ClassicalField/Laplace/LaplaceEllipsoid/Fortran/CMakeLists.txt b/ClassicalField/Laplace/LaplaceEllipsoid/Fortran/CMakeLists.txt new file mode 100644 index 00000000..cc09bf94 --- /dev/null +++ b/ClassicalField/Laplace/LaplaceEllipsoid/Fortran/CMakeLists.txt @@ -0,0 +1,60 @@ + +# Add example executable +add_executable(LaplaceEllipsoid src/LaplaceEllipsoidExample.f90) + +# Turn on Fortran preprocessing (#include directives) +if (MSVC) + set(PROC_OPT "/fpp") +else() + set(PROC_OPT "-cpp") +endif() + +# in debug mode, add flag that make Floating point exceptions fatal +set(OPT "") +if (FALSE) + if(CMAKE_BUILD_TYPE MATCHES DEBUG) + set(OPT "-ffpe-trap=invalid,zero,underflow,overflow,denormal") # GCC: make floating point exceptions fatal + endif() +endif() + +target_compile_options(LaplaceEllipsoid PRIVATE ${PROC_OPT} ${OPT} "-fbacktrace") + +# Link to opencmiss +# ----------------- +# +# This simply uses the opencmiss target created by OC_INIT() above. +# +# Alternatively, you can also directly invoke 'find_package(Iron )' 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 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(LaplaceEllipsoid PRIVATE opencmiss) + +# Add a simple test that runs the executable +add_test(NAME test_LaplaceEllipsoid COMMAND LaplaceEllipsoid) +add_opencmiss_environment(test_LaplaceEllipsoid) + +################### +# 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. +# diff --git a/ClassicalField/Laplace/LaplaceEllipsoid/src/LaplaceEllipsoidExample.f90 b/ClassicalField/Laplace/LaplaceEllipsoid/Fortran/src/LaplaceEllipsoidExample.f90 similarity index 100% rename from ClassicalField/Laplace/LaplaceEllipsoid/src/LaplaceEllipsoidExample.f90 rename to ClassicalField/Laplace/LaplaceEllipsoid/Fortran/src/LaplaceEllipsoidExample.f90 diff --git a/ClassicalField/Laplace/LaplaceEllipsoid/OpenCMISS.cmake b/ClassicalField/Laplace/LaplaceEllipsoid/OpenCMISS.cmake new file mode 100644 index 00000000..3d6cf515 --- /dev/null +++ b/ClassicalField/Laplace/LaplaceEllipsoid/OpenCMISS.cmake @@ -0,0 +1,95 @@ +########################### +# *DO NOT CHANGE THIS FILE* +########################### +# +# Prepares the use of OpenCMISS by scanning at various path locations for OpenCMISS (SDK) installations. +# +# Search order: +# - OPENCMISS_INSTALL_DIR variable +# - OPENCMISS_INSTALL_DIR environment variable +# - OPENCMISS_SDK_DIR variable +# - OPENCMISS_SDK_DIR environment variable +# - [Windows only] The Registry is searched additionally for installed SDKs. +# +# If found +# - Includes the toolchain config script of the found opencmiss installation to enable toolchain selection logic (non-windows) + +# Convenience: The OPENCMISS_INSTALL_DIR may also be defined in the environment and various other places +if (DEFINED OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using specified installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The specified OPENCMISS_INSTALL_DIR '${OPENCMISS_INSTALL_DIR}' does not exist. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_INSTALL_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_INSTALL_DIR}" OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using environment installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The environment variable OPENCMISS_INSTALL_DIR='${OPENCMISS_INSTALL_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if (NOT OPENCMISS_INSTALL_DIR AND DEFINED OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The specified OPENCMISS_SDK_DIR '${OPENCMISS_SDK_DIR}' does not exist. Skipping.") + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_SDK_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_SDK_DIR}" OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using environment SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The environment variable OPENCMISS_SDK_DIR='${OPENCMISS_SDK_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_SDK_DIR) + endif() +endif() +# On windows: check the registry for installed OpenCMISS SDKs +if(NOT OPENCMISS_INSTALL_DIR AND WIN32) + foreach(ROOT HKEY_CURRENT_USER HKEY_LOCAL_MACHINE) + foreach(PACKAGE OpenCMISSUserSDK OpenCMISSDeveloperSDK) + set(_REG_KEY "[${ROOT}\\Software\\Auckland Bioengineering Institute\\${PACKAGE}]") + get_filename_component(OPENCMISS_INSTALL_DIR "${_REG_KEY}" ABSOLUTE) + #message(STATUS "Trying registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Found ${PACKAGE} in Windows registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + break() + else() + unset(OPENCMISS_INSTALL_DIR) + endif() + endforeach() + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + break() + endif() + endforeach() +endif() + +if(OPENCMISS_INSTALL_DIR) + message(STATUS "OPENCMISS_INSTALL_DIR=${OPENCMISS_INSTALL_DIR}") + # Use the OpenCMISS scripts to also allow choosing a separate toolchain + # This file is located at the opencmiss installation rather than the local example + # as it avoids file replication and makes maintenance much easier + if (TOOLCHAIN) + set(_OCTC ${OPENCMISS_INSTALL_DIR}/cmake/OCToolchainCompilers.cmake) + if (EXISTS "${_OCTC}") + include(${_OCTC}) + else() + message(WARNING "TOOLCHAIN specified but OpenCMISS config script could not be found at ${_OCTC}. Trying CMake defaults.") + endif() + unset(_OCTC) + endif() + set(OpenCMISS_DIR "${OPENCMISS_INSTALL_DIR}" CACHE PATH "Path to the found OpenCMISS (SDK) installation") +else() + message(WARNING "No OpenCMISS (SDK) installation directory detected. Using default system environment.") +endif() + \ No newline at end of file diff --git a/ClassicalField/Laplace/LaplaceEllipsoid/build_debug/build.sh b/ClassicalField/Laplace/LaplaceEllipsoid/build_debug/build.sh new file mode 100644 index 00000000..e6624bac --- /dev/null +++ b/ClassicalField/Laplace/LaplaceEllipsoid/build_debug/build.sh @@ -0,0 +1,2 @@ +#ccc && cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all +cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all diff --git a/ClassicalField/Laplace/LaplaceEllipsoid_FieldML/CMakeLists.txt b/ClassicalField/Laplace/LaplaceEllipsoid_FieldML/CMakeLists.txt new file mode 100644 index 00000000..a22b61ee --- /dev/null +++ b/ClassicalField/Laplace/LaplaceEllipsoid_FieldML/CMakeLists.txt @@ -0,0 +1,35 @@ +# 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 C) +enable_language(Fortran OPTIONAL) +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 +# ---------------------- +#add_subdirectory(C) +if (CMAKE_Fortran_COMPILER) + add_subdirectory(Fortran) +endif() diff --git a/ClassicalField/Laplace/LaplaceEllipsoid_FieldML/Fortran/CMakeLists.txt b/ClassicalField/Laplace/LaplaceEllipsoid_FieldML/Fortran/CMakeLists.txt new file mode 100644 index 00000000..767b1883 --- /dev/null +++ b/ClassicalField/Laplace/LaplaceEllipsoid_FieldML/Fortran/CMakeLists.txt @@ -0,0 +1,60 @@ + +# Add example executable +add_executable(LaplaceEllipsoid_FieldML src/LaplaceEllipsoid_FieldMLExample.f90) + +# Turn on Fortran preprocessing (#include directives) +if (MSVC) + set(PROC_OPT "/fpp") +else() + set(PROC_OPT "-cpp") +endif() + +# in debug mode, add flag that make Floating point exceptions fatal +set(OPT "") +if (FALSE) + if(CMAKE_BUILD_TYPE MATCHES DEBUG) + set(OPT "-ffpe-trap=invalid,zero,underflow,overflow,denormal") # GCC: make floating point exceptions fatal + endif() +endif() + +target_compile_options(LaplaceEllipsoid_FieldML PRIVATE ${PROC_OPT} ${OPT} "-fbacktrace") + +# Link to opencmiss +# ----------------- +# +# This simply uses the opencmiss target created by OC_INIT() above. +# +# Alternatively, you can also directly invoke 'find_package(Iron )' 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 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(LaplaceEllipsoid_FieldML PRIVATE opencmiss) + +# Add a simple test that runs the executable +add_test(NAME test_LaplaceEllipsoid_FieldML COMMAND LaplaceEllipsoid_FieldML) +add_opencmiss_environment(test_LaplaceEllipsoid_FieldML) + +################### +# 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. +# diff --git a/ClassicalField/Laplace/LaplaceEllipsoid_FieldML/src/LaplaceEllipsoid_FieldMLExample.f90 b/ClassicalField/Laplace/LaplaceEllipsoid_FieldML/Fortran/src/LaplaceEllipsoid_FieldMLExample.f90 similarity index 100% rename from ClassicalField/Laplace/LaplaceEllipsoid_FieldML/src/LaplaceEllipsoid_FieldMLExample.f90 rename to ClassicalField/Laplace/LaplaceEllipsoid_FieldML/Fortran/src/LaplaceEllipsoid_FieldMLExample.f90 diff --git a/ClassicalField/Laplace/LaplaceEllipsoid_FieldML/OpenCMISS.cmake b/ClassicalField/Laplace/LaplaceEllipsoid_FieldML/OpenCMISS.cmake new file mode 100644 index 00000000..3d6cf515 --- /dev/null +++ b/ClassicalField/Laplace/LaplaceEllipsoid_FieldML/OpenCMISS.cmake @@ -0,0 +1,95 @@ +########################### +# *DO NOT CHANGE THIS FILE* +########################### +# +# Prepares the use of OpenCMISS by scanning at various path locations for OpenCMISS (SDK) installations. +# +# Search order: +# - OPENCMISS_INSTALL_DIR variable +# - OPENCMISS_INSTALL_DIR environment variable +# - OPENCMISS_SDK_DIR variable +# - OPENCMISS_SDK_DIR environment variable +# - [Windows only] The Registry is searched additionally for installed SDKs. +# +# If found +# - Includes the toolchain config script of the found opencmiss installation to enable toolchain selection logic (non-windows) + +# Convenience: The OPENCMISS_INSTALL_DIR may also be defined in the environment and various other places +if (DEFINED OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using specified installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The specified OPENCMISS_INSTALL_DIR '${OPENCMISS_INSTALL_DIR}' does not exist. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_INSTALL_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_INSTALL_DIR}" OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using environment installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The environment variable OPENCMISS_INSTALL_DIR='${OPENCMISS_INSTALL_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if (NOT OPENCMISS_INSTALL_DIR AND DEFINED OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The specified OPENCMISS_SDK_DIR '${OPENCMISS_SDK_DIR}' does not exist. Skipping.") + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_SDK_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_SDK_DIR}" OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using environment SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The environment variable OPENCMISS_SDK_DIR='${OPENCMISS_SDK_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_SDK_DIR) + endif() +endif() +# On windows: check the registry for installed OpenCMISS SDKs +if(NOT OPENCMISS_INSTALL_DIR AND WIN32) + foreach(ROOT HKEY_CURRENT_USER HKEY_LOCAL_MACHINE) + foreach(PACKAGE OpenCMISSUserSDK OpenCMISSDeveloperSDK) + set(_REG_KEY "[${ROOT}\\Software\\Auckland Bioengineering Institute\\${PACKAGE}]") + get_filename_component(OPENCMISS_INSTALL_DIR "${_REG_KEY}" ABSOLUTE) + #message(STATUS "Trying registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Found ${PACKAGE} in Windows registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + break() + else() + unset(OPENCMISS_INSTALL_DIR) + endif() + endforeach() + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + break() + endif() + endforeach() +endif() + +if(OPENCMISS_INSTALL_DIR) + message(STATUS "OPENCMISS_INSTALL_DIR=${OPENCMISS_INSTALL_DIR}") + # Use the OpenCMISS scripts to also allow choosing a separate toolchain + # This file is located at the opencmiss installation rather than the local example + # as it avoids file replication and makes maintenance much easier + if (TOOLCHAIN) + set(_OCTC ${OPENCMISS_INSTALL_DIR}/cmake/OCToolchainCompilers.cmake) + if (EXISTS "${_OCTC}") + include(${_OCTC}) + else() + message(WARNING "TOOLCHAIN specified but OpenCMISS config script could not be found at ${_OCTC}. Trying CMake defaults.") + endif() + unset(_OCTC) + endif() + set(OpenCMISS_DIR "${OPENCMISS_INSTALL_DIR}" CACHE PATH "Path to the found OpenCMISS (SDK) installation") +else() + message(WARNING "No OpenCMISS (SDK) installation directory detected. Using default system environment.") +endif() + \ No newline at end of file diff --git a/ClassicalField/Laplace/LaplaceEllipsoid_FieldML/build_debug/build.sh b/ClassicalField/Laplace/LaplaceEllipsoid_FieldML/build_debug/build.sh new file mode 100644 index 00000000..e6624bac --- /dev/null +++ b/ClassicalField/Laplace/LaplaceEllipsoid_FieldML/build_debug/build.sh @@ -0,0 +1,2 @@ +#ccc && cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all +cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all diff --git a/ClassicalField/Laplace/NumberLaplace/CMakeLists.txt b/ClassicalField/Laplace/NumberLaplace/CMakeLists.txt new file mode 100644 index 00000000..a22b61ee --- /dev/null +++ b/ClassicalField/Laplace/NumberLaplace/CMakeLists.txt @@ -0,0 +1,35 @@ +# 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 C) +enable_language(Fortran OPTIONAL) +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 +# ---------------------- +#add_subdirectory(C) +if (CMAKE_Fortran_COMPILER) + add_subdirectory(Fortran) +endif() diff --git a/ClassicalField/Laplace/NumberLaplace/Fortran/CMakeLists.txt b/ClassicalField/Laplace/NumberLaplace/Fortran/CMakeLists.txt new file mode 100644 index 00000000..863f79f4 --- /dev/null +++ b/ClassicalField/Laplace/NumberLaplace/Fortran/CMakeLists.txt @@ -0,0 +1,60 @@ + +# Add example executable +add_executable(NumberLaplace src/NumberLaplaceExample.f90) + +# Turn on Fortran preprocessing (#include directives) +if (MSVC) + set(PROC_OPT "/fpp") +else() + set(PROC_OPT "-cpp") +endif() + +# in debug mode, add flag that make Floating point exceptions fatal +set(OPT "") +if (FALSE) + if(CMAKE_BUILD_TYPE MATCHES DEBUG) + set(OPT "-ffpe-trap=invalid,zero,underflow,overflow,denormal") # GCC: make floating point exceptions fatal + endif() +endif() + +target_compile_options(NumberLaplace PRIVATE ${PROC_OPT} ${OPT} "-fbacktrace") + +# Link to opencmiss +# ----------------- +# +# This simply uses the opencmiss target created by OC_INIT() above. +# +# Alternatively, you can also directly invoke 'find_package(Iron )' 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 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(NumberLaplace PRIVATE opencmiss) + +# Add a simple test that runs the executable +add_test(NAME test_NumberLaplace COMMAND NumberLaplace) +add_opencmiss_environment(test_NumberLaplace) + +################### +# 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. +# diff --git a/ClassicalField/Laplace/NumberLaplace/src/NumberLaplaceExample.f90 b/ClassicalField/Laplace/NumberLaplace/Fortran/src/NumberLaplaceExample.f90 similarity index 100% rename from ClassicalField/Laplace/NumberLaplace/src/NumberLaplaceExample.f90 rename to ClassicalField/Laplace/NumberLaplace/Fortran/src/NumberLaplaceExample.f90 diff --git a/ClassicalField/Laplace/NumberLaplace/OpenCMISS.cmake b/ClassicalField/Laplace/NumberLaplace/OpenCMISS.cmake new file mode 100644 index 00000000..3d6cf515 --- /dev/null +++ b/ClassicalField/Laplace/NumberLaplace/OpenCMISS.cmake @@ -0,0 +1,95 @@ +########################### +# *DO NOT CHANGE THIS FILE* +########################### +# +# Prepares the use of OpenCMISS by scanning at various path locations for OpenCMISS (SDK) installations. +# +# Search order: +# - OPENCMISS_INSTALL_DIR variable +# - OPENCMISS_INSTALL_DIR environment variable +# - OPENCMISS_SDK_DIR variable +# - OPENCMISS_SDK_DIR environment variable +# - [Windows only] The Registry is searched additionally for installed SDKs. +# +# If found +# - Includes the toolchain config script of the found opencmiss installation to enable toolchain selection logic (non-windows) + +# Convenience: The OPENCMISS_INSTALL_DIR may also be defined in the environment and various other places +if (DEFINED OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using specified installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The specified OPENCMISS_INSTALL_DIR '${OPENCMISS_INSTALL_DIR}' does not exist. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_INSTALL_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_INSTALL_DIR}" OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using environment installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The environment variable OPENCMISS_INSTALL_DIR='${OPENCMISS_INSTALL_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if (NOT OPENCMISS_INSTALL_DIR AND DEFINED OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The specified OPENCMISS_SDK_DIR '${OPENCMISS_SDK_DIR}' does not exist. Skipping.") + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_SDK_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_SDK_DIR}" OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using environment SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The environment variable OPENCMISS_SDK_DIR='${OPENCMISS_SDK_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_SDK_DIR) + endif() +endif() +# On windows: check the registry for installed OpenCMISS SDKs +if(NOT OPENCMISS_INSTALL_DIR AND WIN32) + foreach(ROOT HKEY_CURRENT_USER HKEY_LOCAL_MACHINE) + foreach(PACKAGE OpenCMISSUserSDK OpenCMISSDeveloperSDK) + set(_REG_KEY "[${ROOT}\\Software\\Auckland Bioengineering Institute\\${PACKAGE}]") + get_filename_component(OPENCMISS_INSTALL_DIR "${_REG_KEY}" ABSOLUTE) + #message(STATUS "Trying registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Found ${PACKAGE} in Windows registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + break() + else() + unset(OPENCMISS_INSTALL_DIR) + endif() + endforeach() + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + break() + endif() + endforeach() +endif() + +if(OPENCMISS_INSTALL_DIR) + message(STATUS "OPENCMISS_INSTALL_DIR=${OPENCMISS_INSTALL_DIR}") + # Use the OpenCMISS scripts to also allow choosing a separate toolchain + # This file is located at the opencmiss installation rather than the local example + # as it avoids file replication and makes maintenance much easier + if (TOOLCHAIN) + set(_OCTC ${OPENCMISS_INSTALL_DIR}/cmake/OCToolchainCompilers.cmake) + if (EXISTS "${_OCTC}") + include(${_OCTC}) + else() + message(WARNING "TOOLCHAIN specified but OpenCMISS config script could not be found at ${_OCTC}. Trying CMake defaults.") + endif() + unset(_OCTC) + endif() + set(OpenCMISS_DIR "${OPENCMISS_INSTALL_DIR}" CACHE PATH "Path to the found OpenCMISS (SDK) installation") +else() + message(WARNING "No OpenCMISS (SDK) installation directory detected. Using default system environment.") +endif() + \ No newline at end of file diff --git a/ClassicalField/Laplace/NumberLaplace/build_debug/build.sh b/ClassicalField/Laplace/NumberLaplace/build_debug/build.sh new file mode 100644 index 00000000..e6624bac --- /dev/null +++ b/ClassicalField/Laplace/NumberLaplace/build_debug/build.sh @@ -0,0 +1,2 @@ +#ccc && cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all +cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all diff --git a/ClassicalField/Laplace/ParallelLaplace/CMakeLists.txt b/ClassicalField/Laplace/ParallelLaplace/CMakeLists.txt new file mode 100644 index 00000000..a22b61ee --- /dev/null +++ b/ClassicalField/Laplace/ParallelLaplace/CMakeLists.txt @@ -0,0 +1,35 @@ +# 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 C) +enable_language(Fortran OPTIONAL) +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 +# ---------------------- +#add_subdirectory(C) +if (CMAKE_Fortran_COMPILER) + add_subdirectory(Fortran) +endif() diff --git a/ClassicalField/Laplace/ParallelLaplace/Fortran/CMakeLists.txt b/ClassicalField/Laplace/ParallelLaplace/Fortran/CMakeLists.txt new file mode 100644 index 00000000..5a3faae8 --- /dev/null +++ b/ClassicalField/Laplace/ParallelLaplace/Fortran/CMakeLists.txt @@ -0,0 +1,60 @@ + +# Add example executable +add_executable(ParallelLaplace src/ParallelLaplaceExample.f90) + +# Turn on Fortran preprocessing (#include directives) +if (MSVC) + set(PROC_OPT "/fpp") +else() + set(PROC_OPT "-cpp") +endif() + +# in debug mode, add flag that make Floating point exceptions fatal +set(OPT "") +if (FALSE) + if(CMAKE_BUILD_TYPE MATCHES DEBUG) + set(OPT "-ffpe-trap=invalid,zero,underflow,overflow,denormal") # GCC: make floating point exceptions fatal + endif() +endif() + +target_compile_options(ParallelLaplace PRIVATE ${PROC_OPT} ${OPT} "-fbacktrace") + +# Link to opencmiss +# ----------------- +# +# This simply uses the opencmiss target created by OC_INIT() above. +# +# Alternatively, you can also directly invoke 'find_package(Iron )' 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 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(ParallelLaplace PRIVATE opencmiss) + +# Add a simple test that runs the executable +add_test(NAME test_ParallelLaplace COMMAND ParallelLaplace) +add_opencmiss_environment(test_ParallelLaplace) + +################### +# 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. +# diff --git a/ClassicalField/Laplace/ParallelLaplace/src/ParallelLaplaceExample.f90 b/ClassicalField/Laplace/ParallelLaplace/Fortran/src/ParallelLaplaceExample.f90 similarity index 100% rename from ClassicalField/Laplace/ParallelLaplace/src/ParallelLaplaceExample.f90 rename to ClassicalField/Laplace/ParallelLaplace/Fortran/src/ParallelLaplaceExample.f90 diff --git a/ClassicalField/Laplace/ParallelLaplace/OpenCMISS.cmake b/ClassicalField/Laplace/ParallelLaplace/OpenCMISS.cmake new file mode 100644 index 00000000..3d6cf515 --- /dev/null +++ b/ClassicalField/Laplace/ParallelLaplace/OpenCMISS.cmake @@ -0,0 +1,95 @@ +########################### +# *DO NOT CHANGE THIS FILE* +########################### +# +# Prepares the use of OpenCMISS by scanning at various path locations for OpenCMISS (SDK) installations. +# +# Search order: +# - OPENCMISS_INSTALL_DIR variable +# - OPENCMISS_INSTALL_DIR environment variable +# - OPENCMISS_SDK_DIR variable +# - OPENCMISS_SDK_DIR environment variable +# - [Windows only] The Registry is searched additionally for installed SDKs. +# +# If found +# - Includes the toolchain config script of the found opencmiss installation to enable toolchain selection logic (non-windows) + +# Convenience: The OPENCMISS_INSTALL_DIR may also be defined in the environment and various other places +if (DEFINED OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using specified installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The specified OPENCMISS_INSTALL_DIR '${OPENCMISS_INSTALL_DIR}' does not exist. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_INSTALL_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_INSTALL_DIR}" OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using environment installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The environment variable OPENCMISS_INSTALL_DIR='${OPENCMISS_INSTALL_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if (NOT OPENCMISS_INSTALL_DIR AND DEFINED OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The specified OPENCMISS_SDK_DIR '${OPENCMISS_SDK_DIR}' does not exist. Skipping.") + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_SDK_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_SDK_DIR}" OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using environment SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The environment variable OPENCMISS_SDK_DIR='${OPENCMISS_SDK_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_SDK_DIR) + endif() +endif() +# On windows: check the registry for installed OpenCMISS SDKs +if(NOT OPENCMISS_INSTALL_DIR AND WIN32) + foreach(ROOT HKEY_CURRENT_USER HKEY_LOCAL_MACHINE) + foreach(PACKAGE OpenCMISSUserSDK OpenCMISSDeveloperSDK) + set(_REG_KEY "[${ROOT}\\Software\\Auckland Bioengineering Institute\\${PACKAGE}]") + get_filename_component(OPENCMISS_INSTALL_DIR "${_REG_KEY}" ABSOLUTE) + #message(STATUS "Trying registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Found ${PACKAGE} in Windows registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + break() + else() + unset(OPENCMISS_INSTALL_DIR) + endif() + endforeach() + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + break() + endif() + endforeach() +endif() + +if(OPENCMISS_INSTALL_DIR) + message(STATUS "OPENCMISS_INSTALL_DIR=${OPENCMISS_INSTALL_DIR}") + # Use the OpenCMISS scripts to also allow choosing a separate toolchain + # This file is located at the opencmiss installation rather than the local example + # as it avoids file replication and makes maintenance much easier + if (TOOLCHAIN) + set(_OCTC ${OPENCMISS_INSTALL_DIR}/cmake/OCToolchainCompilers.cmake) + if (EXISTS "${_OCTC}") + include(${_OCTC}) + else() + message(WARNING "TOOLCHAIN specified but OpenCMISS config script could not be found at ${_OCTC}. Trying CMake defaults.") + endif() + unset(_OCTC) + endif() + set(OpenCMISS_DIR "${OPENCMISS_INSTALL_DIR}" CACHE PATH "Path to the found OpenCMISS (SDK) installation") +else() + message(WARNING "No OpenCMISS (SDK) installation directory detected. Using default system environment.") +endif() + \ No newline at end of file diff --git a/ClassicalField/Laplace/ParallelLaplace/build_debug/build.sh b/ClassicalField/Laplace/ParallelLaplace/build_debug/build.sh new file mode 100644 index 00000000..e6624bac --- /dev/null +++ b/ClassicalField/Laplace/ParallelLaplace/build_debug/build.sh @@ -0,0 +1,2 @@ +#ccc && cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all +cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all diff --git a/ClassicalField/Laplace/SimplexLaplace/Linear/CMakeLists.txt b/ClassicalField/Laplace/SimplexLaplace/Linear/CMakeLists.txt new file mode 100644 index 00000000..a22b61ee --- /dev/null +++ b/ClassicalField/Laplace/SimplexLaplace/Linear/CMakeLists.txt @@ -0,0 +1,35 @@ +# 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 C) +enable_language(Fortran OPTIONAL) +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 +# ---------------------- +#add_subdirectory(C) +if (CMAKE_Fortran_COMPILER) + add_subdirectory(Fortran) +endif() diff --git a/ClassicalField/Laplace/SimplexLaplace/Linear/Fortran/CMakeLists.txt b/ClassicalField/Laplace/SimplexLaplace/Linear/Fortran/CMakeLists.txt new file mode 100644 index 00000000..78e65438 --- /dev/null +++ b/ClassicalField/Laplace/SimplexLaplace/Linear/Fortran/CMakeLists.txt @@ -0,0 +1,60 @@ + +# Add example executable +add_executable(Linear src/LinearExample.f90) + +# Turn on Fortran preprocessing (#include directives) +if (MSVC) + set(PROC_OPT "/fpp") +else() + set(PROC_OPT "-cpp") +endif() + +# in debug mode, add flag that make Floating point exceptions fatal +set(OPT "") +if (FALSE) + if(CMAKE_BUILD_TYPE MATCHES DEBUG) + set(OPT "-ffpe-trap=invalid,zero,underflow,overflow,denormal") # GCC: make floating point exceptions fatal + endif() +endif() + +target_compile_options(Linear PRIVATE ${PROC_OPT} ${OPT} "-fbacktrace") + +# Link to opencmiss +# ----------------- +# +# This simply uses the opencmiss target created by OC_INIT() above. +# +# Alternatively, you can also directly invoke 'find_package(Iron )' 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 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(Linear PRIVATE opencmiss) + +# Add a simple test that runs the executable +add_test(NAME test_Linear COMMAND Linear) +add_opencmiss_environment(test_Linear) + +################### +# 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. +# diff --git a/ClassicalField/Laplace/SimplexLaplace/Linear/src/LinearExample.f90 b/ClassicalField/Laplace/SimplexLaplace/Linear/Fortran/src/LinearExample.f90 similarity index 100% rename from ClassicalField/Laplace/SimplexLaplace/Linear/src/LinearExample.f90 rename to ClassicalField/Laplace/SimplexLaplace/Linear/Fortran/src/LinearExample.f90 diff --git a/ClassicalField/Laplace/SimplexLaplace/Linear/OpenCMISS.cmake b/ClassicalField/Laplace/SimplexLaplace/Linear/OpenCMISS.cmake new file mode 100644 index 00000000..3d6cf515 --- /dev/null +++ b/ClassicalField/Laplace/SimplexLaplace/Linear/OpenCMISS.cmake @@ -0,0 +1,95 @@ +########################### +# *DO NOT CHANGE THIS FILE* +########################### +# +# Prepares the use of OpenCMISS by scanning at various path locations for OpenCMISS (SDK) installations. +# +# Search order: +# - OPENCMISS_INSTALL_DIR variable +# - OPENCMISS_INSTALL_DIR environment variable +# - OPENCMISS_SDK_DIR variable +# - OPENCMISS_SDK_DIR environment variable +# - [Windows only] The Registry is searched additionally for installed SDKs. +# +# If found +# - Includes the toolchain config script of the found opencmiss installation to enable toolchain selection logic (non-windows) + +# Convenience: The OPENCMISS_INSTALL_DIR may also be defined in the environment and various other places +if (DEFINED OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using specified installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The specified OPENCMISS_INSTALL_DIR '${OPENCMISS_INSTALL_DIR}' does not exist. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_INSTALL_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_INSTALL_DIR}" OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using environment installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The environment variable OPENCMISS_INSTALL_DIR='${OPENCMISS_INSTALL_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if (NOT OPENCMISS_INSTALL_DIR AND DEFINED OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The specified OPENCMISS_SDK_DIR '${OPENCMISS_SDK_DIR}' does not exist. Skipping.") + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_SDK_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_SDK_DIR}" OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using environment SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The environment variable OPENCMISS_SDK_DIR='${OPENCMISS_SDK_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_SDK_DIR) + endif() +endif() +# On windows: check the registry for installed OpenCMISS SDKs +if(NOT OPENCMISS_INSTALL_DIR AND WIN32) + foreach(ROOT HKEY_CURRENT_USER HKEY_LOCAL_MACHINE) + foreach(PACKAGE OpenCMISSUserSDK OpenCMISSDeveloperSDK) + set(_REG_KEY "[${ROOT}\\Software\\Auckland Bioengineering Institute\\${PACKAGE}]") + get_filename_component(OPENCMISS_INSTALL_DIR "${_REG_KEY}" ABSOLUTE) + #message(STATUS "Trying registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Found ${PACKAGE} in Windows registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + break() + else() + unset(OPENCMISS_INSTALL_DIR) + endif() + endforeach() + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + break() + endif() + endforeach() +endif() + +if(OPENCMISS_INSTALL_DIR) + message(STATUS "OPENCMISS_INSTALL_DIR=${OPENCMISS_INSTALL_DIR}") + # Use the OpenCMISS scripts to also allow choosing a separate toolchain + # This file is located at the opencmiss installation rather than the local example + # as it avoids file replication and makes maintenance much easier + if (TOOLCHAIN) + set(_OCTC ${OPENCMISS_INSTALL_DIR}/cmake/OCToolchainCompilers.cmake) + if (EXISTS "${_OCTC}") + include(${_OCTC}) + else() + message(WARNING "TOOLCHAIN specified but OpenCMISS config script could not be found at ${_OCTC}. Trying CMake defaults.") + endif() + unset(_OCTC) + endif() + set(OpenCMISS_DIR "${OPENCMISS_INSTALL_DIR}" CACHE PATH "Path to the found OpenCMISS (SDK) installation") +else() + message(WARNING "No OpenCMISS (SDK) installation directory detected. Using default system environment.") +endif() + \ No newline at end of file diff --git a/ClassicalField/Laplace/SimplexLaplace/Linear/build_debug/build.sh b/ClassicalField/Laplace/SimplexLaplace/Linear/build_debug/build.sh new file mode 100644 index 00000000..e6624bac --- /dev/null +++ b/ClassicalField/Laplace/SimplexLaplace/Linear/build_debug/build.sh @@ -0,0 +1,2 @@ +#ccc && cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all +cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all diff --git a/ClassicalField/Poisson/42Master/CMakeLists.txt b/ClassicalField/Poisson/42Master/CMakeLists.txt new file mode 100644 index 00000000..a22b61ee --- /dev/null +++ b/ClassicalField/Poisson/42Master/CMakeLists.txt @@ -0,0 +1,35 @@ +# 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 C) +enable_language(Fortran OPTIONAL) +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 +# ---------------------- +#add_subdirectory(C) +if (CMAKE_Fortran_COMPILER) + add_subdirectory(Fortran) +endif() diff --git a/ClassicalField/Poisson/42Master/Fortran/CMakeLists.txt b/ClassicalField/Poisson/42Master/Fortran/CMakeLists.txt new file mode 100644 index 00000000..20e09803 --- /dev/null +++ b/ClassicalField/Poisson/42Master/Fortran/CMakeLists.txt @@ -0,0 +1,60 @@ + +# Add example executable +add_executable(42Master src/42MasterExample.f90) + +# Turn on Fortran preprocessing (#include directives) +if (MSVC) + set(PROC_OPT "/fpp") +else() + set(PROC_OPT "-cpp") +endif() + +# in debug mode, add flag that make Floating point exceptions fatal +set(OPT "") +if (FALSE) + if(CMAKE_BUILD_TYPE MATCHES DEBUG) + set(OPT "-ffpe-trap=invalid,zero,underflow,overflow,denormal") # GCC: make floating point exceptions fatal + endif() +endif() + +target_compile_options(42Master PRIVATE ${PROC_OPT} ${OPT} "-fbacktrace") + +# Link to opencmiss +# ----------------- +# +# This simply uses the opencmiss target created by OC_INIT() above. +# +# Alternatively, you can also directly invoke 'find_package(Iron )' 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 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(42Master PRIVATE opencmiss) + +# Add a simple test that runs the executable +add_test(NAME test_42Master COMMAND 42Master) +add_opencmiss_environment(test_42Master) + +################### +# 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. +# diff --git a/ClassicalField/Poisson/42Master/src/42MasterExample.f90 b/ClassicalField/Poisson/42Master/Fortran/src/42MasterExample.f90 similarity index 100% rename from ClassicalField/Poisson/42Master/src/42MasterExample.f90 rename to ClassicalField/Poisson/42Master/Fortran/src/42MasterExample.f90 diff --git a/ClassicalField/Poisson/42Master/OpenCMISS.cmake b/ClassicalField/Poisson/42Master/OpenCMISS.cmake new file mode 100644 index 00000000..3d6cf515 --- /dev/null +++ b/ClassicalField/Poisson/42Master/OpenCMISS.cmake @@ -0,0 +1,95 @@ +########################### +# *DO NOT CHANGE THIS FILE* +########################### +# +# Prepares the use of OpenCMISS by scanning at various path locations for OpenCMISS (SDK) installations. +# +# Search order: +# - OPENCMISS_INSTALL_DIR variable +# - OPENCMISS_INSTALL_DIR environment variable +# - OPENCMISS_SDK_DIR variable +# - OPENCMISS_SDK_DIR environment variable +# - [Windows only] The Registry is searched additionally for installed SDKs. +# +# If found +# - Includes the toolchain config script of the found opencmiss installation to enable toolchain selection logic (non-windows) + +# Convenience: The OPENCMISS_INSTALL_DIR may also be defined in the environment and various other places +if (DEFINED OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using specified installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The specified OPENCMISS_INSTALL_DIR '${OPENCMISS_INSTALL_DIR}' does not exist. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_INSTALL_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_INSTALL_DIR}" OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using environment installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The environment variable OPENCMISS_INSTALL_DIR='${OPENCMISS_INSTALL_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if (NOT OPENCMISS_INSTALL_DIR AND DEFINED OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The specified OPENCMISS_SDK_DIR '${OPENCMISS_SDK_DIR}' does not exist. Skipping.") + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_SDK_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_SDK_DIR}" OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using environment SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The environment variable OPENCMISS_SDK_DIR='${OPENCMISS_SDK_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_SDK_DIR) + endif() +endif() +# On windows: check the registry for installed OpenCMISS SDKs +if(NOT OPENCMISS_INSTALL_DIR AND WIN32) + foreach(ROOT HKEY_CURRENT_USER HKEY_LOCAL_MACHINE) + foreach(PACKAGE OpenCMISSUserSDK OpenCMISSDeveloperSDK) + set(_REG_KEY "[${ROOT}\\Software\\Auckland Bioengineering Institute\\${PACKAGE}]") + get_filename_component(OPENCMISS_INSTALL_DIR "${_REG_KEY}" ABSOLUTE) + #message(STATUS "Trying registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Found ${PACKAGE} in Windows registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + break() + else() + unset(OPENCMISS_INSTALL_DIR) + endif() + endforeach() + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + break() + endif() + endforeach() +endif() + +if(OPENCMISS_INSTALL_DIR) + message(STATUS "OPENCMISS_INSTALL_DIR=${OPENCMISS_INSTALL_DIR}") + # Use the OpenCMISS scripts to also allow choosing a separate toolchain + # This file is located at the opencmiss installation rather than the local example + # as it avoids file replication and makes maintenance much easier + if (TOOLCHAIN) + set(_OCTC ${OPENCMISS_INSTALL_DIR}/cmake/OCToolchainCompilers.cmake) + if (EXISTS "${_OCTC}") + include(${_OCTC}) + else() + message(WARNING "TOOLCHAIN specified but OpenCMISS config script could not be found at ${_OCTC}. Trying CMake defaults.") + endif() + unset(_OCTC) + endif() + set(OpenCMISS_DIR "${OPENCMISS_INSTALL_DIR}" CACHE PATH "Path to the found OpenCMISS (SDK) installation") +else() + message(WARNING "No OpenCMISS (SDK) installation directory detected. Using default system environment.") +endif() + \ No newline at end of file diff --git a/ClassicalField/Poisson/42Master/build_debug/build.sh b/ClassicalField/Poisson/42Master/build_debug/build.sh new file mode 100644 index 00000000..e6624bac --- /dev/null +++ b/ClassicalField/Poisson/42Master/build_debug/build.sh @@ -0,0 +1,2 @@ +#ccc && cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all +cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all diff --git a/ClassicalField/Poisson/AnalyticNonlinearPoisson/CMakeLists.txt b/ClassicalField/Poisson/AnalyticNonlinearPoisson/CMakeLists.txt new file mode 100644 index 00000000..a22b61ee --- /dev/null +++ b/ClassicalField/Poisson/AnalyticNonlinearPoisson/CMakeLists.txt @@ -0,0 +1,35 @@ +# 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 C) +enable_language(Fortran OPTIONAL) +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 +# ---------------------- +#add_subdirectory(C) +if (CMAKE_Fortran_COMPILER) + add_subdirectory(Fortran) +endif() diff --git a/ClassicalField/Poisson/AnalyticNonlinearPoisson/Fortran/CMakeLists.txt b/ClassicalField/Poisson/AnalyticNonlinearPoisson/Fortran/CMakeLists.txt new file mode 100644 index 00000000..276611ec --- /dev/null +++ b/ClassicalField/Poisson/AnalyticNonlinearPoisson/Fortran/CMakeLists.txt @@ -0,0 +1,60 @@ + +# Add example executable +add_executable(AnalyticNonlinearPoisson src/AnalyticNonlinearPoissonExample.f90) + +# Turn on Fortran preprocessing (#include directives) +if (MSVC) + set(PROC_OPT "/fpp") +else() + set(PROC_OPT "-cpp") +endif() + +# in debug mode, add flag that make Floating point exceptions fatal +set(OPT "") +if (FALSE) + if(CMAKE_BUILD_TYPE MATCHES DEBUG) + set(OPT "-ffpe-trap=invalid,zero,underflow,overflow,denormal") # GCC: make floating point exceptions fatal + endif() +endif() + +target_compile_options(AnalyticNonlinearPoisson PRIVATE ${PROC_OPT} ${OPT} "-fbacktrace") + +# Link to opencmiss +# ----------------- +# +# This simply uses the opencmiss target created by OC_INIT() above. +# +# Alternatively, you can also directly invoke 'find_package(Iron )' 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 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(AnalyticNonlinearPoisson PRIVATE opencmiss) + +# Add a simple test that runs the executable +add_test(NAME test_AnalyticNonlinearPoisson COMMAND AnalyticNonlinearPoisson) +add_opencmiss_environment(test_AnalyticNonlinearPoisson) + +################### +# 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. +# diff --git a/ClassicalField/Poisson/AnalyticNonlinearPoisson/src/AnalyticNonlinearPoissonExample.f90 b/ClassicalField/Poisson/AnalyticNonlinearPoisson/Fortran/src/AnalyticNonlinearPoissonExample.f90 similarity index 100% rename from ClassicalField/Poisson/AnalyticNonlinearPoisson/src/AnalyticNonlinearPoissonExample.f90 rename to ClassicalField/Poisson/AnalyticNonlinearPoisson/Fortran/src/AnalyticNonlinearPoissonExample.f90 diff --git a/ClassicalField/Poisson/AnalyticNonlinearPoisson/OpenCMISS.cmake b/ClassicalField/Poisson/AnalyticNonlinearPoisson/OpenCMISS.cmake new file mode 100644 index 00000000..3d6cf515 --- /dev/null +++ b/ClassicalField/Poisson/AnalyticNonlinearPoisson/OpenCMISS.cmake @@ -0,0 +1,95 @@ +########################### +# *DO NOT CHANGE THIS FILE* +########################### +# +# Prepares the use of OpenCMISS by scanning at various path locations for OpenCMISS (SDK) installations. +# +# Search order: +# - OPENCMISS_INSTALL_DIR variable +# - OPENCMISS_INSTALL_DIR environment variable +# - OPENCMISS_SDK_DIR variable +# - OPENCMISS_SDK_DIR environment variable +# - [Windows only] The Registry is searched additionally for installed SDKs. +# +# If found +# - Includes the toolchain config script of the found opencmiss installation to enable toolchain selection logic (non-windows) + +# Convenience: The OPENCMISS_INSTALL_DIR may also be defined in the environment and various other places +if (DEFINED OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using specified installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The specified OPENCMISS_INSTALL_DIR '${OPENCMISS_INSTALL_DIR}' does not exist. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_INSTALL_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_INSTALL_DIR}" OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using environment installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The environment variable OPENCMISS_INSTALL_DIR='${OPENCMISS_INSTALL_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if (NOT OPENCMISS_INSTALL_DIR AND DEFINED OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The specified OPENCMISS_SDK_DIR '${OPENCMISS_SDK_DIR}' does not exist. Skipping.") + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_SDK_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_SDK_DIR}" OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using environment SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The environment variable OPENCMISS_SDK_DIR='${OPENCMISS_SDK_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_SDK_DIR) + endif() +endif() +# On windows: check the registry for installed OpenCMISS SDKs +if(NOT OPENCMISS_INSTALL_DIR AND WIN32) + foreach(ROOT HKEY_CURRENT_USER HKEY_LOCAL_MACHINE) + foreach(PACKAGE OpenCMISSUserSDK OpenCMISSDeveloperSDK) + set(_REG_KEY "[${ROOT}\\Software\\Auckland Bioengineering Institute\\${PACKAGE}]") + get_filename_component(OPENCMISS_INSTALL_DIR "${_REG_KEY}" ABSOLUTE) + #message(STATUS "Trying registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Found ${PACKAGE} in Windows registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + break() + else() + unset(OPENCMISS_INSTALL_DIR) + endif() + endforeach() + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + break() + endif() + endforeach() +endif() + +if(OPENCMISS_INSTALL_DIR) + message(STATUS "OPENCMISS_INSTALL_DIR=${OPENCMISS_INSTALL_DIR}") + # Use the OpenCMISS scripts to also allow choosing a separate toolchain + # This file is located at the opencmiss installation rather than the local example + # as it avoids file replication and makes maintenance much easier + if (TOOLCHAIN) + set(_OCTC ${OPENCMISS_INSTALL_DIR}/cmake/OCToolchainCompilers.cmake) + if (EXISTS "${_OCTC}") + include(${_OCTC}) + else() + message(WARNING "TOOLCHAIN specified but OpenCMISS config script could not be found at ${_OCTC}. Trying CMake defaults.") + endif() + unset(_OCTC) + endif() + set(OpenCMISS_DIR "${OPENCMISS_INSTALL_DIR}" CACHE PATH "Path to the found OpenCMISS (SDK) installation") +else() + message(WARNING "No OpenCMISS (SDK) installation directory detected. Using default system environment.") +endif() + \ No newline at end of file diff --git a/ClassicalField/Poisson/AnalyticNonlinearPoisson/build_debug/build.sh b/ClassicalField/Poisson/AnalyticNonlinearPoisson/build_debug/build.sh new file mode 100644 index 00000000..e6624bac --- /dev/null +++ b/ClassicalField/Poisson/AnalyticNonlinearPoisson/build_debug/build.sh @@ -0,0 +1,2 @@ +#ccc && cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all +cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all diff --git a/ClassicalField/Poisson/ExtracellularBidomain/CMakeLists.txt b/ClassicalField/Poisson/ExtracellularBidomain/CMakeLists.txt new file mode 100644 index 00000000..a22b61ee --- /dev/null +++ b/ClassicalField/Poisson/ExtracellularBidomain/CMakeLists.txt @@ -0,0 +1,35 @@ +# 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 C) +enable_language(Fortran OPTIONAL) +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 +# ---------------------- +#add_subdirectory(C) +if (CMAKE_Fortran_COMPILER) + add_subdirectory(Fortran) +endif() diff --git a/ClassicalField/Poisson/ExtracellularBidomain/Fortran/CMakeLists.txt b/ClassicalField/Poisson/ExtracellularBidomain/Fortran/CMakeLists.txt new file mode 100644 index 00000000..4838b134 --- /dev/null +++ b/ClassicalField/Poisson/ExtracellularBidomain/Fortran/CMakeLists.txt @@ -0,0 +1,60 @@ + +# Add example executable +add_executable(ExtracellularBidomain src/FortranExample.f90) + +# Turn on Fortran preprocessing (#include directives) +if (MSVC) + set(PROC_OPT "/fpp") +else() + set(PROC_OPT "-cpp") +endif() + +# in debug mode, add flag that make Floating point exceptions fatal +set(OPT "") +if (FALSE) + if(CMAKE_BUILD_TYPE MATCHES DEBUG) + set(OPT "-ffpe-trap=invalid,zero,underflow,overflow,denormal") # GCC: make floating point exceptions fatal + endif() +endif() + +target_compile_options(ExtracellularBidomain PRIVATE ${PROC_OPT} ${OPT} "-fbacktrace") + +# Link to opencmiss +# ----------------- +# +# This simply uses the opencmiss target created by OC_INIT() above. +# +# Alternatively, you can also directly invoke 'find_package(Iron )' 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 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(ExtracellularBidomain PRIVATE opencmiss) + +# Add a simple test that runs the executable +add_test(NAME test_ExtracellularBidomain COMMAND ExtracellularBidomain) +add_opencmiss_environment(test_ExtracellularBidomain) + +################### +# 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. +# diff --git a/ClassicalField/Poisson/ExtracellularBidomain/OpenCMISS.cmake b/ClassicalField/Poisson/ExtracellularBidomain/OpenCMISS.cmake new file mode 100644 index 00000000..3d6cf515 --- /dev/null +++ b/ClassicalField/Poisson/ExtracellularBidomain/OpenCMISS.cmake @@ -0,0 +1,95 @@ +########################### +# *DO NOT CHANGE THIS FILE* +########################### +# +# Prepares the use of OpenCMISS by scanning at various path locations for OpenCMISS (SDK) installations. +# +# Search order: +# - OPENCMISS_INSTALL_DIR variable +# - OPENCMISS_INSTALL_DIR environment variable +# - OPENCMISS_SDK_DIR variable +# - OPENCMISS_SDK_DIR environment variable +# - [Windows only] The Registry is searched additionally for installed SDKs. +# +# If found +# - Includes the toolchain config script of the found opencmiss installation to enable toolchain selection logic (non-windows) + +# Convenience: The OPENCMISS_INSTALL_DIR may also be defined in the environment and various other places +if (DEFINED OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using specified installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The specified OPENCMISS_INSTALL_DIR '${OPENCMISS_INSTALL_DIR}' does not exist. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_INSTALL_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_INSTALL_DIR}" OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using environment installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The environment variable OPENCMISS_INSTALL_DIR='${OPENCMISS_INSTALL_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if (NOT OPENCMISS_INSTALL_DIR AND DEFINED OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The specified OPENCMISS_SDK_DIR '${OPENCMISS_SDK_DIR}' does not exist. Skipping.") + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_SDK_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_SDK_DIR}" OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using environment SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The environment variable OPENCMISS_SDK_DIR='${OPENCMISS_SDK_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_SDK_DIR) + endif() +endif() +# On windows: check the registry for installed OpenCMISS SDKs +if(NOT OPENCMISS_INSTALL_DIR AND WIN32) + foreach(ROOT HKEY_CURRENT_USER HKEY_LOCAL_MACHINE) + foreach(PACKAGE OpenCMISSUserSDK OpenCMISSDeveloperSDK) + set(_REG_KEY "[${ROOT}\\Software\\Auckland Bioengineering Institute\\${PACKAGE}]") + get_filename_component(OPENCMISS_INSTALL_DIR "${_REG_KEY}" ABSOLUTE) + #message(STATUS "Trying registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Found ${PACKAGE} in Windows registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + break() + else() + unset(OPENCMISS_INSTALL_DIR) + endif() + endforeach() + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + break() + endif() + endforeach() +endif() + +if(OPENCMISS_INSTALL_DIR) + message(STATUS "OPENCMISS_INSTALL_DIR=${OPENCMISS_INSTALL_DIR}") + # Use the OpenCMISS scripts to also allow choosing a separate toolchain + # This file is located at the opencmiss installation rather than the local example + # as it avoids file replication and makes maintenance much easier + if (TOOLCHAIN) + set(_OCTC ${OPENCMISS_INSTALL_DIR}/cmake/OCToolchainCompilers.cmake) + if (EXISTS "${_OCTC}") + include(${_OCTC}) + else() + message(WARNING "TOOLCHAIN specified but OpenCMISS config script could not be found at ${_OCTC}. Trying CMake defaults.") + endif() + unset(_OCTC) + endif() + set(OpenCMISS_DIR "${OPENCMISS_INSTALL_DIR}" CACHE PATH "Path to the found OpenCMISS (SDK) installation") +else() + message(WARNING "No OpenCMISS (SDK) installation directory detected. Using default system environment.") +endif() + \ No newline at end of file diff --git a/ClassicalField/Poisson/ExtracellularBidomain/build_debug/build.sh b/ClassicalField/Poisson/ExtracellularBidomain/build_debug/build.sh new file mode 100644 index 00000000..e6624bac --- /dev/null +++ b/ClassicalField/Poisson/ExtracellularBidomain/build_debug/build.sh @@ -0,0 +1,2 @@ +#ccc && cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all +cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all diff --git a/ClassicalField/Poisson/NonlinearPoisson/CMakeLists.txt b/ClassicalField/Poisson/NonlinearPoisson/CMakeLists.txt new file mode 100644 index 00000000..a22b61ee --- /dev/null +++ b/ClassicalField/Poisson/NonlinearPoisson/CMakeLists.txt @@ -0,0 +1,35 @@ +# 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 C) +enable_language(Fortran OPTIONAL) +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 +# ---------------------- +#add_subdirectory(C) +if (CMAKE_Fortran_COMPILER) + add_subdirectory(Fortran) +endif() diff --git a/ClassicalField/Poisson/NonlinearPoisson/Fortran/CMakeLists.txt b/ClassicalField/Poisson/NonlinearPoisson/Fortran/CMakeLists.txt new file mode 100644 index 00000000..073e8246 --- /dev/null +++ b/ClassicalField/Poisson/NonlinearPoisson/Fortran/CMakeLists.txt @@ -0,0 +1,60 @@ + +# Add example executable +add_executable(NonlinearPoisson src/NonlinearPoissonExample.f90) + +# Turn on Fortran preprocessing (#include directives) +if (MSVC) + set(PROC_OPT "/fpp") +else() + set(PROC_OPT "-cpp") +endif() + +# in debug mode, add flag that make Floating point exceptions fatal +set(OPT "") +if (FALSE) + if(CMAKE_BUILD_TYPE MATCHES DEBUG) + set(OPT "-ffpe-trap=invalid,zero,underflow,overflow,denormal") # GCC: make floating point exceptions fatal + endif() +endif() + +target_compile_options(NonlinearPoisson PRIVATE ${PROC_OPT} ${OPT} "-fbacktrace") + +# Link to opencmiss +# ----------------- +# +# This simply uses the opencmiss target created by OC_INIT() above. +# +# Alternatively, you can also directly invoke 'find_package(Iron )' 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 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(NonlinearPoisson PRIVATE opencmiss) + +# Add a simple test that runs the executable +add_test(NAME test_NonlinearPoisson COMMAND NonlinearPoisson) +add_opencmiss_environment(test_NonlinearPoisson) + +################### +# 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. +# diff --git a/ClassicalField/Poisson/NonlinearPoisson/src/NonlinearPoissonExample.f90 b/ClassicalField/Poisson/NonlinearPoisson/Fortran/src/NonlinearPoissonExample.f90 similarity index 100% rename from ClassicalField/Poisson/NonlinearPoisson/src/NonlinearPoissonExample.f90 rename to ClassicalField/Poisson/NonlinearPoisson/Fortran/src/NonlinearPoissonExample.f90 diff --git a/ClassicalField/Poisson/NonlinearPoisson/OpenCMISS.cmake b/ClassicalField/Poisson/NonlinearPoisson/OpenCMISS.cmake new file mode 100644 index 00000000..3d6cf515 --- /dev/null +++ b/ClassicalField/Poisson/NonlinearPoisson/OpenCMISS.cmake @@ -0,0 +1,95 @@ +########################### +# *DO NOT CHANGE THIS FILE* +########################### +# +# Prepares the use of OpenCMISS by scanning at various path locations for OpenCMISS (SDK) installations. +# +# Search order: +# - OPENCMISS_INSTALL_DIR variable +# - OPENCMISS_INSTALL_DIR environment variable +# - OPENCMISS_SDK_DIR variable +# - OPENCMISS_SDK_DIR environment variable +# - [Windows only] The Registry is searched additionally for installed SDKs. +# +# If found +# - Includes the toolchain config script of the found opencmiss installation to enable toolchain selection logic (non-windows) + +# Convenience: The OPENCMISS_INSTALL_DIR may also be defined in the environment and various other places +if (DEFINED OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using specified installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The specified OPENCMISS_INSTALL_DIR '${OPENCMISS_INSTALL_DIR}' does not exist. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_INSTALL_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_INSTALL_DIR}" OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using environment installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The environment variable OPENCMISS_INSTALL_DIR='${OPENCMISS_INSTALL_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if (NOT OPENCMISS_INSTALL_DIR AND DEFINED OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The specified OPENCMISS_SDK_DIR '${OPENCMISS_SDK_DIR}' does not exist. Skipping.") + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_SDK_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_SDK_DIR}" OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using environment SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The environment variable OPENCMISS_SDK_DIR='${OPENCMISS_SDK_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_SDK_DIR) + endif() +endif() +# On windows: check the registry for installed OpenCMISS SDKs +if(NOT OPENCMISS_INSTALL_DIR AND WIN32) + foreach(ROOT HKEY_CURRENT_USER HKEY_LOCAL_MACHINE) + foreach(PACKAGE OpenCMISSUserSDK OpenCMISSDeveloperSDK) + set(_REG_KEY "[${ROOT}\\Software\\Auckland Bioengineering Institute\\${PACKAGE}]") + get_filename_component(OPENCMISS_INSTALL_DIR "${_REG_KEY}" ABSOLUTE) + #message(STATUS "Trying registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Found ${PACKAGE} in Windows registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + break() + else() + unset(OPENCMISS_INSTALL_DIR) + endif() + endforeach() + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + break() + endif() + endforeach() +endif() + +if(OPENCMISS_INSTALL_DIR) + message(STATUS "OPENCMISS_INSTALL_DIR=${OPENCMISS_INSTALL_DIR}") + # Use the OpenCMISS scripts to also allow choosing a separate toolchain + # This file is located at the opencmiss installation rather than the local example + # as it avoids file replication and makes maintenance much easier + if (TOOLCHAIN) + set(_OCTC ${OPENCMISS_INSTALL_DIR}/cmake/OCToolchainCompilers.cmake) + if (EXISTS "${_OCTC}") + include(${_OCTC}) + else() + message(WARNING "TOOLCHAIN specified but OpenCMISS config script could not be found at ${_OCTC}. Trying CMake defaults.") + endif() + unset(_OCTC) + endif() + set(OpenCMISS_DIR "${OPENCMISS_INSTALL_DIR}" CACHE PATH "Path to the found OpenCMISS (SDK) installation") +else() + message(WARNING "No OpenCMISS (SDK) installation directory detected. Using default system environment.") +endif() + \ No newline at end of file diff --git a/ClassicalField/Poisson/NonlinearPoisson/build_debug/build.sh b/ClassicalField/Poisson/NonlinearPoisson/build_debug/build.sh new file mode 100644 index 00000000..e6624bac --- /dev/null +++ b/ClassicalField/Poisson/NonlinearPoisson/build_debug/build.sh @@ -0,0 +1,2 @@ +#ccc && cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all +cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all diff --git a/ClassicalField/ReactionDiffusion/CellMLSplitReactionDiffusion1D/CMakeLists.txt b/ClassicalField/ReactionDiffusion/CellMLSplitReactionDiffusion1D/CMakeLists.txt new file mode 100644 index 00000000..a22b61ee --- /dev/null +++ b/ClassicalField/ReactionDiffusion/CellMLSplitReactionDiffusion1D/CMakeLists.txt @@ -0,0 +1,35 @@ +# 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 C) +enable_language(Fortran OPTIONAL) +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 +# ---------------------- +#add_subdirectory(C) +if (CMAKE_Fortran_COMPILER) + add_subdirectory(Fortran) +endif() diff --git a/ClassicalField/ReactionDiffusion/CellMLSplitReactionDiffusion1D/Fortran/CMakeLists.txt b/ClassicalField/ReactionDiffusion/CellMLSplitReactionDiffusion1D/Fortran/CMakeLists.txt new file mode 100644 index 00000000..6dcc50fc --- /dev/null +++ b/ClassicalField/ReactionDiffusion/CellMLSplitReactionDiffusion1D/Fortran/CMakeLists.txt @@ -0,0 +1,60 @@ + +# Add example executable +add_executable(CellMLSplitReactionDiffusion1D src/CellMLSplitReactionDiffusion1DExample.f90) + +# Turn on Fortran preprocessing (#include directives) +if (MSVC) + set(PROC_OPT "/fpp") +else() + set(PROC_OPT "-cpp") +endif() + +# in debug mode, add flag that make Floating point exceptions fatal +set(OPT "") +if (FALSE) + if(CMAKE_BUILD_TYPE MATCHES DEBUG) + set(OPT "-ffpe-trap=invalid,zero,underflow,overflow,denormal") # GCC: make floating point exceptions fatal + endif() +endif() + +target_compile_options(CellMLSplitReactionDiffusion1D PRIVATE ${PROC_OPT} ${OPT} "-fbacktrace") + +# Link to opencmiss +# ----------------- +# +# This simply uses the opencmiss target created by OC_INIT() above. +# +# Alternatively, you can also directly invoke 'find_package(Iron )' 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 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(CellMLSplitReactionDiffusion1D PRIVATE opencmiss) + +# Add a simple test that runs the executable +add_test(NAME test_CellMLSplitReactionDiffusion1D COMMAND CellMLSplitReactionDiffusion1D) +add_opencmiss_environment(test_CellMLSplitReactionDiffusion1D) + +################### +# 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. +# diff --git a/ClassicalField/ReactionDiffusion/CellMLSplitReactionDiffusion1D/src/CellMLSplitReactionDiffusion1DExample.f90 b/ClassicalField/ReactionDiffusion/CellMLSplitReactionDiffusion1D/Fortran/src/CellMLSplitReactionDiffusion1DExample.f90 similarity index 100% rename from ClassicalField/ReactionDiffusion/CellMLSplitReactionDiffusion1D/src/CellMLSplitReactionDiffusion1DExample.f90 rename to ClassicalField/ReactionDiffusion/CellMLSplitReactionDiffusion1D/Fortran/src/CellMLSplitReactionDiffusion1DExample.f90 diff --git a/ClassicalField/ReactionDiffusion/CellMLSplitReactionDiffusion1D/OpenCMISS.cmake b/ClassicalField/ReactionDiffusion/CellMLSplitReactionDiffusion1D/OpenCMISS.cmake new file mode 100644 index 00000000..3d6cf515 --- /dev/null +++ b/ClassicalField/ReactionDiffusion/CellMLSplitReactionDiffusion1D/OpenCMISS.cmake @@ -0,0 +1,95 @@ +########################### +# *DO NOT CHANGE THIS FILE* +########################### +# +# Prepares the use of OpenCMISS by scanning at various path locations for OpenCMISS (SDK) installations. +# +# Search order: +# - OPENCMISS_INSTALL_DIR variable +# - OPENCMISS_INSTALL_DIR environment variable +# - OPENCMISS_SDK_DIR variable +# - OPENCMISS_SDK_DIR environment variable +# - [Windows only] The Registry is searched additionally for installed SDKs. +# +# If found +# - Includes the toolchain config script of the found opencmiss installation to enable toolchain selection logic (non-windows) + +# Convenience: The OPENCMISS_INSTALL_DIR may also be defined in the environment and various other places +if (DEFINED OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using specified installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The specified OPENCMISS_INSTALL_DIR '${OPENCMISS_INSTALL_DIR}' does not exist. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_INSTALL_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_INSTALL_DIR}" OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using environment installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The environment variable OPENCMISS_INSTALL_DIR='${OPENCMISS_INSTALL_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if (NOT OPENCMISS_INSTALL_DIR AND DEFINED OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The specified OPENCMISS_SDK_DIR '${OPENCMISS_SDK_DIR}' does not exist. Skipping.") + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_SDK_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_SDK_DIR}" OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using environment SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The environment variable OPENCMISS_SDK_DIR='${OPENCMISS_SDK_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_SDK_DIR) + endif() +endif() +# On windows: check the registry for installed OpenCMISS SDKs +if(NOT OPENCMISS_INSTALL_DIR AND WIN32) + foreach(ROOT HKEY_CURRENT_USER HKEY_LOCAL_MACHINE) + foreach(PACKAGE OpenCMISSUserSDK OpenCMISSDeveloperSDK) + set(_REG_KEY "[${ROOT}\\Software\\Auckland Bioengineering Institute\\${PACKAGE}]") + get_filename_component(OPENCMISS_INSTALL_DIR "${_REG_KEY}" ABSOLUTE) + #message(STATUS "Trying registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Found ${PACKAGE} in Windows registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + break() + else() + unset(OPENCMISS_INSTALL_DIR) + endif() + endforeach() + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + break() + endif() + endforeach() +endif() + +if(OPENCMISS_INSTALL_DIR) + message(STATUS "OPENCMISS_INSTALL_DIR=${OPENCMISS_INSTALL_DIR}") + # Use the OpenCMISS scripts to also allow choosing a separate toolchain + # This file is located at the opencmiss installation rather than the local example + # as it avoids file replication and makes maintenance much easier + if (TOOLCHAIN) + set(_OCTC ${OPENCMISS_INSTALL_DIR}/cmake/OCToolchainCompilers.cmake) + if (EXISTS "${_OCTC}") + include(${_OCTC}) + else() + message(WARNING "TOOLCHAIN specified but OpenCMISS config script could not be found at ${_OCTC}. Trying CMake defaults.") + endif() + unset(_OCTC) + endif() + set(OpenCMISS_DIR "${OPENCMISS_INSTALL_DIR}" CACHE PATH "Path to the found OpenCMISS (SDK) installation") +else() + message(WARNING "No OpenCMISS (SDK) installation directory detected. Using default system environment.") +endif() + \ No newline at end of file diff --git a/ClassicalField/ReactionDiffusion/CellMLSplitReactionDiffusion1D/build_debug/build.sh b/ClassicalField/ReactionDiffusion/CellMLSplitReactionDiffusion1D/build_debug/build.sh new file mode 100644 index 00000000..e6624bac --- /dev/null +++ b/ClassicalField/ReactionDiffusion/CellMLSplitReactionDiffusion1D/build_debug/build.sh @@ -0,0 +1,2 @@ +#ccc && cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all +cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all diff --git a/ClassicalField/ReactionDiffusion/ReactionDiffusionConstantSource1D/CMakeLists.txt b/ClassicalField/ReactionDiffusion/ReactionDiffusionConstantSource1D/CMakeLists.txt new file mode 100644 index 00000000..a22b61ee --- /dev/null +++ b/ClassicalField/ReactionDiffusion/ReactionDiffusionConstantSource1D/CMakeLists.txt @@ -0,0 +1,35 @@ +# 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 C) +enable_language(Fortran OPTIONAL) +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 +# ---------------------- +#add_subdirectory(C) +if (CMAKE_Fortran_COMPILER) + add_subdirectory(Fortran) +endif() diff --git a/ClassicalField/ReactionDiffusion/ReactionDiffusionConstantSource1D/Fortran/CMakeLists.txt b/ClassicalField/ReactionDiffusion/ReactionDiffusionConstantSource1D/Fortran/CMakeLists.txt new file mode 100644 index 00000000..ec4023e0 --- /dev/null +++ b/ClassicalField/ReactionDiffusion/ReactionDiffusionConstantSource1D/Fortran/CMakeLists.txt @@ -0,0 +1,60 @@ + +# Add example executable +add_executable(ReactionDiffusionConstantSource1D src/ReactionDiffusionConstantSource1DExample.f90) + +# Turn on Fortran preprocessing (#include directives) +if (MSVC) + set(PROC_OPT "/fpp") +else() + set(PROC_OPT "-cpp") +endif() + +# in debug mode, add flag that make Floating point exceptions fatal +set(OPT "") +if (FALSE) + if(CMAKE_BUILD_TYPE MATCHES DEBUG) + set(OPT "-ffpe-trap=invalid,zero,underflow,overflow,denormal") # GCC: make floating point exceptions fatal + endif() +endif() + +target_compile_options(ReactionDiffusionConstantSource1D PRIVATE ${PROC_OPT} ${OPT} "-fbacktrace") + +# Link to opencmiss +# ----------------- +# +# This simply uses the opencmiss target created by OC_INIT() above. +# +# Alternatively, you can also directly invoke 'find_package(Iron )' 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 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(ReactionDiffusionConstantSource1D PRIVATE opencmiss) + +# Add a simple test that runs the executable +add_test(NAME test_ReactionDiffusionConstantSource1D COMMAND ReactionDiffusionConstantSource1D) +add_opencmiss_environment(test_ReactionDiffusionConstantSource1D) + +################### +# 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. +# diff --git a/ClassicalField/ReactionDiffusion/ReactionDiffusionConstantSource1D/src/ReactionDiffusionConstantSource1DExample.f90 b/ClassicalField/ReactionDiffusion/ReactionDiffusionConstantSource1D/Fortran/src/ReactionDiffusionConstantSource1DExample.f90 similarity index 100% rename from ClassicalField/ReactionDiffusion/ReactionDiffusionConstantSource1D/src/ReactionDiffusionConstantSource1DExample.f90 rename to ClassicalField/ReactionDiffusion/ReactionDiffusionConstantSource1D/Fortran/src/ReactionDiffusionConstantSource1DExample.f90 diff --git a/ClassicalField/ReactionDiffusion/ReactionDiffusionConstantSource1D/OpenCMISS.cmake b/ClassicalField/ReactionDiffusion/ReactionDiffusionConstantSource1D/OpenCMISS.cmake new file mode 100644 index 00000000..3d6cf515 --- /dev/null +++ b/ClassicalField/ReactionDiffusion/ReactionDiffusionConstantSource1D/OpenCMISS.cmake @@ -0,0 +1,95 @@ +########################### +# *DO NOT CHANGE THIS FILE* +########################### +# +# Prepares the use of OpenCMISS by scanning at various path locations for OpenCMISS (SDK) installations. +# +# Search order: +# - OPENCMISS_INSTALL_DIR variable +# - OPENCMISS_INSTALL_DIR environment variable +# - OPENCMISS_SDK_DIR variable +# - OPENCMISS_SDK_DIR environment variable +# - [Windows only] The Registry is searched additionally for installed SDKs. +# +# If found +# - Includes the toolchain config script of the found opencmiss installation to enable toolchain selection logic (non-windows) + +# Convenience: The OPENCMISS_INSTALL_DIR may also be defined in the environment and various other places +if (DEFINED OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using specified installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The specified OPENCMISS_INSTALL_DIR '${OPENCMISS_INSTALL_DIR}' does not exist. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_INSTALL_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_INSTALL_DIR}" OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using environment installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The environment variable OPENCMISS_INSTALL_DIR='${OPENCMISS_INSTALL_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if (NOT OPENCMISS_INSTALL_DIR AND DEFINED OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The specified OPENCMISS_SDK_DIR '${OPENCMISS_SDK_DIR}' does not exist. Skipping.") + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_SDK_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_SDK_DIR}" OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using environment SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The environment variable OPENCMISS_SDK_DIR='${OPENCMISS_SDK_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_SDK_DIR) + endif() +endif() +# On windows: check the registry for installed OpenCMISS SDKs +if(NOT OPENCMISS_INSTALL_DIR AND WIN32) + foreach(ROOT HKEY_CURRENT_USER HKEY_LOCAL_MACHINE) + foreach(PACKAGE OpenCMISSUserSDK OpenCMISSDeveloperSDK) + set(_REG_KEY "[${ROOT}\\Software\\Auckland Bioengineering Institute\\${PACKAGE}]") + get_filename_component(OPENCMISS_INSTALL_DIR "${_REG_KEY}" ABSOLUTE) + #message(STATUS "Trying registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Found ${PACKAGE} in Windows registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + break() + else() + unset(OPENCMISS_INSTALL_DIR) + endif() + endforeach() + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + break() + endif() + endforeach() +endif() + +if(OPENCMISS_INSTALL_DIR) + message(STATUS "OPENCMISS_INSTALL_DIR=${OPENCMISS_INSTALL_DIR}") + # Use the OpenCMISS scripts to also allow choosing a separate toolchain + # This file is located at the opencmiss installation rather than the local example + # as it avoids file replication and makes maintenance much easier + if (TOOLCHAIN) + set(_OCTC ${OPENCMISS_INSTALL_DIR}/cmake/OCToolchainCompilers.cmake) + if (EXISTS "${_OCTC}") + include(${_OCTC}) + else() + message(WARNING "TOOLCHAIN specified but OpenCMISS config script could not be found at ${_OCTC}. Trying CMake defaults.") + endif() + unset(_OCTC) + endif() + set(OpenCMISS_DIR "${OPENCMISS_INSTALL_DIR}" CACHE PATH "Path to the found OpenCMISS (SDK) installation") +else() + message(WARNING "No OpenCMISS (SDK) installation directory detected. Using default system environment.") +endif() + \ No newline at end of file diff --git a/ClassicalField/ReactionDiffusion/ReactionDiffusionConstantSource1D/build_debug/build.sh b/ClassicalField/ReactionDiffusion/ReactionDiffusionConstantSource1D/build_debug/build.sh new file mode 100644 index 00000000..e6624bac --- /dev/null +++ b/ClassicalField/ReactionDiffusion/ReactionDiffusionConstantSource1D/build_debug/build.sh @@ -0,0 +1,2 @@ +#ccc && cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all +cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all diff --git a/ClassicalField/ReactionDiffusion/ReactionDiffusionNoSource1D/CMakeLists.txt b/ClassicalField/ReactionDiffusion/ReactionDiffusionNoSource1D/CMakeLists.txt new file mode 100644 index 00000000..a22b61ee --- /dev/null +++ b/ClassicalField/ReactionDiffusion/ReactionDiffusionNoSource1D/CMakeLists.txt @@ -0,0 +1,35 @@ +# 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 C) +enable_language(Fortran OPTIONAL) +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 +# ---------------------- +#add_subdirectory(C) +if (CMAKE_Fortran_COMPILER) + add_subdirectory(Fortran) +endif() diff --git a/ClassicalField/ReactionDiffusion/ReactionDiffusionNoSource1D/Fortran/CMakeLists.txt b/ClassicalField/ReactionDiffusion/ReactionDiffusionNoSource1D/Fortran/CMakeLists.txt new file mode 100644 index 00000000..e04a3c1b --- /dev/null +++ b/ClassicalField/ReactionDiffusion/ReactionDiffusionNoSource1D/Fortran/CMakeLists.txt @@ -0,0 +1,60 @@ + +# Add example executable +add_executable(ReactionDiffusionNoSource1D src/ReactionDiffusionNoSource1DExample.f90) + +# Turn on Fortran preprocessing (#include directives) +if (MSVC) + set(PROC_OPT "/fpp") +else() + set(PROC_OPT "-cpp") +endif() + +# in debug mode, add flag that make Floating point exceptions fatal +set(OPT "") +if (FALSE) + if(CMAKE_BUILD_TYPE MATCHES DEBUG) + set(OPT "-ffpe-trap=invalid,zero,underflow,overflow,denormal") # GCC: make floating point exceptions fatal + endif() +endif() + +target_compile_options(ReactionDiffusionNoSource1D PRIVATE ${PROC_OPT} ${OPT} "-fbacktrace") + +# Link to opencmiss +# ----------------- +# +# This simply uses the opencmiss target created by OC_INIT() above. +# +# Alternatively, you can also directly invoke 'find_package(Iron )' 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 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(ReactionDiffusionNoSource1D PRIVATE opencmiss) + +# Add a simple test that runs the executable +add_test(NAME test_ReactionDiffusionNoSource1D COMMAND ReactionDiffusionNoSource1D) +add_opencmiss_environment(test_ReactionDiffusionNoSource1D) + +################### +# 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. +# diff --git a/ClassicalField/ReactionDiffusion/ReactionDiffusionNoSource1D/src/ReactionDiffusionNoSource1DExample.f90 b/ClassicalField/ReactionDiffusion/ReactionDiffusionNoSource1D/Fortran/src/ReactionDiffusionNoSource1DExample.f90 similarity index 100% rename from ClassicalField/ReactionDiffusion/ReactionDiffusionNoSource1D/src/ReactionDiffusionNoSource1DExample.f90 rename to ClassicalField/ReactionDiffusion/ReactionDiffusionNoSource1D/Fortran/src/ReactionDiffusionNoSource1DExample.f90 diff --git a/ClassicalField/ReactionDiffusion/ReactionDiffusionNoSource1D/OpenCMISS.cmake b/ClassicalField/ReactionDiffusion/ReactionDiffusionNoSource1D/OpenCMISS.cmake new file mode 100644 index 00000000..3d6cf515 --- /dev/null +++ b/ClassicalField/ReactionDiffusion/ReactionDiffusionNoSource1D/OpenCMISS.cmake @@ -0,0 +1,95 @@ +########################### +# *DO NOT CHANGE THIS FILE* +########################### +# +# Prepares the use of OpenCMISS by scanning at various path locations for OpenCMISS (SDK) installations. +# +# Search order: +# - OPENCMISS_INSTALL_DIR variable +# - OPENCMISS_INSTALL_DIR environment variable +# - OPENCMISS_SDK_DIR variable +# - OPENCMISS_SDK_DIR environment variable +# - [Windows only] The Registry is searched additionally for installed SDKs. +# +# If found +# - Includes the toolchain config script of the found opencmiss installation to enable toolchain selection logic (non-windows) + +# Convenience: The OPENCMISS_INSTALL_DIR may also be defined in the environment and various other places +if (DEFINED OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using specified installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The specified OPENCMISS_INSTALL_DIR '${OPENCMISS_INSTALL_DIR}' does not exist. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_INSTALL_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_INSTALL_DIR}" OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using environment installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The environment variable OPENCMISS_INSTALL_DIR='${OPENCMISS_INSTALL_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if (NOT OPENCMISS_INSTALL_DIR AND DEFINED OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The specified OPENCMISS_SDK_DIR '${OPENCMISS_SDK_DIR}' does not exist. Skipping.") + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_SDK_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_SDK_DIR}" OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using environment SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The environment variable OPENCMISS_SDK_DIR='${OPENCMISS_SDK_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_SDK_DIR) + endif() +endif() +# On windows: check the registry for installed OpenCMISS SDKs +if(NOT OPENCMISS_INSTALL_DIR AND WIN32) + foreach(ROOT HKEY_CURRENT_USER HKEY_LOCAL_MACHINE) + foreach(PACKAGE OpenCMISSUserSDK OpenCMISSDeveloperSDK) + set(_REG_KEY "[${ROOT}\\Software\\Auckland Bioengineering Institute\\${PACKAGE}]") + get_filename_component(OPENCMISS_INSTALL_DIR "${_REG_KEY}" ABSOLUTE) + #message(STATUS "Trying registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Found ${PACKAGE} in Windows registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + break() + else() + unset(OPENCMISS_INSTALL_DIR) + endif() + endforeach() + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + break() + endif() + endforeach() +endif() + +if(OPENCMISS_INSTALL_DIR) + message(STATUS "OPENCMISS_INSTALL_DIR=${OPENCMISS_INSTALL_DIR}") + # Use the OpenCMISS scripts to also allow choosing a separate toolchain + # This file is located at the opencmiss installation rather than the local example + # as it avoids file replication and makes maintenance much easier + if (TOOLCHAIN) + set(_OCTC ${OPENCMISS_INSTALL_DIR}/cmake/OCToolchainCompilers.cmake) + if (EXISTS "${_OCTC}") + include(${_OCTC}) + else() + message(WARNING "TOOLCHAIN specified but OpenCMISS config script could not be found at ${_OCTC}. Trying CMake defaults.") + endif() + unset(_OCTC) + endif() + set(OpenCMISS_DIR "${OPENCMISS_INSTALL_DIR}" CACHE PATH "Path to the found OpenCMISS (SDK) installation") +else() + message(WARNING "No OpenCMISS (SDK) installation directory detected. Using default system environment.") +endif() + \ No newline at end of file diff --git a/ClassicalField/ReactionDiffusion/ReactionDiffusionNoSource1D/build_debug/build.sh b/ClassicalField/ReactionDiffusion/ReactionDiffusionNoSource1D/build_debug/build.sh new file mode 100644 index 00000000..e6624bac --- /dev/null +++ b/ClassicalField/ReactionDiffusion/ReactionDiffusionNoSource1D/build_debug/build.sh @@ -0,0 +1,2 @@ +#ccc && cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all +cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all diff --git a/DataAssimilation/DataAssimilationConstantSystem/CMakeLists.txt b/DataAssimilation/DataAssimilationConstantSystem/CMakeLists.txt new file mode 100644 index 00000000..a22b61ee --- /dev/null +++ b/DataAssimilation/DataAssimilationConstantSystem/CMakeLists.txt @@ -0,0 +1,35 @@ +# 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 C) +enable_language(Fortran OPTIONAL) +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 +# ---------------------- +#add_subdirectory(C) +if (CMAKE_Fortran_COMPILER) + add_subdirectory(Fortran) +endif() diff --git a/DataAssimilation/DataAssimilationConstantSystem/Fortran/CMakeLists.txt b/DataAssimilation/DataAssimilationConstantSystem/Fortran/CMakeLists.txt new file mode 100644 index 00000000..a9bdfada --- /dev/null +++ b/DataAssimilation/DataAssimilationConstantSystem/Fortran/CMakeLists.txt @@ -0,0 +1,60 @@ + +# Add example executable +add_executable(DataAssimilationConstantSystem src/data_assimilation_test01.cpp) + +# Turn on Fortran preprocessing (#include directives) +if (MSVC) + set(PROC_OPT "/fpp") +else() + set(PROC_OPT "-cpp") +endif() + +# in debug mode, add flag that make Floating point exceptions fatal +set(OPT "") +if (FALSE) + if(CMAKE_BUILD_TYPE MATCHES DEBUG) + set(OPT "-ffpe-trap=invalid,zero,underflow,overflow,denormal") # GCC: make floating point exceptions fatal + endif() +endif() + +target_compile_options(DataAssimilationConstantSystem PRIVATE ${PROC_OPT} ${OPT} "-fbacktrace") + +# Link to opencmiss +# ----------------- +# +# This simply uses the opencmiss target created by OC_INIT() above. +# +# Alternatively, you can also directly invoke 'find_package(Iron )' 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 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(DataAssimilationConstantSystem PRIVATE opencmiss) + +# Add a simple test that runs the executable +add_test(NAME test_DataAssimilationConstantSystem COMMAND DataAssimilationConstantSystem) +add_opencmiss_environment(test_DataAssimilationConstantSystem) + +################### +# 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. +# diff --git a/DataAssimilation/DataAssimilationConstantSystem/src/data_assimilation_test01.cpp b/DataAssimilation/DataAssimilationConstantSystem/Fortran/src/data_assimilation_test01.cpp similarity index 100% rename from DataAssimilation/DataAssimilationConstantSystem/src/data_assimilation_test01.cpp rename to DataAssimilation/DataAssimilationConstantSystem/Fortran/src/data_assimilation_test01.cpp diff --git a/DataAssimilation/DataAssimilationConstantSystem/OpenCMISS.cmake b/DataAssimilation/DataAssimilationConstantSystem/OpenCMISS.cmake new file mode 100644 index 00000000..3d6cf515 --- /dev/null +++ b/DataAssimilation/DataAssimilationConstantSystem/OpenCMISS.cmake @@ -0,0 +1,95 @@ +########################### +# *DO NOT CHANGE THIS FILE* +########################### +# +# Prepares the use of OpenCMISS by scanning at various path locations for OpenCMISS (SDK) installations. +# +# Search order: +# - OPENCMISS_INSTALL_DIR variable +# - OPENCMISS_INSTALL_DIR environment variable +# - OPENCMISS_SDK_DIR variable +# - OPENCMISS_SDK_DIR environment variable +# - [Windows only] The Registry is searched additionally for installed SDKs. +# +# If found +# - Includes the toolchain config script of the found opencmiss installation to enable toolchain selection logic (non-windows) + +# Convenience: The OPENCMISS_INSTALL_DIR may also be defined in the environment and various other places +if (DEFINED OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using specified installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The specified OPENCMISS_INSTALL_DIR '${OPENCMISS_INSTALL_DIR}' does not exist. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_INSTALL_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_INSTALL_DIR}" OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using environment installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The environment variable OPENCMISS_INSTALL_DIR='${OPENCMISS_INSTALL_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if (NOT OPENCMISS_INSTALL_DIR AND DEFINED OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The specified OPENCMISS_SDK_DIR '${OPENCMISS_SDK_DIR}' does not exist. Skipping.") + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_SDK_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_SDK_DIR}" OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using environment SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The environment variable OPENCMISS_SDK_DIR='${OPENCMISS_SDK_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_SDK_DIR) + endif() +endif() +# On windows: check the registry for installed OpenCMISS SDKs +if(NOT OPENCMISS_INSTALL_DIR AND WIN32) + foreach(ROOT HKEY_CURRENT_USER HKEY_LOCAL_MACHINE) + foreach(PACKAGE OpenCMISSUserSDK OpenCMISSDeveloperSDK) + set(_REG_KEY "[${ROOT}\\Software\\Auckland Bioengineering Institute\\${PACKAGE}]") + get_filename_component(OPENCMISS_INSTALL_DIR "${_REG_KEY}" ABSOLUTE) + #message(STATUS "Trying registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Found ${PACKAGE} in Windows registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + break() + else() + unset(OPENCMISS_INSTALL_DIR) + endif() + endforeach() + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + break() + endif() + endforeach() +endif() + +if(OPENCMISS_INSTALL_DIR) + message(STATUS "OPENCMISS_INSTALL_DIR=${OPENCMISS_INSTALL_DIR}") + # Use the OpenCMISS scripts to also allow choosing a separate toolchain + # This file is located at the opencmiss installation rather than the local example + # as it avoids file replication and makes maintenance much easier + if (TOOLCHAIN) + set(_OCTC ${OPENCMISS_INSTALL_DIR}/cmake/OCToolchainCompilers.cmake) + if (EXISTS "${_OCTC}") + include(${_OCTC}) + else() + message(WARNING "TOOLCHAIN specified but OpenCMISS config script could not be found at ${_OCTC}. Trying CMake defaults.") + endif() + unset(_OCTC) + endif() + set(OpenCMISS_DIR "${OPENCMISS_INSTALL_DIR}" CACHE PATH "Path to the found OpenCMISS (SDK) installation") +else() + message(WARNING "No OpenCMISS (SDK) installation directory detected. Using default system environment.") +endif() + \ No newline at end of file diff --git a/DataAssimilation/DataAssimilationConstantSystem/build_debug/build.sh b/DataAssimilation/DataAssimilationConstantSystem/build_debug/build.sh new file mode 100644 index 00000000..e6624bac --- /dev/null +++ b/DataAssimilation/DataAssimilationConstantSystem/build_debug/build.sh @@ -0,0 +1,2 @@ +#ccc && cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all +cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all diff --git a/DataAssimilation/DataAssimilationInflationGuccione/CMakeLists.txt b/DataAssimilation/DataAssimilationInflationGuccione/CMakeLists.txt new file mode 100644 index 00000000..a22b61ee --- /dev/null +++ b/DataAssimilation/DataAssimilationInflationGuccione/CMakeLists.txt @@ -0,0 +1,35 @@ +# 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 C) +enable_language(Fortran OPTIONAL) +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 +# ---------------------- +#add_subdirectory(C) +if (CMAKE_Fortran_COMPILER) + add_subdirectory(Fortran) +endif() diff --git a/DataAssimilation/DataAssimilationInflationGuccione/Fortran/CMakeLists.txt b/DataAssimilation/DataAssimilationInflationGuccione/Fortran/CMakeLists.txt new file mode 100644 index 00000000..5d85bb95 --- /dev/null +++ b/DataAssimilation/DataAssimilationInflationGuccione/Fortran/CMakeLists.txt @@ -0,0 +1,60 @@ + +# Add example executable +add_executable(DataAssimilationInflationGuccione src/DataAssimilationInflationGuccioneExample.f90) + +# Turn on Fortran preprocessing (#include directives) +if (MSVC) + set(PROC_OPT "/fpp") +else() + set(PROC_OPT "-cpp") +endif() + +# in debug mode, add flag that make Floating point exceptions fatal +set(OPT "") +if (FALSE) + if(CMAKE_BUILD_TYPE MATCHES DEBUG) + set(OPT "-ffpe-trap=invalid,zero,underflow,overflow,denormal") # GCC: make floating point exceptions fatal + endif() +endif() + +target_compile_options(DataAssimilationInflationGuccione PRIVATE ${PROC_OPT} ${OPT} "-fbacktrace") + +# Link to opencmiss +# ----------------- +# +# This simply uses the opencmiss target created by OC_INIT() above. +# +# Alternatively, you can also directly invoke 'find_package(Iron )' 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 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(DataAssimilationInflationGuccione PRIVATE opencmiss) + +# Add a simple test that runs the executable +add_test(NAME test_DataAssimilationInflationGuccione COMMAND DataAssimilationInflationGuccione) +add_opencmiss_environment(test_DataAssimilationInflationGuccione) + +################### +# 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. +# diff --git a/DataAssimilation/DataAssimilationInflationGuccione/src/DataAssimilationInflationGuccioneExample.f90 b/DataAssimilation/DataAssimilationInflationGuccione/Fortran/src/DataAssimilationInflationGuccioneExample.f90 similarity index 100% rename from DataAssimilation/DataAssimilationInflationGuccione/src/DataAssimilationInflationGuccioneExample.f90 rename to DataAssimilation/DataAssimilationInflationGuccione/Fortran/src/DataAssimilationInflationGuccioneExample.f90 diff --git a/DataAssimilation/DataAssimilationInflationGuccione/OpenCMISS.cmake b/DataAssimilation/DataAssimilationInflationGuccione/OpenCMISS.cmake new file mode 100644 index 00000000..3d6cf515 --- /dev/null +++ b/DataAssimilation/DataAssimilationInflationGuccione/OpenCMISS.cmake @@ -0,0 +1,95 @@ +########################### +# *DO NOT CHANGE THIS FILE* +########################### +# +# Prepares the use of OpenCMISS by scanning at various path locations for OpenCMISS (SDK) installations. +# +# Search order: +# - OPENCMISS_INSTALL_DIR variable +# - OPENCMISS_INSTALL_DIR environment variable +# - OPENCMISS_SDK_DIR variable +# - OPENCMISS_SDK_DIR environment variable +# - [Windows only] The Registry is searched additionally for installed SDKs. +# +# If found +# - Includes the toolchain config script of the found opencmiss installation to enable toolchain selection logic (non-windows) + +# Convenience: The OPENCMISS_INSTALL_DIR may also be defined in the environment and various other places +if (DEFINED OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using specified installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The specified OPENCMISS_INSTALL_DIR '${OPENCMISS_INSTALL_DIR}' does not exist. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_INSTALL_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_INSTALL_DIR}" OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using environment installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The environment variable OPENCMISS_INSTALL_DIR='${OPENCMISS_INSTALL_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if (NOT OPENCMISS_INSTALL_DIR AND DEFINED OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The specified OPENCMISS_SDK_DIR '${OPENCMISS_SDK_DIR}' does not exist. Skipping.") + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_SDK_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_SDK_DIR}" OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using environment SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The environment variable OPENCMISS_SDK_DIR='${OPENCMISS_SDK_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_SDK_DIR) + endif() +endif() +# On windows: check the registry for installed OpenCMISS SDKs +if(NOT OPENCMISS_INSTALL_DIR AND WIN32) + foreach(ROOT HKEY_CURRENT_USER HKEY_LOCAL_MACHINE) + foreach(PACKAGE OpenCMISSUserSDK OpenCMISSDeveloperSDK) + set(_REG_KEY "[${ROOT}\\Software\\Auckland Bioengineering Institute\\${PACKAGE}]") + get_filename_component(OPENCMISS_INSTALL_DIR "${_REG_KEY}" ABSOLUTE) + #message(STATUS "Trying registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Found ${PACKAGE} in Windows registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + break() + else() + unset(OPENCMISS_INSTALL_DIR) + endif() + endforeach() + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + break() + endif() + endforeach() +endif() + +if(OPENCMISS_INSTALL_DIR) + message(STATUS "OPENCMISS_INSTALL_DIR=${OPENCMISS_INSTALL_DIR}") + # Use the OpenCMISS scripts to also allow choosing a separate toolchain + # This file is located at the opencmiss installation rather than the local example + # as it avoids file replication and makes maintenance much easier + if (TOOLCHAIN) + set(_OCTC ${OPENCMISS_INSTALL_DIR}/cmake/OCToolchainCompilers.cmake) + if (EXISTS "${_OCTC}") + include(${_OCTC}) + else() + message(WARNING "TOOLCHAIN specified but OpenCMISS config script could not be found at ${_OCTC}. Trying CMake defaults.") + endif() + unset(_OCTC) + endif() + set(OpenCMISS_DIR "${OPENCMISS_INSTALL_DIR}" CACHE PATH "Path to the found OpenCMISS (SDK) installation") +else() + message(WARNING "No OpenCMISS (SDK) installation directory detected. Using default system environment.") +endif() + \ No newline at end of file diff --git a/DataAssimilation/DataAssimilationInflationGuccione/build_debug/build.sh b/DataAssimilation/DataAssimilationInflationGuccione/build_debug/build.sh new file mode 100644 index 00000000..e6624bac --- /dev/null +++ b/DataAssimilation/DataAssimilationInflationGuccione/build_debug/build.sh @@ -0,0 +1,2 @@ +#ccc && cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all +cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all diff --git a/DataAssimilation/DataAssimilationUniExtension/CMakeLists.txt b/DataAssimilation/DataAssimilationUniExtension/CMakeLists.txt new file mode 100644 index 00000000..a22b61ee --- /dev/null +++ b/DataAssimilation/DataAssimilationUniExtension/CMakeLists.txt @@ -0,0 +1,35 @@ +# 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 C) +enable_language(Fortran OPTIONAL) +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 +# ---------------------- +#add_subdirectory(C) +if (CMAKE_Fortran_COMPILER) + add_subdirectory(Fortran) +endif() diff --git a/DataAssimilation/DataAssimilationUniExtension/Fortran/CMakeLists.txt b/DataAssimilation/DataAssimilationUniExtension/Fortran/CMakeLists.txt new file mode 100644 index 00000000..b093fddf --- /dev/null +++ b/DataAssimilation/DataAssimilationUniExtension/Fortran/CMakeLists.txt @@ -0,0 +1,60 @@ + +# Add example executable +add_executable(DataAssimilationUniExtension src/UniAxialExtensionExample.f90 src/data_assimilation_uniextension.cpp src/data_assimilation_uniextension_OpenCMISS_test.cpp) + +# Turn on Fortran preprocessing (#include directives) +if (MSVC) + set(PROC_OPT "/fpp") +else() + set(PROC_OPT "-cpp") +endif() + +# in debug mode, add flag that make Floating point exceptions fatal +set(OPT "") +if (FALSE) + if(CMAKE_BUILD_TYPE MATCHES DEBUG) + set(OPT "-ffpe-trap=invalid,zero,underflow,overflow,denormal") # GCC: make floating point exceptions fatal + endif() +endif() + +target_compile_options(DataAssimilationUniExtension PRIVATE ${PROC_OPT} ${OPT} "-fbacktrace") + +# Link to opencmiss +# ----------------- +# +# This simply uses the opencmiss target created by OC_INIT() above. +# +# Alternatively, you can also directly invoke 'find_package(Iron )' 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 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(DataAssimilationUniExtension PRIVATE opencmiss) + +# Add a simple test that runs the executable +add_test(NAME test_DataAssimilationUniExtension COMMAND DataAssimilationUniExtension) +add_opencmiss_environment(test_DataAssimilationUniExtension) + +################### +# 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. +# diff --git a/DataAssimilation/DataAssimilationUniExtension/src/UniAxialExtensionExample.f90 b/DataAssimilation/DataAssimilationUniExtension/Fortran/src/UniAxialExtensionExample.f90 similarity index 100% rename from DataAssimilation/DataAssimilationUniExtension/src/UniAxialExtensionExample.f90 rename to DataAssimilation/DataAssimilationUniExtension/Fortran/src/UniAxialExtensionExample.f90 diff --git a/DataAssimilation/DataAssimilationUniExtension/src/data_assimilation_uniextension.cpp b/DataAssimilation/DataAssimilationUniExtension/Fortran/src/data_assimilation_uniextension.cpp similarity index 100% rename from DataAssimilation/DataAssimilationUniExtension/src/data_assimilation_uniextension.cpp rename to DataAssimilation/DataAssimilationUniExtension/Fortran/src/data_assimilation_uniextension.cpp diff --git a/DataAssimilation/DataAssimilationUniExtension/src/data_assimilation_uniextension_OpenCMISS_test.cpp b/DataAssimilation/DataAssimilationUniExtension/Fortran/src/data_assimilation_uniextension_OpenCMISS_test.cpp similarity index 100% rename from DataAssimilation/DataAssimilationUniExtension/src/data_assimilation_uniextension_OpenCMISS_test.cpp rename to DataAssimilation/DataAssimilationUniExtension/Fortran/src/data_assimilation_uniextension_OpenCMISS_test.cpp diff --git a/DataAssimilation/DataAssimilationUniExtension/OpenCMISS.cmake b/DataAssimilation/DataAssimilationUniExtension/OpenCMISS.cmake new file mode 100644 index 00000000..3d6cf515 --- /dev/null +++ b/DataAssimilation/DataAssimilationUniExtension/OpenCMISS.cmake @@ -0,0 +1,95 @@ +########################### +# *DO NOT CHANGE THIS FILE* +########################### +# +# Prepares the use of OpenCMISS by scanning at various path locations for OpenCMISS (SDK) installations. +# +# Search order: +# - OPENCMISS_INSTALL_DIR variable +# - OPENCMISS_INSTALL_DIR environment variable +# - OPENCMISS_SDK_DIR variable +# - OPENCMISS_SDK_DIR environment variable +# - [Windows only] The Registry is searched additionally for installed SDKs. +# +# If found +# - Includes the toolchain config script of the found opencmiss installation to enable toolchain selection logic (non-windows) + +# Convenience: The OPENCMISS_INSTALL_DIR may also be defined in the environment and various other places +if (DEFINED OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using specified installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The specified OPENCMISS_INSTALL_DIR '${OPENCMISS_INSTALL_DIR}' does not exist. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_INSTALL_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_INSTALL_DIR}" OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using environment installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The environment variable OPENCMISS_INSTALL_DIR='${OPENCMISS_INSTALL_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if (NOT OPENCMISS_INSTALL_DIR AND DEFINED OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The specified OPENCMISS_SDK_DIR '${OPENCMISS_SDK_DIR}' does not exist. Skipping.") + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_SDK_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_SDK_DIR}" OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using environment SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The environment variable OPENCMISS_SDK_DIR='${OPENCMISS_SDK_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_SDK_DIR) + endif() +endif() +# On windows: check the registry for installed OpenCMISS SDKs +if(NOT OPENCMISS_INSTALL_DIR AND WIN32) + foreach(ROOT HKEY_CURRENT_USER HKEY_LOCAL_MACHINE) + foreach(PACKAGE OpenCMISSUserSDK OpenCMISSDeveloperSDK) + set(_REG_KEY "[${ROOT}\\Software\\Auckland Bioengineering Institute\\${PACKAGE}]") + get_filename_component(OPENCMISS_INSTALL_DIR "${_REG_KEY}" ABSOLUTE) + #message(STATUS "Trying registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Found ${PACKAGE} in Windows registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + break() + else() + unset(OPENCMISS_INSTALL_DIR) + endif() + endforeach() + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + break() + endif() + endforeach() +endif() + +if(OPENCMISS_INSTALL_DIR) + message(STATUS "OPENCMISS_INSTALL_DIR=${OPENCMISS_INSTALL_DIR}") + # Use the OpenCMISS scripts to also allow choosing a separate toolchain + # This file is located at the opencmiss installation rather than the local example + # as it avoids file replication and makes maintenance much easier + if (TOOLCHAIN) + set(_OCTC ${OPENCMISS_INSTALL_DIR}/cmake/OCToolchainCompilers.cmake) + if (EXISTS "${_OCTC}") + include(${_OCTC}) + else() + message(WARNING "TOOLCHAIN specified but OpenCMISS config script could not be found at ${_OCTC}. Trying CMake defaults.") + endif() + unset(_OCTC) + endif() + set(OpenCMISS_DIR "${OPENCMISS_INSTALL_DIR}" CACHE PATH "Path to the found OpenCMISS (SDK) installation") +else() + message(WARNING "No OpenCMISS (SDK) installation directory detected. Using default system environment.") +endif() + \ No newline at end of file diff --git a/DataAssimilation/DataAssimilationUniExtension/build_debug/build.sh b/DataAssimilation/DataAssimilationUniExtension/build_debug/build.sh new file mode 100644 index 00000000..e6624bac --- /dev/null +++ b/DataAssimilation/DataAssimilationUniExtension/build_debug/build.sh @@ -0,0 +1,2 @@ +#ccc && cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all +cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all diff --git a/DataProjection/1DRectangularCartesian/CMakeLists.txt b/DataProjection/1DRectangularCartesian/CMakeLists.txt new file mode 100644 index 00000000..a22b61ee --- /dev/null +++ b/DataProjection/1DRectangularCartesian/CMakeLists.txt @@ -0,0 +1,35 @@ +# 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 C) +enable_language(Fortran OPTIONAL) +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 +# ---------------------- +#add_subdirectory(C) +if (CMAKE_Fortran_COMPILER) + add_subdirectory(Fortran) +endif() diff --git a/DataProjection/1DRectangularCartesian/Fortran/CMakeLists.txt b/DataProjection/1DRectangularCartesian/Fortran/CMakeLists.txt new file mode 100644 index 00000000..3ae6541c --- /dev/null +++ b/DataProjection/1DRectangularCartesian/Fortran/CMakeLists.txt @@ -0,0 +1,60 @@ + +# Add example executable +add_executable(1DRectangularCartesian src/1DRectangularCartesianExample.f90) + +# Turn on Fortran preprocessing (#include directives) +if (MSVC) + set(PROC_OPT "/fpp") +else() + set(PROC_OPT "-cpp") +endif() + +# in debug mode, add flag that make Floating point exceptions fatal +set(OPT "") +if (FALSE) + if(CMAKE_BUILD_TYPE MATCHES DEBUG) + set(OPT "-ffpe-trap=invalid,zero,underflow,overflow,denormal") # GCC: make floating point exceptions fatal + endif() +endif() + +target_compile_options(1DRectangularCartesian PRIVATE ${PROC_OPT} ${OPT} "-fbacktrace") + +# Link to opencmiss +# ----------------- +# +# This simply uses the opencmiss target created by OC_INIT() above. +# +# Alternatively, you can also directly invoke 'find_package(Iron )' 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 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(1DRectangularCartesian PRIVATE opencmiss) + +# Add a simple test that runs the executable +add_test(NAME test_1DRectangularCartesian COMMAND 1DRectangularCartesian) +add_opencmiss_environment(test_1DRectangularCartesian) + +################### +# 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. +# diff --git a/DataProjection/1DRectangularCartesian/src/1DRectangularCartesianExample.f90 b/DataProjection/1DRectangularCartesian/Fortran/src/1DRectangularCartesianExample.f90 similarity index 100% rename from DataProjection/1DRectangularCartesian/src/1DRectangularCartesianExample.f90 rename to DataProjection/1DRectangularCartesian/Fortran/src/1DRectangularCartesianExample.f90 diff --git a/DataProjection/1DRectangularCartesian/OpenCMISS.cmake b/DataProjection/1DRectangularCartesian/OpenCMISS.cmake new file mode 100644 index 00000000..3d6cf515 --- /dev/null +++ b/DataProjection/1DRectangularCartesian/OpenCMISS.cmake @@ -0,0 +1,95 @@ +########################### +# *DO NOT CHANGE THIS FILE* +########################### +# +# Prepares the use of OpenCMISS by scanning at various path locations for OpenCMISS (SDK) installations. +# +# Search order: +# - OPENCMISS_INSTALL_DIR variable +# - OPENCMISS_INSTALL_DIR environment variable +# - OPENCMISS_SDK_DIR variable +# - OPENCMISS_SDK_DIR environment variable +# - [Windows only] The Registry is searched additionally for installed SDKs. +# +# If found +# - Includes the toolchain config script of the found opencmiss installation to enable toolchain selection logic (non-windows) + +# Convenience: The OPENCMISS_INSTALL_DIR may also be defined in the environment and various other places +if (DEFINED OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using specified installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The specified OPENCMISS_INSTALL_DIR '${OPENCMISS_INSTALL_DIR}' does not exist. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_INSTALL_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_INSTALL_DIR}" OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using environment installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The environment variable OPENCMISS_INSTALL_DIR='${OPENCMISS_INSTALL_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if (NOT OPENCMISS_INSTALL_DIR AND DEFINED OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The specified OPENCMISS_SDK_DIR '${OPENCMISS_SDK_DIR}' does not exist. Skipping.") + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_SDK_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_SDK_DIR}" OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using environment SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The environment variable OPENCMISS_SDK_DIR='${OPENCMISS_SDK_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_SDK_DIR) + endif() +endif() +# On windows: check the registry for installed OpenCMISS SDKs +if(NOT OPENCMISS_INSTALL_DIR AND WIN32) + foreach(ROOT HKEY_CURRENT_USER HKEY_LOCAL_MACHINE) + foreach(PACKAGE OpenCMISSUserSDK OpenCMISSDeveloperSDK) + set(_REG_KEY "[${ROOT}\\Software\\Auckland Bioengineering Institute\\${PACKAGE}]") + get_filename_component(OPENCMISS_INSTALL_DIR "${_REG_KEY}" ABSOLUTE) + #message(STATUS "Trying registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Found ${PACKAGE} in Windows registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + break() + else() + unset(OPENCMISS_INSTALL_DIR) + endif() + endforeach() + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + break() + endif() + endforeach() +endif() + +if(OPENCMISS_INSTALL_DIR) + message(STATUS "OPENCMISS_INSTALL_DIR=${OPENCMISS_INSTALL_DIR}") + # Use the OpenCMISS scripts to also allow choosing a separate toolchain + # This file is located at the opencmiss installation rather than the local example + # as it avoids file replication and makes maintenance much easier + if (TOOLCHAIN) + set(_OCTC ${OPENCMISS_INSTALL_DIR}/cmake/OCToolchainCompilers.cmake) + if (EXISTS "${_OCTC}") + include(${_OCTC}) + else() + message(WARNING "TOOLCHAIN specified but OpenCMISS config script could not be found at ${_OCTC}. Trying CMake defaults.") + endif() + unset(_OCTC) + endif() + set(OpenCMISS_DIR "${OPENCMISS_INSTALL_DIR}" CACHE PATH "Path to the found OpenCMISS (SDK) installation") +else() + message(WARNING "No OpenCMISS (SDK) installation directory detected. Using default system environment.") +endif() + \ No newline at end of file diff --git a/DataProjection/1DRectangularCartesian/build_debug/build.sh b/DataProjection/1DRectangularCartesian/build_debug/build.sh new file mode 100644 index 00000000..e6624bac --- /dev/null +++ b/DataProjection/1DRectangularCartesian/build_debug/build.sh @@ -0,0 +1,2 @@ +#ccc && cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all +cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all diff --git a/DataProjection/2DRectangularCartesian/CMakeLists.txt b/DataProjection/2DRectangularCartesian/CMakeLists.txt new file mode 100644 index 00000000..a22b61ee --- /dev/null +++ b/DataProjection/2DRectangularCartesian/CMakeLists.txt @@ -0,0 +1,35 @@ +# 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 C) +enable_language(Fortran OPTIONAL) +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 +# ---------------------- +#add_subdirectory(C) +if (CMAKE_Fortran_COMPILER) + add_subdirectory(Fortran) +endif() diff --git a/DataProjection/2DRectangularCartesian/Fortran/CMakeLists.txt b/DataProjection/2DRectangularCartesian/Fortran/CMakeLists.txt new file mode 100644 index 00000000..82af0215 --- /dev/null +++ b/DataProjection/2DRectangularCartesian/Fortran/CMakeLists.txt @@ -0,0 +1,60 @@ + +# Add example executable +add_executable(2DRectangularCartesian src/2DRectangularCartesianExample.f90) + +# Turn on Fortran preprocessing (#include directives) +if (MSVC) + set(PROC_OPT "/fpp") +else() + set(PROC_OPT "-cpp") +endif() + +# in debug mode, add flag that make Floating point exceptions fatal +set(OPT "") +if (FALSE) + if(CMAKE_BUILD_TYPE MATCHES DEBUG) + set(OPT "-ffpe-trap=invalid,zero,underflow,overflow,denormal") # GCC: make floating point exceptions fatal + endif() +endif() + +target_compile_options(2DRectangularCartesian PRIVATE ${PROC_OPT} ${OPT} "-fbacktrace") + +# Link to opencmiss +# ----------------- +# +# This simply uses the opencmiss target created by OC_INIT() above. +# +# Alternatively, you can also directly invoke 'find_package(Iron )' 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 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(2DRectangularCartesian PRIVATE opencmiss) + +# Add a simple test that runs the executable +add_test(NAME test_2DRectangularCartesian COMMAND 2DRectangularCartesian) +add_opencmiss_environment(test_2DRectangularCartesian) + +################### +# 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. +# diff --git a/DataProjection/2DRectangularCartesian/src/2DRectangularCartesianExample.f90 b/DataProjection/2DRectangularCartesian/Fortran/src/2DRectangularCartesianExample.f90 similarity index 100% rename from DataProjection/2DRectangularCartesian/src/2DRectangularCartesianExample.f90 rename to DataProjection/2DRectangularCartesian/Fortran/src/2DRectangularCartesianExample.f90 diff --git a/DataProjection/2DRectangularCartesian/OpenCMISS.cmake b/DataProjection/2DRectangularCartesian/OpenCMISS.cmake new file mode 100644 index 00000000..3d6cf515 --- /dev/null +++ b/DataProjection/2DRectangularCartesian/OpenCMISS.cmake @@ -0,0 +1,95 @@ +########################### +# *DO NOT CHANGE THIS FILE* +########################### +# +# Prepares the use of OpenCMISS by scanning at various path locations for OpenCMISS (SDK) installations. +# +# Search order: +# - OPENCMISS_INSTALL_DIR variable +# - OPENCMISS_INSTALL_DIR environment variable +# - OPENCMISS_SDK_DIR variable +# - OPENCMISS_SDK_DIR environment variable +# - [Windows only] The Registry is searched additionally for installed SDKs. +# +# If found +# - Includes the toolchain config script of the found opencmiss installation to enable toolchain selection logic (non-windows) + +# Convenience: The OPENCMISS_INSTALL_DIR may also be defined in the environment and various other places +if (DEFINED OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using specified installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The specified OPENCMISS_INSTALL_DIR '${OPENCMISS_INSTALL_DIR}' does not exist. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_INSTALL_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_INSTALL_DIR}" OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using environment installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The environment variable OPENCMISS_INSTALL_DIR='${OPENCMISS_INSTALL_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if (NOT OPENCMISS_INSTALL_DIR AND DEFINED OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The specified OPENCMISS_SDK_DIR '${OPENCMISS_SDK_DIR}' does not exist. Skipping.") + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_SDK_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_SDK_DIR}" OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using environment SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The environment variable OPENCMISS_SDK_DIR='${OPENCMISS_SDK_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_SDK_DIR) + endif() +endif() +# On windows: check the registry for installed OpenCMISS SDKs +if(NOT OPENCMISS_INSTALL_DIR AND WIN32) + foreach(ROOT HKEY_CURRENT_USER HKEY_LOCAL_MACHINE) + foreach(PACKAGE OpenCMISSUserSDK OpenCMISSDeveloperSDK) + set(_REG_KEY "[${ROOT}\\Software\\Auckland Bioengineering Institute\\${PACKAGE}]") + get_filename_component(OPENCMISS_INSTALL_DIR "${_REG_KEY}" ABSOLUTE) + #message(STATUS "Trying registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Found ${PACKAGE} in Windows registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + break() + else() + unset(OPENCMISS_INSTALL_DIR) + endif() + endforeach() + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + break() + endif() + endforeach() +endif() + +if(OPENCMISS_INSTALL_DIR) + message(STATUS "OPENCMISS_INSTALL_DIR=${OPENCMISS_INSTALL_DIR}") + # Use the OpenCMISS scripts to also allow choosing a separate toolchain + # This file is located at the opencmiss installation rather than the local example + # as it avoids file replication and makes maintenance much easier + if (TOOLCHAIN) + set(_OCTC ${OPENCMISS_INSTALL_DIR}/cmake/OCToolchainCompilers.cmake) + if (EXISTS "${_OCTC}") + include(${_OCTC}) + else() + message(WARNING "TOOLCHAIN specified but OpenCMISS config script could not be found at ${_OCTC}. Trying CMake defaults.") + endif() + unset(_OCTC) + endif() + set(OpenCMISS_DIR "${OPENCMISS_INSTALL_DIR}" CACHE PATH "Path to the found OpenCMISS (SDK) installation") +else() + message(WARNING "No OpenCMISS (SDK) installation directory detected. Using default system environment.") +endif() + \ No newline at end of file diff --git a/DataProjection/2DRectangularCartesian/build_debug/build.sh b/DataProjection/2DRectangularCartesian/build_debug/build.sh new file mode 100644 index 00000000..e6624bac --- /dev/null +++ b/DataProjection/2DRectangularCartesian/build_debug/build.sh @@ -0,0 +1,2 @@ +#ccc && cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all +cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all diff --git a/DataProjection/3DRectangularCartesian/CMakeLists.txt b/DataProjection/3DRectangularCartesian/CMakeLists.txt new file mode 100644 index 00000000..a22b61ee --- /dev/null +++ b/DataProjection/3DRectangularCartesian/CMakeLists.txt @@ -0,0 +1,35 @@ +# 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 C) +enable_language(Fortran OPTIONAL) +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 +# ---------------------- +#add_subdirectory(C) +if (CMAKE_Fortran_COMPILER) + add_subdirectory(Fortran) +endif() diff --git a/DataProjection/3DRectangularCartesian/Fortran/CMakeLists.txt b/DataProjection/3DRectangularCartesian/Fortran/CMakeLists.txt new file mode 100644 index 00000000..a49ffa5b --- /dev/null +++ b/DataProjection/3DRectangularCartesian/Fortran/CMakeLists.txt @@ -0,0 +1,60 @@ + +# Add example executable +add_executable(3DRectangularCartesian src/3DRectangularCartesianExample.f90) + +# Turn on Fortran preprocessing (#include directives) +if (MSVC) + set(PROC_OPT "/fpp") +else() + set(PROC_OPT "-cpp") +endif() + +# in debug mode, add flag that make Floating point exceptions fatal +set(OPT "") +if (FALSE) + if(CMAKE_BUILD_TYPE MATCHES DEBUG) + set(OPT "-ffpe-trap=invalid,zero,underflow,overflow,denormal") # GCC: make floating point exceptions fatal + endif() +endif() + +target_compile_options(3DRectangularCartesian PRIVATE ${PROC_OPT} ${OPT} "-fbacktrace") + +# Link to opencmiss +# ----------------- +# +# This simply uses the opencmiss target created by OC_INIT() above. +# +# Alternatively, you can also directly invoke 'find_package(Iron )' 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 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(3DRectangularCartesian PRIVATE opencmiss) + +# Add a simple test that runs the executable +add_test(NAME test_3DRectangularCartesian COMMAND 3DRectangularCartesian) +add_opencmiss_environment(test_3DRectangularCartesian) + +################### +# 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. +# diff --git a/DataProjection/3DRectangularCartesian/src/3DRectangularCartesianExample.f90 b/DataProjection/3DRectangularCartesian/Fortran/src/3DRectangularCartesianExample.f90 similarity index 100% rename from DataProjection/3DRectangularCartesian/src/3DRectangularCartesianExample.f90 rename to DataProjection/3DRectangularCartesian/Fortran/src/3DRectangularCartesianExample.f90 diff --git a/DataProjection/3DRectangularCartesian/OpenCMISS.cmake b/DataProjection/3DRectangularCartesian/OpenCMISS.cmake new file mode 100644 index 00000000..3d6cf515 --- /dev/null +++ b/DataProjection/3DRectangularCartesian/OpenCMISS.cmake @@ -0,0 +1,95 @@ +########################### +# *DO NOT CHANGE THIS FILE* +########################### +# +# Prepares the use of OpenCMISS by scanning at various path locations for OpenCMISS (SDK) installations. +# +# Search order: +# - OPENCMISS_INSTALL_DIR variable +# - OPENCMISS_INSTALL_DIR environment variable +# - OPENCMISS_SDK_DIR variable +# - OPENCMISS_SDK_DIR environment variable +# - [Windows only] The Registry is searched additionally for installed SDKs. +# +# If found +# - Includes the toolchain config script of the found opencmiss installation to enable toolchain selection logic (non-windows) + +# Convenience: The OPENCMISS_INSTALL_DIR may also be defined in the environment and various other places +if (DEFINED OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using specified installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The specified OPENCMISS_INSTALL_DIR '${OPENCMISS_INSTALL_DIR}' does not exist. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_INSTALL_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_INSTALL_DIR}" OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using environment installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The environment variable OPENCMISS_INSTALL_DIR='${OPENCMISS_INSTALL_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if (NOT OPENCMISS_INSTALL_DIR AND DEFINED OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The specified OPENCMISS_SDK_DIR '${OPENCMISS_SDK_DIR}' does not exist. Skipping.") + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_SDK_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_SDK_DIR}" OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using environment SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The environment variable OPENCMISS_SDK_DIR='${OPENCMISS_SDK_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_SDK_DIR) + endif() +endif() +# On windows: check the registry for installed OpenCMISS SDKs +if(NOT OPENCMISS_INSTALL_DIR AND WIN32) + foreach(ROOT HKEY_CURRENT_USER HKEY_LOCAL_MACHINE) + foreach(PACKAGE OpenCMISSUserSDK OpenCMISSDeveloperSDK) + set(_REG_KEY "[${ROOT}\\Software\\Auckland Bioengineering Institute\\${PACKAGE}]") + get_filename_component(OPENCMISS_INSTALL_DIR "${_REG_KEY}" ABSOLUTE) + #message(STATUS "Trying registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Found ${PACKAGE} in Windows registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + break() + else() + unset(OPENCMISS_INSTALL_DIR) + endif() + endforeach() + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + break() + endif() + endforeach() +endif() + +if(OPENCMISS_INSTALL_DIR) + message(STATUS "OPENCMISS_INSTALL_DIR=${OPENCMISS_INSTALL_DIR}") + # Use the OpenCMISS scripts to also allow choosing a separate toolchain + # This file is located at the opencmiss installation rather than the local example + # as it avoids file replication and makes maintenance much easier + if (TOOLCHAIN) + set(_OCTC ${OPENCMISS_INSTALL_DIR}/cmake/OCToolchainCompilers.cmake) + if (EXISTS "${_OCTC}") + include(${_OCTC}) + else() + message(WARNING "TOOLCHAIN specified but OpenCMISS config script could not be found at ${_OCTC}. Trying CMake defaults.") + endif() + unset(_OCTC) + endif() + set(OpenCMISS_DIR "${OPENCMISS_INSTALL_DIR}" CACHE PATH "Path to the found OpenCMISS (SDK) installation") +else() + message(WARNING "No OpenCMISS (SDK) installation directory detected. Using default system environment.") +endif() + \ No newline at end of file diff --git a/DataProjection/3DRectangularCartesian/build_debug/build.sh b/DataProjection/3DRectangularCartesian/build_debug/build.sh new file mode 100644 index 00000000..e6624bac --- /dev/null +++ b/DataProjection/3DRectangularCartesian/build_debug/build.sh @@ -0,0 +1,2 @@ +#ccc && cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all +cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all diff --git a/EmbeddedMesh/EmbeddedMeshBasic/CMakeLists.txt b/EmbeddedMesh/EmbeddedMeshBasic/CMakeLists.txt new file mode 100644 index 00000000..a22b61ee --- /dev/null +++ b/EmbeddedMesh/EmbeddedMeshBasic/CMakeLists.txt @@ -0,0 +1,35 @@ +# 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 C) +enable_language(Fortran OPTIONAL) +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 +# ---------------------- +#add_subdirectory(C) +if (CMAKE_Fortran_COMPILER) + add_subdirectory(Fortran) +endif() diff --git a/EmbeddedMesh/EmbeddedMeshBasic/Fortran/CMakeLists.txt b/EmbeddedMesh/EmbeddedMeshBasic/Fortran/CMakeLists.txt new file mode 100644 index 00000000..5753765d --- /dev/null +++ b/EmbeddedMesh/EmbeddedMeshBasic/Fortran/CMakeLists.txt @@ -0,0 +1,60 @@ + +# Add example executable +add_executable(EmbeddedMeshBasic src/EmbeddedMeshBasicExample.f90) + +# Turn on Fortran preprocessing (#include directives) +if (MSVC) + set(PROC_OPT "/fpp") +else() + set(PROC_OPT "-cpp") +endif() + +# in debug mode, add flag that make Floating point exceptions fatal +set(OPT "") +if (FALSE) + if(CMAKE_BUILD_TYPE MATCHES DEBUG) + set(OPT "-ffpe-trap=invalid,zero,underflow,overflow,denormal") # GCC: make floating point exceptions fatal + endif() +endif() + +target_compile_options(EmbeddedMeshBasic PRIVATE ${PROC_OPT} ${OPT} "-fbacktrace") + +# Link to opencmiss +# ----------------- +# +# This simply uses the opencmiss target created by OC_INIT() above. +# +# Alternatively, you can also directly invoke 'find_package(Iron )' 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 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(EmbeddedMeshBasic PRIVATE opencmiss) + +# Add a simple test that runs the executable +add_test(NAME test_EmbeddedMeshBasic COMMAND EmbeddedMeshBasic) +add_opencmiss_environment(test_EmbeddedMeshBasic) + +################### +# 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. +# diff --git a/EmbeddedMesh/EmbeddedMeshBasic/src/EmbeddedMeshBasicExample.f90 b/EmbeddedMesh/EmbeddedMeshBasic/Fortran/src/EmbeddedMeshBasicExample.f90 similarity index 100% rename from EmbeddedMesh/EmbeddedMeshBasic/src/EmbeddedMeshBasicExample.f90 rename to EmbeddedMesh/EmbeddedMeshBasic/Fortran/src/EmbeddedMeshBasicExample.f90 diff --git a/EmbeddedMesh/EmbeddedMeshBasic/OpenCMISS.cmake b/EmbeddedMesh/EmbeddedMeshBasic/OpenCMISS.cmake new file mode 100644 index 00000000..3d6cf515 --- /dev/null +++ b/EmbeddedMesh/EmbeddedMeshBasic/OpenCMISS.cmake @@ -0,0 +1,95 @@ +########################### +# *DO NOT CHANGE THIS FILE* +########################### +# +# Prepares the use of OpenCMISS by scanning at various path locations for OpenCMISS (SDK) installations. +# +# Search order: +# - OPENCMISS_INSTALL_DIR variable +# - OPENCMISS_INSTALL_DIR environment variable +# - OPENCMISS_SDK_DIR variable +# - OPENCMISS_SDK_DIR environment variable +# - [Windows only] The Registry is searched additionally for installed SDKs. +# +# If found +# - Includes the toolchain config script of the found opencmiss installation to enable toolchain selection logic (non-windows) + +# Convenience: The OPENCMISS_INSTALL_DIR may also be defined in the environment and various other places +if (DEFINED OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using specified installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The specified OPENCMISS_INSTALL_DIR '${OPENCMISS_INSTALL_DIR}' does not exist. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_INSTALL_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_INSTALL_DIR}" OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using environment installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The environment variable OPENCMISS_INSTALL_DIR='${OPENCMISS_INSTALL_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if (NOT OPENCMISS_INSTALL_DIR AND DEFINED OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The specified OPENCMISS_SDK_DIR '${OPENCMISS_SDK_DIR}' does not exist. Skipping.") + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_SDK_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_SDK_DIR}" OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using environment SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The environment variable OPENCMISS_SDK_DIR='${OPENCMISS_SDK_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_SDK_DIR) + endif() +endif() +# On windows: check the registry for installed OpenCMISS SDKs +if(NOT OPENCMISS_INSTALL_DIR AND WIN32) + foreach(ROOT HKEY_CURRENT_USER HKEY_LOCAL_MACHINE) + foreach(PACKAGE OpenCMISSUserSDK OpenCMISSDeveloperSDK) + set(_REG_KEY "[${ROOT}\\Software\\Auckland Bioengineering Institute\\${PACKAGE}]") + get_filename_component(OPENCMISS_INSTALL_DIR "${_REG_KEY}" ABSOLUTE) + #message(STATUS "Trying registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Found ${PACKAGE} in Windows registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + break() + else() + unset(OPENCMISS_INSTALL_DIR) + endif() + endforeach() + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + break() + endif() + endforeach() +endif() + +if(OPENCMISS_INSTALL_DIR) + message(STATUS "OPENCMISS_INSTALL_DIR=${OPENCMISS_INSTALL_DIR}") + # Use the OpenCMISS scripts to also allow choosing a separate toolchain + # This file is located at the opencmiss installation rather than the local example + # as it avoids file replication and makes maintenance much easier + if (TOOLCHAIN) + set(_OCTC ${OPENCMISS_INSTALL_DIR}/cmake/OCToolchainCompilers.cmake) + if (EXISTS "${_OCTC}") + include(${_OCTC}) + else() + message(WARNING "TOOLCHAIN specified but OpenCMISS config script could not be found at ${_OCTC}. Trying CMake defaults.") + endif() + unset(_OCTC) + endif() + set(OpenCMISS_DIR "${OPENCMISS_INSTALL_DIR}" CACHE PATH "Path to the found OpenCMISS (SDK) installation") +else() + message(WARNING "No OpenCMISS (SDK) installation directory detected. Using default system environment.") +endif() + \ No newline at end of file diff --git a/EmbeddedMesh/EmbeddedMeshBasic/build_debug/build.sh b/EmbeddedMesh/EmbeddedMeshBasic/build_debug/build.sh new file mode 100644 index 00000000..e6624bac --- /dev/null +++ b/EmbeddedMesh/EmbeddedMeshBasic/build_debug/build.sh @@ -0,0 +1,2 @@ +#ccc && cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all +cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all diff --git a/EmbeddedMesh/EmbeddedMeshBasicWithMap/CMakeLists.txt b/EmbeddedMesh/EmbeddedMeshBasicWithMap/CMakeLists.txt new file mode 100644 index 00000000..a22b61ee --- /dev/null +++ b/EmbeddedMesh/EmbeddedMeshBasicWithMap/CMakeLists.txt @@ -0,0 +1,35 @@ +# 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 C) +enable_language(Fortran OPTIONAL) +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 +# ---------------------- +#add_subdirectory(C) +if (CMAKE_Fortran_COMPILER) + add_subdirectory(Fortran) +endif() diff --git a/EmbeddedMesh/EmbeddedMeshBasicWithMap/Fortran/CMakeLists.txt b/EmbeddedMesh/EmbeddedMeshBasicWithMap/Fortran/CMakeLists.txt new file mode 100644 index 00000000..42d6f24f --- /dev/null +++ b/EmbeddedMesh/EmbeddedMeshBasicWithMap/Fortran/CMakeLists.txt @@ -0,0 +1,60 @@ + +# Add example executable +add_executable(EmbeddedMeshBasicWithMap src/EmbeddedMeshBasicWithMapExample.f90) + +# Turn on Fortran preprocessing (#include directives) +if (MSVC) + set(PROC_OPT "/fpp") +else() + set(PROC_OPT "-cpp") +endif() + +# in debug mode, add flag that make Floating point exceptions fatal +set(OPT "") +if (FALSE) + if(CMAKE_BUILD_TYPE MATCHES DEBUG) + set(OPT "-ffpe-trap=invalid,zero,underflow,overflow,denormal") # GCC: make floating point exceptions fatal + endif() +endif() + +target_compile_options(EmbeddedMeshBasicWithMap PRIVATE ${PROC_OPT} ${OPT} "-fbacktrace") + +# Link to opencmiss +# ----------------- +# +# This simply uses the opencmiss target created by OC_INIT() above. +# +# Alternatively, you can also directly invoke 'find_package(Iron )' 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 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(EmbeddedMeshBasicWithMap PRIVATE opencmiss) + +# Add a simple test that runs the executable +add_test(NAME test_EmbeddedMeshBasicWithMap COMMAND EmbeddedMeshBasicWithMap) +add_opencmiss_environment(test_EmbeddedMeshBasicWithMap) + +################### +# 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. +# diff --git a/EmbeddedMesh/EmbeddedMeshBasicWithMap/src/EmbeddedMeshBasicWithMapExample.f90 b/EmbeddedMesh/EmbeddedMeshBasicWithMap/Fortran/src/EmbeddedMeshBasicWithMapExample.f90 similarity index 100% rename from EmbeddedMesh/EmbeddedMeshBasicWithMap/src/EmbeddedMeshBasicWithMapExample.f90 rename to EmbeddedMesh/EmbeddedMeshBasicWithMap/Fortran/src/EmbeddedMeshBasicWithMapExample.f90 diff --git a/EmbeddedMesh/EmbeddedMeshBasicWithMap/OpenCMISS.cmake b/EmbeddedMesh/EmbeddedMeshBasicWithMap/OpenCMISS.cmake new file mode 100644 index 00000000..3d6cf515 --- /dev/null +++ b/EmbeddedMesh/EmbeddedMeshBasicWithMap/OpenCMISS.cmake @@ -0,0 +1,95 @@ +########################### +# *DO NOT CHANGE THIS FILE* +########################### +# +# Prepares the use of OpenCMISS by scanning at various path locations for OpenCMISS (SDK) installations. +# +# Search order: +# - OPENCMISS_INSTALL_DIR variable +# - OPENCMISS_INSTALL_DIR environment variable +# - OPENCMISS_SDK_DIR variable +# - OPENCMISS_SDK_DIR environment variable +# - [Windows only] The Registry is searched additionally for installed SDKs. +# +# If found +# - Includes the toolchain config script of the found opencmiss installation to enable toolchain selection logic (non-windows) + +# Convenience: The OPENCMISS_INSTALL_DIR may also be defined in the environment and various other places +if (DEFINED OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using specified installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The specified OPENCMISS_INSTALL_DIR '${OPENCMISS_INSTALL_DIR}' does not exist. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_INSTALL_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_INSTALL_DIR}" OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using environment installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The environment variable OPENCMISS_INSTALL_DIR='${OPENCMISS_INSTALL_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if (NOT OPENCMISS_INSTALL_DIR AND DEFINED OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The specified OPENCMISS_SDK_DIR '${OPENCMISS_SDK_DIR}' does not exist. Skipping.") + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_SDK_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_SDK_DIR}" OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using environment SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The environment variable OPENCMISS_SDK_DIR='${OPENCMISS_SDK_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_SDK_DIR) + endif() +endif() +# On windows: check the registry for installed OpenCMISS SDKs +if(NOT OPENCMISS_INSTALL_DIR AND WIN32) + foreach(ROOT HKEY_CURRENT_USER HKEY_LOCAL_MACHINE) + foreach(PACKAGE OpenCMISSUserSDK OpenCMISSDeveloperSDK) + set(_REG_KEY "[${ROOT}\\Software\\Auckland Bioengineering Institute\\${PACKAGE}]") + get_filename_component(OPENCMISS_INSTALL_DIR "${_REG_KEY}" ABSOLUTE) + #message(STATUS "Trying registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Found ${PACKAGE} in Windows registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + break() + else() + unset(OPENCMISS_INSTALL_DIR) + endif() + endforeach() + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + break() + endif() + endforeach() +endif() + +if(OPENCMISS_INSTALL_DIR) + message(STATUS "OPENCMISS_INSTALL_DIR=${OPENCMISS_INSTALL_DIR}") + # Use the OpenCMISS scripts to also allow choosing a separate toolchain + # This file is located at the opencmiss installation rather than the local example + # as it avoids file replication and makes maintenance much easier + if (TOOLCHAIN) + set(_OCTC ${OPENCMISS_INSTALL_DIR}/cmake/OCToolchainCompilers.cmake) + if (EXISTS "${_OCTC}") + include(${_OCTC}) + else() + message(WARNING "TOOLCHAIN specified but OpenCMISS config script could not be found at ${_OCTC}. Trying CMake defaults.") + endif() + unset(_OCTC) + endif() + set(OpenCMISS_DIR "${OPENCMISS_INSTALL_DIR}" CACHE PATH "Path to the found OpenCMISS (SDK) installation") +else() + message(WARNING "No OpenCMISS (SDK) installation directory detected. Using default system environment.") +endif() + \ No newline at end of file diff --git a/EmbeddedMesh/EmbeddedMeshBasicWithMap/build_debug/build.sh b/EmbeddedMesh/EmbeddedMeshBasicWithMap/build_debug/build.sh new file mode 100644 index 00000000..e6624bac --- /dev/null +++ b/EmbeddedMesh/EmbeddedMeshBasicWithMap/build_debug/build.sh @@ -0,0 +1,2 @@ +#ccc && cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all +cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all diff --git a/FiniteElasticity/ActiveContraction/CMakeLists.txt b/FiniteElasticity/ActiveContraction/CMakeLists.txt new file mode 100644 index 00000000..a22b61ee --- /dev/null +++ b/FiniteElasticity/ActiveContraction/CMakeLists.txt @@ -0,0 +1,35 @@ +# 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 C) +enable_language(Fortran OPTIONAL) +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 +# ---------------------- +#add_subdirectory(C) +if (CMAKE_Fortran_COMPILER) + add_subdirectory(Fortran) +endif() diff --git a/FiniteElasticity/ActiveContraction/Fortran/CMakeLists.txt b/FiniteElasticity/ActiveContraction/Fortran/CMakeLists.txt new file mode 100644 index 00000000..34b2789e --- /dev/null +++ b/FiniteElasticity/ActiveContraction/Fortran/CMakeLists.txt @@ -0,0 +1,60 @@ + +# Add example executable +add_executable(ActiveContraction src/ActiveContractionExample.f90) + +# Turn on Fortran preprocessing (#include directives) +if (MSVC) + set(PROC_OPT "/fpp") +else() + set(PROC_OPT "-cpp") +endif() + +# in debug mode, add flag that make Floating point exceptions fatal +set(OPT "") +if (FALSE) + if(CMAKE_BUILD_TYPE MATCHES DEBUG) + set(OPT "-ffpe-trap=invalid,zero,underflow,overflow,denormal") # GCC: make floating point exceptions fatal + endif() +endif() + +target_compile_options(ActiveContraction PRIVATE ${PROC_OPT} ${OPT} "-fbacktrace") + +# Link to opencmiss +# ----------------- +# +# This simply uses the opencmiss target created by OC_INIT() above. +# +# Alternatively, you can also directly invoke 'find_package(Iron )' 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 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(ActiveContraction PRIVATE opencmiss) + +# Add a simple test that runs the executable +add_test(NAME test_ActiveContraction COMMAND ActiveContraction) +add_opencmiss_environment(test_ActiveContraction) + +################### +# 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. +# diff --git a/FiniteElasticity/ActiveContraction/src/ActiveContractionExample.f90 b/FiniteElasticity/ActiveContraction/Fortran/src/ActiveContractionExample.f90 similarity index 100% rename from FiniteElasticity/ActiveContraction/src/ActiveContractionExample.f90 rename to FiniteElasticity/ActiveContraction/Fortran/src/ActiveContractionExample.f90 diff --git a/FiniteElasticity/ActiveContraction/OpenCMISS.cmake b/FiniteElasticity/ActiveContraction/OpenCMISS.cmake new file mode 100644 index 00000000..3d6cf515 --- /dev/null +++ b/FiniteElasticity/ActiveContraction/OpenCMISS.cmake @@ -0,0 +1,95 @@ +########################### +# *DO NOT CHANGE THIS FILE* +########################### +# +# Prepares the use of OpenCMISS by scanning at various path locations for OpenCMISS (SDK) installations. +# +# Search order: +# - OPENCMISS_INSTALL_DIR variable +# - OPENCMISS_INSTALL_DIR environment variable +# - OPENCMISS_SDK_DIR variable +# - OPENCMISS_SDK_DIR environment variable +# - [Windows only] The Registry is searched additionally for installed SDKs. +# +# If found +# - Includes the toolchain config script of the found opencmiss installation to enable toolchain selection logic (non-windows) + +# Convenience: The OPENCMISS_INSTALL_DIR may also be defined in the environment and various other places +if (DEFINED OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using specified installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The specified OPENCMISS_INSTALL_DIR '${OPENCMISS_INSTALL_DIR}' does not exist. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_INSTALL_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_INSTALL_DIR}" OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using environment installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The environment variable OPENCMISS_INSTALL_DIR='${OPENCMISS_INSTALL_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if (NOT OPENCMISS_INSTALL_DIR AND DEFINED OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The specified OPENCMISS_SDK_DIR '${OPENCMISS_SDK_DIR}' does not exist. Skipping.") + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_SDK_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_SDK_DIR}" OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using environment SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The environment variable OPENCMISS_SDK_DIR='${OPENCMISS_SDK_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_SDK_DIR) + endif() +endif() +# On windows: check the registry for installed OpenCMISS SDKs +if(NOT OPENCMISS_INSTALL_DIR AND WIN32) + foreach(ROOT HKEY_CURRENT_USER HKEY_LOCAL_MACHINE) + foreach(PACKAGE OpenCMISSUserSDK OpenCMISSDeveloperSDK) + set(_REG_KEY "[${ROOT}\\Software\\Auckland Bioengineering Institute\\${PACKAGE}]") + get_filename_component(OPENCMISS_INSTALL_DIR "${_REG_KEY}" ABSOLUTE) + #message(STATUS "Trying registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Found ${PACKAGE} in Windows registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + break() + else() + unset(OPENCMISS_INSTALL_DIR) + endif() + endforeach() + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + break() + endif() + endforeach() +endif() + +if(OPENCMISS_INSTALL_DIR) + message(STATUS "OPENCMISS_INSTALL_DIR=${OPENCMISS_INSTALL_DIR}") + # Use the OpenCMISS scripts to also allow choosing a separate toolchain + # This file is located at the opencmiss installation rather than the local example + # as it avoids file replication and makes maintenance much easier + if (TOOLCHAIN) + set(_OCTC ${OPENCMISS_INSTALL_DIR}/cmake/OCToolchainCompilers.cmake) + if (EXISTS "${_OCTC}") + include(${_OCTC}) + else() + message(WARNING "TOOLCHAIN specified but OpenCMISS config script could not be found at ${_OCTC}. Trying CMake defaults.") + endif() + unset(_OCTC) + endif() + set(OpenCMISS_DIR "${OPENCMISS_INSTALL_DIR}" CACHE PATH "Path to the found OpenCMISS (SDK) installation") +else() + message(WARNING "No OpenCMISS (SDK) installation directory detected. Using default system environment.") +endif() + \ No newline at end of file diff --git a/FiniteElasticity/ActiveContraction/build_debug/build.sh b/FiniteElasticity/ActiveContraction/build_debug/build.sh new file mode 100644 index 00000000..e6624bac --- /dev/null +++ b/FiniteElasticity/ActiveContraction/build_debug/build.sh @@ -0,0 +1,2 @@ +#ccc && cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all +cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all diff --git a/FiniteElasticity/Cantilever/CMakeLists.txt b/FiniteElasticity/Cantilever/CMakeLists.txt new file mode 100644 index 00000000..a22b61ee --- /dev/null +++ b/FiniteElasticity/Cantilever/CMakeLists.txt @@ -0,0 +1,35 @@ +# 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 C) +enable_language(Fortran OPTIONAL) +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 +# ---------------------- +#add_subdirectory(C) +if (CMAKE_Fortran_COMPILER) + add_subdirectory(Fortran) +endif() diff --git a/FiniteElasticity/Cantilever/Fortran/CMakeLists.txt b/FiniteElasticity/Cantilever/Fortran/CMakeLists.txt new file mode 100644 index 00000000..3120cf36 --- /dev/null +++ b/FiniteElasticity/Cantilever/Fortran/CMakeLists.txt @@ -0,0 +1,60 @@ + +# Add example executable +add_executable(Cantilever src/FortranExample.f90) + +# Turn on Fortran preprocessing (#include directives) +if (MSVC) + set(PROC_OPT "/fpp") +else() + set(PROC_OPT "-cpp") +endif() + +# in debug mode, add flag that make Floating point exceptions fatal +set(OPT "") +if (FALSE) + if(CMAKE_BUILD_TYPE MATCHES DEBUG) + set(OPT "-ffpe-trap=invalid,zero,underflow,overflow,denormal") # GCC: make floating point exceptions fatal + endif() +endif() + +target_compile_options(Cantilever PRIVATE ${PROC_OPT} ${OPT} "-fbacktrace") + +# Link to opencmiss +# ----------------- +# +# This simply uses the opencmiss target created by OC_INIT() above. +# +# Alternatively, you can also directly invoke 'find_package(Iron )' 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 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(Cantilever PRIVATE opencmiss) + +# Add a simple test that runs the executable +add_test(NAME test_Cantilever COMMAND Cantilever) +add_opencmiss_environment(test_Cantilever) + +################### +# 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. +# diff --git a/FiniteElasticity/Cantilever/OpenCMISS.cmake b/FiniteElasticity/Cantilever/OpenCMISS.cmake new file mode 100644 index 00000000..3d6cf515 --- /dev/null +++ b/FiniteElasticity/Cantilever/OpenCMISS.cmake @@ -0,0 +1,95 @@ +########################### +# *DO NOT CHANGE THIS FILE* +########################### +# +# Prepares the use of OpenCMISS by scanning at various path locations for OpenCMISS (SDK) installations. +# +# Search order: +# - OPENCMISS_INSTALL_DIR variable +# - OPENCMISS_INSTALL_DIR environment variable +# - OPENCMISS_SDK_DIR variable +# - OPENCMISS_SDK_DIR environment variable +# - [Windows only] The Registry is searched additionally for installed SDKs. +# +# If found +# - Includes the toolchain config script of the found opencmiss installation to enable toolchain selection logic (non-windows) + +# Convenience: The OPENCMISS_INSTALL_DIR may also be defined in the environment and various other places +if (DEFINED OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using specified installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The specified OPENCMISS_INSTALL_DIR '${OPENCMISS_INSTALL_DIR}' does not exist. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_INSTALL_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_INSTALL_DIR}" OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using environment installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The environment variable OPENCMISS_INSTALL_DIR='${OPENCMISS_INSTALL_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if (NOT OPENCMISS_INSTALL_DIR AND DEFINED OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The specified OPENCMISS_SDK_DIR '${OPENCMISS_SDK_DIR}' does not exist. Skipping.") + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_SDK_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_SDK_DIR}" OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using environment SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The environment variable OPENCMISS_SDK_DIR='${OPENCMISS_SDK_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_SDK_DIR) + endif() +endif() +# On windows: check the registry for installed OpenCMISS SDKs +if(NOT OPENCMISS_INSTALL_DIR AND WIN32) + foreach(ROOT HKEY_CURRENT_USER HKEY_LOCAL_MACHINE) + foreach(PACKAGE OpenCMISSUserSDK OpenCMISSDeveloperSDK) + set(_REG_KEY "[${ROOT}\\Software\\Auckland Bioengineering Institute\\${PACKAGE}]") + get_filename_component(OPENCMISS_INSTALL_DIR "${_REG_KEY}" ABSOLUTE) + #message(STATUS "Trying registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Found ${PACKAGE} in Windows registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + break() + else() + unset(OPENCMISS_INSTALL_DIR) + endif() + endforeach() + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + break() + endif() + endforeach() +endif() + +if(OPENCMISS_INSTALL_DIR) + message(STATUS "OPENCMISS_INSTALL_DIR=${OPENCMISS_INSTALL_DIR}") + # Use the OpenCMISS scripts to also allow choosing a separate toolchain + # This file is located at the opencmiss installation rather than the local example + # as it avoids file replication and makes maintenance much easier + if (TOOLCHAIN) + set(_OCTC ${OPENCMISS_INSTALL_DIR}/cmake/OCToolchainCompilers.cmake) + if (EXISTS "${_OCTC}") + include(${_OCTC}) + else() + message(WARNING "TOOLCHAIN specified but OpenCMISS config script could not be found at ${_OCTC}. Trying CMake defaults.") + endif() + unset(_OCTC) + endif() + set(OpenCMISS_DIR "${OPENCMISS_INSTALL_DIR}" CACHE PATH "Path to the found OpenCMISS (SDK) installation") +else() + message(WARNING "No OpenCMISS (SDK) installation directory detected. Using default system environment.") +endif() + \ No newline at end of file diff --git a/FiniteElasticity/Cantilever/build_debug/build.sh b/FiniteElasticity/Cantilever/build_debug/build.sh new file mode 100644 index 00000000..e6624bac --- /dev/null +++ b/FiniteElasticity/Cantilever/build_debug/build.sh @@ -0,0 +1,2 @@ +#ccc && cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all +cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all diff --git a/FiniteElasticity/CuboidGeneric/CMakeLists.txt b/FiniteElasticity/CuboidGeneric/CMakeLists.txt new file mode 100644 index 00000000..a22b61ee --- /dev/null +++ b/FiniteElasticity/CuboidGeneric/CMakeLists.txt @@ -0,0 +1,35 @@ +# 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 C) +enable_language(Fortran OPTIONAL) +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 +# ---------------------- +#add_subdirectory(C) +if (CMAKE_Fortran_COMPILER) + add_subdirectory(Fortran) +endif() diff --git a/FiniteElasticity/CuboidGeneric/Fortran/CMakeLists.txt b/FiniteElasticity/CuboidGeneric/Fortran/CMakeLists.txt new file mode 100644 index 00000000..1bac8dba --- /dev/null +++ b/FiniteElasticity/CuboidGeneric/Fortran/CMakeLists.txt @@ -0,0 +1,60 @@ + +# Add example executable +add_executable(CuboidGeneric src/CuboidGenericExample.f90) + +# Turn on Fortran preprocessing (#include directives) +if (MSVC) + set(PROC_OPT "/fpp") +else() + set(PROC_OPT "-cpp") +endif() + +# in debug mode, add flag that make Floating point exceptions fatal +set(OPT "") +if (FALSE) + if(CMAKE_BUILD_TYPE MATCHES DEBUG) + set(OPT "-ffpe-trap=invalid,zero,underflow,overflow,denormal") # GCC: make floating point exceptions fatal + endif() +endif() + +target_compile_options(CuboidGeneric PRIVATE ${PROC_OPT} ${OPT} "-fbacktrace") + +# Link to opencmiss +# ----------------- +# +# This simply uses the opencmiss target created by OC_INIT() above. +# +# Alternatively, you can also directly invoke 'find_package(Iron )' 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 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(CuboidGeneric PRIVATE opencmiss) + +# Add a simple test that runs the executable +add_test(NAME test_CuboidGeneric COMMAND CuboidGeneric) +add_opencmiss_environment(test_CuboidGeneric) + +################### +# 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. +# diff --git a/FiniteElasticity/CuboidGeneric/src/CuboidGenericExample.f90 b/FiniteElasticity/CuboidGeneric/Fortran/src/CuboidGenericExample.f90 similarity index 100% rename from FiniteElasticity/CuboidGeneric/src/CuboidGenericExample.f90 rename to FiniteElasticity/CuboidGeneric/Fortran/src/CuboidGenericExample.f90 diff --git a/FiniteElasticity/CuboidGeneric/OpenCMISS.cmake b/FiniteElasticity/CuboidGeneric/OpenCMISS.cmake new file mode 100644 index 00000000..3d6cf515 --- /dev/null +++ b/FiniteElasticity/CuboidGeneric/OpenCMISS.cmake @@ -0,0 +1,95 @@ +########################### +# *DO NOT CHANGE THIS FILE* +########################### +# +# Prepares the use of OpenCMISS by scanning at various path locations for OpenCMISS (SDK) installations. +# +# Search order: +# - OPENCMISS_INSTALL_DIR variable +# - OPENCMISS_INSTALL_DIR environment variable +# - OPENCMISS_SDK_DIR variable +# - OPENCMISS_SDK_DIR environment variable +# - [Windows only] The Registry is searched additionally for installed SDKs. +# +# If found +# - Includes the toolchain config script of the found opencmiss installation to enable toolchain selection logic (non-windows) + +# Convenience: The OPENCMISS_INSTALL_DIR may also be defined in the environment and various other places +if (DEFINED OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using specified installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The specified OPENCMISS_INSTALL_DIR '${OPENCMISS_INSTALL_DIR}' does not exist. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_INSTALL_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_INSTALL_DIR}" OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using environment installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The environment variable OPENCMISS_INSTALL_DIR='${OPENCMISS_INSTALL_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if (NOT OPENCMISS_INSTALL_DIR AND DEFINED OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The specified OPENCMISS_SDK_DIR '${OPENCMISS_SDK_DIR}' does not exist. Skipping.") + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_SDK_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_SDK_DIR}" OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using environment SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The environment variable OPENCMISS_SDK_DIR='${OPENCMISS_SDK_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_SDK_DIR) + endif() +endif() +# On windows: check the registry for installed OpenCMISS SDKs +if(NOT OPENCMISS_INSTALL_DIR AND WIN32) + foreach(ROOT HKEY_CURRENT_USER HKEY_LOCAL_MACHINE) + foreach(PACKAGE OpenCMISSUserSDK OpenCMISSDeveloperSDK) + set(_REG_KEY "[${ROOT}\\Software\\Auckland Bioengineering Institute\\${PACKAGE}]") + get_filename_component(OPENCMISS_INSTALL_DIR "${_REG_KEY}" ABSOLUTE) + #message(STATUS "Trying registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Found ${PACKAGE} in Windows registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + break() + else() + unset(OPENCMISS_INSTALL_DIR) + endif() + endforeach() + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + break() + endif() + endforeach() +endif() + +if(OPENCMISS_INSTALL_DIR) + message(STATUS "OPENCMISS_INSTALL_DIR=${OPENCMISS_INSTALL_DIR}") + # Use the OpenCMISS scripts to also allow choosing a separate toolchain + # This file is located at the opencmiss installation rather than the local example + # as it avoids file replication and makes maintenance much easier + if (TOOLCHAIN) + set(_OCTC ${OPENCMISS_INSTALL_DIR}/cmake/OCToolchainCompilers.cmake) + if (EXISTS "${_OCTC}") + include(${_OCTC}) + else() + message(WARNING "TOOLCHAIN specified but OpenCMISS config script could not be found at ${_OCTC}. Trying CMake defaults.") + endif() + unset(_OCTC) + endif() + set(OpenCMISS_DIR "${OPENCMISS_INSTALL_DIR}" CACHE PATH "Path to the found OpenCMISS (SDK) installation") +else() + message(WARNING "No OpenCMISS (SDK) installation directory detected. Using default system environment.") +endif() + \ No newline at end of file diff --git a/FiniteElasticity/CuboidGeneric/build_debug/build.sh b/FiniteElasticity/CuboidGeneric/build_debug/build.sh new file mode 100644 index 00000000..e6624bac --- /dev/null +++ b/FiniteElasticity/CuboidGeneric/build_debug/build.sh @@ -0,0 +1,2 @@ +#ccc && cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all +cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all diff --git a/FiniteElasticity/CylinderInflation/CMakeLists.txt b/FiniteElasticity/CylinderInflation/CMakeLists.txt new file mode 100644 index 00000000..a22b61ee --- /dev/null +++ b/FiniteElasticity/CylinderInflation/CMakeLists.txt @@ -0,0 +1,35 @@ +# 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 C) +enable_language(Fortran OPTIONAL) +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 +# ---------------------- +#add_subdirectory(C) +if (CMAKE_Fortran_COMPILER) + add_subdirectory(Fortran) +endif() diff --git a/FiniteElasticity/CylinderInflation/Fortran/CMakeLists.txt b/FiniteElasticity/CylinderInflation/Fortran/CMakeLists.txt new file mode 100644 index 00000000..f5120962 --- /dev/null +++ b/FiniteElasticity/CylinderInflation/Fortran/CMakeLists.txt @@ -0,0 +1,60 @@ + +# Add example executable +add_executable(CylinderInflation src/CylinderInflationExample.f90) + +# Turn on Fortran preprocessing (#include directives) +if (MSVC) + set(PROC_OPT "/fpp") +else() + set(PROC_OPT "-cpp") +endif() + +# in debug mode, add flag that make Floating point exceptions fatal +set(OPT "") +if (FALSE) + if(CMAKE_BUILD_TYPE MATCHES DEBUG) + set(OPT "-ffpe-trap=invalid,zero,underflow,overflow,denormal") # GCC: make floating point exceptions fatal + endif() +endif() + +target_compile_options(CylinderInflation PRIVATE ${PROC_OPT} ${OPT} "-fbacktrace") + +# Link to opencmiss +# ----------------- +# +# This simply uses the opencmiss target created by OC_INIT() above. +# +# Alternatively, you can also directly invoke 'find_package(Iron )' 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 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(CylinderInflation PRIVATE opencmiss) + +# Add a simple test that runs the executable +add_test(NAME test_CylinderInflation COMMAND CylinderInflation) +add_opencmiss_environment(test_CylinderInflation) + +################### +# 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. +# diff --git a/FiniteElasticity/CylinderInflation/src/CylinderInflationExample.f90 b/FiniteElasticity/CylinderInflation/Fortran/src/CylinderInflationExample.f90 similarity index 100% rename from FiniteElasticity/CylinderInflation/src/CylinderInflationExample.f90 rename to FiniteElasticity/CylinderInflation/Fortran/src/CylinderInflationExample.f90 diff --git a/FiniteElasticity/CylinderInflation/OpenCMISS.cmake b/FiniteElasticity/CylinderInflation/OpenCMISS.cmake new file mode 100644 index 00000000..3d6cf515 --- /dev/null +++ b/FiniteElasticity/CylinderInflation/OpenCMISS.cmake @@ -0,0 +1,95 @@ +########################### +# *DO NOT CHANGE THIS FILE* +########################### +# +# Prepares the use of OpenCMISS by scanning at various path locations for OpenCMISS (SDK) installations. +# +# Search order: +# - OPENCMISS_INSTALL_DIR variable +# - OPENCMISS_INSTALL_DIR environment variable +# - OPENCMISS_SDK_DIR variable +# - OPENCMISS_SDK_DIR environment variable +# - [Windows only] The Registry is searched additionally for installed SDKs. +# +# If found +# - Includes the toolchain config script of the found opencmiss installation to enable toolchain selection logic (non-windows) + +# Convenience: The OPENCMISS_INSTALL_DIR may also be defined in the environment and various other places +if (DEFINED OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using specified installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The specified OPENCMISS_INSTALL_DIR '${OPENCMISS_INSTALL_DIR}' does not exist. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_INSTALL_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_INSTALL_DIR}" OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using environment installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The environment variable OPENCMISS_INSTALL_DIR='${OPENCMISS_INSTALL_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if (NOT OPENCMISS_INSTALL_DIR AND DEFINED OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The specified OPENCMISS_SDK_DIR '${OPENCMISS_SDK_DIR}' does not exist. Skipping.") + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_SDK_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_SDK_DIR}" OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using environment SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The environment variable OPENCMISS_SDK_DIR='${OPENCMISS_SDK_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_SDK_DIR) + endif() +endif() +# On windows: check the registry for installed OpenCMISS SDKs +if(NOT OPENCMISS_INSTALL_DIR AND WIN32) + foreach(ROOT HKEY_CURRENT_USER HKEY_LOCAL_MACHINE) + foreach(PACKAGE OpenCMISSUserSDK OpenCMISSDeveloperSDK) + set(_REG_KEY "[${ROOT}\\Software\\Auckland Bioengineering Institute\\${PACKAGE}]") + get_filename_component(OPENCMISS_INSTALL_DIR "${_REG_KEY}" ABSOLUTE) + #message(STATUS "Trying registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Found ${PACKAGE} in Windows registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + break() + else() + unset(OPENCMISS_INSTALL_DIR) + endif() + endforeach() + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + break() + endif() + endforeach() +endif() + +if(OPENCMISS_INSTALL_DIR) + message(STATUS "OPENCMISS_INSTALL_DIR=${OPENCMISS_INSTALL_DIR}") + # Use the OpenCMISS scripts to also allow choosing a separate toolchain + # This file is located at the opencmiss installation rather than the local example + # as it avoids file replication and makes maintenance much easier + if (TOOLCHAIN) + set(_OCTC ${OPENCMISS_INSTALL_DIR}/cmake/OCToolchainCompilers.cmake) + if (EXISTS "${_OCTC}") + include(${_OCTC}) + else() + message(WARNING "TOOLCHAIN specified but OpenCMISS config script could not be found at ${_OCTC}. Trying CMake defaults.") + endif() + unset(_OCTC) + endif() + set(OpenCMISS_DIR "${OPENCMISS_INSTALL_DIR}" CACHE PATH "Path to the found OpenCMISS (SDK) installation") +else() + message(WARNING "No OpenCMISS (SDK) installation directory detected. Using default system environment.") +endif() + \ No newline at end of file diff --git a/FiniteElasticity/CylinderInflation/build_debug/build.sh b/FiniteElasticity/CylinderInflation/build_debug/build.sh new file mode 100644 index 00000000..e6624bac --- /dev/null +++ b/FiniteElasticity/CylinderInflation/build_debug/build.sh @@ -0,0 +1,2 @@ +#ccc && cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all +cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all diff --git a/FiniteElasticity/LargeUniAxialExtension/CMakeLists.txt b/FiniteElasticity/LargeUniAxialExtension/CMakeLists.txt new file mode 100644 index 00000000..a22b61ee --- /dev/null +++ b/FiniteElasticity/LargeUniAxialExtension/CMakeLists.txt @@ -0,0 +1,35 @@ +# 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 C) +enable_language(Fortran OPTIONAL) +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 +# ---------------------- +#add_subdirectory(C) +if (CMAKE_Fortran_COMPILER) + add_subdirectory(Fortran) +endif() diff --git a/FiniteElasticity/LargeUniAxialExtension/Fortran/CMakeLists.txt b/FiniteElasticity/LargeUniAxialExtension/Fortran/CMakeLists.txt new file mode 100644 index 00000000..754f3d3b --- /dev/null +++ b/FiniteElasticity/LargeUniAxialExtension/Fortran/CMakeLists.txt @@ -0,0 +1,60 @@ + +# Add example executable +add_executable(LargeUniAxialExtension src/FortranExample.f90) + +# Turn on Fortran preprocessing (#include directives) +if (MSVC) + set(PROC_OPT "/fpp") +else() + set(PROC_OPT "-cpp") +endif() + +# in debug mode, add flag that make Floating point exceptions fatal +set(OPT "") +if (FALSE) + if(CMAKE_BUILD_TYPE MATCHES DEBUG) + set(OPT "-ffpe-trap=invalid,zero,underflow,overflow,denormal") # GCC: make floating point exceptions fatal + endif() +endif() + +target_compile_options(LargeUniAxialExtension PRIVATE ${PROC_OPT} ${OPT} "-fbacktrace") + +# Link to opencmiss +# ----------------- +# +# This simply uses the opencmiss target created by OC_INIT() above. +# +# Alternatively, you can also directly invoke 'find_package(Iron )' 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 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(LargeUniAxialExtension PRIVATE opencmiss) + +# Add a simple test that runs the executable +add_test(NAME test_LargeUniAxialExtension COMMAND LargeUniAxialExtension) +add_opencmiss_environment(test_LargeUniAxialExtension) + +################### +# 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. +# diff --git a/FiniteElasticity/LargeUniAxialExtension/OpenCMISS.cmake b/FiniteElasticity/LargeUniAxialExtension/OpenCMISS.cmake new file mode 100644 index 00000000..3d6cf515 --- /dev/null +++ b/FiniteElasticity/LargeUniAxialExtension/OpenCMISS.cmake @@ -0,0 +1,95 @@ +########################### +# *DO NOT CHANGE THIS FILE* +########################### +# +# Prepares the use of OpenCMISS by scanning at various path locations for OpenCMISS (SDK) installations. +# +# Search order: +# - OPENCMISS_INSTALL_DIR variable +# - OPENCMISS_INSTALL_DIR environment variable +# - OPENCMISS_SDK_DIR variable +# - OPENCMISS_SDK_DIR environment variable +# - [Windows only] The Registry is searched additionally for installed SDKs. +# +# If found +# - Includes the toolchain config script of the found opencmiss installation to enable toolchain selection logic (non-windows) + +# Convenience: The OPENCMISS_INSTALL_DIR may also be defined in the environment and various other places +if (DEFINED OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using specified installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The specified OPENCMISS_INSTALL_DIR '${OPENCMISS_INSTALL_DIR}' does not exist. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_INSTALL_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_INSTALL_DIR}" OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using environment installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The environment variable OPENCMISS_INSTALL_DIR='${OPENCMISS_INSTALL_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if (NOT OPENCMISS_INSTALL_DIR AND DEFINED OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The specified OPENCMISS_SDK_DIR '${OPENCMISS_SDK_DIR}' does not exist. Skipping.") + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_SDK_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_SDK_DIR}" OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using environment SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The environment variable OPENCMISS_SDK_DIR='${OPENCMISS_SDK_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_SDK_DIR) + endif() +endif() +# On windows: check the registry for installed OpenCMISS SDKs +if(NOT OPENCMISS_INSTALL_DIR AND WIN32) + foreach(ROOT HKEY_CURRENT_USER HKEY_LOCAL_MACHINE) + foreach(PACKAGE OpenCMISSUserSDK OpenCMISSDeveloperSDK) + set(_REG_KEY "[${ROOT}\\Software\\Auckland Bioengineering Institute\\${PACKAGE}]") + get_filename_component(OPENCMISS_INSTALL_DIR "${_REG_KEY}" ABSOLUTE) + #message(STATUS "Trying registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Found ${PACKAGE} in Windows registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + break() + else() + unset(OPENCMISS_INSTALL_DIR) + endif() + endforeach() + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + break() + endif() + endforeach() +endif() + +if(OPENCMISS_INSTALL_DIR) + message(STATUS "OPENCMISS_INSTALL_DIR=${OPENCMISS_INSTALL_DIR}") + # Use the OpenCMISS scripts to also allow choosing a separate toolchain + # This file is located at the opencmiss installation rather than the local example + # as it avoids file replication and makes maintenance much easier + if (TOOLCHAIN) + set(_OCTC ${OPENCMISS_INSTALL_DIR}/cmake/OCToolchainCompilers.cmake) + if (EXISTS "${_OCTC}") + include(${_OCTC}) + else() + message(WARNING "TOOLCHAIN specified but OpenCMISS config script could not be found at ${_OCTC}. Trying CMake defaults.") + endif() + unset(_OCTC) + endif() + set(OpenCMISS_DIR "${OPENCMISS_INSTALL_DIR}" CACHE PATH "Path to the found OpenCMISS (SDK) installation") +else() + message(WARNING "No OpenCMISS (SDK) installation directory detected. Using default system environment.") +endif() + \ No newline at end of file diff --git a/FiniteElasticity/LargeUniAxialExtension/build_debug/build.sh b/FiniteElasticity/LargeUniAxialExtension/build_debug/build.sh new file mode 100644 index 00000000..e6624bac --- /dev/null +++ b/FiniteElasticity/LargeUniAxialExtension/build_debug/build.sh @@ -0,0 +1,2 @@ +#ccc && cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all +cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all diff --git a/FiniteElasticity/Membrane/MembraneExtension2DSpace/CMakeLists.txt b/FiniteElasticity/Membrane/MembraneExtension2DSpace/CMakeLists.txt new file mode 100644 index 00000000..a22b61ee --- /dev/null +++ b/FiniteElasticity/Membrane/MembraneExtension2DSpace/CMakeLists.txt @@ -0,0 +1,35 @@ +# 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 C) +enable_language(Fortran OPTIONAL) +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 +# ---------------------- +#add_subdirectory(C) +if (CMAKE_Fortran_COMPILER) + add_subdirectory(Fortran) +endif() diff --git a/FiniteElasticity/Membrane/MembraneExtension2DSpace/Fortran/CMakeLists.txt b/FiniteElasticity/Membrane/MembraneExtension2DSpace/Fortran/CMakeLists.txt new file mode 100644 index 00000000..946f4313 --- /dev/null +++ b/FiniteElasticity/Membrane/MembraneExtension2DSpace/Fortran/CMakeLists.txt @@ -0,0 +1,60 @@ + +# Add example executable +add_executable(MembraneExtension2DSpace src/MembraneExtension2DSpaceExample.f90) + +# Turn on Fortran preprocessing (#include directives) +if (MSVC) + set(PROC_OPT "/fpp") +else() + set(PROC_OPT "-cpp") +endif() + +# in debug mode, add flag that make Floating point exceptions fatal +set(OPT "") +if (FALSE) + if(CMAKE_BUILD_TYPE MATCHES DEBUG) + set(OPT "-ffpe-trap=invalid,zero,underflow,overflow,denormal") # GCC: make floating point exceptions fatal + endif() +endif() + +target_compile_options(MembraneExtension2DSpace PRIVATE ${PROC_OPT} ${OPT} "-fbacktrace") + +# Link to opencmiss +# ----------------- +# +# This simply uses the opencmiss target created by OC_INIT() above. +# +# Alternatively, you can also directly invoke 'find_package(Iron )' 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 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(MembraneExtension2DSpace PRIVATE opencmiss) + +# Add a simple test that runs the executable +add_test(NAME test_MembraneExtension2DSpace COMMAND MembraneExtension2DSpace) +add_opencmiss_environment(test_MembraneExtension2DSpace) + +################### +# 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. +# diff --git a/FiniteElasticity/Membrane/MembraneExtension2DSpace/src/MembraneExtension2DSpaceExample.f90 b/FiniteElasticity/Membrane/MembraneExtension2DSpace/Fortran/src/MembraneExtension2DSpaceExample.f90 similarity index 100% rename from FiniteElasticity/Membrane/MembraneExtension2DSpace/src/MembraneExtension2DSpaceExample.f90 rename to FiniteElasticity/Membrane/MembraneExtension2DSpace/Fortran/src/MembraneExtension2DSpaceExample.f90 diff --git a/FiniteElasticity/Membrane/MembraneExtension2DSpace/OpenCMISS.cmake b/FiniteElasticity/Membrane/MembraneExtension2DSpace/OpenCMISS.cmake new file mode 100644 index 00000000..3d6cf515 --- /dev/null +++ b/FiniteElasticity/Membrane/MembraneExtension2DSpace/OpenCMISS.cmake @@ -0,0 +1,95 @@ +########################### +# *DO NOT CHANGE THIS FILE* +########################### +# +# Prepares the use of OpenCMISS by scanning at various path locations for OpenCMISS (SDK) installations. +# +# Search order: +# - OPENCMISS_INSTALL_DIR variable +# - OPENCMISS_INSTALL_DIR environment variable +# - OPENCMISS_SDK_DIR variable +# - OPENCMISS_SDK_DIR environment variable +# - [Windows only] The Registry is searched additionally for installed SDKs. +# +# If found +# - Includes the toolchain config script of the found opencmiss installation to enable toolchain selection logic (non-windows) + +# Convenience: The OPENCMISS_INSTALL_DIR may also be defined in the environment and various other places +if (DEFINED OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using specified installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The specified OPENCMISS_INSTALL_DIR '${OPENCMISS_INSTALL_DIR}' does not exist. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_INSTALL_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_INSTALL_DIR}" OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using environment installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The environment variable OPENCMISS_INSTALL_DIR='${OPENCMISS_INSTALL_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if (NOT OPENCMISS_INSTALL_DIR AND DEFINED OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The specified OPENCMISS_SDK_DIR '${OPENCMISS_SDK_DIR}' does not exist. Skipping.") + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_SDK_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_SDK_DIR}" OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using environment SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The environment variable OPENCMISS_SDK_DIR='${OPENCMISS_SDK_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_SDK_DIR) + endif() +endif() +# On windows: check the registry for installed OpenCMISS SDKs +if(NOT OPENCMISS_INSTALL_DIR AND WIN32) + foreach(ROOT HKEY_CURRENT_USER HKEY_LOCAL_MACHINE) + foreach(PACKAGE OpenCMISSUserSDK OpenCMISSDeveloperSDK) + set(_REG_KEY "[${ROOT}\\Software\\Auckland Bioengineering Institute\\${PACKAGE}]") + get_filename_component(OPENCMISS_INSTALL_DIR "${_REG_KEY}" ABSOLUTE) + #message(STATUS "Trying registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Found ${PACKAGE} in Windows registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + break() + else() + unset(OPENCMISS_INSTALL_DIR) + endif() + endforeach() + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + break() + endif() + endforeach() +endif() + +if(OPENCMISS_INSTALL_DIR) + message(STATUS "OPENCMISS_INSTALL_DIR=${OPENCMISS_INSTALL_DIR}") + # Use the OpenCMISS scripts to also allow choosing a separate toolchain + # This file is located at the opencmiss installation rather than the local example + # as it avoids file replication and makes maintenance much easier + if (TOOLCHAIN) + set(_OCTC ${OPENCMISS_INSTALL_DIR}/cmake/OCToolchainCompilers.cmake) + if (EXISTS "${_OCTC}") + include(${_OCTC}) + else() + message(WARNING "TOOLCHAIN specified but OpenCMISS config script could not be found at ${_OCTC}. Trying CMake defaults.") + endif() + unset(_OCTC) + endif() + set(OpenCMISS_DIR "${OPENCMISS_INSTALL_DIR}" CACHE PATH "Path to the found OpenCMISS (SDK) installation") +else() + message(WARNING "No OpenCMISS (SDK) installation directory detected. Using default system environment.") +endif() + \ No newline at end of file diff --git a/FiniteElasticity/Membrane/MembraneExtension2DSpace/build_debug/build.sh b/FiniteElasticity/Membrane/MembraneExtension2DSpace/build_debug/build.sh new file mode 100644 index 00000000..e6624bac --- /dev/null +++ b/FiniteElasticity/Membrane/MembraneExtension2DSpace/build_debug/build.sh @@ -0,0 +1,2 @@ +#ccc && cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all +cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all diff --git a/FiniteElasticity/Membrane/MembraneExtension3DSpaceFlat/CMakeLists.txt b/FiniteElasticity/Membrane/MembraneExtension3DSpaceFlat/CMakeLists.txt new file mode 100644 index 00000000..a22b61ee --- /dev/null +++ b/FiniteElasticity/Membrane/MembraneExtension3DSpaceFlat/CMakeLists.txt @@ -0,0 +1,35 @@ +# 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 C) +enable_language(Fortran OPTIONAL) +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 +# ---------------------- +#add_subdirectory(C) +if (CMAKE_Fortran_COMPILER) + add_subdirectory(Fortran) +endif() diff --git a/FiniteElasticity/Membrane/MembraneExtension3DSpaceFlat/Fortran/CMakeLists.txt b/FiniteElasticity/Membrane/MembraneExtension3DSpaceFlat/Fortran/CMakeLists.txt new file mode 100644 index 00000000..532ac633 --- /dev/null +++ b/FiniteElasticity/Membrane/MembraneExtension3DSpaceFlat/Fortran/CMakeLists.txt @@ -0,0 +1,60 @@ + +# Add example executable +add_executable(MembraneExtension3DSpaceFlat src/MembraneExtension3DSpaceFlatExample.f90) + +# Turn on Fortran preprocessing (#include directives) +if (MSVC) + set(PROC_OPT "/fpp") +else() + set(PROC_OPT "-cpp") +endif() + +# in debug mode, add flag that make Floating point exceptions fatal +set(OPT "") +if (FALSE) + if(CMAKE_BUILD_TYPE MATCHES DEBUG) + set(OPT "-ffpe-trap=invalid,zero,underflow,overflow,denormal") # GCC: make floating point exceptions fatal + endif() +endif() + +target_compile_options(MembraneExtension3DSpaceFlat PRIVATE ${PROC_OPT} ${OPT} "-fbacktrace") + +# Link to opencmiss +# ----------------- +# +# This simply uses the opencmiss target created by OC_INIT() above. +# +# Alternatively, you can also directly invoke 'find_package(Iron )' 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 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(MembraneExtension3DSpaceFlat PRIVATE opencmiss) + +# Add a simple test that runs the executable +add_test(NAME test_MembraneExtension3DSpaceFlat COMMAND MembraneExtension3DSpaceFlat) +add_opencmiss_environment(test_MembraneExtension3DSpaceFlat) + +################### +# 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. +# diff --git a/FiniteElasticity/Membrane/MembraneExtension3DSpaceFlat/src/MembraneExtension3DSpaceFlatExample.f90 b/FiniteElasticity/Membrane/MembraneExtension3DSpaceFlat/Fortran/src/MembraneExtension3DSpaceFlatExample.f90 similarity index 100% rename from FiniteElasticity/Membrane/MembraneExtension3DSpaceFlat/src/MembraneExtension3DSpaceFlatExample.f90 rename to FiniteElasticity/Membrane/MembraneExtension3DSpaceFlat/Fortran/src/MembraneExtension3DSpaceFlatExample.f90 diff --git a/FiniteElasticity/Membrane/MembraneExtension3DSpaceFlat/OpenCMISS.cmake b/FiniteElasticity/Membrane/MembraneExtension3DSpaceFlat/OpenCMISS.cmake new file mode 100644 index 00000000..3d6cf515 --- /dev/null +++ b/FiniteElasticity/Membrane/MembraneExtension3DSpaceFlat/OpenCMISS.cmake @@ -0,0 +1,95 @@ +########################### +# *DO NOT CHANGE THIS FILE* +########################### +# +# Prepares the use of OpenCMISS by scanning at various path locations for OpenCMISS (SDK) installations. +# +# Search order: +# - OPENCMISS_INSTALL_DIR variable +# - OPENCMISS_INSTALL_DIR environment variable +# - OPENCMISS_SDK_DIR variable +# - OPENCMISS_SDK_DIR environment variable +# - [Windows only] The Registry is searched additionally for installed SDKs. +# +# If found +# - Includes the toolchain config script of the found opencmiss installation to enable toolchain selection logic (non-windows) + +# Convenience: The OPENCMISS_INSTALL_DIR may also be defined in the environment and various other places +if (DEFINED OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using specified installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The specified OPENCMISS_INSTALL_DIR '${OPENCMISS_INSTALL_DIR}' does not exist. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_INSTALL_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_INSTALL_DIR}" OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using environment installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The environment variable OPENCMISS_INSTALL_DIR='${OPENCMISS_INSTALL_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if (NOT OPENCMISS_INSTALL_DIR AND DEFINED OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The specified OPENCMISS_SDK_DIR '${OPENCMISS_SDK_DIR}' does not exist. Skipping.") + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_SDK_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_SDK_DIR}" OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using environment SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The environment variable OPENCMISS_SDK_DIR='${OPENCMISS_SDK_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_SDK_DIR) + endif() +endif() +# On windows: check the registry for installed OpenCMISS SDKs +if(NOT OPENCMISS_INSTALL_DIR AND WIN32) + foreach(ROOT HKEY_CURRENT_USER HKEY_LOCAL_MACHINE) + foreach(PACKAGE OpenCMISSUserSDK OpenCMISSDeveloperSDK) + set(_REG_KEY "[${ROOT}\\Software\\Auckland Bioengineering Institute\\${PACKAGE}]") + get_filename_component(OPENCMISS_INSTALL_DIR "${_REG_KEY}" ABSOLUTE) + #message(STATUS "Trying registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Found ${PACKAGE} in Windows registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + break() + else() + unset(OPENCMISS_INSTALL_DIR) + endif() + endforeach() + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + break() + endif() + endforeach() +endif() + +if(OPENCMISS_INSTALL_DIR) + message(STATUS "OPENCMISS_INSTALL_DIR=${OPENCMISS_INSTALL_DIR}") + # Use the OpenCMISS scripts to also allow choosing a separate toolchain + # This file is located at the opencmiss installation rather than the local example + # as it avoids file replication and makes maintenance much easier + if (TOOLCHAIN) + set(_OCTC ${OPENCMISS_INSTALL_DIR}/cmake/OCToolchainCompilers.cmake) + if (EXISTS "${_OCTC}") + include(${_OCTC}) + else() + message(WARNING "TOOLCHAIN specified but OpenCMISS config script could not be found at ${_OCTC}. Trying CMake defaults.") + endif() + unset(_OCTC) + endif() + set(OpenCMISS_DIR "${OPENCMISS_INSTALL_DIR}" CACHE PATH "Path to the found OpenCMISS (SDK) installation") +else() + message(WARNING "No OpenCMISS (SDK) installation directory detected. Using default system environment.") +endif() + \ No newline at end of file diff --git a/FiniteElasticity/Membrane/MembraneExtension3DSpaceFlat/build_debug/build.sh b/FiniteElasticity/Membrane/MembraneExtension3DSpaceFlat/build_debug/build.sh new file mode 100644 index 00000000..e6624bac --- /dev/null +++ b/FiniteElasticity/Membrane/MembraneExtension3DSpaceFlat/build_debug/build.sh @@ -0,0 +1,2 @@ +#ccc && cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all +cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all diff --git a/FiniteElasticity/Membrane/MembraneExtension3DSpaceTilted/CMakeLists.txt b/FiniteElasticity/Membrane/MembraneExtension3DSpaceTilted/CMakeLists.txt new file mode 100644 index 00000000..a22b61ee --- /dev/null +++ b/FiniteElasticity/Membrane/MembraneExtension3DSpaceTilted/CMakeLists.txt @@ -0,0 +1,35 @@ +# 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 C) +enable_language(Fortran OPTIONAL) +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 +# ---------------------- +#add_subdirectory(C) +if (CMAKE_Fortran_COMPILER) + add_subdirectory(Fortran) +endif() diff --git a/FiniteElasticity/Membrane/MembraneExtension3DSpaceTilted/Fortran/CMakeLists.txt b/FiniteElasticity/Membrane/MembraneExtension3DSpaceTilted/Fortran/CMakeLists.txt new file mode 100644 index 00000000..2d71d154 --- /dev/null +++ b/FiniteElasticity/Membrane/MembraneExtension3DSpaceTilted/Fortran/CMakeLists.txt @@ -0,0 +1,60 @@ + +# Add example executable +add_executable(MembraneExtension3DSpaceTilted src/MembraneExtension3DSpaceTiltedExample.f90) + +# Turn on Fortran preprocessing (#include directives) +if (MSVC) + set(PROC_OPT "/fpp") +else() + set(PROC_OPT "-cpp") +endif() + +# in debug mode, add flag that make Floating point exceptions fatal +set(OPT "") +if (FALSE) + if(CMAKE_BUILD_TYPE MATCHES DEBUG) + set(OPT "-ffpe-trap=invalid,zero,underflow,overflow,denormal") # GCC: make floating point exceptions fatal + endif() +endif() + +target_compile_options(MembraneExtension3DSpaceTilted PRIVATE ${PROC_OPT} ${OPT} "-fbacktrace") + +# Link to opencmiss +# ----------------- +# +# This simply uses the opencmiss target created by OC_INIT() above. +# +# Alternatively, you can also directly invoke 'find_package(Iron )' 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 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(MembraneExtension3DSpaceTilted PRIVATE opencmiss) + +# Add a simple test that runs the executable +add_test(NAME test_MembraneExtension3DSpaceTilted COMMAND MembraneExtension3DSpaceTilted) +add_opencmiss_environment(test_MembraneExtension3DSpaceTilted) + +################### +# 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. +# diff --git a/FiniteElasticity/Membrane/MembraneExtension3DSpaceTilted/src/MembraneExtension3DSpaceTiltedExample.f90 b/FiniteElasticity/Membrane/MembraneExtension3DSpaceTilted/Fortran/src/MembraneExtension3DSpaceTiltedExample.f90 similarity index 100% rename from FiniteElasticity/Membrane/MembraneExtension3DSpaceTilted/src/MembraneExtension3DSpaceTiltedExample.f90 rename to FiniteElasticity/Membrane/MembraneExtension3DSpaceTilted/Fortran/src/MembraneExtension3DSpaceTiltedExample.f90 diff --git a/FiniteElasticity/Membrane/MembraneExtension3DSpaceTilted/OpenCMISS.cmake b/FiniteElasticity/Membrane/MembraneExtension3DSpaceTilted/OpenCMISS.cmake new file mode 100644 index 00000000..3d6cf515 --- /dev/null +++ b/FiniteElasticity/Membrane/MembraneExtension3DSpaceTilted/OpenCMISS.cmake @@ -0,0 +1,95 @@ +########################### +# *DO NOT CHANGE THIS FILE* +########################### +# +# Prepares the use of OpenCMISS by scanning at various path locations for OpenCMISS (SDK) installations. +# +# Search order: +# - OPENCMISS_INSTALL_DIR variable +# - OPENCMISS_INSTALL_DIR environment variable +# - OPENCMISS_SDK_DIR variable +# - OPENCMISS_SDK_DIR environment variable +# - [Windows only] The Registry is searched additionally for installed SDKs. +# +# If found +# - Includes the toolchain config script of the found opencmiss installation to enable toolchain selection logic (non-windows) + +# Convenience: The OPENCMISS_INSTALL_DIR may also be defined in the environment and various other places +if (DEFINED OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using specified installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The specified OPENCMISS_INSTALL_DIR '${OPENCMISS_INSTALL_DIR}' does not exist. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_INSTALL_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_INSTALL_DIR}" OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using environment installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The environment variable OPENCMISS_INSTALL_DIR='${OPENCMISS_INSTALL_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if (NOT OPENCMISS_INSTALL_DIR AND DEFINED OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The specified OPENCMISS_SDK_DIR '${OPENCMISS_SDK_DIR}' does not exist. Skipping.") + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_SDK_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_SDK_DIR}" OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using environment SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The environment variable OPENCMISS_SDK_DIR='${OPENCMISS_SDK_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_SDK_DIR) + endif() +endif() +# On windows: check the registry for installed OpenCMISS SDKs +if(NOT OPENCMISS_INSTALL_DIR AND WIN32) + foreach(ROOT HKEY_CURRENT_USER HKEY_LOCAL_MACHINE) + foreach(PACKAGE OpenCMISSUserSDK OpenCMISSDeveloperSDK) + set(_REG_KEY "[${ROOT}\\Software\\Auckland Bioengineering Institute\\${PACKAGE}]") + get_filename_component(OPENCMISS_INSTALL_DIR "${_REG_KEY}" ABSOLUTE) + #message(STATUS "Trying registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Found ${PACKAGE} in Windows registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + break() + else() + unset(OPENCMISS_INSTALL_DIR) + endif() + endforeach() + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + break() + endif() + endforeach() +endif() + +if(OPENCMISS_INSTALL_DIR) + message(STATUS "OPENCMISS_INSTALL_DIR=${OPENCMISS_INSTALL_DIR}") + # Use the OpenCMISS scripts to also allow choosing a separate toolchain + # This file is located at the opencmiss installation rather than the local example + # as it avoids file replication and makes maintenance much easier + if (TOOLCHAIN) + set(_OCTC ${OPENCMISS_INSTALL_DIR}/cmake/OCToolchainCompilers.cmake) + if (EXISTS "${_OCTC}") + include(${_OCTC}) + else() + message(WARNING "TOOLCHAIN specified but OpenCMISS config script could not be found at ${_OCTC}. Trying CMake defaults.") + endif() + unset(_OCTC) + endif() + set(OpenCMISS_DIR "${OPENCMISS_INSTALL_DIR}" CACHE PATH "Path to the found OpenCMISS (SDK) installation") +else() + message(WARNING "No OpenCMISS (SDK) installation directory detected. Using default system environment.") +endif() + \ No newline at end of file diff --git a/FiniteElasticity/Membrane/MembraneExtension3DSpaceTilted/build_debug/build.sh b/FiniteElasticity/Membrane/MembraneExtension3DSpaceTilted/build_debug/build.sh new file mode 100644 index 00000000..e6624bac --- /dev/null +++ b/FiniteElasticity/Membrane/MembraneExtension3DSpaceTilted/build_debug/build.sh @@ -0,0 +1,2 @@ +#ccc && cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all +cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all diff --git a/FiniteElasticity/MixedBoundaryConditions/CMakeLists.txt b/FiniteElasticity/MixedBoundaryConditions/CMakeLists.txt new file mode 100644 index 00000000..a22b61ee --- /dev/null +++ b/FiniteElasticity/MixedBoundaryConditions/CMakeLists.txt @@ -0,0 +1,35 @@ +# 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 C) +enable_language(Fortran OPTIONAL) +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 +# ---------------------- +#add_subdirectory(C) +if (CMAKE_Fortran_COMPILER) + add_subdirectory(Fortran) +endif() diff --git a/FiniteElasticity/MixedBoundaryConditions/Fortran/CMakeLists.txt b/FiniteElasticity/MixedBoundaryConditions/Fortran/CMakeLists.txt new file mode 100644 index 00000000..62187105 --- /dev/null +++ b/FiniteElasticity/MixedBoundaryConditions/Fortran/CMakeLists.txt @@ -0,0 +1,60 @@ + +# Add example executable +add_executable(MixedBoundaryConditions src/MixedBoundaryConditionsExample.f90) + +# Turn on Fortran preprocessing (#include directives) +if (MSVC) + set(PROC_OPT "/fpp") +else() + set(PROC_OPT "-cpp") +endif() + +# in debug mode, add flag that make Floating point exceptions fatal +set(OPT "") +if (FALSE) + if(CMAKE_BUILD_TYPE MATCHES DEBUG) + set(OPT "-ffpe-trap=invalid,zero,underflow,overflow,denormal") # GCC: make floating point exceptions fatal + endif() +endif() + +target_compile_options(MixedBoundaryConditions PRIVATE ${PROC_OPT} ${OPT} "-fbacktrace") + +# Link to opencmiss +# ----------------- +# +# This simply uses the opencmiss target created by OC_INIT() above. +# +# Alternatively, you can also directly invoke 'find_package(Iron )' 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 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(MixedBoundaryConditions PRIVATE opencmiss) + +# Add a simple test that runs the executable +add_test(NAME test_MixedBoundaryConditions COMMAND MixedBoundaryConditions) +add_opencmiss_environment(test_MixedBoundaryConditions) + +################### +# 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. +# diff --git a/FiniteElasticity/MixedBoundaryConditions/src/MixedBoundaryConditionsExample.f90 b/FiniteElasticity/MixedBoundaryConditions/Fortran/src/MixedBoundaryConditionsExample.f90 similarity index 100% rename from FiniteElasticity/MixedBoundaryConditions/src/MixedBoundaryConditionsExample.f90 rename to FiniteElasticity/MixedBoundaryConditions/Fortran/src/MixedBoundaryConditionsExample.f90 diff --git a/FiniteElasticity/MixedBoundaryConditions/OpenCMISS.cmake b/FiniteElasticity/MixedBoundaryConditions/OpenCMISS.cmake new file mode 100644 index 00000000..3d6cf515 --- /dev/null +++ b/FiniteElasticity/MixedBoundaryConditions/OpenCMISS.cmake @@ -0,0 +1,95 @@ +########################### +# *DO NOT CHANGE THIS FILE* +########################### +# +# Prepares the use of OpenCMISS by scanning at various path locations for OpenCMISS (SDK) installations. +# +# Search order: +# - OPENCMISS_INSTALL_DIR variable +# - OPENCMISS_INSTALL_DIR environment variable +# - OPENCMISS_SDK_DIR variable +# - OPENCMISS_SDK_DIR environment variable +# - [Windows only] The Registry is searched additionally for installed SDKs. +# +# If found +# - Includes the toolchain config script of the found opencmiss installation to enable toolchain selection logic (non-windows) + +# Convenience: The OPENCMISS_INSTALL_DIR may also be defined in the environment and various other places +if (DEFINED OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using specified installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The specified OPENCMISS_INSTALL_DIR '${OPENCMISS_INSTALL_DIR}' does not exist. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_INSTALL_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_INSTALL_DIR}" OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using environment installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The environment variable OPENCMISS_INSTALL_DIR='${OPENCMISS_INSTALL_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if (NOT OPENCMISS_INSTALL_DIR AND DEFINED OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The specified OPENCMISS_SDK_DIR '${OPENCMISS_SDK_DIR}' does not exist. Skipping.") + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_SDK_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_SDK_DIR}" OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using environment SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The environment variable OPENCMISS_SDK_DIR='${OPENCMISS_SDK_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_SDK_DIR) + endif() +endif() +# On windows: check the registry for installed OpenCMISS SDKs +if(NOT OPENCMISS_INSTALL_DIR AND WIN32) + foreach(ROOT HKEY_CURRENT_USER HKEY_LOCAL_MACHINE) + foreach(PACKAGE OpenCMISSUserSDK OpenCMISSDeveloperSDK) + set(_REG_KEY "[${ROOT}\\Software\\Auckland Bioengineering Institute\\${PACKAGE}]") + get_filename_component(OPENCMISS_INSTALL_DIR "${_REG_KEY}" ABSOLUTE) + #message(STATUS "Trying registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Found ${PACKAGE} in Windows registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + break() + else() + unset(OPENCMISS_INSTALL_DIR) + endif() + endforeach() + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + break() + endif() + endforeach() +endif() + +if(OPENCMISS_INSTALL_DIR) + message(STATUS "OPENCMISS_INSTALL_DIR=${OPENCMISS_INSTALL_DIR}") + # Use the OpenCMISS scripts to also allow choosing a separate toolchain + # This file is located at the opencmiss installation rather than the local example + # as it avoids file replication and makes maintenance much easier + if (TOOLCHAIN) + set(_OCTC ${OPENCMISS_INSTALL_DIR}/cmake/OCToolchainCompilers.cmake) + if (EXISTS "${_OCTC}") + include(${_OCTC}) + else() + message(WARNING "TOOLCHAIN specified but OpenCMISS config script could not be found at ${_OCTC}. Trying CMake defaults.") + endif() + unset(_OCTC) + endif() + set(OpenCMISS_DIR "${OPENCMISS_INSTALL_DIR}" CACHE PATH "Path to the found OpenCMISS (SDK) installation") +else() + message(WARNING "No OpenCMISS (SDK) installation directory detected. Using default system environment.") +endif() + \ No newline at end of file diff --git a/FiniteElasticity/MixedBoundaryConditions/build_debug/build.sh b/FiniteElasticity/MixedBoundaryConditions/build_debug/build.sh new file mode 100644 index 00000000..e6624bac --- /dev/null +++ b/FiniteElasticity/MixedBoundaryConditions/build_debug/build.sh @@ -0,0 +1,2 @@ +#ccc && cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all +cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all diff --git a/FiniteElasticity/MooneyRivlinInCellML/CMakeLists.txt b/FiniteElasticity/MooneyRivlinInCellML/CMakeLists.txt new file mode 100644 index 00000000..a22b61ee --- /dev/null +++ b/FiniteElasticity/MooneyRivlinInCellML/CMakeLists.txt @@ -0,0 +1,35 @@ +# 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 C) +enable_language(Fortran OPTIONAL) +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 +# ---------------------- +#add_subdirectory(C) +if (CMAKE_Fortran_COMPILER) + add_subdirectory(Fortran) +endif() diff --git a/FiniteElasticity/MooneyRivlinInCellML/Fortran/CMakeLists.txt b/FiniteElasticity/MooneyRivlinInCellML/Fortran/CMakeLists.txt new file mode 100644 index 00000000..8de170d5 --- /dev/null +++ b/FiniteElasticity/MooneyRivlinInCellML/Fortran/CMakeLists.txt @@ -0,0 +1,60 @@ + +# Add example executable +add_executable(MooneyRivlinInCellML src/MooneyRivlinInCellMLExample.f90) + +# Turn on Fortran preprocessing (#include directives) +if (MSVC) + set(PROC_OPT "/fpp") +else() + set(PROC_OPT "-cpp") +endif() + +# in debug mode, add flag that make Floating point exceptions fatal +set(OPT "") +if (FALSE) + if(CMAKE_BUILD_TYPE MATCHES DEBUG) + set(OPT "-ffpe-trap=invalid,zero,underflow,overflow,denormal") # GCC: make floating point exceptions fatal + endif() +endif() + +target_compile_options(MooneyRivlinInCellML PRIVATE ${PROC_OPT} ${OPT} "-fbacktrace") + +# Link to opencmiss +# ----------------- +# +# This simply uses the opencmiss target created by OC_INIT() above. +# +# Alternatively, you can also directly invoke 'find_package(Iron )' 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 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(MooneyRivlinInCellML PRIVATE opencmiss) + +# Add a simple test that runs the executable +add_test(NAME test_MooneyRivlinInCellML COMMAND MooneyRivlinInCellML) +add_opencmiss_environment(test_MooneyRivlinInCellML) + +################### +# 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. +# diff --git a/FiniteElasticity/MooneyRivlinInCellML/src/MooneyRivlinInCellMLExample.f90 b/FiniteElasticity/MooneyRivlinInCellML/Fortran/src/MooneyRivlinInCellMLExample.f90 similarity index 100% rename from FiniteElasticity/MooneyRivlinInCellML/src/MooneyRivlinInCellMLExample.f90 rename to FiniteElasticity/MooneyRivlinInCellML/Fortran/src/MooneyRivlinInCellMLExample.f90 diff --git a/FiniteElasticity/MooneyRivlinInCellML/OpenCMISS.cmake b/FiniteElasticity/MooneyRivlinInCellML/OpenCMISS.cmake new file mode 100644 index 00000000..3d6cf515 --- /dev/null +++ b/FiniteElasticity/MooneyRivlinInCellML/OpenCMISS.cmake @@ -0,0 +1,95 @@ +########################### +# *DO NOT CHANGE THIS FILE* +########################### +# +# Prepares the use of OpenCMISS by scanning at various path locations for OpenCMISS (SDK) installations. +# +# Search order: +# - OPENCMISS_INSTALL_DIR variable +# - OPENCMISS_INSTALL_DIR environment variable +# - OPENCMISS_SDK_DIR variable +# - OPENCMISS_SDK_DIR environment variable +# - [Windows only] The Registry is searched additionally for installed SDKs. +# +# If found +# - Includes the toolchain config script of the found opencmiss installation to enable toolchain selection logic (non-windows) + +# Convenience: The OPENCMISS_INSTALL_DIR may also be defined in the environment and various other places +if (DEFINED OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using specified installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The specified OPENCMISS_INSTALL_DIR '${OPENCMISS_INSTALL_DIR}' does not exist. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_INSTALL_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_INSTALL_DIR}" OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using environment installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The environment variable OPENCMISS_INSTALL_DIR='${OPENCMISS_INSTALL_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if (NOT OPENCMISS_INSTALL_DIR AND DEFINED OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The specified OPENCMISS_SDK_DIR '${OPENCMISS_SDK_DIR}' does not exist. Skipping.") + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_SDK_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_SDK_DIR}" OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using environment SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The environment variable OPENCMISS_SDK_DIR='${OPENCMISS_SDK_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_SDK_DIR) + endif() +endif() +# On windows: check the registry for installed OpenCMISS SDKs +if(NOT OPENCMISS_INSTALL_DIR AND WIN32) + foreach(ROOT HKEY_CURRENT_USER HKEY_LOCAL_MACHINE) + foreach(PACKAGE OpenCMISSUserSDK OpenCMISSDeveloperSDK) + set(_REG_KEY "[${ROOT}\\Software\\Auckland Bioengineering Institute\\${PACKAGE}]") + get_filename_component(OPENCMISS_INSTALL_DIR "${_REG_KEY}" ABSOLUTE) + #message(STATUS "Trying registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Found ${PACKAGE} in Windows registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + break() + else() + unset(OPENCMISS_INSTALL_DIR) + endif() + endforeach() + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + break() + endif() + endforeach() +endif() + +if(OPENCMISS_INSTALL_DIR) + message(STATUS "OPENCMISS_INSTALL_DIR=${OPENCMISS_INSTALL_DIR}") + # Use the OpenCMISS scripts to also allow choosing a separate toolchain + # This file is located at the opencmiss installation rather than the local example + # as it avoids file replication and makes maintenance much easier + if (TOOLCHAIN) + set(_OCTC ${OPENCMISS_INSTALL_DIR}/cmake/OCToolchainCompilers.cmake) + if (EXISTS "${_OCTC}") + include(${_OCTC}) + else() + message(WARNING "TOOLCHAIN specified but OpenCMISS config script could not be found at ${_OCTC}. Trying CMake defaults.") + endif() + unset(_OCTC) + endif() + set(OpenCMISS_DIR "${OPENCMISS_INSTALL_DIR}" CACHE PATH "Path to the found OpenCMISS (SDK) installation") +else() + message(WARNING "No OpenCMISS (SDK) installation directory detected. Using default system environment.") +endif() + \ No newline at end of file diff --git a/FiniteElasticity/MooneyRivlinInCellML/build_debug/build.sh b/FiniteElasticity/MooneyRivlinInCellML/build_debug/build.sh new file mode 100644 index 00000000..e6624bac --- /dev/null +++ b/FiniteElasticity/MooneyRivlinInCellML/build_debug/build.sh @@ -0,0 +1,2 @@ +#ccc && cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all +cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all diff --git a/FiniteElasticity/QuadraticEllipsoid/CMakeLists.txt b/FiniteElasticity/QuadraticEllipsoid/CMakeLists.txt new file mode 100644 index 00000000..a22b61ee --- /dev/null +++ b/FiniteElasticity/QuadraticEllipsoid/CMakeLists.txt @@ -0,0 +1,35 @@ +# 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 C) +enable_language(Fortran OPTIONAL) +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 +# ---------------------- +#add_subdirectory(C) +if (CMAKE_Fortran_COMPILER) + add_subdirectory(Fortran) +endif() diff --git a/FiniteElasticity/QuadraticEllipsoid/Fortran/CMakeLists.txt b/FiniteElasticity/QuadraticEllipsoid/Fortran/CMakeLists.txt new file mode 100644 index 00000000..f346047d --- /dev/null +++ b/FiniteElasticity/QuadraticEllipsoid/Fortran/CMakeLists.txt @@ -0,0 +1,60 @@ + +# Add example executable +add_executable(QuadraticEllipsoid src/QuadraticEllipsoidExample.f90) + +# Turn on Fortran preprocessing (#include directives) +if (MSVC) + set(PROC_OPT "/fpp") +else() + set(PROC_OPT "-cpp") +endif() + +# in debug mode, add flag that make Floating point exceptions fatal +set(OPT "") +if (FALSE) + if(CMAKE_BUILD_TYPE MATCHES DEBUG) + set(OPT "-ffpe-trap=invalid,zero,underflow,overflow,denormal") # GCC: make floating point exceptions fatal + endif() +endif() + +target_compile_options(QuadraticEllipsoid PRIVATE ${PROC_OPT} ${OPT} "-fbacktrace") + +# Link to opencmiss +# ----------------- +# +# This simply uses the opencmiss target created by OC_INIT() above. +# +# Alternatively, you can also directly invoke 'find_package(Iron )' 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 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(QuadraticEllipsoid PRIVATE opencmiss) + +# Add a simple test that runs the executable +add_test(NAME test_QuadraticEllipsoid COMMAND QuadraticEllipsoid) +add_opencmiss_environment(test_QuadraticEllipsoid) + +################### +# 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. +# diff --git a/FiniteElasticity/QuadraticEllipsoid/src/QuadraticEllipsoidExample.f90 b/FiniteElasticity/QuadraticEllipsoid/Fortran/src/QuadraticEllipsoidExample.f90 similarity index 100% rename from FiniteElasticity/QuadraticEllipsoid/src/QuadraticEllipsoidExample.f90 rename to FiniteElasticity/QuadraticEllipsoid/Fortran/src/QuadraticEllipsoidExample.f90 diff --git a/FiniteElasticity/QuadraticEllipsoid/OpenCMISS.cmake b/FiniteElasticity/QuadraticEllipsoid/OpenCMISS.cmake new file mode 100644 index 00000000..3d6cf515 --- /dev/null +++ b/FiniteElasticity/QuadraticEllipsoid/OpenCMISS.cmake @@ -0,0 +1,95 @@ +########################### +# *DO NOT CHANGE THIS FILE* +########################### +# +# Prepares the use of OpenCMISS by scanning at various path locations for OpenCMISS (SDK) installations. +# +# Search order: +# - OPENCMISS_INSTALL_DIR variable +# - OPENCMISS_INSTALL_DIR environment variable +# - OPENCMISS_SDK_DIR variable +# - OPENCMISS_SDK_DIR environment variable +# - [Windows only] The Registry is searched additionally for installed SDKs. +# +# If found +# - Includes the toolchain config script of the found opencmiss installation to enable toolchain selection logic (non-windows) + +# Convenience: The OPENCMISS_INSTALL_DIR may also be defined in the environment and various other places +if (DEFINED OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using specified installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The specified OPENCMISS_INSTALL_DIR '${OPENCMISS_INSTALL_DIR}' does not exist. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_INSTALL_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_INSTALL_DIR}" OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using environment installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The environment variable OPENCMISS_INSTALL_DIR='${OPENCMISS_INSTALL_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if (NOT OPENCMISS_INSTALL_DIR AND DEFINED OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The specified OPENCMISS_SDK_DIR '${OPENCMISS_SDK_DIR}' does not exist. Skipping.") + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_SDK_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_SDK_DIR}" OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using environment SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The environment variable OPENCMISS_SDK_DIR='${OPENCMISS_SDK_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_SDK_DIR) + endif() +endif() +# On windows: check the registry for installed OpenCMISS SDKs +if(NOT OPENCMISS_INSTALL_DIR AND WIN32) + foreach(ROOT HKEY_CURRENT_USER HKEY_LOCAL_MACHINE) + foreach(PACKAGE OpenCMISSUserSDK OpenCMISSDeveloperSDK) + set(_REG_KEY "[${ROOT}\\Software\\Auckland Bioengineering Institute\\${PACKAGE}]") + get_filename_component(OPENCMISS_INSTALL_DIR "${_REG_KEY}" ABSOLUTE) + #message(STATUS "Trying registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Found ${PACKAGE} in Windows registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + break() + else() + unset(OPENCMISS_INSTALL_DIR) + endif() + endforeach() + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + break() + endif() + endforeach() +endif() + +if(OPENCMISS_INSTALL_DIR) + message(STATUS "OPENCMISS_INSTALL_DIR=${OPENCMISS_INSTALL_DIR}") + # Use the OpenCMISS scripts to also allow choosing a separate toolchain + # This file is located at the opencmiss installation rather than the local example + # as it avoids file replication and makes maintenance much easier + if (TOOLCHAIN) + set(_OCTC ${OPENCMISS_INSTALL_DIR}/cmake/OCToolchainCompilers.cmake) + if (EXISTS "${_OCTC}") + include(${_OCTC}) + else() + message(WARNING "TOOLCHAIN specified but OpenCMISS config script could not be found at ${_OCTC}. Trying CMake defaults.") + endif() + unset(_OCTC) + endif() + set(OpenCMISS_DIR "${OPENCMISS_INSTALL_DIR}" CACHE PATH "Path to the found OpenCMISS (SDK) installation") +else() + message(WARNING "No OpenCMISS (SDK) installation directory detected. Using default system environment.") +endif() + \ No newline at end of file diff --git a/FiniteElasticity/QuadraticEllipsoid/build_debug/build.sh b/FiniteElasticity/QuadraticEllipsoid/build_debug/build.sh new file mode 100644 index 00000000..e6624bac --- /dev/null +++ b/FiniteElasticity/QuadraticEllipsoid/build_debug/build.sh @@ -0,0 +1,2 @@ +#ccc && cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all +cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all diff --git a/FiniteElasticity/QuadraticEllipsoidCosta/CMakeLists.txt b/FiniteElasticity/QuadraticEllipsoidCosta/CMakeLists.txt new file mode 100644 index 00000000..a22b61ee --- /dev/null +++ b/FiniteElasticity/QuadraticEllipsoidCosta/CMakeLists.txt @@ -0,0 +1,35 @@ +# 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 C) +enable_language(Fortran OPTIONAL) +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 +# ---------------------- +#add_subdirectory(C) +if (CMAKE_Fortran_COMPILER) + add_subdirectory(Fortran) +endif() diff --git a/FiniteElasticity/QuadraticEllipsoidCosta/Fortran/CMakeLists.txt b/FiniteElasticity/QuadraticEllipsoidCosta/Fortran/CMakeLists.txt new file mode 100644 index 00000000..efca7c57 --- /dev/null +++ b/FiniteElasticity/QuadraticEllipsoidCosta/Fortran/CMakeLists.txt @@ -0,0 +1,60 @@ + +# Add example executable +add_executable(QuadraticEllipsoidCosta src/QuadraticEllipsoidCostaExample.f90) + +# Turn on Fortran preprocessing (#include directives) +if (MSVC) + set(PROC_OPT "/fpp") +else() + set(PROC_OPT "-cpp") +endif() + +# in debug mode, add flag that make Floating point exceptions fatal +set(OPT "") +if (FALSE) + if(CMAKE_BUILD_TYPE MATCHES DEBUG) + set(OPT "-ffpe-trap=invalid,zero,underflow,overflow,denormal") # GCC: make floating point exceptions fatal + endif() +endif() + +target_compile_options(QuadraticEllipsoidCosta PRIVATE ${PROC_OPT} ${OPT} "-fbacktrace") + +# Link to opencmiss +# ----------------- +# +# This simply uses the opencmiss target created by OC_INIT() above. +# +# Alternatively, you can also directly invoke 'find_package(Iron )' 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 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(QuadraticEllipsoidCosta PRIVATE opencmiss) + +# Add a simple test that runs the executable +add_test(NAME test_QuadraticEllipsoidCosta COMMAND QuadraticEllipsoidCosta) +add_opencmiss_environment(test_QuadraticEllipsoidCosta) + +################### +# 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. +# diff --git a/FiniteElasticity/QuadraticEllipsoidCosta/src/QuadraticEllipsoidCostaExample.f90 b/FiniteElasticity/QuadraticEllipsoidCosta/Fortran/src/QuadraticEllipsoidCostaExample.f90 similarity index 100% rename from FiniteElasticity/QuadraticEllipsoidCosta/src/QuadraticEllipsoidCostaExample.f90 rename to FiniteElasticity/QuadraticEllipsoidCosta/Fortran/src/QuadraticEllipsoidCostaExample.f90 diff --git a/FiniteElasticity/QuadraticEllipsoidCosta/OpenCMISS.cmake b/FiniteElasticity/QuadraticEllipsoidCosta/OpenCMISS.cmake new file mode 100644 index 00000000..3d6cf515 --- /dev/null +++ b/FiniteElasticity/QuadraticEllipsoidCosta/OpenCMISS.cmake @@ -0,0 +1,95 @@ +########################### +# *DO NOT CHANGE THIS FILE* +########################### +# +# Prepares the use of OpenCMISS by scanning at various path locations for OpenCMISS (SDK) installations. +# +# Search order: +# - OPENCMISS_INSTALL_DIR variable +# - OPENCMISS_INSTALL_DIR environment variable +# - OPENCMISS_SDK_DIR variable +# - OPENCMISS_SDK_DIR environment variable +# - [Windows only] The Registry is searched additionally for installed SDKs. +# +# If found +# - Includes the toolchain config script of the found opencmiss installation to enable toolchain selection logic (non-windows) + +# Convenience: The OPENCMISS_INSTALL_DIR may also be defined in the environment and various other places +if (DEFINED OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using specified installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The specified OPENCMISS_INSTALL_DIR '${OPENCMISS_INSTALL_DIR}' does not exist. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_INSTALL_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_INSTALL_DIR}" OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using environment installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The environment variable OPENCMISS_INSTALL_DIR='${OPENCMISS_INSTALL_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if (NOT OPENCMISS_INSTALL_DIR AND DEFINED OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The specified OPENCMISS_SDK_DIR '${OPENCMISS_SDK_DIR}' does not exist. Skipping.") + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_SDK_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_SDK_DIR}" OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using environment SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The environment variable OPENCMISS_SDK_DIR='${OPENCMISS_SDK_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_SDK_DIR) + endif() +endif() +# On windows: check the registry for installed OpenCMISS SDKs +if(NOT OPENCMISS_INSTALL_DIR AND WIN32) + foreach(ROOT HKEY_CURRENT_USER HKEY_LOCAL_MACHINE) + foreach(PACKAGE OpenCMISSUserSDK OpenCMISSDeveloperSDK) + set(_REG_KEY "[${ROOT}\\Software\\Auckland Bioengineering Institute\\${PACKAGE}]") + get_filename_component(OPENCMISS_INSTALL_DIR "${_REG_KEY}" ABSOLUTE) + #message(STATUS "Trying registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Found ${PACKAGE} in Windows registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + break() + else() + unset(OPENCMISS_INSTALL_DIR) + endif() + endforeach() + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + break() + endif() + endforeach() +endif() + +if(OPENCMISS_INSTALL_DIR) + message(STATUS "OPENCMISS_INSTALL_DIR=${OPENCMISS_INSTALL_DIR}") + # Use the OpenCMISS scripts to also allow choosing a separate toolchain + # This file is located at the opencmiss installation rather than the local example + # as it avoids file replication and makes maintenance much easier + if (TOOLCHAIN) + set(_OCTC ${OPENCMISS_INSTALL_DIR}/cmake/OCToolchainCompilers.cmake) + if (EXISTS "${_OCTC}") + include(${_OCTC}) + else() + message(WARNING "TOOLCHAIN specified but OpenCMISS config script could not be found at ${_OCTC}. Trying CMake defaults.") + endif() + unset(_OCTC) + endif() + set(OpenCMISS_DIR "${OPENCMISS_INSTALL_DIR}" CACHE PATH "Path to the found OpenCMISS (SDK) installation") +else() + message(WARNING "No OpenCMISS (SDK) installation directory detected. Using default system environment.") +endif() + \ No newline at end of file diff --git a/FiniteElasticity/QuadraticEllipsoidCosta/build_debug/build.sh b/FiniteElasticity/QuadraticEllipsoidCosta/build_debug/build.sh new file mode 100644 index 00000000..e6624bac --- /dev/null +++ b/FiniteElasticity/QuadraticEllipsoidCosta/build_debug/build.sh @@ -0,0 +1,2 @@ +#ccc && cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all +cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all diff --git a/FiniteElasticity/QuadraticEllipsoidCostaReadIn/CMakeLists.txt b/FiniteElasticity/QuadraticEllipsoidCostaReadIn/CMakeLists.txt new file mode 100644 index 00000000..a22b61ee --- /dev/null +++ b/FiniteElasticity/QuadraticEllipsoidCostaReadIn/CMakeLists.txt @@ -0,0 +1,35 @@ +# 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 C) +enable_language(Fortran OPTIONAL) +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 +# ---------------------- +#add_subdirectory(C) +if (CMAKE_Fortran_COMPILER) + add_subdirectory(Fortran) +endif() diff --git a/FiniteElasticity/QuadraticEllipsoidCostaReadIn/Fortran/CMakeLists.txt b/FiniteElasticity/QuadraticEllipsoidCostaReadIn/Fortran/CMakeLists.txt new file mode 100644 index 00000000..0c080f11 --- /dev/null +++ b/FiniteElasticity/QuadraticEllipsoidCostaReadIn/Fortran/CMakeLists.txt @@ -0,0 +1,60 @@ + +# Add example executable +add_executable(QuadraticEllipsoidCostaReadIn src/QuadraticEllipsoidCostaReadInExample.f90) + +# Turn on Fortran preprocessing (#include directives) +if (MSVC) + set(PROC_OPT "/fpp") +else() + set(PROC_OPT "-cpp") +endif() + +# in debug mode, add flag that make Floating point exceptions fatal +set(OPT "") +if (FALSE) + if(CMAKE_BUILD_TYPE MATCHES DEBUG) + set(OPT "-ffpe-trap=invalid,zero,underflow,overflow,denormal") # GCC: make floating point exceptions fatal + endif() +endif() + +target_compile_options(QuadraticEllipsoidCostaReadIn PRIVATE ${PROC_OPT} ${OPT} "-fbacktrace") + +# Link to opencmiss +# ----------------- +# +# This simply uses the opencmiss target created by OC_INIT() above. +# +# Alternatively, you can also directly invoke 'find_package(Iron )' 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 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(QuadraticEllipsoidCostaReadIn PRIVATE opencmiss) + +# Add a simple test that runs the executable +add_test(NAME test_QuadraticEllipsoidCostaReadIn COMMAND QuadraticEllipsoidCostaReadIn) +add_opencmiss_environment(test_QuadraticEllipsoidCostaReadIn) + +################### +# 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. +# diff --git a/FiniteElasticity/QuadraticEllipsoidCostaReadIn/src/QuadraticEllipsoidCostaReadInExample.f90 b/FiniteElasticity/QuadraticEllipsoidCostaReadIn/Fortran/src/QuadraticEllipsoidCostaReadInExample.f90 similarity index 100% rename from FiniteElasticity/QuadraticEllipsoidCostaReadIn/src/QuadraticEllipsoidCostaReadInExample.f90 rename to FiniteElasticity/QuadraticEllipsoidCostaReadIn/Fortran/src/QuadraticEllipsoidCostaReadInExample.f90 diff --git a/FiniteElasticity/QuadraticEllipsoidCostaReadIn/OpenCMISS.cmake b/FiniteElasticity/QuadraticEllipsoidCostaReadIn/OpenCMISS.cmake new file mode 100644 index 00000000..3d6cf515 --- /dev/null +++ b/FiniteElasticity/QuadraticEllipsoidCostaReadIn/OpenCMISS.cmake @@ -0,0 +1,95 @@ +########################### +# *DO NOT CHANGE THIS FILE* +########################### +# +# Prepares the use of OpenCMISS by scanning at various path locations for OpenCMISS (SDK) installations. +# +# Search order: +# - OPENCMISS_INSTALL_DIR variable +# - OPENCMISS_INSTALL_DIR environment variable +# - OPENCMISS_SDK_DIR variable +# - OPENCMISS_SDK_DIR environment variable +# - [Windows only] The Registry is searched additionally for installed SDKs. +# +# If found +# - Includes the toolchain config script of the found opencmiss installation to enable toolchain selection logic (non-windows) + +# Convenience: The OPENCMISS_INSTALL_DIR may also be defined in the environment and various other places +if (DEFINED OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using specified installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The specified OPENCMISS_INSTALL_DIR '${OPENCMISS_INSTALL_DIR}' does not exist. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_INSTALL_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_INSTALL_DIR}" OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using environment installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The environment variable OPENCMISS_INSTALL_DIR='${OPENCMISS_INSTALL_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if (NOT OPENCMISS_INSTALL_DIR AND DEFINED OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The specified OPENCMISS_SDK_DIR '${OPENCMISS_SDK_DIR}' does not exist. Skipping.") + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_SDK_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_SDK_DIR}" OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using environment SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The environment variable OPENCMISS_SDK_DIR='${OPENCMISS_SDK_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_SDK_DIR) + endif() +endif() +# On windows: check the registry for installed OpenCMISS SDKs +if(NOT OPENCMISS_INSTALL_DIR AND WIN32) + foreach(ROOT HKEY_CURRENT_USER HKEY_LOCAL_MACHINE) + foreach(PACKAGE OpenCMISSUserSDK OpenCMISSDeveloperSDK) + set(_REG_KEY "[${ROOT}\\Software\\Auckland Bioengineering Institute\\${PACKAGE}]") + get_filename_component(OPENCMISS_INSTALL_DIR "${_REG_KEY}" ABSOLUTE) + #message(STATUS "Trying registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Found ${PACKAGE} in Windows registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + break() + else() + unset(OPENCMISS_INSTALL_DIR) + endif() + endforeach() + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + break() + endif() + endforeach() +endif() + +if(OPENCMISS_INSTALL_DIR) + message(STATUS "OPENCMISS_INSTALL_DIR=${OPENCMISS_INSTALL_DIR}") + # Use the OpenCMISS scripts to also allow choosing a separate toolchain + # This file is located at the opencmiss installation rather than the local example + # as it avoids file replication and makes maintenance much easier + if (TOOLCHAIN) + set(_OCTC ${OPENCMISS_INSTALL_DIR}/cmake/OCToolchainCompilers.cmake) + if (EXISTS "${_OCTC}") + include(${_OCTC}) + else() + message(WARNING "TOOLCHAIN specified but OpenCMISS config script could not be found at ${_OCTC}. Trying CMake defaults.") + endif() + unset(_OCTC) + endif() + set(OpenCMISS_DIR "${OPENCMISS_INSTALL_DIR}" CACHE PATH "Path to the found OpenCMISS (SDK) installation") +else() + message(WARNING "No OpenCMISS (SDK) installation directory detected. Using default system environment.") +endif() + \ No newline at end of file diff --git a/FiniteElasticity/QuadraticEllipsoidCostaReadIn/build_debug/build.sh b/FiniteElasticity/QuadraticEllipsoidCostaReadIn/build_debug/build.sh new file mode 100644 index 00000000..e6624bac --- /dev/null +++ b/FiniteElasticity/QuadraticEllipsoidCostaReadIn/build_debug/build.sh @@ -0,0 +1,2 @@ +#ccc && cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all +cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all diff --git a/FiniteElasticity/RightBiceps/CMakeLists.txt b/FiniteElasticity/RightBiceps/CMakeLists.txt new file mode 100644 index 00000000..a22b61ee --- /dev/null +++ b/FiniteElasticity/RightBiceps/CMakeLists.txt @@ -0,0 +1,35 @@ +# 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 C) +enable_language(Fortran OPTIONAL) +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 +# ---------------------- +#add_subdirectory(C) +if (CMAKE_Fortran_COMPILER) + add_subdirectory(Fortran) +endif() diff --git a/FiniteElasticity/RightBiceps/Fortran/CMakeLists.txt b/FiniteElasticity/RightBiceps/Fortran/CMakeLists.txt new file mode 100644 index 00000000..912a54e1 --- /dev/null +++ b/FiniteElasticity/RightBiceps/Fortran/CMakeLists.txt @@ -0,0 +1,60 @@ + +# Add example executable +add_executable(RightBiceps src/FortranExample.f90) + +# Turn on Fortran preprocessing (#include directives) +if (MSVC) + set(PROC_OPT "/fpp") +else() + set(PROC_OPT "-cpp") +endif() + +# in debug mode, add flag that make Floating point exceptions fatal +set(OPT "") +if (FALSE) + if(CMAKE_BUILD_TYPE MATCHES DEBUG) + set(OPT "-ffpe-trap=invalid,zero,underflow,overflow,denormal") # GCC: make floating point exceptions fatal + endif() +endif() + +target_compile_options(RightBiceps PRIVATE ${PROC_OPT} ${OPT} "-fbacktrace") + +# Link to opencmiss +# ----------------- +# +# This simply uses the opencmiss target created by OC_INIT() above. +# +# Alternatively, you can also directly invoke 'find_package(Iron )' 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 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(RightBiceps PRIVATE opencmiss) + +# Add a simple test that runs the executable +add_test(NAME test_RightBiceps COMMAND RightBiceps) +add_opencmiss_environment(test_RightBiceps) + +################### +# 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. +# diff --git a/FiniteElasticity/RightBiceps/OpenCMISS.cmake b/FiniteElasticity/RightBiceps/OpenCMISS.cmake new file mode 100644 index 00000000..3d6cf515 --- /dev/null +++ b/FiniteElasticity/RightBiceps/OpenCMISS.cmake @@ -0,0 +1,95 @@ +########################### +# *DO NOT CHANGE THIS FILE* +########################### +# +# Prepares the use of OpenCMISS by scanning at various path locations for OpenCMISS (SDK) installations. +# +# Search order: +# - OPENCMISS_INSTALL_DIR variable +# - OPENCMISS_INSTALL_DIR environment variable +# - OPENCMISS_SDK_DIR variable +# - OPENCMISS_SDK_DIR environment variable +# - [Windows only] The Registry is searched additionally for installed SDKs. +# +# If found +# - Includes the toolchain config script of the found opencmiss installation to enable toolchain selection logic (non-windows) + +# Convenience: The OPENCMISS_INSTALL_DIR may also be defined in the environment and various other places +if (DEFINED OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using specified installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The specified OPENCMISS_INSTALL_DIR '${OPENCMISS_INSTALL_DIR}' does not exist. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_INSTALL_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_INSTALL_DIR}" OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using environment installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The environment variable OPENCMISS_INSTALL_DIR='${OPENCMISS_INSTALL_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if (NOT OPENCMISS_INSTALL_DIR AND DEFINED OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The specified OPENCMISS_SDK_DIR '${OPENCMISS_SDK_DIR}' does not exist. Skipping.") + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_SDK_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_SDK_DIR}" OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using environment SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The environment variable OPENCMISS_SDK_DIR='${OPENCMISS_SDK_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_SDK_DIR) + endif() +endif() +# On windows: check the registry for installed OpenCMISS SDKs +if(NOT OPENCMISS_INSTALL_DIR AND WIN32) + foreach(ROOT HKEY_CURRENT_USER HKEY_LOCAL_MACHINE) + foreach(PACKAGE OpenCMISSUserSDK OpenCMISSDeveloperSDK) + set(_REG_KEY "[${ROOT}\\Software\\Auckland Bioengineering Institute\\${PACKAGE}]") + get_filename_component(OPENCMISS_INSTALL_DIR "${_REG_KEY}" ABSOLUTE) + #message(STATUS "Trying registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Found ${PACKAGE} in Windows registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + break() + else() + unset(OPENCMISS_INSTALL_DIR) + endif() + endforeach() + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + break() + endif() + endforeach() +endif() + +if(OPENCMISS_INSTALL_DIR) + message(STATUS "OPENCMISS_INSTALL_DIR=${OPENCMISS_INSTALL_DIR}") + # Use the OpenCMISS scripts to also allow choosing a separate toolchain + # This file is located at the opencmiss installation rather than the local example + # as it avoids file replication and makes maintenance much easier + if (TOOLCHAIN) + set(_OCTC ${OPENCMISS_INSTALL_DIR}/cmake/OCToolchainCompilers.cmake) + if (EXISTS "${_OCTC}") + include(${_OCTC}) + else() + message(WARNING "TOOLCHAIN specified but OpenCMISS config script could not be found at ${_OCTC}. Trying CMake defaults.") + endif() + unset(_OCTC) + endif() + set(OpenCMISS_DIR "${OPENCMISS_INSTALL_DIR}" CACHE PATH "Path to the found OpenCMISS (SDK) installation") +else() + message(WARNING "No OpenCMISS (SDK) installation directory detected. Using default system environment.") +endif() + \ No newline at end of file diff --git a/FiniteElasticity/RightBiceps/build_debug/CMakeCache.txt b/FiniteElasticity/RightBiceps/build_debug/CMakeCache.txt new file mode 100644 index 00000000..93b90a47 --- /dev/null +++ b/FiniteElasticity/RightBiceps/build_debug/CMakeCache.txt @@ -0,0 +1,799 @@ +# This is the CMakeCache file. +# For build in directory: /store/software/opencmiss/OpenCMISS-examples/FiniteElasticity/RightBiceps/build_debug +# It was generated by CMake: /usr/bin/cmake +# You can edit this file to change values found and used by cmake. +# If you do not want to change any of the values, simply exit the editor. +# If you do want to change a value, simply edit, save, and exit the editor. +# The syntax for the file is as follows: +# KEY:TYPE=VALUE +# KEY is the name of a variable in the cache. +# TYPE is a hint to GUIs for the type of VALUE, DO NOT EDIT TYPE!. +# VALUE is the current value for the KEY. + +######################## +# EXTERNAL cache entries +######################## + +//The directory containing a CMake configuration file for BLAS. +BLAS_DIR:PATH=/store/software/opencmiss/dependencies/install/x86_64_linux/gnu-5.4-F5.4/no_mpi/debug/cmake + +//The directory containing a CMake configuration file for BZip2. +BZip2_DIR:PATH=/store/software/opencmiss/dependencies/install/x86_64_linux/gnu-5.4-F5.4/no_mpi/debug/cmake + +//The directory containing a CMake configuration file for CELLML. +CELLML_DIR:PATH=/store/software/opencmiss/dependencies/install/x86_64_linux/gnu-5.4-F5.4/no_mpi/debug/cmake + +//Path to a program. +CMAKE_AR:FILEPATH=/usr/bin/ar + +//Choose the type of build, options are: None(CMAKE_CXX_FLAGS or +// CMAKE_C_FLAGS used) Debug Release RelWithDebInfo MinSizeRel. +CMAKE_BUILD_TYPE:STRING=DEBUG + +//Enable/Disable color output during build. +CMAKE_COLOR_MAKEFILE:BOOL=ON + +//C compiler +CMAKE_C_COMPILER:FILEPATH=/usr/bin/cc + +//Flags used by the compiler during all build types. +CMAKE_C_FLAGS:STRING= + +//Flags used by the compiler during debug builds. +CMAKE_C_FLAGS_DEBUG:STRING=-g + +//Flags used by the compiler during release builds for minimum +// size. +CMAKE_C_FLAGS_MINSIZEREL:STRING=-Os -DNDEBUG + +//Flags used by the compiler during release builds. +CMAKE_C_FLAGS_RELEASE:STRING=-O3 -DNDEBUG + +//Flags used by the compiler during release builds with debug info. +CMAKE_C_FLAGS_RELWITHDEBINFO:STRING=-O2 -g -DNDEBUG + +//Flags used by the linker. +CMAKE_EXE_LINKER_FLAGS:STRING= + +//Flags used by the linker during debug builds. +CMAKE_EXE_LINKER_FLAGS_DEBUG:STRING= + +//Flags used by the linker during release minsize builds. +CMAKE_EXE_LINKER_FLAGS_MINSIZEREL:STRING= + +//Flags used by the linker during release builds. +CMAKE_EXE_LINKER_FLAGS_RELEASE:STRING= + +//Flags used by the linker during Release with Debug Info builds. +CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO:STRING= + +//Enable/Disable output of compile commands during generation. +CMAKE_EXPORT_COMPILE_COMMANDS:BOOL=OFF + +//Fortran compiler +CMAKE_Fortran_COMPILER:FILEPATH=/usr/bin/gfortran + +//Flags for Fortran compiler. +CMAKE_Fortran_FLAGS:STRING= + +//Flags used by the compiler during debug builds. +CMAKE_Fortran_FLAGS_DEBUG:STRING=-g + +//Flags used by the compiler during release builds for minimum +// size. +CMAKE_Fortran_FLAGS_MINSIZEREL:STRING=-Os + +//Flags used by the compiler during release builds. +CMAKE_Fortran_FLAGS_RELEASE:STRING=-O3 + +//Flags used by the compiler during release builds with debug info. +CMAKE_Fortran_FLAGS_RELWITHDEBINFO:STRING=-O2 -g -DNDEBUG + +//Install path prefix, prepended onto install directories. +CMAKE_INSTALL_PREFIX:PATH=/usr/local + +//Path to a program. +CMAKE_LINKER:FILEPATH=/usr/bin/ld + +//Path to a program. +CMAKE_MAKE_PROGRAM:FILEPATH=/usr/bin/make + +//Flags used by the linker during the creation of modules. +CMAKE_MODULE_LINKER_FLAGS:STRING= + +//Flags used by the linker during debug builds. +CMAKE_MODULE_LINKER_FLAGS_DEBUG:STRING= + +//Flags used by the linker during release minsize builds. +CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL:STRING= + +//Flags used by the linker during release builds. +CMAKE_MODULE_LINKER_FLAGS_RELEASE:STRING= + +//Flags used by the linker during Release with Debug Info builds. +CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO:STRING= + +//Path to a program. +CMAKE_NM:FILEPATH=/usr/bin/nm + +//Path to a program. +CMAKE_OBJCOPY:FILEPATH=/usr/bin/objcopy + +//Path to a program. +CMAKE_OBJDUMP:FILEPATH=/usr/bin/objdump + +//Value Computed by CMake +CMAKE_PROJECT_NAME:STATIC=OpenCMISS-Example + +//Path to a program. +CMAKE_RANLIB:FILEPATH=/usr/bin/ranlib + +//Flags used by the linker during the creation of dll's. +CMAKE_SHARED_LINKER_FLAGS:STRING= + +//Flags used by the linker during debug builds. +CMAKE_SHARED_LINKER_FLAGS_DEBUG:STRING= + +//Flags used by the linker during release minsize builds. +CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL:STRING= + +//Flags used by the linker during release builds. +CMAKE_SHARED_LINKER_FLAGS_RELEASE:STRING= + +//Flags used by the linker during Release with Debug Info builds. +CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO:STRING= + +//If set, runtime paths are not added when installing shared libraries, +// but are added when building. +CMAKE_SKIP_INSTALL_RPATH:BOOL=NO + +//If set, runtime paths are not added when using shared libraries. +CMAKE_SKIP_RPATH:BOOL=NO + +//Flags used by the linker during the creation of static libraries. +CMAKE_STATIC_LINKER_FLAGS:STRING= + +//Flags used by the linker during debug builds. +CMAKE_STATIC_LINKER_FLAGS_DEBUG:STRING= + +//Flags used by the linker during release minsize builds. +CMAKE_STATIC_LINKER_FLAGS_MINSIZEREL:STRING= + +//Flags used by the linker during release builds. +CMAKE_STATIC_LINKER_FLAGS_RELEASE:STRING= + +//Flags used by the linker during Release with Debug Info builds. +CMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO:STRING= + +//Path to a program. +CMAKE_STRIP:FILEPATH=/usr/bin/strip + +//If this value is on, makefiles will be generated without the +// .SILENT directive, and all commands will be echoed to the console +// during the make. This is useful for debugging only. With Visual +// Studio IDE projects all commands are done without /nologo. +CMAKE_VERBOSE_MAKEFILE:BOOL=FALSE + +//The directory containing a CMake configuration file for FIELDML-API. +FIELDML-API_DIR:PATH=/store/software/opencmiss/iron_maierbn/install/x86_64_linux/gnu-5.4-F5.4/no_mpi/debug/cmake + +//The directory containing a CMake configuration file for HYPRE. +HYPRE_DIR:PATH=/store/software/opencmiss/dependencies/install/x86_64_linux/gnu-5.4-F5.4/openmpi_release/debug/cmake + +//The directory containing a CMake configuration file for IRON. +IRON_DIR:PATH=/store/software/opencmiss/iron_maierbn/install/x86_64_linux/gnu-5.4-F5.4/openmpi_release/debug/cmake + +//The directory containing a CMake configuration file for LAPACK. +LAPACK_DIR:PATH=/store/software/opencmiss/dependencies/install/x86_64_linux/gnu-5.4-F5.4/no_mpi/debug/cmake + +//The directory containing a CMake configuration file for LIBCELLML. +LIBCELLML_DIR:PATH=/store/software/opencmiss/dependencies/install/x86_64_linux/gnu-5.4-F5.4/no_mpi/debug/cmake + +//The directory containing a CMake configuration file for LibXml2. +LibXml2_DIR:PATH=/store/software/opencmiss/dependencies/install/x86_64_linux/gnu-5.4-F5.4/no_mpi/debug/cmake + +//The directory containing a CMake configuration file for METIS. +METIS_DIR:PATH=/store/software/opencmiss/dependencies/install/x86_64_linux/gnu-5.4-F5.4/openmpi_release/debug/cmake + +//Executable for running MPI programs. +MPIEXEC:FILEPATH=/usr/bin/mpiexec + +//Maximum number of processors available to run MPI applications. +MPIEXEC_MAX_NUMPROCS:STRING=2 + +//Flag used by MPI to specify the number of processes for MPIEXEC; +// the next option will be the number of processes. +MPIEXEC_NUMPROC_FLAG:STRING=-np + +//These flags will come after all flags given to MPIEXEC. +MPIEXEC_POSTFLAGS:STRING= + +//These flags will be directly before the executable that is being +// run by MPIEXEC. +MPIEXEC_PREFLAGS:STRING= + +//Path to a program. +MPI_C_COMPILER:FILEPATH=/usr/bin/mpicc + +//MPI C compilation flags +MPI_C_COMPILE_FLAGS:STRING= + +//MPI C include path +MPI_C_INCLUDE_PATH:STRING=/usr/lib/openmpi/include/openmpi/opal/mca/event/libevent2021/libevent;/usr/lib/openmpi/include/openmpi/opal/mca/event/libevent2021/libevent/include;/usr/lib/openmpi/include;/usr/lib/openmpi/include/openmpi + +//MPI C libraries to link against +MPI_C_LIBRARIES:STRING=/usr/lib/openmpi/lib/libmpi.so + +//MPI C linking flags +MPI_C_LINK_FLAGS:STRING= -Wl,-rpath -Wl,/usr/lib/openmpi/lib -Wl,--enable-new-dtags + +//Compatibility of MPI with toolchain is verified +MPI_C_VERIFIED:BOOL=TRUE + +//Extra MPI libraries to link against +MPI_EXTRA_LIBRARY:STRING=/usr/lib/openmpi/lib/libmpi_usempif08.so;/usr/lib/openmpi/lib/libmpi_usempi_ignore_tkr.so;/usr/lib/openmpi/lib/libmpi_mpifh.so;/usr/lib/openmpi/lib/libmpi.so + +//Path to a program. +MPI_Fortran_COMPILER:FILEPATH=/usr/bin/mpif90 + +//MPI Fortran compilation flags +MPI_Fortran_COMPILE_FLAGS:STRING= + +//MPI Fortran include path +MPI_Fortran_INCLUDE_PATH:STRING=/usr/lib/openmpi/include;/usr/lib/openmpi/lib + +//MPI Fortran libraries to link against +MPI_Fortran_LIBRARIES:STRING=/usr/lib/openmpi/lib/libmpi_usempif08.so;/usr/lib/openmpi/lib/libmpi_usempi_ignore_tkr.so;/usr/lib/openmpi/lib/libmpi_mpifh.so;/usr/lib/openmpi/lib/libmpi.so + +//MPI Fortran linking flags +MPI_Fortran_LINK_FLAGS:STRING= -Wl,-rpath -Wl,/usr/lib/openmpi/lib -Wl,--enable-new-dtags + +//Compatibility of MPI with toolchain is verified +MPI_Fortran_VERIFIED:BOOL=TRUE + +//MPI library to link against +MPI_LIBRARY:FILEPATH=/usr/lib/openmpi/lib/libmpi.so + +//The directory containing a CMake configuration file for MUMPS. +MUMPS_DIR:PATH=/store/software/opencmiss/dependencies/install/x86_64_linux/gnu-5.4-F5.4/openmpi_release/debug/cmake + +//No help, variable specified on the command line. +OPENCMISS_BUILD_TYPE:UNINITIALIZED=DEBUG + +//Value Computed by CMake +OpenCMISS-Example_BINARY_DIR:STATIC=/store/software/opencmiss/OpenCMISS-examples/FiniteElasticity/RightBiceps/build_debug + +//Value Computed by CMake +OpenCMISS-Example_SOURCE_DIR:STATIC=/store/software/opencmiss/OpenCMISS-examples/FiniteElasticity/RightBiceps + +//Path to the found OpenCMISS (SDK) installation +OpenCMISS_DIR:PATH=/store/software/opencmiss/iron_maierbn/install + +//The directory containing a CMake configuration file for PARMETIS. +PARMETIS_DIR:PATH=/store/software/opencmiss/dependencies/install/x86_64_linux/gnu-5.4-F5.4/openmpi_release/debug/cmake + +//The directory containing a CMake configuration file for PASTIX. +PASTIX_DIR:PATH=/store/software/opencmiss/dependencies/install/x86_64_linux/gnu-5.4-F5.4/openmpi_release/debug/cmake + +//The directory containing a CMake configuration file for PETSC. +PETSC_DIR:PATH=/store/software/opencmiss/dependencies/install/x86_64_linux/gnu-5.4-F5.4/openmpi_release/debug/cmake + +//The directory containing a CMake configuration file for PTSCOTCH. +PTSCOTCH_DIR:PATH=/store/software/opencmiss/dependencies/install/x86_64_linux/gnu-5.4-F5.4/openmpi_release/debug/cmake + +//The directory containing a CMake configuration file for SCALAPACK. +SCALAPACK_DIR:PATH=/store/software/opencmiss/dependencies/install/x86_64_linux/gnu-5.4-F5.4/openmpi_release/debug/cmake + +//The directory containing a CMake configuration file for SUITESPARSE. +SUITESPARSE_DIR:PATH=/store/software/opencmiss/dependencies/install/x86_64_linux/gnu-5.4-F5.4/openmpi_release/debug/cmake + +//The directory containing a CMake configuration file for SUNDIALS. +SUNDIALS_DIR:PATH=/store/software/opencmiss/dependencies/install/x86_64_linux/gnu-5.4-F5.4/openmpi_release/debug/cmake + +//The directory containing a CMake configuration file for SUPERLU. +SUPERLU_DIR:PATH=/store/software/opencmiss/dependencies/install/x86_64_linux/gnu-5.4-F5.4/no_mpi/debug/cmake + +//The directory containing a CMake configuration file for SUPERLU_DIST. +SUPERLU_DIST_DIR:PATH=/store/software/opencmiss/dependencies/install/x86_64_linux/gnu-5.4-F5.4/openmpi_release/debug/cmake + +//Path to a file. +X11_ICE_INCLUDE_PATH:PATH=/usr/include + +//Path to a library. +X11_ICE_LIB:FILEPATH=/usr/lib/x86_64-linux-gnu/libICE.so + +//Path to a file. +X11_SM_INCLUDE_PATH:PATH=/usr/include + +//Path to a library. +X11_SM_LIB:FILEPATH=/usr/lib/x86_64-linux-gnu/libSM.so + +//Path to a file. +X11_X11_INCLUDE_PATH:PATH=/usr/include + +//Path to a library. +X11_X11_LIB:FILEPATH=/usr/lib/x86_64-linux-gnu/libX11.so + +//Path to a file. +X11_XRes_INCLUDE_PATH:PATH=/usr/include + +//Path to a library. +X11_XRes_LIB:FILEPATH=/usr/lib/x86_64-linux-gnu/libXRes.so + +//Path to a file. +X11_XShm_INCLUDE_PATH:PATH=/usr/include + +//Path to a file. +X11_XSync_INCLUDE_PATH:PATH=/usr/include + +//Path to a file. +X11_XTest_INCLUDE_PATH:PATH=/usr/include + +//Path to a library. +X11_XTest_LIB:FILEPATH=/usr/lib/x86_64-linux-gnu/libXtst.so + +//Path to a file. +X11_Xaccessrules_INCLUDE_PATH:PATH=/usr/include + +//Path to a file. +X11_Xaccessstr_INCLUDE_PATH:PATH=/usr/include + +//Path to a file. +X11_Xau_INCLUDE_PATH:PATH=/usr/include + +//Path to a library. +X11_Xau_LIB:FILEPATH=/usr/lib/x86_64-linux-gnu/libXau.so + +//Path to a file. +X11_Xcomposite_INCLUDE_PATH:PATH=/usr/include + +//Path to a library. +X11_Xcomposite_LIB:FILEPATH=/usr/lib/x86_64-linux-gnu/libXcomposite.so + +//Path to a file. +X11_Xcursor_INCLUDE_PATH:PATH=/usr/include + +//Path to a library. +X11_Xcursor_LIB:FILEPATH=/usr/lib/x86_64-linux-gnu/libXcursor.so + +//Path to a file. +X11_Xdamage_INCLUDE_PATH:PATH=/usr/include + +//Path to a library. +X11_Xdamage_LIB:FILEPATH=/usr/lib/x86_64-linux-gnu/libXdamage.so + +//Path to a file. +X11_Xdmcp_INCLUDE_PATH:PATH=/usr/include + +//Path to a library. +X11_Xdmcp_LIB:FILEPATH=/usr/lib/x86_64-linux-gnu/libXdmcp.so + +//Path to a library. +X11_Xext_LIB:FILEPATH=/usr/lib/x86_64-linux-gnu/libXext.so + +//Path to a file. +X11_Xfixes_INCLUDE_PATH:PATH=/usr/include + +//Path to a library. +X11_Xfixes_LIB:FILEPATH=/usr/lib/x86_64-linux-gnu/libXfixes.so + +//Path to a file. +X11_Xft_INCLUDE_PATH:PATH=/usr/include + +//Path to a library. +X11_Xft_LIB:FILEPATH=/usr/lib/x86_64-linux-gnu/libXft.so + +//Path to a file. +X11_Xi_INCLUDE_PATH:PATH=/usr/include + +//Path to a library. +X11_Xi_LIB:FILEPATH=/usr/lib/x86_64-linux-gnu/libXi.so + +//Path to a file. +X11_Xinerama_INCLUDE_PATH:PATH=/usr/include + +//Path to a library. +X11_Xinerama_LIB:FILEPATH=/usr/lib/x86_64-linux-gnu/libXinerama.so + +//Path to a file. +X11_Xinput_INCLUDE_PATH:PATH=/usr/include + +//Path to a library. +X11_Xinput_LIB:FILEPATH=/usr/lib/x86_64-linux-gnu/libXi.so + +//Path to a file. +X11_Xkb_INCLUDE_PATH:PATH=/usr/include + +//Path to a file. +X11_Xkbfile_INCLUDE_PATH:PATH=/usr/include + +//Path to a library. +X11_Xkbfile_LIB:FILEPATH=/usr/lib/x86_64-linux-gnu/libxkbfile.so + +//Path to a file. +X11_Xkblib_INCLUDE_PATH:PATH=/usr/include + +//Path to a file. +X11_Xlib_INCLUDE_PATH:PATH=/usr/include + +//Path to a file. +X11_Xmu_INCLUDE_PATH:PATH=/usr/include + +//Path to a library. +X11_Xmu_LIB:FILEPATH=/usr/lib/x86_64-linux-gnu/libXmu.so + +//Path to a file. +X11_Xpm_INCLUDE_PATH:PATH=/usr/include + +//Path to a library. +X11_Xpm_LIB:FILEPATH=/usr/lib/x86_64-linux-gnu/libXpm.so + +//Path to a file. +X11_Xrandr_INCLUDE_PATH:PATH=/usr/include + +//Path to a library. +X11_Xrandr_LIB:FILEPATH=/usr/lib/x86_64-linux-gnu/libXrandr.so + +//Path to a file. +X11_Xrender_INCLUDE_PATH:PATH=/usr/include + +//Path to a library. +X11_Xrender_LIB:FILEPATH=/usr/lib/x86_64-linux-gnu/libXrender.so + +//Path to a file. +X11_Xscreensaver_INCLUDE_PATH:PATH=/usr/include + +//Path to a library. +X11_Xscreensaver_LIB:FILEPATH=/usr/lib/x86_64-linux-gnu/libXss.so + +//Path to a file. +X11_Xshape_INCLUDE_PATH:PATH=/usr/include + +//Path to a file. +X11_Xt_INCLUDE_PATH:PATH=/usr/include + +//Path to a library. +X11_Xt_LIB:FILEPATH=/usr/lib/x86_64-linux-gnu/libXt.so + +//Path to a file. +X11_Xutil_INCLUDE_PATH:PATH=/usr/include + +//Path to a file. +X11_Xv_INCLUDE_PATH:PATH=/usr/include + +//Path to a library. +X11_Xv_LIB:FILEPATH=/usr/lib/x86_64-linux-gnu/libXv.so + +//Path to a library. +X11_Xxf86misc_LIB:FILEPATH=X11_Xxf86misc_LIB-NOTFOUND + +//Path to a library. +X11_Xxf86vm_LIB:FILEPATH=/usr/lib/x86_64-linux-gnu/libXxf86vm.so + +//Path to a file. +X11_dpms_INCLUDE_PATH:PATH=/usr/include + +//Path to a file. +X11_xf86misc_INCLUDE_PATH:PATH=X11_xf86misc_INCLUDE_PATH-NOTFOUND + +//Path to a file. +X11_xf86vmode_INCLUDE_PATH:PATH=/usr/include + +//The directory containing a CMake configuration file for ZLIB. +ZLIB_DIR:PATH=/store/software/opencmiss/dependencies/install/x86_64_linux/gnu-5.4-F5.4/no_mpi/debug/cmake + + +######################## +# INTERNAL cache entries +######################## + +//ADVANCED property for variable: CMAKE_AR +CMAKE_AR-ADVANCED:INTERNAL=1 +//This is the directory where this CMakeCache.txt was created +CMAKE_CACHEFILE_DIR:INTERNAL=/store/software/opencmiss/OpenCMISS-examples/FiniteElasticity/RightBiceps/build_debug +//Major version of cmake used to create the current loaded cache +CMAKE_CACHE_MAJOR_VERSION:INTERNAL=3 +//Minor version of cmake used to create the current loaded cache +CMAKE_CACHE_MINOR_VERSION:INTERNAL=5 +//Patch version of cmake used to create the current loaded cache +CMAKE_CACHE_PATCH_VERSION:INTERNAL=1 +//ADVANCED property for variable: CMAKE_COLOR_MAKEFILE +CMAKE_COLOR_MAKEFILE-ADVANCED:INTERNAL=1 +//Path to CMake executable. +CMAKE_COMMAND:INTERNAL=/usr/bin/cmake +//Path to cpack program executable. +CMAKE_CPACK_COMMAND:INTERNAL=/usr/bin/cpack +//Path to ctest program executable. +CMAKE_CTEST_COMMAND:INTERNAL=/usr/bin/ctest +//ADVANCED property for variable: CMAKE_C_COMPILER +CMAKE_C_COMPILER-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_C_FLAGS +CMAKE_C_FLAGS-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_C_FLAGS_DEBUG +CMAKE_C_FLAGS_DEBUG-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_C_FLAGS_MINSIZEREL +CMAKE_C_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_C_FLAGS_RELEASE +CMAKE_C_FLAGS_RELEASE-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_C_FLAGS_RELWITHDEBINFO +CMAKE_C_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 +//Path to cache edit program executable. +CMAKE_EDIT_COMMAND:INTERNAL=/usr/bin/ccmake +//Executable file format +CMAKE_EXECUTABLE_FORMAT:INTERNAL=ELF +//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS +CMAKE_EXE_LINKER_FLAGS-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_DEBUG +CMAKE_EXE_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_MINSIZEREL +CMAKE_EXE_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_RELEASE +CMAKE_EXE_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO +CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_EXPORT_COMPILE_COMMANDS +CMAKE_EXPORT_COMPILE_COMMANDS-ADVANCED:INTERNAL=1 +//Name of external makefile project generator. +CMAKE_EXTRA_GENERATOR:INTERNAL= +//ADVANCED property for variable: CMAKE_Fortran_COMPILER +CMAKE_Fortran_COMPILER-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_Fortran_FLAGS +CMAKE_Fortran_FLAGS-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_Fortran_FLAGS_DEBUG +CMAKE_Fortran_FLAGS_DEBUG-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_Fortran_FLAGS_MINSIZEREL +CMAKE_Fortran_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_Fortran_FLAGS_RELEASE +CMAKE_Fortran_FLAGS_RELEASE-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_Fortran_FLAGS_RELWITHDEBINFO +CMAKE_Fortran_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 +//Name of generator. +CMAKE_GENERATOR:INTERNAL=Unix Makefiles +//Name of generator platform. +CMAKE_GENERATOR_PLATFORM:INTERNAL= +//Name of generator toolset. +CMAKE_GENERATOR_TOOLSET:INTERNAL= +//Have function connect +CMAKE_HAVE_CONNECT:INTERNAL=1 +//Have function gethostbyname +CMAKE_HAVE_GETHOSTBYNAME:INTERNAL=1 +//Have symbol pthread_create +CMAKE_HAVE_LIBC_CREATE:INTERNAL= +//Have library pthreads +CMAKE_HAVE_PTHREADS_CREATE:INTERNAL= +//Have library pthread +CMAKE_HAVE_PTHREAD_CREATE:INTERNAL=1 +//Have include pthread.h +CMAKE_HAVE_PTHREAD_H:INTERNAL=1 +//Have function remove +CMAKE_HAVE_REMOVE:INTERNAL=1 +//Have function shmat +CMAKE_HAVE_SHMAT:INTERNAL=1 +//Source directory with the top level CMakeLists.txt file for this +// project +CMAKE_HOME_DIRECTORY:INTERNAL=/store/software/opencmiss/OpenCMISS-examples/FiniteElasticity/RightBiceps +//Install .so files without execute permission. +CMAKE_INSTALL_SO_NO_EXE:INTERNAL=1 +//Have library ICE +CMAKE_LIB_ICE_HAS_ICECONNECTIONNUMBER:INTERNAL=1 +//ADVANCED property for variable: CMAKE_LINKER +CMAKE_LINKER-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_MAKE_PROGRAM +CMAKE_MAKE_PROGRAM-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS +CMAKE_MODULE_LINKER_FLAGS-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS_DEBUG +CMAKE_MODULE_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL +CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS_RELEASE +CMAKE_MODULE_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO +CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_NM +CMAKE_NM-ADVANCED:INTERNAL=1 +//number of local generators +CMAKE_NUMBER_OF_MAKEFILES:INTERNAL=2 +//ADVANCED property for variable: CMAKE_OBJCOPY +CMAKE_OBJCOPY-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_OBJDUMP +CMAKE_OBJDUMP-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_RANLIB +CMAKE_RANLIB-ADVANCED:INTERNAL=1 +//Path to CMake installation. +CMAKE_ROOT:INTERNAL=/usr/share/cmake-3.5 +//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS +CMAKE_SHARED_LINKER_FLAGS-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_DEBUG +CMAKE_SHARED_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL +CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_RELEASE +CMAKE_SHARED_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO +CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_SKIP_INSTALL_RPATH +CMAKE_SKIP_INSTALL_RPATH-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_SKIP_RPATH +CMAKE_SKIP_RPATH-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS +CMAKE_STATIC_LINKER_FLAGS-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS_DEBUG +CMAKE_STATIC_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS_MINSIZEREL +CMAKE_STATIC_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS_RELEASE +CMAKE_STATIC_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO +CMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_STRIP +CMAKE_STRIP-ADVANCED:INTERNAL=1 +//uname command +CMAKE_UNAME:INTERNAL=/bin/uname +//ADVANCED property for variable: CMAKE_VERBOSE_MAKEFILE +CMAKE_VERBOSE_MAKEFILE-ADVANCED:INTERNAL=1 +//Details about finding MPI_C +FIND_PACKAGE_MESSAGE_DETAILS_MPI_C:INTERNAL=[/usr/lib/openmpi/lib/libmpi.so][/usr/lib/openmpi/include/openmpi/opal/mca/event/libevent2021/libevent;/usr/lib/openmpi/include/openmpi/opal/mca/event/libevent2021/libevent/include;/usr/lib/openmpi/include;/usr/lib/openmpi/include/openmpi][v()] +//Details about finding MPI_Fortran +FIND_PACKAGE_MESSAGE_DETAILS_MPI_Fortran:INTERNAL=[/usr/lib/openmpi/lib/libmpi_usempif08.so;/usr/lib/openmpi/lib/libmpi_usempi_ignore_tkr.so;/usr/lib/openmpi/lib/libmpi_mpifh.so;/usr/lib/openmpi/lib/libmpi.so][/usr/lib/openmpi/include;/usr/lib/openmpi/lib][v()] +//ADVANCED property for variable: MPIEXEC +MPIEXEC-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: MPIEXEC_MAX_NUMPROCS +MPIEXEC_MAX_NUMPROCS-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: MPIEXEC_NUMPROC_FLAG +MPIEXEC_NUMPROC_FLAG-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: MPIEXEC_POSTFLAGS +MPIEXEC_POSTFLAGS-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: MPIEXEC_PREFLAGS +MPIEXEC_PREFLAGS-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: MPI_C_COMPILER +MPI_C_COMPILER-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: MPI_C_COMPILE_FLAGS +MPI_C_COMPILE_FLAGS-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: MPI_C_INCLUDE_PATH +MPI_C_INCLUDE_PATH-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: MPI_C_LIBRARIES +MPI_C_LIBRARIES-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: MPI_C_LINK_FLAGS +MPI_C_LINK_FLAGS-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: MPI_Fortran_COMPILER +MPI_Fortran_COMPILER-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: MPI_Fortran_COMPILE_FLAGS +MPI_Fortran_COMPILE_FLAGS-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: MPI_Fortran_INCLUDE_PATH +MPI_Fortran_INCLUDE_PATH-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: MPI_Fortran_LIBRARIES +MPI_Fortran_LIBRARIES-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: MPI_Fortran_LINK_FLAGS +MPI_Fortran_LINK_FLAGS-ADVANCED:INTERNAL=1 +//Test MPI_Fortran_MODULE_COMPATIBLE +MPI_Fortran_MODULE_COMPATIBLE:INTERNAL=1 +//Scratch variable for MPI header detection +MPI_HEADER_PATH:INTERNAL=MPI_HEADER_PATH-NOTFOUND +//Scratch variable for MPI lib detection +MPI_LIB:INTERNAL=MPI_LIB-NOTFOUND +//ADVANCED property for variable: X11_ICE_INCLUDE_PATH +X11_ICE_INCLUDE_PATH-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: X11_ICE_LIB +X11_ICE_LIB-ADVANCED:INTERNAL=1 +//Have library /usr/lib/x86_64-linux-gnu/libX11.so;/usr/lib/x86_64-linux-gnu/libXext.so +X11_LIB_X11_SOLO:INTERNAL=1 +//ADVANCED property for variable: X11_SM_INCLUDE_PATH +X11_SM_INCLUDE_PATH-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: X11_SM_LIB +X11_SM_LIB-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: X11_X11_INCLUDE_PATH +X11_X11_INCLUDE_PATH-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: X11_X11_LIB +X11_X11_LIB-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: X11_XRes_INCLUDE_PATH +X11_XRes_INCLUDE_PATH-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: X11_XRes_LIB +X11_XRes_LIB-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: X11_XShm_INCLUDE_PATH +X11_XShm_INCLUDE_PATH-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: X11_XSync_INCLUDE_PATH +X11_XSync_INCLUDE_PATH-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: X11_XTest_INCLUDE_PATH +X11_XTest_INCLUDE_PATH-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: X11_XTest_LIB +X11_XTest_LIB-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: X11_Xaccessrules_INCLUDE_PATH +X11_Xaccessrules_INCLUDE_PATH-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: X11_Xaccessstr_INCLUDE_PATH +X11_Xaccessstr_INCLUDE_PATH-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: X11_Xau_INCLUDE_PATH +X11_Xau_INCLUDE_PATH-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: X11_Xau_LIB +X11_Xau_LIB-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: X11_Xcomposite_INCLUDE_PATH +X11_Xcomposite_INCLUDE_PATH-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: X11_Xcomposite_LIB +X11_Xcomposite_LIB-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: X11_Xcursor_INCLUDE_PATH +X11_Xcursor_INCLUDE_PATH-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: X11_Xcursor_LIB +X11_Xcursor_LIB-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: X11_Xdamage_INCLUDE_PATH +X11_Xdamage_INCLUDE_PATH-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: X11_Xdamage_LIB +X11_Xdamage_LIB-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: X11_Xdmcp_INCLUDE_PATH +X11_Xdmcp_INCLUDE_PATH-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: X11_Xdmcp_LIB +X11_Xdmcp_LIB-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: X11_Xext_LIB +X11_Xext_LIB-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: X11_Xfixes_INCLUDE_PATH +X11_Xfixes_INCLUDE_PATH-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: X11_Xfixes_LIB +X11_Xfixes_LIB-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: X11_Xft_INCLUDE_PATH +X11_Xft_INCLUDE_PATH-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: X11_Xft_LIB +X11_Xft_LIB-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: X11_Xi_INCLUDE_PATH +X11_Xi_INCLUDE_PATH-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: X11_Xi_LIB +X11_Xi_LIB-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: X11_Xinerama_INCLUDE_PATH +X11_Xinerama_INCLUDE_PATH-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: X11_Xinerama_LIB +X11_Xinerama_LIB-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: X11_Xinput_INCLUDE_PATH +X11_Xinput_INCLUDE_PATH-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: X11_Xinput_LIB +X11_Xinput_LIB-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: X11_Xkb_INCLUDE_PATH +X11_Xkb_INCLUDE_PATH-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: X11_Xkbfile_INCLUDE_PATH +X11_Xkbfile_INCLUDE_PATH-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: X11_Xkbfile_LIB +X11_Xkbfile_LIB-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: X11_Xkblib_INCLUDE_PATH +X11_Xkblib_INCLUDE_PATH-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: X11_Xlib_INCLUDE_PATH +X11_Xlib_INCLUDE_PATH-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: X11_Xmu_INCLUDE_PATH +X11_Xmu_INCLUDE_PATH-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: X11_Xmu_LIB +X11_Xmu_LIB-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: X11_Xpm_INCLUDE_PATH +X11_Xpm_INCLUDE_PATH-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: X11_Xpm_LIB +X11_Xpm_LIB-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: X11_Xrandr_INCLUDE_PATH +X11_Xrandr_INCLUDE_PATH-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: X11_Xrandr_LIB +X11_Xrandr_LIB-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: X11_Xrender_INCLUDE_PATH +X11_Xrender_INCLUDE_PATH-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: X11_Xrender_LIB +X11_Xrender_LIB-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: X11_Xscreensaver_INCLUDE_PATH +X11_Xscreensaver_INCLUDE_PATH-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: X11_Xscreensaver_LIB +X11_Xscreensaver_LIB-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: X11_Xshape_INCLUDE_PATH +X11_Xshape_INCLUDE_PATH-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: X11_Xt_INCLUDE_PATH +X11_Xt_INCLUDE_PATH-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: X11_Xt_LIB +X11_Xt_LIB-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: X11_Xutil_INCLUDE_PATH +X11_Xutil_INCLUDE_PATH-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: X11_Xv_INCLUDE_PATH +X11_Xv_INCLUDE_PATH-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: X11_Xv_LIB +X11_Xv_LIB-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: X11_Xxf86misc_LIB +X11_Xxf86misc_LIB-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: X11_Xxf86vm_LIB +X11_Xxf86vm_LIB-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: X11_dpms_INCLUDE_PATH +X11_dpms_INCLUDE_PATH-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: X11_xf86misc_INCLUDE_PATH +X11_xf86misc_INCLUDE_PATH-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: X11_xf86vmode_INCLUDE_PATH +X11_xf86vmode_INCLUDE_PATH-ADVANCED:INTERNAL=1 + diff --git a/FiniteElasticity/RightBiceps/build_debug/CMakeFiles/3.5.1/CMakeCCompiler.cmake b/FiniteElasticity/RightBiceps/build_debug/CMakeFiles/3.5.1/CMakeCCompiler.cmake new file mode 100644 index 00000000..f40522e6 --- /dev/null +++ b/FiniteElasticity/RightBiceps/build_debug/CMakeFiles/3.5.1/CMakeCCompiler.cmake @@ -0,0 +1,67 @@ +set(CMAKE_C_COMPILER "/usr/bin/cc") +set(CMAKE_C_COMPILER_ARG1 "") +set(CMAKE_C_COMPILER_ID "GNU") +set(CMAKE_C_COMPILER_VERSION "5.4.0") +set(CMAKE_C_COMPILER_WRAPPER "") +set(CMAKE_C_STANDARD_COMPUTED_DEFAULT "11") +set(CMAKE_C_COMPILE_FEATURES "c_function_prototypes;c_restrict;c_variadic_macros;c_static_assert") +set(CMAKE_C90_COMPILE_FEATURES "c_function_prototypes") +set(CMAKE_C99_COMPILE_FEATURES "c_restrict;c_variadic_macros") +set(CMAKE_C11_COMPILE_FEATURES "c_static_assert") + +set(CMAKE_C_PLATFORM_ID "Linux") +set(CMAKE_C_SIMULATE_ID "") +set(CMAKE_C_SIMULATE_VERSION "") + +set(CMAKE_AR "/usr/bin/ar") +set(CMAKE_RANLIB "/usr/bin/ranlib") +set(CMAKE_LINKER "/usr/bin/ld") +set(CMAKE_COMPILER_IS_GNUCC 1) +set(CMAKE_C_COMPILER_LOADED 1) +set(CMAKE_C_COMPILER_WORKS TRUE) +set(CMAKE_C_ABI_COMPILED TRUE) +set(CMAKE_COMPILER_IS_MINGW ) +set(CMAKE_COMPILER_IS_CYGWIN ) +if(CMAKE_COMPILER_IS_CYGWIN) + set(CYGWIN 1) + set(UNIX 1) +endif() + +set(CMAKE_C_COMPILER_ENV_VAR "CC") + +if(CMAKE_COMPILER_IS_MINGW) + set(MINGW 1) +endif() +set(CMAKE_C_COMPILER_ID_RUN 1) +set(CMAKE_C_SOURCE_FILE_EXTENSIONS c;m) +set(CMAKE_C_IGNORE_EXTENSIONS h;H;o;O;obj;OBJ;def;DEF;rc;RC) +set(CMAKE_C_LINKER_PREFERENCE 10) + +# Save compiler ABI information. +set(CMAKE_C_SIZEOF_DATA_PTR "8") +set(CMAKE_C_COMPILER_ABI "ELF") +set(CMAKE_C_LIBRARY_ARCHITECTURE "x86_64-linux-gnu") + +if(CMAKE_C_SIZEOF_DATA_PTR) + set(CMAKE_SIZEOF_VOID_P "${CMAKE_C_SIZEOF_DATA_PTR}") +endif() + +if(CMAKE_C_COMPILER_ABI) + set(CMAKE_INTERNAL_PLATFORM_ABI "${CMAKE_C_COMPILER_ABI}") +endif() + +if(CMAKE_C_LIBRARY_ARCHITECTURE) + set(CMAKE_LIBRARY_ARCHITECTURE "x86_64-linux-gnu") +endif() + +set(CMAKE_C_CL_SHOWINCLUDES_PREFIX "") +if(CMAKE_C_CL_SHOWINCLUDES_PREFIX) + set(CMAKE_CL_SHOWINCLUDES_PREFIX "${CMAKE_C_CL_SHOWINCLUDES_PREFIX}") +endif() + + + + +set(CMAKE_C_IMPLICIT_LINK_LIBRARIES "c") +set(CMAKE_C_IMPLICIT_LINK_DIRECTORIES "/usr/lib/gcc/x86_64-linux-gnu/5;/usr/lib/x86_64-linux-gnu;/usr/lib;/lib/x86_64-linux-gnu;/lib") +set(CMAKE_C_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES "") diff --git a/FiniteElasticity/RightBiceps/build_debug/CMakeFiles/3.5.1/CMakeDetermineCompilerABI_C.bin b/FiniteElasticity/RightBiceps/build_debug/CMakeFiles/3.5.1/CMakeDetermineCompilerABI_C.bin new file mode 100755 index 00000000..5bf96b27 Binary files /dev/null and b/FiniteElasticity/RightBiceps/build_debug/CMakeFiles/3.5.1/CMakeDetermineCompilerABI_C.bin differ diff --git a/FiniteElasticity/RightBiceps/build_debug/CMakeFiles/3.5.1/CMakeDetermineCompilerABI_Fortran.bin b/FiniteElasticity/RightBiceps/build_debug/CMakeFiles/3.5.1/CMakeDetermineCompilerABI_Fortran.bin new file mode 100755 index 00000000..595fbef4 Binary files /dev/null and b/FiniteElasticity/RightBiceps/build_debug/CMakeFiles/3.5.1/CMakeDetermineCompilerABI_Fortran.bin differ diff --git a/FiniteElasticity/RightBiceps/build_debug/CMakeFiles/3.5.1/CMakeFortranCompiler.cmake b/FiniteElasticity/RightBiceps/build_debug/CMakeFiles/3.5.1/CMakeFortranCompiler.cmake new file mode 100644 index 00000000..fff89a77 --- /dev/null +++ b/FiniteElasticity/RightBiceps/build_debug/CMakeFiles/3.5.1/CMakeFortranCompiler.cmake @@ -0,0 +1,59 @@ +set(CMAKE_Fortran_COMPILER "/usr/bin/gfortran") +set(CMAKE_Fortran_COMPILER_ARG1 "") +set(CMAKE_Fortran_COMPILER_ID "GNU") +set(CMAKE_Fortran_COMPILER_VERSION "5.4.0") +set(CMAKE_Fortran_COMPILER_WRAPPER "") +set(CMAKE_Fortran_PLATFORM_ID "") +set(CMAKE_Fortran_SIMULATE_ID "") +set(CMAKE_Fortran_SIMULATE_VERSION "") + +set(CMAKE_AR "/usr/bin/ar") +set(CMAKE_RANLIB "/usr/bin/ranlib") +set(CMAKE_COMPILER_IS_GNUG77 1) +set(CMAKE_Fortran_COMPILER_LOADED 1) +set(CMAKE_Fortran_COMPILER_WORKS TRUE) +set(CMAKE_Fortran_ABI_COMPILED TRUE) +set(CMAKE_COMPILER_IS_MINGW ) +set(CMAKE_COMPILER_IS_CYGWIN ) +if(CMAKE_COMPILER_IS_CYGWIN) + set(CYGWIN 1) + set(UNIX 1) +endif() + +set(CMAKE_Fortran_COMPILER_ENV_VAR "FC") + +set(CMAKE_Fortran_COMPILER_SUPPORTS_F90 1) + +if(CMAKE_COMPILER_IS_MINGW) + set(MINGW 1) +endif() +set(CMAKE_Fortran_COMPILER_ID_RUN 1) +set(CMAKE_Fortran_SOURCE_FILE_EXTENSIONS f;F;f77;F77;f90;F90;for;For;FOR;f95;F95) +set(CMAKE_Fortran_IGNORE_EXTENSIONS h;H;o;O;obj;OBJ;def;DEF;rc;RC) +set(CMAKE_Fortran_LINKER_PREFERENCE 20) +if(UNIX) + set(CMAKE_Fortran_OUTPUT_EXTENSION .o) +else() + set(CMAKE_Fortran_OUTPUT_EXTENSION .obj) +endif() + +# Save compiler ABI information. +set(CMAKE_Fortran_SIZEOF_DATA_PTR "8") +set(CMAKE_Fortran_COMPILER_ABI "") +set(CMAKE_Fortran_LIBRARY_ARCHITECTURE "x86_64-linux-gnu") + +if(CMAKE_Fortran_SIZEOF_DATA_PTR AND NOT CMAKE_SIZEOF_VOID_P) + set(CMAKE_SIZEOF_VOID_P "${CMAKE_Fortran_SIZEOF_DATA_PTR}") +endif() + +if(CMAKE_Fortran_COMPILER_ABI) + set(CMAKE_INTERNAL_PLATFORM_ABI "${CMAKE_Fortran_COMPILER_ABI}") +endif() + +if(CMAKE_Fortran_LIBRARY_ARCHITECTURE) + set(CMAKE_LIBRARY_ARCHITECTURE "x86_64-linux-gnu") +endif() + +set(CMAKE_Fortran_IMPLICIT_LINK_LIBRARIES "gfortran;m;quadmath;m;c") +set(CMAKE_Fortran_IMPLICIT_LINK_DIRECTORIES "/usr/lib/gcc/x86_64-linux-gnu/5;/usr/lib/x86_64-linux-gnu;/usr/lib;/lib/x86_64-linux-gnu;/lib") +set(CMAKE_Fortran_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES "") diff --git a/FiniteElasticity/RightBiceps/build_debug/CMakeFiles/3.5.1/CMakeSystem.cmake b/FiniteElasticity/RightBiceps/build_debug/CMakeFiles/3.5.1/CMakeSystem.cmake new file mode 100644 index 00000000..84375768 --- /dev/null +++ b/FiniteElasticity/RightBiceps/build_debug/CMakeFiles/3.5.1/CMakeSystem.cmake @@ -0,0 +1,15 @@ +set(CMAKE_HOST_SYSTEM "Linux-4.4.0-104-generic") +set(CMAKE_HOST_SYSTEM_NAME "Linux") +set(CMAKE_HOST_SYSTEM_VERSION "4.4.0-104-generic") +set(CMAKE_HOST_SYSTEM_PROCESSOR "x86_64") + + + +set(CMAKE_SYSTEM "Linux-4.4.0-104-generic") +set(CMAKE_SYSTEM_NAME "Linux") +set(CMAKE_SYSTEM_VERSION "4.4.0-104-generic") +set(CMAKE_SYSTEM_PROCESSOR "x86_64") + +set(CMAKE_CROSSCOMPILING "FALSE") + +set(CMAKE_SYSTEM_LOADED 1) diff --git a/FiniteElasticity/RightBiceps/build_debug/CMakeFiles/3.5.1/CompilerIdC/CMakeCCompilerId.c b/FiniteElasticity/RightBiceps/build_debug/CMakeFiles/3.5.1/CompilerIdC/CMakeCCompilerId.c new file mode 100644 index 00000000..570a15e9 --- /dev/null +++ b/FiniteElasticity/RightBiceps/build_debug/CMakeFiles/3.5.1/CompilerIdC/CMakeCCompilerId.c @@ -0,0 +1,544 @@ +#ifdef __cplusplus +# error "A C++ compiler has been selected for C." +#endif + +#if defined(__18CXX) +# define ID_VOID_MAIN +#endif + + +/* Version number components: V=Version, R=Revision, P=Patch + Version date components: YYYY=Year, MM=Month, DD=Day */ + +#if defined(__INTEL_COMPILER) || defined(__ICC) +# define COMPILER_ID "Intel" +# if defined(_MSC_VER) +# define SIMULATE_ID "MSVC" +# endif + /* __INTEL_COMPILER = VRP */ +# define COMPILER_VERSION_MAJOR DEC(__INTEL_COMPILER/100) +# define COMPILER_VERSION_MINOR DEC(__INTEL_COMPILER/10 % 10) +# if defined(__INTEL_COMPILER_UPDATE) +# define COMPILER_VERSION_PATCH DEC(__INTEL_COMPILER_UPDATE) +# else +# define COMPILER_VERSION_PATCH DEC(__INTEL_COMPILER % 10) +# endif +# if defined(__INTEL_COMPILER_BUILD_DATE) + /* __INTEL_COMPILER_BUILD_DATE = YYYYMMDD */ +# define COMPILER_VERSION_TWEAK DEC(__INTEL_COMPILER_BUILD_DATE) +# endif +# if defined(_MSC_VER) + /* _MSC_VER = VVRR */ +# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100) +# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100) +# endif + +#elif defined(__PATHCC__) +# define COMPILER_ID "PathScale" +# define COMPILER_VERSION_MAJOR DEC(__PATHCC__) +# define COMPILER_VERSION_MINOR DEC(__PATHCC_MINOR__) +# if defined(__PATHCC_PATCHLEVEL__) +# define COMPILER_VERSION_PATCH DEC(__PATHCC_PATCHLEVEL__) +# endif + +#elif defined(__BORLANDC__) && defined(__CODEGEARC_VERSION__) +# define COMPILER_ID "Embarcadero" +# define COMPILER_VERSION_MAJOR HEX(__CODEGEARC_VERSION__>>24 & 0x00FF) +# define COMPILER_VERSION_MINOR HEX(__CODEGEARC_VERSION__>>16 & 0x00FF) +# define COMPILER_VERSION_PATCH DEC(__CODEGEARC_VERSION__ & 0xFFFF) + +#elif defined(__BORLANDC__) +# define COMPILER_ID "Borland" + /* __BORLANDC__ = 0xVRR */ +# define COMPILER_VERSION_MAJOR HEX(__BORLANDC__>>8) +# define COMPILER_VERSION_MINOR HEX(__BORLANDC__ & 0xFF) + +#elif defined(__WATCOMC__) && __WATCOMC__ < 1200 +# define COMPILER_ID "Watcom" + /* __WATCOMC__ = VVRR */ +# define COMPILER_VERSION_MAJOR DEC(__WATCOMC__ / 100) +# define COMPILER_VERSION_MINOR DEC((__WATCOMC__ / 10) % 10) +# if (__WATCOMC__ % 10) > 0 +# define COMPILER_VERSION_PATCH DEC(__WATCOMC__ % 10) +# endif + +#elif defined(__WATCOMC__) +# define COMPILER_ID "OpenWatcom" + /* __WATCOMC__ = VVRP + 1100 */ +# define COMPILER_VERSION_MAJOR DEC((__WATCOMC__ - 1100) / 100) +# define COMPILER_VERSION_MINOR DEC((__WATCOMC__ / 10) % 10) +# if (__WATCOMC__ % 10) > 0 +# define COMPILER_VERSION_PATCH DEC(__WATCOMC__ % 10) +# endif + +#elif defined(__SUNPRO_C) +# define COMPILER_ID "SunPro" +# if __SUNPRO_C >= 0x5100 + /* __SUNPRO_C = 0xVRRP */ +# define COMPILER_VERSION_MAJOR HEX(__SUNPRO_C>>12) +# define COMPILER_VERSION_MINOR HEX(__SUNPRO_C>>4 & 0xFF) +# define COMPILER_VERSION_PATCH HEX(__SUNPRO_C & 0xF) +# else + /* __SUNPRO_CC = 0xVRP */ +# define COMPILER_VERSION_MAJOR HEX(__SUNPRO_C>>8) +# define COMPILER_VERSION_MINOR HEX(__SUNPRO_C>>4 & 0xF) +# define COMPILER_VERSION_PATCH HEX(__SUNPRO_C & 0xF) +# endif + +#elif defined(__HP_cc) +# define COMPILER_ID "HP" + /* __HP_cc = VVRRPP */ +# define COMPILER_VERSION_MAJOR DEC(__HP_cc/10000) +# define COMPILER_VERSION_MINOR DEC(__HP_cc/100 % 100) +# define COMPILER_VERSION_PATCH DEC(__HP_cc % 100) + +#elif defined(__DECC) +# define COMPILER_ID "Compaq" + /* __DECC_VER = VVRRTPPPP */ +# define COMPILER_VERSION_MAJOR DEC(__DECC_VER/10000000) +# define COMPILER_VERSION_MINOR DEC(__DECC_VER/100000 % 100) +# define COMPILER_VERSION_PATCH DEC(__DECC_VER % 10000) + +#elif defined(__IBMC__) && defined(__COMPILER_VER__) +# define COMPILER_ID "zOS" + /* __IBMC__ = VRP */ +# define COMPILER_VERSION_MAJOR DEC(__IBMC__/100) +# define COMPILER_VERSION_MINOR DEC(__IBMC__/10 % 10) +# define COMPILER_VERSION_PATCH DEC(__IBMC__ % 10) + +#elif defined(__IBMC__) && !defined(__COMPILER_VER__) && __IBMC__ >= 800 +# define COMPILER_ID "XL" + /* __IBMC__ = VRP */ +# define COMPILER_VERSION_MAJOR DEC(__IBMC__/100) +# define COMPILER_VERSION_MINOR DEC(__IBMC__/10 % 10) +# define COMPILER_VERSION_PATCH DEC(__IBMC__ % 10) + +#elif defined(__IBMC__) && !defined(__COMPILER_VER__) && __IBMC__ < 800 +# define COMPILER_ID "VisualAge" + /* __IBMC__ = VRP */ +# define COMPILER_VERSION_MAJOR DEC(__IBMC__/100) +# define COMPILER_VERSION_MINOR DEC(__IBMC__/10 % 10) +# define COMPILER_VERSION_PATCH DEC(__IBMC__ % 10) + +#elif defined(__PGI) +# define COMPILER_ID "PGI" +# define COMPILER_VERSION_MAJOR DEC(__PGIC__) +# define COMPILER_VERSION_MINOR DEC(__PGIC_MINOR__) +# if defined(__PGIC_PATCHLEVEL__) +# define COMPILER_VERSION_PATCH DEC(__PGIC_PATCHLEVEL__) +# endif + +#elif defined(_CRAYC) +# define COMPILER_ID "Cray" +# define COMPILER_VERSION_MAJOR DEC(_RELEASE_MAJOR) +# define COMPILER_VERSION_MINOR DEC(_RELEASE_MINOR) + +#elif defined(__TI_COMPILER_VERSION__) +# define COMPILER_ID "TI" + /* __TI_COMPILER_VERSION__ = VVVRRRPPP */ +# define COMPILER_VERSION_MAJOR DEC(__TI_COMPILER_VERSION__/1000000) +# define COMPILER_VERSION_MINOR DEC(__TI_COMPILER_VERSION__/1000 % 1000) +# define COMPILER_VERSION_PATCH DEC(__TI_COMPILER_VERSION__ % 1000) + +#elif defined(__FUJITSU) || defined(__FCC_VERSION) || defined(__fcc_version) +# define COMPILER_ID "Fujitsu" + +#elif defined(__TINYC__) +# define COMPILER_ID "TinyCC" + +#elif defined(__SCO_VERSION__) +# define COMPILER_ID "SCO" + +#elif defined(__clang__) && defined(__apple_build_version__) +# define COMPILER_ID "AppleClang" +# if defined(_MSC_VER) +# define SIMULATE_ID "MSVC" +# endif +# define COMPILER_VERSION_MAJOR DEC(__clang_major__) +# define COMPILER_VERSION_MINOR DEC(__clang_minor__) +# define COMPILER_VERSION_PATCH DEC(__clang_patchlevel__) +# if defined(_MSC_VER) + /* _MSC_VER = VVRR */ +# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100) +# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100) +# endif +# define COMPILER_VERSION_TWEAK DEC(__apple_build_version__) + +#elif defined(__clang__) +# define COMPILER_ID "Clang" +# if defined(_MSC_VER) +# define SIMULATE_ID "MSVC" +# endif +# define COMPILER_VERSION_MAJOR DEC(__clang_major__) +# define COMPILER_VERSION_MINOR DEC(__clang_minor__) +# define COMPILER_VERSION_PATCH DEC(__clang_patchlevel__) +# if defined(_MSC_VER) + /* _MSC_VER = VVRR */ +# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100) +# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100) +# endif + +#elif defined(__GNUC__) +# define COMPILER_ID "GNU" +# define COMPILER_VERSION_MAJOR DEC(__GNUC__) +# if defined(__GNUC_MINOR__) +# define COMPILER_VERSION_MINOR DEC(__GNUC_MINOR__) +# endif +# if defined(__GNUC_PATCHLEVEL__) +# define COMPILER_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__) +# endif + +#elif defined(_MSC_VER) +# define COMPILER_ID "MSVC" + /* _MSC_VER = VVRR */ +# define COMPILER_VERSION_MAJOR DEC(_MSC_VER / 100) +# define COMPILER_VERSION_MINOR DEC(_MSC_VER % 100) +# if defined(_MSC_FULL_VER) +# if _MSC_VER >= 1400 + /* _MSC_FULL_VER = VVRRPPPPP */ +# define COMPILER_VERSION_PATCH DEC(_MSC_FULL_VER % 100000) +# else + /* _MSC_FULL_VER = VVRRPPPP */ +# define COMPILER_VERSION_PATCH DEC(_MSC_FULL_VER % 10000) +# endif +# endif +# if defined(_MSC_BUILD) +# define COMPILER_VERSION_TWEAK DEC(_MSC_BUILD) +# endif + +#elif defined(__VISUALDSPVERSION__) || defined(__ADSPBLACKFIN__) || defined(__ADSPTS__) || defined(__ADSP21000__) +# define COMPILER_ID "ADSP" +#if defined(__VISUALDSPVERSION__) + /* __VISUALDSPVERSION__ = 0xVVRRPP00 */ +# define COMPILER_VERSION_MAJOR HEX(__VISUALDSPVERSION__>>24) +# define COMPILER_VERSION_MINOR HEX(__VISUALDSPVERSION__>>16 & 0xFF) +# define COMPILER_VERSION_PATCH HEX(__VISUALDSPVERSION__>>8 & 0xFF) +#endif + +#elif defined(__IAR_SYSTEMS_ICC__ ) || defined(__IAR_SYSTEMS_ICC) +# define COMPILER_ID "IAR" + +#elif defined(__ARMCC_VERSION) +# define COMPILER_ID "ARMCC" +#if __ARMCC_VERSION >= 1000000 + /* __ARMCC_VERSION = VRRPPPP */ + # define COMPILER_VERSION_MAJOR DEC(__ARMCC_VERSION/1000000) + # define COMPILER_VERSION_MINOR DEC(__ARMCC_VERSION/10000 % 100) + # define COMPILER_VERSION_PATCH DEC(__ARMCC_VERSION % 10000) +#else + /* __ARMCC_VERSION = VRPPPP */ + # define COMPILER_VERSION_MAJOR DEC(__ARMCC_VERSION/100000) + # define COMPILER_VERSION_MINOR DEC(__ARMCC_VERSION/10000 % 10) + # define COMPILER_VERSION_PATCH DEC(__ARMCC_VERSION % 10000) +#endif + + +#elif defined(SDCC) +# define COMPILER_ID "SDCC" + /* SDCC = VRP */ +# define COMPILER_VERSION_MAJOR DEC(SDCC/100) +# define COMPILER_VERSION_MINOR DEC(SDCC/10 % 10) +# define COMPILER_VERSION_PATCH DEC(SDCC % 10) + +#elif defined(_SGI_COMPILER_VERSION) || defined(_COMPILER_VERSION) +# define COMPILER_ID "MIPSpro" +# if defined(_SGI_COMPILER_VERSION) + /* _SGI_COMPILER_VERSION = VRP */ +# define COMPILER_VERSION_MAJOR DEC(_SGI_COMPILER_VERSION/100) +# define COMPILER_VERSION_MINOR DEC(_SGI_COMPILER_VERSION/10 % 10) +# define COMPILER_VERSION_PATCH DEC(_SGI_COMPILER_VERSION % 10) +# else + /* _COMPILER_VERSION = VRP */ +# define COMPILER_VERSION_MAJOR DEC(_COMPILER_VERSION/100) +# define COMPILER_VERSION_MINOR DEC(_COMPILER_VERSION/10 % 10) +# define COMPILER_VERSION_PATCH DEC(_COMPILER_VERSION % 10) +# endif + + +/* These compilers are either not known or too old to define an + identification macro. Try to identify the platform and guess that + it is the native compiler. */ +#elif defined(__sgi) +# define COMPILER_ID "MIPSpro" + +#elif defined(__hpux) || defined(__hpua) +# define COMPILER_ID "HP" + +#else /* unknown compiler */ +# define COMPILER_ID "" +#endif + +/* Construct the string literal in pieces to prevent the source from + getting matched. Store it in a pointer rather than an array + because some compilers will just produce instructions to fill the + array rather than assigning a pointer to a static array. */ +char const* info_compiler = "INFO" ":" "compiler[" COMPILER_ID "]"; +#ifdef SIMULATE_ID +char const* info_simulate = "INFO" ":" "simulate[" SIMULATE_ID "]"; +#endif + +#ifdef __QNXNTO__ +char const* qnxnto = "INFO" ":" "qnxnto[]"; +#endif + +#if defined(__CRAYXE) || defined(__CRAYXC) +char const *info_cray = "INFO" ":" "compiler_wrapper[CrayPrgEnv]"; +#endif + +#define STRINGIFY_HELPER(X) #X +#define STRINGIFY(X) STRINGIFY_HELPER(X) + +/* Identify known platforms by name. */ +#if defined(__linux) || defined(__linux__) || defined(linux) +# define PLATFORM_ID "Linux" + +#elif defined(__CYGWIN__) +# define PLATFORM_ID "Cygwin" + +#elif defined(__MINGW32__) +# define PLATFORM_ID "MinGW" + +#elif defined(__APPLE__) +# define PLATFORM_ID "Darwin" + +#elif defined(_WIN32) || defined(__WIN32__) || defined(WIN32) +# define PLATFORM_ID "Windows" + +#elif defined(__FreeBSD__) || defined(__FreeBSD) +# define PLATFORM_ID "FreeBSD" + +#elif defined(__NetBSD__) || defined(__NetBSD) +# define PLATFORM_ID "NetBSD" + +#elif defined(__OpenBSD__) || defined(__OPENBSD) +# define PLATFORM_ID "OpenBSD" + +#elif defined(__sun) || defined(sun) +# define PLATFORM_ID "SunOS" + +#elif defined(_AIX) || defined(__AIX) || defined(__AIX__) || defined(__aix) || defined(__aix__) +# define PLATFORM_ID "AIX" + +#elif defined(__sgi) || defined(__sgi__) || defined(_SGI) +# define PLATFORM_ID "IRIX" + +#elif defined(__hpux) || defined(__hpux__) +# define PLATFORM_ID "HP-UX" + +#elif defined(__HAIKU__) +# define PLATFORM_ID "Haiku" + +#elif defined(__BeOS) || defined(__BEOS__) || defined(_BEOS) +# define PLATFORM_ID "BeOS" + +#elif defined(__QNX__) || defined(__QNXNTO__) +# define PLATFORM_ID "QNX" + +#elif defined(__tru64) || defined(_tru64) || defined(__TRU64__) +# define PLATFORM_ID "Tru64" + +#elif defined(__riscos) || defined(__riscos__) +# define PLATFORM_ID "RISCos" + +#elif defined(__sinix) || defined(__sinix__) || defined(__SINIX__) +# define PLATFORM_ID "SINIX" + +#elif defined(__UNIX_SV__) +# define PLATFORM_ID "UNIX_SV" + +#elif defined(__bsdos__) +# define PLATFORM_ID "BSDOS" + +#elif defined(_MPRAS) || defined(MPRAS) +# define PLATFORM_ID "MP-RAS" + +#elif defined(__osf) || defined(__osf__) +# define PLATFORM_ID "OSF1" + +#elif defined(_SCO_SV) || defined(SCO_SV) || defined(sco_sv) +# define PLATFORM_ID "SCO_SV" + +#elif defined(__ultrix) || defined(__ultrix__) || defined(_ULTRIX) +# define PLATFORM_ID "ULTRIX" + +#elif defined(__XENIX__) || defined(_XENIX) || defined(XENIX) +# define PLATFORM_ID "Xenix" + +#elif defined(__WATCOMC__) +# if defined(__LINUX__) +# define PLATFORM_ID "Linux" + +# elif defined(__DOS__) +# define PLATFORM_ID "DOS" + +# elif defined(__OS2__) +# define PLATFORM_ID "OS2" + +# elif defined(__WINDOWS__) +# define PLATFORM_ID "Windows3x" + +# else /* unknown platform */ +# define PLATFORM_ID "" +# endif + +#else /* unknown platform */ +# define PLATFORM_ID "" + +#endif + +/* For windows compilers MSVC and Intel we can determine + the architecture of the compiler being used. This is because + the compilers do not have flags that can change the architecture, + but rather depend on which compiler is being used +*/ +#if defined(_WIN32) && defined(_MSC_VER) +# if defined(_M_IA64) +# define ARCHITECTURE_ID "IA64" + +# elif defined(_M_X64) || defined(_M_AMD64) +# define ARCHITECTURE_ID "x64" + +# elif defined(_M_IX86) +# define ARCHITECTURE_ID "X86" + +# elif defined(_M_ARM) +# if _M_ARM == 4 +# define ARCHITECTURE_ID "ARMV4I" +# elif _M_ARM == 5 +# define ARCHITECTURE_ID "ARMV5I" +# else +# define ARCHITECTURE_ID "ARMV" STRINGIFY(_M_ARM) +# endif + +# elif defined(_M_MIPS) +# define ARCHITECTURE_ID "MIPS" + +# elif defined(_M_SH) +# define ARCHITECTURE_ID "SHx" + +# else /* unknown architecture */ +# define ARCHITECTURE_ID "" +# endif + +#elif defined(__WATCOMC__) +# if defined(_M_I86) +# define ARCHITECTURE_ID "I86" + +# elif defined(_M_IX86) +# define ARCHITECTURE_ID "X86" + +# else /* unknown architecture */ +# define ARCHITECTURE_ID "" +# endif + +#else +# define ARCHITECTURE_ID "" +#endif + +/* Convert integer to decimal digit literals. */ +#define DEC(n) \ + ('0' + (((n) / 10000000)%10)), \ + ('0' + (((n) / 1000000)%10)), \ + ('0' + (((n) / 100000)%10)), \ + ('0' + (((n) / 10000)%10)), \ + ('0' + (((n) / 1000)%10)), \ + ('0' + (((n) / 100)%10)), \ + ('0' + (((n) / 10)%10)), \ + ('0' + ((n) % 10)) + +/* Convert integer to hex digit literals. */ +#define HEX(n) \ + ('0' + ((n)>>28 & 0xF)), \ + ('0' + ((n)>>24 & 0xF)), \ + ('0' + ((n)>>20 & 0xF)), \ + ('0' + ((n)>>16 & 0xF)), \ + ('0' + ((n)>>12 & 0xF)), \ + ('0' + ((n)>>8 & 0xF)), \ + ('0' + ((n)>>4 & 0xF)), \ + ('0' + ((n) & 0xF)) + +/* Construct a string literal encoding the version number components. */ +#ifdef COMPILER_VERSION_MAJOR +char const info_version[] = { + 'I', 'N', 'F', 'O', ':', + 'c','o','m','p','i','l','e','r','_','v','e','r','s','i','o','n','[', + COMPILER_VERSION_MAJOR, +# ifdef COMPILER_VERSION_MINOR + '.', COMPILER_VERSION_MINOR, +# ifdef COMPILER_VERSION_PATCH + '.', COMPILER_VERSION_PATCH, +# ifdef COMPILER_VERSION_TWEAK + '.', COMPILER_VERSION_TWEAK, +# endif +# endif +# endif + ']','\0'}; +#endif + +/* Construct a string literal encoding the version number components. */ +#ifdef SIMULATE_VERSION_MAJOR +char const info_simulate_version[] = { + 'I', 'N', 'F', 'O', ':', + 's','i','m','u','l','a','t','e','_','v','e','r','s','i','o','n','[', + SIMULATE_VERSION_MAJOR, +# ifdef SIMULATE_VERSION_MINOR + '.', SIMULATE_VERSION_MINOR, +# ifdef SIMULATE_VERSION_PATCH + '.', SIMULATE_VERSION_PATCH, +# ifdef SIMULATE_VERSION_TWEAK + '.', SIMULATE_VERSION_TWEAK, +# endif +# endif +# endif + ']','\0'}; +#endif + +/* Construct the string literal in pieces to prevent the source from + getting matched. Store it in a pointer rather than an array + because some compilers will just produce instructions to fill the + array rather than assigning a pointer to a static array. */ +char const* info_platform = "INFO" ":" "platform[" PLATFORM_ID "]"; +char const* info_arch = "INFO" ":" "arch[" ARCHITECTURE_ID "]"; + + + + +const char* info_language_dialect_default = "INFO" ":" "dialect_default[" +#if !defined(__STDC_VERSION__) + "90" +#elif __STDC_VERSION__ >= 201000L + "11" +#elif __STDC_VERSION__ >= 199901L + "99" +#else +#endif +"]"; + +/*--------------------------------------------------------------------------*/ + +#ifdef ID_VOID_MAIN +void main() {} +#else +int main(int argc, char* argv[]) +{ + int require = 0; + require += info_compiler[argc]; + require += info_platform[argc]; + require += info_arch[argc]; +#ifdef COMPILER_VERSION_MAJOR + require += info_version[argc]; +#endif +#ifdef SIMULATE_ID + require += info_simulate[argc]; +#endif +#ifdef SIMULATE_VERSION_MAJOR + require += info_simulate_version[argc]; +#endif +#if defined(__CRAYXE) || defined(__CRAYXC) + require += info_cray[argc]; +#endif + require += info_language_dialect_default[argc]; + (void)argv; + return require; +} +#endif diff --git a/FiniteElasticity/RightBiceps/build_debug/CMakeFiles/3.5.1/CompilerIdFortran/CMakeFortranCompilerId.F b/FiniteElasticity/RightBiceps/build_debug/CMakeFiles/3.5.1/CompilerIdFortran/CMakeFortranCompilerId.F new file mode 100644 index 00000000..0e149618 --- /dev/null +++ b/FiniteElasticity/RightBiceps/build_debug/CMakeFiles/3.5.1/CompilerIdFortran/CMakeFortranCompilerId.F @@ -0,0 +1,1048 @@ + PROGRAM CMakeFortranCompilerId +#if 0 +! Identify the compiler +#endif +#if defined(__INTEL_COMPILER) || defined(__ICC) + PRINT *, 'INFO:compiler[Intel]' +# define COMPILER_VERSION_MAJOR DEC(__INTEL_COMPILER/100) +# define COMPILER_VERSION_MINOR DEC(__INTEL_COMPILER/10 % 10) +# if defined(__INTEL_COMPILER_UPDATE) +# define COMPILER_VERSION_PATCH DEC(__INTEL_COMPILER_UPDATE) +# else +# define COMPILER_VERSION_PATCH DEC(__INTEL_COMPILER % 10) +# endif +# if defined(__INTEL_COMPILER_BUILD_DATE) +# define COMPILER_VERSION_TWEAK DEC(__INTEL_COMPILER_BUILD_DATE) +# endif + +# if defined(_MSC_VER) + PRINT *, 'INFO:simulate[MSVC]' +# if _MSC_VER >= 1900 + PRINT *, 'INFO:simulate_version[019.00]' +# elif _MSC_VER >= 1800 + PRINT *, 'INFO:simulate_version[018.00]' +# elif _MSC_VER >= 1700 + PRINT *, 'INFO:simulate_version[017.00]' +# elif _MSC_VER >= 1600 + PRINT *, 'INFO:simulate_version[016.00]' +# elif _MSC_VER >= 1500 + PRINT *, 'INFO:simulate_version[015.00]' +# elif _MSC_VER >= 1400 + PRINT *, 'INFO:simulate_version[014.00]' +# elif _MSC_VER >= 1310 + PRINT *, 'INFO:simulate_version[013.01]' +# else + PRINT *, 'INFO:simulate_version[013.00]' +# endif +# endif +#elif defined(__SUNPRO_F95) + PRINT *, 'INFO:compiler[SunPro]' +# define COMPILER_VERSION_MAJOR HEX(__SUNPRO_F95>>8) +# define COMPILER_VERSION_MINOR HEX(__SUNPRO_F95>>4 & 0xF) +# define COMPILER_VERSION_PATCH HEX(__SUNPRO_F95 & 0xF) +#elif defined(__SUNPRO_F90) + PRINT *, 'INFO:compiler[SunPro]' +# define COMPILER_VERSION_MAJOR HEX(__SUNPRO_F90>>8) +# define COMPILER_VERSION_MINOR HEX(__SUNPRO_F90>>4 & 0xF) +# define COMPILER_VERSION_PATCH HEX(__SUNPRO_F90 & 0xF) +#elif defined(_CRAYFTN) + PRINT *, 'INFO:compiler[Cray]' +# define COMPILER_VERSION_MAJOR DEC(_RELEASE_MAJOR) +# define COMPILER_VERSION_MINOR DEC(_RELEASE_MINOR) +#elif defined(__G95__) + PRINT *, 'INFO:compiler[G95]' +# define COMPILER_VERSION_MAJOR DEC(__G95__) +# define COMPILER_VERSION_MINOR DEC(__G95_MINOR__) +#elif defined(__PATHSCALE__) + PRINT *, 'INFO:compiler[PathScale]' +# define COMPILER_VERSION_MAJOR DEC(__PATHCC__) +# define COMPILER_VERSION_MINOR DEC(__PATHCC_MINOR__) +# if defined(__PATHCC_PATCHLEVEL__) +# define COMPILER_VERSION_PATCH DEC(__PATHCC_PATCHLEVEL__) +# endif +#elif defined(__ABSOFT__) + PRINT *, 'INFO:compiler[Absoft]' +#elif defined(__GNUC__) + PRINT *, 'INFO:compiler[GNU]' +# define COMPILER_VERSION_MAJOR DEC(__GNUC__) +# define COMPILER_VERSION_MINOR DEC(__GNUC_MINOR__) +# if defined(__GNUC_PATCHLEVEL__) +# define COMPILER_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__) +# endif +#elif defined(__IBMC__) +# if defined(__COMPILER_VER__) + PRINT *, 'INFO:compiler[zOS]' +# elif __IBMC__ >= 800 + PRINT *, 'INFO:compiler[XL]' +# define COMPILER_VERSION_MAJOR DEC(__IBMC__/100) +# define COMPILER_VERSION_MINOR DEC(__IBMC__/10 % 10) +# define COMPILER_VERSION_PATCH DEC(__IBMC__ % 10) +# else + PRINT *, 'INFO:compiler[VisualAge]' +# define COMPILER_VERSION_MAJOR DEC(__IBMC__/100) +# define COMPILER_VERSION_MINOR DEC(__IBMC__/10 % 10) +# define COMPILER_VERSION_PATCH DEC(__IBMC__ % 10) +# endif +#elif defined(__PGI) + PRINT *, 'INFO:compiler[PGI]' +# define COMPILER_VERSION_MAJOR DEC(__PGIC__) +# define COMPILER_VERSION_MINOR DEC(__PGIC_MINOR__) +# if defined(__PGIC_PATCHLEVEL__) +# define COMPILER_VERSION_PATCH DEC(__PGIC_PATCHLEVEL__) +# endif +#elif defined(_SGI_COMPILER_VERSION) || defined(_COMPILER_VERSION) + PRINT *, 'INFO:compiler[MIPSpro]' +# if 0 +! This compiler is either not known or is too old to define an +! identification macro. Try to identify the platform and guess that +! it is the native compiler. +# endif +#elif defined(_AIX) || defined(__AIX) || defined(__AIX__) || defined(__aix) || defined(__aix__) + PRINT *, 'INFO:compiler[VisualAge]' +#elif defined(__sgi) || defined(__sgi__) || defined(_SGI) + PRINT *, 'INFO:compiler[MIPSpro]' +#elif defined(__hpux) || defined(__hpux__) + PRINT *, 'INFO:compiler[HP]' +#elif 1 +# if 0 +! The above 'elif 1' instead of 'else' is to work around a bug in the +! SGI preprocessor which produces both the __sgi and else blocks. +# endif + PRINT *, 'INFO:compiler[]' +#endif +#if defined(__CRAYXE) || defined(__CRAYXC) + PRINT *, 'INFO:compiler_wrapper[CrayPrgEnv]' +#endif + +#if 0 +! Identify the platform +#endif +#if defined(__linux) || defined(__linux__) || defined(linux) + PRINT *, 'INFO:platform[Linux]' +#elif defined(__CYGWIN__) + PRINT *, 'INFO:platform[Cygwin]' +#elif defined(__MINGW32__) + PRINT *, 'INFO:platform[MinGW]' +#elif defined(__APPLE__) + PRINT *, 'INFO:platform[Darwin]' +#elif defined(_WIN32) || defined(__WIN32__) || defined(WIN32) + PRINT *, 'INFO:platform[Windows]' +#elif defined(__FreeBSD__) || defined(__FreeBSD) + PRINT *, 'INFO:platform[FreeBSD]' +#elif defined(__NetBSD__) || defined(__NetBSD) + PRINT *, 'INFO:platform[NetBSD]' +#elif defined(__OpenBSD__) || defined(__OPENBSD) + PRINT *, 'INFO:platform[OpenBSD]' +#elif defined(__sun) || defined(sun) + PRINT *, 'INFO:platform[SunOS]' +#elif defined(_AIX) || defined(__AIX) || defined(__AIX__) || defined(__aix) || defined(__aix__) + PRINT *, 'INFO:platform[AIX]' +#elif defined(__sgi) || defined(__sgi__) || defined(_SGI) + PRINT *, 'INFO:platform[IRIX]' +#elif defined(__hpux) || defined(__hpux__) + PRINT *, 'INFO:platform[HP-UX]' +#elif defined(__HAIKU__) + PRINT *, 'INFO:platform[Haiku]' +#elif defined(__BeOS) || defined(__BEOS__) || defined(_BEOS) + PRINT *, 'INFO:platform[BeOS]' +#elif defined(__QNX__) || defined(__QNXNTO__) + PRINT *, 'INFO:platform[QNX]' +#elif defined(__tru64) || defined(_tru64) || defined(__TRU64__) + PRINT *, 'INFO:platform[Tru64]' +#elif defined(__riscos) || defined(__riscos__) + PRINT *, 'INFO:platform[RISCos]' +#elif defined(__sinix) || defined(__sinix__) || defined(__SINIX__) + PRINT *, 'INFO:platform[SINIX]' +#elif defined(__UNIX_SV__) + PRINT *, 'INFO:platform[UNIX_SV]' +#elif defined(__bsdos__) + PRINT *, 'INFO:platform[BSDOS]' +#elif defined(_MPRAS) || defined(MPRAS) + PRINT *, 'INFO:platform[MP-RAS]' +#elif defined(__osf) || defined(__osf__) + PRINT *, 'INFO:platform[OSF1]' +#elif defined(_SCO_SV) || defined(SCO_SV) || defined(sco_sv) + PRINT *, 'INFO:platform[SCO_SV]' +#elif defined(__ultrix) || defined(__ultrix__) || defined(_ULTRIX) + PRINT *, 'INFO:platform[ULTRIX]' +#elif defined(__XENIX__) || defined(_XENIX) || defined(XENIX) + PRINT *, 'INFO:platform[Xenix]' +#elif 1 +# if 0 +! The above 'elif 1' instead of 'else' is to work around a bug in the +! SGI preprocessor which produces both the __sgi and else blocks. +# endif + PRINT *, 'INFO:platform[]' +#endif +#if defined(_WIN32) && (defined(__INTEL_COMPILER) || defined(__ICC)) +# if defined(_M_IA64) + PRINT *, 'INFO:arch[IA64]' +# elif defined(_M_X64) || defined(_M_AMD64) + PRINT *, 'INFO:arch[x64]' +# elif defined(_M_IX86) + PRINT *, 'INFO:arch[X86]' +# endif +#endif + +#if 0 +! Encode compiler version digits +#endif +#define DEC_8(n) (((n) / 10000000) % 10) +#define DEC_7(n) (((n) / 1000000) % 10) +#define DEC_6(n) (((n) / 100000) % 10) +#define DEC_5(n) (((n) / 10000) % 10) +#define DEC_4(n) (((n) / 1000) % 10) +#define DEC_3(n) (((n) / 100) % 10) +#define DEC_2(n) (((n) / 10) % 10) +#define DEC_1(n) (((n) ) % 10) +#define HEX_8(n) ((n)>>28 & 0xF) +#define HEX_7(n) ((n)>>24 & 0xF) +#define HEX_6(n) ((n)>>20 & 0xF) +#define HEX_5(n) ((n)>>16 & 0xF) +#define HEX_4(n) ((n)>>12 & 0xF) +#define HEX_3(n) ((n)>>8 & 0xF) +#define HEX_2(n) ((n)>>4 & 0xF) +#define HEX_1(n) ((n) & 0xF) + +#if defined(COMPILER_VERSION_MAJOR) +# undef DEC +# undef HEX +# define DEC(n) DEC_1(n) +# define HEX(n) HEX_1(n) +# if COMPILER_VERSION_MAJOR == 0 + PRINT *, 'INFO:compiler_version_MAJOR_digit_1[0]' +# elif COMPILER_VERSION_MAJOR == 1 + PRINT *, 'INFO:compiler_version_MAJOR_digit_1[1]' +# elif COMPILER_VERSION_MAJOR == 2 + PRINT *, 'INFO:compiler_version_MAJOR_digit_1[2]' +# elif COMPILER_VERSION_MAJOR == 3 + PRINT *, 'INFO:compiler_version_MAJOR_digit_1[3]' +# elif COMPILER_VERSION_MAJOR == 4 + PRINT *, 'INFO:compiler_version_MAJOR_digit_1[4]' +# elif COMPILER_VERSION_MAJOR == 5 + PRINT *, 'INFO:compiler_version_MAJOR_digit_1[5]' +# elif COMPILER_VERSION_MAJOR == 6 + PRINT *, 'INFO:compiler_version_MAJOR_digit_1[6]' +# elif COMPILER_VERSION_MAJOR == 7 + PRINT *, 'INFO:compiler_version_MAJOR_digit_1[7]' +# elif COMPILER_VERSION_MAJOR == 8 + PRINT *, 'INFO:compiler_version_MAJOR_digit_1[8]' +# elif COMPILER_VERSION_MAJOR == 9 + PRINT *, 'INFO:compiler_version_MAJOR_digit_1[9]' +# endif + +# undef DEC +# undef HEX +# define DEC(n) DEC_2(n) +# define HEX(n) HEX_2(n) +# if COMPILER_VERSION_MAJOR == 0 + PRINT *, 'INFO:compiler_version_MAJOR_digit_2[0]' +# elif COMPILER_VERSION_MAJOR == 1 + PRINT *, 'INFO:compiler_version_MAJOR_digit_2[1]' +# elif COMPILER_VERSION_MAJOR == 2 + PRINT *, 'INFO:compiler_version_MAJOR_digit_2[2]' +# elif COMPILER_VERSION_MAJOR == 3 + PRINT *, 'INFO:compiler_version_MAJOR_digit_2[3]' +# elif COMPILER_VERSION_MAJOR == 4 + PRINT *, 'INFO:compiler_version_MAJOR_digit_2[4]' +# elif COMPILER_VERSION_MAJOR == 5 + PRINT *, 'INFO:compiler_version_MAJOR_digit_2[5]' +# elif COMPILER_VERSION_MAJOR == 6 + PRINT *, 'INFO:compiler_version_MAJOR_digit_2[6]' +# elif COMPILER_VERSION_MAJOR == 7 + PRINT *, 'INFO:compiler_version_MAJOR_digit_2[7]' +# elif COMPILER_VERSION_MAJOR == 8 + PRINT *, 'INFO:compiler_version_MAJOR_digit_2[8]' +# elif COMPILER_VERSION_MAJOR == 9 + PRINT *, 'INFO:compiler_version_MAJOR_digit_2[9]' +# endif + +# undef DEC +# undef HEX +# define DEC(n) DEC_3(n) +# define HEX(n) HEX_3(n) +# if COMPILER_VERSION_MAJOR == 0 + PRINT *, 'INFO:compiler_version_MAJOR_digit_3[0]' +# elif COMPILER_VERSION_MAJOR == 1 + PRINT *, 'INFO:compiler_version_MAJOR_digit_3[1]' +# elif COMPILER_VERSION_MAJOR == 2 + PRINT *, 'INFO:compiler_version_MAJOR_digit_3[2]' +# elif COMPILER_VERSION_MAJOR == 3 + PRINT *, 'INFO:compiler_version_MAJOR_digit_3[3]' +# elif COMPILER_VERSION_MAJOR == 4 + PRINT *, 'INFO:compiler_version_MAJOR_digit_3[4]' +# elif COMPILER_VERSION_MAJOR == 5 + PRINT *, 'INFO:compiler_version_MAJOR_digit_3[5]' +# elif COMPILER_VERSION_MAJOR == 6 + PRINT *, 'INFO:compiler_version_MAJOR_digit_3[6]' +# elif COMPILER_VERSION_MAJOR == 7 + PRINT *, 'INFO:compiler_version_MAJOR_digit_3[7]' +# elif COMPILER_VERSION_MAJOR == 8 + PRINT *, 'INFO:compiler_version_MAJOR_digit_3[8]' +# elif COMPILER_VERSION_MAJOR == 9 + PRINT *, 'INFO:compiler_version_MAJOR_digit_3[9]' +# endif + +# undef DEC +# undef HEX +# define DEC(n) DEC_4(n) +# define HEX(n) HEX_4(n) +# if COMPILER_VERSION_MAJOR == 0 + PRINT *, 'INFO:compiler_version_MAJOR_digit_4[0]' +# elif COMPILER_VERSION_MAJOR == 1 + PRINT *, 'INFO:compiler_version_MAJOR_digit_4[1]' +# elif COMPILER_VERSION_MAJOR == 2 + PRINT *, 'INFO:compiler_version_MAJOR_digit_4[2]' +# elif COMPILER_VERSION_MAJOR == 3 + PRINT *, 'INFO:compiler_version_MAJOR_digit_4[3]' +# elif COMPILER_VERSION_MAJOR == 4 + PRINT *, 'INFO:compiler_version_MAJOR_digit_4[4]' +# elif COMPILER_VERSION_MAJOR == 5 + PRINT *, 'INFO:compiler_version_MAJOR_digit_4[5]' +# elif COMPILER_VERSION_MAJOR == 6 + PRINT *, 'INFO:compiler_version_MAJOR_digit_4[6]' +# elif COMPILER_VERSION_MAJOR == 7 + PRINT *, 'INFO:compiler_version_MAJOR_digit_4[7]' +# elif COMPILER_VERSION_MAJOR == 8 + PRINT *, 'INFO:compiler_version_MAJOR_digit_4[8]' +# elif COMPILER_VERSION_MAJOR == 9 + PRINT *, 'INFO:compiler_version_MAJOR_digit_4[9]' +# endif + +# undef DEC +# undef HEX +# define DEC(n) DEC_5(n) +# define HEX(n) HEX_5(n) +# if COMPILER_VERSION_MAJOR == 0 + PRINT *, 'INFO:compiler_version_MAJOR_digit_5[0]' +# elif COMPILER_VERSION_MAJOR == 1 + PRINT *, 'INFO:compiler_version_MAJOR_digit_5[1]' +# elif COMPILER_VERSION_MAJOR == 2 + PRINT *, 'INFO:compiler_version_MAJOR_digit_5[2]' +# elif COMPILER_VERSION_MAJOR == 3 + PRINT *, 'INFO:compiler_version_MAJOR_digit_5[3]' +# elif COMPILER_VERSION_MAJOR == 4 + PRINT *, 'INFO:compiler_version_MAJOR_digit_5[4]' +# elif COMPILER_VERSION_MAJOR == 5 + PRINT *, 'INFO:compiler_version_MAJOR_digit_5[5]' +# elif COMPILER_VERSION_MAJOR == 6 + PRINT *, 'INFO:compiler_version_MAJOR_digit_5[6]' +# elif COMPILER_VERSION_MAJOR == 7 + PRINT *, 'INFO:compiler_version_MAJOR_digit_5[7]' +# elif COMPILER_VERSION_MAJOR == 8 + PRINT *, 'INFO:compiler_version_MAJOR_digit_5[8]' +# elif COMPILER_VERSION_MAJOR == 9 + PRINT *, 'INFO:compiler_version_MAJOR_digit_5[9]' +# endif + +# undef DEC +# undef HEX +# define DEC(n) DEC_6(n) +# define HEX(n) HEX_6(n) +# if COMPILER_VERSION_MAJOR == 0 + PRINT *, 'INFO:compiler_version_MAJOR_digit_6[0]' +# elif COMPILER_VERSION_MAJOR == 1 + PRINT *, 'INFO:compiler_version_MAJOR_digit_6[1]' +# elif COMPILER_VERSION_MAJOR == 2 + PRINT *, 'INFO:compiler_version_MAJOR_digit_6[2]' +# elif COMPILER_VERSION_MAJOR == 3 + PRINT *, 'INFO:compiler_version_MAJOR_digit_6[3]' +# elif COMPILER_VERSION_MAJOR == 4 + PRINT *, 'INFO:compiler_version_MAJOR_digit_6[4]' +# elif COMPILER_VERSION_MAJOR == 5 + PRINT *, 'INFO:compiler_version_MAJOR_digit_6[5]' +# elif COMPILER_VERSION_MAJOR == 6 + PRINT *, 'INFO:compiler_version_MAJOR_digit_6[6]' +# elif COMPILER_VERSION_MAJOR == 7 + PRINT *, 'INFO:compiler_version_MAJOR_digit_6[7]' +# elif COMPILER_VERSION_MAJOR == 8 + PRINT *, 'INFO:compiler_version_MAJOR_digit_6[8]' +# elif COMPILER_VERSION_MAJOR == 9 + PRINT *, 'INFO:compiler_version_MAJOR_digit_6[9]' +# endif + +# undef DEC +# undef HEX +# define DEC(n) DEC_7(n) +# define HEX(n) HEX_7(n) +# if COMPILER_VERSION_MAJOR == 0 + PRINT *, 'INFO:compiler_version_MAJOR_digit_7[0]' +# elif COMPILER_VERSION_MAJOR == 1 + PRINT *, 'INFO:compiler_version_MAJOR_digit_7[1]' +# elif COMPILER_VERSION_MAJOR == 2 + PRINT *, 'INFO:compiler_version_MAJOR_digit_7[2]' +# elif COMPILER_VERSION_MAJOR == 3 + PRINT *, 'INFO:compiler_version_MAJOR_digit_7[3]' +# elif COMPILER_VERSION_MAJOR == 4 + PRINT *, 'INFO:compiler_version_MAJOR_digit_7[4]' +# elif COMPILER_VERSION_MAJOR == 5 + PRINT *, 'INFO:compiler_version_MAJOR_digit_7[5]' +# elif COMPILER_VERSION_MAJOR == 6 + PRINT *, 'INFO:compiler_version_MAJOR_digit_7[6]' +# elif COMPILER_VERSION_MAJOR == 7 + PRINT *, 'INFO:compiler_version_MAJOR_digit_7[7]' +# elif COMPILER_VERSION_MAJOR == 8 + PRINT *, 'INFO:compiler_version_MAJOR_digit_7[8]' +# elif COMPILER_VERSION_MAJOR == 9 + PRINT *, 'INFO:compiler_version_MAJOR_digit_7[9]' +# endif + +# undef DEC +# undef HEX +# define DEC(n) DEC_8(n) +# define HEX(n) HEX_8(n) +# if COMPILER_VERSION_MAJOR == 0 + PRINT *, 'INFO:compiler_version_MAJOR_digit_8[0]' +# elif COMPILER_VERSION_MAJOR == 1 + PRINT *, 'INFO:compiler_version_MAJOR_digit_8[1]' +# elif COMPILER_VERSION_MAJOR == 2 + PRINT *, 'INFO:compiler_version_MAJOR_digit_8[2]' +# elif COMPILER_VERSION_MAJOR == 3 + PRINT *, 'INFO:compiler_version_MAJOR_digit_8[3]' +# elif COMPILER_VERSION_MAJOR == 4 + PRINT *, 'INFO:compiler_version_MAJOR_digit_8[4]' +# elif COMPILER_VERSION_MAJOR == 5 + PRINT *, 'INFO:compiler_version_MAJOR_digit_8[5]' +# elif COMPILER_VERSION_MAJOR == 6 + PRINT *, 'INFO:compiler_version_MAJOR_digit_8[6]' +# elif COMPILER_VERSION_MAJOR == 7 + PRINT *, 'INFO:compiler_version_MAJOR_digit_8[7]' +# elif COMPILER_VERSION_MAJOR == 8 + PRINT *, 'INFO:compiler_version_MAJOR_digit_8[8]' +# elif COMPILER_VERSION_MAJOR == 9 + PRINT *, 'INFO:compiler_version_MAJOR_digit_8[9]' +# endif + +#endif +#if defined(COMPILER_VERSION_MINOR) +# undef DEC +# undef HEX +# define DEC(n) DEC_1(n) +# define HEX(n) HEX_1(n) +# if COMPILER_VERSION_MINOR == 0 + PRINT *, 'INFO:compiler_version_MINOR_digit_1[0]' +# elif COMPILER_VERSION_MINOR == 1 + PRINT *, 'INFO:compiler_version_MINOR_digit_1[1]' +# elif COMPILER_VERSION_MINOR == 2 + PRINT *, 'INFO:compiler_version_MINOR_digit_1[2]' +# elif COMPILER_VERSION_MINOR == 3 + PRINT *, 'INFO:compiler_version_MINOR_digit_1[3]' +# elif COMPILER_VERSION_MINOR == 4 + PRINT *, 'INFO:compiler_version_MINOR_digit_1[4]' +# elif COMPILER_VERSION_MINOR == 5 + PRINT *, 'INFO:compiler_version_MINOR_digit_1[5]' +# elif COMPILER_VERSION_MINOR == 6 + PRINT *, 'INFO:compiler_version_MINOR_digit_1[6]' +# elif COMPILER_VERSION_MINOR == 7 + PRINT *, 'INFO:compiler_version_MINOR_digit_1[7]' +# elif COMPILER_VERSION_MINOR == 8 + PRINT *, 'INFO:compiler_version_MINOR_digit_1[8]' +# elif COMPILER_VERSION_MINOR == 9 + PRINT *, 'INFO:compiler_version_MINOR_digit_1[9]' +# endif + +# undef DEC +# undef HEX +# define DEC(n) DEC_2(n) +# define HEX(n) HEX_2(n) +# if COMPILER_VERSION_MINOR == 0 + PRINT *, 'INFO:compiler_version_MINOR_digit_2[0]' +# elif COMPILER_VERSION_MINOR == 1 + PRINT *, 'INFO:compiler_version_MINOR_digit_2[1]' +# elif COMPILER_VERSION_MINOR == 2 + PRINT *, 'INFO:compiler_version_MINOR_digit_2[2]' +# elif COMPILER_VERSION_MINOR == 3 + PRINT *, 'INFO:compiler_version_MINOR_digit_2[3]' +# elif COMPILER_VERSION_MINOR == 4 + PRINT *, 'INFO:compiler_version_MINOR_digit_2[4]' +# elif COMPILER_VERSION_MINOR == 5 + PRINT *, 'INFO:compiler_version_MINOR_digit_2[5]' +# elif COMPILER_VERSION_MINOR == 6 + PRINT *, 'INFO:compiler_version_MINOR_digit_2[6]' +# elif COMPILER_VERSION_MINOR == 7 + PRINT *, 'INFO:compiler_version_MINOR_digit_2[7]' +# elif COMPILER_VERSION_MINOR == 8 + PRINT *, 'INFO:compiler_version_MINOR_digit_2[8]' +# elif COMPILER_VERSION_MINOR == 9 + PRINT *, 'INFO:compiler_version_MINOR_digit_2[9]' +# endif + +# undef DEC +# undef HEX +# define DEC(n) DEC_3(n) +# define HEX(n) HEX_3(n) +# if COMPILER_VERSION_MINOR == 0 + PRINT *, 'INFO:compiler_version_MINOR_digit_3[0]' +# elif COMPILER_VERSION_MINOR == 1 + PRINT *, 'INFO:compiler_version_MINOR_digit_3[1]' +# elif COMPILER_VERSION_MINOR == 2 + PRINT *, 'INFO:compiler_version_MINOR_digit_3[2]' +# elif COMPILER_VERSION_MINOR == 3 + PRINT *, 'INFO:compiler_version_MINOR_digit_3[3]' +# elif COMPILER_VERSION_MINOR == 4 + PRINT *, 'INFO:compiler_version_MINOR_digit_3[4]' +# elif COMPILER_VERSION_MINOR == 5 + PRINT *, 'INFO:compiler_version_MINOR_digit_3[5]' +# elif COMPILER_VERSION_MINOR == 6 + PRINT *, 'INFO:compiler_version_MINOR_digit_3[6]' +# elif COMPILER_VERSION_MINOR == 7 + PRINT *, 'INFO:compiler_version_MINOR_digit_3[7]' +# elif COMPILER_VERSION_MINOR == 8 + PRINT *, 'INFO:compiler_version_MINOR_digit_3[8]' +# elif COMPILER_VERSION_MINOR == 9 + PRINT *, 'INFO:compiler_version_MINOR_digit_3[9]' +# endif + +# undef DEC +# undef HEX +# define DEC(n) DEC_4(n) +# define HEX(n) HEX_4(n) +# if COMPILER_VERSION_MINOR == 0 + PRINT *, 'INFO:compiler_version_MINOR_digit_4[0]' +# elif COMPILER_VERSION_MINOR == 1 + PRINT *, 'INFO:compiler_version_MINOR_digit_4[1]' +# elif COMPILER_VERSION_MINOR == 2 + PRINT *, 'INFO:compiler_version_MINOR_digit_4[2]' +# elif COMPILER_VERSION_MINOR == 3 + PRINT *, 'INFO:compiler_version_MINOR_digit_4[3]' +# elif COMPILER_VERSION_MINOR == 4 + PRINT *, 'INFO:compiler_version_MINOR_digit_4[4]' +# elif COMPILER_VERSION_MINOR == 5 + PRINT *, 'INFO:compiler_version_MINOR_digit_4[5]' +# elif COMPILER_VERSION_MINOR == 6 + PRINT *, 'INFO:compiler_version_MINOR_digit_4[6]' +# elif COMPILER_VERSION_MINOR == 7 + PRINT *, 'INFO:compiler_version_MINOR_digit_4[7]' +# elif COMPILER_VERSION_MINOR == 8 + PRINT *, 'INFO:compiler_version_MINOR_digit_4[8]' +# elif COMPILER_VERSION_MINOR == 9 + PRINT *, 'INFO:compiler_version_MINOR_digit_4[9]' +# endif + +# undef DEC +# undef HEX +# define DEC(n) DEC_5(n) +# define HEX(n) HEX_5(n) +# if COMPILER_VERSION_MINOR == 0 + PRINT *, 'INFO:compiler_version_MINOR_digit_5[0]' +# elif COMPILER_VERSION_MINOR == 1 + PRINT *, 'INFO:compiler_version_MINOR_digit_5[1]' +# elif COMPILER_VERSION_MINOR == 2 + PRINT *, 'INFO:compiler_version_MINOR_digit_5[2]' +# elif COMPILER_VERSION_MINOR == 3 + PRINT *, 'INFO:compiler_version_MINOR_digit_5[3]' +# elif COMPILER_VERSION_MINOR == 4 + PRINT *, 'INFO:compiler_version_MINOR_digit_5[4]' +# elif COMPILER_VERSION_MINOR == 5 + PRINT *, 'INFO:compiler_version_MINOR_digit_5[5]' +# elif COMPILER_VERSION_MINOR == 6 + PRINT *, 'INFO:compiler_version_MINOR_digit_5[6]' +# elif COMPILER_VERSION_MINOR == 7 + PRINT *, 'INFO:compiler_version_MINOR_digit_5[7]' +# elif COMPILER_VERSION_MINOR == 8 + PRINT *, 'INFO:compiler_version_MINOR_digit_5[8]' +# elif COMPILER_VERSION_MINOR == 9 + PRINT *, 'INFO:compiler_version_MINOR_digit_5[9]' +# endif + +# undef DEC +# undef HEX +# define DEC(n) DEC_6(n) +# define HEX(n) HEX_6(n) +# if COMPILER_VERSION_MINOR == 0 + PRINT *, 'INFO:compiler_version_MINOR_digit_6[0]' +# elif COMPILER_VERSION_MINOR == 1 + PRINT *, 'INFO:compiler_version_MINOR_digit_6[1]' +# elif COMPILER_VERSION_MINOR == 2 + PRINT *, 'INFO:compiler_version_MINOR_digit_6[2]' +# elif COMPILER_VERSION_MINOR == 3 + PRINT *, 'INFO:compiler_version_MINOR_digit_6[3]' +# elif COMPILER_VERSION_MINOR == 4 + PRINT *, 'INFO:compiler_version_MINOR_digit_6[4]' +# elif COMPILER_VERSION_MINOR == 5 + PRINT *, 'INFO:compiler_version_MINOR_digit_6[5]' +# elif COMPILER_VERSION_MINOR == 6 + PRINT *, 'INFO:compiler_version_MINOR_digit_6[6]' +# elif COMPILER_VERSION_MINOR == 7 + PRINT *, 'INFO:compiler_version_MINOR_digit_6[7]' +# elif COMPILER_VERSION_MINOR == 8 + PRINT *, 'INFO:compiler_version_MINOR_digit_6[8]' +# elif COMPILER_VERSION_MINOR == 9 + PRINT *, 'INFO:compiler_version_MINOR_digit_6[9]' +# endif + +# undef DEC +# undef HEX +# define DEC(n) DEC_7(n) +# define HEX(n) HEX_7(n) +# if COMPILER_VERSION_MINOR == 0 + PRINT *, 'INFO:compiler_version_MINOR_digit_7[0]' +# elif COMPILER_VERSION_MINOR == 1 + PRINT *, 'INFO:compiler_version_MINOR_digit_7[1]' +# elif COMPILER_VERSION_MINOR == 2 + PRINT *, 'INFO:compiler_version_MINOR_digit_7[2]' +# elif COMPILER_VERSION_MINOR == 3 + PRINT *, 'INFO:compiler_version_MINOR_digit_7[3]' +# elif COMPILER_VERSION_MINOR == 4 + PRINT *, 'INFO:compiler_version_MINOR_digit_7[4]' +# elif COMPILER_VERSION_MINOR == 5 + PRINT *, 'INFO:compiler_version_MINOR_digit_7[5]' +# elif COMPILER_VERSION_MINOR == 6 + PRINT *, 'INFO:compiler_version_MINOR_digit_7[6]' +# elif COMPILER_VERSION_MINOR == 7 + PRINT *, 'INFO:compiler_version_MINOR_digit_7[7]' +# elif COMPILER_VERSION_MINOR == 8 + PRINT *, 'INFO:compiler_version_MINOR_digit_7[8]' +# elif COMPILER_VERSION_MINOR == 9 + PRINT *, 'INFO:compiler_version_MINOR_digit_7[9]' +# endif + +# undef DEC +# undef HEX +# define DEC(n) DEC_8(n) +# define HEX(n) HEX_8(n) +# if COMPILER_VERSION_MINOR == 0 + PRINT *, 'INFO:compiler_version_MINOR_digit_8[0]' +# elif COMPILER_VERSION_MINOR == 1 + PRINT *, 'INFO:compiler_version_MINOR_digit_8[1]' +# elif COMPILER_VERSION_MINOR == 2 + PRINT *, 'INFO:compiler_version_MINOR_digit_8[2]' +# elif COMPILER_VERSION_MINOR == 3 + PRINT *, 'INFO:compiler_version_MINOR_digit_8[3]' +# elif COMPILER_VERSION_MINOR == 4 + PRINT *, 'INFO:compiler_version_MINOR_digit_8[4]' +# elif COMPILER_VERSION_MINOR == 5 + PRINT *, 'INFO:compiler_version_MINOR_digit_8[5]' +# elif COMPILER_VERSION_MINOR == 6 + PRINT *, 'INFO:compiler_version_MINOR_digit_8[6]' +# elif COMPILER_VERSION_MINOR == 7 + PRINT *, 'INFO:compiler_version_MINOR_digit_8[7]' +# elif COMPILER_VERSION_MINOR == 8 + PRINT *, 'INFO:compiler_version_MINOR_digit_8[8]' +# elif COMPILER_VERSION_MINOR == 9 + PRINT *, 'INFO:compiler_version_MINOR_digit_8[9]' +# endif + +#endif +#if defined(COMPILER_VERSION_PATCH) +# undef DEC +# undef HEX +# define DEC(n) DEC_1(n) +# define HEX(n) HEX_1(n) +# if COMPILER_VERSION_PATCH == 0 + PRINT *, 'INFO:compiler_version_PATCH_digit_1[0]' +# elif COMPILER_VERSION_PATCH == 1 + PRINT *, 'INFO:compiler_version_PATCH_digit_1[1]' +# elif COMPILER_VERSION_PATCH == 2 + PRINT *, 'INFO:compiler_version_PATCH_digit_1[2]' +# elif COMPILER_VERSION_PATCH == 3 + PRINT *, 'INFO:compiler_version_PATCH_digit_1[3]' +# elif COMPILER_VERSION_PATCH == 4 + PRINT *, 'INFO:compiler_version_PATCH_digit_1[4]' +# elif COMPILER_VERSION_PATCH == 5 + PRINT *, 'INFO:compiler_version_PATCH_digit_1[5]' +# elif COMPILER_VERSION_PATCH == 6 + PRINT *, 'INFO:compiler_version_PATCH_digit_1[6]' +# elif COMPILER_VERSION_PATCH == 7 + PRINT *, 'INFO:compiler_version_PATCH_digit_1[7]' +# elif COMPILER_VERSION_PATCH == 8 + PRINT *, 'INFO:compiler_version_PATCH_digit_1[8]' +# elif COMPILER_VERSION_PATCH == 9 + PRINT *, 'INFO:compiler_version_PATCH_digit_1[9]' +# endif + +# undef DEC +# undef HEX +# define DEC(n) DEC_2(n) +# define HEX(n) HEX_2(n) +# if COMPILER_VERSION_PATCH == 0 + PRINT *, 'INFO:compiler_version_PATCH_digit_2[0]' +# elif COMPILER_VERSION_PATCH == 1 + PRINT *, 'INFO:compiler_version_PATCH_digit_2[1]' +# elif COMPILER_VERSION_PATCH == 2 + PRINT *, 'INFO:compiler_version_PATCH_digit_2[2]' +# elif COMPILER_VERSION_PATCH == 3 + PRINT *, 'INFO:compiler_version_PATCH_digit_2[3]' +# elif COMPILER_VERSION_PATCH == 4 + PRINT *, 'INFO:compiler_version_PATCH_digit_2[4]' +# elif COMPILER_VERSION_PATCH == 5 + PRINT *, 'INFO:compiler_version_PATCH_digit_2[5]' +# elif COMPILER_VERSION_PATCH == 6 + PRINT *, 'INFO:compiler_version_PATCH_digit_2[6]' +# elif COMPILER_VERSION_PATCH == 7 + PRINT *, 'INFO:compiler_version_PATCH_digit_2[7]' +# elif COMPILER_VERSION_PATCH == 8 + PRINT *, 'INFO:compiler_version_PATCH_digit_2[8]' +# elif COMPILER_VERSION_PATCH == 9 + PRINT *, 'INFO:compiler_version_PATCH_digit_2[9]' +# endif + +# undef DEC +# undef HEX +# define DEC(n) DEC_3(n) +# define HEX(n) HEX_3(n) +# if COMPILER_VERSION_PATCH == 0 + PRINT *, 'INFO:compiler_version_PATCH_digit_3[0]' +# elif COMPILER_VERSION_PATCH == 1 + PRINT *, 'INFO:compiler_version_PATCH_digit_3[1]' +# elif COMPILER_VERSION_PATCH == 2 + PRINT *, 'INFO:compiler_version_PATCH_digit_3[2]' +# elif COMPILER_VERSION_PATCH == 3 + PRINT *, 'INFO:compiler_version_PATCH_digit_3[3]' +# elif COMPILER_VERSION_PATCH == 4 + PRINT *, 'INFO:compiler_version_PATCH_digit_3[4]' +# elif COMPILER_VERSION_PATCH == 5 + PRINT *, 'INFO:compiler_version_PATCH_digit_3[5]' +# elif COMPILER_VERSION_PATCH == 6 + PRINT *, 'INFO:compiler_version_PATCH_digit_3[6]' +# elif COMPILER_VERSION_PATCH == 7 + PRINT *, 'INFO:compiler_version_PATCH_digit_3[7]' +# elif COMPILER_VERSION_PATCH == 8 + PRINT *, 'INFO:compiler_version_PATCH_digit_3[8]' +# elif COMPILER_VERSION_PATCH == 9 + PRINT *, 'INFO:compiler_version_PATCH_digit_3[9]' +# endif + +# undef DEC +# undef HEX +# define DEC(n) DEC_4(n) +# define HEX(n) HEX_4(n) +# if COMPILER_VERSION_PATCH == 0 + PRINT *, 'INFO:compiler_version_PATCH_digit_4[0]' +# elif COMPILER_VERSION_PATCH == 1 + PRINT *, 'INFO:compiler_version_PATCH_digit_4[1]' +# elif COMPILER_VERSION_PATCH == 2 + PRINT *, 'INFO:compiler_version_PATCH_digit_4[2]' +# elif COMPILER_VERSION_PATCH == 3 + PRINT *, 'INFO:compiler_version_PATCH_digit_4[3]' +# elif COMPILER_VERSION_PATCH == 4 + PRINT *, 'INFO:compiler_version_PATCH_digit_4[4]' +# elif COMPILER_VERSION_PATCH == 5 + PRINT *, 'INFO:compiler_version_PATCH_digit_4[5]' +# elif COMPILER_VERSION_PATCH == 6 + PRINT *, 'INFO:compiler_version_PATCH_digit_4[6]' +# elif COMPILER_VERSION_PATCH == 7 + PRINT *, 'INFO:compiler_version_PATCH_digit_4[7]' +# elif COMPILER_VERSION_PATCH == 8 + PRINT *, 'INFO:compiler_version_PATCH_digit_4[8]' +# elif COMPILER_VERSION_PATCH == 9 + PRINT *, 'INFO:compiler_version_PATCH_digit_4[9]' +# endif + +# undef DEC +# undef HEX +# define DEC(n) DEC_5(n) +# define HEX(n) HEX_5(n) +# if COMPILER_VERSION_PATCH == 0 + PRINT *, 'INFO:compiler_version_PATCH_digit_5[0]' +# elif COMPILER_VERSION_PATCH == 1 + PRINT *, 'INFO:compiler_version_PATCH_digit_5[1]' +# elif COMPILER_VERSION_PATCH == 2 + PRINT *, 'INFO:compiler_version_PATCH_digit_5[2]' +# elif COMPILER_VERSION_PATCH == 3 + PRINT *, 'INFO:compiler_version_PATCH_digit_5[3]' +# elif COMPILER_VERSION_PATCH == 4 + PRINT *, 'INFO:compiler_version_PATCH_digit_5[4]' +# elif COMPILER_VERSION_PATCH == 5 + PRINT *, 'INFO:compiler_version_PATCH_digit_5[5]' +# elif COMPILER_VERSION_PATCH == 6 + PRINT *, 'INFO:compiler_version_PATCH_digit_5[6]' +# elif COMPILER_VERSION_PATCH == 7 + PRINT *, 'INFO:compiler_version_PATCH_digit_5[7]' +# elif COMPILER_VERSION_PATCH == 8 + PRINT *, 'INFO:compiler_version_PATCH_digit_5[8]' +# elif COMPILER_VERSION_PATCH == 9 + PRINT *, 'INFO:compiler_version_PATCH_digit_5[9]' +# endif + +# undef DEC +# undef HEX +# define DEC(n) DEC_6(n) +# define HEX(n) HEX_6(n) +# if COMPILER_VERSION_PATCH == 0 + PRINT *, 'INFO:compiler_version_PATCH_digit_6[0]' +# elif COMPILER_VERSION_PATCH == 1 + PRINT *, 'INFO:compiler_version_PATCH_digit_6[1]' +# elif COMPILER_VERSION_PATCH == 2 + PRINT *, 'INFO:compiler_version_PATCH_digit_6[2]' +# elif COMPILER_VERSION_PATCH == 3 + PRINT *, 'INFO:compiler_version_PATCH_digit_6[3]' +# elif COMPILER_VERSION_PATCH == 4 + PRINT *, 'INFO:compiler_version_PATCH_digit_6[4]' +# elif COMPILER_VERSION_PATCH == 5 + PRINT *, 'INFO:compiler_version_PATCH_digit_6[5]' +# elif COMPILER_VERSION_PATCH == 6 + PRINT *, 'INFO:compiler_version_PATCH_digit_6[6]' +# elif COMPILER_VERSION_PATCH == 7 + PRINT *, 'INFO:compiler_version_PATCH_digit_6[7]' +# elif COMPILER_VERSION_PATCH == 8 + PRINT *, 'INFO:compiler_version_PATCH_digit_6[8]' +# elif COMPILER_VERSION_PATCH == 9 + PRINT *, 'INFO:compiler_version_PATCH_digit_6[9]' +# endif + +# undef DEC +# undef HEX +# define DEC(n) DEC_7(n) +# define HEX(n) HEX_7(n) +# if COMPILER_VERSION_PATCH == 0 + PRINT *, 'INFO:compiler_version_PATCH_digit_7[0]' +# elif COMPILER_VERSION_PATCH == 1 + PRINT *, 'INFO:compiler_version_PATCH_digit_7[1]' +# elif COMPILER_VERSION_PATCH == 2 + PRINT *, 'INFO:compiler_version_PATCH_digit_7[2]' +# elif COMPILER_VERSION_PATCH == 3 + PRINT *, 'INFO:compiler_version_PATCH_digit_7[3]' +# elif COMPILER_VERSION_PATCH == 4 + PRINT *, 'INFO:compiler_version_PATCH_digit_7[4]' +# elif COMPILER_VERSION_PATCH == 5 + PRINT *, 'INFO:compiler_version_PATCH_digit_7[5]' +# elif COMPILER_VERSION_PATCH == 6 + PRINT *, 'INFO:compiler_version_PATCH_digit_7[6]' +# elif COMPILER_VERSION_PATCH == 7 + PRINT *, 'INFO:compiler_version_PATCH_digit_7[7]' +# elif COMPILER_VERSION_PATCH == 8 + PRINT *, 'INFO:compiler_version_PATCH_digit_7[8]' +# elif COMPILER_VERSION_PATCH == 9 + PRINT *, 'INFO:compiler_version_PATCH_digit_7[9]' +# endif + +# undef DEC +# undef HEX +# define DEC(n) DEC_8(n) +# define HEX(n) HEX_8(n) +# if COMPILER_VERSION_PATCH == 0 + PRINT *, 'INFO:compiler_version_PATCH_digit_8[0]' +# elif COMPILER_VERSION_PATCH == 1 + PRINT *, 'INFO:compiler_version_PATCH_digit_8[1]' +# elif COMPILER_VERSION_PATCH == 2 + PRINT *, 'INFO:compiler_version_PATCH_digit_8[2]' +# elif COMPILER_VERSION_PATCH == 3 + PRINT *, 'INFO:compiler_version_PATCH_digit_8[3]' +# elif COMPILER_VERSION_PATCH == 4 + PRINT *, 'INFO:compiler_version_PATCH_digit_8[4]' +# elif COMPILER_VERSION_PATCH == 5 + PRINT *, 'INFO:compiler_version_PATCH_digit_8[5]' +# elif COMPILER_VERSION_PATCH == 6 + PRINT *, 'INFO:compiler_version_PATCH_digit_8[6]' +# elif COMPILER_VERSION_PATCH == 7 + PRINT *, 'INFO:compiler_version_PATCH_digit_8[7]' +# elif COMPILER_VERSION_PATCH == 8 + PRINT *, 'INFO:compiler_version_PATCH_digit_8[8]' +# elif COMPILER_VERSION_PATCH == 9 + PRINT *, 'INFO:compiler_version_PATCH_digit_8[9]' +# endif + +#endif +#if defined(COMPILER_VERSION_TWEAK) +# undef DEC +# undef HEX +# define DEC(n) DEC_1(n) +# define HEX(n) HEX_1(n) +# if COMPILER_VERSION_TWEAK == 0 + PRINT *, 'INFO:compiler_version_TWEAK_digit_1[0]' +# elif COMPILER_VERSION_TWEAK == 1 + PRINT *, 'INFO:compiler_version_TWEAK_digit_1[1]' +# elif COMPILER_VERSION_TWEAK == 2 + PRINT *, 'INFO:compiler_version_TWEAK_digit_1[2]' +# elif COMPILER_VERSION_TWEAK == 3 + PRINT *, 'INFO:compiler_version_TWEAK_digit_1[3]' +# elif COMPILER_VERSION_TWEAK == 4 + PRINT *, 'INFO:compiler_version_TWEAK_digit_1[4]' +# elif COMPILER_VERSION_TWEAK == 5 + PRINT *, 'INFO:compiler_version_TWEAK_digit_1[5]' +# elif COMPILER_VERSION_TWEAK == 6 + PRINT *, 'INFO:compiler_version_TWEAK_digit_1[6]' +# elif COMPILER_VERSION_TWEAK == 7 + PRINT *, 'INFO:compiler_version_TWEAK_digit_1[7]' +# elif COMPILER_VERSION_TWEAK == 8 + PRINT *, 'INFO:compiler_version_TWEAK_digit_1[8]' +# elif COMPILER_VERSION_TWEAK == 9 + PRINT *, 'INFO:compiler_version_TWEAK_digit_1[9]' +# endif + +# undef DEC +# undef HEX +# define DEC(n) DEC_2(n) +# define HEX(n) HEX_2(n) +# if COMPILER_VERSION_TWEAK == 0 + PRINT *, 'INFO:compiler_version_TWEAK_digit_2[0]' +# elif COMPILER_VERSION_TWEAK == 1 + PRINT *, 'INFO:compiler_version_TWEAK_digit_2[1]' +# elif COMPILER_VERSION_TWEAK == 2 + PRINT *, 'INFO:compiler_version_TWEAK_digit_2[2]' +# elif COMPILER_VERSION_TWEAK == 3 + PRINT *, 'INFO:compiler_version_TWEAK_digit_2[3]' +# elif COMPILER_VERSION_TWEAK == 4 + PRINT *, 'INFO:compiler_version_TWEAK_digit_2[4]' +# elif COMPILER_VERSION_TWEAK == 5 + PRINT *, 'INFO:compiler_version_TWEAK_digit_2[5]' +# elif COMPILER_VERSION_TWEAK == 6 + PRINT *, 'INFO:compiler_version_TWEAK_digit_2[6]' +# elif COMPILER_VERSION_TWEAK == 7 + PRINT *, 'INFO:compiler_version_TWEAK_digit_2[7]' +# elif COMPILER_VERSION_TWEAK == 8 + PRINT *, 'INFO:compiler_version_TWEAK_digit_2[8]' +# elif COMPILER_VERSION_TWEAK == 9 + PRINT *, 'INFO:compiler_version_TWEAK_digit_2[9]' +# endif + +# undef DEC +# undef HEX +# define DEC(n) DEC_3(n) +# define HEX(n) HEX_3(n) +# if COMPILER_VERSION_TWEAK == 0 + PRINT *, 'INFO:compiler_version_TWEAK_digit_3[0]' +# elif COMPILER_VERSION_TWEAK == 1 + PRINT *, 'INFO:compiler_version_TWEAK_digit_3[1]' +# elif COMPILER_VERSION_TWEAK == 2 + PRINT *, 'INFO:compiler_version_TWEAK_digit_3[2]' +# elif COMPILER_VERSION_TWEAK == 3 + PRINT *, 'INFO:compiler_version_TWEAK_digit_3[3]' +# elif COMPILER_VERSION_TWEAK == 4 + PRINT *, 'INFO:compiler_version_TWEAK_digit_3[4]' +# elif COMPILER_VERSION_TWEAK == 5 + PRINT *, 'INFO:compiler_version_TWEAK_digit_3[5]' +# elif COMPILER_VERSION_TWEAK == 6 + PRINT *, 'INFO:compiler_version_TWEAK_digit_3[6]' +# elif COMPILER_VERSION_TWEAK == 7 + PRINT *, 'INFO:compiler_version_TWEAK_digit_3[7]' +# elif COMPILER_VERSION_TWEAK == 8 + PRINT *, 'INFO:compiler_version_TWEAK_digit_3[8]' +# elif COMPILER_VERSION_TWEAK == 9 + PRINT *, 'INFO:compiler_version_TWEAK_digit_3[9]' +# endif + +# undef DEC +# undef HEX +# define DEC(n) DEC_4(n) +# define HEX(n) HEX_4(n) +# if COMPILER_VERSION_TWEAK == 0 + PRINT *, 'INFO:compiler_version_TWEAK_digit_4[0]' +# elif COMPILER_VERSION_TWEAK == 1 + PRINT *, 'INFO:compiler_version_TWEAK_digit_4[1]' +# elif COMPILER_VERSION_TWEAK == 2 + PRINT *, 'INFO:compiler_version_TWEAK_digit_4[2]' +# elif COMPILER_VERSION_TWEAK == 3 + PRINT *, 'INFO:compiler_version_TWEAK_digit_4[3]' +# elif COMPILER_VERSION_TWEAK == 4 + PRINT *, 'INFO:compiler_version_TWEAK_digit_4[4]' +# elif COMPILER_VERSION_TWEAK == 5 + PRINT *, 'INFO:compiler_version_TWEAK_digit_4[5]' +# elif COMPILER_VERSION_TWEAK == 6 + PRINT *, 'INFO:compiler_version_TWEAK_digit_4[6]' +# elif COMPILER_VERSION_TWEAK == 7 + PRINT *, 'INFO:compiler_version_TWEAK_digit_4[7]' +# elif COMPILER_VERSION_TWEAK == 8 + PRINT *, 'INFO:compiler_version_TWEAK_digit_4[8]' +# elif COMPILER_VERSION_TWEAK == 9 + PRINT *, 'INFO:compiler_version_TWEAK_digit_4[9]' +# endif + +# undef DEC +# undef HEX +# define DEC(n) DEC_5(n) +# define HEX(n) HEX_5(n) +# if COMPILER_VERSION_TWEAK == 0 + PRINT *, 'INFO:compiler_version_TWEAK_digit_5[0]' +# elif COMPILER_VERSION_TWEAK == 1 + PRINT *, 'INFO:compiler_version_TWEAK_digit_5[1]' +# elif COMPILER_VERSION_TWEAK == 2 + PRINT *, 'INFO:compiler_version_TWEAK_digit_5[2]' +# elif COMPILER_VERSION_TWEAK == 3 + PRINT *, 'INFO:compiler_version_TWEAK_digit_5[3]' +# elif COMPILER_VERSION_TWEAK == 4 + PRINT *, 'INFO:compiler_version_TWEAK_digit_5[4]' +# elif COMPILER_VERSION_TWEAK == 5 + PRINT *, 'INFO:compiler_version_TWEAK_digit_5[5]' +# elif COMPILER_VERSION_TWEAK == 6 + PRINT *, 'INFO:compiler_version_TWEAK_digit_5[6]' +# elif COMPILER_VERSION_TWEAK == 7 + PRINT *, 'INFO:compiler_version_TWEAK_digit_5[7]' +# elif COMPILER_VERSION_TWEAK == 8 + PRINT *, 'INFO:compiler_version_TWEAK_digit_5[8]' +# elif COMPILER_VERSION_TWEAK == 9 + PRINT *, 'INFO:compiler_version_TWEAK_digit_5[9]' +# endif + +# undef DEC +# undef HEX +# define DEC(n) DEC_6(n) +# define HEX(n) HEX_6(n) +# if COMPILER_VERSION_TWEAK == 0 + PRINT *, 'INFO:compiler_version_TWEAK_digit_6[0]' +# elif COMPILER_VERSION_TWEAK == 1 + PRINT *, 'INFO:compiler_version_TWEAK_digit_6[1]' +# elif COMPILER_VERSION_TWEAK == 2 + PRINT *, 'INFO:compiler_version_TWEAK_digit_6[2]' +# elif COMPILER_VERSION_TWEAK == 3 + PRINT *, 'INFO:compiler_version_TWEAK_digit_6[3]' +# elif COMPILER_VERSION_TWEAK == 4 + PRINT *, 'INFO:compiler_version_TWEAK_digit_6[4]' +# elif COMPILER_VERSION_TWEAK == 5 + PRINT *, 'INFO:compiler_version_TWEAK_digit_6[5]' +# elif COMPILER_VERSION_TWEAK == 6 + PRINT *, 'INFO:compiler_version_TWEAK_digit_6[6]' +# elif COMPILER_VERSION_TWEAK == 7 + PRINT *, 'INFO:compiler_version_TWEAK_digit_6[7]' +# elif COMPILER_VERSION_TWEAK == 8 + PRINT *, 'INFO:compiler_version_TWEAK_digit_6[8]' +# elif COMPILER_VERSION_TWEAK == 9 + PRINT *, 'INFO:compiler_version_TWEAK_digit_6[9]' +# endif + +# undef DEC +# undef HEX +# define DEC(n) DEC_7(n) +# define HEX(n) HEX_7(n) +# if COMPILER_VERSION_TWEAK == 0 + PRINT *, 'INFO:compiler_version_TWEAK_digit_7[0]' +# elif COMPILER_VERSION_TWEAK == 1 + PRINT *, 'INFO:compiler_version_TWEAK_digit_7[1]' +# elif COMPILER_VERSION_TWEAK == 2 + PRINT *, 'INFO:compiler_version_TWEAK_digit_7[2]' +# elif COMPILER_VERSION_TWEAK == 3 + PRINT *, 'INFO:compiler_version_TWEAK_digit_7[3]' +# elif COMPILER_VERSION_TWEAK == 4 + PRINT *, 'INFO:compiler_version_TWEAK_digit_7[4]' +# elif COMPILER_VERSION_TWEAK == 5 + PRINT *, 'INFO:compiler_version_TWEAK_digit_7[5]' +# elif COMPILER_VERSION_TWEAK == 6 + PRINT *, 'INFO:compiler_version_TWEAK_digit_7[6]' +# elif COMPILER_VERSION_TWEAK == 7 + PRINT *, 'INFO:compiler_version_TWEAK_digit_7[7]' +# elif COMPILER_VERSION_TWEAK == 8 + PRINT *, 'INFO:compiler_version_TWEAK_digit_7[8]' +# elif COMPILER_VERSION_TWEAK == 9 + PRINT *, 'INFO:compiler_version_TWEAK_digit_7[9]' +# endif + +# undef DEC +# undef HEX +# define DEC(n) DEC_8(n) +# define HEX(n) HEX_8(n) +# if COMPILER_VERSION_TWEAK == 0 + PRINT *, 'INFO:compiler_version_TWEAK_digit_8[0]' +# elif COMPILER_VERSION_TWEAK == 1 + PRINT *, 'INFO:compiler_version_TWEAK_digit_8[1]' +# elif COMPILER_VERSION_TWEAK == 2 + PRINT *, 'INFO:compiler_version_TWEAK_digit_8[2]' +# elif COMPILER_VERSION_TWEAK == 3 + PRINT *, 'INFO:compiler_version_TWEAK_digit_8[3]' +# elif COMPILER_VERSION_TWEAK == 4 + PRINT *, 'INFO:compiler_version_TWEAK_digit_8[4]' +# elif COMPILER_VERSION_TWEAK == 5 + PRINT *, 'INFO:compiler_version_TWEAK_digit_8[5]' +# elif COMPILER_VERSION_TWEAK == 6 + PRINT *, 'INFO:compiler_version_TWEAK_digit_8[6]' +# elif COMPILER_VERSION_TWEAK == 7 + PRINT *, 'INFO:compiler_version_TWEAK_digit_8[7]' +# elif COMPILER_VERSION_TWEAK == 8 + PRINT *, 'INFO:compiler_version_TWEAK_digit_8[8]' +# elif COMPILER_VERSION_TWEAK == 9 + PRINT *, 'INFO:compiler_version_TWEAK_digit_8[9]' +# endif + +#endif + + END diff --git a/FiniteElasticity/RightBiceps/build_debug/CMakeFiles/CMakeDirectoryInformation.cmake b/FiniteElasticity/RightBiceps/build_debug/CMakeFiles/CMakeDirectoryInformation.cmake new file mode 100644 index 00000000..0eaed40a --- /dev/null +++ b/FiniteElasticity/RightBiceps/build_debug/CMakeFiles/CMakeDirectoryInformation.cmake @@ -0,0 +1,16 @@ +# CMAKE generated file: DO NOT EDIT! +# Generated by "Unix Makefiles" Generator, CMake Version 3.5 + +# Relative path conversion top directories. +set(CMAKE_RELATIVE_PATH_TOP_SOURCE "/store/software/opencmiss/OpenCMISS-examples/FiniteElasticity/RightBiceps") +set(CMAKE_RELATIVE_PATH_TOP_BINARY "/store/software/opencmiss/OpenCMISS-examples/FiniteElasticity/RightBiceps/build_debug") + +# Force unix paths in dependencies. +set(CMAKE_FORCE_UNIX_PATHS 1) + + +# The C and CXX include file regular expressions for this directory. +set(CMAKE_C_INCLUDE_REGEX_SCAN "^.*$") +set(CMAKE_C_INCLUDE_REGEX_COMPLAIN "^$") +set(CMAKE_CXX_INCLUDE_REGEX_SCAN ${CMAKE_C_INCLUDE_REGEX_SCAN}) +set(CMAKE_CXX_INCLUDE_REGEX_COMPLAIN ${CMAKE_C_INCLUDE_REGEX_COMPLAIN}) diff --git a/FiniteElasticity/RightBiceps/build_debug/CMakeFiles/CMakeError.log b/FiniteElasticity/RightBiceps/build_debug/CMakeFiles/CMakeError.log new file mode 100644 index 00000000..2e7ca015 --- /dev/null +++ b/FiniteElasticity/RightBiceps/build_debug/CMakeFiles/CMakeError.log @@ -0,0 +1,55 @@ +Determining if the pthread_create exist failed with the following output: +Change Dir: /store/software/opencmiss/OpenCMISS-examples/FiniteElasticity/RightBiceps/build_debug/CMakeFiles/CMakeTmp + +Run Build Command:"/usr/bin/make" "cmTC_697e4/fast" +/usr/bin/make -f CMakeFiles/cmTC_697e4.dir/build.make CMakeFiles/cmTC_697e4.dir/build +make[1]: Entering directory '/store/software/opencmiss/OpenCMISS-examples/FiniteElasticity/RightBiceps/build_debug/CMakeFiles/CMakeTmp' +Building C object CMakeFiles/cmTC_697e4.dir/CheckSymbolExists.c.o +/usr/bin/cc -o CMakeFiles/cmTC_697e4.dir/CheckSymbolExists.c.o -c /store/software/opencmiss/OpenCMISS-examples/FiniteElasticity/RightBiceps/build_debug/CMakeFiles/CMakeTmp/CheckSymbolExists.c +Linking C executable cmTC_697e4 +/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_697e4.dir/link.txt --verbose=1 +/usr/bin/cc CMakeFiles/cmTC_697e4.dir/CheckSymbolExists.c.o -o cmTC_697e4 -rdynamic +CMakeFiles/cmTC_697e4.dir/CheckSymbolExists.c.o: In function `main': +CheckSymbolExists.c:(.text+0x16): undefined reference to `pthread_create' +collect2: error: ld returned 1 exit status +CMakeFiles/cmTC_697e4.dir/build.make:97: recipe for target 'cmTC_697e4' failed +make[1]: *** [cmTC_697e4] Error 1 +make[1]: Leaving directory '/store/software/opencmiss/OpenCMISS-examples/FiniteElasticity/RightBiceps/build_debug/CMakeFiles/CMakeTmp' +Makefile:126: recipe for target 'cmTC_697e4/fast' failed +make: *** [cmTC_697e4/fast] Error 2 + +File /store/software/opencmiss/OpenCMISS-examples/FiniteElasticity/RightBiceps/build_debug/CMakeFiles/CMakeTmp/CheckSymbolExists.c: +/* */ +#include + +int main(int argc, char** argv) +{ + (void)argv; +#ifndef pthread_create + return ((int*)(&pthread_create))[argc]; +#else + (void)argc; + return 0; +#endif +} + +Determining if the function pthread_create exists in the pthreads failed with the following output: +Change Dir: /store/software/opencmiss/OpenCMISS-examples/FiniteElasticity/RightBiceps/build_debug/CMakeFiles/CMakeTmp + +Run Build Command:"/usr/bin/make" "cmTC_edcbc/fast" +/usr/bin/make -f CMakeFiles/cmTC_edcbc.dir/build.make CMakeFiles/cmTC_edcbc.dir/build +make[1]: Entering directory '/store/software/opencmiss/OpenCMISS-examples/FiniteElasticity/RightBiceps/build_debug/CMakeFiles/CMakeTmp' +Building C object CMakeFiles/cmTC_edcbc.dir/CheckFunctionExists.c.o +/usr/bin/cc -DCHECK_FUNCTION_EXISTS=pthread_create -o CMakeFiles/cmTC_edcbc.dir/CheckFunctionExists.c.o -c /usr/share/cmake-3.5/Modules/CheckFunctionExists.c +Linking C executable cmTC_edcbc +/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_edcbc.dir/link.txt --verbose=1 +/usr/bin/cc -DCHECK_FUNCTION_EXISTS=pthread_create CMakeFiles/cmTC_edcbc.dir/CheckFunctionExists.c.o -o cmTC_edcbc -rdynamic -lpthreads +/usr/bin/ld: cannot find -lpthreads +collect2: error: ld returned 1 exit status +CMakeFiles/cmTC_edcbc.dir/build.make:97: recipe for target 'cmTC_edcbc' failed +make[1]: *** [cmTC_edcbc] Error 1 +make[1]: Leaving directory '/store/software/opencmiss/OpenCMISS-examples/FiniteElasticity/RightBiceps/build_debug/CMakeFiles/CMakeTmp' +Makefile:126: recipe for target 'cmTC_edcbc/fast' failed +make: *** [cmTC_edcbc/fast] Error 2 + + diff --git a/FiniteElasticity/RightBiceps/build_debug/CMakeFiles/CMakeOutput.log b/FiniteElasticity/RightBiceps/build_debug/CMakeFiles/CMakeOutput.log new file mode 100644 index 00000000..8a051eb2 --- /dev/null +++ b/FiniteElasticity/RightBiceps/build_debug/CMakeFiles/CMakeOutput.log @@ -0,0 +1,532 @@ +The system is: Linux - 4.4.0-104-generic - x86_64 +Compiling the C compiler identification source file "CMakeCCompilerId.c" succeeded. +Compiler: /usr/bin/cc +Build flags: +Id flags: + +The output was: +0 + + +Compilation of the C compiler identification source "CMakeCCompilerId.c" produced "a.out" + +The C compiler identification is GNU, found in "/store/software/opencmiss/OpenCMISS-examples/FiniteElasticity/RightBiceps/build_debug/CMakeFiles/3.5.1/CompilerIdC/a.out" + +Determining if the C compiler works passed with the following output: +Change Dir: /store/software/opencmiss/OpenCMISS-examples/FiniteElasticity/RightBiceps/build_debug/CMakeFiles/CMakeTmp + +Run Build Command:"/usr/bin/make" "cmTC_2dde0/fast" +/usr/bin/make -f CMakeFiles/cmTC_2dde0.dir/build.make CMakeFiles/cmTC_2dde0.dir/build +make[1]: Entering directory '/store/software/opencmiss/OpenCMISS-examples/FiniteElasticity/RightBiceps/build_debug/CMakeFiles/CMakeTmp' +Building C object CMakeFiles/cmTC_2dde0.dir/testCCompiler.c.o +/usr/bin/cc -o CMakeFiles/cmTC_2dde0.dir/testCCompiler.c.o -c /store/software/opencmiss/OpenCMISS-examples/FiniteElasticity/RightBiceps/build_debug/CMakeFiles/CMakeTmp/testCCompiler.c +Linking C executable cmTC_2dde0 +/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_2dde0.dir/link.txt --verbose=1 +/usr/bin/cc CMakeFiles/cmTC_2dde0.dir/testCCompiler.c.o -o cmTC_2dde0 -rdynamic +make[1]: Leaving directory '/store/software/opencmiss/OpenCMISS-examples/FiniteElasticity/RightBiceps/build_debug/CMakeFiles/CMakeTmp' + + +Detecting C compiler ABI info compiled with the following output: +Change Dir: /store/software/opencmiss/OpenCMISS-examples/FiniteElasticity/RightBiceps/build_debug/CMakeFiles/CMakeTmp + +Run Build Command:"/usr/bin/make" "cmTC_e2f27/fast" +/usr/bin/make -f CMakeFiles/cmTC_e2f27.dir/build.make CMakeFiles/cmTC_e2f27.dir/build +make[1]: Entering directory '/store/software/opencmiss/OpenCMISS-examples/FiniteElasticity/RightBiceps/build_debug/CMakeFiles/CMakeTmp' +Building C object CMakeFiles/cmTC_e2f27.dir/CMakeCCompilerABI.c.o +/usr/bin/cc -o CMakeFiles/cmTC_e2f27.dir/CMakeCCompilerABI.c.o -c /usr/share/cmake-3.5/Modules/CMakeCCompilerABI.c +Linking C executable cmTC_e2f27 +/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_e2f27.dir/link.txt --verbose=1 +/usr/bin/cc -v CMakeFiles/cmTC_e2f27.dir/CMakeCCompilerABI.c.o -o cmTC_e2f27 -rdynamic +Using built-in specs. +COLLECT_GCC=/usr/bin/cc +COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/5/lto-wrapper +Target: x86_64-linux-gnu +Configured with: ../src/configure -v --with-pkgversion='Ubuntu 5.4.0-6ubuntu1~16.04.5' --with-bugurl=file:///usr/share/doc/gcc-5/README.Bugs --enable-languages=c,ada,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-5 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-libmpx --enable-plugin --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-5-amd64/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-5-amd64 --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-5-amd64 --with-arch-directory=amd64 --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --enable-objc-gc --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu +Thread model: posix +gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.5) +COMPILER_PATH=/usr/lib/gcc/x86_64-linux-gnu/5/:/usr/lib/gcc/x86_64-linux-gnu/5/:/usr/lib/gcc/x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/5/:/usr/lib/gcc/x86_64-linux-gnu/ +LIBRARY_PATH=/usr/lib/gcc/x86_64-linux-gnu/5/:/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/5/../../../../lib/:/lib/x86_64-linux-gnu/:/lib/../lib/:/usr/lib/x86_64-linux-gnu/:/usr/lib/../lib/:/usr/lib/gcc/x86_64-linux-gnu/5/../../../:/lib/:/usr/lib/ +COLLECT_GCC_OPTIONS='-v' '-o' 'cmTC_e2f27' '-rdynamic' '-mtune=generic' '-march=x86-64' + /usr/lib/gcc/x86_64-linux-gnu/5/collect2 -plugin /usr/lib/gcc/x86_64-linux-gnu/5/liblto_plugin.so -plugin-opt=/usr/lib/gcc/x86_64-linux-gnu/5/lto-wrapper -plugin-opt=-fresolution=/tmp/ccPN6ZYw.res -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lc -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_s --sysroot=/ --build-id --eh-frame-hdr -m elf_x86_64 --hash-style=gnu --as-needed -export-dynamic -dynamic-linker /lib64/ld-linux-x86-64.so.2 -z relro -o cmTC_e2f27 /usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/crt1.o /usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/crti.o /usr/lib/gcc/x86_64-linux-gnu/5/crtbegin.o -L/usr/lib/gcc/x86_64-linux-gnu/5 -L/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu -L/usr/lib/gcc/x86_64-linux-gnu/5/../../../../lib -L/lib/x86_64-linux-gnu -L/lib/../lib -L/usr/lib/x86_64-linux-gnu -L/usr/lib/../lib -L/usr/lib/gcc/x86_64-linux-gnu/5/../../.. CMakeFiles/cmTC_e2f27.dir/CMakeCCompilerABI.c.o -lgcc --as-needed -lgcc_s --no-as-needed -lc -lgcc --as-needed -lgcc_s --no-as-needed /usr/lib/gcc/x86_64-linux-gnu/5/crtend.o /usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/crtn.o +make[1]: Leaving directory '/store/software/opencmiss/OpenCMISS-examples/FiniteElasticity/RightBiceps/build_debug/CMakeFiles/CMakeTmp' + + +Parsed C implicit link information from above output: + link line regex: [^( *|.*[/\])(ld|([^/\]+-)?ld|collect2)[^/\]*( |$)] + ignore line: [Change Dir: /store/software/opencmiss/OpenCMISS-examples/FiniteElasticity/RightBiceps/build_debug/CMakeFiles/CMakeTmp] + ignore line: [] + ignore line: [Run Build Command:"/usr/bin/make" "cmTC_e2f27/fast"] + ignore line: [/usr/bin/make -f CMakeFiles/cmTC_e2f27.dir/build.make CMakeFiles/cmTC_e2f27.dir/build] + ignore line: [make[1]: Entering directory '/store/software/opencmiss/OpenCMISS-examples/FiniteElasticity/RightBiceps/build_debug/CMakeFiles/CMakeTmp'] + ignore line: [Building C object CMakeFiles/cmTC_e2f27.dir/CMakeCCompilerABI.c.o] + ignore line: [/usr/bin/cc -o CMakeFiles/cmTC_e2f27.dir/CMakeCCompilerABI.c.o -c /usr/share/cmake-3.5/Modules/CMakeCCompilerABI.c] + ignore line: [Linking C executable cmTC_e2f27] + ignore line: [/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_e2f27.dir/link.txt --verbose=1] + ignore line: [/usr/bin/cc -v CMakeFiles/cmTC_e2f27.dir/CMakeCCompilerABI.c.o -o cmTC_e2f27 -rdynamic ] + ignore line: [Using built-in specs.] + ignore line: [COLLECT_GCC=/usr/bin/cc] + ignore line: [COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/5/lto-wrapper] + ignore line: [Target: x86_64-linux-gnu] + ignore line: [Configured with: ../src/configure -v --with-pkgversion='Ubuntu 5.4.0-6ubuntu1~16.04.5' --with-bugurl=file:///usr/share/doc/gcc-5/README.Bugs --enable-languages=c,ada,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-5 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-libmpx --enable-plugin --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-5-amd64/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-5-amd64 --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-5-amd64 --with-arch-directory=amd64 --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --enable-objc-gc --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu] + ignore line: [Thread model: posix] + ignore line: [gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.5) ] + ignore line: [COMPILER_PATH=/usr/lib/gcc/x86_64-linux-gnu/5/:/usr/lib/gcc/x86_64-linux-gnu/5/:/usr/lib/gcc/x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/5/:/usr/lib/gcc/x86_64-linux-gnu/] + ignore line: [LIBRARY_PATH=/usr/lib/gcc/x86_64-linux-gnu/5/:/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/5/../../../../lib/:/lib/x86_64-linux-gnu/:/lib/../lib/:/usr/lib/x86_64-linux-gnu/:/usr/lib/../lib/:/usr/lib/gcc/x86_64-linux-gnu/5/../../../:/lib/:/usr/lib/] + ignore line: [COLLECT_GCC_OPTIONS='-v' '-o' 'cmTC_e2f27' '-rdynamic' '-mtune=generic' '-march=x86-64'] + link line: [ /usr/lib/gcc/x86_64-linux-gnu/5/collect2 -plugin /usr/lib/gcc/x86_64-linux-gnu/5/liblto_plugin.so -plugin-opt=/usr/lib/gcc/x86_64-linux-gnu/5/lto-wrapper -plugin-opt=-fresolution=/tmp/ccPN6ZYw.res -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lc -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_s --sysroot=/ --build-id --eh-frame-hdr -m elf_x86_64 --hash-style=gnu --as-needed -export-dynamic -dynamic-linker /lib64/ld-linux-x86-64.so.2 -z relro -o cmTC_e2f27 /usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/crt1.o /usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/crti.o /usr/lib/gcc/x86_64-linux-gnu/5/crtbegin.o -L/usr/lib/gcc/x86_64-linux-gnu/5 -L/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu -L/usr/lib/gcc/x86_64-linux-gnu/5/../../../../lib -L/lib/x86_64-linux-gnu -L/lib/../lib -L/usr/lib/x86_64-linux-gnu -L/usr/lib/../lib -L/usr/lib/gcc/x86_64-linux-gnu/5/../../.. CMakeFiles/cmTC_e2f27.dir/CMakeCCompilerABI.c.o -lgcc --as-needed -lgcc_s --no-as-needed -lc -lgcc --as-needed -lgcc_s --no-as-needed /usr/lib/gcc/x86_64-linux-gnu/5/crtend.o /usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/crtn.o] + arg [/usr/lib/gcc/x86_64-linux-gnu/5/collect2] ==> ignore + arg [-plugin] ==> ignore + arg [/usr/lib/gcc/x86_64-linux-gnu/5/liblto_plugin.so] ==> ignore + arg [-plugin-opt=/usr/lib/gcc/x86_64-linux-gnu/5/lto-wrapper] ==> ignore + arg [-plugin-opt=-fresolution=/tmp/ccPN6ZYw.res] ==> ignore + arg [-plugin-opt=-pass-through=-lgcc] ==> ignore + arg [-plugin-opt=-pass-through=-lgcc_s] ==> ignore + arg [-plugin-opt=-pass-through=-lc] ==> ignore + arg [-plugin-opt=-pass-through=-lgcc] ==> ignore + arg [-plugin-opt=-pass-through=-lgcc_s] ==> ignore + arg [--sysroot=/] ==> ignore + arg [--build-id] ==> ignore + arg [--eh-frame-hdr] ==> ignore + arg [-m] ==> ignore + arg [elf_x86_64] ==> ignore + arg [--hash-style=gnu] ==> ignore + arg [--as-needed] ==> ignore + arg [-export-dynamic] ==> ignore + arg [-dynamic-linker] ==> ignore + arg [/lib64/ld-linux-x86-64.so.2] ==> ignore + arg [-zrelro] ==> ignore + arg [-o] ==> ignore + arg [cmTC_e2f27] ==> ignore + arg [/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/crt1.o] ==> ignore + arg [/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/crti.o] ==> ignore + arg [/usr/lib/gcc/x86_64-linux-gnu/5/crtbegin.o] ==> ignore + arg [-L/usr/lib/gcc/x86_64-linux-gnu/5] ==> dir [/usr/lib/gcc/x86_64-linux-gnu/5] + arg [-L/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu] ==> dir [/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu] + arg [-L/usr/lib/gcc/x86_64-linux-gnu/5/../../../../lib] ==> dir [/usr/lib/gcc/x86_64-linux-gnu/5/../../../../lib] + arg [-L/lib/x86_64-linux-gnu] ==> dir [/lib/x86_64-linux-gnu] + arg [-L/lib/../lib] ==> dir [/lib/../lib] + arg [-L/usr/lib/x86_64-linux-gnu] ==> dir [/usr/lib/x86_64-linux-gnu] + arg [-L/usr/lib/../lib] ==> dir [/usr/lib/../lib] + arg [-L/usr/lib/gcc/x86_64-linux-gnu/5/../../..] ==> dir [/usr/lib/gcc/x86_64-linux-gnu/5/../../..] + arg [CMakeFiles/cmTC_e2f27.dir/CMakeCCompilerABI.c.o] ==> ignore + arg [-lgcc] ==> lib [gcc] + arg [--as-needed] ==> ignore + arg [-lgcc_s] ==> lib [gcc_s] + arg [--no-as-needed] ==> ignore + arg [-lc] ==> lib [c] + arg [-lgcc] ==> lib [gcc] + arg [--as-needed] ==> ignore + arg [-lgcc_s] ==> lib [gcc_s] + arg [--no-as-needed] ==> ignore + arg [/usr/lib/gcc/x86_64-linux-gnu/5/crtend.o] ==> ignore + arg [/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/crtn.o] ==> ignore + remove lib [gcc] + remove lib [gcc_s] + remove lib [gcc] + remove lib [gcc_s] + collapse library dir [/usr/lib/gcc/x86_64-linux-gnu/5] ==> [/usr/lib/gcc/x86_64-linux-gnu/5] + collapse library dir [/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu] ==> [/usr/lib/x86_64-linux-gnu] + collapse library dir [/usr/lib/gcc/x86_64-linux-gnu/5/../../../../lib] ==> [/usr/lib] + collapse library dir [/lib/x86_64-linux-gnu] ==> [/lib/x86_64-linux-gnu] + collapse library dir [/lib/../lib] ==> [/lib] + collapse library dir [/usr/lib/x86_64-linux-gnu] ==> [/usr/lib/x86_64-linux-gnu] + collapse library dir [/usr/lib/../lib] ==> [/usr/lib] + collapse library dir [/usr/lib/gcc/x86_64-linux-gnu/5/../../..] ==> [/usr/lib] + implicit libs: [c] + implicit dirs: [/usr/lib/gcc/x86_64-linux-gnu/5;/usr/lib/x86_64-linux-gnu;/usr/lib;/lib/x86_64-linux-gnu;/lib] + implicit fwks: [] + + + + +Detecting C [-std=c11] compiler features compiled with the following output: +Change Dir: /store/software/opencmiss/OpenCMISS-examples/FiniteElasticity/RightBiceps/build_debug/CMakeFiles/CMakeTmp + +Run Build Command:"/usr/bin/make" "cmTC_78d3e/fast" +/usr/bin/make -f CMakeFiles/cmTC_78d3e.dir/build.make CMakeFiles/cmTC_78d3e.dir/build +make[1]: Entering directory '/store/software/opencmiss/OpenCMISS-examples/FiniteElasticity/RightBiceps/build_debug/CMakeFiles/CMakeTmp' +Building C object CMakeFiles/cmTC_78d3e.dir/feature_tests.c.o +/usr/bin/cc -std=c11 -o CMakeFiles/cmTC_78d3e.dir/feature_tests.c.o -c /store/software/opencmiss/OpenCMISS-examples/FiniteElasticity/RightBiceps/build_debug/CMakeFiles/feature_tests.c +Linking C executable cmTC_78d3e +/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_78d3e.dir/link.txt --verbose=1 +/usr/bin/cc CMakeFiles/cmTC_78d3e.dir/feature_tests.c.o -o cmTC_78d3e -rdynamic +make[1]: Leaving directory '/store/software/opencmiss/OpenCMISS-examples/FiniteElasticity/RightBiceps/build_debug/CMakeFiles/CMakeTmp' + + + Feature record: C_FEATURE:1c_function_prototypes + Feature record: C_FEATURE:1c_restrict + Feature record: C_FEATURE:1c_static_assert + Feature record: C_FEATURE:1c_variadic_macros + + +Detecting C [-std=c99] compiler features compiled with the following output: +Change Dir: /store/software/opencmiss/OpenCMISS-examples/FiniteElasticity/RightBiceps/build_debug/CMakeFiles/CMakeTmp + +Run Build Command:"/usr/bin/make" "cmTC_f9547/fast" +/usr/bin/make -f CMakeFiles/cmTC_f9547.dir/build.make CMakeFiles/cmTC_f9547.dir/build +make[1]: Entering directory '/store/software/opencmiss/OpenCMISS-examples/FiniteElasticity/RightBiceps/build_debug/CMakeFiles/CMakeTmp' +Building C object CMakeFiles/cmTC_f9547.dir/feature_tests.c.o +/usr/bin/cc -std=c99 -o CMakeFiles/cmTC_f9547.dir/feature_tests.c.o -c /store/software/opencmiss/OpenCMISS-examples/FiniteElasticity/RightBiceps/build_debug/CMakeFiles/feature_tests.c +Linking C executable cmTC_f9547 +/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_f9547.dir/link.txt --verbose=1 +/usr/bin/cc CMakeFiles/cmTC_f9547.dir/feature_tests.c.o -o cmTC_f9547 -rdynamic +make[1]: Leaving directory '/store/software/opencmiss/OpenCMISS-examples/FiniteElasticity/RightBiceps/build_debug/CMakeFiles/CMakeTmp' + + + Feature record: C_FEATURE:1c_function_prototypes + Feature record: C_FEATURE:1c_restrict + Feature record: C_FEATURE:0c_static_assert + Feature record: C_FEATURE:1c_variadic_macros + + +Detecting C [-std=c90] compiler features compiled with the following output: +Change Dir: /store/software/opencmiss/OpenCMISS-examples/FiniteElasticity/RightBiceps/build_debug/CMakeFiles/CMakeTmp + +Run Build Command:"/usr/bin/make" "cmTC_d0459/fast" +/usr/bin/make -f CMakeFiles/cmTC_d0459.dir/build.make CMakeFiles/cmTC_d0459.dir/build +make[1]: Entering directory '/store/software/opencmiss/OpenCMISS-examples/FiniteElasticity/RightBiceps/build_debug/CMakeFiles/CMakeTmp' +Building C object CMakeFiles/cmTC_d0459.dir/feature_tests.c.o +/usr/bin/cc -std=c90 -o CMakeFiles/cmTC_d0459.dir/feature_tests.c.o -c /store/software/opencmiss/OpenCMISS-examples/FiniteElasticity/RightBiceps/build_debug/CMakeFiles/feature_tests.c +Linking C executable cmTC_d0459 +/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_d0459.dir/link.txt --verbose=1 +/usr/bin/cc CMakeFiles/cmTC_d0459.dir/feature_tests.c.o -o cmTC_d0459 -rdynamic +make[1]: Leaving directory '/store/software/opencmiss/OpenCMISS-examples/FiniteElasticity/RightBiceps/build_debug/CMakeFiles/CMakeTmp' + + + Feature record: C_FEATURE:1c_function_prototypes + Feature record: C_FEATURE:0c_restrict + Feature record: C_FEATURE:0c_static_assert + Feature record: C_FEATURE:0c_variadic_macros +Compiling the Fortran compiler identification source file "CMakeFortranCompilerId.F" succeeded. +Compiler: /usr/bin/gfortran +Build flags: +Id flags: -v + +The output was: +0 +Driving: /usr/bin/gfortran -v CMakeFortranCompilerId.F -l gfortran -l m -shared-libgcc +Using built-in specs. +COLLECT_GCC=/usr/bin/gfortran +COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/5/lto-wrapper +Target: x86_64-linux-gnu +Configured with: ../src/configure -v --with-pkgversion='Ubuntu 5.4.0-6ubuntu1~16.04.5' --with-bugurl=file:///usr/share/doc/gcc-5/README.Bugs --enable-languages=c,ada,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-5 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-libmpx --enable-plugin --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-5-amd64/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-5-amd64 --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-5-amd64 --with-arch-directory=amd64 --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --enable-objc-gc --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu +Thread model: posix +gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.5) +COLLECT_GCC_OPTIONS='-v' '-shared-libgcc' '-mtune=generic' '-march=x86-64' + /usr/lib/gcc/x86_64-linux-gnu/5/f951 CMakeFortranCompilerId.F -ffixed-form -cpp=/tmp/ccjAv1IJ.f90 -quiet -v -imultiarch x86_64-linux-gnu CMakeFortranCompilerId.F -quiet -dumpbase CMakeFortranCompilerId.F -mtune=generic -march=x86-64 -auxbase CMakeFortranCompilerId -version -fintrinsic-modules-path /usr/lib/gcc/x86_64-linux-gnu/5/finclude -o /tmp/cc1lYzWQ.s +GNU Fortran (Ubuntu 5.4.0-6ubuntu1~16.04.5) version 5.4.0 20160609 (x86_64-linux-gnu) + compiled by GNU C version 5.4.0 20160609, GMP version 6.1.0, MPFR version 3.1.4, MPC version 1.0.3 +GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072 +ignoring nonexistent directory "/usr/local/include/x86_64-linux-gnu" +ignoring nonexistent directory "/usr/lib/gcc/x86_64-linux-gnu/5/../../../../x86_64-linux-gnu/include" +#include "..." search starts here: +#include <...> search starts here: + /usr/lib/gcc/x86_64-linux-gnu/5/finclude + /usr/lib/gcc/x86_64-linux-gnu/5/include + /usr/local/include + /usr/lib/gcc/x86_64-linux-gnu/5/include-fixed + /usr/include/x86_64-linux-gnu + /usr/include +End of search list. +GNU Fortran2008 (Ubuntu 5.4.0-6ubuntu1~16.04.5) version 5.4.0 20160609 (x86_64-linux-gnu) + compiled by GNU C version 5.4.0 20160609, GMP version 6.1.0, MPFR version 3.1.4, MPC version 1.0.3 +GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072 +COLLECT_GCC_OPTIONS='-v' '-shared-libgcc' '-mtune=generic' '-march=x86-64' + as -v --64 -o /tmp/ccNycOcY.o /tmp/cc1lYzWQ.s +GNU assembler version 2.26.1 (x86_64-linux-gnu) using BFD version (GNU Binutils for Ubuntu) 2.26.1 +Reading specs from /usr/lib/gcc/x86_64-linux-gnu/5/libgfortran.spec +rename spec lib to liborig +COLLECT_GCC_OPTIONS='-v' '-shared-libgcc' '-mtune=generic' '-march=x86-64' +COMPILER_PATH=/usr/lib/gcc/x86_64-linux-gnu/5/:/usr/lib/gcc/x86_64-linux-gnu/5/:/usr/lib/gcc/x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/5/:/usr/lib/gcc/x86_64-linux-gnu/ +LIBRARY_PATH=/usr/lib/gcc/x86_64-linux-gnu/5/:/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/5/../../../../lib/:/lib/x86_64-linux-gnu/:/lib/../lib/:/usr/lib/x86_64-linux-gnu/:/usr/lib/../lib/:/usr/lib/gcc/x86_64-linux-gnu/5/../../../:/lib/:/usr/lib/ +COLLECT_GCC_OPTIONS='-v' '-shared-libgcc' '-mtune=generic' '-march=x86-64' + /usr/lib/gcc/x86_64-linux-gnu/5/collect2 -plugin /usr/lib/gcc/x86_64-linux-gnu/5/liblto_plugin.so -plugin-opt=/usr/lib/gcc/x86_64-linux-gnu/5/lto-wrapper -plugin-opt=-fresolution=/tmp/ccDrhNt5.res -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lquadmath -plugin-opt=-pass-through=-lm -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lc -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc --sysroot=/ --build-id --eh-frame-hdr -m elf_x86_64 --hash-style=gnu --as-needed -dynamic-linker /lib64/ld-linux-x86-64.so.2 -z relro /usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/crt1.o /usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/crti.o /usr/lib/gcc/x86_64-linux-gnu/5/crtbegin.o -L/usr/lib/gcc/x86_64-linux-gnu/5 -L/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu -L/usr/lib/gcc/x86_64-linux-gnu/5/../../../../lib -L/lib/x86_64-linux-gnu -L/lib/../lib -L/usr/lib/x86_64-linux-gnu -L/usr/lib/../lib -L/usr/lib/gcc/x86_64-linux-gnu/5/../../.. /tmp/ccNycOcY.o -lgfortran -lm -lgcc_s -lgcc -lquadmath -lm -lgcc_s -lgcc -lc -lgcc_s -lgcc /usr/lib/gcc/x86_64-linux-gnu/5/crtend.o /usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/crtn.o + + +Compilation of the Fortran compiler identification source "CMakeFortranCompilerId.F" produced "a.out" + +The Fortran compiler identification is GNU, found in "/store/software/opencmiss/OpenCMISS-examples/FiniteElasticity/RightBiceps/build_debug/CMakeFiles/3.5.1/CompilerIdFortran/a.out" + +Determining if the Fortran compiler works passed with the following output: +Change Dir: /store/software/opencmiss/OpenCMISS-examples/FiniteElasticity/RightBiceps/build_debug/CMakeFiles/CMakeTmp + +Run Build Command:"/usr/bin/make" "cmTC_eba0c/fast" +/usr/bin/make -f CMakeFiles/cmTC_eba0c.dir/build.make CMakeFiles/cmTC_eba0c.dir/build +make[1]: Entering directory '/store/software/opencmiss/OpenCMISS-examples/FiniteElasticity/RightBiceps/build_debug/CMakeFiles/CMakeTmp' +Building Fortran object CMakeFiles/cmTC_eba0c.dir/testFortranCompiler.f.o +/usr/bin/gfortran -c /store/software/opencmiss/OpenCMISS-examples/FiniteElasticity/RightBiceps/build_debug/CMakeFiles/CMakeTmp/testFortranCompiler.f -o CMakeFiles/cmTC_eba0c.dir/testFortranCompiler.f.o +Linking Fortran executable cmTC_eba0c +/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_eba0c.dir/link.txt --verbose=1 +/usr/bin/gfortran CMakeFiles/cmTC_eba0c.dir/testFortranCompiler.f.o -o cmTC_eba0c +make[1]: Leaving directory '/store/software/opencmiss/OpenCMISS-examples/FiniteElasticity/RightBiceps/build_debug/CMakeFiles/CMakeTmp' + + +Detecting Fortran compiler ABI info compiled with the following output: +Change Dir: /store/software/opencmiss/OpenCMISS-examples/FiniteElasticity/RightBiceps/build_debug/CMakeFiles/CMakeTmp + +Run Build Command:"/usr/bin/make" "cmTC_1f98c/fast" +/usr/bin/make -f CMakeFiles/cmTC_1f98c.dir/build.make CMakeFiles/cmTC_1f98c.dir/build +make[1]: Entering directory '/store/software/opencmiss/OpenCMISS-examples/FiniteElasticity/RightBiceps/build_debug/CMakeFiles/CMakeTmp' +Building Fortran object CMakeFiles/cmTC_1f98c.dir/CMakeFortranCompilerABI.F.o +/usr/bin/gfortran -c /usr/share/cmake-3.5/Modules/CMakeFortranCompilerABI.F -o CMakeFiles/cmTC_1f98c.dir/CMakeFortranCompilerABI.F.o +Linking Fortran executable cmTC_1f98c +/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_1f98c.dir/link.txt --verbose=1 +/usr/bin/gfortran -v CMakeFiles/cmTC_1f98c.dir/CMakeFortranCompilerABI.F.o -o cmTC_1f98c +Driving: /usr/bin/gfortran -v CMakeFiles/cmTC_1f98c.dir/CMakeFortranCompilerABI.F.o -o cmTC_1f98c -l gfortran -l m -shared-libgcc +Using built-in specs. +COLLECT_GCC=/usr/bin/gfortran +COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/5/lto-wrapper +Target: x86_64-linux-gnu +Configured with: ../src/configure -v --with-pkgversion='Ubuntu 5.4.0-6ubuntu1~16.04.5' --with-bugurl=file:///usr/share/doc/gcc-5/README.Bugs --enable-languages=c,ada,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-5 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-libmpx --enable-plugin --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-5-amd64/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-5-amd64 --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-5-amd64 --with-arch-directory=amd64 --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --enable-objc-gc --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu +Thread model: posix +gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.5) +Reading specs from /usr/lib/gcc/x86_64-linux-gnu/5/libgfortran.spec +rename spec lib to liborig +COLLECT_GCC_OPTIONS='-v' '-o' 'cmTC_1f98c' '-shared-libgcc' '-mtune=generic' '-march=x86-64' +COMPILER_PATH=/usr/lib/gcc/x86_64-linux-gnu/5/:/usr/lib/gcc/x86_64-linux-gnu/5/:/usr/lib/gcc/x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/5/:/usr/lib/gcc/x86_64-linux-gnu/ +LIBRARY_PATH=/usr/lib/gcc/x86_64-linux-gnu/5/:/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/5/../../../../lib/:/lib/x86_64-linux-gnu/:/lib/../lib/:/usr/lib/x86_64-linux-gnu/:/usr/lib/../lib/:/usr/lib/gcc/x86_64-linux-gnu/5/../../../:/lib/:/usr/lib/ +COLLECT_GCC_OPTIONS='-v' '-o' 'cmTC_1f98c' '-shared-libgcc' '-mtune=generic' '-march=x86-64' + /usr/lib/gcc/x86_64-linux-gnu/5/collect2 -plugin /usr/lib/gcc/x86_64-linux-gnu/5/liblto_plugin.so -plugin-opt=/usr/lib/gcc/x86_64-linux-gnu/5/lto-wrapper -plugin-opt=-fresolution=/tmp/ccpTnwk0.res -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lquadmath -plugin-opt=-pass-through=-lm -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lc -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc --sysroot=/ --build-id --eh-frame-hdr -m elf_x86_64 --hash-style=gnu --as-needed -dynamic-linker /lib64/ld-linux-x86-64.so.2 -z relro -o cmTC_1f98c /usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/crt1.o /usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/crti.o /usr/lib/gcc/x86_64-linux-gnu/5/crtbegin.o -L/usr/lib/gcc/x86_64-linux-gnu/5 -L/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu -L/usr/lib/gcc/x86_64-linux-gnu/5/../../../../lib -L/lib/x86_64-linux-gnu -L/lib/../lib -L/usr/lib/x86_64-linux-gnu -L/usr/lib/../lib -L/usr/lib/gcc/x86_64-linux-gnu/5/../../.. CMakeFiles/cmTC_1f98c.dir/CMakeFortranCompilerABI.F.o -lgfortran -lm -lgcc_s -lgcc -lquadmath -lm -lgcc_s -lgcc -lc -lgcc_s -lgcc /usr/lib/gcc/x86_64-linux-gnu/5/crtend.o /usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/crtn.o +make[1]: Leaving directory '/store/software/opencmiss/OpenCMISS-examples/FiniteElasticity/RightBiceps/build_debug/CMakeFiles/CMakeTmp' + + +Parsed Fortran implicit link information from above output: + link line regex: [^( *|.*[/\])(ld|([^/\]+-)?ld|collect2)[^/\]*( |$)] + ignore line: [Change Dir: /store/software/opencmiss/OpenCMISS-examples/FiniteElasticity/RightBiceps/build_debug/CMakeFiles/CMakeTmp] + ignore line: [] + ignore line: [Run Build Command:"/usr/bin/make" "cmTC_1f98c/fast"] + ignore line: [/usr/bin/make -f CMakeFiles/cmTC_1f98c.dir/build.make CMakeFiles/cmTC_1f98c.dir/build] + ignore line: [make[1]: Entering directory '/store/software/opencmiss/OpenCMISS-examples/FiniteElasticity/RightBiceps/build_debug/CMakeFiles/CMakeTmp'] + ignore line: [Building Fortran object CMakeFiles/cmTC_1f98c.dir/CMakeFortranCompilerABI.F.o] + ignore line: [/usr/bin/gfortran -c /usr/share/cmake-3.5/Modules/CMakeFortranCompilerABI.F -o CMakeFiles/cmTC_1f98c.dir/CMakeFortranCompilerABI.F.o] + ignore line: [Linking Fortran executable cmTC_1f98c] + ignore line: [/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_1f98c.dir/link.txt --verbose=1] + ignore line: [/usr/bin/gfortran -v CMakeFiles/cmTC_1f98c.dir/CMakeFortranCompilerABI.F.o -o cmTC_1f98c ] + ignore line: [Driving: /usr/bin/gfortran -v CMakeFiles/cmTC_1f98c.dir/CMakeFortranCompilerABI.F.o -o cmTC_1f98c -l gfortran -l m -shared-libgcc] + ignore line: [Using built-in specs.] + ignore line: [COLLECT_GCC=/usr/bin/gfortran] + ignore line: [COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/5/lto-wrapper] + ignore line: [Target: x86_64-linux-gnu] + ignore line: [Configured with: ../src/configure -v --with-pkgversion='Ubuntu 5.4.0-6ubuntu1~16.04.5' --with-bugurl=file:///usr/share/doc/gcc-5/README.Bugs --enable-languages=c,ada,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-5 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-libmpx --enable-plugin --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-5-amd64/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-5-amd64 --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-5-amd64 --with-arch-directory=amd64 --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --enable-objc-gc --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu] + ignore line: [Thread model: posix] + ignore line: [gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.5) ] + ignore line: [Reading specs from /usr/lib/gcc/x86_64-linux-gnu/5/libgfortran.spec] + ignore line: [rename spec lib to liborig] + ignore line: [COLLECT_GCC_OPTIONS='-v' '-o' 'cmTC_1f98c' '-shared-libgcc' '-mtune=generic' '-march=x86-64'] + ignore line: [COMPILER_PATH=/usr/lib/gcc/x86_64-linux-gnu/5/:/usr/lib/gcc/x86_64-linux-gnu/5/:/usr/lib/gcc/x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/5/:/usr/lib/gcc/x86_64-linux-gnu/] + ignore line: [LIBRARY_PATH=/usr/lib/gcc/x86_64-linux-gnu/5/:/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/5/../../../../lib/:/lib/x86_64-linux-gnu/:/lib/../lib/:/usr/lib/x86_64-linux-gnu/:/usr/lib/../lib/:/usr/lib/gcc/x86_64-linux-gnu/5/../../../:/lib/:/usr/lib/] + ignore line: [COLLECT_GCC_OPTIONS='-v' '-o' 'cmTC_1f98c' '-shared-libgcc' '-mtune=generic' '-march=x86-64'] + link line: [ /usr/lib/gcc/x86_64-linux-gnu/5/collect2 -plugin /usr/lib/gcc/x86_64-linux-gnu/5/liblto_plugin.so -plugin-opt=/usr/lib/gcc/x86_64-linux-gnu/5/lto-wrapper -plugin-opt=-fresolution=/tmp/ccpTnwk0.res -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lquadmath -plugin-opt=-pass-through=-lm -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lc -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc --sysroot=/ --build-id --eh-frame-hdr -m elf_x86_64 --hash-style=gnu --as-needed -dynamic-linker /lib64/ld-linux-x86-64.so.2 -z relro -o cmTC_1f98c /usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/crt1.o /usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/crti.o /usr/lib/gcc/x86_64-linux-gnu/5/crtbegin.o -L/usr/lib/gcc/x86_64-linux-gnu/5 -L/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu -L/usr/lib/gcc/x86_64-linux-gnu/5/../../../../lib -L/lib/x86_64-linux-gnu -L/lib/../lib -L/usr/lib/x86_64-linux-gnu -L/usr/lib/../lib -L/usr/lib/gcc/x86_64-linux-gnu/5/../../.. CMakeFiles/cmTC_1f98c.dir/CMakeFortranCompilerABI.F.o -lgfortran -lm -lgcc_s -lgcc -lquadmath -lm -lgcc_s -lgcc -lc -lgcc_s -lgcc /usr/lib/gcc/x86_64-linux-gnu/5/crtend.o /usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/crtn.o] + arg [/usr/lib/gcc/x86_64-linux-gnu/5/collect2] ==> ignore + arg [-plugin] ==> ignore + arg [/usr/lib/gcc/x86_64-linux-gnu/5/liblto_plugin.so] ==> ignore + arg [-plugin-opt=/usr/lib/gcc/x86_64-linux-gnu/5/lto-wrapper] ==> ignore + arg [-plugin-opt=-fresolution=/tmp/ccpTnwk0.res] ==> ignore + arg [-plugin-opt=-pass-through=-lgcc_s] ==> ignore + arg [-plugin-opt=-pass-through=-lgcc] ==> ignore + arg [-plugin-opt=-pass-through=-lquadmath] ==> ignore + arg [-plugin-opt=-pass-through=-lm] ==> ignore + arg [-plugin-opt=-pass-through=-lgcc_s] ==> ignore + arg [-plugin-opt=-pass-through=-lgcc] ==> ignore + arg [-plugin-opt=-pass-through=-lc] ==> ignore + arg [-plugin-opt=-pass-through=-lgcc_s] ==> ignore + arg [-plugin-opt=-pass-through=-lgcc] ==> ignore + arg [--sysroot=/] ==> ignore + arg [--build-id] ==> ignore + arg [--eh-frame-hdr] ==> ignore + arg [-m] ==> ignore + arg [elf_x86_64] ==> ignore + arg [--hash-style=gnu] ==> ignore + arg [--as-needed] ==> ignore + arg [-dynamic-linker] ==> ignore + arg [/lib64/ld-linux-x86-64.so.2] ==> ignore + arg [-zrelro] ==> ignore + arg [-o] ==> ignore + arg [cmTC_1f98c] ==> ignore + arg [/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/crt1.o] ==> ignore + arg [/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/crti.o] ==> ignore + arg [/usr/lib/gcc/x86_64-linux-gnu/5/crtbegin.o] ==> ignore + arg [-L/usr/lib/gcc/x86_64-linux-gnu/5] ==> dir [/usr/lib/gcc/x86_64-linux-gnu/5] + arg [-L/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu] ==> dir [/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu] + arg [-L/usr/lib/gcc/x86_64-linux-gnu/5/../../../../lib] ==> dir [/usr/lib/gcc/x86_64-linux-gnu/5/../../../../lib] + arg [-L/lib/x86_64-linux-gnu] ==> dir [/lib/x86_64-linux-gnu] + arg [-L/lib/../lib] ==> dir [/lib/../lib] + arg [-L/usr/lib/x86_64-linux-gnu] ==> dir [/usr/lib/x86_64-linux-gnu] + arg [-L/usr/lib/../lib] ==> dir [/usr/lib/../lib] + arg [-L/usr/lib/gcc/x86_64-linux-gnu/5/../../..] ==> dir [/usr/lib/gcc/x86_64-linux-gnu/5/../../..] + arg [CMakeFiles/cmTC_1f98c.dir/CMakeFortranCompilerABI.F.o] ==> ignore + arg [-lgfortran] ==> lib [gfortran] + arg [-lm] ==> lib [m] + arg [-lgcc_s] ==> lib [gcc_s] + arg [-lgcc] ==> lib [gcc] + arg [-lquadmath] ==> lib [quadmath] + arg [-lm] ==> lib [m] + arg [-lgcc_s] ==> lib [gcc_s] + arg [-lgcc] ==> lib [gcc] + arg [-lc] ==> lib [c] + arg [-lgcc_s] ==> lib [gcc_s] + arg [-lgcc] ==> lib [gcc] + arg [/usr/lib/gcc/x86_64-linux-gnu/5/crtend.o] ==> ignore + arg [/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/crtn.o] ==> ignore + remove lib [gcc_s] + remove lib [gcc] + remove lib [gcc_s] + remove lib [gcc] + remove lib [gcc_s] + remove lib [gcc] + collapse library dir [/usr/lib/gcc/x86_64-linux-gnu/5] ==> [/usr/lib/gcc/x86_64-linux-gnu/5] + collapse library dir [/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu] ==> [/usr/lib/x86_64-linux-gnu] + collapse library dir [/usr/lib/gcc/x86_64-linux-gnu/5/../../../../lib] ==> [/usr/lib] + collapse library dir [/lib/x86_64-linux-gnu] ==> [/lib/x86_64-linux-gnu] + collapse library dir [/lib/../lib] ==> [/lib] + collapse library dir [/usr/lib/x86_64-linux-gnu] ==> [/usr/lib/x86_64-linux-gnu] + collapse library dir [/usr/lib/../lib] ==> [/usr/lib] + collapse library dir [/usr/lib/gcc/x86_64-linux-gnu/5/../../..] ==> [/usr/lib] + implicit libs: [gfortran;m;quadmath;m;c] + implicit dirs: [/usr/lib/gcc/x86_64-linux-gnu/5;/usr/lib/x86_64-linux-gnu;/usr/lib;/lib/x86_64-linux-gnu;/lib] + implicit fwks: [] + + +Determining if the Fortran compiler supports Fortran 90 passed with the following output: +Change Dir: /store/software/opencmiss/OpenCMISS-examples/FiniteElasticity/RightBiceps/build_debug/CMakeFiles/CMakeTmp + +Run Build Command:"/usr/bin/make" "cmTC_67b00/fast" +/usr/bin/make -f CMakeFiles/cmTC_67b00.dir/build.make CMakeFiles/cmTC_67b00.dir/build +make[1]: Entering directory '/store/software/opencmiss/OpenCMISS-examples/FiniteElasticity/RightBiceps/build_debug/CMakeFiles/CMakeTmp' +Building Fortran object CMakeFiles/cmTC_67b00.dir/testFortranCompilerF90.f90.o +/usr/bin/gfortran -c /store/software/opencmiss/OpenCMISS-examples/FiniteElasticity/RightBiceps/build_debug/CMakeFiles/CMakeTmp/testFortranCompilerF90.f90 -o CMakeFiles/cmTC_67b00.dir/testFortranCompilerF90.f90.o +Linking Fortran executable cmTC_67b00 +/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_67b00.dir/link.txt --verbose=1 +/usr/bin/gfortran CMakeFiles/cmTC_67b00.dir/testFortranCompilerF90.f90.o -o cmTC_67b00 +make[1]: Leaving directory '/store/software/opencmiss/OpenCMISS-examples/FiniteElasticity/RightBiceps/build_debug/CMakeFiles/CMakeTmp' + + +Determining if the include file pthread.h exists passed with the following output: +Change Dir: /store/software/opencmiss/OpenCMISS-examples/FiniteElasticity/RightBiceps/build_debug/CMakeFiles/CMakeTmp + +Run Build Command:"/usr/bin/make" "cmTC_f576d/fast" +/usr/bin/make -f CMakeFiles/cmTC_f576d.dir/build.make CMakeFiles/cmTC_f576d.dir/build +make[1]: Entering directory '/store/software/opencmiss/OpenCMISS-examples/FiniteElasticity/RightBiceps/build_debug/CMakeFiles/CMakeTmp' +Building C object CMakeFiles/cmTC_f576d.dir/CheckIncludeFile.c.o +/usr/bin/cc -o CMakeFiles/cmTC_f576d.dir/CheckIncludeFile.c.o -c /store/software/opencmiss/OpenCMISS-examples/FiniteElasticity/RightBiceps/build_debug/CMakeFiles/CMakeTmp/CheckIncludeFile.c +Linking C executable cmTC_f576d +/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_f576d.dir/link.txt --verbose=1 +/usr/bin/cc CMakeFiles/cmTC_f576d.dir/CheckIncludeFile.c.o -o cmTC_f576d -rdynamic +make[1]: Leaving directory '/store/software/opencmiss/OpenCMISS-examples/FiniteElasticity/RightBiceps/build_debug/CMakeFiles/CMakeTmp' + + +Determining if the function pthread_create exists in the pthread passed with the following output: +Change Dir: /store/software/opencmiss/OpenCMISS-examples/FiniteElasticity/RightBiceps/build_debug/CMakeFiles/CMakeTmp + +Run Build Command:"/usr/bin/make" "cmTC_b9eed/fast" +/usr/bin/make -f CMakeFiles/cmTC_b9eed.dir/build.make CMakeFiles/cmTC_b9eed.dir/build +make[1]: Entering directory '/store/software/opencmiss/OpenCMISS-examples/FiniteElasticity/RightBiceps/build_debug/CMakeFiles/CMakeTmp' +Building C object CMakeFiles/cmTC_b9eed.dir/CheckFunctionExists.c.o +/usr/bin/cc -DCHECK_FUNCTION_EXISTS=pthread_create -o CMakeFiles/cmTC_b9eed.dir/CheckFunctionExists.c.o -c /usr/share/cmake-3.5/Modules/CheckFunctionExists.c +Linking C executable cmTC_b9eed +/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_b9eed.dir/link.txt --verbose=1 +/usr/bin/cc -DCHECK_FUNCTION_EXISTS=pthread_create CMakeFiles/cmTC_b9eed.dir/CheckFunctionExists.c.o -o cmTC_b9eed -rdynamic -lpthread +make[1]: Leaving directory '/store/software/opencmiss/OpenCMISS-examples/FiniteElasticity/RightBiceps/build_debug/CMakeFiles/CMakeTmp' + + +Determining if the function XOpenDisplay exists in the /usr/lib/x86_64-linux-gnu/libX11.so;/usr/lib/x86_64-linux-gnu/libXext.so passed with the following output: +Change Dir: /store/software/opencmiss/OpenCMISS-examples/FiniteElasticity/RightBiceps/build_debug/CMakeFiles/CMakeTmp + +Run Build Command:"/usr/bin/make" "cmTC_6ed73/fast" +/usr/bin/make -f CMakeFiles/cmTC_6ed73.dir/build.make CMakeFiles/cmTC_6ed73.dir/build +make[1]: Entering directory '/store/software/opencmiss/OpenCMISS-examples/FiniteElasticity/RightBiceps/build_debug/CMakeFiles/CMakeTmp' +Building C object CMakeFiles/cmTC_6ed73.dir/CheckFunctionExists.c.o +/usr/bin/cc -DCHECK_FUNCTION_EXISTS=XOpenDisplay -o CMakeFiles/cmTC_6ed73.dir/CheckFunctionExists.c.o -c /usr/share/cmake-3.5/Modules/CheckFunctionExists.c +Linking C executable cmTC_6ed73 +/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_6ed73.dir/link.txt --verbose=1 +/usr/bin/cc -DCHECK_FUNCTION_EXISTS=XOpenDisplay CMakeFiles/cmTC_6ed73.dir/CheckFunctionExists.c.o -o cmTC_6ed73 -rdynamic /usr/lib/x86_64-linux-gnu/libX11.so /usr/lib/x86_64-linux-gnu/libXext.so +make[1]: Leaving directory '/store/software/opencmiss/OpenCMISS-examples/FiniteElasticity/RightBiceps/build_debug/CMakeFiles/CMakeTmp' + + +Determining if the function gethostbyname exists passed with the following output: +Change Dir: /store/software/opencmiss/OpenCMISS-examples/FiniteElasticity/RightBiceps/build_debug/CMakeFiles/CMakeTmp + +Run Build Command:"/usr/bin/make" "cmTC_6b6f5/fast" +/usr/bin/make -f CMakeFiles/cmTC_6b6f5.dir/build.make CMakeFiles/cmTC_6b6f5.dir/build +make[1]: Entering directory '/store/software/opencmiss/OpenCMISS-examples/FiniteElasticity/RightBiceps/build_debug/CMakeFiles/CMakeTmp' +Building C object CMakeFiles/cmTC_6b6f5.dir/CheckFunctionExists.c.o +/usr/bin/cc -DCHECK_FUNCTION_EXISTS=gethostbyname -o CMakeFiles/cmTC_6b6f5.dir/CheckFunctionExists.c.o -c /usr/share/cmake-3.5/Modules/CheckFunctionExists.c +Linking C executable cmTC_6b6f5 +/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_6b6f5.dir/link.txt --verbose=1 +/usr/bin/cc -DCHECK_FUNCTION_EXISTS=gethostbyname CMakeFiles/cmTC_6b6f5.dir/CheckFunctionExists.c.o -o cmTC_6b6f5 -rdynamic +make[1]: Leaving directory '/store/software/opencmiss/OpenCMISS-examples/FiniteElasticity/RightBiceps/build_debug/CMakeFiles/CMakeTmp' + + +Determining if the function connect exists passed with the following output: +Change Dir: /store/software/opencmiss/OpenCMISS-examples/FiniteElasticity/RightBiceps/build_debug/CMakeFiles/CMakeTmp + +Run Build Command:"/usr/bin/make" "cmTC_14103/fast" +/usr/bin/make -f CMakeFiles/cmTC_14103.dir/build.make CMakeFiles/cmTC_14103.dir/build +make[1]: Entering directory '/store/software/opencmiss/OpenCMISS-examples/FiniteElasticity/RightBiceps/build_debug/CMakeFiles/CMakeTmp' +Building C object CMakeFiles/cmTC_14103.dir/CheckFunctionExists.c.o +/usr/bin/cc -DCHECK_FUNCTION_EXISTS=connect -o CMakeFiles/cmTC_14103.dir/CheckFunctionExists.c.o -c /usr/share/cmake-3.5/Modules/CheckFunctionExists.c +Linking C executable cmTC_14103 +/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_14103.dir/link.txt --verbose=1 +/usr/bin/cc -DCHECK_FUNCTION_EXISTS=connect CMakeFiles/cmTC_14103.dir/CheckFunctionExists.c.o -o cmTC_14103 -rdynamic +make[1]: Leaving directory '/store/software/opencmiss/OpenCMISS-examples/FiniteElasticity/RightBiceps/build_debug/CMakeFiles/CMakeTmp' + + +Determining if the function remove exists passed with the following output: +Change Dir: /store/software/opencmiss/OpenCMISS-examples/FiniteElasticity/RightBiceps/build_debug/CMakeFiles/CMakeTmp + +Run Build Command:"/usr/bin/make" "cmTC_f5504/fast" +/usr/bin/make -f CMakeFiles/cmTC_f5504.dir/build.make CMakeFiles/cmTC_f5504.dir/build +make[1]: Entering directory '/store/software/opencmiss/OpenCMISS-examples/FiniteElasticity/RightBiceps/build_debug/CMakeFiles/CMakeTmp' +Building C object CMakeFiles/cmTC_f5504.dir/CheckFunctionExists.c.o +/usr/bin/cc -DCHECK_FUNCTION_EXISTS=remove -o CMakeFiles/cmTC_f5504.dir/CheckFunctionExists.c.o -c /usr/share/cmake-3.5/Modules/CheckFunctionExists.c +Linking C executable cmTC_f5504 +/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_f5504.dir/link.txt --verbose=1 +/usr/bin/cc -DCHECK_FUNCTION_EXISTS=remove CMakeFiles/cmTC_f5504.dir/CheckFunctionExists.c.o -o cmTC_f5504 -rdynamic +make[1]: Leaving directory '/store/software/opencmiss/OpenCMISS-examples/FiniteElasticity/RightBiceps/build_debug/CMakeFiles/CMakeTmp' + + +Determining if the function shmat exists passed with the following output: +Change Dir: /store/software/opencmiss/OpenCMISS-examples/FiniteElasticity/RightBiceps/build_debug/CMakeFiles/CMakeTmp + +Run Build Command:"/usr/bin/make" "cmTC_0b941/fast" +/usr/bin/make -f CMakeFiles/cmTC_0b941.dir/build.make CMakeFiles/cmTC_0b941.dir/build +make[1]: Entering directory '/store/software/opencmiss/OpenCMISS-examples/FiniteElasticity/RightBiceps/build_debug/CMakeFiles/CMakeTmp' +Building C object CMakeFiles/cmTC_0b941.dir/CheckFunctionExists.c.o +/usr/bin/cc -DCHECK_FUNCTION_EXISTS=shmat -o CMakeFiles/cmTC_0b941.dir/CheckFunctionExists.c.o -c /usr/share/cmake-3.5/Modules/CheckFunctionExists.c +Linking C executable cmTC_0b941 +/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_0b941.dir/link.txt --verbose=1 +/usr/bin/cc -DCHECK_FUNCTION_EXISTS=shmat CMakeFiles/cmTC_0b941.dir/CheckFunctionExists.c.o -o cmTC_0b941 -rdynamic +make[1]: Leaving directory '/store/software/opencmiss/OpenCMISS-examples/FiniteElasticity/RightBiceps/build_debug/CMakeFiles/CMakeTmp' + + +Determining if the function IceConnectionNumber exists in the ICE passed with the following output: +Change Dir: /store/software/opencmiss/OpenCMISS-examples/FiniteElasticity/RightBiceps/build_debug/CMakeFiles/CMakeTmp + +Run Build Command:"/usr/bin/make" "cmTC_aa6c2/fast" +/usr/bin/make -f CMakeFiles/cmTC_aa6c2.dir/build.make CMakeFiles/cmTC_aa6c2.dir/build +make[1]: Entering directory '/store/software/opencmiss/OpenCMISS-examples/FiniteElasticity/RightBiceps/build_debug/CMakeFiles/CMakeTmp' +Building C object CMakeFiles/cmTC_aa6c2.dir/CheckFunctionExists.c.o +/usr/bin/cc -DCHECK_FUNCTION_EXISTS=IceConnectionNumber -o CMakeFiles/cmTC_aa6c2.dir/CheckFunctionExists.c.o -c /usr/share/cmake-3.5/Modules/CheckFunctionExists.c +Linking C executable cmTC_aa6c2 +/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_aa6c2.dir/link.txt --verbose=1 +/usr/bin/cc -DCHECK_FUNCTION_EXISTS=IceConnectionNumber CMakeFiles/cmTC_aa6c2.dir/CheckFunctionExists.c.o -o cmTC_aa6c2 -rdynamic -lICE +make[1]: Leaving directory '/store/software/opencmiss/OpenCMISS-examples/FiniteElasticity/RightBiceps/build_debug/CMakeFiles/CMakeTmp' + + +Performing Fortran SOURCE FILE Test MPI_Fortran_MODULE_COMPATIBLE succeeded with the following output: +Change Dir: /store/software/opencmiss/OpenCMISS-examples/FiniteElasticity/RightBiceps/build_debug/CMakeFiles/CMakeTmp + +Run Build Command:"/usr/bin/make" "cmTC_a81d6/fast" +/usr/bin/make -f CMakeFiles/cmTC_a81d6.dir/build.make CMakeFiles/cmTC_a81d6.dir/build +make[1]: Entering directory '/store/software/opencmiss/OpenCMISS-examples/FiniteElasticity/RightBiceps/build_debug/CMakeFiles/CMakeTmp' +Building Fortran object CMakeFiles/cmTC_a81d6.dir/src.F.o +/usr/bin/gfortran -I/usr/lib/openmpi/include -I/usr/lib/openmpi/lib -DMPI_Fortran_MODULE_COMPATIBLE -c /store/software/opencmiss/OpenCMISS-examples/FiniteElasticity/RightBiceps/build_debug/CMakeFiles/CMakeTmp/src.F -o CMakeFiles/cmTC_a81d6.dir/src.F.o +Linking Fortran executable cmTC_a81d6 +/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_a81d6.dir/link.txt --verbose=1 +/usr/bin/gfortran -DMPI_Fortran_MODULE_COMPATIBLE CMakeFiles/cmTC_a81d6.dir/src.F.o -o cmTC_a81d6 /usr/lib/openmpi/lib/libmpi_usempif08.so /usr/lib/openmpi/lib/libmpi_usempi_ignore_tkr.so /usr/lib/openmpi/lib/libmpi_mpifh.so /usr/lib/openmpi/lib/libmpi.so -Wl,-rpath,/usr/lib/openmpi/lib +make[1]: Leaving directory '/store/software/opencmiss/OpenCMISS-examples/FiniteElasticity/RightBiceps/build_debug/CMakeFiles/CMakeTmp' + +Source file was: + program test_mpi_module + use mpi + end program test_mpi_module diff --git a/FiniteElasticity/RightBiceps/build_debug/CMakeFiles/Makefile.cmake b/FiniteElasticity/RightBiceps/build_debug/CMakeFiles/Makefile.cmake new file mode 100644 index 00000000..43573bd0 --- /dev/null +++ b/FiniteElasticity/RightBiceps/build_debug/CMakeFiles/Makefile.cmake @@ -0,0 +1,222 @@ +# CMAKE generated file: DO NOT EDIT! +# Generated by "Unix Makefiles" Generator, CMake Version 3.5 + +# The generator used is: +set(CMAKE_DEPENDS_GENERATOR "Unix Makefiles") + +# The top level Makefile was generated from the following files: +set(CMAKE_MAKEFILE_DEPENDS + "CMakeCache.txt" + "../CMakeLists.txt" + "../Fortran/CMakeLists.txt" + "../OpenCMISS.cmake" + "CMakeFiles/3.5.1/CMakeCCompiler.cmake" + "CMakeFiles/3.5.1/CMakeFortranCompiler.cmake" + "CMakeFiles/3.5.1/CMakeSystem.cmake" + "CMakeFiles/feature_tests.c" + "mpi_verification/C/compiler_info.cmake" + "mpi_verification/Fortran/compiler_info.cmake" + "/store/software/opencmiss/dependencies/install/x86_64_linux/gnu-5.4-F5.4/no_mpi/debug/cmake/blas-config-debug.cmake" + "/store/software/opencmiss/dependencies/install/x86_64_linux/gnu-5.4-F5.4/no_mpi/debug/cmake/blas-config-version.cmake" + "/store/software/opencmiss/dependencies/install/x86_64_linux/gnu-5.4-F5.4/no_mpi/debug/cmake/blas-config.cmake" + "/store/software/opencmiss/dependencies/install/x86_64_linux/gnu-5.4-F5.4/no_mpi/debug/cmake/bzip2-config-debug.cmake" + "/store/software/opencmiss/dependencies/install/x86_64_linux/gnu-5.4-F5.4/no_mpi/debug/cmake/bzip2-config-version.cmake" + "/store/software/opencmiss/dependencies/install/x86_64_linux/gnu-5.4-F5.4/no_mpi/debug/cmake/bzip2-config.cmake" + "/store/software/opencmiss/dependencies/install/x86_64_linux/gnu-5.4-F5.4/no_mpi/debug/cmake/cellml-config-debug.cmake" + "/store/software/opencmiss/dependencies/install/x86_64_linux/gnu-5.4-F5.4/no_mpi/debug/cmake/cellml-config-dependencies.cmake" + "/store/software/opencmiss/dependencies/install/x86_64_linux/gnu-5.4-F5.4/no_mpi/debug/cmake/cellml-config-version.cmake" + "/store/software/opencmiss/dependencies/install/x86_64_linux/gnu-5.4-F5.4/no_mpi/debug/cmake/cellml-config.cmake" + "/store/software/opencmiss/dependencies/install/x86_64_linux/gnu-5.4-F5.4/no_mpi/debug/cmake/lapack-config-debug.cmake" + "/store/software/opencmiss/dependencies/install/x86_64_linux/gnu-5.4-F5.4/no_mpi/debug/cmake/lapack-config-version.cmake" + "/store/software/opencmiss/dependencies/install/x86_64_linux/gnu-5.4-F5.4/no_mpi/debug/cmake/lapack-config.cmake" + "/store/software/opencmiss/dependencies/install/x86_64_linux/gnu-5.4-F5.4/no_mpi/debug/cmake/libcellml-config-debug.cmake" + "/store/software/opencmiss/dependencies/install/x86_64_linux/gnu-5.4-F5.4/no_mpi/debug/cmake/libcellml-config-version.cmake" + "/store/software/opencmiss/dependencies/install/x86_64_linux/gnu-5.4-F5.4/no_mpi/debug/cmake/libcellml-config.cmake" + "/store/software/opencmiss/dependencies/install/x86_64_linux/gnu-5.4-F5.4/no_mpi/debug/cmake/libxml2-config-debug.cmake" + "/store/software/opencmiss/dependencies/install/x86_64_linux/gnu-5.4-F5.4/no_mpi/debug/cmake/libxml2-config-dependencies.cmake" + "/store/software/opencmiss/dependencies/install/x86_64_linux/gnu-5.4-F5.4/no_mpi/debug/cmake/libxml2-config-version.cmake" + "/store/software/opencmiss/dependencies/install/x86_64_linux/gnu-5.4-F5.4/no_mpi/debug/cmake/libxml2-config.cmake" + "/store/software/opencmiss/dependencies/install/x86_64_linux/gnu-5.4-F5.4/no_mpi/debug/cmake/superlu-config-debug.cmake" + "/store/software/opencmiss/dependencies/install/x86_64_linux/gnu-5.4-F5.4/no_mpi/debug/cmake/superlu-config-dependencies.cmake" + "/store/software/opencmiss/dependencies/install/x86_64_linux/gnu-5.4-F5.4/no_mpi/debug/cmake/superlu-config-version.cmake" + "/store/software/opencmiss/dependencies/install/x86_64_linux/gnu-5.4-F5.4/no_mpi/debug/cmake/superlu-config.cmake" + "/store/software/opencmiss/dependencies/install/x86_64_linux/gnu-5.4-F5.4/no_mpi/debug/cmake/zlib-config-debug.cmake" + "/store/software/opencmiss/dependencies/install/x86_64_linux/gnu-5.4-F5.4/no_mpi/debug/cmake/zlib-config-version.cmake" + "/store/software/opencmiss/dependencies/install/x86_64_linux/gnu-5.4-F5.4/no_mpi/debug/cmake/zlib-config.cmake" + "/store/software/opencmiss/dependencies/install/x86_64_linux/gnu-5.4-F5.4/openmpi_release/debug/cmake/hypre-config-debug.cmake" + "/store/software/opencmiss/dependencies/install/x86_64_linux/gnu-5.4-F5.4/openmpi_release/debug/cmake/hypre-config-dependencies.cmake" + "/store/software/opencmiss/dependencies/install/x86_64_linux/gnu-5.4-F5.4/openmpi_release/debug/cmake/hypre-config-version.cmake" + "/store/software/opencmiss/dependencies/install/x86_64_linux/gnu-5.4-F5.4/openmpi_release/debug/cmake/hypre-config.cmake" + "/store/software/opencmiss/dependencies/install/x86_64_linux/gnu-5.4-F5.4/openmpi_release/debug/cmake/metis-config-debug.cmake" + "/store/software/opencmiss/dependencies/install/x86_64_linux/gnu-5.4-F5.4/openmpi_release/debug/cmake/metis-config-dependencies.cmake" + "/store/software/opencmiss/dependencies/install/x86_64_linux/gnu-5.4-F5.4/openmpi_release/debug/cmake/metis-config-version.cmake" + "/store/software/opencmiss/dependencies/install/x86_64_linux/gnu-5.4-F5.4/openmpi_release/debug/cmake/metis-config.cmake" + "/store/software/opencmiss/dependencies/install/x86_64_linux/gnu-5.4-F5.4/openmpi_release/debug/cmake/mumps-config-debug.cmake" + "/store/software/opencmiss/dependencies/install/x86_64_linux/gnu-5.4-F5.4/openmpi_release/debug/cmake/mumps-config-dependencies.cmake" + "/store/software/opencmiss/dependencies/install/x86_64_linux/gnu-5.4-F5.4/openmpi_release/debug/cmake/mumps-config-version.cmake" + "/store/software/opencmiss/dependencies/install/x86_64_linux/gnu-5.4-F5.4/openmpi_release/debug/cmake/mumps-config.cmake" + "/store/software/opencmiss/dependencies/install/x86_64_linux/gnu-5.4-F5.4/openmpi_release/debug/cmake/parmetis-config-debug.cmake" + "/store/software/opencmiss/dependencies/install/x86_64_linux/gnu-5.4-F5.4/openmpi_release/debug/cmake/parmetis-config-dependencies.cmake" + "/store/software/opencmiss/dependencies/install/x86_64_linux/gnu-5.4-F5.4/openmpi_release/debug/cmake/parmetis-config-version.cmake" + "/store/software/opencmiss/dependencies/install/x86_64_linux/gnu-5.4-F5.4/openmpi_release/debug/cmake/parmetis-config.cmake" + "/store/software/opencmiss/dependencies/install/x86_64_linux/gnu-5.4-F5.4/openmpi_release/debug/cmake/pastix-config-debug.cmake" + "/store/software/opencmiss/dependencies/install/x86_64_linux/gnu-5.4-F5.4/openmpi_release/debug/cmake/pastix-config-dependencies.cmake" + "/store/software/opencmiss/dependencies/install/x86_64_linux/gnu-5.4-F5.4/openmpi_release/debug/cmake/pastix-config-version.cmake" + "/store/software/opencmiss/dependencies/install/x86_64_linux/gnu-5.4-F5.4/openmpi_release/debug/cmake/pastix-config.cmake" + "/store/software/opencmiss/dependencies/install/x86_64_linux/gnu-5.4-F5.4/openmpi_release/debug/cmake/petsc-config-debug.cmake" + "/store/software/opencmiss/dependencies/install/x86_64_linux/gnu-5.4-F5.4/openmpi_release/debug/cmake/petsc-config-dependencies.cmake" + "/store/software/opencmiss/dependencies/install/x86_64_linux/gnu-5.4-F5.4/openmpi_release/debug/cmake/petsc-config-version.cmake" + "/store/software/opencmiss/dependencies/install/x86_64_linux/gnu-5.4-F5.4/openmpi_release/debug/cmake/petsc-config.cmake" + "/store/software/opencmiss/dependencies/install/x86_64_linux/gnu-5.4-F5.4/openmpi_release/debug/cmake/ptscotch-config-debug.cmake" + "/store/software/opencmiss/dependencies/install/x86_64_linux/gnu-5.4-F5.4/openmpi_release/debug/cmake/ptscotch-config-dependencies.cmake" + "/store/software/opencmiss/dependencies/install/x86_64_linux/gnu-5.4-F5.4/openmpi_release/debug/cmake/ptscotch-config-version.cmake" + "/store/software/opencmiss/dependencies/install/x86_64_linux/gnu-5.4-F5.4/openmpi_release/debug/cmake/ptscotch-config.cmake" + "/store/software/opencmiss/dependencies/install/x86_64_linux/gnu-5.4-F5.4/openmpi_release/debug/cmake/scalapack-config-debug.cmake" + "/store/software/opencmiss/dependencies/install/x86_64_linux/gnu-5.4-F5.4/openmpi_release/debug/cmake/scalapack-config-dependencies.cmake" + "/store/software/opencmiss/dependencies/install/x86_64_linux/gnu-5.4-F5.4/openmpi_release/debug/cmake/scalapack-config-version.cmake" + "/store/software/opencmiss/dependencies/install/x86_64_linux/gnu-5.4-F5.4/openmpi_release/debug/cmake/scalapack-config.cmake" + "/store/software/opencmiss/dependencies/install/x86_64_linux/gnu-5.4-F5.4/openmpi_release/debug/cmake/suitesparse-config-debug.cmake" + "/store/software/opencmiss/dependencies/install/x86_64_linux/gnu-5.4-F5.4/openmpi_release/debug/cmake/suitesparse-config-dependencies.cmake" + "/store/software/opencmiss/dependencies/install/x86_64_linux/gnu-5.4-F5.4/openmpi_release/debug/cmake/suitesparse-config-version.cmake" + "/store/software/opencmiss/dependencies/install/x86_64_linux/gnu-5.4-F5.4/openmpi_release/debug/cmake/suitesparse-config.cmake" + "/store/software/opencmiss/dependencies/install/x86_64_linux/gnu-5.4-F5.4/openmpi_release/debug/cmake/sundials-config-debug.cmake" + "/store/software/opencmiss/dependencies/install/x86_64_linux/gnu-5.4-F5.4/openmpi_release/debug/cmake/sundials-config-dependencies.cmake" + "/store/software/opencmiss/dependencies/install/x86_64_linux/gnu-5.4-F5.4/openmpi_release/debug/cmake/sundials-config-version.cmake" + "/store/software/opencmiss/dependencies/install/x86_64_linux/gnu-5.4-F5.4/openmpi_release/debug/cmake/sundials-config.cmake" + "/store/software/opencmiss/dependencies/install/x86_64_linux/gnu-5.4-F5.4/openmpi_release/debug/cmake/superlu_dist-config-debug.cmake" + "/store/software/opencmiss/dependencies/install/x86_64_linux/gnu-5.4-F5.4/openmpi_release/debug/cmake/superlu_dist-config-dependencies.cmake" + "/store/software/opencmiss/dependencies/install/x86_64_linux/gnu-5.4-F5.4/openmpi_release/debug/cmake/superlu_dist-config-version.cmake" + "/store/software/opencmiss/dependencies/install/x86_64_linux/gnu-5.4-F5.4/openmpi_release/debug/cmake/superlu_dist-config.cmake" + "/store/software/opencmiss/iron_maierbn/install/cmake/OCArchitecturePath.cmake" + "/store/software/opencmiss/iron_maierbn/install/cmake/OpenCMISSExtraFindModules/FindMPI.cmake" + "/store/software/opencmiss/iron_maierbn/install/cmake/OpenCMISSFindModuleWrappers/FindBLAS.cmake" + "/store/software/opencmiss/iron_maierbn/install/cmake/OpenCMISSFindModuleWrappers/FindBZip2.cmake" + "/store/software/opencmiss/iron_maierbn/install/cmake/OpenCMISSFindModuleWrappers/FindHYPRE.cmake" + "/store/software/opencmiss/iron_maierbn/install/cmake/OpenCMISSFindModuleWrappers/FindLAPACK.cmake" + "/store/software/opencmiss/iron_maierbn/install/cmake/OpenCMISSFindModuleWrappers/FindLibXml2.cmake" + "/store/software/opencmiss/iron_maierbn/install/cmake/OpenCMISSFindModuleWrappers/FindMUMPS.cmake" + "/store/software/opencmiss/iron_maierbn/install/cmake/OpenCMISSFindModuleWrappers/FindPARMETIS.cmake" + "/store/software/opencmiss/iron_maierbn/install/cmake/OpenCMISSFindModuleWrappers/FindPASTIX.cmake" + "/store/software/opencmiss/iron_maierbn/install/cmake/OpenCMISSFindModuleWrappers/FindPETSC.cmake" + "/store/software/opencmiss/iron_maierbn/install/cmake/OpenCMISSFindModuleWrappers/FindPTSCOTCH.cmake" + "/store/software/opencmiss/iron_maierbn/install/cmake/OpenCMISSFindModuleWrappers/FindSCALAPACK.cmake" + "/store/software/opencmiss/iron_maierbn/install/cmake/OpenCMISSFindModuleWrappers/FindSUITESPARSE.cmake" + "/store/software/opencmiss/iron_maierbn/install/cmake/OpenCMISSFindModuleWrappers/FindSUNDIALS.cmake" + "/store/software/opencmiss/iron_maierbn/install/cmake/OpenCMISSFindModuleWrappers/FindSUPERLU.cmake" + "/store/software/opencmiss/iron_maierbn/install/cmake/OpenCMISSFindModuleWrappers/FindSUPERLU_DIST.cmake" + "/store/software/opencmiss/iron_maierbn/install/cmake/OpenCMISSFindModuleWrappers/FindZLIB.cmake" + "/store/software/opencmiss/iron_maierbn/install/opencmiss-config-version.cmake" + "/store/software/opencmiss/iron_maierbn/install/opencmiss-config.cmake" + "/store/software/opencmiss/iron_maierbn/install/x86_64_linux/gnu-5.4-F5.4/no_mpi/debug/cmake/fieldml-api-config-debug.cmake" + "/store/software/opencmiss/iron_maierbn/install/x86_64_linux/gnu-5.4-F5.4/no_mpi/debug/cmake/fieldml-api-config-dependencies.cmake" + "/store/software/opencmiss/iron_maierbn/install/x86_64_linux/gnu-5.4-F5.4/no_mpi/debug/cmake/fieldml-api-config-version.cmake" + "/store/software/opencmiss/iron_maierbn/install/x86_64_linux/gnu-5.4-F5.4/no_mpi/debug/cmake/fieldml-api-config.cmake" + "/store/software/opencmiss/iron_maierbn/install/x86_64_linux/gnu-5.4-F5.4/openmpi_release/debug/cmake/iron-config-debug.cmake" + "/store/software/opencmiss/iron_maierbn/install/x86_64_linux/gnu-5.4-F5.4/openmpi_release/debug/cmake/iron-config-dependencies.cmake" + "/store/software/opencmiss/iron_maierbn/install/x86_64_linux/gnu-5.4-F5.4/openmpi_release/debug/cmake/iron-config-version.cmake" + "/store/software/opencmiss/iron_maierbn/install/x86_64_linux/gnu-5.4-F5.4/openmpi_release/debug/cmake/iron-config.cmake" + "/store/software/opencmiss/iron_maierbn/install/x86_64_linux/gnu-5.4-F5.4/openmpi_release/debug/context.cmake" + "/usr/share/cmake-3.5/Modules/CMakeCCompiler.cmake.in" + "/usr/share/cmake-3.5/Modules/CMakeCCompilerABI.c" + "/usr/share/cmake-3.5/Modules/CMakeCInformation.cmake" + "/usr/share/cmake-3.5/Modules/CMakeCommonLanguageInclude.cmake" + "/usr/share/cmake-3.5/Modules/CMakeCompilerIdDetection.cmake" + "/usr/share/cmake-3.5/Modules/CMakeConfigurableFile.in" + "/usr/share/cmake-3.5/Modules/CMakeDetermineCCompiler.cmake" + "/usr/share/cmake-3.5/Modules/CMakeDetermineCompileFeatures.cmake" + "/usr/share/cmake-3.5/Modules/CMakeDetermineCompiler.cmake" + "/usr/share/cmake-3.5/Modules/CMakeDetermineCompilerABI.cmake" + "/usr/share/cmake-3.5/Modules/CMakeDetermineCompilerId.cmake" + "/usr/share/cmake-3.5/Modules/CMakeDetermineFortranCompiler.cmake" + "/usr/share/cmake-3.5/Modules/CMakeDetermineSystem.cmake" + "/usr/share/cmake-3.5/Modules/CMakeFindBinUtils.cmake" + "/usr/share/cmake-3.5/Modules/CMakeFindDependencyMacro.cmake" + "/usr/share/cmake-3.5/Modules/CMakeFortranCompiler.cmake.in" + "/usr/share/cmake-3.5/Modules/CMakeFortranCompilerABI.F" + "/usr/share/cmake-3.5/Modules/CMakeFortranInformation.cmake" + "/usr/share/cmake-3.5/Modules/CMakeGenericSystem.cmake" + "/usr/share/cmake-3.5/Modules/CMakeLanguageInformation.cmake" + "/usr/share/cmake-3.5/Modules/CMakeParseArguments.cmake" + "/usr/share/cmake-3.5/Modules/CMakeParseImplicitLinkInfo.cmake" + "/usr/share/cmake-3.5/Modules/CMakeSystem.cmake.in" + "/usr/share/cmake-3.5/Modules/CMakeSystemSpecificInformation.cmake" + "/usr/share/cmake-3.5/Modules/CMakeSystemSpecificInitialize.cmake" + "/usr/share/cmake-3.5/Modules/CMakeTestCCompiler.cmake" + "/usr/share/cmake-3.5/Modules/CMakeTestCompilerCommon.cmake" + "/usr/share/cmake-3.5/Modules/CMakeTestFortranCompiler.cmake" + "/usr/share/cmake-3.5/Modules/CMakeUnixFindMake.cmake" + "/usr/share/cmake-3.5/Modules/CheckFortranSourceCompiles.cmake" + "/usr/share/cmake-3.5/Modules/CheckFunctionExists.c" + "/usr/share/cmake-3.5/Modules/CheckFunctionExists.cmake" + "/usr/share/cmake-3.5/Modules/CheckIncludeFile.c.in" + "/usr/share/cmake-3.5/Modules/CheckIncludeFile.cmake" + "/usr/share/cmake-3.5/Modules/CheckLibraryExists.cmake" + "/usr/share/cmake-3.5/Modules/CheckSymbolExists.cmake" + "/usr/share/cmake-3.5/Modules/Compiler/ADSP-DetermineCompiler.cmake" + "/usr/share/cmake-3.5/Modules/Compiler/ARMCC-DetermineCompiler.cmake" + "/usr/share/cmake-3.5/Modules/Compiler/AppleClang-DetermineCompiler.cmake" + "/usr/share/cmake-3.5/Modules/Compiler/Borland-DetermineCompiler.cmake" + "/usr/share/cmake-3.5/Modules/Compiler/Clang-DetermineCompiler.cmake" + "/usr/share/cmake-3.5/Modules/Compiler/Clang-DetermineCompilerInternal.cmake" + "/usr/share/cmake-3.5/Modules/Compiler/Compaq-C-DetermineCompiler.cmake" + "/usr/share/cmake-3.5/Modules/Compiler/Cray-DetermineCompiler.cmake" + "/usr/share/cmake-3.5/Modules/Compiler/Embarcadero-DetermineCompiler.cmake" + "/usr/share/cmake-3.5/Modules/Compiler/Fujitsu-DetermineCompiler.cmake" + "/usr/share/cmake-3.5/Modules/Compiler/GHS-DetermineCompiler.cmake" + "/usr/share/cmake-3.5/Modules/Compiler/GNU-C-FeatureTests.cmake" + "/usr/share/cmake-3.5/Modules/Compiler/GNU-C.cmake" + "/usr/share/cmake-3.5/Modules/Compiler/GNU-DetermineCompiler.cmake" + "/usr/share/cmake-3.5/Modules/Compiler/GNU-Fortran.cmake" + "/usr/share/cmake-3.5/Modules/Compiler/GNU.cmake" + "/usr/share/cmake-3.5/Modules/Compiler/HP-C-DetermineCompiler.cmake" + "/usr/share/cmake-3.5/Modules/Compiler/IAR-DetermineCompiler.cmake" + "/usr/share/cmake-3.5/Modules/Compiler/IBMCPP-C-DetermineVersionInternal.cmake" + "/usr/share/cmake-3.5/Modules/Compiler/Intel-DetermineCompiler.cmake" + "/usr/share/cmake-3.5/Modules/Compiler/MIPSpro-DetermineCompiler.cmake" + "/usr/share/cmake-3.5/Modules/Compiler/MSVC-DetermineCompiler.cmake" + "/usr/share/cmake-3.5/Modules/Compiler/OpenWatcom-DetermineCompiler.cmake" + "/usr/share/cmake-3.5/Modules/Compiler/PGI-DetermineCompiler.cmake" + "/usr/share/cmake-3.5/Modules/Compiler/PathScale-DetermineCompiler.cmake" + "/usr/share/cmake-3.5/Modules/Compiler/SCO-DetermineCompiler.cmake" + "/usr/share/cmake-3.5/Modules/Compiler/SDCC-C-DetermineCompiler.cmake" + "/usr/share/cmake-3.5/Modules/Compiler/SunPro-C-DetermineCompiler.cmake" + "/usr/share/cmake-3.5/Modules/Compiler/TI-DetermineCompiler.cmake" + "/usr/share/cmake-3.5/Modules/Compiler/TinyCC-C-DetermineCompiler.cmake" + "/usr/share/cmake-3.5/Modules/Compiler/VisualAge-C-DetermineCompiler.cmake" + "/usr/share/cmake-3.5/Modules/Compiler/Watcom-DetermineCompiler.cmake" + "/usr/share/cmake-3.5/Modules/Compiler/XL-C-DetermineCompiler.cmake" + "/usr/share/cmake-3.5/Modules/Compiler/zOS-C-DetermineCompiler.cmake" + "/usr/share/cmake-3.5/Modules/FindPackageHandleStandardArgs.cmake" + "/usr/share/cmake-3.5/Modules/FindPackageMessage.cmake" + "/usr/share/cmake-3.5/Modules/FindThreads.cmake" + "/usr/share/cmake-3.5/Modules/FindX11.cmake" + "/usr/share/cmake-3.5/Modules/Internal/FeatureTesting.cmake" + "/usr/share/cmake-3.5/Modules/MultiArchCross.cmake" + "/usr/share/cmake-3.5/Modules/Platform/Linux-GNU-C.cmake" + "/usr/share/cmake-3.5/Modules/Platform/Linux-GNU-Fortran.cmake" + "/usr/share/cmake-3.5/Modules/Platform/Linux-GNU.cmake" + "/usr/share/cmake-3.5/Modules/Platform/Linux.cmake" + "/usr/share/cmake-3.5/Modules/Platform/UnixPaths.cmake" + ) + +# The corresponding makefile is: +set(CMAKE_MAKEFILE_OUTPUTS + "Makefile" + "CMakeFiles/cmake.check_cache" + ) + +# Byproducts of CMake generate step: +set(CMAKE_MAKEFILE_PRODUCTS + "CMakeFiles/3.5.1/CMakeSystem.cmake" + "CMakeFiles/3.5.1/CMakeCCompiler.cmake" + "CMakeFiles/3.5.1/CMakeCCompiler.cmake" + "CMakeFiles/3.5.1/CMakeFortranCompiler.cmake" + "CMakeFiles/3.5.1/CMakeFortranCompiler.cmake" + "CMakeFiles/CMakeDirectoryInformation.cmake" + "Fortran/CMakeFiles/CMakeDirectoryInformation.cmake" + ) + +# Dependency information for all targets: +set(CMAKE_DEPEND_INFO_FILES + "Fortran/CMakeFiles/RightBiceps.dir/DependInfo.cmake" + ) diff --git a/FiniteElasticity/RightBiceps/build_debug/CMakeFiles/Makefile2 b/FiniteElasticity/RightBiceps/build_debug/CMakeFiles/Makefile2 new file mode 100644 index 00000000..45a7e234 --- /dev/null +++ b/FiniteElasticity/RightBiceps/build_debug/CMakeFiles/Makefile2 @@ -0,0 +1,127 @@ +# CMAKE generated file: DO NOT EDIT! +# Generated by "Unix Makefiles" Generator, CMake Version 3.5 + +# Default target executed when no arguments are given to make. +default_target: all + +.PHONY : default_target + +# The main recursive all target +all: + +.PHONY : all + +# The main recursive preinstall target +preinstall: + +.PHONY : preinstall + +#============================================================================= +# Special targets provided by cmake. + +# Disable implicit rules so canonical targets will work. +.SUFFIXES: + + +# Remove some rules from gmake that .SUFFIXES does not remove. +SUFFIXES = + +.SUFFIXES: .hpux_make_needs_suffix_list + + +# Suppress display of executed commands. +$(VERBOSE).SILENT: + + +# A target that is always out of date. +cmake_force: + +.PHONY : cmake_force + +#============================================================================= +# Set environment variables for the build. + +# The shell in which to execute make rules. +SHELL = /bin/sh + +# The CMake executable. +CMAKE_COMMAND = /usr/bin/cmake + +# The command to remove a file. +RM = /usr/bin/cmake -E remove -f + +# Escaping for special characters. +EQUALS = = + +# The top-level source directory on which CMake was run. +CMAKE_SOURCE_DIR = /store/software/opencmiss/OpenCMISS-examples/FiniteElasticity/RightBiceps + +# The top-level build directory on which CMake was run. +CMAKE_BINARY_DIR = /store/software/opencmiss/OpenCMISS-examples/FiniteElasticity/RightBiceps/build_debug + +#============================================================================= +# Directory level rules for directory Fortran + +# Convenience name for "all" pass in the directory. +Fortran/all: Fortran/CMakeFiles/RightBiceps.dir/all + +.PHONY : Fortran/all + +# Convenience name for "clean" pass in the directory. +Fortran/clean: Fortran/CMakeFiles/RightBiceps.dir/clean + +.PHONY : Fortran/clean + +# Convenience name for "preinstall" pass in the directory. +Fortran/preinstall: + +.PHONY : Fortran/preinstall + +#============================================================================= +# Target rules for target Fortran/CMakeFiles/RightBiceps.dir + +# All Build rule for target. +Fortran/CMakeFiles/RightBiceps.dir/all: + $(MAKE) -f Fortran/CMakeFiles/RightBiceps.dir/build.make Fortran/CMakeFiles/RightBiceps.dir/depend + $(MAKE) -f Fortran/CMakeFiles/RightBiceps.dir/build.make Fortran/CMakeFiles/RightBiceps.dir/requires + $(MAKE) -f Fortran/CMakeFiles/RightBiceps.dir/build.make Fortran/CMakeFiles/RightBiceps.dir/build + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --progress-dir=/store/software/opencmiss/OpenCMISS-examples/FiniteElasticity/RightBiceps/build_debug/CMakeFiles --progress-num=1,2 "Built target RightBiceps" +.PHONY : Fortran/CMakeFiles/RightBiceps.dir/all + +# Include target in all. +all: Fortran/CMakeFiles/RightBiceps.dir/all + +.PHONY : all + +# Build rule for subdir invocation for target. +Fortran/CMakeFiles/RightBiceps.dir/rule: cmake_check_build_system + $(CMAKE_COMMAND) -E cmake_progress_start /store/software/opencmiss/OpenCMISS-examples/FiniteElasticity/RightBiceps/build_debug/CMakeFiles 2 + $(MAKE) -f CMakeFiles/Makefile2 Fortran/CMakeFiles/RightBiceps.dir/all + $(CMAKE_COMMAND) -E cmake_progress_start /store/software/opencmiss/OpenCMISS-examples/FiniteElasticity/RightBiceps/build_debug/CMakeFiles 0 +.PHONY : Fortran/CMakeFiles/RightBiceps.dir/rule + +# Convenience name for target. +RightBiceps: Fortran/CMakeFiles/RightBiceps.dir/rule + +.PHONY : RightBiceps + +# clean rule for target. +Fortran/CMakeFiles/RightBiceps.dir/clean: + $(MAKE) -f Fortran/CMakeFiles/RightBiceps.dir/build.make Fortran/CMakeFiles/RightBiceps.dir/clean +.PHONY : Fortran/CMakeFiles/RightBiceps.dir/clean + +# clean rule for target. +clean: Fortran/CMakeFiles/RightBiceps.dir/clean + +.PHONY : clean + +#============================================================================= +# Special targets to cleanup operation of make. + +# Special rule to run CMake to check the build system integrity. +# No rule that depends on this can have commands that come from listfiles +# because they might be regenerated. +cmake_check_build_system: + $(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 0 +.PHONY : cmake_check_build_system + diff --git a/FiniteElasticity/RightBiceps/build_debug/CMakeFiles/TargetDirectories.txt b/FiniteElasticity/RightBiceps/build_debug/CMakeFiles/TargetDirectories.txt new file mode 100644 index 00000000..1d48f52e --- /dev/null +++ b/FiniteElasticity/RightBiceps/build_debug/CMakeFiles/TargetDirectories.txt @@ -0,0 +1,7 @@ +/store/software/opencmiss/OpenCMISS-examples/FiniteElasticity/RightBiceps/build_debug/CMakeFiles/test.dir +/store/software/opencmiss/OpenCMISS-examples/FiniteElasticity/RightBiceps/build_debug/CMakeFiles/rebuild_cache.dir +/store/software/opencmiss/OpenCMISS-examples/FiniteElasticity/RightBiceps/build_debug/CMakeFiles/edit_cache.dir +/store/software/opencmiss/OpenCMISS-examples/FiniteElasticity/RightBiceps/build_debug/Fortran/CMakeFiles/test.dir +/store/software/opencmiss/OpenCMISS-examples/FiniteElasticity/RightBiceps/build_debug/Fortran/CMakeFiles/edit_cache.dir +/store/software/opencmiss/OpenCMISS-examples/FiniteElasticity/RightBiceps/build_debug/Fortran/CMakeFiles/rebuild_cache.dir +/store/software/opencmiss/OpenCMISS-examples/FiniteElasticity/RightBiceps/build_debug/Fortran/CMakeFiles/RightBiceps.dir diff --git a/FiniteElasticity/RightBiceps/build_debug/CMakeFiles/cmake.check_cache b/FiniteElasticity/RightBiceps/build_debug/CMakeFiles/cmake.check_cache new file mode 100644 index 00000000..3dccd731 --- /dev/null +++ b/FiniteElasticity/RightBiceps/build_debug/CMakeFiles/cmake.check_cache @@ -0,0 +1 @@ +# This file is generated by cmake for dependency checking of the CMakeCache.txt file diff --git a/FiniteElasticity/RightBiceps/build_debug/CMakeFiles/feature_tests.bin b/FiniteElasticity/RightBiceps/build_debug/CMakeFiles/feature_tests.bin new file mode 100755 index 00000000..8d335c5f Binary files /dev/null and b/FiniteElasticity/RightBiceps/build_debug/CMakeFiles/feature_tests.bin differ diff --git a/FiniteElasticity/RightBiceps/build_debug/CMakeFiles/feature_tests.c b/FiniteElasticity/RightBiceps/build_debug/CMakeFiles/feature_tests.c new file mode 100644 index 00000000..6590dded --- /dev/null +++ b/FiniteElasticity/RightBiceps/build_debug/CMakeFiles/feature_tests.c @@ -0,0 +1,34 @@ + + const char features[] = {"\n" +"C_FEATURE:" +#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 404 +"1" +#else +"0" +#endif +"c_function_prototypes\n" +"C_FEATURE:" +#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 404 && defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L +"1" +#else +"0" +#endif +"c_restrict\n" +"C_FEATURE:" +#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 406 && defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201000L +"1" +#else +"0" +#endif +"c_static_assert\n" +"C_FEATURE:" +#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 404 && defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L +"1" +#else +"0" +#endif +"c_variadic_macros\n" + +}; + +int main(int argc, char** argv) { (void)argv; return features[argc]; } diff --git a/FiniteElasticity/RightBiceps/build_debug/CMakeFiles/progress.marks b/FiniteElasticity/RightBiceps/build_debug/CMakeFiles/progress.marks new file mode 100644 index 00000000..0cfbf088 --- /dev/null +++ b/FiniteElasticity/RightBiceps/build_debug/CMakeFiles/progress.marks @@ -0,0 +1 @@ +2 diff --git a/FiniteElasticity/RightBiceps/build_debug/CTestTestfile.cmake b/FiniteElasticity/RightBiceps/build_debug/CTestTestfile.cmake new file mode 100644 index 00000000..4e2c722f --- /dev/null +++ b/FiniteElasticity/RightBiceps/build_debug/CTestTestfile.cmake @@ -0,0 +1,7 @@ +# CMake generated Testfile for +# Source directory: /store/software/opencmiss/OpenCMISS-examples/FiniteElasticity/RightBiceps +# Build directory: /store/software/opencmiss/OpenCMISS-examples/FiniteElasticity/RightBiceps/build_debug +# +# This file includes the relevant testing commands required for +# testing this directory and lists subdirectories to be tested as well. +subdirs(Fortran) diff --git a/FiniteElasticity/RightBiceps/build_debug/Fortran/CMakeFiles/CMakeDirectoryInformation.cmake b/FiniteElasticity/RightBiceps/build_debug/Fortran/CMakeFiles/CMakeDirectoryInformation.cmake new file mode 100644 index 00000000..0eaed40a --- /dev/null +++ b/FiniteElasticity/RightBiceps/build_debug/Fortran/CMakeFiles/CMakeDirectoryInformation.cmake @@ -0,0 +1,16 @@ +# CMAKE generated file: DO NOT EDIT! +# Generated by "Unix Makefiles" Generator, CMake Version 3.5 + +# Relative path conversion top directories. +set(CMAKE_RELATIVE_PATH_TOP_SOURCE "/store/software/opencmiss/OpenCMISS-examples/FiniteElasticity/RightBiceps") +set(CMAKE_RELATIVE_PATH_TOP_BINARY "/store/software/opencmiss/OpenCMISS-examples/FiniteElasticity/RightBiceps/build_debug") + +# Force unix paths in dependencies. +set(CMAKE_FORCE_UNIX_PATHS 1) + + +# The C and CXX include file regular expressions for this directory. +set(CMAKE_C_INCLUDE_REGEX_SCAN "^.*$") +set(CMAKE_C_INCLUDE_REGEX_COMPLAIN "^$") +set(CMAKE_CXX_INCLUDE_REGEX_SCAN ${CMAKE_C_INCLUDE_REGEX_SCAN}) +set(CMAKE_CXX_INCLUDE_REGEX_COMPLAIN ${CMAKE_C_INCLUDE_REGEX_COMPLAIN}) diff --git a/FiniteElasticity/RightBiceps/build_debug/Fortran/CMakeFiles/RightBiceps.dir/DependInfo.cmake b/FiniteElasticity/RightBiceps/build_debug/Fortran/CMakeFiles/RightBiceps.dir/DependInfo.cmake new file mode 100644 index 00000000..8b40b7ce --- /dev/null +++ b/FiniteElasticity/RightBiceps/build_debug/Fortran/CMakeFiles/RightBiceps.dir/DependInfo.cmake @@ -0,0 +1,42 @@ +# The set of languages for which implicit dependencies are needed: +set(CMAKE_DEPENDS_LANGUAGES + "Fortran" + ) +# The set of files for implicit dependencies of each language: +set(CMAKE_DEPENDS_CHECK_Fortran + "/store/software/opencmiss/OpenCMISS-examples/FiniteElasticity/RightBiceps/Fortran/src/FortranExample.f90" "/store/software/opencmiss/OpenCMISS-examples/FiniteElasticity/RightBiceps/build_debug/Fortran/CMakeFiles/RightBiceps.dir/src/FortranExample.f90.o" + ) +set(CMAKE_Fortran_COMPILER_ID "GNU") + +# Preprocessor definitions for this target. +set(CMAKE_TARGET_DEFINITIONS_Fortran + "DEBUG" + "DOUBLE_REAL_PRECISION" + "USE_CUSTOM_PROFILING" + "WITH_CELLML" + "WITH_DIAGNOSTICS" + "WITH_FIELDML" + "WITH_HYPRE" + "WITH_MUMPS" + "WITH_PETSC" + "WITH_SCALAPACK" + "WITH_SUNDIALS" + ) + +# The include file search paths: +set(CMAKE_Fortran_TARGET_INCLUDE_PATH + "/store/software/opencmiss/iron_maierbn/install/x86_64_linux/gnu-5.4-F5.4/openmpi_release/debug/include/opencmiss" + "/store/software/opencmiss/iron_maierbn/install/x86_64_linux/gnu-5.4-F5.4/openmpi_release/debug/include" + "/usr/lib/openmpi/include" + "/usr/lib/openmpi/lib" + "/usr/lib/openmpi/include/openmpi/opal/mca/event/libevent2021/libevent" + "/usr/lib/openmpi/include/openmpi/opal/mca/event/libevent2021/libevent/include" + "/usr/lib/openmpi/include/openmpi" + ) + +# Targets to which this target links. +set(CMAKE_TARGET_LINKED_INFO_FILES + ) + +# Fortran module output directory. +set(CMAKE_Fortran_TARGET_MODULE_DIR "") diff --git a/FiniteElasticity/RightBiceps/build_debug/Fortran/CMakeFiles/RightBiceps.dir/build.make b/FiniteElasticity/RightBiceps/build_debug/Fortran/CMakeFiles/RightBiceps.dir/build.make new file mode 100644 index 00000000..bae14654 --- /dev/null +++ b/FiniteElasticity/RightBiceps/build_debug/Fortran/CMakeFiles/RightBiceps.dir/build.make @@ -0,0 +1,120 @@ +# CMAKE generated file: DO NOT EDIT! +# Generated by "Unix Makefiles" Generator, CMake Version 3.5 + +# Delete rule output on recipe failure. +.DELETE_ON_ERROR: + + +#============================================================================= +# Special targets provided by cmake. + +# Disable implicit rules so canonical targets will work. +.SUFFIXES: + + +# Remove some rules from gmake that .SUFFIXES does not remove. +SUFFIXES = + +.SUFFIXES: .hpux_make_needs_suffix_list + + +# Suppress display of executed commands. +$(VERBOSE).SILENT: + + +# A target that is always out of date. +cmake_force: + +.PHONY : cmake_force + +#============================================================================= +# Set environment variables for the build. + +# The shell in which to execute make rules. +SHELL = /bin/sh + +# The CMake executable. +CMAKE_COMMAND = /usr/bin/cmake + +# The command to remove a file. +RM = /usr/bin/cmake -E remove -f + +# Escaping for special characters. +EQUALS = = + +# The top-level source directory on which CMake was run. +CMAKE_SOURCE_DIR = /store/software/opencmiss/OpenCMISS-examples/FiniteElasticity/RightBiceps + +# The top-level build directory on which CMake was run. +CMAKE_BINARY_DIR = /store/software/opencmiss/OpenCMISS-examples/FiniteElasticity/RightBiceps/build_debug + +# Include any dependencies generated for this target. +include Fortran/CMakeFiles/RightBiceps.dir/depend.make + +# Include the progress variables for this target. +include Fortran/CMakeFiles/RightBiceps.dir/progress.make + +# Include the compile flags for this target's objects. +include Fortran/CMakeFiles/RightBiceps.dir/flags.make + +Fortran/CMakeFiles/RightBiceps.dir/src/FortranExample.f90.o: Fortran/CMakeFiles/RightBiceps.dir/flags.make +Fortran/CMakeFiles/RightBiceps.dir/src/FortranExample.f90.o: ../Fortran/src/FortranExample.f90 + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --progress-dir=/store/software/opencmiss/OpenCMISS-examples/FiniteElasticity/RightBiceps/build_debug/CMakeFiles --progress-num=$(CMAKE_PROGRESS_1) "Building Fortran object Fortran/CMakeFiles/RightBiceps.dir/src/FortranExample.f90.o" + cd /store/software/opencmiss/OpenCMISS-examples/FiniteElasticity/RightBiceps/build_debug/Fortran && /usr/bin/gfortran $(Fortran_DEFINES) $(Fortran_INCLUDES) $(Fortran_FLAGS) -c /store/software/opencmiss/OpenCMISS-examples/FiniteElasticity/RightBiceps/Fortran/src/FortranExample.f90 -o CMakeFiles/RightBiceps.dir/src/FortranExample.f90.o + +Fortran/CMakeFiles/RightBiceps.dir/src/FortranExample.f90.i: cmake_force + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Preprocessing Fortran source to CMakeFiles/RightBiceps.dir/src/FortranExample.f90.i" + cd /store/software/opencmiss/OpenCMISS-examples/FiniteElasticity/RightBiceps/build_debug/Fortran && /usr/bin/gfortran $(Fortran_DEFINES) $(Fortran_INCLUDES) $(Fortran_FLAGS) -E /store/software/opencmiss/OpenCMISS-examples/FiniteElasticity/RightBiceps/Fortran/src/FortranExample.f90 > CMakeFiles/RightBiceps.dir/src/FortranExample.f90.i + +Fortran/CMakeFiles/RightBiceps.dir/src/FortranExample.f90.s: cmake_force + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Compiling Fortran source to assembly CMakeFiles/RightBiceps.dir/src/FortranExample.f90.s" + cd /store/software/opencmiss/OpenCMISS-examples/FiniteElasticity/RightBiceps/build_debug/Fortran && /usr/bin/gfortran $(Fortran_DEFINES) $(Fortran_INCLUDES) $(Fortran_FLAGS) -S /store/software/opencmiss/OpenCMISS-examples/FiniteElasticity/RightBiceps/Fortran/src/FortranExample.f90 -o CMakeFiles/RightBiceps.dir/src/FortranExample.f90.s + +Fortran/CMakeFiles/RightBiceps.dir/src/FortranExample.f90.o.requires: + +.PHONY : Fortran/CMakeFiles/RightBiceps.dir/src/FortranExample.f90.o.requires + +Fortran/CMakeFiles/RightBiceps.dir/src/FortranExample.f90.o.provides: Fortran/CMakeFiles/RightBiceps.dir/src/FortranExample.f90.o.requires + $(MAKE) -f Fortran/CMakeFiles/RightBiceps.dir/build.make Fortran/CMakeFiles/RightBiceps.dir/src/FortranExample.f90.o.provides.build +.PHONY : Fortran/CMakeFiles/RightBiceps.dir/src/FortranExample.f90.o.provides + +Fortran/CMakeFiles/RightBiceps.dir/src/FortranExample.f90.o.provides.build: Fortran/CMakeFiles/RightBiceps.dir/src/FortranExample.f90.o + + +# Object files for target RightBiceps +RightBiceps_OBJECTS = \ +"CMakeFiles/RightBiceps.dir/src/FortranExample.f90.o" + +# External object files for target RightBiceps +RightBiceps_EXTERNAL_OBJECTS = + +Fortran/RightBiceps: Fortran/CMakeFiles/RightBiceps.dir/src/FortranExample.f90.o +Fortran/RightBiceps: Fortran/CMakeFiles/RightBiceps.dir/build.make +Fortran/RightBiceps: /store/software/opencmiss/iron_maierbn/install/x86_64_linux/gnu-5.4-F5.4/openmpi_release/debug/lib/libiron_cd.so +Fortran/RightBiceps: /store/software/opencmiss/iron_maierbn/install/x86_64_linux/gnu-5.4-F5.4/openmpi_release/debug/lib/libirond.so +Fortran/RightBiceps: /usr/lib/openmpi/lib/libmpi_usempif08.so +Fortran/RightBiceps: /usr/lib/openmpi/lib/libmpi_usempi_ignore_tkr.so +Fortran/RightBiceps: /usr/lib/openmpi/lib/libmpi_mpifh.so +Fortran/RightBiceps: /usr/lib/openmpi/lib/libmpi.so +Fortran/RightBiceps: /usr/lib/openmpi/lib/libmpi.so +Fortran/RightBiceps: Fortran/CMakeFiles/RightBiceps.dir/link.txt + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --bold --progress-dir=/store/software/opencmiss/OpenCMISS-examples/FiniteElasticity/RightBiceps/build_debug/CMakeFiles --progress-num=$(CMAKE_PROGRESS_2) "Linking Fortran executable RightBiceps" + cd /store/software/opencmiss/OpenCMISS-examples/FiniteElasticity/RightBiceps/build_debug/Fortran && $(CMAKE_COMMAND) -E cmake_link_script CMakeFiles/RightBiceps.dir/link.txt --verbose=$(VERBOSE) + +# Rule to build all files generated by this target. +Fortran/CMakeFiles/RightBiceps.dir/build: Fortran/RightBiceps + +.PHONY : Fortran/CMakeFiles/RightBiceps.dir/build + +Fortran/CMakeFiles/RightBiceps.dir/requires: Fortran/CMakeFiles/RightBiceps.dir/src/FortranExample.f90.o.requires + +.PHONY : Fortran/CMakeFiles/RightBiceps.dir/requires + +Fortran/CMakeFiles/RightBiceps.dir/clean: + cd /store/software/opencmiss/OpenCMISS-examples/FiniteElasticity/RightBiceps/build_debug/Fortran && $(CMAKE_COMMAND) -P CMakeFiles/RightBiceps.dir/cmake_clean.cmake +.PHONY : Fortran/CMakeFiles/RightBiceps.dir/clean + +Fortran/CMakeFiles/RightBiceps.dir/depend: + cd /store/software/opencmiss/OpenCMISS-examples/FiniteElasticity/RightBiceps/build_debug && $(CMAKE_COMMAND) -E cmake_depends "Unix Makefiles" /store/software/opencmiss/OpenCMISS-examples/FiniteElasticity/RightBiceps /store/software/opencmiss/OpenCMISS-examples/FiniteElasticity/RightBiceps/Fortran /store/software/opencmiss/OpenCMISS-examples/FiniteElasticity/RightBiceps/build_debug /store/software/opencmiss/OpenCMISS-examples/FiniteElasticity/RightBiceps/build_debug/Fortran /store/software/opencmiss/OpenCMISS-examples/FiniteElasticity/RightBiceps/build_debug/Fortran/CMakeFiles/RightBiceps.dir/DependInfo.cmake --color=$(COLOR) +.PHONY : Fortran/CMakeFiles/RightBiceps.dir/depend + diff --git a/FiniteElasticity/RightBiceps/build_debug/Fortran/CMakeFiles/RightBiceps.dir/cmake_clean.cmake b/FiniteElasticity/RightBiceps/build_debug/Fortran/CMakeFiles/RightBiceps.dir/cmake_clean.cmake new file mode 100644 index 00000000..792383f9 --- /dev/null +++ b/FiniteElasticity/RightBiceps/build_debug/Fortran/CMakeFiles/RightBiceps.dir/cmake_clean.cmake @@ -0,0 +1,10 @@ +file(REMOVE_RECURSE + "CMakeFiles/RightBiceps.dir/src/FortranExample.f90.o" + "RightBiceps.pdb" + "RightBiceps" +) + +# Per-language clean rules from dependency scanning. +foreach(lang Fortran) + include(CMakeFiles/RightBiceps.dir/cmake_clean_${lang}.cmake OPTIONAL) +endforeach() diff --git a/FiniteElasticity/RightBiceps/build_debug/Fortran/CMakeFiles/RightBiceps.dir/depend.internal b/FiniteElasticity/RightBiceps/build_debug/Fortran/CMakeFiles/RightBiceps.dir/depend.internal new file mode 100644 index 00000000..392ee84b --- /dev/null +++ b/FiniteElasticity/RightBiceps/build_debug/Fortran/CMakeFiles/RightBiceps.dir/depend.internal @@ -0,0 +1,5 @@ +# CMAKE generated file: DO NOT EDIT! +# Generated by "Unix Makefiles" Generator, CMake Version 3.5 + +Fortran/CMakeFiles/RightBiceps.dir/src/FortranExample.f90.o + /store/software/opencmiss/OpenCMISS-examples/FiniteElasticity/RightBiceps/Fortran/src/FortranExample.f90 diff --git a/FiniteElasticity/RightBiceps/build_debug/Fortran/CMakeFiles/RightBiceps.dir/depend.make b/FiniteElasticity/RightBiceps/build_debug/Fortran/CMakeFiles/RightBiceps.dir/depend.make new file mode 100644 index 00000000..0c008f1e --- /dev/null +++ b/FiniteElasticity/RightBiceps/build_debug/Fortran/CMakeFiles/RightBiceps.dir/depend.make @@ -0,0 +1,7 @@ +# CMAKE generated file: DO NOT EDIT! +# Generated by "Unix Makefiles" Generator, CMake Version 3.5 + + +Fortran/CMakeFiles/RightBiceps.dir/src/FortranExample.f90.o: /usr/lib/openmpi/lib/mpi.mod +Fortran/CMakeFiles/RightBiceps.dir/src/FortranExample.f90.o: /store/software/opencmiss/iron_maierbn/install/x86_64_linux/gnu-5.4-F5.4/openmpi_release/debug/include/opencmiss/opencmiss.mod +Fortran/CMakeFiles/RightBiceps.dir/src/FortranExample.f90.o: /store/software/opencmiss/iron_maierbn/install/x86_64_linux/gnu-5.4-F5.4/openmpi_release/debug/include/opencmiss/opencmiss_iron.mod diff --git a/FiniteElasticity/RightBiceps/build_debug/Fortran/CMakeFiles/RightBiceps.dir/flags.make b/FiniteElasticity/RightBiceps/build_debug/Fortran/CMakeFiles/RightBiceps.dir/flags.make new file mode 100644 index 00000000..83a03eef --- /dev/null +++ b/FiniteElasticity/RightBiceps/build_debug/Fortran/CMakeFiles/RightBiceps.dir/flags.make @@ -0,0 +1,10 @@ +# CMAKE generated file: DO NOT EDIT! +# Generated by "Unix Makefiles" Generator, CMake Version 3.5 + +# compile Fortran with /usr/bin/gfortran +Fortran_FLAGS = -g -cpp -fbacktrace + +Fortran_DEFINES = -DDEBUG -DDOUBLE_REAL_PRECISION -DUSE_CUSTOM_PROFILING -DWITH_CELLML -DWITH_DIAGNOSTICS -DWITH_FIELDML -DWITH_HYPRE -DWITH_MUMPS -DWITH_PETSC -DWITH_SCALAPACK -DWITH_SUNDIALS + +Fortran_INCLUDES = -I/store/software/opencmiss/iron_maierbn/install/x86_64_linux/gnu-5.4-F5.4/openmpi_release/debug/include/opencmiss -I/store/software/opencmiss/iron_maierbn/install/x86_64_linux/gnu-5.4-F5.4/openmpi_release/debug/include -I/usr/lib/openmpi/include -I/usr/lib/openmpi/lib -I/usr/lib/openmpi/include/openmpi/opal/mca/event/libevent2021/libevent -I/usr/lib/openmpi/include/openmpi/opal/mca/event/libevent2021/libevent/include -I/usr/lib/openmpi/include/openmpi + diff --git a/FiniteElasticity/RightBiceps/build_debug/Fortran/CMakeFiles/RightBiceps.dir/fortran.internal b/FiniteElasticity/RightBiceps/build_debug/Fortran/CMakeFiles/RightBiceps.dir/fortran.internal new file mode 100644 index 00000000..1b732d31 --- /dev/null +++ b/FiniteElasticity/RightBiceps/build_debug/Fortran/CMakeFiles/RightBiceps.dir/fortran.internal @@ -0,0 +1,2 @@ +# The fortran modules provided by this target. +provides diff --git a/FiniteElasticity/RightBiceps/build_debug/Fortran/CMakeFiles/RightBiceps.dir/link.txt b/FiniteElasticity/RightBiceps/build_debug/Fortran/CMakeFiles/RightBiceps.dir/link.txt new file mode 100644 index 00000000..23ecbf05 --- /dev/null +++ b/FiniteElasticity/RightBiceps/build_debug/Fortran/CMakeFiles/RightBiceps.dir/link.txt @@ -0,0 +1 @@ +/usr/bin/gfortran -g CMakeFiles/RightBiceps.dir/src/FortranExample.f90.o -o RightBiceps /store/software/opencmiss/iron_maierbn/install/x86_64_linux/gnu-5.4-F5.4/openmpi_release/debug/lib/libiron_cd.so /store/software/opencmiss/iron_maierbn/install/x86_64_linux/gnu-5.4-F5.4/openmpi_release/debug/lib/libirond.so /usr/lib/openmpi/lib/libmpi_usempif08.so /usr/lib/openmpi/lib/libmpi_usempi_ignore_tkr.so /usr/lib/openmpi/lib/libmpi_mpifh.so /usr/lib/openmpi/lib/libmpi.so /usr/lib/openmpi/lib/libmpi.so -Wl,-rpath,/store/software/opencmiss/iron_maierbn/install/x86_64_linux/gnu-5.4-F5.4/openmpi_release/debug/lib:/usr/lib/openmpi/lib diff --git a/FiniteElasticity/RightBiceps/build_debug/Fortran/CMakeFiles/RightBiceps.dir/progress.make b/FiniteElasticity/RightBiceps/build_debug/Fortran/CMakeFiles/RightBiceps.dir/progress.make new file mode 100644 index 00000000..abadeb0c --- /dev/null +++ b/FiniteElasticity/RightBiceps/build_debug/Fortran/CMakeFiles/RightBiceps.dir/progress.make @@ -0,0 +1,3 @@ +CMAKE_PROGRESS_1 = 1 +CMAKE_PROGRESS_2 = 2 + diff --git a/FiniteElasticity/RightBiceps/build_debug/Fortran/CMakeFiles/RightBiceps.dir/src/FortranExample.f90.o b/FiniteElasticity/RightBiceps/build_debug/Fortran/CMakeFiles/RightBiceps.dir/src/FortranExample.f90.o new file mode 100644 index 00000000..0aa2ebdb Binary files /dev/null and b/FiniteElasticity/RightBiceps/build_debug/Fortran/CMakeFiles/RightBiceps.dir/src/FortranExample.f90.o differ diff --git a/FiniteElasticity/RightBiceps/build_debug/Fortran/CMakeFiles/progress.marks b/FiniteElasticity/RightBiceps/build_debug/Fortran/CMakeFiles/progress.marks new file mode 100644 index 00000000..0cfbf088 --- /dev/null +++ b/FiniteElasticity/RightBiceps/build_debug/Fortran/CMakeFiles/progress.marks @@ -0,0 +1 @@ +2 diff --git a/FiniteElasticity/RightBiceps/build_debug/Fortran/CTestTestfile.cmake b/FiniteElasticity/RightBiceps/build_debug/Fortran/CTestTestfile.cmake new file mode 100644 index 00000000..c3a41e82 --- /dev/null +++ b/FiniteElasticity/RightBiceps/build_debug/Fortran/CTestTestfile.cmake @@ -0,0 +1,8 @@ +# CMake generated Testfile for +# Source directory: /store/software/opencmiss/OpenCMISS-examples/FiniteElasticity/RightBiceps/Fortran +# Build directory: /store/software/opencmiss/OpenCMISS-examples/FiniteElasticity/RightBiceps/build_debug/Fortran +# +# This file includes the relevant testing commands required for +# testing this directory and lists subdirectories to be tested as well. +add_test(test_RightBiceps "/store/software/opencmiss/OpenCMISS-examples/FiniteElasticity/RightBiceps/build_debug/Fortran/RightBiceps") +set_tests_properties(test_RightBiceps PROPERTIES ENVIRONMENT "LD_LIBRARY_PATH=/store/software/opencmiss/iron_maierbn/install/x86_64_linux/gnu-5.4-F5.4/openmpi_release/debug/bin::/home/maierbn/perl5/perlbrew/build/perl-5.10.0:/store/software/opendihu/dependencies/petsc/install/lib:/store/software/simbody/install:/store/software/opensim/opensim-core/install") diff --git a/FiniteElasticity/RightBiceps/build_debug/Fortran/Makefile b/FiniteElasticity/RightBiceps/build_debug/Fortran/Makefile new file mode 100644 index 00000000..d5bd6c07 --- /dev/null +++ b/FiniteElasticity/RightBiceps/build_debug/Fortran/Makefile @@ -0,0 +1,192 @@ +# CMAKE generated file: DO NOT EDIT! +# Generated by "Unix Makefiles" Generator, CMake Version 3.5 + +# Default target executed when no arguments are given to make. +default_target: all + +.PHONY : default_target + +# Allow only one "make -f Makefile2" at a time, but pass parallelism. +.NOTPARALLEL: + + +#============================================================================= +# Special targets provided by cmake. + +# Disable implicit rules so canonical targets will work. +.SUFFIXES: + + +# Remove some rules from gmake that .SUFFIXES does not remove. +SUFFIXES = + +.SUFFIXES: .hpux_make_needs_suffix_list + + +# Suppress display of executed commands. +$(VERBOSE).SILENT: + + +# A target that is always out of date. +cmake_force: + +.PHONY : cmake_force + +#============================================================================= +# Set environment variables for the build. + +# The shell in which to execute make rules. +SHELL = /bin/sh + +# The CMake executable. +CMAKE_COMMAND = /usr/bin/cmake + +# The command to remove a file. +RM = /usr/bin/cmake -E remove -f + +# Escaping for special characters. +EQUALS = = + +# The top-level source directory on which CMake was run. +CMAKE_SOURCE_DIR = /store/software/opencmiss/OpenCMISS-examples/FiniteElasticity/RightBiceps + +# The top-level build directory on which CMake was run. +CMAKE_BINARY_DIR = /store/software/opencmiss/OpenCMISS-examples/FiniteElasticity/RightBiceps/build_debug + +#============================================================================= +# Targets provided globally by CMake. + +# Special rule for the target test +test: + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running tests..." + /usr/bin/ctest --force-new-ctest-process $(ARGS) +.PHONY : test + +# Special rule for the target test +test/fast: test + +.PHONY : test/fast + +# Special rule for the target edit_cache +edit_cache: + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running CMake cache editor..." + /usr/bin/ccmake -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) +.PHONY : edit_cache + +# Special rule for the target edit_cache +edit_cache/fast: edit_cache + +.PHONY : edit_cache/fast + +# Special rule for the target rebuild_cache +rebuild_cache: + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running CMake to regenerate build system..." + /usr/bin/cmake -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) +.PHONY : rebuild_cache + +# Special rule for the target rebuild_cache +rebuild_cache/fast: rebuild_cache + +.PHONY : rebuild_cache/fast + +# The main all target +all: cmake_check_build_system + cd /store/software/opencmiss/OpenCMISS-examples/FiniteElasticity/RightBiceps/build_debug && $(CMAKE_COMMAND) -E cmake_progress_start /store/software/opencmiss/OpenCMISS-examples/FiniteElasticity/RightBiceps/build_debug/CMakeFiles /store/software/opencmiss/OpenCMISS-examples/FiniteElasticity/RightBiceps/build_debug/Fortran/CMakeFiles/progress.marks + cd /store/software/opencmiss/OpenCMISS-examples/FiniteElasticity/RightBiceps/build_debug && $(MAKE) -f CMakeFiles/Makefile2 Fortran/all + $(CMAKE_COMMAND) -E cmake_progress_start /store/software/opencmiss/OpenCMISS-examples/FiniteElasticity/RightBiceps/build_debug/CMakeFiles 0 +.PHONY : all + +# The main clean target +clean: + cd /store/software/opencmiss/OpenCMISS-examples/FiniteElasticity/RightBiceps/build_debug && $(MAKE) -f CMakeFiles/Makefile2 Fortran/clean +.PHONY : clean + +# The main clean target +clean/fast: clean + +.PHONY : clean/fast + +# Prepare targets for installation. +preinstall: all + cd /store/software/opencmiss/OpenCMISS-examples/FiniteElasticity/RightBiceps/build_debug && $(MAKE) -f CMakeFiles/Makefile2 Fortran/preinstall +.PHONY : preinstall + +# Prepare targets for installation. +preinstall/fast: + cd /store/software/opencmiss/OpenCMISS-examples/FiniteElasticity/RightBiceps/build_debug && $(MAKE) -f CMakeFiles/Makefile2 Fortran/preinstall +.PHONY : preinstall/fast + +# clear depends +depend: + cd /store/software/opencmiss/OpenCMISS-examples/FiniteElasticity/RightBiceps/build_debug && $(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 1 +.PHONY : depend + +# Convenience name for target. +Fortran/CMakeFiles/RightBiceps.dir/rule: + cd /store/software/opencmiss/OpenCMISS-examples/FiniteElasticity/RightBiceps/build_debug && $(MAKE) -f CMakeFiles/Makefile2 Fortran/CMakeFiles/RightBiceps.dir/rule +.PHONY : Fortran/CMakeFiles/RightBiceps.dir/rule + +# Convenience name for target. +RightBiceps: Fortran/CMakeFiles/RightBiceps.dir/rule + +.PHONY : RightBiceps + +# fast build rule for target. +RightBiceps/fast: + cd /store/software/opencmiss/OpenCMISS-examples/FiniteElasticity/RightBiceps/build_debug && $(MAKE) -f Fortran/CMakeFiles/RightBiceps.dir/build.make Fortran/CMakeFiles/RightBiceps.dir/build +.PHONY : RightBiceps/fast + +src/FortranExample.o: src/FortranExample.f90.o + +.PHONY : src/FortranExample.o + +# target to build an object file +src/FortranExample.f90.o: + cd /store/software/opencmiss/OpenCMISS-examples/FiniteElasticity/RightBiceps/build_debug && $(MAKE) -f Fortran/CMakeFiles/RightBiceps.dir/build.make Fortran/CMakeFiles/RightBiceps.dir/src/FortranExample.f90.o +.PHONY : src/FortranExample.f90.o + +src/FortranExample.i: src/FortranExample.f90.i + +.PHONY : src/FortranExample.i + +# target to preprocess a source file +src/FortranExample.f90.i: + cd /store/software/opencmiss/OpenCMISS-examples/FiniteElasticity/RightBiceps/build_debug && $(MAKE) -f Fortran/CMakeFiles/RightBiceps.dir/build.make Fortran/CMakeFiles/RightBiceps.dir/src/FortranExample.f90.i +.PHONY : src/FortranExample.f90.i + +src/FortranExample.s: src/FortranExample.f90.s + +.PHONY : src/FortranExample.s + +# target to generate assembly for a file +src/FortranExample.f90.s: + cd /store/software/opencmiss/OpenCMISS-examples/FiniteElasticity/RightBiceps/build_debug && $(MAKE) -f Fortran/CMakeFiles/RightBiceps.dir/build.make Fortran/CMakeFiles/RightBiceps.dir/src/FortranExample.f90.s +.PHONY : src/FortranExample.f90.s + +# Help Target +help: + @echo "The following are some of the valid targets for this Makefile:" + @echo "... all (the default if no target is provided)" + @echo "... clean" + @echo "... depend" + @echo "... test" + @echo "... edit_cache" + @echo "... rebuild_cache" + @echo "... RightBiceps" + @echo "... src/FortranExample.o" + @echo "... src/FortranExample.i" + @echo "... src/FortranExample.s" +.PHONY : help + + + +#============================================================================= +# Special targets to cleanup operation of make. + +# Special rule to run CMake to check the build system integrity. +# No rule that depends on this can have commands that come from listfiles +# because they might be regenerated. +cmake_check_build_system: + cd /store/software/opencmiss/OpenCMISS-examples/FiniteElasticity/RightBiceps/build_debug && $(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 0 +.PHONY : cmake_check_build_system + diff --git a/FiniteElasticity/RightBiceps/build_debug/Fortran/RightBiceps b/FiniteElasticity/RightBiceps/build_debug/Fortran/RightBiceps new file mode 100755 index 00000000..bc5cb286 Binary files /dev/null and b/FiniteElasticity/RightBiceps/build_debug/Fortran/RightBiceps differ diff --git a/FiniteElasticity/RightBiceps/build_debug/Fortran/cmake_install.cmake b/FiniteElasticity/RightBiceps/build_debug/Fortran/cmake_install.cmake new file mode 100644 index 00000000..3889dd84 --- /dev/null +++ b/FiniteElasticity/RightBiceps/build_debug/Fortran/cmake_install.cmake @@ -0,0 +1,34 @@ +# Install script for directory: /store/software/opencmiss/OpenCMISS-examples/FiniteElasticity/RightBiceps/Fortran + +# Set the install prefix +if(NOT DEFINED CMAKE_INSTALL_PREFIX) + set(CMAKE_INSTALL_PREFIX "/usr/local") +endif() +string(REGEX REPLACE "/$" "" CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}") + +# Set the install configuration name. +if(NOT DEFINED CMAKE_INSTALL_CONFIG_NAME) + if(BUILD_TYPE) + string(REGEX REPLACE "^[^A-Za-z0-9_]+" "" + CMAKE_INSTALL_CONFIG_NAME "${BUILD_TYPE}") + else() + set(CMAKE_INSTALL_CONFIG_NAME "DEBUG") + endif() + message(STATUS "Install configuration: \"${CMAKE_INSTALL_CONFIG_NAME}\"") +endif() + +# Set the component getting installed. +if(NOT CMAKE_INSTALL_COMPONENT) + if(COMPONENT) + message(STATUS "Install component: \"${COMPONENT}\"") + set(CMAKE_INSTALL_COMPONENT "${COMPONENT}") + else() + set(CMAKE_INSTALL_COMPONENT) + endif() +endif() + +# Install shared libraries without execute permission? +if(NOT DEFINED CMAKE_INSTALL_SO_NO_EXE) + set(CMAKE_INSTALL_SO_NO_EXE "1") +endif() + diff --git a/FiniteElasticity/RightBiceps/build_debug/Fortran/fort.1 b/FiniteElasticity/RightBiceps/build_debug/Fortran/fort.1 new file mode 100644 index 00000000..e69de29b diff --git a/FiniteElasticity/RightBiceps/build_debug/Makefile b/FiniteElasticity/RightBiceps/build_debug/Makefile new file mode 100644 index 00000000..5648c17a --- /dev/null +++ b/FiniteElasticity/RightBiceps/build_debug/Makefile @@ -0,0 +1,160 @@ +# CMAKE generated file: DO NOT EDIT! +# Generated by "Unix Makefiles" Generator, CMake Version 3.5 + +# Default target executed when no arguments are given to make. +default_target: all + +.PHONY : default_target + +# Allow only one "make -f Makefile2" at a time, but pass parallelism. +.NOTPARALLEL: + + +#============================================================================= +# Special targets provided by cmake. + +# Disable implicit rules so canonical targets will work. +.SUFFIXES: + + +# Remove some rules from gmake that .SUFFIXES does not remove. +SUFFIXES = + +.SUFFIXES: .hpux_make_needs_suffix_list + + +# Suppress display of executed commands. +$(VERBOSE).SILENT: + + +# A target that is always out of date. +cmake_force: + +.PHONY : cmake_force + +#============================================================================= +# Set environment variables for the build. + +# The shell in which to execute make rules. +SHELL = /bin/sh + +# The CMake executable. +CMAKE_COMMAND = /usr/bin/cmake + +# The command to remove a file. +RM = /usr/bin/cmake -E remove -f + +# Escaping for special characters. +EQUALS = = + +# The top-level source directory on which CMake was run. +CMAKE_SOURCE_DIR = /store/software/opencmiss/OpenCMISS-examples/FiniteElasticity/RightBiceps + +# The top-level build directory on which CMake was run. +CMAKE_BINARY_DIR = /store/software/opencmiss/OpenCMISS-examples/FiniteElasticity/RightBiceps/build_debug + +#============================================================================= +# Targets provided globally by CMake. + +# Special rule for the target test +test: + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running tests..." + /usr/bin/ctest --force-new-ctest-process $(ARGS) +.PHONY : test + +# Special rule for the target test +test/fast: test + +.PHONY : test/fast + +# Special rule for the target rebuild_cache +rebuild_cache: + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running CMake to regenerate build system..." + /usr/bin/cmake -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) +.PHONY : rebuild_cache + +# Special rule for the target rebuild_cache +rebuild_cache/fast: rebuild_cache + +.PHONY : rebuild_cache/fast + +# Special rule for the target edit_cache +edit_cache: + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running CMake cache editor..." + /usr/bin/ccmake -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) +.PHONY : edit_cache + +# Special rule for the target edit_cache +edit_cache/fast: edit_cache + +.PHONY : edit_cache/fast + +# The main all target +all: cmake_check_build_system + $(CMAKE_COMMAND) -E cmake_progress_start /store/software/opencmiss/OpenCMISS-examples/FiniteElasticity/RightBiceps/build_debug/CMakeFiles /store/software/opencmiss/OpenCMISS-examples/FiniteElasticity/RightBiceps/build_debug/CMakeFiles/progress.marks + $(MAKE) -f CMakeFiles/Makefile2 all + $(CMAKE_COMMAND) -E cmake_progress_start /store/software/opencmiss/OpenCMISS-examples/FiniteElasticity/RightBiceps/build_debug/CMakeFiles 0 +.PHONY : all + +# The main clean target +clean: + $(MAKE) -f CMakeFiles/Makefile2 clean +.PHONY : clean + +# The main clean target +clean/fast: clean + +.PHONY : clean/fast + +# Prepare targets for installation. +preinstall: all + $(MAKE) -f CMakeFiles/Makefile2 preinstall +.PHONY : preinstall + +# Prepare targets for installation. +preinstall/fast: + $(MAKE) -f CMakeFiles/Makefile2 preinstall +.PHONY : preinstall/fast + +# clear depends +depend: + $(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 1 +.PHONY : depend + +#============================================================================= +# Target rules for targets named RightBiceps + +# Build rule for target. +RightBiceps: cmake_check_build_system + $(MAKE) -f CMakeFiles/Makefile2 RightBiceps +.PHONY : RightBiceps + +# fast build rule for target. +RightBiceps/fast: + $(MAKE) -f Fortran/CMakeFiles/RightBiceps.dir/build.make Fortran/CMakeFiles/RightBiceps.dir/build +.PHONY : RightBiceps/fast + +# Help Target +help: + @echo "The following are some of the valid targets for this Makefile:" + @echo "... all (the default if no target is provided)" + @echo "... clean" + @echo "... depend" + @echo "... test" + @echo "... rebuild_cache" + @echo "... edit_cache" + @echo "... RightBiceps" +.PHONY : help + + + +#============================================================================= +# Special targets to cleanup operation of make. + +# Special rule to run CMake to check the build system integrity. +# No rule that depends on this can have commands that come from listfiles +# because they might be regenerated. +cmake_check_build_system: + $(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 0 +.PHONY : cmake_check_build_system + diff --git a/FiniteElasticity/RightBiceps/build_debug/build.sh b/FiniteElasticity/RightBiceps/build_debug/build.sh new file mode 100644 index 00000000..e6624bac --- /dev/null +++ b/FiniteElasticity/RightBiceps/build_debug/build.sh @@ -0,0 +1,2 @@ +#ccc && cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all +cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all diff --git a/FiniteElasticity/RightBiceps/build_debug/cmake_install.cmake b/FiniteElasticity/RightBiceps/build_debug/cmake_install.cmake new file mode 100644 index 00000000..ac02b501 --- /dev/null +++ b/FiniteElasticity/RightBiceps/build_debug/cmake_install.cmake @@ -0,0 +1,50 @@ +# Install script for directory: /store/software/opencmiss/OpenCMISS-examples/FiniteElasticity/RightBiceps + +# Set the install prefix +if(NOT DEFINED CMAKE_INSTALL_PREFIX) + set(CMAKE_INSTALL_PREFIX "/usr/local") +endif() +string(REGEX REPLACE "/$" "" CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}") + +# Set the install configuration name. +if(NOT DEFINED CMAKE_INSTALL_CONFIG_NAME) + if(BUILD_TYPE) + string(REGEX REPLACE "^[^A-Za-z0-9_]+" "" + CMAKE_INSTALL_CONFIG_NAME "${BUILD_TYPE}") + else() + set(CMAKE_INSTALL_CONFIG_NAME "DEBUG") + endif() + message(STATUS "Install configuration: \"${CMAKE_INSTALL_CONFIG_NAME}\"") +endif() + +# Set the component getting installed. +if(NOT CMAKE_INSTALL_COMPONENT) + if(COMPONENT) + message(STATUS "Install component: \"${COMPONENT}\"") + set(CMAKE_INSTALL_COMPONENT "${COMPONENT}") + else() + set(CMAKE_INSTALL_COMPONENT) + endif() +endif() + +# Install shared libraries without execute permission? +if(NOT DEFINED CMAKE_INSTALL_SO_NO_EXE) + set(CMAKE_INSTALL_SO_NO_EXE "1") +endif() + +if(NOT CMAKE_INSTALL_LOCAL_ONLY) + # Include the install script for each subdirectory. + include("/store/software/opencmiss/OpenCMISS-examples/FiniteElasticity/RightBiceps/build_debug/Fortran/cmake_install.cmake") + +endif() + +if(CMAKE_INSTALL_COMPONENT) + set(CMAKE_INSTALL_MANIFEST "install_manifest_${CMAKE_INSTALL_COMPONENT}.txt") +else() + set(CMAKE_INSTALL_MANIFEST "install_manifest.txt") +endif() + +string(REPLACE ";" "\n" CMAKE_INSTALL_MANIFEST_CONTENT + "${CMAKE_INSTALL_MANIFEST_FILES}") +file(WRITE "/store/software/opencmiss/OpenCMISS-examples/FiniteElasticity/RightBiceps/build_debug/${CMAKE_INSTALL_MANIFEST}" + "${CMAKE_INSTALL_MANIFEST_CONTENT}") diff --git a/FiniteElasticity/RightBiceps/build_debug/mpi_verification/C/CMakeCache.txt b/FiniteElasticity/RightBiceps/build_debug/mpi_verification/C/CMakeCache.txt new file mode 100644 index 00000000..23c0e24d --- /dev/null +++ b/FiniteElasticity/RightBiceps/build_debug/mpi_verification/C/CMakeCache.txt @@ -0,0 +1,275 @@ +# This is the CMakeCache file. +# For build in directory: /store/software/opencmiss/OpenCMISS-examples/FiniteElasticity/RightBiceps/build_debug/mpi_verification/C +# It was generated by CMake: /usr/bin/cmake +# You can edit this file to change values found and used by cmake. +# If you do not want to change any of the values, simply exit the editor. +# If you do want to change a value, simply edit, save, and exit the editor. +# The syntax for the file is as follows: +# KEY:TYPE=VALUE +# KEY is the name of a variable in the cache. +# TYPE is a hint to GUIs for the type of VALUE, DO NOT EDIT TYPE!. +# VALUE is the current value for the KEY. + +######################## +# EXTERNAL cache entries +######################## + +//Path to a program. +CMAKE_AR:FILEPATH=/usr/bin/ar + +//Choose the type of build, options are: None(CMAKE_CXX_FLAGS or +// CMAKE_C_FLAGS used) Debug Release RelWithDebInfo MinSizeRel. +CMAKE_BUILD_TYPE:STRING= + +//Enable/Disable color output during build. +CMAKE_COLOR_MAKEFILE:BOOL=ON + +//No help, variable specified on the command line. +CMAKE_C_COMPILER:UNINITIALIZED=/usr/bin/mpicc + +//Flags used by the compiler during all build types. +CMAKE_C_FLAGS:STRING= + +//Flags used by the compiler during debug builds. +CMAKE_C_FLAGS_DEBUG:STRING=-g + +//Flags used by the compiler during release builds for minimum +// size. +CMAKE_C_FLAGS_MINSIZEREL:STRING=-Os -DNDEBUG + +//Flags used by the compiler during release builds. +CMAKE_C_FLAGS_RELEASE:STRING=-O3 -DNDEBUG + +//Flags used by the compiler during release builds with debug info. +CMAKE_C_FLAGS_RELWITHDEBINFO:STRING=-O2 -g -DNDEBUG + +//Flags used by the linker. +CMAKE_EXE_LINKER_FLAGS:STRING= + +//Flags used by the linker during debug builds. +CMAKE_EXE_LINKER_FLAGS_DEBUG:STRING= + +//Flags used by the linker during release minsize builds. +CMAKE_EXE_LINKER_FLAGS_MINSIZEREL:STRING= + +//Flags used by the linker during release builds. +CMAKE_EXE_LINKER_FLAGS_RELEASE:STRING= + +//Flags used by the linker during Release with Debug Info builds. +CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO:STRING= + +//Enable/Disable output of compile commands during generation. +CMAKE_EXPORT_COMPILE_COMMANDS:BOOL=OFF + +//Install path prefix, prepended onto install directories. +CMAKE_INSTALL_PREFIX:PATH=/usr/local + +//Path to a program. +CMAKE_LINKER:FILEPATH=/usr/bin/ld + +//Path to a program. +CMAKE_MAKE_PROGRAM:FILEPATH=/usr/bin/make + +//Flags used by the linker during the creation of modules. +CMAKE_MODULE_LINKER_FLAGS:STRING= + +//Flags used by the linker during debug builds. +CMAKE_MODULE_LINKER_FLAGS_DEBUG:STRING= + +//Flags used by the linker during release minsize builds. +CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL:STRING= + +//Flags used by the linker during release builds. +CMAKE_MODULE_LINKER_FLAGS_RELEASE:STRING= + +//Flags used by the linker during Release with Debug Info builds. +CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO:STRING= + +//Path to a program. +CMAKE_NM:FILEPATH=/usr/bin/nm + +//Path to a program. +CMAKE_OBJCOPY:FILEPATH=/usr/bin/objcopy + +//Path to a program. +CMAKE_OBJDUMP:FILEPATH=/usr/bin/objdump + +//Value Computed by CMake +CMAKE_PROJECT_NAME:STATIC=verify_mpi_compat + +//Path to a program. +CMAKE_RANLIB:FILEPATH=/usr/bin/ranlib + +//Flags used by the linker during the creation of dll's. +CMAKE_SHARED_LINKER_FLAGS:STRING= + +//Flags used by the linker during debug builds. +CMAKE_SHARED_LINKER_FLAGS_DEBUG:STRING= + +//Flags used by the linker during release minsize builds. +CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL:STRING= + +//Flags used by the linker during release builds. +CMAKE_SHARED_LINKER_FLAGS_RELEASE:STRING= + +//Flags used by the linker during Release with Debug Info builds. +CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO:STRING= + +//If set, runtime paths are not added when installing shared libraries, +// but are added when building. +CMAKE_SKIP_INSTALL_RPATH:BOOL=NO + +//If set, runtime paths are not added when using shared libraries. +CMAKE_SKIP_RPATH:BOOL=NO + +//Flags used by the linker during the creation of static libraries. +CMAKE_STATIC_LINKER_FLAGS:STRING= + +//Flags used by the linker during debug builds. +CMAKE_STATIC_LINKER_FLAGS_DEBUG:STRING= + +//Flags used by the linker during release minsize builds. +CMAKE_STATIC_LINKER_FLAGS_MINSIZEREL:STRING= + +//Flags used by the linker during release builds. +CMAKE_STATIC_LINKER_FLAGS_RELEASE:STRING= + +//Flags used by the linker during Release with Debug Info builds. +CMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO:STRING= + +//Path to a program. +CMAKE_STRIP:FILEPATH=/usr/bin/strip + +//If this value is on, makefiles will be generated without the +// .SILENT directive, and all commands will be echoed to the console +// during the make. This is useful for debugging only. With Visual +// Studio IDE projects all commands are done without /nologo. +CMAKE_VERBOSE_MAKEFILE:BOOL=FALSE + +//Value Computed by CMake +verify_mpi_compat_BINARY_DIR:STATIC=/store/software/opencmiss/OpenCMISS-examples/FiniteElasticity/RightBiceps/build_debug/mpi_verification/C + +//Value Computed by CMake +verify_mpi_compat_SOURCE_DIR:STATIC=/store/software/opencmiss/OpenCMISS-examples/FiniteElasticity/RightBiceps/build_debug/mpi_verification/C + + +######################## +# INTERNAL cache entries +######################## + +//ADVANCED property for variable: CMAKE_AR +CMAKE_AR-ADVANCED:INTERNAL=1 +//This is the directory where this CMakeCache.txt was created +CMAKE_CACHEFILE_DIR:INTERNAL=/store/software/opencmiss/OpenCMISS-examples/FiniteElasticity/RightBiceps/build_debug/mpi_verification/C +//Major version of cmake used to create the current loaded cache +CMAKE_CACHE_MAJOR_VERSION:INTERNAL=3 +//Minor version of cmake used to create the current loaded cache +CMAKE_CACHE_MINOR_VERSION:INTERNAL=5 +//Patch version of cmake used to create the current loaded cache +CMAKE_CACHE_PATCH_VERSION:INTERNAL=1 +//ADVANCED property for variable: CMAKE_COLOR_MAKEFILE +CMAKE_COLOR_MAKEFILE-ADVANCED:INTERNAL=1 +//Path to CMake executable. +CMAKE_COMMAND:INTERNAL=/usr/bin/cmake +//Path to cpack program executable. +CMAKE_CPACK_COMMAND:INTERNAL=/usr/bin/cpack +//Path to ctest program executable. +CMAKE_CTEST_COMMAND:INTERNAL=/usr/bin/ctest +//ADVANCED property for variable: CMAKE_C_COMPILER +CMAKE_C_COMPILER-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_C_FLAGS +CMAKE_C_FLAGS-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_C_FLAGS_DEBUG +CMAKE_C_FLAGS_DEBUG-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_C_FLAGS_MINSIZEREL +CMAKE_C_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_C_FLAGS_RELEASE +CMAKE_C_FLAGS_RELEASE-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_C_FLAGS_RELWITHDEBINFO +CMAKE_C_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 +//Path to cache edit program executable. +CMAKE_EDIT_COMMAND:INTERNAL=/usr/bin/ccmake +//Executable file format +CMAKE_EXECUTABLE_FORMAT:INTERNAL=ELF +//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS +CMAKE_EXE_LINKER_FLAGS-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_DEBUG +CMAKE_EXE_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_MINSIZEREL +CMAKE_EXE_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_RELEASE +CMAKE_EXE_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO +CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_EXPORT_COMPILE_COMMANDS +CMAKE_EXPORT_COMPILE_COMMANDS-ADVANCED:INTERNAL=1 +//Name of external makefile project generator. +CMAKE_EXTRA_GENERATOR:INTERNAL= +//Name of generator. +CMAKE_GENERATOR:INTERNAL=Unix Makefiles +//Name of generator platform. +CMAKE_GENERATOR_PLATFORM:INTERNAL= +//Name of generator toolset. +CMAKE_GENERATOR_TOOLSET:INTERNAL= +//Source directory with the top level CMakeLists.txt file for this +// project +CMAKE_HOME_DIRECTORY:INTERNAL=/store/software/opencmiss/OpenCMISS-examples/FiniteElasticity/RightBiceps/build_debug/mpi_verification/C +//Install .so files without execute permission. +CMAKE_INSTALL_SO_NO_EXE:INTERNAL=1 +//ADVANCED property for variable: CMAKE_LINKER +CMAKE_LINKER-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_MAKE_PROGRAM +CMAKE_MAKE_PROGRAM-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS +CMAKE_MODULE_LINKER_FLAGS-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS_DEBUG +CMAKE_MODULE_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL +CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS_RELEASE +CMAKE_MODULE_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO +CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_NM +CMAKE_NM-ADVANCED:INTERNAL=1 +//number of local generators +CMAKE_NUMBER_OF_MAKEFILES:INTERNAL=1 +//ADVANCED property for variable: CMAKE_OBJCOPY +CMAKE_OBJCOPY-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_OBJDUMP +CMAKE_OBJDUMP-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_RANLIB +CMAKE_RANLIB-ADVANCED:INTERNAL=1 +//Path to CMake installation. +CMAKE_ROOT:INTERNAL=/usr/share/cmake-3.5 +//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS +CMAKE_SHARED_LINKER_FLAGS-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_DEBUG +CMAKE_SHARED_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL +CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_RELEASE +CMAKE_SHARED_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO +CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_SKIP_INSTALL_RPATH +CMAKE_SKIP_INSTALL_RPATH-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_SKIP_RPATH +CMAKE_SKIP_RPATH-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS +CMAKE_STATIC_LINKER_FLAGS-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS_DEBUG +CMAKE_STATIC_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS_MINSIZEREL +CMAKE_STATIC_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS_RELEASE +CMAKE_STATIC_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO +CMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_STRIP +CMAKE_STRIP-ADVANCED:INTERNAL=1 +//uname command +CMAKE_UNAME:INTERNAL=/bin/uname +//ADVANCED property for variable: CMAKE_VERBOSE_MAKEFILE +CMAKE_VERBOSE_MAKEFILE-ADVANCED:INTERNAL=1 + diff --git a/FiniteElasticity/RightBiceps/build_debug/mpi_verification/C/CMakeFiles/3.5.1/CMakeCCompiler.cmake b/FiniteElasticity/RightBiceps/build_debug/mpi_verification/C/CMakeFiles/3.5.1/CMakeCCompiler.cmake new file mode 100644 index 00000000..6d451c8a --- /dev/null +++ b/FiniteElasticity/RightBiceps/build_debug/mpi_verification/C/CMakeFiles/3.5.1/CMakeCCompiler.cmake @@ -0,0 +1,67 @@ +set(CMAKE_C_COMPILER "/usr/bin/mpicc") +set(CMAKE_C_COMPILER_ARG1 "") +set(CMAKE_C_COMPILER_ID "GNU") +set(CMAKE_C_COMPILER_VERSION "5.4.0") +set(CMAKE_C_COMPILER_WRAPPER "") +set(CMAKE_C_STANDARD_COMPUTED_DEFAULT "11") +set(CMAKE_C_COMPILE_FEATURES "c_function_prototypes;c_restrict;c_variadic_macros;c_static_assert") +set(CMAKE_C90_COMPILE_FEATURES "c_function_prototypes") +set(CMAKE_C99_COMPILE_FEATURES "c_restrict;c_variadic_macros") +set(CMAKE_C11_COMPILE_FEATURES "c_static_assert") + +set(CMAKE_C_PLATFORM_ID "Linux") +set(CMAKE_C_SIMULATE_ID "") +set(CMAKE_C_SIMULATE_VERSION "") + +set(CMAKE_AR "/usr/bin/ar") +set(CMAKE_RANLIB "/usr/bin/ranlib") +set(CMAKE_LINKER "/usr/bin/ld") +set(CMAKE_COMPILER_IS_GNUCC 1) +set(CMAKE_C_COMPILER_LOADED 1) +set(CMAKE_C_COMPILER_WORKS TRUE) +set(CMAKE_C_ABI_COMPILED TRUE) +set(CMAKE_COMPILER_IS_MINGW ) +set(CMAKE_COMPILER_IS_CYGWIN ) +if(CMAKE_COMPILER_IS_CYGWIN) + set(CYGWIN 1) + set(UNIX 1) +endif() + +set(CMAKE_C_COMPILER_ENV_VAR "CC") + +if(CMAKE_COMPILER_IS_MINGW) + set(MINGW 1) +endif() +set(CMAKE_C_COMPILER_ID_RUN 1) +set(CMAKE_C_SOURCE_FILE_EXTENSIONS c;m) +set(CMAKE_C_IGNORE_EXTENSIONS h;H;o;O;obj;OBJ;def;DEF;rc;RC) +set(CMAKE_C_LINKER_PREFERENCE 10) + +# Save compiler ABI information. +set(CMAKE_C_SIZEOF_DATA_PTR "8") +set(CMAKE_C_COMPILER_ABI "ELF") +set(CMAKE_C_LIBRARY_ARCHITECTURE "x86_64-linux-gnu") + +if(CMAKE_C_SIZEOF_DATA_PTR) + set(CMAKE_SIZEOF_VOID_P "${CMAKE_C_SIZEOF_DATA_PTR}") +endif() + +if(CMAKE_C_COMPILER_ABI) + set(CMAKE_INTERNAL_PLATFORM_ABI "${CMAKE_C_COMPILER_ABI}") +endif() + +if(CMAKE_C_LIBRARY_ARCHITECTURE) + set(CMAKE_LIBRARY_ARCHITECTURE "x86_64-linux-gnu") +endif() + +set(CMAKE_C_CL_SHOWINCLUDES_PREFIX "") +if(CMAKE_C_CL_SHOWINCLUDES_PREFIX) + set(CMAKE_CL_SHOWINCLUDES_PREFIX "${CMAKE_C_CL_SHOWINCLUDES_PREFIX}") +endif() + + + + +set(CMAKE_C_IMPLICIT_LINK_LIBRARIES "mpi;pthread;c") +set(CMAKE_C_IMPLICIT_LINK_DIRECTORIES "/usr/lib/openmpi/lib;/usr/lib/gcc/x86_64-linux-gnu/5;/usr/lib/x86_64-linux-gnu;/usr/lib;/lib/x86_64-linux-gnu;/lib") +set(CMAKE_C_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES "") diff --git a/FiniteElasticity/RightBiceps/build_debug/mpi_verification/C/CMakeFiles/3.5.1/CMakeDetermineCompilerABI_C.bin b/FiniteElasticity/RightBiceps/build_debug/mpi_verification/C/CMakeFiles/3.5.1/CMakeDetermineCompilerABI_C.bin new file mode 100755 index 00000000..76e2de79 Binary files /dev/null and b/FiniteElasticity/RightBiceps/build_debug/mpi_verification/C/CMakeFiles/3.5.1/CMakeDetermineCompilerABI_C.bin differ diff --git a/FiniteElasticity/RightBiceps/build_debug/mpi_verification/C/CMakeFiles/3.5.1/CMakeSystem.cmake b/FiniteElasticity/RightBiceps/build_debug/mpi_verification/C/CMakeFiles/3.5.1/CMakeSystem.cmake new file mode 100644 index 00000000..84375768 --- /dev/null +++ b/FiniteElasticity/RightBiceps/build_debug/mpi_verification/C/CMakeFiles/3.5.1/CMakeSystem.cmake @@ -0,0 +1,15 @@ +set(CMAKE_HOST_SYSTEM "Linux-4.4.0-104-generic") +set(CMAKE_HOST_SYSTEM_NAME "Linux") +set(CMAKE_HOST_SYSTEM_VERSION "4.4.0-104-generic") +set(CMAKE_HOST_SYSTEM_PROCESSOR "x86_64") + + + +set(CMAKE_SYSTEM "Linux-4.4.0-104-generic") +set(CMAKE_SYSTEM_NAME "Linux") +set(CMAKE_SYSTEM_VERSION "4.4.0-104-generic") +set(CMAKE_SYSTEM_PROCESSOR "x86_64") + +set(CMAKE_CROSSCOMPILING "FALSE") + +set(CMAKE_SYSTEM_LOADED 1) diff --git a/FiniteElasticity/RightBiceps/build_debug/mpi_verification/C/CMakeFiles/3.5.1/CompilerIdC/CMakeCCompilerId.c b/FiniteElasticity/RightBiceps/build_debug/mpi_verification/C/CMakeFiles/3.5.1/CompilerIdC/CMakeCCompilerId.c new file mode 100644 index 00000000..570a15e9 --- /dev/null +++ b/FiniteElasticity/RightBiceps/build_debug/mpi_verification/C/CMakeFiles/3.5.1/CompilerIdC/CMakeCCompilerId.c @@ -0,0 +1,544 @@ +#ifdef __cplusplus +# error "A C++ compiler has been selected for C." +#endif + +#if defined(__18CXX) +# define ID_VOID_MAIN +#endif + + +/* Version number components: V=Version, R=Revision, P=Patch + Version date components: YYYY=Year, MM=Month, DD=Day */ + +#if defined(__INTEL_COMPILER) || defined(__ICC) +# define COMPILER_ID "Intel" +# if defined(_MSC_VER) +# define SIMULATE_ID "MSVC" +# endif + /* __INTEL_COMPILER = VRP */ +# define COMPILER_VERSION_MAJOR DEC(__INTEL_COMPILER/100) +# define COMPILER_VERSION_MINOR DEC(__INTEL_COMPILER/10 % 10) +# if defined(__INTEL_COMPILER_UPDATE) +# define COMPILER_VERSION_PATCH DEC(__INTEL_COMPILER_UPDATE) +# else +# define COMPILER_VERSION_PATCH DEC(__INTEL_COMPILER % 10) +# endif +# if defined(__INTEL_COMPILER_BUILD_DATE) + /* __INTEL_COMPILER_BUILD_DATE = YYYYMMDD */ +# define COMPILER_VERSION_TWEAK DEC(__INTEL_COMPILER_BUILD_DATE) +# endif +# if defined(_MSC_VER) + /* _MSC_VER = VVRR */ +# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100) +# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100) +# endif + +#elif defined(__PATHCC__) +# define COMPILER_ID "PathScale" +# define COMPILER_VERSION_MAJOR DEC(__PATHCC__) +# define COMPILER_VERSION_MINOR DEC(__PATHCC_MINOR__) +# if defined(__PATHCC_PATCHLEVEL__) +# define COMPILER_VERSION_PATCH DEC(__PATHCC_PATCHLEVEL__) +# endif + +#elif defined(__BORLANDC__) && defined(__CODEGEARC_VERSION__) +# define COMPILER_ID "Embarcadero" +# define COMPILER_VERSION_MAJOR HEX(__CODEGEARC_VERSION__>>24 & 0x00FF) +# define COMPILER_VERSION_MINOR HEX(__CODEGEARC_VERSION__>>16 & 0x00FF) +# define COMPILER_VERSION_PATCH DEC(__CODEGEARC_VERSION__ & 0xFFFF) + +#elif defined(__BORLANDC__) +# define COMPILER_ID "Borland" + /* __BORLANDC__ = 0xVRR */ +# define COMPILER_VERSION_MAJOR HEX(__BORLANDC__>>8) +# define COMPILER_VERSION_MINOR HEX(__BORLANDC__ & 0xFF) + +#elif defined(__WATCOMC__) && __WATCOMC__ < 1200 +# define COMPILER_ID "Watcom" + /* __WATCOMC__ = VVRR */ +# define COMPILER_VERSION_MAJOR DEC(__WATCOMC__ / 100) +# define COMPILER_VERSION_MINOR DEC((__WATCOMC__ / 10) % 10) +# if (__WATCOMC__ % 10) > 0 +# define COMPILER_VERSION_PATCH DEC(__WATCOMC__ % 10) +# endif + +#elif defined(__WATCOMC__) +# define COMPILER_ID "OpenWatcom" + /* __WATCOMC__ = VVRP + 1100 */ +# define COMPILER_VERSION_MAJOR DEC((__WATCOMC__ - 1100) / 100) +# define COMPILER_VERSION_MINOR DEC((__WATCOMC__ / 10) % 10) +# if (__WATCOMC__ % 10) > 0 +# define COMPILER_VERSION_PATCH DEC(__WATCOMC__ % 10) +# endif + +#elif defined(__SUNPRO_C) +# define COMPILER_ID "SunPro" +# if __SUNPRO_C >= 0x5100 + /* __SUNPRO_C = 0xVRRP */ +# define COMPILER_VERSION_MAJOR HEX(__SUNPRO_C>>12) +# define COMPILER_VERSION_MINOR HEX(__SUNPRO_C>>4 & 0xFF) +# define COMPILER_VERSION_PATCH HEX(__SUNPRO_C & 0xF) +# else + /* __SUNPRO_CC = 0xVRP */ +# define COMPILER_VERSION_MAJOR HEX(__SUNPRO_C>>8) +# define COMPILER_VERSION_MINOR HEX(__SUNPRO_C>>4 & 0xF) +# define COMPILER_VERSION_PATCH HEX(__SUNPRO_C & 0xF) +# endif + +#elif defined(__HP_cc) +# define COMPILER_ID "HP" + /* __HP_cc = VVRRPP */ +# define COMPILER_VERSION_MAJOR DEC(__HP_cc/10000) +# define COMPILER_VERSION_MINOR DEC(__HP_cc/100 % 100) +# define COMPILER_VERSION_PATCH DEC(__HP_cc % 100) + +#elif defined(__DECC) +# define COMPILER_ID "Compaq" + /* __DECC_VER = VVRRTPPPP */ +# define COMPILER_VERSION_MAJOR DEC(__DECC_VER/10000000) +# define COMPILER_VERSION_MINOR DEC(__DECC_VER/100000 % 100) +# define COMPILER_VERSION_PATCH DEC(__DECC_VER % 10000) + +#elif defined(__IBMC__) && defined(__COMPILER_VER__) +# define COMPILER_ID "zOS" + /* __IBMC__ = VRP */ +# define COMPILER_VERSION_MAJOR DEC(__IBMC__/100) +# define COMPILER_VERSION_MINOR DEC(__IBMC__/10 % 10) +# define COMPILER_VERSION_PATCH DEC(__IBMC__ % 10) + +#elif defined(__IBMC__) && !defined(__COMPILER_VER__) && __IBMC__ >= 800 +# define COMPILER_ID "XL" + /* __IBMC__ = VRP */ +# define COMPILER_VERSION_MAJOR DEC(__IBMC__/100) +# define COMPILER_VERSION_MINOR DEC(__IBMC__/10 % 10) +# define COMPILER_VERSION_PATCH DEC(__IBMC__ % 10) + +#elif defined(__IBMC__) && !defined(__COMPILER_VER__) && __IBMC__ < 800 +# define COMPILER_ID "VisualAge" + /* __IBMC__ = VRP */ +# define COMPILER_VERSION_MAJOR DEC(__IBMC__/100) +# define COMPILER_VERSION_MINOR DEC(__IBMC__/10 % 10) +# define COMPILER_VERSION_PATCH DEC(__IBMC__ % 10) + +#elif defined(__PGI) +# define COMPILER_ID "PGI" +# define COMPILER_VERSION_MAJOR DEC(__PGIC__) +# define COMPILER_VERSION_MINOR DEC(__PGIC_MINOR__) +# if defined(__PGIC_PATCHLEVEL__) +# define COMPILER_VERSION_PATCH DEC(__PGIC_PATCHLEVEL__) +# endif + +#elif defined(_CRAYC) +# define COMPILER_ID "Cray" +# define COMPILER_VERSION_MAJOR DEC(_RELEASE_MAJOR) +# define COMPILER_VERSION_MINOR DEC(_RELEASE_MINOR) + +#elif defined(__TI_COMPILER_VERSION__) +# define COMPILER_ID "TI" + /* __TI_COMPILER_VERSION__ = VVVRRRPPP */ +# define COMPILER_VERSION_MAJOR DEC(__TI_COMPILER_VERSION__/1000000) +# define COMPILER_VERSION_MINOR DEC(__TI_COMPILER_VERSION__/1000 % 1000) +# define COMPILER_VERSION_PATCH DEC(__TI_COMPILER_VERSION__ % 1000) + +#elif defined(__FUJITSU) || defined(__FCC_VERSION) || defined(__fcc_version) +# define COMPILER_ID "Fujitsu" + +#elif defined(__TINYC__) +# define COMPILER_ID "TinyCC" + +#elif defined(__SCO_VERSION__) +# define COMPILER_ID "SCO" + +#elif defined(__clang__) && defined(__apple_build_version__) +# define COMPILER_ID "AppleClang" +# if defined(_MSC_VER) +# define SIMULATE_ID "MSVC" +# endif +# define COMPILER_VERSION_MAJOR DEC(__clang_major__) +# define COMPILER_VERSION_MINOR DEC(__clang_minor__) +# define COMPILER_VERSION_PATCH DEC(__clang_patchlevel__) +# if defined(_MSC_VER) + /* _MSC_VER = VVRR */ +# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100) +# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100) +# endif +# define COMPILER_VERSION_TWEAK DEC(__apple_build_version__) + +#elif defined(__clang__) +# define COMPILER_ID "Clang" +# if defined(_MSC_VER) +# define SIMULATE_ID "MSVC" +# endif +# define COMPILER_VERSION_MAJOR DEC(__clang_major__) +# define COMPILER_VERSION_MINOR DEC(__clang_minor__) +# define COMPILER_VERSION_PATCH DEC(__clang_patchlevel__) +# if defined(_MSC_VER) + /* _MSC_VER = VVRR */ +# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100) +# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100) +# endif + +#elif defined(__GNUC__) +# define COMPILER_ID "GNU" +# define COMPILER_VERSION_MAJOR DEC(__GNUC__) +# if defined(__GNUC_MINOR__) +# define COMPILER_VERSION_MINOR DEC(__GNUC_MINOR__) +# endif +# if defined(__GNUC_PATCHLEVEL__) +# define COMPILER_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__) +# endif + +#elif defined(_MSC_VER) +# define COMPILER_ID "MSVC" + /* _MSC_VER = VVRR */ +# define COMPILER_VERSION_MAJOR DEC(_MSC_VER / 100) +# define COMPILER_VERSION_MINOR DEC(_MSC_VER % 100) +# if defined(_MSC_FULL_VER) +# if _MSC_VER >= 1400 + /* _MSC_FULL_VER = VVRRPPPPP */ +# define COMPILER_VERSION_PATCH DEC(_MSC_FULL_VER % 100000) +# else + /* _MSC_FULL_VER = VVRRPPPP */ +# define COMPILER_VERSION_PATCH DEC(_MSC_FULL_VER % 10000) +# endif +# endif +# if defined(_MSC_BUILD) +# define COMPILER_VERSION_TWEAK DEC(_MSC_BUILD) +# endif + +#elif defined(__VISUALDSPVERSION__) || defined(__ADSPBLACKFIN__) || defined(__ADSPTS__) || defined(__ADSP21000__) +# define COMPILER_ID "ADSP" +#if defined(__VISUALDSPVERSION__) + /* __VISUALDSPVERSION__ = 0xVVRRPP00 */ +# define COMPILER_VERSION_MAJOR HEX(__VISUALDSPVERSION__>>24) +# define COMPILER_VERSION_MINOR HEX(__VISUALDSPVERSION__>>16 & 0xFF) +# define COMPILER_VERSION_PATCH HEX(__VISUALDSPVERSION__>>8 & 0xFF) +#endif + +#elif defined(__IAR_SYSTEMS_ICC__ ) || defined(__IAR_SYSTEMS_ICC) +# define COMPILER_ID "IAR" + +#elif defined(__ARMCC_VERSION) +# define COMPILER_ID "ARMCC" +#if __ARMCC_VERSION >= 1000000 + /* __ARMCC_VERSION = VRRPPPP */ + # define COMPILER_VERSION_MAJOR DEC(__ARMCC_VERSION/1000000) + # define COMPILER_VERSION_MINOR DEC(__ARMCC_VERSION/10000 % 100) + # define COMPILER_VERSION_PATCH DEC(__ARMCC_VERSION % 10000) +#else + /* __ARMCC_VERSION = VRPPPP */ + # define COMPILER_VERSION_MAJOR DEC(__ARMCC_VERSION/100000) + # define COMPILER_VERSION_MINOR DEC(__ARMCC_VERSION/10000 % 10) + # define COMPILER_VERSION_PATCH DEC(__ARMCC_VERSION % 10000) +#endif + + +#elif defined(SDCC) +# define COMPILER_ID "SDCC" + /* SDCC = VRP */ +# define COMPILER_VERSION_MAJOR DEC(SDCC/100) +# define COMPILER_VERSION_MINOR DEC(SDCC/10 % 10) +# define COMPILER_VERSION_PATCH DEC(SDCC % 10) + +#elif defined(_SGI_COMPILER_VERSION) || defined(_COMPILER_VERSION) +# define COMPILER_ID "MIPSpro" +# if defined(_SGI_COMPILER_VERSION) + /* _SGI_COMPILER_VERSION = VRP */ +# define COMPILER_VERSION_MAJOR DEC(_SGI_COMPILER_VERSION/100) +# define COMPILER_VERSION_MINOR DEC(_SGI_COMPILER_VERSION/10 % 10) +# define COMPILER_VERSION_PATCH DEC(_SGI_COMPILER_VERSION % 10) +# else + /* _COMPILER_VERSION = VRP */ +# define COMPILER_VERSION_MAJOR DEC(_COMPILER_VERSION/100) +# define COMPILER_VERSION_MINOR DEC(_COMPILER_VERSION/10 % 10) +# define COMPILER_VERSION_PATCH DEC(_COMPILER_VERSION % 10) +# endif + + +/* These compilers are either not known or too old to define an + identification macro. Try to identify the platform and guess that + it is the native compiler. */ +#elif defined(__sgi) +# define COMPILER_ID "MIPSpro" + +#elif defined(__hpux) || defined(__hpua) +# define COMPILER_ID "HP" + +#else /* unknown compiler */ +# define COMPILER_ID "" +#endif + +/* Construct the string literal in pieces to prevent the source from + getting matched. Store it in a pointer rather than an array + because some compilers will just produce instructions to fill the + array rather than assigning a pointer to a static array. */ +char const* info_compiler = "INFO" ":" "compiler[" COMPILER_ID "]"; +#ifdef SIMULATE_ID +char const* info_simulate = "INFO" ":" "simulate[" SIMULATE_ID "]"; +#endif + +#ifdef __QNXNTO__ +char const* qnxnto = "INFO" ":" "qnxnto[]"; +#endif + +#if defined(__CRAYXE) || defined(__CRAYXC) +char const *info_cray = "INFO" ":" "compiler_wrapper[CrayPrgEnv]"; +#endif + +#define STRINGIFY_HELPER(X) #X +#define STRINGIFY(X) STRINGIFY_HELPER(X) + +/* Identify known platforms by name. */ +#if defined(__linux) || defined(__linux__) || defined(linux) +# define PLATFORM_ID "Linux" + +#elif defined(__CYGWIN__) +# define PLATFORM_ID "Cygwin" + +#elif defined(__MINGW32__) +# define PLATFORM_ID "MinGW" + +#elif defined(__APPLE__) +# define PLATFORM_ID "Darwin" + +#elif defined(_WIN32) || defined(__WIN32__) || defined(WIN32) +# define PLATFORM_ID "Windows" + +#elif defined(__FreeBSD__) || defined(__FreeBSD) +# define PLATFORM_ID "FreeBSD" + +#elif defined(__NetBSD__) || defined(__NetBSD) +# define PLATFORM_ID "NetBSD" + +#elif defined(__OpenBSD__) || defined(__OPENBSD) +# define PLATFORM_ID "OpenBSD" + +#elif defined(__sun) || defined(sun) +# define PLATFORM_ID "SunOS" + +#elif defined(_AIX) || defined(__AIX) || defined(__AIX__) || defined(__aix) || defined(__aix__) +# define PLATFORM_ID "AIX" + +#elif defined(__sgi) || defined(__sgi__) || defined(_SGI) +# define PLATFORM_ID "IRIX" + +#elif defined(__hpux) || defined(__hpux__) +# define PLATFORM_ID "HP-UX" + +#elif defined(__HAIKU__) +# define PLATFORM_ID "Haiku" + +#elif defined(__BeOS) || defined(__BEOS__) || defined(_BEOS) +# define PLATFORM_ID "BeOS" + +#elif defined(__QNX__) || defined(__QNXNTO__) +# define PLATFORM_ID "QNX" + +#elif defined(__tru64) || defined(_tru64) || defined(__TRU64__) +# define PLATFORM_ID "Tru64" + +#elif defined(__riscos) || defined(__riscos__) +# define PLATFORM_ID "RISCos" + +#elif defined(__sinix) || defined(__sinix__) || defined(__SINIX__) +# define PLATFORM_ID "SINIX" + +#elif defined(__UNIX_SV__) +# define PLATFORM_ID "UNIX_SV" + +#elif defined(__bsdos__) +# define PLATFORM_ID "BSDOS" + +#elif defined(_MPRAS) || defined(MPRAS) +# define PLATFORM_ID "MP-RAS" + +#elif defined(__osf) || defined(__osf__) +# define PLATFORM_ID "OSF1" + +#elif defined(_SCO_SV) || defined(SCO_SV) || defined(sco_sv) +# define PLATFORM_ID "SCO_SV" + +#elif defined(__ultrix) || defined(__ultrix__) || defined(_ULTRIX) +# define PLATFORM_ID "ULTRIX" + +#elif defined(__XENIX__) || defined(_XENIX) || defined(XENIX) +# define PLATFORM_ID "Xenix" + +#elif defined(__WATCOMC__) +# if defined(__LINUX__) +# define PLATFORM_ID "Linux" + +# elif defined(__DOS__) +# define PLATFORM_ID "DOS" + +# elif defined(__OS2__) +# define PLATFORM_ID "OS2" + +# elif defined(__WINDOWS__) +# define PLATFORM_ID "Windows3x" + +# else /* unknown platform */ +# define PLATFORM_ID "" +# endif + +#else /* unknown platform */ +# define PLATFORM_ID "" + +#endif + +/* For windows compilers MSVC and Intel we can determine + the architecture of the compiler being used. This is because + the compilers do not have flags that can change the architecture, + but rather depend on which compiler is being used +*/ +#if defined(_WIN32) && defined(_MSC_VER) +# if defined(_M_IA64) +# define ARCHITECTURE_ID "IA64" + +# elif defined(_M_X64) || defined(_M_AMD64) +# define ARCHITECTURE_ID "x64" + +# elif defined(_M_IX86) +# define ARCHITECTURE_ID "X86" + +# elif defined(_M_ARM) +# if _M_ARM == 4 +# define ARCHITECTURE_ID "ARMV4I" +# elif _M_ARM == 5 +# define ARCHITECTURE_ID "ARMV5I" +# else +# define ARCHITECTURE_ID "ARMV" STRINGIFY(_M_ARM) +# endif + +# elif defined(_M_MIPS) +# define ARCHITECTURE_ID "MIPS" + +# elif defined(_M_SH) +# define ARCHITECTURE_ID "SHx" + +# else /* unknown architecture */ +# define ARCHITECTURE_ID "" +# endif + +#elif defined(__WATCOMC__) +# if defined(_M_I86) +# define ARCHITECTURE_ID "I86" + +# elif defined(_M_IX86) +# define ARCHITECTURE_ID "X86" + +# else /* unknown architecture */ +# define ARCHITECTURE_ID "" +# endif + +#else +# define ARCHITECTURE_ID "" +#endif + +/* Convert integer to decimal digit literals. */ +#define DEC(n) \ + ('0' + (((n) / 10000000)%10)), \ + ('0' + (((n) / 1000000)%10)), \ + ('0' + (((n) / 100000)%10)), \ + ('0' + (((n) / 10000)%10)), \ + ('0' + (((n) / 1000)%10)), \ + ('0' + (((n) / 100)%10)), \ + ('0' + (((n) / 10)%10)), \ + ('0' + ((n) % 10)) + +/* Convert integer to hex digit literals. */ +#define HEX(n) \ + ('0' + ((n)>>28 & 0xF)), \ + ('0' + ((n)>>24 & 0xF)), \ + ('0' + ((n)>>20 & 0xF)), \ + ('0' + ((n)>>16 & 0xF)), \ + ('0' + ((n)>>12 & 0xF)), \ + ('0' + ((n)>>8 & 0xF)), \ + ('0' + ((n)>>4 & 0xF)), \ + ('0' + ((n) & 0xF)) + +/* Construct a string literal encoding the version number components. */ +#ifdef COMPILER_VERSION_MAJOR +char const info_version[] = { + 'I', 'N', 'F', 'O', ':', + 'c','o','m','p','i','l','e','r','_','v','e','r','s','i','o','n','[', + COMPILER_VERSION_MAJOR, +# ifdef COMPILER_VERSION_MINOR + '.', COMPILER_VERSION_MINOR, +# ifdef COMPILER_VERSION_PATCH + '.', COMPILER_VERSION_PATCH, +# ifdef COMPILER_VERSION_TWEAK + '.', COMPILER_VERSION_TWEAK, +# endif +# endif +# endif + ']','\0'}; +#endif + +/* Construct a string literal encoding the version number components. */ +#ifdef SIMULATE_VERSION_MAJOR +char const info_simulate_version[] = { + 'I', 'N', 'F', 'O', ':', + 's','i','m','u','l','a','t','e','_','v','e','r','s','i','o','n','[', + SIMULATE_VERSION_MAJOR, +# ifdef SIMULATE_VERSION_MINOR + '.', SIMULATE_VERSION_MINOR, +# ifdef SIMULATE_VERSION_PATCH + '.', SIMULATE_VERSION_PATCH, +# ifdef SIMULATE_VERSION_TWEAK + '.', SIMULATE_VERSION_TWEAK, +# endif +# endif +# endif + ']','\0'}; +#endif + +/* Construct the string literal in pieces to prevent the source from + getting matched. Store it in a pointer rather than an array + because some compilers will just produce instructions to fill the + array rather than assigning a pointer to a static array. */ +char const* info_platform = "INFO" ":" "platform[" PLATFORM_ID "]"; +char const* info_arch = "INFO" ":" "arch[" ARCHITECTURE_ID "]"; + + + + +const char* info_language_dialect_default = "INFO" ":" "dialect_default[" +#if !defined(__STDC_VERSION__) + "90" +#elif __STDC_VERSION__ >= 201000L + "11" +#elif __STDC_VERSION__ >= 199901L + "99" +#else +#endif +"]"; + +/*--------------------------------------------------------------------------*/ + +#ifdef ID_VOID_MAIN +void main() {} +#else +int main(int argc, char* argv[]) +{ + int require = 0; + require += info_compiler[argc]; + require += info_platform[argc]; + require += info_arch[argc]; +#ifdef COMPILER_VERSION_MAJOR + require += info_version[argc]; +#endif +#ifdef SIMULATE_ID + require += info_simulate[argc]; +#endif +#ifdef SIMULATE_VERSION_MAJOR + require += info_simulate_version[argc]; +#endif +#if defined(__CRAYXE) || defined(__CRAYXC) + require += info_cray[argc]; +#endif + require += info_language_dialect_default[argc]; + (void)argv; + return require; +} +#endif diff --git a/FiniteElasticity/RightBiceps/build_debug/mpi_verification/C/CMakeFiles/CMakeDirectoryInformation.cmake b/FiniteElasticity/RightBiceps/build_debug/mpi_verification/C/CMakeFiles/CMakeDirectoryInformation.cmake new file mode 100644 index 00000000..10e72aa9 --- /dev/null +++ b/FiniteElasticity/RightBiceps/build_debug/mpi_verification/C/CMakeFiles/CMakeDirectoryInformation.cmake @@ -0,0 +1,16 @@ +# CMAKE generated file: DO NOT EDIT! +# Generated by "Unix Makefiles" Generator, CMake Version 3.5 + +# Relative path conversion top directories. +set(CMAKE_RELATIVE_PATH_TOP_SOURCE "/store/software/opencmiss/OpenCMISS-examples/FiniteElasticity/RightBiceps/build_debug/mpi_verification/C") +set(CMAKE_RELATIVE_PATH_TOP_BINARY "/store/software/opencmiss/OpenCMISS-examples/FiniteElasticity/RightBiceps/build_debug/mpi_verification/C") + +# Force unix paths in dependencies. +set(CMAKE_FORCE_UNIX_PATHS 1) + + +# The C and CXX include file regular expressions for this directory. +set(CMAKE_C_INCLUDE_REGEX_SCAN "^.*$") +set(CMAKE_C_INCLUDE_REGEX_COMPLAIN "^$") +set(CMAKE_CXX_INCLUDE_REGEX_SCAN ${CMAKE_C_INCLUDE_REGEX_SCAN}) +set(CMAKE_CXX_INCLUDE_REGEX_COMPLAIN ${CMAKE_C_INCLUDE_REGEX_COMPLAIN}) diff --git a/FiniteElasticity/RightBiceps/build_debug/mpi_verification/C/CMakeFiles/CMakeOutput.log b/FiniteElasticity/RightBiceps/build_debug/mpi_verification/C/CMakeFiles/CMakeOutput.log new file mode 100644 index 00000000..2bf78d29 --- /dev/null +++ b/FiniteElasticity/RightBiceps/build_debug/mpi_verification/C/CMakeFiles/CMakeOutput.log @@ -0,0 +1,207 @@ +The system is: Linux - 4.4.0-104-generic - x86_64 +Compiling the C compiler identification source file "CMakeCCompilerId.c" succeeded. +Compiler: /usr/bin/mpicc +Build flags: +Id flags: + +The output was: +0 + + +Compilation of the C compiler identification source "CMakeCCompilerId.c" produced "a.out" + +The C compiler identification is GNU, found in "/store/software/opencmiss/OpenCMISS-examples/FiniteElasticity/RightBiceps/build_debug/mpi_verification/C/CMakeFiles/3.5.1/CompilerIdC/a.out" + +Determining if the C compiler works passed with the following output: +Change Dir: /store/software/opencmiss/OpenCMISS-examples/FiniteElasticity/RightBiceps/build_debug/mpi_verification/C/CMakeFiles/CMakeTmp + +Run Build Command:"/usr/bin/make" "cmTC_2070b/fast" +/usr/bin/make -f CMakeFiles/cmTC_2070b.dir/build.make CMakeFiles/cmTC_2070b.dir/build +make[1]: Entering directory '/store/software/opencmiss/OpenCMISS-examples/FiniteElasticity/RightBiceps/build_debug/mpi_verification/C/CMakeFiles/CMakeTmp' +Building C object CMakeFiles/cmTC_2070b.dir/testCCompiler.c.o +/usr/bin/mpicc -o CMakeFiles/cmTC_2070b.dir/testCCompiler.c.o -c /store/software/opencmiss/OpenCMISS-examples/FiniteElasticity/RightBiceps/build_debug/mpi_verification/C/CMakeFiles/CMakeTmp/testCCompiler.c +Linking C executable cmTC_2070b +/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_2070b.dir/link.txt --verbose=1 +/usr/bin/mpicc CMakeFiles/cmTC_2070b.dir/testCCompiler.c.o -o cmTC_2070b -rdynamic +make[1]: Leaving directory '/store/software/opencmiss/OpenCMISS-examples/FiniteElasticity/RightBiceps/build_debug/mpi_verification/C/CMakeFiles/CMakeTmp' + + +Detecting C compiler ABI info compiled with the following output: +Change Dir: /store/software/opencmiss/OpenCMISS-examples/FiniteElasticity/RightBiceps/build_debug/mpi_verification/C/CMakeFiles/CMakeTmp + +Run Build Command:"/usr/bin/make" "cmTC_3e244/fast" +/usr/bin/make -f CMakeFiles/cmTC_3e244.dir/build.make CMakeFiles/cmTC_3e244.dir/build +make[1]: Entering directory '/store/software/opencmiss/OpenCMISS-examples/FiniteElasticity/RightBiceps/build_debug/mpi_verification/C/CMakeFiles/CMakeTmp' +Building C object CMakeFiles/cmTC_3e244.dir/CMakeCCompilerABI.c.o +/usr/bin/mpicc -o CMakeFiles/cmTC_3e244.dir/CMakeCCompilerABI.c.o -c /usr/share/cmake-3.5/Modules/CMakeCCompilerABI.c +Linking C executable cmTC_3e244 +/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_3e244.dir/link.txt --verbose=1 +/usr/bin/mpicc -v CMakeFiles/cmTC_3e244.dir/CMakeCCompilerABI.c.o -o cmTC_3e244 -rdynamic +Using built-in specs. +COLLECT_GCC=/usr/bin/gcc +COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/5/lto-wrapper +Target: x86_64-linux-gnu +Configured with: ../src/configure -v --with-pkgversion='Ubuntu 5.4.0-6ubuntu1~16.04.5' --with-bugurl=file:///usr/share/doc/gcc-5/README.Bugs --enable-languages=c,ada,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-5 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-libmpx --enable-plugin --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-5-amd64/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-5-amd64 --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-5-amd64 --with-arch-directory=amd64 --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --enable-objc-gc --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu +Thread model: posix +gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.5) +COMPILER_PATH=/usr/lib/gcc/x86_64-linux-gnu/5/:/usr/lib/gcc/x86_64-linux-gnu/5/:/usr/lib/gcc/x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/5/:/usr/lib/gcc/x86_64-linux-gnu/ +LIBRARY_PATH=/usr/lib/gcc/x86_64-linux-gnu/5/:/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/5/../../../../lib/:/lib/x86_64-linux-gnu/:/lib/../lib/:/usr/lib/x86_64-linux-gnu/:/usr/lib/../lib/:/usr/lib/gcc/x86_64-linux-gnu/5/../../../:/lib/:/usr/lib/ +COLLECT_GCC_OPTIONS='-v' '-o' 'cmTC_3e244' '-rdynamic' '-I' '/usr/lib/openmpi/include/openmpi/opal/mca/event/libevent2021/libevent' '-I' '/usr/lib/openmpi/include/openmpi/opal/mca/event/libevent2021/libevent/include' '-I' '/usr/lib/openmpi/include' '-I' '/usr/lib/openmpi/include/openmpi' '-pthread' '-L/usr/lib/openmpi/lib' '-mtune=generic' '-march=x86-64' + /usr/lib/gcc/x86_64-linux-gnu/5/collect2 -plugin /usr/lib/gcc/x86_64-linux-gnu/5/liblto_plugin.so -plugin-opt=/usr/lib/gcc/x86_64-linux-gnu/5/lto-wrapper -plugin-opt=-fresolution=/tmp/ccZTgx00.res -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lpthread -plugin-opt=-pass-through=-lc -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_s --sysroot=/ --build-id --eh-frame-hdr -m elf_x86_64 --hash-style=gnu --as-needed -export-dynamic -dynamic-linker /lib64/ld-linux-x86-64.so.2 -z relro -o cmTC_3e244 /usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/crt1.o /usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/crti.o /usr/lib/gcc/x86_64-linux-gnu/5/crtbegin.o -L/usr/lib/openmpi/lib -L/usr/lib/gcc/x86_64-linux-gnu/5 -L/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu -L/usr/lib/gcc/x86_64-linux-gnu/5/../../../../lib -L/lib/x86_64-linux-gnu -L/lib/../lib -L/usr/lib/x86_64-linux-gnu -L/usr/lib/../lib -L/usr/lib/gcc/x86_64-linux-gnu/5/../../.. CMakeFiles/cmTC_3e244.dir/CMakeCCompilerABI.c.o -rpath /usr/lib/openmpi/lib --enable-new-dtags -lmpi -lgcc --as-needed -lgcc_s --no-as-needed -lpthread -lc -lgcc --as-needed -lgcc_s --no-as-needed /usr/lib/gcc/x86_64-linux-gnu/5/crtend.o /usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/crtn.o +make[1]: Leaving directory '/store/software/opencmiss/OpenCMISS-examples/FiniteElasticity/RightBiceps/build_debug/mpi_verification/C/CMakeFiles/CMakeTmp' + + +Parsed C implicit link information from above output: + link line regex: [^( *|.*[/\])(ld|([^/\]+-)?ld|collect2)[^/\]*( |$)] + ignore line: [Change Dir: /store/software/opencmiss/OpenCMISS-examples/FiniteElasticity/RightBiceps/build_debug/mpi_verification/C/CMakeFiles/CMakeTmp] + ignore line: [] + ignore line: [Run Build Command:"/usr/bin/make" "cmTC_3e244/fast"] + ignore line: [/usr/bin/make -f CMakeFiles/cmTC_3e244.dir/build.make CMakeFiles/cmTC_3e244.dir/build] + ignore line: [make[1]: Entering directory '/store/software/opencmiss/OpenCMISS-examples/FiniteElasticity/RightBiceps/build_debug/mpi_verification/C/CMakeFiles/CMakeTmp'] + ignore line: [Building C object CMakeFiles/cmTC_3e244.dir/CMakeCCompilerABI.c.o] + ignore line: [/usr/bin/mpicc -o CMakeFiles/cmTC_3e244.dir/CMakeCCompilerABI.c.o -c /usr/share/cmake-3.5/Modules/CMakeCCompilerABI.c] + ignore line: [Linking C executable cmTC_3e244] + ignore line: [/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_3e244.dir/link.txt --verbose=1] + ignore line: [/usr/bin/mpicc -v CMakeFiles/cmTC_3e244.dir/CMakeCCompilerABI.c.o -o cmTC_3e244 -rdynamic ] + ignore line: [Using built-in specs.] + ignore line: [COLLECT_GCC=/usr/bin/gcc] + ignore line: [COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/5/lto-wrapper] + ignore line: [Target: x86_64-linux-gnu] + ignore line: [Configured with: ../src/configure -v --with-pkgversion='Ubuntu 5.4.0-6ubuntu1~16.04.5' --with-bugurl=file:///usr/share/doc/gcc-5/README.Bugs --enable-languages=c,ada,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-5 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-libmpx --enable-plugin --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-5-amd64/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-5-amd64 --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-5-amd64 --with-arch-directory=amd64 --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --enable-objc-gc --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu] + ignore line: [Thread model: posix] + ignore line: [gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.5) ] + ignore line: [COMPILER_PATH=/usr/lib/gcc/x86_64-linux-gnu/5/:/usr/lib/gcc/x86_64-linux-gnu/5/:/usr/lib/gcc/x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/5/:/usr/lib/gcc/x86_64-linux-gnu/] + ignore line: [LIBRARY_PATH=/usr/lib/gcc/x86_64-linux-gnu/5/:/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/5/../../../../lib/:/lib/x86_64-linux-gnu/:/lib/../lib/:/usr/lib/x86_64-linux-gnu/:/usr/lib/../lib/:/usr/lib/gcc/x86_64-linux-gnu/5/../../../:/lib/:/usr/lib/] + ignore line: [COLLECT_GCC_OPTIONS='-v' '-o' 'cmTC_3e244' '-rdynamic' '-I' '/usr/lib/openmpi/include/openmpi/opal/mca/event/libevent2021/libevent' '-I' '/usr/lib/openmpi/include/openmpi/opal/mca/event/libevent2021/libevent/include' '-I' '/usr/lib/openmpi/include' '-I' '/usr/lib/openmpi/include/openmpi' '-pthread' '-L/usr/lib/openmpi/lib' '-mtune=generic' '-march=x86-64'] + link line: [ /usr/lib/gcc/x86_64-linux-gnu/5/collect2 -plugin /usr/lib/gcc/x86_64-linux-gnu/5/liblto_plugin.so -plugin-opt=/usr/lib/gcc/x86_64-linux-gnu/5/lto-wrapper -plugin-opt=-fresolution=/tmp/ccZTgx00.res -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lpthread -plugin-opt=-pass-through=-lc -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_s --sysroot=/ --build-id --eh-frame-hdr -m elf_x86_64 --hash-style=gnu --as-needed -export-dynamic -dynamic-linker /lib64/ld-linux-x86-64.so.2 -z relro -o cmTC_3e244 /usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/crt1.o /usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/crti.o /usr/lib/gcc/x86_64-linux-gnu/5/crtbegin.o -L/usr/lib/openmpi/lib -L/usr/lib/gcc/x86_64-linux-gnu/5 -L/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu -L/usr/lib/gcc/x86_64-linux-gnu/5/../../../../lib -L/lib/x86_64-linux-gnu -L/lib/../lib -L/usr/lib/x86_64-linux-gnu -L/usr/lib/../lib -L/usr/lib/gcc/x86_64-linux-gnu/5/../../.. CMakeFiles/cmTC_3e244.dir/CMakeCCompilerABI.c.o -rpath /usr/lib/openmpi/lib --enable-new-dtags -lmpi -lgcc --as-needed -lgcc_s --no-as-needed -lpthread -lc -lgcc --as-needed -lgcc_s --no-as-needed /usr/lib/gcc/x86_64-linux-gnu/5/crtend.o /usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/crtn.o] + arg [/usr/lib/gcc/x86_64-linux-gnu/5/collect2] ==> ignore + arg [-plugin] ==> ignore + arg [/usr/lib/gcc/x86_64-linux-gnu/5/liblto_plugin.so] ==> ignore + arg [-plugin-opt=/usr/lib/gcc/x86_64-linux-gnu/5/lto-wrapper] ==> ignore + arg [-plugin-opt=-fresolution=/tmp/ccZTgx00.res] ==> ignore + arg [-plugin-opt=-pass-through=-lgcc] ==> ignore + arg [-plugin-opt=-pass-through=-lgcc_s] ==> ignore + arg [-plugin-opt=-pass-through=-lpthread] ==> ignore + arg [-plugin-opt=-pass-through=-lc] ==> ignore + arg [-plugin-opt=-pass-through=-lgcc] ==> ignore + arg [-plugin-opt=-pass-through=-lgcc_s] ==> ignore + arg [--sysroot=/] ==> ignore + arg [--build-id] ==> ignore + arg [--eh-frame-hdr] ==> ignore + arg [-m] ==> ignore + arg [elf_x86_64] ==> ignore + arg [--hash-style=gnu] ==> ignore + arg [--as-needed] ==> ignore + arg [-export-dynamic] ==> ignore + arg [-dynamic-linker] ==> ignore + arg [/lib64/ld-linux-x86-64.so.2] ==> ignore + arg [-zrelro] ==> ignore + arg [-o] ==> ignore + arg [cmTC_3e244] ==> ignore + arg [/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/crt1.o] ==> ignore + arg [/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/crti.o] ==> ignore + arg [/usr/lib/gcc/x86_64-linux-gnu/5/crtbegin.o] ==> ignore + arg [-L/usr/lib/openmpi/lib] ==> dir [/usr/lib/openmpi/lib] + arg [-L/usr/lib/gcc/x86_64-linux-gnu/5] ==> dir [/usr/lib/gcc/x86_64-linux-gnu/5] + arg [-L/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu] ==> dir [/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu] + arg [-L/usr/lib/gcc/x86_64-linux-gnu/5/../../../../lib] ==> dir [/usr/lib/gcc/x86_64-linux-gnu/5/../../../../lib] + arg [-L/lib/x86_64-linux-gnu] ==> dir [/lib/x86_64-linux-gnu] + arg [-L/lib/../lib] ==> dir [/lib/../lib] + arg [-L/usr/lib/x86_64-linux-gnu] ==> dir [/usr/lib/x86_64-linux-gnu] + arg [-L/usr/lib/../lib] ==> dir [/usr/lib/../lib] + arg [-L/usr/lib/gcc/x86_64-linux-gnu/5/../../..] ==> dir [/usr/lib/gcc/x86_64-linux-gnu/5/../../..] + arg [CMakeFiles/cmTC_3e244.dir/CMakeCCompilerABI.c.o] ==> ignore + arg [-rpath] ==> ignore + arg [/usr/lib/openmpi/lib] ==> ignore + arg [--enable-new-dtags] ==> ignore + arg [-lmpi] ==> lib [mpi] + arg [-lgcc] ==> lib [gcc] + arg [--as-needed] ==> ignore + arg [-lgcc_s] ==> lib [gcc_s] + arg [--no-as-needed] ==> ignore + arg [-lpthread] ==> lib [pthread] + arg [-lc] ==> lib [c] + arg [-lgcc] ==> lib [gcc] + arg [--as-needed] ==> ignore + arg [-lgcc_s] ==> lib [gcc_s] + arg [--no-as-needed] ==> ignore + arg [/usr/lib/gcc/x86_64-linux-gnu/5/crtend.o] ==> ignore + arg [/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/crtn.o] ==> ignore + remove lib [gcc] + remove lib [gcc_s] + remove lib [gcc] + remove lib [gcc_s] + collapse library dir [/usr/lib/openmpi/lib] ==> [/usr/lib/openmpi/lib] + collapse library dir [/usr/lib/gcc/x86_64-linux-gnu/5] ==> [/usr/lib/gcc/x86_64-linux-gnu/5] + collapse library dir [/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu] ==> [/usr/lib/x86_64-linux-gnu] + collapse library dir [/usr/lib/gcc/x86_64-linux-gnu/5/../../../../lib] ==> [/usr/lib] + collapse library dir [/lib/x86_64-linux-gnu] ==> [/lib/x86_64-linux-gnu] + collapse library dir [/lib/../lib] ==> [/lib] + collapse library dir [/usr/lib/x86_64-linux-gnu] ==> [/usr/lib/x86_64-linux-gnu] + collapse library dir [/usr/lib/../lib] ==> [/usr/lib] + collapse library dir [/usr/lib/gcc/x86_64-linux-gnu/5/../../..] ==> [/usr/lib] + implicit libs: [mpi;pthread;c] + implicit dirs: [/usr/lib/openmpi/lib;/usr/lib/gcc/x86_64-linux-gnu/5;/usr/lib/x86_64-linux-gnu;/usr/lib;/lib/x86_64-linux-gnu;/lib] + implicit fwks: [] + + + + +Detecting C [-std=c11] compiler features compiled with the following output: +Change Dir: /store/software/opencmiss/OpenCMISS-examples/FiniteElasticity/RightBiceps/build_debug/mpi_verification/C/CMakeFiles/CMakeTmp + +Run Build Command:"/usr/bin/make" "cmTC_1d43c/fast" +/usr/bin/make -f CMakeFiles/cmTC_1d43c.dir/build.make CMakeFiles/cmTC_1d43c.dir/build +make[1]: Entering directory '/store/software/opencmiss/OpenCMISS-examples/FiniteElasticity/RightBiceps/build_debug/mpi_verification/C/CMakeFiles/CMakeTmp' +Building C object CMakeFiles/cmTC_1d43c.dir/feature_tests.c.o +/usr/bin/mpicc -std=c11 -o CMakeFiles/cmTC_1d43c.dir/feature_tests.c.o -c /store/software/opencmiss/OpenCMISS-examples/FiniteElasticity/RightBiceps/build_debug/mpi_verification/C/CMakeFiles/feature_tests.c +Linking C executable cmTC_1d43c +/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_1d43c.dir/link.txt --verbose=1 +/usr/bin/mpicc CMakeFiles/cmTC_1d43c.dir/feature_tests.c.o -o cmTC_1d43c -rdynamic +make[1]: Leaving directory '/store/software/opencmiss/OpenCMISS-examples/FiniteElasticity/RightBiceps/build_debug/mpi_verification/C/CMakeFiles/CMakeTmp' + + + Feature record: C_FEATURE:1c_function_prototypes + Feature record: C_FEATURE:1c_restrict + Feature record: C_FEATURE:1c_static_assert + Feature record: C_FEATURE:1c_variadic_macros + + +Detecting C [-std=c99] compiler features compiled with the following output: +Change Dir: /store/software/opencmiss/OpenCMISS-examples/FiniteElasticity/RightBiceps/build_debug/mpi_verification/C/CMakeFiles/CMakeTmp + +Run Build Command:"/usr/bin/make" "cmTC_53a66/fast" +/usr/bin/make -f CMakeFiles/cmTC_53a66.dir/build.make CMakeFiles/cmTC_53a66.dir/build +make[1]: Entering directory '/store/software/opencmiss/OpenCMISS-examples/FiniteElasticity/RightBiceps/build_debug/mpi_verification/C/CMakeFiles/CMakeTmp' +Building C object CMakeFiles/cmTC_53a66.dir/feature_tests.c.o +/usr/bin/mpicc -std=c99 -o CMakeFiles/cmTC_53a66.dir/feature_tests.c.o -c /store/software/opencmiss/OpenCMISS-examples/FiniteElasticity/RightBiceps/build_debug/mpi_verification/C/CMakeFiles/feature_tests.c +Linking C executable cmTC_53a66 +/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_53a66.dir/link.txt --verbose=1 +/usr/bin/mpicc CMakeFiles/cmTC_53a66.dir/feature_tests.c.o -o cmTC_53a66 -rdynamic +make[1]: Leaving directory '/store/software/opencmiss/OpenCMISS-examples/FiniteElasticity/RightBiceps/build_debug/mpi_verification/C/CMakeFiles/CMakeTmp' + + + Feature record: C_FEATURE:1c_function_prototypes + Feature record: C_FEATURE:1c_restrict + Feature record: C_FEATURE:0c_static_assert + Feature record: C_FEATURE:1c_variadic_macros + + +Detecting C [-std=c90] compiler features compiled with the following output: +Change Dir: /store/software/opencmiss/OpenCMISS-examples/FiniteElasticity/RightBiceps/build_debug/mpi_verification/C/CMakeFiles/CMakeTmp + +Run Build Command:"/usr/bin/make" "cmTC_3dde1/fast" +/usr/bin/make -f CMakeFiles/cmTC_3dde1.dir/build.make CMakeFiles/cmTC_3dde1.dir/build +make[1]: Entering directory '/store/software/opencmiss/OpenCMISS-examples/FiniteElasticity/RightBiceps/build_debug/mpi_verification/C/CMakeFiles/CMakeTmp' +Building C object CMakeFiles/cmTC_3dde1.dir/feature_tests.c.o +/usr/bin/mpicc -std=c90 -o CMakeFiles/cmTC_3dde1.dir/feature_tests.c.o -c /store/software/opencmiss/OpenCMISS-examples/FiniteElasticity/RightBiceps/build_debug/mpi_verification/C/CMakeFiles/feature_tests.c +Linking C executable cmTC_3dde1 +/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_3dde1.dir/link.txt --verbose=1 +/usr/bin/mpicc CMakeFiles/cmTC_3dde1.dir/feature_tests.c.o -o cmTC_3dde1 -rdynamic +make[1]: Leaving directory '/store/software/opencmiss/OpenCMISS-examples/FiniteElasticity/RightBiceps/build_debug/mpi_verification/C/CMakeFiles/CMakeTmp' + + + Feature record: C_FEATURE:1c_function_prototypes + Feature record: C_FEATURE:0c_restrict + Feature record: C_FEATURE:0c_static_assert + Feature record: C_FEATURE:0c_variadic_macros diff --git a/FiniteElasticity/RightBiceps/build_debug/mpi_verification/C/CMakeFiles/Makefile.cmake b/FiniteElasticity/RightBiceps/build_debug/mpi_verification/C/CMakeFiles/Makefile.cmake new file mode 100644 index 00000000..eda41f1d --- /dev/null +++ b/FiniteElasticity/RightBiceps/build_debug/mpi_verification/C/CMakeFiles/Makefile.cmake @@ -0,0 +1,93 @@ +# CMAKE generated file: DO NOT EDIT! +# Generated by "Unix Makefiles" Generator, CMake Version 3.5 + +# The generator used is: +set(CMAKE_DEPENDS_GENERATOR "Unix Makefiles") + +# The top level Makefile was generated from the following files: +set(CMAKE_MAKEFILE_DEPENDS + "CMakeCache.txt" + "CMakeFiles/3.5.1/CMakeCCompiler.cmake" + "CMakeFiles/3.5.1/CMakeSystem.cmake" + "CMakeFiles/feature_tests.c" + "CMakeLists.txt" + "/usr/share/cmake-3.5/Modules/CMakeCCompiler.cmake.in" + "/usr/share/cmake-3.5/Modules/CMakeCCompilerABI.c" + "/usr/share/cmake-3.5/Modules/CMakeCInformation.cmake" + "/usr/share/cmake-3.5/Modules/CMakeCommonLanguageInclude.cmake" + "/usr/share/cmake-3.5/Modules/CMakeCompilerIdDetection.cmake" + "/usr/share/cmake-3.5/Modules/CMakeDetermineCCompiler.cmake" + "/usr/share/cmake-3.5/Modules/CMakeDetermineCompileFeatures.cmake" + "/usr/share/cmake-3.5/Modules/CMakeDetermineCompiler.cmake" + "/usr/share/cmake-3.5/Modules/CMakeDetermineCompilerABI.cmake" + "/usr/share/cmake-3.5/Modules/CMakeDetermineCompilerId.cmake" + "/usr/share/cmake-3.5/Modules/CMakeDetermineSystem.cmake" + "/usr/share/cmake-3.5/Modules/CMakeFindBinUtils.cmake" + "/usr/share/cmake-3.5/Modules/CMakeGenericSystem.cmake" + "/usr/share/cmake-3.5/Modules/CMakeLanguageInformation.cmake" + "/usr/share/cmake-3.5/Modules/CMakeParseArguments.cmake" + "/usr/share/cmake-3.5/Modules/CMakeParseImplicitLinkInfo.cmake" + "/usr/share/cmake-3.5/Modules/CMakeSystem.cmake.in" + "/usr/share/cmake-3.5/Modules/CMakeSystemSpecificInformation.cmake" + "/usr/share/cmake-3.5/Modules/CMakeSystemSpecificInitialize.cmake" + "/usr/share/cmake-3.5/Modules/CMakeTestCCompiler.cmake" + "/usr/share/cmake-3.5/Modules/CMakeTestCompilerCommon.cmake" + "/usr/share/cmake-3.5/Modules/CMakeUnixFindMake.cmake" + "/usr/share/cmake-3.5/Modules/Compiler/ADSP-DetermineCompiler.cmake" + "/usr/share/cmake-3.5/Modules/Compiler/ARMCC-DetermineCompiler.cmake" + "/usr/share/cmake-3.5/Modules/Compiler/AppleClang-DetermineCompiler.cmake" + "/usr/share/cmake-3.5/Modules/Compiler/Borland-DetermineCompiler.cmake" + "/usr/share/cmake-3.5/Modules/Compiler/Clang-DetermineCompiler.cmake" + "/usr/share/cmake-3.5/Modules/Compiler/Clang-DetermineCompilerInternal.cmake" + "/usr/share/cmake-3.5/Modules/Compiler/Compaq-C-DetermineCompiler.cmake" + "/usr/share/cmake-3.5/Modules/Compiler/Cray-DetermineCompiler.cmake" + "/usr/share/cmake-3.5/Modules/Compiler/Embarcadero-DetermineCompiler.cmake" + "/usr/share/cmake-3.5/Modules/Compiler/Fujitsu-DetermineCompiler.cmake" + "/usr/share/cmake-3.5/Modules/Compiler/GHS-DetermineCompiler.cmake" + "/usr/share/cmake-3.5/Modules/Compiler/GNU-C-FeatureTests.cmake" + "/usr/share/cmake-3.5/Modules/Compiler/GNU-C.cmake" + "/usr/share/cmake-3.5/Modules/Compiler/GNU-DetermineCompiler.cmake" + "/usr/share/cmake-3.5/Modules/Compiler/GNU.cmake" + "/usr/share/cmake-3.5/Modules/Compiler/HP-C-DetermineCompiler.cmake" + "/usr/share/cmake-3.5/Modules/Compiler/IAR-DetermineCompiler.cmake" + "/usr/share/cmake-3.5/Modules/Compiler/IBMCPP-C-DetermineVersionInternal.cmake" + "/usr/share/cmake-3.5/Modules/Compiler/Intel-DetermineCompiler.cmake" + "/usr/share/cmake-3.5/Modules/Compiler/MIPSpro-DetermineCompiler.cmake" + "/usr/share/cmake-3.5/Modules/Compiler/MSVC-DetermineCompiler.cmake" + "/usr/share/cmake-3.5/Modules/Compiler/OpenWatcom-DetermineCompiler.cmake" + "/usr/share/cmake-3.5/Modules/Compiler/PGI-DetermineCompiler.cmake" + "/usr/share/cmake-3.5/Modules/Compiler/PathScale-DetermineCompiler.cmake" + "/usr/share/cmake-3.5/Modules/Compiler/SCO-DetermineCompiler.cmake" + "/usr/share/cmake-3.5/Modules/Compiler/SDCC-C-DetermineCompiler.cmake" + "/usr/share/cmake-3.5/Modules/Compiler/SunPro-C-DetermineCompiler.cmake" + "/usr/share/cmake-3.5/Modules/Compiler/TI-DetermineCompiler.cmake" + "/usr/share/cmake-3.5/Modules/Compiler/TinyCC-C-DetermineCompiler.cmake" + "/usr/share/cmake-3.5/Modules/Compiler/VisualAge-C-DetermineCompiler.cmake" + "/usr/share/cmake-3.5/Modules/Compiler/Watcom-DetermineCompiler.cmake" + "/usr/share/cmake-3.5/Modules/Compiler/XL-C-DetermineCompiler.cmake" + "/usr/share/cmake-3.5/Modules/Compiler/zOS-C-DetermineCompiler.cmake" + "/usr/share/cmake-3.5/Modules/Internal/FeatureTesting.cmake" + "/usr/share/cmake-3.5/Modules/MultiArchCross.cmake" + "/usr/share/cmake-3.5/Modules/Platform/Linux-GNU-C.cmake" + "/usr/share/cmake-3.5/Modules/Platform/Linux-GNU.cmake" + "/usr/share/cmake-3.5/Modules/Platform/Linux.cmake" + "/usr/share/cmake-3.5/Modules/Platform/UnixPaths.cmake" + ) + +# The corresponding makefile is: +set(CMAKE_MAKEFILE_OUTPUTS + "Makefile" + "CMakeFiles/cmake.check_cache" + ) + +# Byproducts of CMake generate step: +set(CMAKE_MAKEFILE_PRODUCTS + "CMakeFiles/3.5.1/CMakeSystem.cmake" + "CMakeFiles/3.5.1/CMakeCCompiler.cmake" + "CMakeFiles/3.5.1/CMakeCCompiler.cmake" + "CMakeFiles/CMakeDirectoryInformation.cmake" + ) + +# Dependency information for all targets: +set(CMAKE_DEPEND_INFO_FILES + ) diff --git a/FiniteElasticity/RightBiceps/build_debug/mpi_verification/C/CMakeFiles/Makefile2 b/FiniteElasticity/RightBiceps/build_debug/mpi_verification/C/CMakeFiles/Makefile2 new file mode 100644 index 00000000..65656619 --- /dev/null +++ b/FiniteElasticity/RightBiceps/build_debug/mpi_verification/C/CMakeFiles/Makefile2 @@ -0,0 +1,71 @@ +# CMAKE generated file: DO NOT EDIT! +# Generated by "Unix Makefiles" Generator, CMake Version 3.5 + +# Default target executed when no arguments are given to make. +default_target: all + +.PHONY : default_target + +# The main recursive all target +all: + +.PHONY : all + +# The main recursive preinstall target +preinstall: + +.PHONY : preinstall + +#============================================================================= +# Special targets provided by cmake. + +# Disable implicit rules so canonical targets will work. +.SUFFIXES: + + +# Remove some rules from gmake that .SUFFIXES does not remove. +SUFFIXES = + +.SUFFIXES: .hpux_make_needs_suffix_list + + +# Suppress display of executed commands. +$(VERBOSE).SILENT: + + +# A target that is always out of date. +cmake_force: + +.PHONY : cmake_force + +#============================================================================= +# Set environment variables for the build. + +# The shell in which to execute make rules. +SHELL = /bin/sh + +# The CMake executable. +CMAKE_COMMAND = /usr/bin/cmake + +# The command to remove a file. +RM = /usr/bin/cmake -E remove -f + +# Escaping for special characters. +EQUALS = = + +# The top-level source directory on which CMake was run. +CMAKE_SOURCE_DIR = /store/software/opencmiss/OpenCMISS-examples/FiniteElasticity/RightBiceps/build_debug/mpi_verification/C + +# The top-level build directory on which CMake was run. +CMAKE_BINARY_DIR = /store/software/opencmiss/OpenCMISS-examples/FiniteElasticity/RightBiceps/build_debug/mpi_verification/C + +#============================================================================= +# Special targets to cleanup operation of make. + +# Special rule to run CMake to check the build system integrity. +# No rule that depends on this can have commands that come from listfiles +# because they might be regenerated. +cmake_check_build_system: + $(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 0 +.PHONY : cmake_check_build_system + diff --git a/FiniteElasticity/RightBiceps/build_debug/mpi_verification/C/CMakeFiles/TargetDirectories.txt b/FiniteElasticity/RightBiceps/build_debug/mpi_verification/C/CMakeFiles/TargetDirectories.txt new file mode 100644 index 00000000..1028108c --- /dev/null +++ b/FiniteElasticity/RightBiceps/build_debug/mpi_verification/C/CMakeFiles/TargetDirectories.txt @@ -0,0 +1,2 @@ +/store/software/opencmiss/OpenCMISS-examples/FiniteElasticity/RightBiceps/build_debug/mpi_verification/C/CMakeFiles/edit_cache.dir +/store/software/opencmiss/OpenCMISS-examples/FiniteElasticity/RightBiceps/build_debug/mpi_verification/C/CMakeFiles/rebuild_cache.dir diff --git a/FiniteElasticity/RightBiceps/build_debug/mpi_verification/C/CMakeFiles/cmake.check_cache b/FiniteElasticity/RightBiceps/build_debug/mpi_verification/C/CMakeFiles/cmake.check_cache new file mode 100644 index 00000000..3dccd731 --- /dev/null +++ b/FiniteElasticity/RightBiceps/build_debug/mpi_verification/C/CMakeFiles/cmake.check_cache @@ -0,0 +1 @@ +# This file is generated by cmake for dependency checking of the CMakeCache.txt file diff --git a/FiniteElasticity/RightBiceps/build_debug/mpi_verification/C/CMakeFiles/feature_tests.bin b/FiniteElasticity/RightBiceps/build_debug/mpi_verification/C/CMakeFiles/feature_tests.bin new file mode 100755 index 00000000..ed768941 Binary files /dev/null and b/FiniteElasticity/RightBiceps/build_debug/mpi_verification/C/CMakeFiles/feature_tests.bin differ diff --git a/FiniteElasticity/RightBiceps/build_debug/mpi_verification/C/CMakeFiles/feature_tests.c b/FiniteElasticity/RightBiceps/build_debug/mpi_verification/C/CMakeFiles/feature_tests.c new file mode 100644 index 00000000..6590dded --- /dev/null +++ b/FiniteElasticity/RightBiceps/build_debug/mpi_verification/C/CMakeFiles/feature_tests.c @@ -0,0 +1,34 @@ + + const char features[] = {"\n" +"C_FEATURE:" +#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 404 +"1" +#else +"0" +#endif +"c_function_prototypes\n" +"C_FEATURE:" +#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 404 && defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L +"1" +#else +"0" +#endif +"c_restrict\n" +"C_FEATURE:" +#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 406 && defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201000L +"1" +#else +"0" +#endif +"c_static_assert\n" +"C_FEATURE:" +#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 404 && defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L +"1" +#else +"0" +#endif +"c_variadic_macros\n" + +}; + +int main(int argc, char** argv) { (void)argv; return features[argc]; } diff --git a/FiniteElasticity/RightBiceps/build_debug/mpi_verification/C/CMakeFiles/progress.marks b/FiniteElasticity/RightBiceps/build_debug/mpi_verification/C/CMakeFiles/progress.marks new file mode 100644 index 00000000..573541ac --- /dev/null +++ b/FiniteElasticity/RightBiceps/build_debug/mpi_verification/C/CMakeFiles/progress.marks @@ -0,0 +1 @@ +0 diff --git a/FiniteElasticity/RightBiceps/build_debug/mpi_verification/C/CMakeLists.txt b/FiniteElasticity/RightBiceps/build_debug/mpi_verification/C/CMakeLists.txt new file mode 100644 index 00000000..f156ff6a --- /dev/null +++ b/FiniteElasticity/RightBiceps/build_debug/mpi_verification/C/CMakeLists.txt @@ -0,0 +1,8 @@ + + cmake_minimum_required(VERSION 3.0) + project(verify_mpi_compat VERSION 1.0 LANGUAGES C) + file(WRITE compiler_info.cmake " + set(MPI_C_COMPILER_VERSION ${CMAKE_C_COMPILER_VERSION}) + set(MPI_C_COMPILER_ID ${CMAKE_C_COMPILER_ID}) + ") + \ No newline at end of file diff --git a/FiniteElasticity/RightBiceps/build_debug/mpi_verification/C/Makefile b/FiniteElasticity/RightBiceps/build_debug/mpi_verification/C/Makefile new file mode 100644 index 00000000..e16f9c22 --- /dev/null +++ b/FiniteElasticity/RightBiceps/build_debug/mpi_verification/C/Makefile @@ -0,0 +1,134 @@ +# CMAKE generated file: DO NOT EDIT! +# Generated by "Unix Makefiles" Generator, CMake Version 3.5 + +# Default target executed when no arguments are given to make. +default_target: all + +.PHONY : default_target + +# Allow only one "make -f Makefile2" at a time, but pass parallelism. +.NOTPARALLEL: + + +#============================================================================= +# Special targets provided by cmake. + +# Disable implicit rules so canonical targets will work. +.SUFFIXES: + + +# Remove some rules from gmake that .SUFFIXES does not remove. +SUFFIXES = + +.SUFFIXES: .hpux_make_needs_suffix_list + + +# Suppress display of executed commands. +$(VERBOSE).SILENT: + + +# A target that is always out of date. +cmake_force: + +.PHONY : cmake_force + +#============================================================================= +# Set environment variables for the build. + +# The shell in which to execute make rules. +SHELL = /bin/sh + +# The CMake executable. +CMAKE_COMMAND = /usr/bin/cmake + +# The command to remove a file. +RM = /usr/bin/cmake -E remove -f + +# Escaping for special characters. +EQUALS = = + +# The top-level source directory on which CMake was run. +CMAKE_SOURCE_DIR = /store/software/opencmiss/OpenCMISS-examples/FiniteElasticity/RightBiceps/build_debug/mpi_verification/C + +# The top-level build directory on which CMake was run. +CMAKE_BINARY_DIR = /store/software/opencmiss/OpenCMISS-examples/FiniteElasticity/RightBiceps/build_debug/mpi_verification/C + +#============================================================================= +# Targets provided globally by CMake. + +# Special rule for the target edit_cache +edit_cache: + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running CMake cache editor..." + /usr/bin/ccmake -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) +.PHONY : edit_cache + +# Special rule for the target edit_cache +edit_cache/fast: edit_cache + +.PHONY : edit_cache/fast + +# Special rule for the target rebuild_cache +rebuild_cache: + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running CMake to regenerate build system..." + /usr/bin/cmake -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) +.PHONY : rebuild_cache + +# Special rule for the target rebuild_cache +rebuild_cache/fast: rebuild_cache + +.PHONY : rebuild_cache/fast + +# The main all target +all: cmake_check_build_system + $(CMAKE_COMMAND) -E cmake_progress_start /store/software/opencmiss/OpenCMISS-examples/FiniteElasticity/RightBiceps/build_debug/mpi_verification/C/CMakeFiles /store/software/opencmiss/OpenCMISS-examples/FiniteElasticity/RightBiceps/build_debug/mpi_verification/C/CMakeFiles/progress.marks + $(MAKE) -f CMakeFiles/Makefile2 all + $(CMAKE_COMMAND) -E cmake_progress_start /store/software/opencmiss/OpenCMISS-examples/FiniteElasticity/RightBiceps/build_debug/mpi_verification/C/CMakeFiles 0 +.PHONY : all + +# The main clean target +clean: + $(MAKE) -f CMakeFiles/Makefile2 clean +.PHONY : clean + +# The main clean target +clean/fast: clean + +.PHONY : clean/fast + +# Prepare targets for installation. +preinstall: all + $(MAKE) -f CMakeFiles/Makefile2 preinstall +.PHONY : preinstall + +# Prepare targets for installation. +preinstall/fast: + $(MAKE) -f CMakeFiles/Makefile2 preinstall +.PHONY : preinstall/fast + +# clear depends +depend: + $(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 1 +.PHONY : depend + +# Help Target +help: + @echo "The following are some of the valid targets for this Makefile:" + @echo "... all (the default if no target is provided)" + @echo "... clean" + @echo "... depend" + @echo "... edit_cache" + @echo "... rebuild_cache" +.PHONY : help + + + +#============================================================================= +# Special targets to cleanup operation of make. + +# Special rule to run CMake to check the build system integrity. +# No rule that depends on this can have commands that come from listfiles +# because they might be regenerated. +cmake_check_build_system: + $(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 0 +.PHONY : cmake_check_build_system + diff --git a/FiniteElasticity/RightBiceps/build_debug/mpi_verification/C/cmake_install.cmake b/FiniteElasticity/RightBiceps/build_debug/mpi_verification/C/cmake_install.cmake new file mode 100644 index 00000000..4e329f1e --- /dev/null +++ b/FiniteElasticity/RightBiceps/build_debug/mpi_verification/C/cmake_install.cmake @@ -0,0 +1,44 @@ +# Install script for directory: /store/software/opencmiss/OpenCMISS-examples/FiniteElasticity/RightBiceps/build_debug/mpi_verification/C + +# Set the install prefix +if(NOT DEFINED CMAKE_INSTALL_PREFIX) + set(CMAKE_INSTALL_PREFIX "/usr/local") +endif() +string(REGEX REPLACE "/$" "" CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}") + +# Set the install configuration name. +if(NOT DEFINED CMAKE_INSTALL_CONFIG_NAME) + if(BUILD_TYPE) + string(REGEX REPLACE "^[^A-Za-z0-9_]+" "" + CMAKE_INSTALL_CONFIG_NAME "${BUILD_TYPE}") + else() + set(CMAKE_INSTALL_CONFIG_NAME "") + endif() + message(STATUS "Install configuration: \"${CMAKE_INSTALL_CONFIG_NAME}\"") +endif() + +# Set the component getting installed. +if(NOT CMAKE_INSTALL_COMPONENT) + if(COMPONENT) + message(STATUS "Install component: \"${COMPONENT}\"") + set(CMAKE_INSTALL_COMPONENT "${COMPONENT}") + else() + set(CMAKE_INSTALL_COMPONENT) + endif() +endif() + +# Install shared libraries without execute permission? +if(NOT DEFINED CMAKE_INSTALL_SO_NO_EXE) + set(CMAKE_INSTALL_SO_NO_EXE "1") +endif() + +if(CMAKE_INSTALL_COMPONENT) + set(CMAKE_INSTALL_MANIFEST "install_manifest_${CMAKE_INSTALL_COMPONENT}.txt") +else() + set(CMAKE_INSTALL_MANIFEST "install_manifest.txt") +endif() + +string(REPLACE ";" "\n" CMAKE_INSTALL_MANIFEST_CONTENT + "${CMAKE_INSTALL_MANIFEST_FILES}") +file(WRITE "/store/software/opencmiss/OpenCMISS-examples/FiniteElasticity/RightBiceps/build_debug/mpi_verification/C/${CMAKE_INSTALL_MANIFEST}" + "${CMAKE_INSTALL_MANIFEST_CONTENT}") diff --git a/FiniteElasticity/RightBiceps/build_debug/mpi_verification/C/compiler_info.cmake b/FiniteElasticity/RightBiceps/build_debug/mpi_verification/C/compiler_info.cmake new file mode 100644 index 00000000..d0e32634 --- /dev/null +++ b/FiniteElasticity/RightBiceps/build_debug/mpi_verification/C/compiler_info.cmake @@ -0,0 +1,4 @@ + + set(MPI_C_COMPILER_VERSION 5.4.0) + set(MPI_C_COMPILER_ID GNU) + \ No newline at end of file diff --git a/FiniteElasticity/RightBiceps/build_debug/mpi_verification/Fortran/CMakeCache.txt b/FiniteElasticity/RightBiceps/build_debug/mpi_verification/Fortran/CMakeCache.txt new file mode 100644 index 00000000..1d284339 --- /dev/null +++ b/FiniteElasticity/RightBiceps/build_debug/mpi_verification/Fortran/CMakeCache.txt @@ -0,0 +1,275 @@ +# This is the CMakeCache file. +# For build in directory: /store/software/opencmiss/OpenCMISS-examples/FiniteElasticity/RightBiceps/build_debug/mpi_verification/Fortran +# It was generated by CMake: /usr/bin/cmake +# You can edit this file to change values found and used by cmake. +# If you do not want to change any of the values, simply exit the editor. +# If you do want to change a value, simply edit, save, and exit the editor. +# The syntax for the file is as follows: +# KEY:TYPE=VALUE +# KEY is the name of a variable in the cache. +# TYPE is a hint to GUIs for the type of VALUE, DO NOT EDIT TYPE!. +# VALUE is the current value for the KEY. + +######################## +# EXTERNAL cache entries +######################## + +//Path to a program. +CMAKE_AR:FILEPATH=/usr/bin/ar + +//Choose the type of build, options are: None(CMAKE_CXX_FLAGS or +// CMAKE_C_FLAGS used) Debug Release RelWithDebInfo MinSizeRel. +CMAKE_BUILD_TYPE:STRING= + +//Enable/Disable color output during build. +CMAKE_COLOR_MAKEFILE:BOOL=ON + +//Flags used by the linker. +CMAKE_EXE_LINKER_FLAGS:STRING= + +//Flags used by the linker during debug builds. +CMAKE_EXE_LINKER_FLAGS_DEBUG:STRING= + +//Flags used by the linker during release minsize builds. +CMAKE_EXE_LINKER_FLAGS_MINSIZEREL:STRING= + +//Flags used by the linker during release builds. +CMAKE_EXE_LINKER_FLAGS_RELEASE:STRING= + +//Flags used by the linker during Release with Debug Info builds. +CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO:STRING= + +//Enable/Disable output of compile commands during generation. +CMAKE_EXPORT_COMPILE_COMMANDS:BOOL=OFF + +//No help, variable specified on the command line. +CMAKE_Fortran_COMPILER:UNINITIALIZED=/usr/bin/mpif90 + +//Flags for Fortran compiler. +CMAKE_Fortran_FLAGS:STRING= + +//Flags used by the compiler during debug builds. +CMAKE_Fortran_FLAGS_DEBUG:STRING=-g + +//Flags used by the compiler during release builds for minimum +// size. +CMAKE_Fortran_FLAGS_MINSIZEREL:STRING=-Os + +//Flags used by the compiler during release builds. +CMAKE_Fortran_FLAGS_RELEASE:STRING=-O3 + +//Flags used by the compiler during release builds with debug info. +CMAKE_Fortran_FLAGS_RELWITHDEBINFO:STRING=-O2 -g -DNDEBUG + +//Install path prefix, prepended onto install directories. +CMAKE_INSTALL_PREFIX:PATH=/usr/local + +//Path to a program. +CMAKE_LINKER:FILEPATH=/usr/bin/ld + +//Path to a program. +CMAKE_MAKE_PROGRAM:FILEPATH=/usr/bin/make + +//Flags used by the linker during the creation of modules. +CMAKE_MODULE_LINKER_FLAGS:STRING= + +//Flags used by the linker during debug builds. +CMAKE_MODULE_LINKER_FLAGS_DEBUG:STRING= + +//Flags used by the linker during release minsize builds. +CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL:STRING= + +//Flags used by the linker during release builds. +CMAKE_MODULE_LINKER_FLAGS_RELEASE:STRING= + +//Flags used by the linker during Release with Debug Info builds. +CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO:STRING= + +//Path to a program. +CMAKE_NM:FILEPATH=/usr/bin/nm + +//Path to a program. +CMAKE_OBJCOPY:FILEPATH=/usr/bin/objcopy + +//Path to a program. +CMAKE_OBJDUMP:FILEPATH=/usr/bin/objdump + +//Value Computed by CMake +CMAKE_PROJECT_NAME:STATIC=verify_mpi_compat + +//Path to a program. +CMAKE_RANLIB:FILEPATH=/usr/bin/ranlib + +//Flags used by the linker during the creation of dll's. +CMAKE_SHARED_LINKER_FLAGS:STRING= + +//Flags used by the linker during debug builds. +CMAKE_SHARED_LINKER_FLAGS_DEBUG:STRING= + +//Flags used by the linker during release minsize builds. +CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL:STRING= + +//Flags used by the linker during release builds. +CMAKE_SHARED_LINKER_FLAGS_RELEASE:STRING= + +//Flags used by the linker during Release with Debug Info builds. +CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO:STRING= + +//If set, runtime paths are not added when installing shared libraries, +// but are added when building. +CMAKE_SKIP_INSTALL_RPATH:BOOL=NO + +//If set, runtime paths are not added when using shared libraries. +CMAKE_SKIP_RPATH:BOOL=NO + +//Flags used by the linker during the creation of static libraries. +CMAKE_STATIC_LINKER_FLAGS:STRING= + +//Flags used by the linker during debug builds. +CMAKE_STATIC_LINKER_FLAGS_DEBUG:STRING= + +//Flags used by the linker during release minsize builds. +CMAKE_STATIC_LINKER_FLAGS_MINSIZEREL:STRING= + +//Flags used by the linker during release builds. +CMAKE_STATIC_LINKER_FLAGS_RELEASE:STRING= + +//Flags used by the linker during Release with Debug Info builds. +CMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO:STRING= + +//Path to a program. +CMAKE_STRIP:FILEPATH=/usr/bin/strip + +//If this value is on, makefiles will be generated without the +// .SILENT directive, and all commands will be echoed to the console +// during the make. This is useful for debugging only. With Visual +// Studio IDE projects all commands are done without /nologo. +CMAKE_VERBOSE_MAKEFILE:BOOL=FALSE + +//Value Computed by CMake +verify_mpi_compat_BINARY_DIR:STATIC=/store/software/opencmiss/OpenCMISS-examples/FiniteElasticity/RightBiceps/build_debug/mpi_verification/Fortran + +//Value Computed by CMake +verify_mpi_compat_SOURCE_DIR:STATIC=/store/software/opencmiss/OpenCMISS-examples/FiniteElasticity/RightBiceps/build_debug/mpi_verification/Fortran + + +######################## +# INTERNAL cache entries +######################## + +//ADVANCED property for variable: CMAKE_AR +CMAKE_AR-ADVANCED:INTERNAL=1 +//This is the directory where this CMakeCache.txt was created +CMAKE_CACHEFILE_DIR:INTERNAL=/store/software/opencmiss/OpenCMISS-examples/FiniteElasticity/RightBiceps/build_debug/mpi_verification/Fortran +//Major version of cmake used to create the current loaded cache +CMAKE_CACHE_MAJOR_VERSION:INTERNAL=3 +//Minor version of cmake used to create the current loaded cache +CMAKE_CACHE_MINOR_VERSION:INTERNAL=5 +//Patch version of cmake used to create the current loaded cache +CMAKE_CACHE_PATCH_VERSION:INTERNAL=1 +//ADVANCED property for variable: CMAKE_COLOR_MAKEFILE +CMAKE_COLOR_MAKEFILE-ADVANCED:INTERNAL=1 +//Path to CMake executable. +CMAKE_COMMAND:INTERNAL=/usr/bin/cmake +//Path to cpack program executable. +CMAKE_CPACK_COMMAND:INTERNAL=/usr/bin/cpack +//Path to ctest program executable. +CMAKE_CTEST_COMMAND:INTERNAL=/usr/bin/ctest +//Path to cache edit program executable. +CMAKE_EDIT_COMMAND:INTERNAL=/usr/bin/ccmake +//Executable file format +CMAKE_EXECUTABLE_FORMAT:INTERNAL=ELF +//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS +CMAKE_EXE_LINKER_FLAGS-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_DEBUG +CMAKE_EXE_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_MINSIZEREL +CMAKE_EXE_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_RELEASE +CMAKE_EXE_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO +CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_EXPORT_COMPILE_COMMANDS +CMAKE_EXPORT_COMPILE_COMMANDS-ADVANCED:INTERNAL=1 +//Name of external makefile project generator. +CMAKE_EXTRA_GENERATOR:INTERNAL= +//ADVANCED property for variable: CMAKE_Fortran_COMPILER +CMAKE_Fortran_COMPILER-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_Fortran_FLAGS +CMAKE_Fortran_FLAGS-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_Fortran_FLAGS_DEBUG +CMAKE_Fortran_FLAGS_DEBUG-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_Fortran_FLAGS_MINSIZEREL +CMAKE_Fortran_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_Fortran_FLAGS_RELEASE +CMAKE_Fortran_FLAGS_RELEASE-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_Fortran_FLAGS_RELWITHDEBINFO +CMAKE_Fortran_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 +//Name of generator. +CMAKE_GENERATOR:INTERNAL=Unix Makefiles +//Name of generator platform. +CMAKE_GENERATOR_PLATFORM:INTERNAL= +//Name of generator toolset. +CMAKE_GENERATOR_TOOLSET:INTERNAL= +//Source directory with the top level CMakeLists.txt file for this +// project +CMAKE_HOME_DIRECTORY:INTERNAL=/store/software/opencmiss/OpenCMISS-examples/FiniteElasticity/RightBiceps/build_debug/mpi_verification/Fortran +//Install .so files without execute permission. +CMAKE_INSTALL_SO_NO_EXE:INTERNAL=1 +//ADVANCED property for variable: CMAKE_LINKER +CMAKE_LINKER-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_MAKE_PROGRAM +CMAKE_MAKE_PROGRAM-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS +CMAKE_MODULE_LINKER_FLAGS-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS_DEBUG +CMAKE_MODULE_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL +CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS_RELEASE +CMAKE_MODULE_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO +CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_NM +CMAKE_NM-ADVANCED:INTERNAL=1 +//number of local generators +CMAKE_NUMBER_OF_MAKEFILES:INTERNAL=1 +//ADVANCED property for variable: CMAKE_OBJCOPY +CMAKE_OBJCOPY-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_OBJDUMP +CMAKE_OBJDUMP-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_RANLIB +CMAKE_RANLIB-ADVANCED:INTERNAL=1 +//Path to CMake installation. +CMAKE_ROOT:INTERNAL=/usr/share/cmake-3.5 +//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS +CMAKE_SHARED_LINKER_FLAGS-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_DEBUG +CMAKE_SHARED_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL +CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_RELEASE +CMAKE_SHARED_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO +CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_SKIP_INSTALL_RPATH +CMAKE_SKIP_INSTALL_RPATH-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_SKIP_RPATH +CMAKE_SKIP_RPATH-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS +CMAKE_STATIC_LINKER_FLAGS-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS_DEBUG +CMAKE_STATIC_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS_MINSIZEREL +CMAKE_STATIC_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS_RELEASE +CMAKE_STATIC_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO +CMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_STRIP +CMAKE_STRIP-ADVANCED:INTERNAL=1 +//uname command +CMAKE_UNAME:INTERNAL=/bin/uname +//ADVANCED property for variable: CMAKE_VERBOSE_MAKEFILE +CMAKE_VERBOSE_MAKEFILE-ADVANCED:INTERNAL=1 + diff --git a/FiniteElasticity/RightBiceps/build_debug/mpi_verification/Fortran/CMakeFiles/3.5.1/CMakeDetermineCompilerABI_Fortran.bin b/FiniteElasticity/RightBiceps/build_debug/mpi_verification/Fortran/CMakeFiles/3.5.1/CMakeDetermineCompilerABI_Fortran.bin new file mode 100755 index 00000000..72c256a1 Binary files /dev/null and b/FiniteElasticity/RightBiceps/build_debug/mpi_verification/Fortran/CMakeFiles/3.5.1/CMakeDetermineCompilerABI_Fortran.bin differ diff --git a/FiniteElasticity/RightBiceps/build_debug/mpi_verification/Fortran/CMakeFiles/3.5.1/CMakeFortranCompiler.cmake b/FiniteElasticity/RightBiceps/build_debug/mpi_verification/Fortran/CMakeFiles/3.5.1/CMakeFortranCompiler.cmake new file mode 100644 index 00000000..ebd554b3 --- /dev/null +++ b/FiniteElasticity/RightBiceps/build_debug/mpi_verification/Fortran/CMakeFiles/3.5.1/CMakeFortranCompiler.cmake @@ -0,0 +1,59 @@ +set(CMAKE_Fortran_COMPILER "/usr/bin/mpif90") +set(CMAKE_Fortran_COMPILER_ARG1 "") +set(CMAKE_Fortran_COMPILER_ID "GNU") +set(CMAKE_Fortran_COMPILER_VERSION "5.4.0") +set(CMAKE_Fortran_COMPILER_WRAPPER "") +set(CMAKE_Fortran_PLATFORM_ID "") +set(CMAKE_Fortran_SIMULATE_ID "") +set(CMAKE_Fortran_SIMULATE_VERSION "") + +set(CMAKE_AR "/usr/bin/ar") +set(CMAKE_RANLIB "/usr/bin/ranlib") +set(CMAKE_COMPILER_IS_GNUG77 1) +set(CMAKE_Fortran_COMPILER_LOADED 1) +set(CMAKE_Fortran_COMPILER_WORKS TRUE) +set(CMAKE_Fortran_ABI_COMPILED TRUE) +set(CMAKE_COMPILER_IS_MINGW ) +set(CMAKE_COMPILER_IS_CYGWIN ) +if(CMAKE_COMPILER_IS_CYGWIN) + set(CYGWIN 1) + set(UNIX 1) +endif() + +set(CMAKE_Fortran_COMPILER_ENV_VAR "FC") + +set(CMAKE_Fortran_COMPILER_SUPPORTS_F90 1) + +if(CMAKE_COMPILER_IS_MINGW) + set(MINGW 1) +endif() +set(CMAKE_Fortran_COMPILER_ID_RUN 1) +set(CMAKE_Fortran_SOURCE_FILE_EXTENSIONS f;F;f77;F77;f90;F90;for;For;FOR;f95;F95) +set(CMAKE_Fortran_IGNORE_EXTENSIONS h;H;o;O;obj;OBJ;def;DEF;rc;RC) +set(CMAKE_Fortran_LINKER_PREFERENCE 20) +if(UNIX) + set(CMAKE_Fortran_OUTPUT_EXTENSION .o) +else() + set(CMAKE_Fortran_OUTPUT_EXTENSION .obj) +endif() + +# Save compiler ABI information. +set(CMAKE_Fortran_SIZEOF_DATA_PTR "8") +set(CMAKE_Fortran_COMPILER_ABI "") +set(CMAKE_Fortran_LIBRARY_ARCHITECTURE "x86_64-linux-gnu") + +if(CMAKE_Fortran_SIZEOF_DATA_PTR AND NOT CMAKE_SIZEOF_VOID_P) + set(CMAKE_SIZEOF_VOID_P "${CMAKE_Fortran_SIZEOF_DATA_PTR}") +endif() + +if(CMAKE_Fortran_COMPILER_ABI) + set(CMAKE_INTERNAL_PLATFORM_ABI "${CMAKE_Fortran_COMPILER_ABI}") +endif() + +if(CMAKE_Fortran_LIBRARY_ARCHITECTURE) + set(CMAKE_LIBRARY_ARCHITECTURE "x86_64-linux-gnu") +endif() + +set(CMAKE_Fortran_IMPLICIT_LINK_LIBRARIES "mpi_usempif08;mpi_usempi_ignore_tkr;mpi_mpifh;mpi;gfortran;m;quadmath;m;pthread;c") +set(CMAKE_Fortran_IMPLICIT_LINK_DIRECTORIES "/usr/lib/openmpi/lib;/usr/lib/gcc/x86_64-linux-gnu/5;/usr/lib/x86_64-linux-gnu;/usr/lib;/lib/x86_64-linux-gnu;/lib") +set(CMAKE_Fortran_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES "") diff --git a/FiniteElasticity/RightBiceps/build_debug/mpi_verification/Fortran/CMakeFiles/3.5.1/CMakeSystem.cmake b/FiniteElasticity/RightBiceps/build_debug/mpi_verification/Fortran/CMakeFiles/3.5.1/CMakeSystem.cmake new file mode 100644 index 00000000..84375768 --- /dev/null +++ b/FiniteElasticity/RightBiceps/build_debug/mpi_verification/Fortran/CMakeFiles/3.5.1/CMakeSystem.cmake @@ -0,0 +1,15 @@ +set(CMAKE_HOST_SYSTEM "Linux-4.4.0-104-generic") +set(CMAKE_HOST_SYSTEM_NAME "Linux") +set(CMAKE_HOST_SYSTEM_VERSION "4.4.0-104-generic") +set(CMAKE_HOST_SYSTEM_PROCESSOR "x86_64") + + + +set(CMAKE_SYSTEM "Linux-4.4.0-104-generic") +set(CMAKE_SYSTEM_NAME "Linux") +set(CMAKE_SYSTEM_VERSION "4.4.0-104-generic") +set(CMAKE_SYSTEM_PROCESSOR "x86_64") + +set(CMAKE_CROSSCOMPILING "FALSE") + +set(CMAKE_SYSTEM_LOADED 1) diff --git a/FiniteElasticity/RightBiceps/build_debug/mpi_verification/Fortran/CMakeFiles/3.5.1/CompilerIdFortran/CMakeFortranCompilerId.F b/FiniteElasticity/RightBiceps/build_debug/mpi_verification/Fortran/CMakeFiles/3.5.1/CompilerIdFortran/CMakeFortranCompilerId.F new file mode 100644 index 00000000..0e149618 --- /dev/null +++ b/FiniteElasticity/RightBiceps/build_debug/mpi_verification/Fortran/CMakeFiles/3.5.1/CompilerIdFortran/CMakeFortranCompilerId.F @@ -0,0 +1,1048 @@ + PROGRAM CMakeFortranCompilerId +#if 0 +! Identify the compiler +#endif +#if defined(__INTEL_COMPILER) || defined(__ICC) + PRINT *, 'INFO:compiler[Intel]' +# define COMPILER_VERSION_MAJOR DEC(__INTEL_COMPILER/100) +# define COMPILER_VERSION_MINOR DEC(__INTEL_COMPILER/10 % 10) +# if defined(__INTEL_COMPILER_UPDATE) +# define COMPILER_VERSION_PATCH DEC(__INTEL_COMPILER_UPDATE) +# else +# define COMPILER_VERSION_PATCH DEC(__INTEL_COMPILER % 10) +# endif +# if defined(__INTEL_COMPILER_BUILD_DATE) +# define COMPILER_VERSION_TWEAK DEC(__INTEL_COMPILER_BUILD_DATE) +# endif + +# if defined(_MSC_VER) + PRINT *, 'INFO:simulate[MSVC]' +# if _MSC_VER >= 1900 + PRINT *, 'INFO:simulate_version[019.00]' +# elif _MSC_VER >= 1800 + PRINT *, 'INFO:simulate_version[018.00]' +# elif _MSC_VER >= 1700 + PRINT *, 'INFO:simulate_version[017.00]' +# elif _MSC_VER >= 1600 + PRINT *, 'INFO:simulate_version[016.00]' +# elif _MSC_VER >= 1500 + PRINT *, 'INFO:simulate_version[015.00]' +# elif _MSC_VER >= 1400 + PRINT *, 'INFO:simulate_version[014.00]' +# elif _MSC_VER >= 1310 + PRINT *, 'INFO:simulate_version[013.01]' +# else + PRINT *, 'INFO:simulate_version[013.00]' +# endif +# endif +#elif defined(__SUNPRO_F95) + PRINT *, 'INFO:compiler[SunPro]' +# define COMPILER_VERSION_MAJOR HEX(__SUNPRO_F95>>8) +# define COMPILER_VERSION_MINOR HEX(__SUNPRO_F95>>4 & 0xF) +# define COMPILER_VERSION_PATCH HEX(__SUNPRO_F95 & 0xF) +#elif defined(__SUNPRO_F90) + PRINT *, 'INFO:compiler[SunPro]' +# define COMPILER_VERSION_MAJOR HEX(__SUNPRO_F90>>8) +# define COMPILER_VERSION_MINOR HEX(__SUNPRO_F90>>4 & 0xF) +# define COMPILER_VERSION_PATCH HEX(__SUNPRO_F90 & 0xF) +#elif defined(_CRAYFTN) + PRINT *, 'INFO:compiler[Cray]' +# define COMPILER_VERSION_MAJOR DEC(_RELEASE_MAJOR) +# define COMPILER_VERSION_MINOR DEC(_RELEASE_MINOR) +#elif defined(__G95__) + PRINT *, 'INFO:compiler[G95]' +# define COMPILER_VERSION_MAJOR DEC(__G95__) +# define COMPILER_VERSION_MINOR DEC(__G95_MINOR__) +#elif defined(__PATHSCALE__) + PRINT *, 'INFO:compiler[PathScale]' +# define COMPILER_VERSION_MAJOR DEC(__PATHCC__) +# define COMPILER_VERSION_MINOR DEC(__PATHCC_MINOR__) +# if defined(__PATHCC_PATCHLEVEL__) +# define COMPILER_VERSION_PATCH DEC(__PATHCC_PATCHLEVEL__) +# endif +#elif defined(__ABSOFT__) + PRINT *, 'INFO:compiler[Absoft]' +#elif defined(__GNUC__) + PRINT *, 'INFO:compiler[GNU]' +# define COMPILER_VERSION_MAJOR DEC(__GNUC__) +# define COMPILER_VERSION_MINOR DEC(__GNUC_MINOR__) +# if defined(__GNUC_PATCHLEVEL__) +# define COMPILER_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__) +# endif +#elif defined(__IBMC__) +# if defined(__COMPILER_VER__) + PRINT *, 'INFO:compiler[zOS]' +# elif __IBMC__ >= 800 + PRINT *, 'INFO:compiler[XL]' +# define COMPILER_VERSION_MAJOR DEC(__IBMC__/100) +# define COMPILER_VERSION_MINOR DEC(__IBMC__/10 % 10) +# define COMPILER_VERSION_PATCH DEC(__IBMC__ % 10) +# else + PRINT *, 'INFO:compiler[VisualAge]' +# define COMPILER_VERSION_MAJOR DEC(__IBMC__/100) +# define COMPILER_VERSION_MINOR DEC(__IBMC__/10 % 10) +# define COMPILER_VERSION_PATCH DEC(__IBMC__ % 10) +# endif +#elif defined(__PGI) + PRINT *, 'INFO:compiler[PGI]' +# define COMPILER_VERSION_MAJOR DEC(__PGIC__) +# define COMPILER_VERSION_MINOR DEC(__PGIC_MINOR__) +# if defined(__PGIC_PATCHLEVEL__) +# define COMPILER_VERSION_PATCH DEC(__PGIC_PATCHLEVEL__) +# endif +#elif defined(_SGI_COMPILER_VERSION) || defined(_COMPILER_VERSION) + PRINT *, 'INFO:compiler[MIPSpro]' +# if 0 +! This compiler is either not known or is too old to define an +! identification macro. Try to identify the platform and guess that +! it is the native compiler. +# endif +#elif defined(_AIX) || defined(__AIX) || defined(__AIX__) || defined(__aix) || defined(__aix__) + PRINT *, 'INFO:compiler[VisualAge]' +#elif defined(__sgi) || defined(__sgi__) || defined(_SGI) + PRINT *, 'INFO:compiler[MIPSpro]' +#elif defined(__hpux) || defined(__hpux__) + PRINT *, 'INFO:compiler[HP]' +#elif 1 +# if 0 +! The above 'elif 1' instead of 'else' is to work around a bug in the +! SGI preprocessor which produces both the __sgi and else blocks. +# endif + PRINT *, 'INFO:compiler[]' +#endif +#if defined(__CRAYXE) || defined(__CRAYXC) + PRINT *, 'INFO:compiler_wrapper[CrayPrgEnv]' +#endif + +#if 0 +! Identify the platform +#endif +#if defined(__linux) || defined(__linux__) || defined(linux) + PRINT *, 'INFO:platform[Linux]' +#elif defined(__CYGWIN__) + PRINT *, 'INFO:platform[Cygwin]' +#elif defined(__MINGW32__) + PRINT *, 'INFO:platform[MinGW]' +#elif defined(__APPLE__) + PRINT *, 'INFO:platform[Darwin]' +#elif defined(_WIN32) || defined(__WIN32__) || defined(WIN32) + PRINT *, 'INFO:platform[Windows]' +#elif defined(__FreeBSD__) || defined(__FreeBSD) + PRINT *, 'INFO:platform[FreeBSD]' +#elif defined(__NetBSD__) || defined(__NetBSD) + PRINT *, 'INFO:platform[NetBSD]' +#elif defined(__OpenBSD__) || defined(__OPENBSD) + PRINT *, 'INFO:platform[OpenBSD]' +#elif defined(__sun) || defined(sun) + PRINT *, 'INFO:platform[SunOS]' +#elif defined(_AIX) || defined(__AIX) || defined(__AIX__) || defined(__aix) || defined(__aix__) + PRINT *, 'INFO:platform[AIX]' +#elif defined(__sgi) || defined(__sgi__) || defined(_SGI) + PRINT *, 'INFO:platform[IRIX]' +#elif defined(__hpux) || defined(__hpux__) + PRINT *, 'INFO:platform[HP-UX]' +#elif defined(__HAIKU__) + PRINT *, 'INFO:platform[Haiku]' +#elif defined(__BeOS) || defined(__BEOS__) || defined(_BEOS) + PRINT *, 'INFO:platform[BeOS]' +#elif defined(__QNX__) || defined(__QNXNTO__) + PRINT *, 'INFO:platform[QNX]' +#elif defined(__tru64) || defined(_tru64) || defined(__TRU64__) + PRINT *, 'INFO:platform[Tru64]' +#elif defined(__riscos) || defined(__riscos__) + PRINT *, 'INFO:platform[RISCos]' +#elif defined(__sinix) || defined(__sinix__) || defined(__SINIX__) + PRINT *, 'INFO:platform[SINIX]' +#elif defined(__UNIX_SV__) + PRINT *, 'INFO:platform[UNIX_SV]' +#elif defined(__bsdos__) + PRINT *, 'INFO:platform[BSDOS]' +#elif defined(_MPRAS) || defined(MPRAS) + PRINT *, 'INFO:platform[MP-RAS]' +#elif defined(__osf) || defined(__osf__) + PRINT *, 'INFO:platform[OSF1]' +#elif defined(_SCO_SV) || defined(SCO_SV) || defined(sco_sv) + PRINT *, 'INFO:platform[SCO_SV]' +#elif defined(__ultrix) || defined(__ultrix__) || defined(_ULTRIX) + PRINT *, 'INFO:platform[ULTRIX]' +#elif defined(__XENIX__) || defined(_XENIX) || defined(XENIX) + PRINT *, 'INFO:platform[Xenix]' +#elif 1 +# if 0 +! The above 'elif 1' instead of 'else' is to work around a bug in the +! SGI preprocessor which produces both the __sgi and else blocks. +# endif + PRINT *, 'INFO:platform[]' +#endif +#if defined(_WIN32) && (defined(__INTEL_COMPILER) || defined(__ICC)) +# if defined(_M_IA64) + PRINT *, 'INFO:arch[IA64]' +# elif defined(_M_X64) || defined(_M_AMD64) + PRINT *, 'INFO:arch[x64]' +# elif defined(_M_IX86) + PRINT *, 'INFO:arch[X86]' +# endif +#endif + +#if 0 +! Encode compiler version digits +#endif +#define DEC_8(n) (((n) / 10000000) % 10) +#define DEC_7(n) (((n) / 1000000) % 10) +#define DEC_6(n) (((n) / 100000) % 10) +#define DEC_5(n) (((n) / 10000) % 10) +#define DEC_4(n) (((n) / 1000) % 10) +#define DEC_3(n) (((n) / 100) % 10) +#define DEC_2(n) (((n) / 10) % 10) +#define DEC_1(n) (((n) ) % 10) +#define HEX_8(n) ((n)>>28 & 0xF) +#define HEX_7(n) ((n)>>24 & 0xF) +#define HEX_6(n) ((n)>>20 & 0xF) +#define HEX_5(n) ((n)>>16 & 0xF) +#define HEX_4(n) ((n)>>12 & 0xF) +#define HEX_3(n) ((n)>>8 & 0xF) +#define HEX_2(n) ((n)>>4 & 0xF) +#define HEX_1(n) ((n) & 0xF) + +#if defined(COMPILER_VERSION_MAJOR) +# undef DEC +# undef HEX +# define DEC(n) DEC_1(n) +# define HEX(n) HEX_1(n) +# if COMPILER_VERSION_MAJOR == 0 + PRINT *, 'INFO:compiler_version_MAJOR_digit_1[0]' +# elif COMPILER_VERSION_MAJOR == 1 + PRINT *, 'INFO:compiler_version_MAJOR_digit_1[1]' +# elif COMPILER_VERSION_MAJOR == 2 + PRINT *, 'INFO:compiler_version_MAJOR_digit_1[2]' +# elif COMPILER_VERSION_MAJOR == 3 + PRINT *, 'INFO:compiler_version_MAJOR_digit_1[3]' +# elif COMPILER_VERSION_MAJOR == 4 + PRINT *, 'INFO:compiler_version_MAJOR_digit_1[4]' +# elif COMPILER_VERSION_MAJOR == 5 + PRINT *, 'INFO:compiler_version_MAJOR_digit_1[5]' +# elif COMPILER_VERSION_MAJOR == 6 + PRINT *, 'INFO:compiler_version_MAJOR_digit_1[6]' +# elif COMPILER_VERSION_MAJOR == 7 + PRINT *, 'INFO:compiler_version_MAJOR_digit_1[7]' +# elif COMPILER_VERSION_MAJOR == 8 + PRINT *, 'INFO:compiler_version_MAJOR_digit_1[8]' +# elif COMPILER_VERSION_MAJOR == 9 + PRINT *, 'INFO:compiler_version_MAJOR_digit_1[9]' +# endif + +# undef DEC +# undef HEX +# define DEC(n) DEC_2(n) +# define HEX(n) HEX_2(n) +# if COMPILER_VERSION_MAJOR == 0 + PRINT *, 'INFO:compiler_version_MAJOR_digit_2[0]' +# elif COMPILER_VERSION_MAJOR == 1 + PRINT *, 'INFO:compiler_version_MAJOR_digit_2[1]' +# elif COMPILER_VERSION_MAJOR == 2 + PRINT *, 'INFO:compiler_version_MAJOR_digit_2[2]' +# elif COMPILER_VERSION_MAJOR == 3 + PRINT *, 'INFO:compiler_version_MAJOR_digit_2[3]' +# elif COMPILER_VERSION_MAJOR == 4 + PRINT *, 'INFO:compiler_version_MAJOR_digit_2[4]' +# elif COMPILER_VERSION_MAJOR == 5 + PRINT *, 'INFO:compiler_version_MAJOR_digit_2[5]' +# elif COMPILER_VERSION_MAJOR == 6 + PRINT *, 'INFO:compiler_version_MAJOR_digit_2[6]' +# elif COMPILER_VERSION_MAJOR == 7 + PRINT *, 'INFO:compiler_version_MAJOR_digit_2[7]' +# elif COMPILER_VERSION_MAJOR == 8 + PRINT *, 'INFO:compiler_version_MAJOR_digit_2[8]' +# elif COMPILER_VERSION_MAJOR == 9 + PRINT *, 'INFO:compiler_version_MAJOR_digit_2[9]' +# endif + +# undef DEC +# undef HEX +# define DEC(n) DEC_3(n) +# define HEX(n) HEX_3(n) +# if COMPILER_VERSION_MAJOR == 0 + PRINT *, 'INFO:compiler_version_MAJOR_digit_3[0]' +# elif COMPILER_VERSION_MAJOR == 1 + PRINT *, 'INFO:compiler_version_MAJOR_digit_3[1]' +# elif COMPILER_VERSION_MAJOR == 2 + PRINT *, 'INFO:compiler_version_MAJOR_digit_3[2]' +# elif COMPILER_VERSION_MAJOR == 3 + PRINT *, 'INFO:compiler_version_MAJOR_digit_3[3]' +# elif COMPILER_VERSION_MAJOR == 4 + PRINT *, 'INFO:compiler_version_MAJOR_digit_3[4]' +# elif COMPILER_VERSION_MAJOR == 5 + PRINT *, 'INFO:compiler_version_MAJOR_digit_3[5]' +# elif COMPILER_VERSION_MAJOR == 6 + PRINT *, 'INFO:compiler_version_MAJOR_digit_3[6]' +# elif COMPILER_VERSION_MAJOR == 7 + PRINT *, 'INFO:compiler_version_MAJOR_digit_3[7]' +# elif COMPILER_VERSION_MAJOR == 8 + PRINT *, 'INFO:compiler_version_MAJOR_digit_3[8]' +# elif COMPILER_VERSION_MAJOR == 9 + PRINT *, 'INFO:compiler_version_MAJOR_digit_3[9]' +# endif + +# undef DEC +# undef HEX +# define DEC(n) DEC_4(n) +# define HEX(n) HEX_4(n) +# if COMPILER_VERSION_MAJOR == 0 + PRINT *, 'INFO:compiler_version_MAJOR_digit_4[0]' +# elif COMPILER_VERSION_MAJOR == 1 + PRINT *, 'INFO:compiler_version_MAJOR_digit_4[1]' +# elif COMPILER_VERSION_MAJOR == 2 + PRINT *, 'INFO:compiler_version_MAJOR_digit_4[2]' +# elif COMPILER_VERSION_MAJOR == 3 + PRINT *, 'INFO:compiler_version_MAJOR_digit_4[3]' +# elif COMPILER_VERSION_MAJOR == 4 + PRINT *, 'INFO:compiler_version_MAJOR_digit_4[4]' +# elif COMPILER_VERSION_MAJOR == 5 + PRINT *, 'INFO:compiler_version_MAJOR_digit_4[5]' +# elif COMPILER_VERSION_MAJOR == 6 + PRINT *, 'INFO:compiler_version_MAJOR_digit_4[6]' +# elif COMPILER_VERSION_MAJOR == 7 + PRINT *, 'INFO:compiler_version_MAJOR_digit_4[7]' +# elif COMPILER_VERSION_MAJOR == 8 + PRINT *, 'INFO:compiler_version_MAJOR_digit_4[8]' +# elif COMPILER_VERSION_MAJOR == 9 + PRINT *, 'INFO:compiler_version_MAJOR_digit_4[9]' +# endif + +# undef DEC +# undef HEX +# define DEC(n) DEC_5(n) +# define HEX(n) HEX_5(n) +# if COMPILER_VERSION_MAJOR == 0 + PRINT *, 'INFO:compiler_version_MAJOR_digit_5[0]' +# elif COMPILER_VERSION_MAJOR == 1 + PRINT *, 'INFO:compiler_version_MAJOR_digit_5[1]' +# elif COMPILER_VERSION_MAJOR == 2 + PRINT *, 'INFO:compiler_version_MAJOR_digit_5[2]' +# elif COMPILER_VERSION_MAJOR == 3 + PRINT *, 'INFO:compiler_version_MAJOR_digit_5[3]' +# elif COMPILER_VERSION_MAJOR == 4 + PRINT *, 'INFO:compiler_version_MAJOR_digit_5[4]' +# elif COMPILER_VERSION_MAJOR == 5 + PRINT *, 'INFO:compiler_version_MAJOR_digit_5[5]' +# elif COMPILER_VERSION_MAJOR == 6 + PRINT *, 'INFO:compiler_version_MAJOR_digit_5[6]' +# elif COMPILER_VERSION_MAJOR == 7 + PRINT *, 'INFO:compiler_version_MAJOR_digit_5[7]' +# elif COMPILER_VERSION_MAJOR == 8 + PRINT *, 'INFO:compiler_version_MAJOR_digit_5[8]' +# elif COMPILER_VERSION_MAJOR == 9 + PRINT *, 'INFO:compiler_version_MAJOR_digit_5[9]' +# endif + +# undef DEC +# undef HEX +# define DEC(n) DEC_6(n) +# define HEX(n) HEX_6(n) +# if COMPILER_VERSION_MAJOR == 0 + PRINT *, 'INFO:compiler_version_MAJOR_digit_6[0]' +# elif COMPILER_VERSION_MAJOR == 1 + PRINT *, 'INFO:compiler_version_MAJOR_digit_6[1]' +# elif COMPILER_VERSION_MAJOR == 2 + PRINT *, 'INFO:compiler_version_MAJOR_digit_6[2]' +# elif COMPILER_VERSION_MAJOR == 3 + PRINT *, 'INFO:compiler_version_MAJOR_digit_6[3]' +# elif COMPILER_VERSION_MAJOR == 4 + PRINT *, 'INFO:compiler_version_MAJOR_digit_6[4]' +# elif COMPILER_VERSION_MAJOR == 5 + PRINT *, 'INFO:compiler_version_MAJOR_digit_6[5]' +# elif COMPILER_VERSION_MAJOR == 6 + PRINT *, 'INFO:compiler_version_MAJOR_digit_6[6]' +# elif COMPILER_VERSION_MAJOR == 7 + PRINT *, 'INFO:compiler_version_MAJOR_digit_6[7]' +# elif COMPILER_VERSION_MAJOR == 8 + PRINT *, 'INFO:compiler_version_MAJOR_digit_6[8]' +# elif COMPILER_VERSION_MAJOR == 9 + PRINT *, 'INFO:compiler_version_MAJOR_digit_6[9]' +# endif + +# undef DEC +# undef HEX +# define DEC(n) DEC_7(n) +# define HEX(n) HEX_7(n) +# if COMPILER_VERSION_MAJOR == 0 + PRINT *, 'INFO:compiler_version_MAJOR_digit_7[0]' +# elif COMPILER_VERSION_MAJOR == 1 + PRINT *, 'INFO:compiler_version_MAJOR_digit_7[1]' +# elif COMPILER_VERSION_MAJOR == 2 + PRINT *, 'INFO:compiler_version_MAJOR_digit_7[2]' +# elif COMPILER_VERSION_MAJOR == 3 + PRINT *, 'INFO:compiler_version_MAJOR_digit_7[3]' +# elif COMPILER_VERSION_MAJOR == 4 + PRINT *, 'INFO:compiler_version_MAJOR_digit_7[4]' +# elif COMPILER_VERSION_MAJOR == 5 + PRINT *, 'INFO:compiler_version_MAJOR_digit_7[5]' +# elif COMPILER_VERSION_MAJOR == 6 + PRINT *, 'INFO:compiler_version_MAJOR_digit_7[6]' +# elif COMPILER_VERSION_MAJOR == 7 + PRINT *, 'INFO:compiler_version_MAJOR_digit_7[7]' +# elif COMPILER_VERSION_MAJOR == 8 + PRINT *, 'INFO:compiler_version_MAJOR_digit_7[8]' +# elif COMPILER_VERSION_MAJOR == 9 + PRINT *, 'INFO:compiler_version_MAJOR_digit_7[9]' +# endif + +# undef DEC +# undef HEX +# define DEC(n) DEC_8(n) +# define HEX(n) HEX_8(n) +# if COMPILER_VERSION_MAJOR == 0 + PRINT *, 'INFO:compiler_version_MAJOR_digit_8[0]' +# elif COMPILER_VERSION_MAJOR == 1 + PRINT *, 'INFO:compiler_version_MAJOR_digit_8[1]' +# elif COMPILER_VERSION_MAJOR == 2 + PRINT *, 'INFO:compiler_version_MAJOR_digit_8[2]' +# elif COMPILER_VERSION_MAJOR == 3 + PRINT *, 'INFO:compiler_version_MAJOR_digit_8[3]' +# elif COMPILER_VERSION_MAJOR == 4 + PRINT *, 'INFO:compiler_version_MAJOR_digit_8[4]' +# elif COMPILER_VERSION_MAJOR == 5 + PRINT *, 'INFO:compiler_version_MAJOR_digit_8[5]' +# elif COMPILER_VERSION_MAJOR == 6 + PRINT *, 'INFO:compiler_version_MAJOR_digit_8[6]' +# elif COMPILER_VERSION_MAJOR == 7 + PRINT *, 'INFO:compiler_version_MAJOR_digit_8[7]' +# elif COMPILER_VERSION_MAJOR == 8 + PRINT *, 'INFO:compiler_version_MAJOR_digit_8[8]' +# elif COMPILER_VERSION_MAJOR == 9 + PRINT *, 'INFO:compiler_version_MAJOR_digit_8[9]' +# endif + +#endif +#if defined(COMPILER_VERSION_MINOR) +# undef DEC +# undef HEX +# define DEC(n) DEC_1(n) +# define HEX(n) HEX_1(n) +# if COMPILER_VERSION_MINOR == 0 + PRINT *, 'INFO:compiler_version_MINOR_digit_1[0]' +# elif COMPILER_VERSION_MINOR == 1 + PRINT *, 'INFO:compiler_version_MINOR_digit_1[1]' +# elif COMPILER_VERSION_MINOR == 2 + PRINT *, 'INFO:compiler_version_MINOR_digit_1[2]' +# elif COMPILER_VERSION_MINOR == 3 + PRINT *, 'INFO:compiler_version_MINOR_digit_1[3]' +# elif COMPILER_VERSION_MINOR == 4 + PRINT *, 'INFO:compiler_version_MINOR_digit_1[4]' +# elif COMPILER_VERSION_MINOR == 5 + PRINT *, 'INFO:compiler_version_MINOR_digit_1[5]' +# elif COMPILER_VERSION_MINOR == 6 + PRINT *, 'INFO:compiler_version_MINOR_digit_1[6]' +# elif COMPILER_VERSION_MINOR == 7 + PRINT *, 'INFO:compiler_version_MINOR_digit_1[7]' +# elif COMPILER_VERSION_MINOR == 8 + PRINT *, 'INFO:compiler_version_MINOR_digit_1[8]' +# elif COMPILER_VERSION_MINOR == 9 + PRINT *, 'INFO:compiler_version_MINOR_digit_1[9]' +# endif + +# undef DEC +# undef HEX +# define DEC(n) DEC_2(n) +# define HEX(n) HEX_2(n) +# if COMPILER_VERSION_MINOR == 0 + PRINT *, 'INFO:compiler_version_MINOR_digit_2[0]' +# elif COMPILER_VERSION_MINOR == 1 + PRINT *, 'INFO:compiler_version_MINOR_digit_2[1]' +# elif COMPILER_VERSION_MINOR == 2 + PRINT *, 'INFO:compiler_version_MINOR_digit_2[2]' +# elif COMPILER_VERSION_MINOR == 3 + PRINT *, 'INFO:compiler_version_MINOR_digit_2[3]' +# elif COMPILER_VERSION_MINOR == 4 + PRINT *, 'INFO:compiler_version_MINOR_digit_2[4]' +# elif COMPILER_VERSION_MINOR == 5 + PRINT *, 'INFO:compiler_version_MINOR_digit_2[5]' +# elif COMPILER_VERSION_MINOR == 6 + PRINT *, 'INFO:compiler_version_MINOR_digit_2[6]' +# elif COMPILER_VERSION_MINOR == 7 + PRINT *, 'INFO:compiler_version_MINOR_digit_2[7]' +# elif COMPILER_VERSION_MINOR == 8 + PRINT *, 'INFO:compiler_version_MINOR_digit_2[8]' +# elif COMPILER_VERSION_MINOR == 9 + PRINT *, 'INFO:compiler_version_MINOR_digit_2[9]' +# endif + +# undef DEC +# undef HEX +# define DEC(n) DEC_3(n) +# define HEX(n) HEX_3(n) +# if COMPILER_VERSION_MINOR == 0 + PRINT *, 'INFO:compiler_version_MINOR_digit_3[0]' +# elif COMPILER_VERSION_MINOR == 1 + PRINT *, 'INFO:compiler_version_MINOR_digit_3[1]' +# elif COMPILER_VERSION_MINOR == 2 + PRINT *, 'INFO:compiler_version_MINOR_digit_3[2]' +# elif COMPILER_VERSION_MINOR == 3 + PRINT *, 'INFO:compiler_version_MINOR_digit_3[3]' +# elif COMPILER_VERSION_MINOR == 4 + PRINT *, 'INFO:compiler_version_MINOR_digit_3[4]' +# elif COMPILER_VERSION_MINOR == 5 + PRINT *, 'INFO:compiler_version_MINOR_digit_3[5]' +# elif COMPILER_VERSION_MINOR == 6 + PRINT *, 'INFO:compiler_version_MINOR_digit_3[6]' +# elif COMPILER_VERSION_MINOR == 7 + PRINT *, 'INFO:compiler_version_MINOR_digit_3[7]' +# elif COMPILER_VERSION_MINOR == 8 + PRINT *, 'INFO:compiler_version_MINOR_digit_3[8]' +# elif COMPILER_VERSION_MINOR == 9 + PRINT *, 'INFO:compiler_version_MINOR_digit_3[9]' +# endif + +# undef DEC +# undef HEX +# define DEC(n) DEC_4(n) +# define HEX(n) HEX_4(n) +# if COMPILER_VERSION_MINOR == 0 + PRINT *, 'INFO:compiler_version_MINOR_digit_4[0]' +# elif COMPILER_VERSION_MINOR == 1 + PRINT *, 'INFO:compiler_version_MINOR_digit_4[1]' +# elif COMPILER_VERSION_MINOR == 2 + PRINT *, 'INFO:compiler_version_MINOR_digit_4[2]' +# elif COMPILER_VERSION_MINOR == 3 + PRINT *, 'INFO:compiler_version_MINOR_digit_4[3]' +# elif COMPILER_VERSION_MINOR == 4 + PRINT *, 'INFO:compiler_version_MINOR_digit_4[4]' +# elif COMPILER_VERSION_MINOR == 5 + PRINT *, 'INFO:compiler_version_MINOR_digit_4[5]' +# elif COMPILER_VERSION_MINOR == 6 + PRINT *, 'INFO:compiler_version_MINOR_digit_4[6]' +# elif COMPILER_VERSION_MINOR == 7 + PRINT *, 'INFO:compiler_version_MINOR_digit_4[7]' +# elif COMPILER_VERSION_MINOR == 8 + PRINT *, 'INFO:compiler_version_MINOR_digit_4[8]' +# elif COMPILER_VERSION_MINOR == 9 + PRINT *, 'INFO:compiler_version_MINOR_digit_4[9]' +# endif + +# undef DEC +# undef HEX +# define DEC(n) DEC_5(n) +# define HEX(n) HEX_5(n) +# if COMPILER_VERSION_MINOR == 0 + PRINT *, 'INFO:compiler_version_MINOR_digit_5[0]' +# elif COMPILER_VERSION_MINOR == 1 + PRINT *, 'INFO:compiler_version_MINOR_digit_5[1]' +# elif COMPILER_VERSION_MINOR == 2 + PRINT *, 'INFO:compiler_version_MINOR_digit_5[2]' +# elif COMPILER_VERSION_MINOR == 3 + PRINT *, 'INFO:compiler_version_MINOR_digit_5[3]' +# elif COMPILER_VERSION_MINOR == 4 + PRINT *, 'INFO:compiler_version_MINOR_digit_5[4]' +# elif COMPILER_VERSION_MINOR == 5 + PRINT *, 'INFO:compiler_version_MINOR_digit_5[5]' +# elif COMPILER_VERSION_MINOR == 6 + PRINT *, 'INFO:compiler_version_MINOR_digit_5[6]' +# elif COMPILER_VERSION_MINOR == 7 + PRINT *, 'INFO:compiler_version_MINOR_digit_5[7]' +# elif COMPILER_VERSION_MINOR == 8 + PRINT *, 'INFO:compiler_version_MINOR_digit_5[8]' +# elif COMPILER_VERSION_MINOR == 9 + PRINT *, 'INFO:compiler_version_MINOR_digit_5[9]' +# endif + +# undef DEC +# undef HEX +# define DEC(n) DEC_6(n) +# define HEX(n) HEX_6(n) +# if COMPILER_VERSION_MINOR == 0 + PRINT *, 'INFO:compiler_version_MINOR_digit_6[0]' +# elif COMPILER_VERSION_MINOR == 1 + PRINT *, 'INFO:compiler_version_MINOR_digit_6[1]' +# elif COMPILER_VERSION_MINOR == 2 + PRINT *, 'INFO:compiler_version_MINOR_digit_6[2]' +# elif COMPILER_VERSION_MINOR == 3 + PRINT *, 'INFO:compiler_version_MINOR_digit_6[3]' +# elif COMPILER_VERSION_MINOR == 4 + PRINT *, 'INFO:compiler_version_MINOR_digit_6[4]' +# elif COMPILER_VERSION_MINOR == 5 + PRINT *, 'INFO:compiler_version_MINOR_digit_6[5]' +# elif COMPILER_VERSION_MINOR == 6 + PRINT *, 'INFO:compiler_version_MINOR_digit_6[6]' +# elif COMPILER_VERSION_MINOR == 7 + PRINT *, 'INFO:compiler_version_MINOR_digit_6[7]' +# elif COMPILER_VERSION_MINOR == 8 + PRINT *, 'INFO:compiler_version_MINOR_digit_6[8]' +# elif COMPILER_VERSION_MINOR == 9 + PRINT *, 'INFO:compiler_version_MINOR_digit_6[9]' +# endif + +# undef DEC +# undef HEX +# define DEC(n) DEC_7(n) +# define HEX(n) HEX_7(n) +# if COMPILER_VERSION_MINOR == 0 + PRINT *, 'INFO:compiler_version_MINOR_digit_7[0]' +# elif COMPILER_VERSION_MINOR == 1 + PRINT *, 'INFO:compiler_version_MINOR_digit_7[1]' +# elif COMPILER_VERSION_MINOR == 2 + PRINT *, 'INFO:compiler_version_MINOR_digit_7[2]' +# elif COMPILER_VERSION_MINOR == 3 + PRINT *, 'INFO:compiler_version_MINOR_digit_7[3]' +# elif COMPILER_VERSION_MINOR == 4 + PRINT *, 'INFO:compiler_version_MINOR_digit_7[4]' +# elif COMPILER_VERSION_MINOR == 5 + PRINT *, 'INFO:compiler_version_MINOR_digit_7[5]' +# elif COMPILER_VERSION_MINOR == 6 + PRINT *, 'INFO:compiler_version_MINOR_digit_7[6]' +# elif COMPILER_VERSION_MINOR == 7 + PRINT *, 'INFO:compiler_version_MINOR_digit_7[7]' +# elif COMPILER_VERSION_MINOR == 8 + PRINT *, 'INFO:compiler_version_MINOR_digit_7[8]' +# elif COMPILER_VERSION_MINOR == 9 + PRINT *, 'INFO:compiler_version_MINOR_digit_7[9]' +# endif + +# undef DEC +# undef HEX +# define DEC(n) DEC_8(n) +# define HEX(n) HEX_8(n) +# if COMPILER_VERSION_MINOR == 0 + PRINT *, 'INFO:compiler_version_MINOR_digit_8[0]' +# elif COMPILER_VERSION_MINOR == 1 + PRINT *, 'INFO:compiler_version_MINOR_digit_8[1]' +# elif COMPILER_VERSION_MINOR == 2 + PRINT *, 'INFO:compiler_version_MINOR_digit_8[2]' +# elif COMPILER_VERSION_MINOR == 3 + PRINT *, 'INFO:compiler_version_MINOR_digit_8[3]' +# elif COMPILER_VERSION_MINOR == 4 + PRINT *, 'INFO:compiler_version_MINOR_digit_8[4]' +# elif COMPILER_VERSION_MINOR == 5 + PRINT *, 'INFO:compiler_version_MINOR_digit_8[5]' +# elif COMPILER_VERSION_MINOR == 6 + PRINT *, 'INFO:compiler_version_MINOR_digit_8[6]' +# elif COMPILER_VERSION_MINOR == 7 + PRINT *, 'INFO:compiler_version_MINOR_digit_8[7]' +# elif COMPILER_VERSION_MINOR == 8 + PRINT *, 'INFO:compiler_version_MINOR_digit_8[8]' +# elif COMPILER_VERSION_MINOR == 9 + PRINT *, 'INFO:compiler_version_MINOR_digit_8[9]' +# endif + +#endif +#if defined(COMPILER_VERSION_PATCH) +# undef DEC +# undef HEX +# define DEC(n) DEC_1(n) +# define HEX(n) HEX_1(n) +# if COMPILER_VERSION_PATCH == 0 + PRINT *, 'INFO:compiler_version_PATCH_digit_1[0]' +# elif COMPILER_VERSION_PATCH == 1 + PRINT *, 'INFO:compiler_version_PATCH_digit_1[1]' +# elif COMPILER_VERSION_PATCH == 2 + PRINT *, 'INFO:compiler_version_PATCH_digit_1[2]' +# elif COMPILER_VERSION_PATCH == 3 + PRINT *, 'INFO:compiler_version_PATCH_digit_1[3]' +# elif COMPILER_VERSION_PATCH == 4 + PRINT *, 'INFO:compiler_version_PATCH_digit_1[4]' +# elif COMPILER_VERSION_PATCH == 5 + PRINT *, 'INFO:compiler_version_PATCH_digit_1[5]' +# elif COMPILER_VERSION_PATCH == 6 + PRINT *, 'INFO:compiler_version_PATCH_digit_1[6]' +# elif COMPILER_VERSION_PATCH == 7 + PRINT *, 'INFO:compiler_version_PATCH_digit_1[7]' +# elif COMPILER_VERSION_PATCH == 8 + PRINT *, 'INFO:compiler_version_PATCH_digit_1[8]' +# elif COMPILER_VERSION_PATCH == 9 + PRINT *, 'INFO:compiler_version_PATCH_digit_1[9]' +# endif + +# undef DEC +# undef HEX +# define DEC(n) DEC_2(n) +# define HEX(n) HEX_2(n) +# if COMPILER_VERSION_PATCH == 0 + PRINT *, 'INFO:compiler_version_PATCH_digit_2[0]' +# elif COMPILER_VERSION_PATCH == 1 + PRINT *, 'INFO:compiler_version_PATCH_digit_2[1]' +# elif COMPILER_VERSION_PATCH == 2 + PRINT *, 'INFO:compiler_version_PATCH_digit_2[2]' +# elif COMPILER_VERSION_PATCH == 3 + PRINT *, 'INFO:compiler_version_PATCH_digit_2[3]' +# elif COMPILER_VERSION_PATCH == 4 + PRINT *, 'INFO:compiler_version_PATCH_digit_2[4]' +# elif COMPILER_VERSION_PATCH == 5 + PRINT *, 'INFO:compiler_version_PATCH_digit_2[5]' +# elif COMPILER_VERSION_PATCH == 6 + PRINT *, 'INFO:compiler_version_PATCH_digit_2[6]' +# elif COMPILER_VERSION_PATCH == 7 + PRINT *, 'INFO:compiler_version_PATCH_digit_2[7]' +# elif COMPILER_VERSION_PATCH == 8 + PRINT *, 'INFO:compiler_version_PATCH_digit_2[8]' +# elif COMPILER_VERSION_PATCH == 9 + PRINT *, 'INFO:compiler_version_PATCH_digit_2[9]' +# endif + +# undef DEC +# undef HEX +# define DEC(n) DEC_3(n) +# define HEX(n) HEX_3(n) +# if COMPILER_VERSION_PATCH == 0 + PRINT *, 'INFO:compiler_version_PATCH_digit_3[0]' +# elif COMPILER_VERSION_PATCH == 1 + PRINT *, 'INFO:compiler_version_PATCH_digit_3[1]' +# elif COMPILER_VERSION_PATCH == 2 + PRINT *, 'INFO:compiler_version_PATCH_digit_3[2]' +# elif COMPILER_VERSION_PATCH == 3 + PRINT *, 'INFO:compiler_version_PATCH_digit_3[3]' +# elif COMPILER_VERSION_PATCH == 4 + PRINT *, 'INFO:compiler_version_PATCH_digit_3[4]' +# elif COMPILER_VERSION_PATCH == 5 + PRINT *, 'INFO:compiler_version_PATCH_digit_3[5]' +# elif COMPILER_VERSION_PATCH == 6 + PRINT *, 'INFO:compiler_version_PATCH_digit_3[6]' +# elif COMPILER_VERSION_PATCH == 7 + PRINT *, 'INFO:compiler_version_PATCH_digit_3[7]' +# elif COMPILER_VERSION_PATCH == 8 + PRINT *, 'INFO:compiler_version_PATCH_digit_3[8]' +# elif COMPILER_VERSION_PATCH == 9 + PRINT *, 'INFO:compiler_version_PATCH_digit_3[9]' +# endif + +# undef DEC +# undef HEX +# define DEC(n) DEC_4(n) +# define HEX(n) HEX_4(n) +# if COMPILER_VERSION_PATCH == 0 + PRINT *, 'INFO:compiler_version_PATCH_digit_4[0]' +# elif COMPILER_VERSION_PATCH == 1 + PRINT *, 'INFO:compiler_version_PATCH_digit_4[1]' +# elif COMPILER_VERSION_PATCH == 2 + PRINT *, 'INFO:compiler_version_PATCH_digit_4[2]' +# elif COMPILER_VERSION_PATCH == 3 + PRINT *, 'INFO:compiler_version_PATCH_digit_4[3]' +# elif COMPILER_VERSION_PATCH == 4 + PRINT *, 'INFO:compiler_version_PATCH_digit_4[4]' +# elif COMPILER_VERSION_PATCH == 5 + PRINT *, 'INFO:compiler_version_PATCH_digit_4[5]' +# elif COMPILER_VERSION_PATCH == 6 + PRINT *, 'INFO:compiler_version_PATCH_digit_4[6]' +# elif COMPILER_VERSION_PATCH == 7 + PRINT *, 'INFO:compiler_version_PATCH_digit_4[7]' +# elif COMPILER_VERSION_PATCH == 8 + PRINT *, 'INFO:compiler_version_PATCH_digit_4[8]' +# elif COMPILER_VERSION_PATCH == 9 + PRINT *, 'INFO:compiler_version_PATCH_digit_4[9]' +# endif + +# undef DEC +# undef HEX +# define DEC(n) DEC_5(n) +# define HEX(n) HEX_5(n) +# if COMPILER_VERSION_PATCH == 0 + PRINT *, 'INFO:compiler_version_PATCH_digit_5[0]' +# elif COMPILER_VERSION_PATCH == 1 + PRINT *, 'INFO:compiler_version_PATCH_digit_5[1]' +# elif COMPILER_VERSION_PATCH == 2 + PRINT *, 'INFO:compiler_version_PATCH_digit_5[2]' +# elif COMPILER_VERSION_PATCH == 3 + PRINT *, 'INFO:compiler_version_PATCH_digit_5[3]' +# elif COMPILER_VERSION_PATCH == 4 + PRINT *, 'INFO:compiler_version_PATCH_digit_5[4]' +# elif COMPILER_VERSION_PATCH == 5 + PRINT *, 'INFO:compiler_version_PATCH_digit_5[5]' +# elif COMPILER_VERSION_PATCH == 6 + PRINT *, 'INFO:compiler_version_PATCH_digit_5[6]' +# elif COMPILER_VERSION_PATCH == 7 + PRINT *, 'INFO:compiler_version_PATCH_digit_5[7]' +# elif COMPILER_VERSION_PATCH == 8 + PRINT *, 'INFO:compiler_version_PATCH_digit_5[8]' +# elif COMPILER_VERSION_PATCH == 9 + PRINT *, 'INFO:compiler_version_PATCH_digit_5[9]' +# endif + +# undef DEC +# undef HEX +# define DEC(n) DEC_6(n) +# define HEX(n) HEX_6(n) +# if COMPILER_VERSION_PATCH == 0 + PRINT *, 'INFO:compiler_version_PATCH_digit_6[0]' +# elif COMPILER_VERSION_PATCH == 1 + PRINT *, 'INFO:compiler_version_PATCH_digit_6[1]' +# elif COMPILER_VERSION_PATCH == 2 + PRINT *, 'INFO:compiler_version_PATCH_digit_6[2]' +# elif COMPILER_VERSION_PATCH == 3 + PRINT *, 'INFO:compiler_version_PATCH_digit_6[3]' +# elif COMPILER_VERSION_PATCH == 4 + PRINT *, 'INFO:compiler_version_PATCH_digit_6[4]' +# elif COMPILER_VERSION_PATCH == 5 + PRINT *, 'INFO:compiler_version_PATCH_digit_6[5]' +# elif COMPILER_VERSION_PATCH == 6 + PRINT *, 'INFO:compiler_version_PATCH_digit_6[6]' +# elif COMPILER_VERSION_PATCH == 7 + PRINT *, 'INFO:compiler_version_PATCH_digit_6[7]' +# elif COMPILER_VERSION_PATCH == 8 + PRINT *, 'INFO:compiler_version_PATCH_digit_6[8]' +# elif COMPILER_VERSION_PATCH == 9 + PRINT *, 'INFO:compiler_version_PATCH_digit_6[9]' +# endif + +# undef DEC +# undef HEX +# define DEC(n) DEC_7(n) +# define HEX(n) HEX_7(n) +# if COMPILER_VERSION_PATCH == 0 + PRINT *, 'INFO:compiler_version_PATCH_digit_7[0]' +# elif COMPILER_VERSION_PATCH == 1 + PRINT *, 'INFO:compiler_version_PATCH_digit_7[1]' +# elif COMPILER_VERSION_PATCH == 2 + PRINT *, 'INFO:compiler_version_PATCH_digit_7[2]' +# elif COMPILER_VERSION_PATCH == 3 + PRINT *, 'INFO:compiler_version_PATCH_digit_7[3]' +# elif COMPILER_VERSION_PATCH == 4 + PRINT *, 'INFO:compiler_version_PATCH_digit_7[4]' +# elif COMPILER_VERSION_PATCH == 5 + PRINT *, 'INFO:compiler_version_PATCH_digit_7[5]' +# elif COMPILER_VERSION_PATCH == 6 + PRINT *, 'INFO:compiler_version_PATCH_digit_7[6]' +# elif COMPILER_VERSION_PATCH == 7 + PRINT *, 'INFO:compiler_version_PATCH_digit_7[7]' +# elif COMPILER_VERSION_PATCH == 8 + PRINT *, 'INFO:compiler_version_PATCH_digit_7[8]' +# elif COMPILER_VERSION_PATCH == 9 + PRINT *, 'INFO:compiler_version_PATCH_digit_7[9]' +# endif + +# undef DEC +# undef HEX +# define DEC(n) DEC_8(n) +# define HEX(n) HEX_8(n) +# if COMPILER_VERSION_PATCH == 0 + PRINT *, 'INFO:compiler_version_PATCH_digit_8[0]' +# elif COMPILER_VERSION_PATCH == 1 + PRINT *, 'INFO:compiler_version_PATCH_digit_8[1]' +# elif COMPILER_VERSION_PATCH == 2 + PRINT *, 'INFO:compiler_version_PATCH_digit_8[2]' +# elif COMPILER_VERSION_PATCH == 3 + PRINT *, 'INFO:compiler_version_PATCH_digit_8[3]' +# elif COMPILER_VERSION_PATCH == 4 + PRINT *, 'INFO:compiler_version_PATCH_digit_8[4]' +# elif COMPILER_VERSION_PATCH == 5 + PRINT *, 'INFO:compiler_version_PATCH_digit_8[5]' +# elif COMPILER_VERSION_PATCH == 6 + PRINT *, 'INFO:compiler_version_PATCH_digit_8[6]' +# elif COMPILER_VERSION_PATCH == 7 + PRINT *, 'INFO:compiler_version_PATCH_digit_8[7]' +# elif COMPILER_VERSION_PATCH == 8 + PRINT *, 'INFO:compiler_version_PATCH_digit_8[8]' +# elif COMPILER_VERSION_PATCH == 9 + PRINT *, 'INFO:compiler_version_PATCH_digit_8[9]' +# endif + +#endif +#if defined(COMPILER_VERSION_TWEAK) +# undef DEC +# undef HEX +# define DEC(n) DEC_1(n) +# define HEX(n) HEX_1(n) +# if COMPILER_VERSION_TWEAK == 0 + PRINT *, 'INFO:compiler_version_TWEAK_digit_1[0]' +# elif COMPILER_VERSION_TWEAK == 1 + PRINT *, 'INFO:compiler_version_TWEAK_digit_1[1]' +# elif COMPILER_VERSION_TWEAK == 2 + PRINT *, 'INFO:compiler_version_TWEAK_digit_1[2]' +# elif COMPILER_VERSION_TWEAK == 3 + PRINT *, 'INFO:compiler_version_TWEAK_digit_1[3]' +# elif COMPILER_VERSION_TWEAK == 4 + PRINT *, 'INFO:compiler_version_TWEAK_digit_1[4]' +# elif COMPILER_VERSION_TWEAK == 5 + PRINT *, 'INFO:compiler_version_TWEAK_digit_1[5]' +# elif COMPILER_VERSION_TWEAK == 6 + PRINT *, 'INFO:compiler_version_TWEAK_digit_1[6]' +# elif COMPILER_VERSION_TWEAK == 7 + PRINT *, 'INFO:compiler_version_TWEAK_digit_1[7]' +# elif COMPILER_VERSION_TWEAK == 8 + PRINT *, 'INFO:compiler_version_TWEAK_digit_1[8]' +# elif COMPILER_VERSION_TWEAK == 9 + PRINT *, 'INFO:compiler_version_TWEAK_digit_1[9]' +# endif + +# undef DEC +# undef HEX +# define DEC(n) DEC_2(n) +# define HEX(n) HEX_2(n) +# if COMPILER_VERSION_TWEAK == 0 + PRINT *, 'INFO:compiler_version_TWEAK_digit_2[0]' +# elif COMPILER_VERSION_TWEAK == 1 + PRINT *, 'INFO:compiler_version_TWEAK_digit_2[1]' +# elif COMPILER_VERSION_TWEAK == 2 + PRINT *, 'INFO:compiler_version_TWEAK_digit_2[2]' +# elif COMPILER_VERSION_TWEAK == 3 + PRINT *, 'INFO:compiler_version_TWEAK_digit_2[3]' +# elif COMPILER_VERSION_TWEAK == 4 + PRINT *, 'INFO:compiler_version_TWEAK_digit_2[4]' +# elif COMPILER_VERSION_TWEAK == 5 + PRINT *, 'INFO:compiler_version_TWEAK_digit_2[5]' +# elif COMPILER_VERSION_TWEAK == 6 + PRINT *, 'INFO:compiler_version_TWEAK_digit_2[6]' +# elif COMPILER_VERSION_TWEAK == 7 + PRINT *, 'INFO:compiler_version_TWEAK_digit_2[7]' +# elif COMPILER_VERSION_TWEAK == 8 + PRINT *, 'INFO:compiler_version_TWEAK_digit_2[8]' +# elif COMPILER_VERSION_TWEAK == 9 + PRINT *, 'INFO:compiler_version_TWEAK_digit_2[9]' +# endif + +# undef DEC +# undef HEX +# define DEC(n) DEC_3(n) +# define HEX(n) HEX_3(n) +# if COMPILER_VERSION_TWEAK == 0 + PRINT *, 'INFO:compiler_version_TWEAK_digit_3[0]' +# elif COMPILER_VERSION_TWEAK == 1 + PRINT *, 'INFO:compiler_version_TWEAK_digit_3[1]' +# elif COMPILER_VERSION_TWEAK == 2 + PRINT *, 'INFO:compiler_version_TWEAK_digit_3[2]' +# elif COMPILER_VERSION_TWEAK == 3 + PRINT *, 'INFO:compiler_version_TWEAK_digit_3[3]' +# elif COMPILER_VERSION_TWEAK == 4 + PRINT *, 'INFO:compiler_version_TWEAK_digit_3[4]' +# elif COMPILER_VERSION_TWEAK == 5 + PRINT *, 'INFO:compiler_version_TWEAK_digit_3[5]' +# elif COMPILER_VERSION_TWEAK == 6 + PRINT *, 'INFO:compiler_version_TWEAK_digit_3[6]' +# elif COMPILER_VERSION_TWEAK == 7 + PRINT *, 'INFO:compiler_version_TWEAK_digit_3[7]' +# elif COMPILER_VERSION_TWEAK == 8 + PRINT *, 'INFO:compiler_version_TWEAK_digit_3[8]' +# elif COMPILER_VERSION_TWEAK == 9 + PRINT *, 'INFO:compiler_version_TWEAK_digit_3[9]' +# endif + +# undef DEC +# undef HEX +# define DEC(n) DEC_4(n) +# define HEX(n) HEX_4(n) +# if COMPILER_VERSION_TWEAK == 0 + PRINT *, 'INFO:compiler_version_TWEAK_digit_4[0]' +# elif COMPILER_VERSION_TWEAK == 1 + PRINT *, 'INFO:compiler_version_TWEAK_digit_4[1]' +# elif COMPILER_VERSION_TWEAK == 2 + PRINT *, 'INFO:compiler_version_TWEAK_digit_4[2]' +# elif COMPILER_VERSION_TWEAK == 3 + PRINT *, 'INFO:compiler_version_TWEAK_digit_4[3]' +# elif COMPILER_VERSION_TWEAK == 4 + PRINT *, 'INFO:compiler_version_TWEAK_digit_4[4]' +# elif COMPILER_VERSION_TWEAK == 5 + PRINT *, 'INFO:compiler_version_TWEAK_digit_4[5]' +# elif COMPILER_VERSION_TWEAK == 6 + PRINT *, 'INFO:compiler_version_TWEAK_digit_4[6]' +# elif COMPILER_VERSION_TWEAK == 7 + PRINT *, 'INFO:compiler_version_TWEAK_digit_4[7]' +# elif COMPILER_VERSION_TWEAK == 8 + PRINT *, 'INFO:compiler_version_TWEAK_digit_4[8]' +# elif COMPILER_VERSION_TWEAK == 9 + PRINT *, 'INFO:compiler_version_TWEAK_digit_4[9]' +# endif + +# undef DEC +# undef HEX +# define DEC(n) DEC_5(n) +# define HEX(n) HEX_5(n) +# if COMPILER_VERSION_TWEAK == 0 + PRINT *, 'INFO:compiler_version_TWEAK_digit_5[0]' +# elif COMPILER_VERSION_TWEAK == 1 + PRINT *, 'INFO:compiler_version_TWEAK_digit_5[1]' +# elif COMPILER_VERSION_TWEAK == 2 + PRINT *, 'INFO:compiler_version_TWEAK_digit_5[2]' +# elif COMPILER_VERSION_TWEAK == 3 + PRINT *, 'INFO:compiler_version_TWEAK_digit_5[3]' +# elif COMPILER_VERSION_TWEAK == 4 + PRINT *, 'INFO:compiler_version_TWEAK_digit_5[4]' +# elif COMPILER_VERSION_TWEAK == 5 + PRINT *, 'INFO:compiler_version_TWEAK_digit_5[5]' +# elif COMPILER_VERSION_TWEAK == 6 + PRINT *, 'INFO:compiler_version_TWEAK_digit_5[6]' +# elif COMPILER_VERSION_TWEAK == 7 + PRINT *, 'INFO:compiler_version_TWEAK_digit_5[7]' +# elif COMPILER_VERSION_TWEAK == 8 + PRINT *, 'INFO:compiler_version_TWEAK_digit_5[8]' +# elif COMPILER_VERSION_TWEAK == 9 + PRINT *, 'INFO:compiler_version_TWEAK_digit_5[9]' +# endif + +# undef DEC +# undef HEX +# define DEC(n) DEC_6(n) +# define HEX(n) HEX_6(n) +# if COMPILER_VERSION_TWEAK == 0 + PRINT *, 'INFO:compiler_version_TWEAK_digit_6[0]' +# elif COMPILER_VERSION_TWEAK == 1 + PRINT *, 'INFO:compiler_version_TWEAK_digit_6[1]' +# elif COMPILER_VERSION_TWEAK == 2 + PRINT *, 'INFO:compiler_version_TWEAK_digit_6[2]' +# elif COMPILER_VERSION_TWEAK == 3 + PRINT *, 'INFO:compiler_version_TWEAK_digit_6[3]' +# elif COMPILER_VERSION_TWEAK == 4 + PRINT *, 'INFO:compiler_version_TWEAK_digit_6[4]' +# elif COMPILER_VERSION_TWEAK == 5 + PRINT *, 'INFO:compiler_version_TWEAK_digit_6[5]' +# elif COMPILER_VERSION_TWEAK == 6 + PRINT *, 'INFO:compiler_version_TWEAK_digit_6[6]' +# elif COMPILER_VERSION_TWEAK == 7 + PRINT *, 'INFO:compiler_version_TWEAK_digit_6[7]' +# elif COMPILER_VERSION_TWEAK == 8 + PRINT *, 'INFO:compiler_version_TWEAK_digit_6[8]' +# elif COMPILER_VERSION_TWEAK == 9 + PRINT *, 'INFO:compiler_version_TWEAK_digit_6[9]' +# endif + +# undef DEC +# undef HEX +# define DEC(n) DEC_7(n) +# define HEX(n) HEX_7(n) +# if COMPILER_VERSION_TWEAK == 0 + PRINT *, 'INFO:compiler_version_TWEAK_digit_7[0]' +# elif COMPILER_VERSION_TWEAK == 1 + PRINT *, 'INFO:compiler_version_TWEAK_digit_7[1]' +# elif COMPILER_VERSION_TWEAK == 2 + PRINT *, 'INFO:compiler_version_TWEAK_digit_7[2]' +# elif COMPILER_VERSION_TWEAK == 3 + PRINT *, 'INFO:compiler_version_TWEAK_digit_7[3]' +# elif COMPILER_VERSION_TWEAK == 4 + PRINT *, 'INFO:compiler_version_TWEAK_digit_7[4]' +# elif COMPILER_VERSION_TWEAK == 5 + PRINT *, 'INFO:compiler_version_TWEAK_digit_7[5]' +# elif COMPILER_VERSION_TWEAK == 6 + PRINT *, 'INFO:compiler_version_TWEAK_digit_7[6]' +# elif COMPILER_VERSION_TWEAK == 7 + PRINT *, 'INFO:compiler_version_TWEAK_digit_7[7]' +# elif COMPILER_VERSION_TWEAK == 8 + PRINT *, 'INFO:compiler_version_TWEAK_digit_7[8]' +# elif COMPILER_VERSION_TWEAK == 9 + PRINT *, 'INFO:compiler_version_TWEAK_digit_7[9]' +# endif + +# undef DEC +# undef HEX +# define DEC(n) DEC_8(n) +# define HEX(n) HEX_8(n) +# if COMPILER_VERSION_TWEAK == 0 + PRINT *, 'INFO:compiler_version_TWEAK_digit_8[0]' +# elif COMPILER_VERSION_TWEAK == 1 + PRINT *, 'INFO:compiler_version_TWEAK_digit_8[1]' +# elif COMPILER_VERSION_TWEAK == 2 + PRINT *, 'INFO:compiler_version_TWEAK_digit_8[2]' +# elif COMPILER_VERSION_TWEAK == 3 + PRINT *, 'INFO:compiler_version_TWEAK_digit_8[3]' +# elif COMPILER_VERSION_TWEAK == 4 + PRINT *, 'INFO:compiler_version_TWEAK_digit_8[4]' +# elif COMPILER_VERSION_TWEAK == 5 + PRINT *, 'INFO:compiler_version_TWEAK_digit_8[5]' +# elif COMPILER_VERSION_TWEAK == 6 + PRINT *, 'INFO:compiler_version_TWEAK_digit_8[6]' +# elif COMPILER_VERSION_TWEAK == 7 + PRINT *, 'INFO:compiler_version_TWEAK_digit_8[7]' +# elif COMPILER_VERSION_TWEAK == 8 + PRINT *, 'INFO:compiler_version_TWEAK_digit_8[8]' +# elif COMPILER_VERSION_TWEAK == 9 + PRINT *, 'INFO:compiler_version_TWEAK_digit_8[9]' +# endif + +#endif + + END diff --git a/FiniteElasticity/RightBiceps/build_debug/mpi_verification/Fortran/CMakeFiles/CMakeDirectoryInformation.cmake b/FiniteElasticity/RightBiceps/build_debug/mpi_verification/Fortran/CMakeFiles/CMakeDirectoryInformation.cmake new file mode 100644 index 00000000..7ba6a1e4 --- /dev/null +++ b/FiniteElasticity/RightBiceps/build_debug/mpi_verification/Fortran/CMakeFiles/CMakeDirectoryInformation.cmake @@ -0,0 +1,16 @@ +# CMAKE generated file: DO NOT EDIT! +# Generated by "Unix Makefiles" Generator, CMake Version 3.5 + +# Relative path conversion top directories. +set(CMAKE_RELATIVE_PATH_TOP_SOURCE "/store/software/opencmiss/OpenCMISS-examples/FiniteElasticity/RightBiceps/build_debug/mpi_verification/Fortran") +set(CMAKE_RELATIVE_PATH_TOP_BINARY "/store/software/opencmiss/OpenCMISS-examples/FiniteElasticity/RightBiceps/build_debug/mpi_verification/Fortran") + +# Force unix paths in dependencies. +set(CMAKE_FORCE_UNIX_PATHS 1) + + +# The C and CXX include file regular expressions for this directory. +set(CMAKE_C_INCLUDE_REGEX_SCAN "^.*$") +set(CMAKE_C_INCLUDE_REGEX_COMPLAIN "^$") +set(CMAKE_CXX_INCLUDE_REGEX_SCAN ${CMAKE_C_INCLUDE_REGEX_SCAN}) +set(CMAKE_CXX_INCLUDE_REGEX_COMPLAIN ${CMAKE_C_INCLUDE_REGEX_COMPLAIN}) diff --git a/FiniteElasticity/RightBiceps/build_debug/mpi_verification/Fortran/CMakeFiles/CMakeOutput.log b/FiniteElasticity/RightBiceps/build_debug/mpi_verification/Fortran/CMakeFiles/CMakeOutput.log new file mode 100644 index 00000000..021c3a35 --- /dev/null +++ b/FiniteElasticity/RightBiceps/build_debug/mpi_verification/Fortran/CMakeFiles/CMakeOutput.log @@ -0,0 +1,218 @@ +The system is: Linux - 4.4.0-104-generic - x86_64 +Compiling the Fortran compiler identification source file "CMakeFortranCompilerId.F" succeeded. +Compiler: /usr/bin/mpif90 +Build flags: +Id flags: -v + +The output was: +0 +Driving: /usr/bin/gfortran -v CMakeFortranCompilerId.F -I/usr/lib/openmpi/include -pthread -I/usr/lib/openmpi/lib -Wl,-rpath -Wl,/usr/lib/openmpi/lib -Wl,--enable-new-dtags -L/usr/lib/openmpi/lib -lmpi_usempif08 -lmpi_usempi_ignore_tkr -lmpi_mpifh -lmpi -l gfortran -l m -shared-libgcc +Using built-in specs. +COLLECT_GCC=/usr/bin/gfortran +COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/5/lto-wrapper +Target: x86_64-linux-gnu +Configured with: ../src/configure -v --with-pkgversion='Ubuntu 5.4.0-6ubuntu1~16.04.5' --with-bugurl=file:///usr/share/doc/gcc-5/README.Bugs --enable-languages=c,ada,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-5 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-libmpx --enable-plugin --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-5-amd64/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-5-amd64 --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-5-amd64 --with-arch-directory=amd64 --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --enable-objc-gc --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu +Thread model: posix +gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.5) +COLLECT_GCC_OPTIONS='-v' '-I' '/usr/lib/openmpi/include' '-pthread' '-I' '/usr/lib/openmpi/lib' '-L/usr/lib/openmpi/lib' '-shared-libgcc' '-mtune=generic' '-march=x86-64' + /usr/lib/gcc/x86_64-linux-gnu/5/f951 CMakeFortranCompilerId.F -ffixed-form -cpp=/tmp/ccFQI2fl.f90 -quiet -v -I /usr/lib/openmpi/include -I /usr/lib/openmpi/lib -imultiarch x86_64-linux-gnu -D_REENTRANT CMakeFortranCompilerId.F -quiet -dumpbase CMakeFortranCompilerId.F -mtune=generic -march=x86-64 -auxbase CMakeFortranCompilerId -version -fintrinsic-modules-path /usr/lib/gcc/x86_64-linux-gnu/5/finclude -o /tmp/cc8Q20sw.s +GNU Fortran (Ubuntu 5.4.0-6ubuntu1~16.04.5) version 5.4.0 20160609 (x86_64-linux-gnu) + compiled by GNU C version 5.4.0 20160609, GMP version 6.1.0, MPFR version 3.1.4, MPC version 1.0.3 +GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072 +ignoring nonexistent directory "/usr/local/include/x86_64-linux-gnu" +ignoring nonexistent directory "/usr/lib/gcc/x86_64-linux-gnu/5/../../../../x86_64-linux-gnu/include" +#include "..." search starts here: +#include <...> search starts here: + /usr/lib/openmpi/include + /usr/lib/openmpi/lib + /usr/lib/gcc/x86_64-linux-gnu/5/finclude + /usr/lib/gcc/x86_64-linux-gnu/5/include + /usr/local/include + /usr/lib/gcc/x86_64-linux-gnu/5/include-fixed + /usr/include/x86_64-linux-gnu + /usr/include +End of search list. +GNU Fortran2008 (Ubuntu 5.4.0-6ubuntu1~16.04.5) version 5.4.0 20160609 (x86_64-linux-gnu) + compiled by GNU C version 5.4.0 20160609, GMP version 6.1.0, MPFR version 3.1.4, MPC version 1.0.3 +GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072 +COLLECT_GCC_OPTIONS='-v' '-I' '/usr/lib/openmpi/include' '-pthread' '-I' '/usr/lib/openmpi/lib' '-L/usr/lib/openmpi/lib' '-shared-libgcc' '-mtune=generic' '-march=x86-64' + as -v -I /usr/lib/openmpi/include -I /usr/lib/openmpi/lib --64 -o /tmp/cc5CEDIH.o /tmp/cc8Q20sw.s +GNU assembler version 2.26.1 (x86_64-linux-gnu) using BFD version (GNU Binutils for Ubuntu) 2.26.1 +Reading specs from /usr/lib/gcc/x86_64-linux-gnu/5/libgfortran.spec +rename spec lib to liborig +COLLECT_GCC_OPTIONS='-v' '-I' '/usr/lib/openmpi/include' '-pthread' '-I' '/usr/lib/openmpi/lib' '-L/usr/lib/openmpi/lib' '-shared-libgcc' '-mtune=generic' '-march=x86-64' +COMPILER_PATH=/usr/lib/gcc/x86_64-linux-gnu/5/:/usr/lib/gcc/x86_64-linux-gnu/5/:/usr/lib/gcc/x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/5/:/usr/lib/gcc/x86_64-linux-gnu/ +LIBRARY_PATH=/usr/lib/gcc/x86_64-linux-gnu/5/:/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/5/../../../../lib/:/lib/x86_64-linux-gnu/:/lib/../lib/:/usr/lib/x86_64-linux-gnu/:/usr/lib/../lib/:/usr/lib/gcc/x86_64-linux-gnu/5/../../../:/lib/:/usr/lib/ +COLLECT_GCC_OPTIONS='-v' '-I' '/usr/lib/openmpi/include' '-pthread' '-I' '/usr/lib/openmpi/lib' '-L/usr/lib/openmpi/lib' '-shared-libgcc' '-mtune=generic' '-march=x86-64' + /usr/lib/gcc/x86_64-linux-gnu/5/collect2 -plugin /usr/lib/gcc/x86_64-linux-gnu/5/liblto_plugin.so -plugin-opt=/usr/lib/gcc/x86_64-linux-gnu/5/lto-wrapper -plugin-opt=-fresolution=/tmp/ccgWe2YS.res -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lquadmath -plugin-opt=-pass-through=-lm -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lpthread -plugin-opt=-pass-through=-lc -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc --sysroot=/ --build-id --eh-frame-hdr -m elf_x86_64 --hash-style=gnu --as-needed -dynamic-linker /lib64/ld-linux-x86-64.so.2 -z relro /usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/crt1.o /usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/crti.o /usr/lib/gcc/x86_64-linux-gnu/5/crtbegin.o -L/usr/lib/openmpi/lib -L/usr/lib/gcc/x86_64-linux-gnu/5 -L/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu -L/usr/lib/gcc/x86_64-linux-gnu/5/../../../../lib -L/lib/x86_64-linux-gnu -L/lib/../lib -L/usr/lib/x86_64-linux-gnu -L/usr/lib/../lib -L/usr/lib/gcc/x86_64-linux-gnu/5/../../.. /tmp/cc5CEDIH.o -rpath /usr/lib/openmpi/lib --enable-new-dtags -lmpi_usempif08 -lmpi_usempi_ignore_tkr -lmpi_mpifh -lmpi -lgfortran -lm -lgcc_s -lgcc -lquadmath -lm -lgcc_s -lgcc -lpthread -lc -lgcc_s -lgcc /usr/lib/gcc/x86_64-linux-gnu/5/crtend.o /usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/crtn.o + + +Compilation of the Fortran compiler identification source "CMakeFortranCompilerId.F" produced "a.out" + +The Fortran compiler identification is GNU, found in "/store/software/opencmiss/OpenCMISS-examples/FiniteElasticity/RightBiceps/build_debug/mpi_verification/Fortran/CMakeFiles/3.5.1/CompilerIdFortran/a.out" + +Determining if the Fortran compiler works passed with the following output: +Change Dir: /store/software/opencmiss/OpenCMISS-examples/FiniteElasticity/RightBiceps/build_debug/mpi_verification/Fortran/CMakeFiles/CMakeTmp + +Run Build Command:"/usr/bin/make" "cmTC_2685a/fast" +/usr/bin/make -f CMakeFiles/cmTC_2685a.dir/build.make CMakeFiles/cmTC_2685a.dir/build +make[1]: Entering directory '/store/software/opencmiss/OpenCMISS-examples/FiniteElasticity/RightBiceps/build_debug/mpi_verification/Fortran/CMakeFiles/CMakeTmp' +Building Fortran object CMakeFiles/cmTC_2685a.dir/testFortranCompiler.f.o +/usr/bin/mpif90 -c /store/software/opencmiss/OpenCMISS-examples/FiniteElasticity/RightBiceps/build_debug/mpi_verification/Fortran/CMakeFiles/CMakeTmp/testFortranCompiler.f -o CMakeFiles/cmTC_2685a.dir/testFortranCompiler.f.o +Linking Fortran executable cmTC_2685a +/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_2685a.dir/link.txt --verbose=1 +/usr/bin/mpif90 CMakeFiles/cmTC_2685a.dir/testFortranCompiler.f.o -o cmTC_2685a +make[1]: Leaving directory '/store/software/opencmiss/OpenCMISS-examples/FiniteElasticity/RightBiceps/build_debug/mpi_verification/Fortran/CMakeFiles/CMakeTmp' + + +Detecting Fortran compiler ABI info compiled with the following output: +Change Dir: /store/software/opencmiss/OpenCMISS-examples/FiniteElasticity/RightBiceps/build_debug/mpi_verification/Fortran/CMakeFiles/CMakeTmp + +Run Build Command:"/usr/bin/make" "cmTC_7dc99/fast" +/usr/bin/make -f CMakeFiles/cmTC_7dc99.dir/build.make CMakeFiles/cmTC_7dc99.dir/build +make[1]: Entering directory '/store/software/opencmiss/OpenCMISS-examples/FiniteElasticity/RightBiceps/build_debug/mpi_verification/Fortran/CMakeFiles/CMakeTmp' +Building Fortran object CMakeFiles/cmTC_7dc99.dir/CMakeFortranCompilerABI.F.o +/usr/bin/mpif90 -c /usr/share/cmake-3.5/Modules/CMakeFortranCompilerABI.F -o CMakeFiles/cmTC_7dc99.dir/CMakeFortranCompilerABI.F.o +Linking Fortran executable cmTC_7dc99 +/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_7dc99.dir/link.txt --verbose=1 +/usr/bin/mpif90 -v CMakeFiles/cmTC_7dc99.dir/CMakeFortranCompilerABI.F.o -o cmTC_7dc99 +Driving: /usr/bin/gfortran -v CMakeFiles/cmTC_7dc99.dir/CMakeFortranCompilerABI.F.o -o cmTC_7dc99 -I/usr/lib/openmpi/include -pthread -I/usr/lib/openmpi/lib -Wl,-rpath -Wl,/usr/lib/openmpi/lib -Wl,--enable-new-dtags -L/usr/lib/openmpi/lib -lmpi_usempif08 -lmpi_usempi_ignore_tkr -lmpi_mpifh -lmpi -l gfortran -l m -shared-libgcc +Using built-in specs. +COLLECT_GCC=/usr/bin/gfortran +COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/5/lto-wrapper +Target: x86_64-linux-gnu +Configured with: ../src/configure -v --with-pkgversion='Ubuntu 5.4.0-6ubuntu1~16.04.5' --with-bugurl=file:///usr/share/doc/gcc-5/README.Bugs --enable-languages=c,ada,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-5 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-libmpx --enable-plugin --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-5-amd64/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-5-amd64 --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-5-amd64 --with-arch-directory=amd64 --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --enable-objc-gc --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu +Thread model: posix +gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.5) +Reading specs from /usr/lib/gcc/x86_64-linux-gnu/5/libgfortran.spec +rename spec lib to liborig +COLLECT_GCC_OPTIONS='-v' '-o' 'cmTC_7dc99' '-I' '/usr/lib/openmpi/include' '-pthread' '-I' '/usr/lib/openmpi/lib' '-L/usr/lib/openmpi/lib' '-shared-libgcc' '-mtune=generic' '-march=x86-64' +COMPILER_PATH=/usr/lib/gcc/x86_64-linux-gnu/5/:/usr/lib/gcc/x86_64-linux-gnu/5/:/usr/lib/gcc/x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/5/:/usr/lib/gcc/x86_64-linux-gnu/ +LIBRARY_PATH=/usr/lib/gcc/x86_64-linux-gnu/5/:/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/5/../../../../lib/:/lib/x86_64-linux-gnu/:/lib/../lib/:/usr/lib/x86_64-linux-gnu/:/usr/lib/../lib/:/usr/lib/gcc/x86_64-linux-gnu/5/../../../:/lib/:/usr/lib/ +COLLECT_GCC_OPTIONS='-v' '-o' 'cmTC_7dc99' '-I' '/usr/lib/openmpi/include' '-pthread' '-I' '/usr/lib/openmpi/lib' '-L/usr/lib/openmpi/lib' '-shared-libgcc' '-mtune=generic' '-march=x86-64' + /usr/lib/gcc/x86_64-linux-gnu/5/collect2 -plugin /usr/lib/gcc/x86_64-linux-gnu/5/liblto_plugin.so -plugin-opt=/usr/lib/gcc/x86_64-linux-gnu/5/lto-wrapper -plugin-opt=-fresolution=/tmp/cczxqjMq.res -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lquadmath -plugin-opt=-pass-through=-lm -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lpthread -plugin-opt=-pass-through=-lc -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc --sysroot=/ --build-id --eh-frame-hdr -m elf_x86_64 --hash-style=gnu --as-needed -dynamic-linker /lib64/ld-linux-x86-64.so.2 -z relro -o cmTC_7dc99 /usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/crt1.o /usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/crti.o /usr/lib/gcc/x86_64-linux-gnu/5/crtbegin.o -L/usr/lib/openmpi/lib -L/usr/lib/gcc/x86_64-linux-gnu/5 -L/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu -L/usr/lib/gcc/x86_64-linux-gnu/5/../../../../lib -L/lib/x86_64-linux-gnu -L/lib/../lib -L/usr/lib/x86_64-linux-gnu -L/usr/lib/../lib -L/usr/lib/gcc/x86_64-linux-gnu/5/../../.. CMakeFiles/cmTC_7dc99.dir/CMakeFortranCompilerABI.F.o -rpath /usr/lib/openmpi/lib --enable-new-dtags -lmpi_usempif08 -lmpi_usempi_ignore_tkr -lmpi_mpifh -lmpi -lgfortran -lm -lgcc_s -lgcc -lquadmath -lm -lgcc_s -lgcc -lpthread -lc -lgcc_s -lgcc /usr/lib/gcc/x86_64-linux-gnu/5/crtend.o /usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/crtn.o +make[1]: Leaving directory '/store/software/opencmiss/OpenCMISS-examples/FiniteElasticity/RightBiceps/build_debug/mpi_verification/Fortran/CMakeFiles/CMakeTmp' + + +Parsed Fortran implicit link information from above output: + link line regex: [^( *|.*[/\])(ld|([^/\]+-)?ld|collect2)[^/\]*( |$)] + ignore line: [Change Dir: /store/software/opencmiss/OpenCMISS-examples/FiniteElasticity/RightBiceps/build_debug/mpi_verification/Fortran/CMakeFiles/CMakeTmp] + ignore line: [] + ignore line: [Run Build Command:"/usr/bin/make" "cmTC_7dc99/fast"] + ignore line: [/usr/bin/make -f CMakeFiles/cmTC_7dc99.dir/build.make CMakeFiles/cmTC_7dc99.dir/build] + ignore line: [make[1]: Entering directory '/store/software/opencmiss/OpenCMISS-examples/FiniteElasticity/RightBiceps/build_debug/mpi_verification/Fortran/CMakeFiles/CMakeTmp'] + ignore line: [Building Fortran object CMakeFiles/cmTC_7dc99.dir/CMakeFortranCompilerABI.F.o] + ignore line: [/usr/bin/mpif90 -c /usr/share/cmake-3.5/Modules/CMakeFortranCompilerABI.F -o CMakeFiles/cmTC_7dc99.dir/CMakeFortranCompilerABI.F.o] + ignore line: [Linking Fortran executable cmTC_7dc99] + ignore line: [/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_7dc99.dir/link.txt --verbose=1] + ignore line: [/usr/bin/mpif90 -v CMakeFiles/cmTC_7dc99.dir/CMakeFortranCompilerABI.F.o -o cmTC_7dc99 ] + ignore line: [Driving: /usr/bin/gfortran -v CMakeFiles/cmTC_7dc99.dir/CMakeFortranCompilerABI.F.o -o cmTC_7dc99 -I/usr/lib/openmpi/include -pthread -I/usr/lib/openmpi/lib -Wl,-rpath -Wl,/usr/lib/openmpi/lib -Wl,--enable-new-dtags -L/usr/lib/openmpi/lib -lmpi_usempif08 -lmpi_usempi_ignore_tkr -lmpi_mpifh -lmpi -l gfortran -l m -shared-libgcc] + ignore line: [Using built-in specs.] + ignore line: [COLLECT_GCC=/usr/bin/gfortran] + ignore line: [COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/5/lto-wrapper] + ignore line: [Target: x86_64-linux-gnu] + ignore line: [Configured with: ../src/configure -v --with-pkgversion='Ubuntu 5.4.0-6ubuntu1~16.04.5' --with-bugurl=file:///usr/share/doc/gcc-5/README.Bugs --enable-languages=c,ada,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-5 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-libmpx --enable-plugin --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-5-amd64/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-5-amd64 --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-5-amd64 --with-arch-directory=amd64 --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --enable-objc-gc --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu] + ignore line: [Thread model: posix] + ignore line: [gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.5) ] + ignore line: [Reading specs from /usr/lib/gcc/x86_64-linux-gnu/5/libgfortran.spec] + ignore line: [rename spec lib to liborig] + ignore line: [COLLECT_GCC_OPTIONS='-v' '-o' 'cmTC_7dc99' '-I' '/usr/lib/openmpi/include' '-pthread' '-I' '/usr/lib/openmpi/lib' '-L/usr/lib/openmpi/lib' '-shared-libgcc' '-mtune=generic' '-march=x86-64'] + ignore line: [COMPILER_PATH=/usr/lib/gcc/x86_64-linux-gnu/5/:/usr/lib/gcc/x86_64-linux-gnu/5/:/usr/lib/gcc/x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/5/:/usr/lib/gcc/x86_64-linux-gnu/] + ignore line: [LIBRARY_PATH=/usr/lib/gcc/x86_64-linux-gnu/5/:/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/5/../../../../lib/:/lib/x86_64-linux-gnu/:/lib/../lib/:/usr/lib/x86_64-linux-gnu/:/usr/lib/../lib/:/usr/lib/gcc/x86_64-linux-gnu/5/../../../:/lib/:/usr/lib/] + ignore line: [COLLECT_GCC_OPTIONS='-v' '-o' 'cmTC_7dc99' '-I' '/usr/lib/openmpi/include' '-pthread' '-I' '/usr/lib/openmpi/lib' '-L/usr/lib/openmpi/lib' '-shared-libgcc' '-mtune=generic' '-march=x86-64'] + link line: [ /usr/lib/gcc/x86_64-linux-gnu/5/collect2 -plugin /usr/lib/gcc/x86_64-linux-gnu/5/liblto_plugin.so -plugin-opt=/usr/lib/gcc/x86_64-linux-gnu/5/lto-wrapper -plugin-opt=-fresolution=/tmp/cczxqjMq.res -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lquadmath -plugin-opt=-pass-through=-lm -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lpthread -plugin-opt=-pass-through=-lc -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc --sysroot=/ --build-id --eh-frame-hdr -m elf_x86_64 --hash-style=gnu --as-needed -dynamic-linker /lib64/ld-linux-x86-64.so.2 -z relro -o cmTC_7dc99 /usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/crt1.o /usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/crti.o /usr/lib/gcc/x86_64-linux-gnu/5/crtbegin.o -L/usr/lib/openmpi/lib -L/usr/lib/gcc/x86_64-linux-gnu/5 -L/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu -L/usr/lib/gcc/x86_64-linux-gnu/5/../../../../lib -L/lib/x86_64-linux-gnu -L/lib/../lib -L/usr/lib/x86_64-linux-gnu -L/usr/lib/../lib -L/usr/lib/gcc/x86_64-linux-gnu/5/../../.. CMakeFiles/cmTC_7dc99.dir/CMakeFortranCompilerABI.F.o -rpath /usr/lib/openmpi/lib --enable-new-dtags -lmpi_usempif08 -lmpi_usempi_ignore_tkr -lmpi_mpifh -lmpi -lgfortran -lm -lgcc_s -lgcc -lquadmath -lm -lgcc_s -lgcc -lpthread -lc -lgcc_s -lgcc /usr/lib/gcc/x86_64-linux-gnu/5/crtend.o /usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/crtn.o] + arg [/usr/lib/gcc/x86_64-linux-gnu/5/collect2] ==> ignore + arg [-plugin] ==> ignore + arg [/usr/lib/gcc/x86_64-linux-gnu/5/liblto_plugin.so] ==> ignore + arg [-plugin-opt=/usr/lib/gcc/x86_64-linux-gnu/5/lto-wrapper] ==> ignore + arg [-plugin-opt=-fresolution=/tmp/cczxqjMq.res] ==> ignore + arg [-plugin-opt=-pass-through=-lgcc_s] ==> ignore + arg [-plugin-opt=-pass-through=-lgcc] ==> ignore + arg [-plugin-opt=-pass-through=-lquadmath] ==> ignore + arg [-plugin-opt=-pass-through=-lm] ==> ignore + arg [-plugin-opt=-pass-through=-lgcc_s] ==> ignore + arg [-plugin-opt=-pass-through=-lgcc] ==> ignore + arg [-plugin-opt=-pass-through=-lpthread] ==> ignore + arg [-plugin-opt=-pass-through=-lc] ==> ignore + arg [-plugin-opt=-pass-through=-lgcc_s] ==> ignore + arg [-plugin-opt=-pass-through=-lgcc] ==> ignore + arg [--sysroot=/] ==> ignore + arg [--build-id] ==> ignore + arg [--eh-frame-hdr] ==> ignore + arg [-m] ==> ignore + arg [elf_x86_64] ==> ignore + arg [--hash-style=gnu] ==> ignore + arg [--as-needed] ==> ignore + arg [-dynamic-linker] ==> ignore + arg [/lib64/ld-linux-x86-64.so.2] ==> ignore + arg [-zrelro] ==> ignore + arg [-o] ==> ignore + arg [cmTC_7dc99] ==> ignore + arg [/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/crt1.o] ==> ignore + arg [/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/crti.o] ==> ignore + arg [/usr/lib/gcc/x86_64-linux-gnu/5/crtbegin.o] ==> ignore + arg [-L/usr/lib/openmpi/lib] ==> dir [/usr/lib/openmpi/lib] + arg [-L/usr/lib/gcc/x86_64-linux-gnu/5] ==> dir [/usr/lib/gcc/x86_64-linux-gnu/5] + arg [-L/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu] ==> dir [/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu] + arg [-L/usr/lib/gcc/x86_64-linux-gnu/5/../../../../lib] ==> dir [/usr/lib/gcc/x86_64-linux-gnu/5/../../../../lib] + arg [-L/lib/x86_64-linux-gnu] ==> dir [/lib/x86_64-linux-gnu] + arg [-L/lib/../lib] ==> dir [/lib/../lib] + arg [-L/usr/lib/x86_64-linux-gnu] ==> dir [/usr/lib/x86_64-linux-gnu] + arg [-L/usr/lib/../lib] ==> dir [/usr/lib/../lib] + arg [-L/usr/lib/gcc/x86_64-linux-gnu/5/../../..] ==> dir [/usr/lib/gcc/x86_64-linux-gnu/5/../../..] + arg [CMakeFiles/cmTC_7dc99.dir/CMakeFortranCompilerABI.F.o] ==> ignore + arg [-rpath] ==> ignore + arg [/usr/lib/openmpi/lib] ==> ignore + arg [--enable-new-dtags] ==> ignore + arg [-lmpi_usempif08] ==> lib [mpi_usempif08] + arg [-lmpi_usempi_ignore_tkr] ==> lib [mpi_usempi_ignore_tkr] + arg [-lmpi_mpifh] ==> lib [mpi_mpifh] + arg [-lmpi] ==> lib [mpi] + arg [-lgfortran] ==> lib [gfortran] + arg [-lm] ==> lib [m] + arg [-lgcc_s] ==> lib [gcc_s] + arg [-lgcc] ==> lib [gcc] + arg [-lquadmath] ==> lib [quadmath] + arg [-lm] ==> lib [m] + arg [-lgcc_s] ==> lib [gcc_s] + arg [-lgcc] ==> lib [gcc] + arg [-lpthread] ==> lib [pthread] + arg [-lc] ==> lib [c] + arg [-lgcc_s] ==> lib [gcc_s] + arg [-lgcc] ==> lib [gcc] + arg [/usr/lib/gcc/x86_64-linux-gnu/5/crtend.o] ==> ignore + arg [/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/crtn.o] ==> ignore + remove lib [gcc_s] + remove lib [gcc] + remove lib [gcc_s] + remove lib [gcc] + remove lib [gcc_s] + remove lib [gcc] + collapse library dir [/usr/lib/openmpi/lib] ==> [/usr/lib/openmpi/lib] + collapse library dir [/usr/lib/gcc/x86_64-linux-gnu/5] ==> [/usr/lib/gcc/x86_64-linux-gnu/5] + collapse library dir [/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu] ==> [/usr/lib/x86_64-linux-gnu] + collapse library dir [/usr/lib/gcc/x86_64-linux-gnu/5/../../../../lib] ==> [/usr/lib] + collapse library dir [/lib/x86_64-linux-gnu] ==> [/lib/x86_64-linux-gnu] + collapse library dir [/lib/../lib] ==> [/lib] + collapse library dir [/usr/lib/x86_64-linux-gnu] ==> [/usr/lib/x86_64-linux-gnu] + collapse library dir [/usr/lib/../lib] ==> [/usr/lib] + collapse library dir [/usr/lib/gcc/x86_64-linux-gnu/5/../../..] ==> [/usr/lib] + implicit libs: [mpi_usempif08;mpi_usempi_ignore_tkr;mpi_mpifh;mpi;gfortran;m;quadmath;m;pthread;c] + implicit dirs: [/usr/lib/openmpi/lib;/usr/lib/gcc/x86_64-linux-gnu/5;/usr/lib/x86_64-linux-gnu;/usr/lib;/lib/x86_64-linux-gnu;/lib] + implicit fwks: [] + + +Determining if the Fortran compiler supports Fortran 90 passed with the following output: +Change Dir: /store/software/opencmiss/OpenCMISS-examples/FiniteElasticity/RightBiceps/build_debug/mpi_verification/Fortran/CMakeFiles/CMakeTmp + +Run Build Command:"/usr/bin/make" "cmTC_99e48/fast" +/usr/bin/make -f CMakeFiles/cmTC_99e48.dir/build.make CMakeFiles/cmTC_99e48.dir/build +make[1]: Entering directory '/store/software/opencmiss/OpenCMISS-examples/FiniteElasticity/RightBiceps/build_debug/mpi_verification/Fortran/CMakeFiles/CMakeTmp' +Building Fortran object CMakeFiles/cmTC_99e48.dir/testFortranCompilerF90.f90.o +/usr/bin/mpif90 -c /store/software/opencmiss/OpenCMISS-examples/FiniteElasticity/RightBiceps/build_debug/mpi_verification/Fortran/CMakeFiles/CMakeTmp/testFortranCompilerF90.f90 -o CMakeFiles/cmTC_99e48.dir/testFortranCompilerF90.f90.o +Linking Fortran executable cmTC_99e48 +/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_99e48.dir/link.txt --verbose=1 +/usr/bin/mpif90 CMakeFiles/cmTC_99e48.dir/testFortranCompilerF90.f90.o -o cmTC_99e48 +make[1]: Leaving directory '/store/software/opencmiss/OpenCMISS-examples/FiniteElasticity/RightBiceps/build_debug/mpi_verification/Fortran/CMakeFiles/CMakeTmp' + + diff --git a/FiniteElasticity/RightBiceps/build_debug/mpi_verification/Fortran/CMakeFiles/Makefile.cmake b/FiniteElasticity/RightBiceps/build_debug/mpi_verification/Fortran/CMakeFiles/Makefile.cmake new file mode 100644 index 00000000..39f9bfcb --- /dev/null +++ b/FiniteElasticity/RightBiceps/build_debug/mpi_verification/Fortran/CMakeFiles/Makefile.cmake @@ -0,0 +1,59 @@ +# CMAKE generated file: DO NOT EDIT! +# Generated by "Unix Makefiles" Generator, CMake Version 3.5 + +# The generator used is: +set(CMAKE_DEPENDS_GENERATOR "Unix Makefiles") + +# The top level Makefile was generated from the following files: +set(CMAKE_MAKEFILE_DEPENDS + "CMakeCache.txt" + "CMakeFiles/3.5.1/CMakeFortranCompiler.cmake" + "CMakeFiles/3.5.1/CMakeSystem.cmake" + "CMakeLists.txt" + "/usr/share/cmake-3.5/Modules/CMakeCommonLanguageInclude.cmake" + "/usr/share/cmake-3.5/Modules/CMakeCompilerIdDetection.cmake" + "/usr/share/cmake-3.5/Modules/CMakeDetermineCompiler.cmake" + "/usr/share/cmake-3.5/Modules/CMakeDetermineCompilerABI.cmake" + "/usr/share/cmake-3.5/Modules/CMakeDetermineCompilerId.cmake" + "/usr/share/cmake-3.5/Modules/CMakeDetermineFortranCompiler.cmake" + "/usr/share/cmake-3.5/Modules/CMakeDetermineSystem.cmake" + "/usr/share/cmake-3.5/Modules/CMakeFindBinUtils.cmake" + "/usr/share/cmake-3.5/Modules/CMakeFortranCompiler.cmake.in" + "/usr/share/cmake-3.5/Modules/CMakeFortranCompilerABI.F" + "/usr/share/cmake-3.5/Modules/CMakeFortranInformation.cmake" + "/usr/share/cmake-3.5/Modules/CMakeGenericSystem.cmake" + "/usr/share/cmake-3.5/Modules/CMakeLanguageInformation.cmake" + "/usr/share/cmake-3.5/Modules/CMakeParseArguments.cmake" + "/usr/share/cmake-3.5/Modules/CMakeParseImplicitLinkInfo.cmake" + "/usr/share/cmake-3.5/Modules/CMakeSystem.cmake.in" + "/usr/share/cmake-3.5/Modules/CMakeSystemSpecificInformation.cmake" + "/usr/share/cmake-3.5/Modules/CMakeSystemSpecificInitialize.cmake" + "/usr/share/cmake-3.5/Modules/CMakeTestCompilerCommon.cmake" + "/usr/share/cmake-3.5/Modules/CMakeTestFortranCompiler.cmake" + "/usr/share/cmake-3.5/Modules/CMakeUnixFindMake.cmake" + "/usr/share/cmake-3.5/Modules/Compiler/GNU-Fortran.cmake" + "/usr/share/cmake-3.5/Modules/Compiler/GNU.cmake" + "/usr/share/cmake-3.5/Modules/MultiArchCross.cmake" + "/usr/share/cmake-3.5/Modules/Platform/Linux-GNU-Fortran.cmake" + "/usr/share/cmake-3.5/Modules/Platform/Linux-GNU.cmake" + "/usr/share/cmake-3.5/Modules/Platform/Linux.cmake" + "/usr/share/cmake-3.5/Modules/Platform/UnixPaths.cmake" + ) + +# The corresponding makefile is: +set(CMAKE_MAKEFILE_OUTPUTS + "Makefile" + "CMakeFiles/cmake.check_cache" + ) + +# Byproducts of CMake generate step: +set(CMAKE_MAKEFILE_PRODUCTS + "CMakeFiles/3.5.1/CMakeSystem.cmake" + "CMakeFiles/3.5.1/CMakeFortranCompiler.cmake" + "CMakeFiles/3.5.1/CMakeFortranCompiler.cmake" + "CMakeFiles/CMakeDirectoryInformation.cmake" + ) + +# Dependency information for all targets: +set(CMAKE_DEPEND_INFO_FILES + ) diff --git a/FiniteElasticity/RightBiceps/build_debug/mpi_verification/Fortran/CMakeFiles/Makefile2 b/FiniteElasticity/RightBiceps/build_debug/mpi_verification/Fortran/CMakeFiles/Makefile2 new file mode 100644 index 00000000..74e34535 --- /dev/null +++ b/FiniteElasticity/RightBiceps/build_debug/mpi_verification/Fortran/CMakeFiles/Makefile2 @@ -0,0 +1,71 @@ +# CMAKE generated file: DO NOT EDIT! +# Generated by "Unix Makefiles" Generator, CMake Version 3.5 + +# Default target executed when no arguments are given to make. +default_target: all + +.PHONY : default_target + +# The main recursive all target +all: + +.PHONY : all + +# The main recursive preinstall target +preinstall: + +.PHONY : preinstall + +#============================================================================= +# Special targets provided by cmake. + +# Disable implicit rules so canonical targets will work. +.SUFFIXES: + + +# Remove some rules from gmake that .SUFFIXES does not remove. +SUFFIXES = + +.SUFFIXES: .hpux_make_needs_suffix_list + + +# Suppress display of executed commands. +$(VERBOSE).SILENT: + + +# A target that is always out of date. +cmake_force: + +.PHONY : cmake_force + +#============================================================================= +# Set environment variables for the build. + +# The shell in which to execute make rules. +SHELL = /bin/sh + +# The CMake executable. +CMAKE_COMMAND = /usr/bin/cmake + +# The command to remove a file. +RM = /usr/bin/cmake -E remove -f + +# Escaping for special characters. +EQUALS = = + +# The top-level source directory on which CMake was run. +CMAKE_SOURCE_DIR = /store/software/opencmiss/OpenCMISS-examples/FiniteElasticity/RightBiceps/build_debug/mpi_verification/Fortran + +# The top-level build directory on which CMake was run. +CMAKE_BINARY_DIR = /store/software/opencmiss/OpenCMISS-examples/FiniteElasticity/RightBiceps/build_debug/mpi_verification/Fortran + +#============================================================================= +# Special targets to cleanup operation of make. + +# Special rule to run CMake to check the build system integrity. +# No rule that depends on this can have commands that come from listfiles +# because they might be regenerated. +cmake_check_build_system: + $(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 0 +.PHONY : cmake_check_build_system + diff --git a/FiniteElasticity/RightBiceps/build_debug/mpi_verification/Fortran/CMakeFiles/TargetDirectories.txt b/FiniteElasticity/RightBiceps/build_debug/mpi_verification/Fortran/CMakeFiles/TargetDirectories.txt new file mode 100644 index 00000000..b3a21616 --- /dev/null +++ b/FiniteElasticity/RightBiceps/build_debug/mpi_verification/Fortran/CMakeFiles/TargetDirectories.txt @@ -0,0 +1,2 @@ +/store/software/opencmiss/OpenCMISS-examples/FiniteElasticity/RightBiceps/build_debug/mpi_verification/Fortran/CMakeFiles/edit_cache.dir +/store/software/opencmiss/OpenCMISS-examples/FiniteElasticity/RightBiceps/build_debug/mpi_verification/Fortran/CMakeFiles/rebuild_cache.dir diff --git a/FiniteElasticity/RightBiceps/build_debug/mpi_verification/Fortran/CMakeFiles/cmake.check_cache b/FiniteElasticity/RightBiceps/build_debug/mpi_verification/Fortran/CMakeFiles/cmake.check_cache new file mode 100644 index 00000000..3dccd731 --- /dev/null +++ b/FiniteElasticity/RightBiceps/build_debug/mpi_verification/Fortran/CMakeFiles/cmake.check_cache @@ -0,0 +1 @@ +# This file is generated by cmake for dependency checking of the CMakeCache.txt file diff --git a/FiniteElasticity/RightBiceps/build_debug/mpi_verification/Fortran/CMakeFiles/progress.marks b/FiniteElasticity/RightBiceps/build_debug/mpi_verification/Fortran/CMakeFiles/progress.marks new file mode 100644 index 00000000..573541ac --- /dev/null +++ b/FiniteElasticity/RightBiceps/build_debug/mpi_verification/Fortran/CMakeFiles/progress.marks @@ -0,0 +1 @@ +0 diff --git a/FiniteElasticity/RightBiceps/build_debug/mpi_verification/Fortran/CMakeLists.txt b/FiniteElasticity/RightBiceps/build_debug/mpi_verification/Fortran/CMakeLists.txt new file mode 100644 index 00000000..fbb3b4a2 --- /dev/null +++ b/FiniteElasticity/RightBiceps/build_debug/mpi_verification/Fortran/CMakeLists.txt @@ -0,0 +1,8 @@ + + cmake_minimum_required(VERSION 3.0) + project(verify_mpi_compat VERSION 1.0 LANGUAGES Fortran) + file(WRITE compiler_info.cmake " + set(MPI_Fortran_COMPILER_VERSION ${CMAKE_Fortran_COMPILER_VERSION}) + set(MPI_Fortran_COMPILER_ID ${CMAKE_Fortran_COMPILER_ID}) + ") + \ No newline at end of file diff --git a/FiniteElasticity/RightBiceps/build_debug/mpi_verification/Fortran/Makefile b/FiniteElasticity/RightBiceps/build_debug/mpi_verification/Fortran/Makefile new file mode 100644 index 00000000..0ebed540 --- /dev/null +++ b/FiniteElasticity/RightBiceps/build_debug/mpi_verification/Fortran/Makefile @@ -0,0 +1,134 @@ +# CMAKE generated file: DO NOT EDIT! +# Generated by "Unix Makefiles" Generator, CMake Version 3.5 + +# Default target executed when no arguments are given to make. +default_target: all + +.PHONY : default_target + +# Allow only one "make -f Makefile2" at a time, but pass parallelism. +.NOTPARALLEL: + + +#============================================================================= +# Special targets provided by cmake. + +# Disable implicit rules so canonical targets will work. +.SUFFIXES: + + +# Remove some rules from gmake that .SUFFIXES does not remove. +SUFFIXES = + +.SUFFIXES: .hpux_make_needs_suffix_list + + +# Suppress display of executed commands. +$(VERBOSE).SILENT: + + +# A target that is always out of date. +cmake_force: + +.PHONY : cmake_force + +#============================================================================= +# Set environment variables for the build. + +# The shell in which to execute make rules. +SHELL = /bin/sh + +# The CMake executable. +CMAKE_COMMAND = /usr/bin/cmake + +# The command to remove a file. +RM = /usr/bin/cmake -E remove -f + +# Escaping for special characters. +EQUALS = = + +# The top-level source directory on which CMake was run. +CMAKE_SOURCE_DIR = /store/software/opencmiss/OpenCMISS-examples/FiniteElasticity/RightBiceps/build_debug/mpi_verification/Fortran + +# The top-level build directory on which CMake was run. +CMAKE_BINARY_DIR = /store/software/opencmiss/OpenCMISS-examples/FiniteElasticity/RightBiceps/build_debug/mpi_verification/Fortran + +#============================================================================= +# Targets provided globally by CMake. + +# Special rule for the target edit_cache +edit_cache: + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running CMake cache editor..." + /usr/bin/ccmake -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) +.PHONY : edit_cache + +# Special rule for the target edit_cache +edit_cache/fast: edit_cache + +.PHONY : edit_cache/fast + +# Special rule for the target rebuild_cache +rebuild_cache: + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running CMake to regenerate build system..." + /usr/bin/cmake -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) +.PHONY : rebuild_cache + +# Special rule for the target rebuild_cache +rebuild_cache/fast: rebuild_cache + +.PHONY : rebuild_cache/fast + +# The main all target +all: cmake_check_build_system + $(CMAKE_COMMAND) -E cmake_progress_start /store/software/opencmiss/OpenCMISS-examples/FiniteElasticity/RightBiceps/build_debug/mpi_verification/Fortran/CMakeFiles /store/software/opencmiss/OpenCMISS-examples/FiniteElasticity/RightBiceps/build_debug/mpi_verification/Fortran/CMakeFiles/progress.marks + $(MAKE) -f CMakeFiles/Makefile2 all + $(CMAKE_COMMAND) -E cmake_progress_start /store/software/opencmiss/OpenCMISS-examples/FiniteElasticity/RightBiceps/build_debug/mpi_verification/Fortran/CMakeFiles 0 +.PHONY : all + +# The main clean target +clean: + $(MAKE) -f CMakeFiles/Makefile2 clean +.PHONY : clean + +# The main clean target +clean/fast: clean + +.PHONY : clean/fast + +# Prepare targets for installation. +preinstall: all + $(MAKE) -f CMakeFiles/Makefile2 preinstall +.PHONY : preinstall + +# Prepare targets for installation. +preinstall/fast: + $(MAKE) -f CMakeFiles/Makefile2 preinstall +.PHONY : preinstall/fast + +# clear depends +depend: + $(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 1 +.PHONY : depend + +# Help Target +help: + @echo "The following are some of the valid targets for this Makefile:" + @echo "... all (the default if no target is provided)" + @echo "... clean" + @echo "... depend" + @echo "... edit_cache" + @echo "... rebuild_cache" +.PHONY : help + + + +#============================================================================= +# Special targets to cleanup operation of make. + +# Special rule to run CMake to check the build system integrity. +# No rule that depends on this can have commands that come from listfiles +# because they might be regenerated. +cmake_check_build_system: + $(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 0 +.PHONY : cmake_check_build_system + diff --git a/FiniteElasticity/RightBiceps/build_debug/mpi_verification/Fortran/cmake_install.cmake b/FiniteElasticity/RightBiceps/build_debug/mpi_verification/Fortran/cmake_install.cmake new file mode 100644 index 00000000..a605f26b --- /dev/null +++ b/FiniteElasticity/RightBiceps/build_debug/mpi_verification/Fortran/cmake_install.cmake @@ -0,0 +1,44 @@ +# Install script for directory: /store/software/opencmiss/OpenCMISS-examples/FiniteElasticity/RightBiceps/build_debug/mpi_verification/Fortran + +# Set the install prefix +if(NOT DEFINED CMAKE_INSTALL_PREFIX) + set(CMAKE_INSTALL_PREFIX "/usr/local") +endif() +string(REGEX REPLACE "/$" "" CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}") + +# Set the install configuration name. +if(NOT DEFINED CMAKE_INSTALL_CONFIG_NAME) + if(BUILD_TYPE) + string(REGEX REPLACE "^[^A-Za-z0-9_]+" "" + CMAKE_INSTALL_CONFIG_NAME "${BUILD_TYPE}") + else() + set(CMAKE_INSTALL_CONFIG_NAME "") + endif() + message(STATUS "Install configuration: \"${CMAKE_INSTALL_CONFIG_NAME}\"") +endif() + +# Set the component getting installed. +if(NOT CMAKE_INSTALL_COMPONENT) + if(COMPONENT) + message(STATUS "Install component: \"${COMPONENT}\"") + set(CMAKE_INSTALL_COMPONENT "${COMPONENT}") + else() + set(CMAKE_INSTALL_COMPONENT) + endif() +endif() + +# Install shared libraries without execute permission? +if(NOT DEFINED CMAKE_INSTALL_SO_NO_EXE) + set(CMAKE_INSTALL_SO_NO_EXE "1") +endif() + +if(CMAKE_INSTALL_COMPONENT) + set(CMAKE_INSTALL_MANIFEST "install_manifest_${CMAKE_INSTALL_COMPONENT}.txt") +else() + set(CMAKE_INSTALL_MANIFEST "install_manifest.txt") +endif() + +string(REPLACE ";" "\n" CMAKE_INSTALL_MANIFEST_CONTENT + "${CMAKE_INSTALL_MANIFEST_FILES}") +file(WRITE "/store/software/opencmiss/OpenCMISS-examples/FiniteElasticity/RightBiceps/build_debug/mpi_verification/Fortran/${CMAKE_INSTALL_MANIFEST}" + "${CMAKE_INSTALL_MANIFEST_CONTENT}") diff --git a/FiniteElasticity/RightBiceps/build_debug/mpi_verification/Fortran/compiler_info.cmake b/FiniteElasticity/RightBiceps/build_debug/mpi_verification/Fortran/compiler_info.cmake new file mode 100644 index 00000000..b319d33e --- /dev/null +++ b/FiniteElasticity/RightBiceps/build_debug/mpi_verification/Fortran/compiler_info.cmake @@ -0,0 +1,4 @@ + + set(MPI_Fortran_COMPILER_VERSION 5.4.0) + set(MPI_Fortran_COMPILER_ID GNU) + \ No newline at end of file diff --git a/FiniteElasticity/SimpleShear/CMakeLists.txt b/FiniteElasticity/SimpleShear/CMakeLists.txt new file mode 100644 index 00000000..a22b61ee --- /dev/null +++ b/FiniteElasticity/SimpleShear/CMakeLists.txt @@ -0,0 +1,35 @@ +# 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 C) +enable_language(Fortran OPTIONAL) +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 +# ---------------------- +#add_subdirectory(C) +if (CMAKE_Fortran_COMPILER) + add_subdirectory(Fortran) +endif() diff --git a/FiniteElasticity/SimpleShear/Fortran/CMakeLists.txt b/FiniteElasticity/SimpleShear/Fortran/CMakeLists.txt new file mode 100644 index 00000000..7a542bb0 --- /dev/null +++ b/FiniteElasticity/SimpleShear/Fortran/CMakeLists.txt @@ -0,0 +1,60 @@ + +# Add example executable +add_executable(SimpleShear src/FortranExample.f90 src/FortranExample_nearly.f90 src/FortranExample_incomp.f90) + +# Turn on Fortran preprocessing (#include directives) +if (MSVC) + set(PROC_OPT "/fpp") +else() + set(PROC_OPT "-cpp") +endif() + +# in debug mode, add flag that make Floating point exceptions fatal +set(OPT "") +if (FALSE) + if(CMAKE_BUILD_TYPE MATCHES DEBUG) + set(OPT "-ffpe-trap=invalid,zero,underflow,overflow,denormal") # GCC: make floating point exceptions fatal + endif() +endif() + +target_compile_options(SimpleShear PRIVATE ${PROC_OPT} ${OPT} "-fbacktrace") + +# Link to opencmiss +# ----------------- +# +# This simply uses the opencmiss target created by OC_INIT() above. +# +# Alternatively, you can also directly invoke 'find_package(Iron )' 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 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(SimpleShear PRIVATE opencmiss) + +# Add a simple test that runs the executable +add_test(NAME test_SimpleShear COMMAND SimpleShear) +add_opencmiss_environment(test_SimpleShear) + +################### +# 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. +# diff --git a/FiniteElasticity/SimpleShear/OpenCMISS.cmake b/FiniteElasticity/SimpleShear/OpenCMISS.cmake new file mode 100644 index 00000000..3d6cf515 --- /dev/null +++ b/FiniteElasticity/SimpleShear/OpenCMISS.cmake @@ -0,0 +1,95 @@ +########################### +# *DO NOT CHANGE THIS FILE* +########################### +# +# Prepares the use of OpenCMISS by scanning at various path locations for OpenCMISS (SDK) installations. +# +# Search order: +# - OPENCMISS_INSTALL_DIR variable +# - OPENCMISS_INSTALL_DIR environment variable +# - OPENCMISS_SDK_DIR variable +# - OPENCMISS_SDK_DIR environment variable +# - [Windows only] The Registry is searched additionally for installed SDKs. +# +# If found +# - Includes the toolchain config script of the found opencmiss installation to enable toolchain selection logic (non-windows) + +# Convenience: The OPENCMISS_INSTALL_DIR may also be defined in the environment and various other places +if (DEFINED OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using specified installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The specified OPENCMISS_INSTALL_DIR '${OPENCMISS_INSTALL_DIR}' does not exist. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_INSTALL_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_INSTALL_DIR}" OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using environment installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The environment variable OPENCMISS_INSTALL_DIR='${OPENCMISS_INSTALL_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if (NOT OPENCMISS_INSTALL_DIR AND DEFINED OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The specified OPENCMISS_SDK_DIR '${OPENCMISS_SDK_DIR}' does not exist. Skipping.") + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_SDK_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_SDK_DIR}" OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using environment SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The environment variable OPENCMISS_SDK_DIR='${OPENCMISS_SDK_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_SDK_DIR) + endif() +endif() +# On windows: check the registry for installed OpenCMISS SDKs +if(NOT OPENCMISS_INSTALL_DIR AND WIN32) + foreach(ROOT HKEY_CURRENT_USER HKEY_LOCAL_MACHINE) + foreach(PACKAGE OpenCMISSUserSDK OpenCMISSDeveloperSDK) + set(_REG_KEY "[${ROOT}\\Software\\Auckland Bioengineering Institute\\${PACKAGE}]") + get_filename_component(OPENCMISS_INSTALL_DIR "${_REG_KEY}" ABSOLUTE) + #message(STATUS "Trying registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Found ${PACKAGE} in Windows registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + break() + else() + unset(OPENCMISS_INSTALL_DIR) + endif() + endforeach() + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + break() + endif() + endforeach() +endif() + +if(OPENCMISS_INSTALL_DIR) + message(STATUS "OPENCMISS_INSTALL_DIR=${OPENCMISS_INSTALL_DIR}") + # Use the OpenCMISS scripts to also allow choosing a separate toolchain + # This file is located at the opencmiss installation rather than the local example + # as it avoids file replication and makes maintenance much easier + if (TOOLCHAIN) + set(_OCTC ${OPENCMISS_INSTALL_DIR}/cmake/OCToolchainCompilers.cmake) + if (EXISTS "${_OCTC}") + include(${_OCTC}) + else() + message(WARNING "TOOLCHAIN specified but OpenCMISS config script could not be found at ${_OCTC}. Trying CMake defaults.") + endif() + unset(_OCTC) + endif() + set(OpenCMISS_DIR "${OPENCMISS_INSTALL_DIR}" CACHE PATH "Path to the found OpenCMISS (SDK) installation") +else() + message(WARNING "No OpenCMISS (SDK) installation directory detected. Using default system environment.") +endif() + \ No newline at end of file diff --git a/FiniteElasticity/SimpleShear/build_debug/build.sh b/FiniteElasticity/SimpleShear/build_debug/build.sh new file mode 100644 index 00000000..e6624bac --- /dev/null +++ b/FiniteElasticity/SimpleShear/build_debug/build.sh @@ -0,0 +1,2 @@ +#ccc && cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all +cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all diff --git a/FiniteElasticity/SimplexElements/LargeQuadraticTet/CMakeLists.txt b/FiniteElasticity/SimplexElements/LargeQuadraticTet/CMakeLists.txt new file mode 100644 index 00000000..a22b61ee --- /dev/null +++ b/FiniteElasticity/SimplexElements/LargeQuadraticTet/CMakeLists.txt @@ -0,0 +1,35 @@ +# 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 C) +enable_language(Fortran OPTIONAL) +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 +# ---------------------- +#add_subdirectory(C) +if (CMAKE_Fortran_COMPILER) + add_subdirectory(Fortran) +endif() diff --git a/FiniteElasticity/SimplexElements/LargeQuadraticTet/Fortran/CMakeLists.txt b/FiniteElasticity/SimplexElements/LargeQuadraticTet/Fortran/CMakeLists.txt new file mode 100644 index 00000000..80abbcf7 --- /dev/null +++ b/FiniteElasticity/SimplexElements/LargeQuadraticTet/Fortran/CMakeLists.txt @@ -0,0 +1,60 @@ + +# Add example executable +add_executable(LargeQuadraticTet src/LargeQuadraticTetExample.f90) + +# Turn on Fortran preprocessing (#include directives) +if (MSVC) + set(PROC_OPT "/fpp") +else() + set(PROC_OPT "-cpp") +endif() + +# in debug mode, add flag that make Floating point exceptions fatal +set(OPT "") +if (FALSE) + if(CMAKE_BUILD_TYPE MATCHES DEBUG) + set(OPT "-ffpe-trap=invalid,zero,underflow,overflow,denormal") # GCC: make floating point exceptions fatal + endif() +endif() + +target_compile_options(LargeQuadraticTet PRIVATE ${PROC_OPT} ${OPT} "-fbacktrace") + +# Link to opencmiss +# ----------------- +# +# This simply uses the opencmiss target created by OC_INIT() above. +# +# Alternatively, you can also directly invoke 'find_package(Iron )' 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 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(LargeQuadraticTet PRIVATE opencmiss) + +# Add a simple test that runs the executable +add_test(NAME test_LargeQuadraticTet COMMAND LargeQuadraticTet) +add_opencmiss_environment(test_LargeQuadraticTet) + +################### +# 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. +# diff --git a/FiniteElasticity/SimplexElements/LargeQuadraticTet/src/LargeQuadraticTetExample.f90 b/FiniteElasticity/SimplexElements/LargeQuadraticTet/Fortran/src/LargeQuadraticTetExample.f90 similarity index 100% rename from FiniteElasticity/SimplexElements/LargeQuadraticTet/src/LargeQuadraticTetExample.f90 rename to FiniteElasticity/SimplexElements/LargeQuadraticTet/Fortran/src/LargeQuadraticTetExample.f90 diff --git a/FiniteElasticity/SimplexElements/LargeQuadraticTet/OpenCMISS.cmake b/FiniteElasticity/SimplexElements/LargeQuadraticTet/OpenCMISS.cmake new file mode 100644 index 00000000..3d6cf515 --- /dev/null +++ b/FiniteElasticity/SimplexElements/LargeQuadraticTet/OpenCMISS.cmake @@ -0,0 +1,95 @@ +########################### +# *DO NOT CHANGE THIS FILE* +########################### +# +# Prepares the use of OpenCMISS by scanning at various path locations for OpenCMISS (SDK) installations. +# +# Search order: +# - OPENCMISS_INSTALL_DIR variable +# - OPENCMISS_INSTALL_DIR environment variable +# - OPENCMISS_SDK_DIR variable +# - OPENCMISS_SDK_DIR environment variable +# - [Windows only] The Registry is searched additionally for installed SDKs. +# +# If found +# - Includes the toolchain config script of the found opencmiss installation to enable toolchain selection logic (non-windows) + +# Convenience: The OPENCMISS_INSTALL_DIR may also be defined in the environment and various other places +if (DEFINED OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using specified installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The specified OPENCMISS_INSTALL_DIR '${OPENCMISS_INSTALL_DIR}' does not exist. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_INSTALL_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_INSTALL_DIR}" OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using environment installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The environment variable OPENCMISS_INSTALL_DIR='${OPENCMISS_INSTALL_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if (NOT OPENCMISS_INSTALL_DIR AND DEFINED OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The specified OPENCMISS_SDK_DIR '${OPENCMISS_SDK_DIR}' does not exist. Skipping.") + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_SDK_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_SDK_DIR}" OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using environment SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The environment variable OPENCMISS_SDK_DIR='${OPENCMISS_SDK_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_SDK_DIR) + endif() +endif() +# On windows: check the registry for installed OpenCMISS SDKs +if(NOT OPENCMISS_INSTALL_DIR AND WIN32) + foreach(ROOT HKEY_CURRENT_USER HKEY_LOCAL_MACHINE) + foreach(PACKAGE OpenCMISSUserSDK OpenCMISSDeveloperSDK) + set(_REG_KEY "[${ROOT}\\Software\\Auckland Bioengineering Institute\\${PACKAGE}]") + get_filename_component(OPENCMISS_INSTALL_DIR "${_REG_KEY}" ABSOLUTE) + #message(STATUS "Trying registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Found ${PACKAGE} in Windows registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + break() + else() + unset(OPENCMISS_INSTALL_DIR) + endif() + endforeach() + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + break() + endif() + endforeach() +endif() + +if(OPENCMISS_INSTALL_DIR) + message(STATUS "OPENCMISS_INSTALL_DIR=${OPENCMISS_INSTALL_DIR}") + # Use the OpenCMISS scripts to also allow choosing a separate toolchain + # This file is located at the opencmiss installation rather than the local example + # as it avoids file replication and makes maintenance much easier + if (TOOLCHAIN) + set(_OCTC ${OPENCMISS_INSTALL_DIR}/cmake/OCToolchainCompilers.cmake) + if (EXISTS "${_OCTC}") + include(${_OCTC}) + else() + message(WARNING "TOOLCHAIN specified but OpenCMISS config script could not be found at ${_OCTC}. Trying CMake defaults.") + endif() + unset(_OCTC) + endif() + set(OpenCMISS_DIR "${OPENCMISS_INSTALL_DIR}" CACHE PATH "Path to the found OpenCMISS (SDK) installation") +else() + message(WARNING "No OpenCMISS (SDK) installation directory detected. Using default system environment.") +endif() + \ No newline at end of file diff --git a/FiniteElasticity/SimplexElements/LargeQuadraticTet/build_debug/build.sh b/FiniteElasticity/SimplexElements/LargeQuadraticTet/build_debug/build.sh new file mode 100644 index 00000000..e6624bac --- /dev/null +++ b/FiniteElasticity/SimplexElements/LargeQuadraticTet/build_debug/build.sh @@ -0,0 +1,2 @@ +#ccc && cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all +cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all diff --git a/FiniteElasticity/SimplexElements/LinearTet/CMakeLists.txt b/FiniteElasticity/SimplexElements/LinearTet/CMakeLists.txt new file mode 100644 index 00000000..a22b61ee --- /dev/null +++ b/FiniteElasticity/SimplexElements/LinearTet/CMakeLists.txt @@ -0,0 +1,35 @@ +# 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 C) +enable_language(Fortran OPTIONAL) +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 +# ---------------------- +#add_subdirectory(C) +if (CMAKE_Fortran_COMPILER) + add_subdirectory(Fortran) +endif() diff --git a/FiniteElasticity/SimplexElements/LinearTet/Fortran/CMakeLists.txt b/FiniteElasticity/SimplexElements/LinearTet/Fortran/CMakeLists.txt new file mode 100644 index 00000000..5dcf3560 --- /dev/null +++ b/FiniteElasticity/SimplexElements/LinearTet/Fortran/CMakeLists.txt @@ -0,0 +1,60 @@ + +# Add example executable +add_executable(LinearTet src/LinearTetExample.f90) + +# Turn on Fortran preprocessing (#include directives) +if (MSVC) + set(PROC_OPT "/fpp") +else() + set(PROC_OPT "-cpp") +endif() + +# in debug mode, add flag that make Floating point exceptions fatal +set(OPT "") +if (FALSE) + if(CMAKE_BUILD_TYPE MATCHES DEBUG) + set(OPT "-ffpe-trap=invalid,zero,underflow,overflow,denormal") # GCC: make floating point exceptions fatal + endif() +endif() + +target_compile_options(LinearTet PRIVATE ${PROC_OPT} ${OPT} "-fbacktrace") + +# Link to opencmiss +# ----------------- +# +# This simply uses the opencmiss target created by OC_INIT() above. +# +# Alternatively, you can also directly invoke 'find_package(Iron )' 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 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(LinearTet PRIVATE opencmiss) + +# Add a simple test that runs the executable +add_test(NAME test_LinearTet COMMAND LinearTet) +add_opencmiss_environment(test_LinearTet) + +################### +# 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. +# diff --git a/FiniteElasticity/SimplexElements/LinearTet/src/LinearTetExample.f90 b/FiniteElasticity/SimplexElements/LinearTet/Fortran/src/LinearTetExample.f90 similarity index 100% rename from FiniteElasticity/SimplexElements/LinearTet/src/LinearTetExample.f90 rename to FiniteElasticity/SimplexElements/LinearTet/Fortran/src/LinearTetExample.f90 diff --git a/FiniteElasticity/SimplexElements/LinearTet/OpenCMISS.cmake b/FiniteElasticity/SimplexElements/LinearTet/OpenCMISS.cmake new file mode 100644 index 00000000..3d6cf515 --- /dev/null +++ b/FiniteElasticity/SimplexElements/LinearTet/OpenCMISS.cmake @@ -0,0 +1,95 @@ +########################### +# *DO NOT CHANGE THIS FILE* +########################### +# +# Prepares the use of OpenCMISS by scanning at various path locations for OpenCMISS (SDK) installations. +# +# Search order: +# - OPENCMISS_INSTALL_DIR variable +# - OPENCMISS_INSTALL_DIR environment variable +# - OPENCMISS_SDK_DIR variable +# - OPENCMISS_SDK_DIR environment variable +# - [Windows only] The Registry is searched additionally for installed SDKs. +# +# If found +# - Includes the toolchain config script of the found opencmiss installation to enable toolchain selection logic (non-windows) + +# Convenience: The OPENCMISS_INSTALL_DIR may also be defined in the environment and various other places +if (DEFINED OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using specified installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The specified OPENCMISS_INSTALL_DIR '${OPENCMISS_INSTALL_DIR}' does not exist. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_INSTALL_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_INSTALL_DIR}" OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using environment installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The environment variable OPENCMISS_INSTALL_DIR='${OPENCMISS_INSTALL_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if (NOT OPENCMISS_INSTALL_DIR AND DEFINED OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The specified OPENCMISS_SDK_DIR '${OPENCMISS_SDK_DIR}' does not exist. Skipping.") + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_SDK_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_SDK_DIR}" OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using environment SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The environment variable OPENCMISS_SDK_DIR='${OPENCMISS_SDK_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_SDK_DIR) + endif() +endif() +# On windows: check the registry for installed OpenCMISS SDKs +if(NOT OPENCMISS_INSTALL_DIR AND WIN32) + foreach(ROOT HKEY_CURRENT_USER HKEY_LOCAL_MACHINE) + foreach(PACKAGE OpenCMISSUserSDK OpenCMISSDeveloperSDK) + set(_REG_KEY "[${ROOT}\\Software\\Auckland Bioengineering Institute\\${PACKAGE}]") + get_filename_component(OPENCMISS_INSTALL_DIR "${_REG_KEY}" ABSOLUTE) + #message(STATUS "Trying registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Found ${PACKAGE} in Windows registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + break() + else() + unset(OPENCMISS_INSTALL_DIR) + endif() + endforeach() + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + break() + endif() + endforeach() +endif() + +if(OPENCMISS_INSTALL_DIR) + message(STATUS "OPENCMISS_INSTALL_DIR=${OPENCMISS_INSTALL_DIR}") + # Use the OpenCMISS scripts to also allow choosing a separate toolchain + # This file is located at the opencmiss installation rather than the local example + # as it avoids file replication and makes maintenance much easier + if (TOOLCHAIN) + set(_OCTC ${OPENCMISS_INSTALL_DIR}/cmake/OCToolchainCompilers.cmake) + if (EXISTS "${_OCTC}") + include(${_OCTC}) + else() + message(WARNING "TOOLCHAIN specified but OpenCMISS config script could not be found at ${_OCTC}. Trying CMake defaults.") + endif() + unset(_OCTC) + endif() + set(OpenCMISS_DIR "${OPENCMISS_INSTALL_DIR}" CACHE PATH "Path to the found OpenCMISS (SDK) installation") +else() + message(WARNING "No OpenCMISS (SDK) installation directory detected. Using default system environment.") +endif() + \ No newline at end of file diff --git a/FiniteElasticity/SimplexElements/LinearTet/build_debug/build.sh b/FiniteElasticity/SimplexElements/LinearTet/build_debug/build.sh new file mode 100644 index 00000000..e6624bac --- /dev/null +++ b/FiniteElasticity/SimplexElements/LinearTet/build_debug/build.sh @@ -0,0 +1,2 @@ +#ccc && cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all +cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all diff --git a/FiniteElasticity/SimplexElements/QuadraticTet/CMakeLists.txt b/FiniteElasticity/SimplexElements/QuadraticTet/CMakeLists.txt new file mode 100644 index 00000000..a22b61ee --- /dev/null +++ b/FiniteElasticity/SimplexElements/QuadraticTet/CMakeLists.txt @@ -0,0 +1,35 @@ +# 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 C) +enable_language(Fortran OPTIONAL) +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 +# ---------------------- +#add_subdirectory(C) +if (CMAKE_Fortran_COMPILER) + add_subdirectory(Fortran) +endif() diff --git a/FiniteElasticity/SimplexElements/QuadraticTet/Fortran/CMakeLists.txt b/FiniteElasticity/SimplexElements/QuadraticTet/Fortran/CMakeLists.txt new file mode 100644 index 00000000..2692ef0f --- /dev/null +++ b/FiniteElasticity/SimplexElements/QuadraticTet/Fortran/CMakeLists.txt @@ -0,0 +1,60 @@ + +# Add example executable +add_executable(QuadraticTet src/QuadraticTetExample.f90) + +# Turn on Fortran preprocessing (#include directives) +if (MSVC) + set(PROC_OPT "/fpp") +else() + set(PROC_OPT "-cpp") +endif() + +# in debug mode, add flag that make Floating point exceptions fatal +set(OPT "") +if (FALSE) + if(CMAKE_BUILD_TYPE MATCHES DEBUG) + set(OPT "-ffpe-trap=invalid,zero,underflow,overflow,denormal") # GCC: make floating point exceptions fatal + endif() +endif() + +target_compile_options(QuadraticTet PRIVATE ${PROC_OPT} ${OPT} "-fbacktrace") + +# Link to opencmiss +# ----------------- +# +# This simply uses the opencmiss target created by OC_INIT() above. +# +# Alternatively, you can also directly invoke 'find_package(Iron )' 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 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(QuadraticTet PRIVATE opencmiss) + +# Add a simple test that runs the executable +add_test(NAME test_QuadraticTet COMMAND QuadraticTet) +add_opencmiss_environment(test_QuadraticTet) + +################### +# 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. +# diff --git a/FiniteElasticity/SimplexElements/QuadraticTet/src/QuadraticTetExample.f90 b/FiniteElasticity/SimplexElements/QuadraticTet/Fortran/src/QuadraticTetExample.f90 similarity index 100% rename from FiniteElasticity/SimplexElements/QuadraticTet/src/QuadraticTetExample.f90 rename to FiniteElasticity/SimplexElements/QuadraticTet/Fortran/src/QuadraticTetExample.f90 diff --git a/FiniteElasticity/SimplexElements/QuadraticTet/OpenCMISS.cmake b/FiniteElasticity/SimplexElements/QuadraticTet/OpenCMISS.cmake new file mode 100644 index 00000000..3d6cf515 --- /dev/null +++ b/FiniteElasticity/SimplexElements/QuadraticTet/OpenCMISS.cmake @@ -0,0 +1,95 @@ +########################### +# *DO NOT CHANGE THIS FILE* +########################### +# +# Prepares the use of OpenCMISS by scanning at various path locations for OpenCMISS (SDK) installations. +# +# Search order: +# - OPENCMISS_INSTALL_DIR variable +# - OPENCMISS_INSTALL_DIR environment variable +# - OPENCMISS_SDK_DIR variable +# - OPENCMISS_SDK_DIR environment variable +# - [Windows only] The Registry is searched additionally for installed SDKs. +# +# If found +# - Includes the toolchain config script of the found opencmiss installation to enable toolchain selection logic (non-windows) + +# Convenience: The OPENCMISS_INSTALL_DIR may also be defined in the environment and various other places +if (DEFINED OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using specified installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The specified OPENCMISS_INSTALL_DIR '${OPENCMISS_INSTALL_DIR}' does not exist. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_INSTALL_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_INSTALL_DIR}" OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using environment installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The environment variable OPENCMISS_INSTALL_DIR='${OPENCMISS_INSTALL_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if (NOT OPENCMISS_INSTALL_DIR AND DEFINED OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The specified OPENCMISS_SDK_DIR '${OPENCMISS_SDK_DIR}' does not exist. Skipping.") + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_SDK_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_SDK_DIR}" OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using environment SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The environment variable OPENCMISS_SDK_DIR='${OPENCMISS_SDK_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_SDK_DIR) + endif() +endif() +# On windows: check the registry for installed OpenCMISS SDKs +if(NOT OPENCMISS_INSTALL_DIR AND WIN32) + foreach(ROOT HKEY_CURRENT_USER HKEY_LOCAL_MACHINE) + foreach(PACKAGE OpenCMISSUserSDK OpenCMISSDeveloperSDK) + set(_REG_KEY "[${ROOT}\\Software\\Auckland Bioengineering Institute\\${PACKAGE}]") + get_filename_component(OPENCMISS_INSTALL_DIR "${_REG_KEY}" ABSOLUTE) + #message(STATUS "Trying registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Found ${PACKAGE} in Windows registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + break() + else() + unset(OPENCMISS_INSTALL_DIR) + endif() + endforeach() + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + break() + endif() + endforeach() +endif() + +if(OPENCMISS_INSTALL_DIR) + message(STATUS "OPENCMISS_INSTALL_DIR=${OPENCMISS_INSTALL_DIR}") + # Use the OpenCMISS scripts to also allow choosing a separate toolchain + # This file is located at the opencmiss installation rather than the local example + # as it avoids file replication and makes maintenance much easier + if (TOOLCHAIN) + set(_OCTC ${OPENCMISS_INSTALL_DIR}/cmake/OCToolchainCompilers.cmake) + if (EXISTS "${_OCTC}") + include(${_OCTC}) + else() + message(WARNING "TOOLCHAIN specified but OpenCMISS config script could not be found at ${_OCTC}. Trying CMake defaults.") + endif() + unset(_OCTC) + endif() + set(OpenCMISS_DIR "${OPENCMISS_INSTALL_DIR}" CACHE PATH "Path to the found OpenCMISS (SDK) installation") +else() + message(WARNING "No OpenCMISS (SDK) installation directory detected. Using default system environment.") +endif() + \ No newline at end of file diff --git a/FiniteElasticity/SimplexElements/QuadraticTet/build_debug/build.sh b/FiniteElasticity/SimplexElements/QuadraticTet/build_debug/build.sh new file mode 100644 index 00000000..e6624bac --- /dev/null +++ b/FiniteElasticity/SimplexElements/QuadraticTet/build_debug/build.sh @@ -0,0 +1,2 @@ +#ccc && cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all +cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all diff --git a/FiniteElasticity/TriCubicAxialExtension/CMakeLists.txt b/FiniteElasticity/TriCubicAxialExtension/CMakeLists.txt new file mode 100644 index 00000000..a22b61ee --- /dev/null +++ b/FiniteElasticity/TriCubicAxialExtension/CMakeLists.txt @@ -0,0 +1,35 @@ +# 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 C) +enable_language(Fortran OPTIONAL) +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 +# ---------------------- +#add_subdirectory(C) +if (CMAKE_Fortran_COMPILER) + add_subdirectory(Fortran) +endif() diff --git a/FiniteElasticity/TriCubicAxialExtension/Fortran/CMakeLists.txt b/FiniteElasticity/TriCubicAxialExtension/Fortran/CMakeLists.txt new file mode 100644 index 00000000..e1ff9219 --- /dev/null +++ b/FiniteElasticity/TriCubicAxialExtension/Fortran/CMakeLists.txt @@ -0,0 +1,60 @@ + +# Add example executable +add_executable(TriCubicAxialExtension src/TriCubicAxialExtensionExample.f90) + +# Turn on Fortran preprocessing (#include directives) +if (MSVC) + set(PROC_OPT "/fpp") +else() + set(PROC_OPT "-cpp") +endif() + +# in debug mode, add flag that make Floating point exceptions fatal +set(OPT "") +if (FALSE) + if(CMAKE_BUILD_TYPE MATCHES DEBUG) + set(OPT "-ffpe-trap=invalid,zero,underflow,overflow,denormal") # GCC: make floating point exceptions fatal + endif() +endif() + +target_compile_options(TriCubicAxialExtension PRIVATE ${PROC_OPT} ${OPT} "-fbacktrace") + +# Link to opencmiss +# ----------------- +# +# This simply uses the opencmiss target created by OC_INIT() above. +# +# Alternatively, you can also directly invoke 'find_package(Iron )' 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 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(TriCubicAxialExtension PRIVATE opencmiss) + +# Add a simple test that runs the executable +add_test(NAME test_TriCubicAxialExtension COMMAND TriCubicAxialExtension) +add_opencmiss_environment(test_TriCubicAxialExtension) + +################### +# 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. +# diff --git a/FiniteElasticity/TriCubicAxialExtension/src/TriCubicAxialExtensionExample.f90 b/FiniteElasticity/TriCubicAxialExtension/Fortran/src/TriCubicAxialExtensionExample.f90 similarity index 100% rename from FiniteElasticity/TriCubicAxialExtension/src/TriCubicAxialExtensionExample.f90 rename to FiniteElasticity/TriCubicAxialExtension/Fortran/src/TriCubicAxialExtensionExample.f90 diff --git a/FiniteElasticity/TriCubicAxialExtension/OpenCMISS.cmake b/FiniteElasticity/TriCubicAxialExtension/OpenCMISS.cmake new file mode 100644 index 00000000..3d6cf515 --- /dev/null +++ b/FiniteElasticity/TriCubicAxialExtension/OpenCMISS.cmake @@ -0,0 +1,95 @@ +########################### +# *DO NOT CHANGE THIS FILE* +########################### +# +# Prepares the use of OpenCMISS by scanning at various path locations for OpenCMISS (SDK) installations. +# +# Search order: +# - OPENCMISS_INSTALL_DIR variable +# - OPENCMISS_INSTALL_DIR environment variable +# - OPENCMISS_SDK_DIR variable +# - OPENCMISS_SDK_DIR environment variable +# - [Windows only] The Registry is searched additionally for installed SDKs. +# +# If found +# - Includes the toolchain config script of the found opencmiss installation to enable toolchain selection logic (non-windows) + +# Convenience: The OPENCMISS_INSTALL_DIR may also be defined in the environment and various other places +if (DEFINED OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using specified installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The specified OPENCMISS_INSTALL_DIR '${OPENCMISS_INSTALL_DIR}' does not exist. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_INSTALL_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_INSTALL_DIR}" OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using environment installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The environment variable OPENCMISS_INSTALL_DIR='${OPENCMISS_INSTALL_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if (NOT OPENCMISS_INSTALL_DIR AND DEFINED OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The specified OPENCMISS_SDK_DIR '${OPENCMISS_SDK_DIR}' does not exist. Skipping.") + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_SDK_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_SDK_DIR}" OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using environment SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The environment variable OPENCMISS_SDK_DIR='${OPENCMISS_SDK_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_SDK_DIR) + endif() +endif() +# On windows: check the registry for installed OpenCMISS SDKs +if(NOT OPENCMISS_INSTALL_DIR AND WIN32) + foreach(ROOT HKEY_CURRENT_USER HKEY_LOCAL_MACHINE) + foreach(PACKAGE OpenCMISSUserSDK OpenCMISSDeveloperSDK) + set(_REG_KEY "[${ROOT}\\Software\\Auckland Bioengineering Institute\\${PACKAGE}]") + get_filename_component(OPENCMISS_INSTALL_DIR "${_REG_KEY}" ABSOLUTE) + #message(STATUS "Trying registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Found ${PACKAGE} in Windows registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + break() + else() + unset(OPENCMISS_INSTALL_DIR) + endif() + endforeach() + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + break() + endif() + endforeach() +endif() + +if(OPENCMISS_INSTALL_DIR) + message(STATUS "OPENCMISS_INSTALL_DIR=${OPENCMISS_INSTALL_DIR}") + # Use the OpenCMISS scripts to also allow choosing a separate toolchain + # This file is located at the opencmiss installation rather than the local example + # as it avoids file replication and makes maintenance much easier + if (TOOLCHAIN) + set(_OCTC ${OPENCMISS_INSTALL_DIR}/cmake/OCToolchainCompilers.cmake) + if (EXISTS "${_OCTC}") + include(${_OCTC}) + else() + message(WARNING "TOOLCHAIN specified but OpenCMISS config script could not be found at ${_OCTC}. Trying CMake defaults.") + endif() + unset(_OCTC) + endif() + set(OpenCMISS_DIR "${OPENCMISS_INSTALL_DIR}" CACHE PATH "Path to the found OpenCMISS (SDK) installation") +else() + message(WARNING "No OpenCMISS (SDK) installation directory detected. Using default system environment.") +endif() + \ No newline at end of file diff --git a/FiniteElasticity/TriCubicAxialExtension/build_debug/build.sh b/FiniteElasticity/TriCubicAxialExtension/build_debug/build.sh new file mode 100644 index 00000000..e6624bac --- /dev/null +++ b/FiniteElasticity/TriCubicAxialExtension/build_debug/build.sh @@ -0,0 +1,2 @@ +#ccc && cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all +cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all diff --git a/FiniteElasticity/TriQuadraticCube/CMakeLists.txt b/FiniteElasticity/TriQuadraticCube/CMakeLists.txt new file mode 100644 index 00000000..a22b61ee --- /dev/null +++ b/FiniteElasticity/TriQuadraticCube/CMakeLists.txt @@ -0,0 +1,35 @@ +# 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 C) +enable_language(Fortran OPTIONAL) +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 +# ---------------------- +#add_subdirectory(C) +if (CMAKE_Fortran_COMPILER) + add_subdirectory(Fortran) +endif() diff --git a/FiniteElasticity/TriQuadraticCube/Fortran/CMakeLists.txt b/FiniteElasticity/TriQuadraticCube/Fortran/CMakeLists.txt new file mode 100644 index 00000000..17c695e0 --- /dev/null +++ b/FiniteElasticity/TriQuadraticCube/Fortran/CMakeLists.txt @@ -0,0 +1,60 @@ + +# Add example executable +add_executable(TriQuadraticCube src/TriQuadraticCubeExample.f90) + +# Turn on Fortran preprocessing (#include directives) +if (MSVC) + set(PROC_OPT "/fpp") +else() + set(PROC_OPT "-cpp") +endif() + +# in debug mode, add flag that make Floating point exceptions fatal +set(OPT "") +if (FALSE) + if(CMAKE_BUILD_TYPE MATCHES DEBUG) + set(OPT "-ffpe-trap=invalid,zero,underflow,overflow,denormal") # GCC: make floating point exceptions fatal + endif() +endif() + +target_compile_options(TriQuadraticCube PRIVATE ${PROC_OPT} ${OPT} "-fbacktrace") + +# Link to opencmiss +# ----------------- +# +# This simply uses the opencmiss target created by OC_INIT() above. +# +# Alternatively, you can also directly invoke 'find_package(Iron )' 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 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(TriQuadraticCube PRIVATE opencmiss) + +# Add a simple test that runs the executable +add_test(NAME test_TriQuadraticCube COMMAND TriQuadraticCube) +add_opencmiss_environment(test_TriQuadraticCube) + +################### +# 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. +# diff --git a/FiniteElasticity/TriQuadraticCube/src/TriQuadraticCubeExample.f90 b/FiniteElasticity/TriQuadraticCube/Fortran/src/TriQuadraticCubeExample.f90 similarity index 100% rename from FiniteElasticity/TriQuadraticCube/src/TriQuadraticCubeExample.f90 rename to FiniteElasticity/TriQuadraticCube/Fortran/src/TriQuadraticCubeExample.f90 diff --git a/FiniteElasticity/TriQuadraticCube/OpenCMISS.cmake b/FiniteElasticity/TriQuadraticCube/OpenCMISS.cmake new file mode 100644 index 00000000..3d6cf515 --- /dev/null +++ b/FiniteElasticity/TriQuadraticCube/OpenCMISS.cmake @@ -0,0 +1,95 @@ +########################### +# *DO NOT CHANGE THIS FILE* +########################### +# +# Prepares the use of OpenCMISS by scanning at various path locations for OpenCMISS (SDK) installations. +# +# Search order: +# - OPENCMISS_INSTALL_DIR variable +# - OPENCMISS_INSTALL_DIR environment variable +# - OPENCMISS_SDK_DIR variable +# - OPENCMISS_SDK_DIR environment variable +# - [Windows only] The Registry is searched additionally for installed SDKs. +# +# If found +# - Includes the toolchain config script of the found opencmiss installation to enable toolchain selection logic (non-windows) + +# Convenience: The OPENCMISS_INSTALL_DIR may also be defined in the environment and various other places +if (DEFINED OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using specified installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The specified OPENCMISS_INSTALL_DIR '${OPENCMISS_INSTALL_DIR}' does not exist. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_INSTALL_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_INSTALL_DIR}" OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using environment installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The environment variable OPENCMISS_INSTALL_DIR='${OPENCMISS_INSTALL_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if (NOT OPENCMISS_INSTALL_DIR AND DEFINED OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The specified OPENCMISS_SDK_DIR '${OPENCMISS_SDK_DIR}' does not exist. Skipping.") + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_SDK_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_SDK_DIR}" OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using environment SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The environment variable OPENCMISS_SDK_DIR='${OPENCMISS_SDK_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_SDK_DIR) + endif() +endif() +# On windows: check the registry for installed OpenCMISS SDKs +if(NOT OPENCMISS_INSTALL_DIR AND WIN32) + foreach(ROOT HKEY_CURRENT_USER HKEY_LOCAL_MACHINE) + foreach(PACKAGE OpenCMISSUserSDK OpenCMISSDeveloperSDK) + set(_REG_KEY "[${ROOT}\\Software\\Auckland Bioengineering Institute\\${PACKAGE}]") + get_filename_component(OPENCMISS_INSTALL_DIR "${_REG_KEY}" ABSOLUTE) + #message(STATUS "Trying registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Found ${PACKAGE} in Windows registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + break() + else() + unset(OPENCMISS_INSTALL_DIR) + endif() + endforeach() + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + break() + endif() + endforeach() +endif() + +if(OPENCMISS_INSTALL_DIR) + message(STATUS "OPENCMISS_INSTALL_DIR=${OPENCMISS_INSTALL_DIR}") + # Use the OpenCMISS scripts to also allow choosing a separate toolchain + # This file is located at the opencmiss installation rather than the local example + # as it avoids file replication and makes maintenance much easier + if (TOOLCHAIN) + set(_OCTC ${OPENCMISS_INSTALL_DIR}/cmake/OCToolchainCompilers.cmake) + if (EXISTS "${_OCTC}") + include(${_OCTC}) + else() + message(WARNING "TOOLCHAIN specified but OpenCMISS config script could not be found at ${_OCTC}. Trying CMake defaults.") + endif() + unset(_OCTC) + endif() + set(OpenCMISS_DIR "${OPENCMISS_INSTALL_DIR}" CACHE PATH "Path to the found OpenCMISS (SDK) installation") +else() + message(WARNING "No OpenCMISS (SDK) installation directory detected. Using default system environment.") +endif() + \ No newline at end of file diff --git a/FiniteElasticity/TriQuadraticCube/build_debug/build.sh b/FiniteElasticity/TriQuadraticCube/build_debug/build.sh new file mode 100644 index 00000000..e6624bac --- /dev/null +++ b/FiniteElasticity/TriQuadraticCube/build_debug/build.sh @@ -0,0 +1,2 @@ +#ccc && cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all +cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all diff --git a/FiniteElasticity/UniAxialExtension/CMakeLists.txt b/FiniteElasticity/UniAxialExtension/CMakeLists.txt new file mode 100644 index 00000000..a22b61ee --- /dev/null +++ b/FiniteElasticity/UniAxialExtension/CMakeLists.txt @@ -0,0 +1,35 @@ +# 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 C) +enable_language(Fortran OPTIONAL) +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 +# ---------------------- +#add_subdirectory(C) +if (CMAKE_Fortran_COMPILER) + add_subdirectory(Fortran) +endif() diff --git a/FiniteElasticity/UniAxialExtension/Fortran/CMakeLists.txt b/FiniteElasticity/UniAxialExtension/Fortran/CMakeLists.txt new file mode 100644 index 00000000..175c27eb --- /dev/null +++ b/FiniteElasticity/UniAxialExtension/Fortran/CMakeLists.txt @@ -0,0 +1,60 @@ + +# Add example executable +add_executable(UniAxialExtension src/FortranExample.f90) + +# Turn on Fortran preprocessing (#include directives) +if (MSVC) + set(PROC_OPT "/fpp") +else() + set(PROC_OPT "-cpp") +endif() + +# in debug mode, add flag that make Floating point exceptions fatal +set(OPT "") +if (FALSE) + if(CMAKE_BUILD_TYPE MATCHES DEBUG) + set(OPT "-ffpe-trap=invalid,zero,underflow,overflow,denormal") # GCC: make floating point exceptions fatal + endif() +endif() + +target_compile_options(UniAxialExtension PRIVATE ${PROC_OPT} ${OPT} "-fbacktrace") + +# Link to opencmiss +# ----------------- +# +# This simply uses the opencmiss target created by OC_INIT() above. +# +# Alternatively, you can also directly invoke 'find_package(Iron )' 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 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(UniAxialExtension PRIVATE opencmiss) + +# Add a simple test that runs the executable +add_test(NAME test_UniAxialExtension COMMAND UniAxialExtension) +add_opencmiss_environment(test_UniAxialExtension) + +################### +# 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. +# diff --git a/FiniteElasticity/UniAxialExtension/OpenCMISS.cmake b/FiniteElasticity/UniAxialExtension/OpenCMISS.cmake new file mode 100644 index 00000000..3d6cf515 --- /dev/null +++ b/FiniteElasticity/UniAxialExtension/OpenCMISS.cmake @@ -0,0 +1,95 @@ +########################### +# *DO NOT CHANGE THIS FILE* +########################### +# +# Prepares the use of OpenCMISS by scanning at various path locations for OpenCMISS (SDK) installations. +# +# Search order: +# - OPENCMISS_INSTALL_DIR variable +# - OPENCMISS_INSTALL_DIR environment variable +# - OPENCMISS_SDK_DIR variable +# - OPENCMISS_SDK_DIR environment variable +# - [Windows only] The Registry is searched additionally for installed SDKs. +# +# If found +# - Includes the toolchain config script of the found opencmiss installation to enable toolchain selection logic (non-windows) + +# Convenience: The OPENCMISS_INSTALL_DIR may also be defined in the environment and various other places +if (DEFINED OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using specified installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The specified OPENCMISS_INSTALL_DIR '${OPENCMISS_INSTALL_DIR}' does not exist. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_INSTALL_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_INSTALL_DIR}" OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using environment installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The environment variable OPENCMISS_INSTALL_DIR='${OPENCMISS_INSTALL_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if (NOT OPENCMISS_INSTALL_DIR AND DEFINED OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The specified OPENCMISS_SDK_DIR '${OPENCMISS_SDK_DIR}' does not exist. Skipping.") + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_SDK_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_SDK_DIR}" OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using environment SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The environment variable OPENCMISS_SDK_DIR='${OPENCMISS_SDK_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_SDK_DIR) + endif() +endif() +# On windows: check the registry for installed OpenCMISS SDKs +if(NOT OPENCMISS_INSTALL_DIR AND WIN32) + foreach(ROOT HKEY_CURRENT_USER HKEY_LOCAL_MACHINE) + foreach(PACKAGE OpenCMISSUserSDK OpenCMISSDeveloperSDK) + set(_REG_KEY "[${ROOT}\\Software\\Auckland Bioengineering Institute\\${PACKAGE}]") + get_filename_component(OPENCMISS_INSTALL_DIR "${_REG_KEY}" ABSOLUTE) + #message(STATUS "Trying registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Found ${PACKAGE} in Windows registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + break() + else() + unset(OPENCMISS_INSTALL_DIR) + endif() + endforeach() + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + break() + endif() + endforeach() +endif() + +if(OPENCMISS_INSTALL_DIR) + message(STATUS "OPENCMISS_INSTALL_DIR=${OPENCMISS_INSTALL_DIR}") + # Use the OpenCMISS scripts to also allow choosing a separate toolchain + # This file is located at the opencmiss installation rather than the local example + # as it avoids file replication and makes maintenance much easier + if (TOOLCHAIN) + set(_OCTC ${OPENCMISS_INSTALL_DIR}/cmake/OCToolchainCompilers.cmake) + if (EXISTS "${_OCTC}") + include(${_OCTC}) + else() + message(WARNING "TOOLCHAIN specified but OpenCMISS config script could not be found at ${_OCTC}. Trying CMake defaults.") + endif() + unset(_OCTC) + endif() + set(OpenCMISS_DIR "${OPENCMISS_INSTALL_DIR}" CACHE PATH "Path to the found OpenCMISS (SDK) installation") +else() + message(WARNING "No OpenCMISS (SDK) installation directory detected. Using default system environment.") +endif() + \ No newline at end of file diff --git a/FiniteElasticity/UniAxialExtension/build_debug/build.sh b/FiniteElasticity/UniAxialExtension/build_debug/build.sh new file mode 100644 index 00000000..e6624bac --- /dev/null +++ b/FiniteElasticity/UniAxialExtension/build_debug/build.sh @@ -0,0 +1,2 @@ +#ccc && cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all +cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all diff --git a/FiniteElasticity/UniAxialExtensionCompressible/CMakeLists.txt b/FiniteElasticity/UniAxialExtensionCompressible/CMakeLists.txt new file mode 100644 index 00000000..a22b61ee --- /dev/null +++ b/FiniteElasticity/UniAxialExtensionCompressible/CMakeLists.txt @@ -0,0 +1,35 @@ +# 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 C) +enable_language(Fortran OPTIONAL) +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 +# ---------------------- +#add_subdirectory(C) +if (CMAKE_Fortran_COMPILER) + add_subdirectory(Fortran) +endif() diff --git a/FiniteElasticity/UniAxialExtensionCompressible/Fortran/CMakeLists.txt b/FiniteElasticity/UniAxialExtensionCompressible/Fortran/CMakeLists.txt new file mode 100644 index 00000000..cce5a3bf --- /dev/null +++ b/FiniteElasticity/UniAxialExtensionCompressible/Fortran/CMakeLists.txt @@ -0,0 +1,60 @@ + +# Add example executable +add_executable(UniAxialExtensionCompressible src/UniAxialExtensionCompressibleExample.f90) + +# Turn on Fortran preprocessing (#include directives) +if (MSVC) + set(PROC_OPT "/fpp") +else() + set(PROC_OPT "-cpp") +endif() + +# in debug mode, add flag that make Floating point exceptions fatal +set(OPT "") +if (FALSE) + if(CMAKE_BUILD_TYPE MATCHES DEBUG) + set(OPT "-ffpe-trap=invalid,zero,underflow,overflow,denormal") # GCC: make floating point exceptions fatal + endif() +endif() + +target_compile_options(UniAxialExtensionCompressible PRIVATE ${PROC_OPT} ${OPT} "-fbacktrace") + +# Link to opencmiss +# ----------------- +# +# This simply uses the opencmiss target created by OC_INIT() above. +# +# Alternatively, you can also directly invoke 'find_package(Iron )' 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 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(UniAxialExtensionCompressible PRIVATE opencmiss) + +# Add a simple test that runs the executable +add_test(NAME test_UniAxialExtensionCompressible COMMAND UniAxialExtensionCompressible) +add_opencmiss_environment(test_UniAxialExtensionCompressible) + +################### +# 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. +# diff --git a/FiniteElasticity/UniAxialExtensionCompressible/src/UniAxialExtensionCompressibleExample.f90 b/FiniteElasticity/UniAxialExtensionCompressible/Fortran/src/UniAxialExtensionCompressibleExample.f90 similarity index 100% rename from FiniteElasticity/UniAxialExtensionCompressible/src/UniAxialExtensionCompressibleExample.f90 rename to FiniteElasticity/UniAxialExtensionCompressible/Fortran/src/UniAxialExtensionCompressibleExample.f90 diff --git a/FiniteElasticity/UniAxialExtensionCompressible/OpenCMISS.cmake b/FiniteElasticity/UniAxialExtensionCompressible/OpenCMISS.cmake new file mode 100644 index 00000000..3d6cf515 --- /dev/null +++ b/FiniteElasticity/UniAxialExtensionCompressible/OpenCMISS.cmake @@ -0,0 +1,95 @@ +########################### +# *DO NOT CHANGE THIS FILE* +########################### +# +# Prepares the use of OpenCMISS by scanning at various path locations for OpenCMISS (SDK) installations. +# +# Search order: +# - OPENCMISS_INSTALL_DIR variable +# - OPENCMISS_INSTALL_DIR environment variable +# - OPENCMISS_SDK_DIR variable +# - OPENCMISS_SDK_DIR environment variable +# - [Windows only] The Registry is searched additionally for installed SDKs. +# +# If found +# - Includes the toolchain config script of the found opencmiss installation to enable toolchain selection logic (non-windows) + +# Convenience: The OPENCMISS_INSTALL_DIR may also be defined in the environment and various other places +if (DEFINED OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using specified installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The specified OPENCMISS_INSTALL_DIR '${OPENCMISS_INSTALL_DIR}' does not exist. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_INSTALL_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_INSTALL_DIR}" OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using environment installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The environment variable OPENCMISS_INSTALL_DIR='${OPENCMISS_INSTALL_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if (NOT OPENCMISS_INSTALL_DIR AND DEFINED OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The specified OPENCMISS_SDK_DIR '${OPENCMISS_SDK_DIR}' does not exist. Skipping.") + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_SDK_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_SDK_DIR}" OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using environment SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The environment variable OPENCMISS_SDK_DIR='${OPENCMISS_SDK_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_SDK_DIR) + endif() +endif() +# On windows: check the registry for installed OpenCMISS SDKs +if(NOT OPENCMISS_INSTALL_DIR AND WIN32) + foreach(ROOT HKEY_CURRENT_USER HKEY_LOCAL_MACHINE) + foreach(PACKAGE OpenCMISSUserSDK OpenCMISSDeveloperSDK) + set(_REG_KEY "[${ROOT}\\Software\\Auckland Bioengineering Institute\\${PACKAGE}]") + get_filename_component(OPENCMISS_INSTALL_DIR "${_REG_KEY}" ABSOLUTE) + #message(STATUS "Trying registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Found ${PACKAGE} in Windows registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + break() + else() + unset(OPENCMISS_INSTALL_DIR) + endif() + endforeach() + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + break() + endif() + endforeach() +endif() + +if(OPENCMISS_INSTALL_DIR) + message(STATUS "OPENCMISS_INSTALL_DIR=${OPENCMISS_INSTALL_DIR}") + # Use the OpenCMISS scripts to also allow choosing a separate toolchain + # This file is located at the opencmiss installation rather than the local example + # as it avoids file replication and makes maintenance much easier + if (TOOLCHAIN) + set(_OCTC ${OPENCMISS_INSTALL_DIR}/cmake/OCToolchainCompilers.cmake) + if (EXISTS "${_OCTC}") + include(${_OCTC}) + else() + message(WARNING "TOOLCHAIN specified but OpenCMISS config script could not be found at ${_OCTC}. Trying CMake defaults.") + endif() + unset(_OCTC) + endif() + set(OpenCMISS_DIR "${OPENCMISS_INSTALL_DIR}" CACHE PATH "Path to the found OpenCMISS (SDK) installation") +else() + message(WARNING "No OpenCMISS (SDK) installation directory detected. Using default system environment.") +endif() + \ No newline at end of file diff --git a/FiniteElasticity/UniAxialExtensionCompressible/build_debug/build.sh b/FiniteElasticity/UniAxialExtensionCompressible/build_debug/build.sh new file mode 100644 index 00000000..e6624bac --- /dev/null +++ b/FiniteElasticity/UniAxialExtensionCompressible/build_debug/build.sh @@ -0,0 +1,2 @@ +#ccc && cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all +cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all diff --git a/FiniteElasticity/UniAxialExtensionLoadIncrements/CMakeLists.txt b/FiniteElasticity/UniAxialExtensionLoadIncrements/CMakeLists.txt new file mode 100644 index 00000000..a22b61ee --- /dev/null +++ b/FiniteElasticity/UniAxialExtensionLoadIncrements/CMakeLists.txt @@ -0,0 +1,35 @@ +# 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 C) +enable_language(Fortran OPTIONAL) +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 +# ---------------------- +#add_subdirectory(C) +if (CMAKE_Fortran_COMPILER) + add_subdirectory(Fortran) +endif() diff --git a/FiniteElasticity/UniAxialExtensionLoadIncrements/Fortran/CMakeLists.txt b/FiniteElasticity/UniAxialExtensionLoadIncrements/Fortran/CMakeLists.txt new file mode 100644 index 00000000..7085b43f --- /dev/null +++ b/FiniteElasticity/UniAxialExtensionLoadIncrements/Fortran/CMakeLists.txt @@ -0,0 +1,60 @@ + +# Add example executable +add_executable(UniAxialExtensionLoadIncrements src/UniAxialExtensionLoadIncrementsExample.f90) + +# Turn on Fortran preprocessing (#include directives) +if (MSVC) + set(PROC_OPT "/fpp") +else() + set(PROC_OPT "-cpp") +endif() + +# in debug mode, add flag that make Floating point exceptions fatal +set(OPT "") +if (FALSE) + if(CMAKE_BUILD_TYPE MATCHES DEBUG) + set(OPT "-ffpe-trap=invalid,zero,underflow,overflow,denormal") # GCC: make floating point exceptions fatal + endif() +endif() + +target_compile_options(UniAxialExtensionLoadIncrements PRIVATE ${PROC_OPT} ${OPT} "-fbacktrace") + +# Link to opencmiss +# ----------------- +# +# This simply uses the opencmiss target created by OC_INIT() above. +# +# Alternatively, you can also directly invoke 'find_package(Iron )' 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 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(UniAxialExtensionLoadIncrements PRIVATE opencmiss) + +# Add a simple test that runs the executable +add_test(NAME test_UniAxialExtensionLoadIncrements COMMAND UniAxialExtensionLoadIncrements) +add_opencmiss_environment(test_UniAxialExtensionLoadIncrements) + +################### +# 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. +# diff --git a/FiniteElasticity/UniAxialExtensionLoadIncrements/src/UniAxialExtensionLoadIncrementsExample.f90 b/FiniteElasticity/UniAxialExtensionLoadIncrements/Fortran/src/UniAxialExtensionLoadIncrementsExample.f90 similarity index 100% rename from FiniteElasticity/UniAxialExtensionLoadIncrements/src/UniAxialExtensionLoadIncrementsExample.f90 rename to FiniteElasticity/UniAxialExtensionLoadIncrements/Fortran/src/UniAxialExtensionLoadIncrementsExample.f90 diff --git a/FiniteElasticity/UniAxialExtensionLoadIncrements/OpenCMISS.cmake b/FiniteElasticity/UniAxialExtensionLoadIncrements/OpenCMISS.cmake new file mode 100644 index 00000000..3d6cf515 --- /dev/null +++ b/FiniteElasticity/UniAxialExtensionLoadIncrements/OpenCMISS.cmake @@ -0,0 +1,95 @@ +########################### +# *DO NOT CHANGE THIS FILE* +########################### +# +# Prepares the use of OpenCMISS by scanning at various path locations for OpenCMISS (SDK) installations. +# +# Search order: +# - OPENCMISS_INSTALL_DIR variable +# - OPENCMISS_INSTALL_DIR environment variable +# - OPENCMISS_SDK_DIR variable +# - OPENCMISS_SDK_DIR environment variable +# - [Windows only] The Registry is searched additionally for installed SDKs. +# +# If found +# - Includes the toolchain config script of the found opencmiss installation to enable toolchain selection logic (non-windows) + +# Convenience: The OPENCMISS_INSTALL_DIR may also be defined in the environment and various other places +if (DEFINED OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using specified installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The specified OPENCMISS_INSTALL_DIR '${OPENCMISS_INSTALL_DIR}' does not exist. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_INSTALL_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_INSTALL_DIR}" OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using environment installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The environment variable OPENCMISS_INSTALL_DIR='${OPENCMISS_INSTALL_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if (NOT OPENCMISS_INSTALL_DIR AND DEFINED OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The specified OPENCMISS_SDK_DIR '${OPENCMISS_SDK_DIR}' does not exist. Skipping.") + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_SDK_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_SDK_DIR}" OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using environment SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The environment variable OPENCMISS_SDK_DIR='${OPENCMISS_SDK_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_SDK_DIR) + endif() +endif() +# On windows: check the registry for installed OpenCMISS SDKs +if(NOT OPENCMISS_INSTALL_DIR AND WIN32) + foreach(ROOT HKEY_CURRENT_USER HKEY_LOCAL_MACHINE) + foreach(PACKAGE OpenCMISSUserSDK OpenCMISSDeveloperSDK) + set(_REG_KEY "[${ROOT}\\Software\\Auckland Bioengineering Institute\\${PACKAGE}]") + get_filename_component(OPENCMISS_INSTALL_DIR "${_REG_KEY}" ABSOLUTE) + #message(STATUS "Trying registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Found ${PACKAGE} in Windows registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + break() + else() + unset(OPENCMISS_INSTALL_DIR) + endif() + endforeach() + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + break() + endif() + endforeach() +endif() + +if(OPENCMISS_INSTALL_DIR) + message(STATUS "OPENCMISS_INSTALL_DIR=${OPENCMISS_INSTALL_DIR}") + # Use the OpenCMISS scripts to also allow choosing a separate toolchain + # This file is located at the opencmiss installation rather than the local example + # as it avoids file replication and makes maintenance much easier + if (TOOLCHAIN) + set(_OCTC ${OPENCMISS_INSTALL_DIR}/cmake/OCToolchainCompilers.cmake) + if (EXISTS "${_OCTC}") + include(${_OCTC}) + else() + message(WARNING "TOOLCHAIN specified but OpenCMISS config script could not be found at ${_OCTC}. Trying CMake defaults.") + endif() + unset(_OCTC) + endif() + set(OpenCMISS_DIR "${OPENCMISS_INSTALL_DIR}" CACHE PATH "Path to the found OpenCMISS (SDK) installation") +else() + message(WARNING "No OpenCMISS (SDK) installation directory detected. Using default system environment.") +endif() + \ No newline at end of file diff --git a/FiniteElasticity/UniAxialExtensionLoadIncrements/build_debug/build.sh b/FiniteElasticity/UniAxialExtensionLoadIncrements/build_debug/build.sh new file mode 100644 index 00000000..e6624bac --- /dev/null +++ b/FiniteElasticity/UniAxialExtensionLoadIncrements/build_debug/build.sh @@ -0,0 +1,2 @@ +#ccc && cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all +cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all diff --git a/FiniteElasticity/UniAxialExtensionOrthotropic/CMakeLists.txt b/FiniteElasticity/UniAxialExtensionOrthotropic/CMakeLists.txt new file mode 100644 index 00000000..a22b61ee --- /dev/null +++ b/FiniteElasticity/UniAxialExtensionOrthotropic/CMakeLists.txt @@ -0,0 +1,35 @@ +# 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 C) +enable_language(Fortran OPTIONAL) +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 +# ---------------------- +#add_subdirectory(C) +if (CMAKE_Fortran_COMPILER) + add_subdirectory(Fortran) +endif() diff --git a/FiniteElasticity/UniAxialExtensionOrthotropic/Fortran/CMakeLists.txt b/FiniteElasticity/UniAxialExtensionOrthotropic/Fortran/CMakeLists.txt new file mode 100644 index 00000000..cbcec4f2 --- /dev/null +++ b/FiniteElasticity/UniAxialExtensionOrthotropic/Fortran/CMakeLists.txt @@ -0,0 +1,60 @@ + +# Add example executable +add_executable(UniAxialExtensionOrthotropic src/UniAxialExtensionOrthotropicExample.f90) + +# Turn on Fortran preprocessing (#include directives) +if (MSVC) + set(PROC_OPT "/fpp") +else() + set(PROC_OPT "-cpp") +endif() + +# in debug mode, add flag that make Floating point exceptions fatal +set(OPT "") +if (FALSE) + if(CMAKE_BUILD_TYPE MATCHES DEBUG) + set(OPT "-ffpe-trap=invalid,zero,underflow,overflow,denormal") # GCC: make floating point exceptions fatal + endif() +endif() + +target_compile_options(UniAxialExtensionOrthotropic PRIVATE ${PROC_OPT} ${OPT} "-fbacktrace") + +# Link to opencmiss +# ----------------- +# +# This simply uses the opencmiss target created by OC_INIT() above. +# +# Alternatively, you can also directly invoke 'find_package(Iron )' 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 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(UniAxialExtensionOrthotropic PRIVATE opencmiss) + +# Add a simple test that runs the executable +add_test(NAME test_UniAxialExtensionOrthotropic COMMAND UniAxialExtensionOrthotropic) +add_opencmiss_environment(test_UniAxialExtensionOrthotropic) + +################### +# 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. +# diff --git a/FiniteElasticity/UniAxialExtensionOrthotropic/src/UniAxialExtensionOrthotropicExample.f90 b/FiniteElasticity/UniAxialExtensionOrthotropic/Fortran/src/UniAxialExtensionOrthotropicExample.f90 similarity index 100% rename from FiniteElasticity/UniAxialExtensionOrthotropic/src/UniAxialExtensionOrthotropicExample.f90 rename to FiniteElasticity/UniAxialExtensionOrthotropic/Fortran/src/UniAxialExtensionOrthotropicExample.f90 diff --git a/FiniteElasticity/UniAxialExtensionOrthotropic/OpenCMISS.cmake b/FiniteElasticity/UniAxialExtensionOrthotropic/OpenCMISS.cmake new file mode 100644 index 00000000..3d6cf515 --- /dev/null +++ b/FiniteElasticity/UniAxialExtensionOrthotropic/OpenCMISS.cmake @@ -0,0 +1,95 @@ +########################### +# *DO NOT CHANGE THIS FILE* +########################### +# +# Prepares the use of OpenCMISS by scanning at various path locations for OpenCMISS (SDK) installations. +# +# Search order: +# - OPENCMISS_INSTALL_DIR variable +# - OPENCMISS_INSTALL_DIR environment variable +# - OPENCMISS_SDK_DIR variable +# - OPENCMISS_SDK_DIR environment variable +# - [Windows only] The Registry is searched additionally for installed SDKs. +# +# If found +# - Includes the toolchain config script of the found opencmiss installation to enable toolchain selection logic (non-windows) + +# Convenience: The OPENCMISS_INSTALL_DIR may also be defined in the environment and various other places +if (DEFINED OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using specified installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The specified OPENCMISS_INSTALL_DIR '${OPENCMISS_INSTALL_DIR}' does not exist. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_INSTALL_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_INSTALL_DIR}" OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using environment installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The environment variable OPENCMISS_INSTALL_DIR='${OPENCMISS_INSTALL_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if (NOT OPENCMISS_INSTALL_DIR AND DEFINED OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The specified OPENCMISS_SDK_DIR '${OPENCMISS_SDK_DIR}' does not exist. Skipping.") + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_SDK_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_SDK_DIR}" OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using environment SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The environment variable OPENCMISS_SDK_DIR='${OPENCMISS_SDK_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_SDK_DIR) + endif() +endif() +# On windows: check the registry for installed OpenCMISS SDKs +if(NOT OPENCMISS_INSTALL_DIR AND WIN32) + foreach(ROOT HKEY_CURRENT_USER HKEY_LOCAL_MACHINE) + foreach(PACKAGE OpenCMISSUserSDK OpenCMISSDeveloperSDK) + set(_REG_KEY "[${ROOT}\\Software\\Auckland Bioengineering Institute\\${PACKAGE}]") + get_filename_component(OPENCMISS_INSTALL_DIR "${_REG_KEY}" ABSOLUTE) + #message(STATUS "Trying registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Found ${PACKAGE} in Windows registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + break() + else() + unset(OPENCMISS_INSTALL_DIR) + endif() + endforeach() + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + break() + endif() + endforeach() +endif() + +if(OPENCMISS_INSTALL_DIR) + message(STATUS "OPENCMISS_INSTALL_DIR=${OPENCMISS_INSTALL_DIR}") + # Use the OpenCMISS scripts to also allow choosing a separate toolchain + # This file is located at the opencmiss installation rather than the local example + # as it avoids file replication and makes maintenance much easier + if (TOOLCHAIN) + set(_OCTC ${OPENCMISS_INSTALL_DIR}/cmake/OCToolchainCompilers.cmake) + if (EXISTS "${_OCTC}") + include(${_OCTC}) + else() + message(WARNING "TOOLCHAIN specified but OpenCMISS config script could not be found at ${_OCTC}. Trying CMake defaults.") + endif() + unset(_OCTC) + endif() + set(OpenCMISS_DIR "${OPENCMISS_INSTALL_DIR}" CACHE PATH "Path to the found OpenCMISS (SDK) installation") +else() + message(WARNING "No OpenCMISS (SDK) installation directory detected. Using default system environment.") +endif() + \ No newline at end of file diff --git a/FiniteElasticity/UniAxialExtensionOrthotropic/build_debug/build.sh b/FiniteElasticity/UniAxialExtensionOrthotropic/build_debug/build.sh new file mode 100644 index 00000000..e6624bac --- /dev/null +++ b/FiniteElasticity/UniAxialExtensionOrthotropic/build_debug/build.sh @@ -0,0 +1,2 @@ +#ccc && cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all +cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all diff --git a/FiniteElasticity/testingPoints/CMakeLists.txt b/FiniteElasticity/testingPoints/CMakeLists.txt new file mode 100644 index 00000000..a22b61ee --- /dev/null +++ b/FiniteElasticity/testingPoints/CMakeLists.txt @@ -0,0 +1,35 @@ +# 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 C) +enable_language(Fortran OPTIONAL) +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 +# ---------------------- +#add_subdirectory(C) +if (CMAKE_Fortran_COMPILER) + add_subdirectory(Fortran) +endif() diff --git a/FiniteElasticity/testingPoints/Fortran/CMakeLists.txt b/FiniteElasticity/testingPoints/Fortran/CMakeLists.txt new file mode 100644 index 00000000..03ef6345 --- /dev/null +++ b/FiniteElasticity/testingPoints/Fortran/CMakeLists.txt @@ -0,0 +1,60 @@ + +# Add example executable +add_executable(testingPoints src/testingPointsExample.f90) + +# Turn on Fortran preprocessing (#include directives) +if (MSVC) + set(PROC_OPT "/fpp") +else() + set(PROC_OPT "-cpp") +endif() + +# in debug mode, add flag that make Floating point exceptions fatal +set(OPT "") +if (FALSE) + if(CMAKE_BUILD_TYPE MATCHES DEBUG) + set(OPT "-ffpe-trap=invalid,zero,underflow,overflow,denormal") # GCC: make floating point exceptions fatal + endif() +endif() + +target_compile_options(testingPoints PRIVATE ${PROC_OPT} ${OPT} "-fbacktrace") + +# Link to opencmiss +# ----------------- +# +# This simply uses the opencmiss target created by OC_INIT() above. +# +# Alternatively, you can also directly invoke 'find_package(Iron )' 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 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(testingPoints PRIVATE opencmiss) + +# Add a simple test that runs the executable +add_test(NAME test_testingPoints COMMAND testingPoints) +add_opencmiss_environment(test_testingPoints) + +################### +# 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. +# diff --git a/FiniteElasticity/testingPoints/src/testingPointsExample.f90 b/FiniteElasticity/testingPoints/Fortran/src/testingPointsExample.f90 similarity index 100% rename from FiniteElasticity/testingPoints/src/testingPointsExample.f90 rename to FiniteElasticity/testingPoints/Fortran/src/testingPointsExample.f90 diff --git a/FiniteElasticity/testingPoints/OpenCMISS.cmake b/FiniteElasticity/testingPoints/OpenCMISS.cmake new file mode 100644 index 00000000..3d6cf515 --- /dev/null +++ b/FiniteElasticity/testingPoints/OpenCMISS.cmake @@ -0,0 +1,95 @@ +########################### +# *DO NOT CHANGE THIS FILE* +########################### +# +# Prepares the use of OpenCMISS by scanning at various path locations for OpenCMISS (SDK) installations. +# +# Search order: +# - OPENCMISS_INSTALL_DIR variable +# - OPENCMISS_INSTALL_DIR environment variable +# - OPENCMISS_SDK_DIR variable +# - OPENCMISS_SDK_DIR environment variable +# - [Windows only] The Registry is searched additionally for installed SDKs. +# +# If found +# - Includes the toolchain config script of the found opencmiss installation to enable toolchain selection logic (non-windows) + +# Convenience: The OPENCMISS_INSTALL_DIR may also be defined in the environment and various other places +if (DEFINED OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using specified installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The specified OPENCMISS_INSTALL_DIR '${OPENCMISS_INSTALL_DIR}' does not exist. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_INSTALL_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_INSTALL_DIR}" OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using environment installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The environment variable OPENCMISS_INSTALL_DIR='${OPENCMISS_INSTALL_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if (NOT OPENCMISS_INSTALL_DIR AND DEFINED OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The specified OPENCMISS_SDK_DIR '${OPENCMISS_SDK_DIR}' does not exist. Skipping.") + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_SDK_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_SDK_DIR}" OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using environment SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The environment variable OPENCMISS_SDK_DIR='${OPENCMISS_SDK_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_SDK_DIR) + endif() +endif() +# On windows: check the registry for installed OpenCMISS SDKs +if(NOT OPENCMISS_INSTALL_DIR AND WIN32) + foreach(ROOT HKEY_CURRENT_USER HKEY_LOCAL_MACHINE) + foreach(PACKAGE OpenCMISSUserSDK OpenCMISSDeveloperSDK) + set(_REG_KEY "[${ROOT}\\Software\\Auckland Bioengineering Institute\\${PACKAGE}]") + get_filename_component(OPENCMISS_INSTALL_DIR "${_REG_KEY}" ABSOLUTE) + #message(STATUS "Trying registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Found ${PACKAGE} in Windows registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + break() + else() + unset(OPENCMISS_INSTALL_DIR) + endif() + endforeach() + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + break() + endif() + endforeach() +endif() + +if(OPENCMISS_INSTALL_DIR) + message(STATUS "OPENCMISS_INSTALL_DIR=${OPENCMISS_INSTALL_DIR}") + # Use the OpenCMISS scripts to also allow choosing a separate toolchain + # This file is located at the opencmiss installation rather than the local example + # as it avoids file replication and makes maintenance much easier + if (TOOLCHAIN) + set(_OCTC ${OPENCMISS_INSTALL_DIR}/cmake/OCToolchainCompilers.cmake) + if (EXISTS "${_OCTC}") + include(${_OCTC}) + else() + message(WARNING "TOOLCHAIN specified but OpenCMISS config script could not be found at ${_OCTC}. Trying CMake defaults.") + endif() + unset(_OCTC) + endif() + set(OpenCMISS_DIR "${OPENCMISS_INSTALL_DIR}" CACHE PATH "Path to the found OpenCMISS (SDK) installation") +else() + message(WARNING "No OpenCMISS (SDK) installation directory detected. Using default system environment.") +endif() + \ No newline at end of file diff --git a/FiniteElasticity/testingPoints/build_debug/build.sh b/FiniteElasticity/testingPoints/build_debug/build.sh new file mode 100644 index 00000000..e6624bac --- /dev/null +++ b/FiniteElasticity/testingPoints/build_debug/build.sh @@ -0,0 +1,2 @@ +#ccc && cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all +cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all diff --git a/FluidMechanics/Burgers/Burgers/CMakeLists.txt b/FluidMechanics/Burgers/Burgers/CMakeLists.txt new file mode 100644 index 00000000..a22b61ee --- /dev/null +++ b/FluidMechanics/Burgers/Burgers/CMakeLists.txt @@ -0,0 +1,35 @@ +# 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 C) +enable_language(Fortran OPTIONAL) +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 +# ---------------------- +#add_subdirectory(C) +if (CMAKE_Fortran_COMPILER) + add_subdirectory(Fortran) +endif() diff --git a/FluidMechanics/Burgers/Burgers/Fortran/CMakeLists.txt b/FluidMechanics/Burgers/Burgers/Fortran/CMakeLists.txt new file mode 100644 index 00000000..97a3d020 --- /dev/null +++ b/FluidMechanics/Burgers/Burgers/Fortran/CMakeLists.txt @@ -0,0 +1,60 @@ + +# Add example executable +add_executable(Burgers src/BurgersExample.f90) + +# Turn on Fortran preprocessing (#include directives) +if (MSVC) + set(PROC_OPT "/fpp") +else() + set(PROC_OPT "-cpp") +endif() + +# in debug mode, add flag that make Floating point exceptions fatal +set(OPT "") +if (FALSE) + if(CMAKE_BUILD_TYPE MATCHES DEBUG) + set(OPT "-ffpe-trap=invalid,zero,underflow,overflow,denormal") # GCC: make floating point exceptions fatal + endif() +endif() + +target_compile_options(Burgers PRIVATE ${PROC_OPT} ${OPT} "-fbacktrace") + +# Link to opencmiss +# ----------------- +# +# This simply uses the opencmiss target created by OC_INIT() above. +# +# Alternatively, you can also directly invoke 'find_package(Iron )' 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 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(Burgers PRIVATE opencmiss) + +# Add a simple test that runs the executable +add_test(NAME test_Burgers COMMAND Burgers) +add_opencmiss_environment(test_Burgers) + +################### +# 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. +# diff --git a/FluidMechanics/Burgers/Burgers/src/BurgersExample.f90 b/FluidMechanics/Burgers/Burgers/Fortran/src/BurgersExample.f90 similarity index 100% rename from FluidMechanics/Burgers/Burgers/src/BurgersExample.f90 rename to FluidMechanics/Burgers/Burgers/Fortran/src/BurgersExample.f90 diff --git a/FluidMechanics/Burgers/Burgers/OpenCMISS.cmake b/FluidMechanics/Burgers/Burgers/OpenCMISS.cmake new file mode 100644 index 00000000..3d6cf515 --- /dev/null +++ b/FluidMechanics/Burgers/Burgers/OpenCMISS.cmake @@ -0,0 +1,95 @@ +########################### +# *DO NOT CHANGE THIS FILE* +########################### +# +# Prepares the use of OpenCMISS by scanning at various path locations for OpenCMISS (SDK) installations. +# +# Search order: +# - OPENCMISS_INSTALL_DIR variable +# - OPENCMISS_INSTALL_DIR environment variable +# - OPENCMISS_SDK_DIR variable +# - OPENCMISS_SDK_DIR environment variable +# - [Windows only] The Registry is searched additionally for installed SDKs. +# +# If found +# - Includes the toolchain config script of the found opencmiss installation to enable toolchain selection logic (non-windows) + +# Convenience: The OPENCMISS_INSTALL_DIR may also be defined in the environment and various other places +if (DEFINED OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using specified installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The specified OPENCMISS_INSTALL_DIR '${OPENCMISS_INSTALL_DIR}' does not exist. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_INSTALL_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_INSTALL_DIR}" OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using environment installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The environment variable OPENCMISS_INSTALL_DIR='${OPENCMISS_INSTALL_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if (NOT OPENCMISS_INSTALL_DIR AND DEFINED OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The specified OPENCMISS_SDK_DIR '${OPENCMISS_SDK_DIR}' does not exist. Skipping.") + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_SDK_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_SDK_DIR}" OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using environment SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The environment variable OPENCMISS_SDK_DIR='${OPENCMISS_SDK_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_SDK_DIR) + endif() +endif() +# On windows: check the registry for installed OpenCMISS SDKs +if(NOT OPENCMISS_INSTALL_DIR AND WIN32) + foreach(ROOT HKEY_CURRENT_USER HKEY_LOCAL_MACHINE) + foreach(PACKAGE OpenCMISSUserSDK OpenCMISSDeveloperSDK) + set(_REG_KEY "[${ROOT}\\Software\\Auckland Bioengineering Institute\\${PACKAGE}]") + get_filename_component(OPENCMISS_INSTALL_DIR "${_REG_KEY}" ABSOLUTE) + #message(STATUS "Trying registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Found ${PACKAGE} in Windows registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + break() + else() + unset(OPENCMISS_INSTALL_DIR) + endif() + endforeach() + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + break() + endif() + endforeach() +endif() + +if(OPENCMISS_INSTALL_DIR) + message(STATUS "OPENCMISS_INSTALL_DIR=${OPENCMISS_INSTALL_DIR}") + # Use the OpenCMISS scripts to also allow choosing a separate toolchain + # This file is located at the opencmiss installation rather than the local example + # as it avoids file replication and makes maintenance much easier + if (TOOLCHAIN) + set(_OCTC ${OPENCMISS_INSTALL_DIR}/cmake/OCToolchainCompilers.cmake) + if (EXISTS "${_OCTC}") + include(${_OCTC}) + else() + message(WARNING "TOOLCHAIN specified but OpenCMISS config script could not be found at ${_OCTC}. Trying CMake defaults.") + endif() + unset(_OCTC) + endif() + set(OpenCMISS_DIR "${OPENCMISS_INSTALL_DIR}" CACHE PATH "Path to the found OpenCMISS (SDK) installation") +else() + message(WARNING "No OpenCMISS (SDK) installation directory detected. Using default system environment.") +endif() + \ No newline at end of file diff --git a/FluidMechanics/Burgers/Burgers/build_debug/build.sh b/FluidMechanics/Burgers/Burgers/build_debug/build.sh new file mode 100644 index 00000000..e6624bac --- /dev/null +++ b/FluidMechanics/Burgers/Burgers/build_debug/build.sh @@ -0,0 +1,2 @@ +#ccc && cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all +cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all diff --git a/FluidMechanics/Burgers/GeneralisedBurgers/CMakeLists.txt b/FluidMechanics/Burgers/GeneralisedBurgers/CMakeLists.txt new file mode 100644 index 00000000..a22b61ee --- /dev/null +++ b/FluidMechanics/Burgers/GeneralisedBurgers/CMakeLists.txt @@ -0,0 +1,35 @@ +# 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 C) +enable_language(Fortran OPTIONAL) +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 +# ---------------------- +#add_subdirectory(C) +if (CMAKE_Fortran_COMPILER) + add_subdirectory(Fortran) +endif() diff --git a/FluidMechanics/Burgers/GeneralisedBurgers/Fortran/CMakeLists.txt b/FluidMechanics/Burgers/GeneralisedBurgers/Fortran/CMakeLists.txt new file mode 100644 index 00000000..0386ebff --- /dev/null +++ b/FluidMechanics/Burgers/GeneralisedBurgers/Fortran/CMakeLists.txt @@ -0,0 +1,60 @@ + +# Add example executable +add_executable(GeneralisedBurgers src/GeneralisedBurgersExample.f90) + +# Turn on Fortran preprocessing (#include directives) +if (MSVC) + set(PROC_OPT "/fpp") +else() + set(PROC_OPT "-cpp") +endif() + +# in debug mode, add flag that make Floating point exceptions fatal +set(OPT "") +if (FALSE) + if(CMAKE_BUILD_TYPE MATCHES DEBUG) + set(OPT "-ffpe-trap=invalid,zero,underflow,overflow,denormal") # GCC: make floating point exceptions fatal + endif() +endif() + +target_compile_options(GeneralisedBurgers PRIVATE ${PROC_OPT} ${OPT} "-fbacktrace") + +# Link to opencmiss +# ----------------- +# +# This simply uses the opencmiss target created by OC_INIT() above. +# +# Alternatively, you can also directly invoke 'find_package(Iron )' 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 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(GeneralisedBurgers PRIVATE opencmiss) + +# Add a simple test that runs the executable +add_test(NAME test_GeneralisedBurgers COMMAND GeneralisedBurgers) +add_opencmiss_environment(test_GeneralisedBurgers) + +################### +# 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. +# diff --git a/FluidMechanics/Burgers/GeneralisedBurgers/src/GeneralisedBurgersExample.f90 b/FluidMechanics/Burgers/GeneralisedBurgers/Fortran/src/GeneralisedBurgersExample.f90 similarity index 100% rename from FluidMechanics/Burgers/GeneralisedBurgers/src/GeneralisedBurgersExample.f90 rename to FluidMechanics/Burgers/GeneralisedBurgers/Fortran/src/GeneralisedBurgersExample.f90 diff --git a/FluidMechanics/Burgers/GeneralisedBurgers/OpenCMISS.cmake b/FluidMechanics/Burgers/GeneralisedBurgers/OpenCMISS.cmake new file mode 100644 index 00000000..3d6cf515 --- /dev/null +++ b/FluidMechanics/Burgers/GeneralisedBurgers/OpenCMISS.cmake @@ -0,0 +1,95 @@ +########################### +# *DO NOT CHANGE THIS FILE* +########################### +# +# Prepares the use of OpenCMISS by scanning at various path locations for OpenCMISS (SDK) installations. +# +# Search order: +# - OPENCMISS_INSTALL_DIR variable +# - OPENCMISS_INSTALL_DIR environment variable +# - OPENCMISS_SDK_DIR variable +# - OPENCMISS_SDK_DIR environment variable +# - [Windows only] The Registry is searched additionally for installed SDKs. +# +# If found +# - Includes the toolchain config script of the found opencmiss installation to enable toolchain selection logic (non-windows) + +# Convenience: The OPENCMISS_INSTALL_DIR may also be defined in the environment and various other places +if (DEFINED OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using specified installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The specified OPENCMISS_INSTALL_DIR '${OPENCMISS_INSTALL_DIR}' does not exist. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_INSTALL_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_INSTALL_DIR}" OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using environment installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The environment variable OPENCMISS_INSTALL_DIR='${OPENCMISS_INSTALL_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if (NOT OPENCMISS_INSTALL_DIR AND DEFINED OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The specified OPENCMISS_SDK_DIR '${OPENCMISS_SDK_DIR}' does not exist. Skipping.") + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_SDK_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_SDK_DIR}" OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using environment SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The environment variable OPENCMISS_SDK_DIR='${OPENCMISS_SDK_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_SDK_DIR) + endif() +endif() +# On windows: check the registry for installed OpenCMISS SDKs +if(NOT OPENCMISS_INSTALL_DIR AND WIN32) + foreach(ROOT HKEY_CURRENT_USER HKEY_LOCAL_MACHINE) + foreach(PACKAGE OpenCMISSUserSDK OpenCMISSDeveloperSDK) + set(_REG_KEY "[${ROOT}\\Software\\Auckland Bioengineering Institute\\${PACKAGE}]") + get_filename_component(OPENCMISS_INSTALL_DIR "${_REG_KEY}" ABSOLUTE) + #message(STATUS "Trying registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Found ${PACKAGE} in Windows registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + break() + else() + unset(OPENCMISS_INSTALL_DIR) + endif() + endforeach() + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + break() + endif() + endforeach() +endif() + +if(OPENCMISS_INSTALL_DIR) + message(STATUS "OPENCMISS_INSTALL_DIR=${OPENCMISS_INSTALL_DIR}") + # Use the OpenCMISS scripts to also allow choosing a separate toolchain + # This file is located at the opencmiss installation rather than the local example + # as it avoids file replication and makes maintenance much easier + if (TOOLCHAIN) + set(_OCTC ${OPENCMISS_INSTALL_DIR}/cmake/OCToolchainCompilers.cmake) + if (EXISTS "${_OCTC}") + include(${_OCTC}) + else() + message(WARNING "TOOLCHAIN specified but OpenCMISS config script could not be found at ${_OCTC}. Trying CMake defaults.") + endif() + unset(_OCTC) + endif() + set(OpenCMISS_DIR "${OPENCMISS_INSTALL_DIR}" CACHE PATH "Path to the found OpenCMISS (SDK) installation") +else() + message(WARNING "No OpenCMISS (SDK) installation directory detected. Using default system environment.") +endif() + \ No newline at end of file diff --git a/FluidMechanics/Burgers/GeneralisedBurgers/build_debug/build.sh b/FluidMechanics/Burgers/GeneralisedBurgers/build_debug/build.sh new file mode 100644 index 00000000..e6624bac --- /dev/null +++ b/FluidMechanics/Burgers/GeneralisedBurgers/build_debug/build.sh @@ -0,0 +1,2 @@ +#ccc && cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all +cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all diff --git a/FluidMechanics/Burgers/StaticBurgers/CMakeLists.txt b/FluidMechanics/Burgers/StaticBurgers/CMakeLists.txt new file mode 100644 index 00000000..a22b61ee --- /dev/null +++ b/FluidMechanics/Burgers/StaticBurgers/CMakeLists.txt @@ -0,0 +1,35 @@ +# 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 C) +enable_language(Fortran OPTIONAL) +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 +# ---------------------- +#add_subdirectory(C) +if (CMAKE_Fortran_COMPILER) + add_subdirectory(Fortran) +endif() diff --git a/FluidMechanics/Burgers/StaticBurgers/Fortran/CMakeLists.txt b/FluidMechanics/Burgers/StaticBurgers/Fortran/CMakeLists.txt new file mode 100644 index 00000000..03a7f60b --- /dev/null +++ b/FluidMechanics/Burgers/StaticBurgers/Fortran/CMakeLists.txt @@ -0,0 +1,60 @@ + +# Add example executable +add_executable(StaticBurgers src/StaticBurgersExample.f90) + +# Turn on Fortran preprocessing (#include directives) +if (MSVC) + set(PROC_OPT "/fpp") +else() + set(PROC_OPT "-cpp") +endif() + +# in debug mode, add flag that make Floating point exceptions fatal +set(OPT "") +if (FALSE) + if(CMAKE_BUILD_TYPE MATCHES DEBUG) + set(OPT "-ffpe-trap=invalid,zero,underflow,overflow,denormal") # GCC: make floating point exceptions fatal + endif() +endif() + +target_compile_options(StaticBurgers PRIVATE ${PROC_OPT} ${OPT} "-fbacktrace") + +# Link to opencmiss +# ----------------- +# +# This simply uses the opencmiss target created by OC_INIT() above. +# +# Alternatively, you can also directly invoke 'find_package(Iron )' 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 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(StaticBurgers PRIVATE opencmiss) + +# Add a simple test that runs the executable +add_test(NAME test_StaticBurgers COMMAND StaticBurgers) +add_opencmiss_environment(test_StaticBurgers) + +################### +# 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. +# diff --git a/FluidMechanics/Burgers/StaticBurgers/src/StaticBurgersExample.f90 b/FluidMechanics/Burgers/StaticBurgers/Fortran/src/StaticBurgersExample.f90 similarity index 100% rename from FluidMechanics/Burgers/StaticBurgers/src/StaticBurgersExample.f90 rename to FluidMechanics/Burgers/StaticBurgers/Fortran/src/StaticBurgersExample.f90 diff --git a/FluidMechanics/Burgers/StaticBurgers/OpenCMISS.cmake b/FluidMechanics/Burgers/StaticBurgers/OpenCMISS.cmake new file mode 100644 index 00000000..3d6cf515 --- /dev/null +++ b/FluidMechanics/Burgers/StaticBurgers/OpenCMISS.cmake @@ -0,0 +1,95 @@ +########################### +# *DO NOT CHANGE THIS FILE* +########################### +# +# Prepares the use of OpenCMISS by scanning at various path locations for OpenCMISS (SDK) installations. +# +# Search order: +# - OPENCMISS_INSTALL_DIR variable +# - OPENCMISS_INSTALL_DIR environment variable +# - OPENCMISS_SDK_DIR variable +# - OPENCMISS_SDK_DIR environment variable +# - [Windows only] The Registry is searched additionally for installed SDKs. +# +# If found +# - Includes the toolchain config script of the found opencmiss installation to enable toolchain selection logic (non-windows) + +# Convenience: The OPENCMISS_INSTALL_DIR may also be defined in the environment and various other places +if (DEFINED OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using specified installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The specified OPENCMISS_INSTALL_DIR '${OPENCMISS_INSTALL_DIR}' does not exist. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_INSTALL_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_INSTALL_DIR}" OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using environment installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The environment variable OPENCMISS_INSTALL_DIR='${OPENCMISS_INSTALL_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if (NOT OPENCMISS_INSTALL_DIR AND DEFINED OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The specified OPENCMISS_SDK_DIR '${OPENCMISS_SDK_DIR}' does not exist. Skipping.") + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_SDK_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_SDK_DIR}" OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using environment SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The environment variable OPENCMISS_SDK_DIR='${OPENCMISS_SDK_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_SDK_DIR) + endif() +endif() +# On windows: check the registry for installed OpenCMISS SDKs +if(NOT OPENCMISS_INSTALL_DIR AND WIN32) + foreach(ROOT HKEY_CURRENT_USER HKEY_LOCAL_MACHINE) + foreach(PACKAGE OpenCMISSUserSDK OpenCMISSDeveloperSDK) + set(_REG_KEY "[${ROOT}\\Software\\Auckland Bioengineering Institute\\${PACKAGE}]") + get_filename_component(OPENCMISS_INSTALL_DIR "${_REG_KEY}" ABSOLUTE) + #message(STATUS "Trying registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Found ${PACKAGE} in Windows registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + break() + else() + unset(OPENCMISS_INSTALL_DIR) + endif() + endforeach() + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + break() + endif() + endforeach() +endif() + +if(OPENCMISS_INSTALL_DIR) + message(STATUS "OPENCMISS_INSTALL_DIR=${OPENCMISS_INSTALL_DIR}") + # Use the OpenCMISS scripts to also allow choosing a separate toolchain + # This file is located at the opencmiss installation rather than the local example + # as it avoids file replication and makes maintenance much easier + if (TOOLCHAIN) + set(_OCTC ${OPENCMISS_INSTALL_DIR}/cmake/OCToolchainCompilers.cmake) + if (EXISTS "${_OCTC}") + include(${_OCTC}) + else() + message(WARNING "TOOLCHAIN specified but OpenCMISS config script could not be found at ${_OCTC}. Trying CMake defaults.") + endif() + unset(_OCTC) + endif() + set(OpenCMISS_DIR "${OPENCMISS_INSTALL_DIR}" CACHE PATH "Path to the found OpenCMISS (SDK) installation") +else() + message(WARNING "No OpenCMISS (SDK) installation directory detected. Using default system environment.") +endif() + \ No newline at end of file diff --git a/FluidMechanics/Burgers/StaticBurgers/build_debug/build.sh b/FluidMechanics/Burgers/StaticBurgers/build_debug/build.sh new file mode 100644 index 00000000..e6624bac --- /dev/null +++ b/FluidMechanics/Burgers/StaticBurgers/build_debug/build.sh @@ -0,0 +1,2 @@ +#ccc && cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all +cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all diff --git a/FluidMechanics/Darcy/Analytic/CMakeLists.txt b/FluidMechanics/Darcy/Analytic/CMakeLists.txt new file mode 100644 index 00000000..a22b61ee --- /dev/null +++ b/FluidMechanics/Darcy/Analytic/CMakeLists.txt @@ -0,0 +1,35 @@ +# 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 C) +enable_language(Fortran OPTIONAL) +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 +# ---------------------- +#add_subdirectory(C) +if (CMAKE_Fortran_COMPILER) + add_subdirectory(Fortran) +endif() diff --git a/FluidMechanics/Darcy/Analytic/Fortran/CMakeLists.txt b/FluidMechanics/Darcy/Analytic/Fortran/CMakeLists.txt new file mode 100644 index 00000000..6098ab98 --- /dev/null +++ b/FluidMechanics/Darcy/Analytic/Fortran/CMakeLists.txt @@ -0,0 +1,60 @@ + +# Add example executable +add_executable(Analytic src/AnalyticExample.f90) + +# Turn on Fortran preprocessing (#include directives) +if (MSVC) + set(PROC_OPT "/fpp") +else() + set(PROC_OPT "-cpp") +endif() + +# in debug mode, add flag that make Floating point exceptions fatal +set(OPT "") +if (FALSE) + if(CMAKE_BUILD_TYPE MATCHES DEBUG) + set(OPT "-ffpe-trap=invalid,zero,underflow,overflow,denormal") # GCC: make floating point exceptions fatal + endif() +endif() + +target_compile_options(Analytic PRIVATE ${PROC_OPT} ${OPT} "-fbacktrace") + +# Link to opencmiss +# ----------------- +# +# This simply uses the opencmiss target created by OC_INIT() above. +# +# Alternatively, you can also directly invoke 'find_package(Iron )' 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 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(Analytic PRIVATE opencmiss) + +# Add a simple test that runs the executable +add_test(NAME test_Analytic COMMAND Analytic) +add_opencmiss_environment(test_Analytic) + +################### +# 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. +# diff --git a/FluidMechanics/Darcy/Analytic/src/AnalyticExample.f90 b/FluidMechanics/Darcy/Analytic/Fortran/src/AnalyticExample.f90 similarity index 100% rename from FluidMechanics/Darcy/Analytic/src/AnalyticExample.f90 rename to FluidMechanics/Darcy/Analytic/Fortran/src/AnalyticExample.f90 diff --git a/FluidMechanics/Darcy/Analytic/OpenCMISS.cmake b/FluidMechanics/Darcy/Analytic/OpenCMISS.cmake new file mode 100644 index 00000000..3d6cf515 --- /dev/null +++ b/FluidMechanics/Darcy/Analytic/OpenCMISS.cmake @@ -0,0 +1,95 @@ +########################### +# *DO NOT CHANGE THIS FILE* +########################### +# +# Prepares the use of OpenCMISS by scanning at various path locations for OpenCMISS (SDK) installations. +# +# Search order: +# - OPENCMISS_INSTALL_DIR variable +# - OPENCMISS_INSTALL_DIR environment variable +# - OPENCMISS_SDK_DIR variable +# - OPENCMISS_SDK_DIR environment variable +# - [Windows only] The Registry is searched additionally for installed SDKs. +# +# If found +# - Includes the toolchain config script of the found opencmiss installation to enable toolchain selection logic (non-windows) + +# Convenience: The OPENCMISS_INSTALL_DIR may also be defined in the environment and various other places +if (DEFINED OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using specified installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The specified OPENCMISS_INSTALL_DIR '${OPENCMISS_INSTALL_DIR}' does not exist. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_INSTALL_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_INSTALL_DIR}" OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using environment installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The environment variable OPENCMISS_INSTALL_DIR='${OPENCMISS_INSTALL_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if (NOT OPENCMISS_INSTALL_DIR AND DEFINED OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The specified OPENCMISS_SDK_DIR '${OPENCMISS_SDK_DIR}' does not exist. Skipping.") + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_SDK_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_SDK_DIR}" OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using environment SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The environment variable OPENCMISS_SDK_DIR='${OPENCMISS_SDK_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_SDK_DIR) + endif() +endif() +# On windows: check the registry for installed OpenCMISS SDKs +if(NOT OPENCMISS_INSTALL_DIR AND WIN32) + foreach(ROOT HKEY_CURRENT_USER HKEY_LOCAL_MACHINE) + foreach(PACKAGE OpenCMISSUserSDK OpenCMISSDeveloperSDK) + set(_REG_KEY "[${ROOT}\\Software\\Auckland Bioengineering Institute\\${PACKAGE}]") + get_filename_component(OPENCMISS_INSTALL_DIR "${_REG_KEY}" ABSOLUTE) + #message(STATUS "Trying registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Found ${PACKAGE} in Windows registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + break() + else() + unset(OPENCMISS_INSTALL_DIR) + endif() + endforeach() + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + break() + endif() + endforeach() +endif() + +if(OPENCMISS_INSTALL_DIR) + message(STATUS "OPENCMISS_INSTALL_DIR=${OPENCMISS_INSTALL_DIR}") + # Use the OpenCMISS scripts to also allow choosing a separate toolchain + # This file is located at the opencmiss installation rather than the local example + # as it avoids file replication and makes maintenance much easier + if (TOOLCHAIN) + set(_OCTC ${OPENCMISS_INSTALL_DIR}/cmake/OCToolchainCompilers.cmake) + if (EXISTS "${_OCTC}") + include(${_OCTC}) + else() + message(WARNING "TOOLCHAIN specified but OpenCMISS config script could not be found at ${_OCTC}. Trying CMake defaults.") + endif() + unset(_OCTC) + endif() + set(OpenCMISS_DIR "${OPENCMISS_INSTALL_DIR}" CACHE PATH "Path to the found OpenCMISS (SDK) installation") +else() + message(WARNING "No OpenCMISS (SDK) installation directory detected. Using default system environment.") +endif() + \ No newline at end of file diff --git a/FluidMechanics/Darcy/Analytic/build_debug/build.sh b/FluidMechanics/Darcy/Analytic/build_debug/build.sh new file mode 100644 index 00000000..e6624bac --- /dev/null +++ b/FluidMechanics/Darcy/Analytic/build_debug/build.sh @@ -0,0 +1,2 @@ +#ccc && cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all +cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all diff --git a/FluidMechanics/Darcy/Dynamic/CMakeLists.txt b/FluidMechanics/Darcy/Dynamic/CMakeLists.txt new file mode 100644 index 00000000..a22b61ee --- /dev/null +++ b/FluidMechanics/Darcy/Dynamic/CMakeLists.txt @@ -0,0 +1,35 @@ +# 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 C) +enable_language(Fortran OPTIONAL) +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 +# ---------------------- +#add_subdirectory(C) +if (CMAKE_Fortran_COMPILER) + add_subdirectory(Fortran) +endif() diff --git a/FluidMechanics/Darcy/Dynamic/Fortran/CMakeLists.txt b/FluidMechanics/Darcy/Dynamic/Fortran/CMakeLists.txt new file mode 100644 index 00000000..b0d7f800 --- /dev/null +++ b/FluidMechanics/Darcy/Dynamic/Fortran/CMakeLists.txt @@ -0,0 +1,60 @@ + +# Add example executable +add_executable(Dynamic src/DynamicExample.f90) + +# Turn on Fortran preprocessing (#include directives) +if (MSVC) + set(PROC_OPT "/fpp") +else() + set(PROC_OPT "-cpp") +endif() + +# in debug mode, add flag that make Floating point exceptions fatal +set(OPT "") +if (FALSE) + if(CMAKE_BUILD_TYPE MATCHES DEBUG) + set(OPT "-ffpe-trap=invalid,zero,underflow,overflow,denormal") # GCC: make floating point exceptions fatal + endif() +endif() + +target_compile_options(Dynamic PRIVATE ${PROC_OPT} ${OPT} "-fbacktrace") + +# Link to opencmiss +# ----------------- +# +# This simply uses the opencmiss target created by OC_INIT() above. +# +# Alternatively, you can also directly invoke 'find_package(Iron )' 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 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(Dynamic PRIVATE opencmiss) + +# Add a simple test that runs the executable +add_test(NAME test_Dynamic COMMAND Dynamic) +add_opencmiss_environment(test_Dynamic) + +################### +# 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. +# diff --git a/FluidMechanics/Darcy/Dynamic/src/DynamicExample.f90 b/FluidMechanics/Darcy/Dynamic/Fortran/src/DynamicExample.f90 similarity index 100% rename from FluidMechanics/Darcy/Dynamic/src/DynamicExample.f90 rename to FluidMechanics/Darcy/Dynamic/Fortran/src/DynamicExample.f90 diff --git a/FluidMechanics/Darcy/Dynamic/OpenCMISS.cmake b/FluidMechanics/Darcy/Dynamic/OpenCMISS.cmake new file mode 100644 index 00000000..3d6cf515 --- /dev/null +++ b/FluidMechanics/Darcy/Dynamic/OpenCMISS.cmake @@ -0,0 +1,95 @@ +########################### +# *DO NOT CHANGE THIS FILE* +########################### +# +# Prepares the use of OpenCMISS by scanning at various path locations for OpenCMISS (SDK) installations. +# +# Search order: +# - OPENCMISS_INSTALL_DIR variable +# - OPENCMISS_INSTALL_DIR environment variable +# - OPENCMISS_SDK_DIR variable +# - OPENCMISS_SDK_DIR environment variable +# - [Windows only] The Registry is searched additionally for installed SDKs. +# +# If found +# - Includes the toolchain config script of the found opencmiss installation to enable toolchain selection logic (non-windows) + +# Convenience: The OPENCMISS_INSTALL_DIR may also be defined in the environment and various other places +if (DEFINED OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using specified installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The specified OPENCMISS_INSTALL_DIR '${OPENCMISS_INSTALL_DIR}' does not exist. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_INSTALL_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_INSTALL_DIR}" OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using environment installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The environment variable OPENCMISS_INSTALL_DIR='${OPENCMISS_INSTALL_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if (NOT OPENCMISS_INSTALL_DIR AND DEFINED OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The specified OPENCMISS_SDK_DIR '${OPENCMISS_SDK_DIR}' does not exist. Skipping.") + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_SDK_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_SDK_DIR}" OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using environment SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The environment variable OPENCMISS_SDK_DIR='${OPENCMISS_SDK_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_SDK_DIR) + endif() +endif() +# On windows: check the registry for installed OpenCMISS SDKs +if(NOT OPENCMISS_INSTALL_DIR AND WIN32) + foreach(ROOT HKEY_CURRENT_USER HKEY_LOCAL_MACHINE) + foreach(PACKAGE OpenCMISSUserSDK OpenCMISSDeveloperSDK) + set(_REG_KEY "[${ROOT}\\Software\\Auckland Bioengineering Institute\\${PACKAGE}]") + get_filename_component(OPENCMISS_INSTALL_DIR "${_REG_KEY}" ABSOLUTE) + #message(STATUS "Trying registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Found ${PACKAGE} in Windows registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + break() + else() + unset(OPENCMISS_INSTALL_DIR) + endif() + endforeach() + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + break() + endif() + endforeach() +endif() + +if(OPENCMISS_INSTALL_DIR) + message(STATUS "OPENCMISS_INSTALL_DIR=${OPENCMISS_INSTALL_DIR}") + # Use the OpenCMISS scripts to also allow choosing a separate toolchain + # This file is located at the opencmiss installation rather than the local example + # as it avoids file replication and makes maintenance much easier + if (TOOLCHAIN) + set(_OCTC ${OPENCMISS_INSTALL_DIR}/cmake/OCToolchainCompilers.cmake) + if (EXISTS "${_OCTC}") + include(${_OCTC}) + else() + message(WARNING "TOOLCHAIN specified but OpenCMISS config script could not be found at ${_OCTC}. Trying CMake defaults.") + endif() + unset(_OCTC) + endif() + set(OpenCMISS_DIR "${OPENCMISS_INSTALL_DIR}" CACHE PATH "Path to the found OpenCMISS (SDK) installation") +else() + message(WARNING "No OpenCMISS (SDK) installation directory detected. Using default system environment.") +endif() + \ No newline at end of file diff --git a/FluidMechanics/Darcy/Dynamic/build_debug/build.sh b/FluidMechanics/Darcy/Dynamic/build_debug/build.sh new file mode 100644 index 00000000..e6624bac --- /dev/null +++ b/FluidMechanics/Darcy/Dynamic/build_debug/build.sh @@ -0,0 +1,2 @@ +#ccc && cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all +cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all diff --git a/FluidMechanics/Darcy/MultiCompartmentStaticDarcy/CMakeLists.txt b/FluidMechanics/Darcy/MultiCompartmentStaticDarcy/CMakeLists.txt new file mode 100644 index 00000000..a22b61ee --- /dev/null +++ b/FluidMechanics/Darcy/MultiCompartmentStaticDarcy/CMakeLists.txt @@ -0,0 +1,35 @@ +# 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 C) +enable_language(Fortran OPTIONAL) +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 +# ---------------------- +#add_subdirectory(C) +if (CMAKE_Fortran_COMPILER) + add_subdirectory(Fortran) +endif() diff --git a/FluidMechanics/Darcy/MultiCompartmentStaticDarcy/Fortran/CMakeLists.txt b/FluidMechanics/Darcy/MultiCompartmentStaticDarcy/Fortran/CMakeLists.txt new file mode 100644 index 00000000..442b5739 --- /dev/null +++ b/FluidMechanics/Darcy/MultiCompartmentStaticDarcy/Fortran/CMakeLists.txt @@ -0,0 +1,60 @@ + +# Add example executable +add_executable(MultiCompartmentStaticDarcy src/MultiCompartmentStaticDarcyExample.f90) + +# Turn on Fortran preprocessing (#include directives) +if (MSVC) + set(PROC_OPT "/fpp") +else() + set(PROC_OPT "-cpp") +endif() + +# in debug mode, add flag that make Floating point exceptions fatal +set(OPT "") +if (FALSE) + if(CMAKE_BUILD_TYPE MATCHES DEBUG) + set(OPT "-ffpe-trap=invalid,zero,underflow,overflow,denormal") # GCC: make floating point exceptions fatal + endif() +endif() + +target_compile_options(MultiCompartmentStaticDarcy PRIVATE ${PROC_OPT} ${OPT} "-fbacktrace") + +# Link to opencmiss +# ----------------- +# +# This simply uses the opencmiss target created by OC_INIT() above. +# +# Alternatively, you can also directly invoke 'find_package(Iron )' 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 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(MultiCompartmentStaticDarcy PRIVATE opencmiss) + +# Add a simple test that runs the executable +add_test(NAME test_MultiCompartmentStaticDarcy COMMAND MultiCompartmentStaticDarcy) +add_opencmiss_environment(test_MultiCompartmentStaticDarcy) + +################### +# 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. +# diff --git a/FluidMechanics/Darcy/MultiCompartmentStaticDarcy/src/MultiCompartmentStaticDarcyExample.f90 b/FluidMechanics/Darcy/MultiCompartmentStaticDarcy/Fortran/src/MultiCompartmentStaticDarcyExample.f90 similarity index 100% rename from FluidMechanics/Darcy/MultiCompartmentStaticDarcy/src/MultiCompartmentStaticDarcyExample.f90 rename to FluidMechanics/Darcy/MultiCompartmentStaticDarcy/Fortran/src/MultiCompartmentStaticDarcyExample.f90 diff --git a/FluidMechanics/Darcy/MultiCompartmentStaticDarcy/OpenCMISS.cmake b/FluidMechanics/Darcy/MultiCompartmentStaticDarcy/OpenCMISS.cmake new file mode 100644 index 00000000..3d6cf515 --- /dev/null +++ b/FluidMechanics/Darcy/MultiCompartmentStaticDarcy/OpenCMISS.cmake @@ -0,0 +1,95 @@ +########################### +# *DO NOT CHANGE THIS FILE* +########################### +# +# Prepares the use of OpenCMISS by scanning at various path locations for OpenCMISS (SDK) installations. +# +# Search order: +# - OPENCMISS_INSTALL_DIR variable +# - OPENCMISS_INSTALL_DIR environment variable +# - OPENCMISS_SDK_DIR variable +# - OPENCMISS_SDK_DIR environment variable +# - [Windows only] The Registry is searched additionally for installed SDKs. +# +# If found +# - Includes the toolchain config script of the found opencmiss installation to enable toolchain selection logic (non-windows) + +# Convenience: The OPENCMISS_INSTALL_DIR may also be defined in the environment and various other places +if (DEFINED OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using specified installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The specified OPENCMISS_INSTALL_DIR '${OPENCMISS_INSTALL_DIR}' does not exist. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_INSTALL_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_INSTALL_DIR}" OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using environment installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The environment variable OPENCMISS_INSTALL_DIR='${OPENCMISS_INSTALL_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if (NOT OPENCMISS_INSTALL_DIR AND DEFINED OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The specified OPENCMISS_SDK_DIR '${OPENCMISS_SDK_DIR}' does not exist. Skipping.") + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_SDK_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_SDK_DIR}" OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using environment SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The environment variable OPENCMISS_SDK_DIR='${OPENCMISS_SDK_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_SDK_DIR) + endif() +endif() +# On windows: check the registry for installed OpenCMISS SDKs +if(NOT OPENCMISS_INSTALL_DIR AND WIN32) + foreach(ROOT HKEY_CURRENT_USER HKEY_LOCAL_MACHINE) + foreach(PACKAGE OpenCMISSUserSDK OpenCMISSDeveloperSDK) + set(_REG_KEY "[${ROOT}\\Software\\Auckland Bioengineering Institute\\${PACKAGE}]") + get_filename_component(OPENCMISS_INSTALL_DIR "${_REG_KEY}" ABSOLUTE) + #message(STATUS "Trying registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Found ${PACKAGE} in Windows registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + break() + else() + unset(OPENCMISS_INSTALL_DIR) + endif() + endforeach() + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + break() + endif() + endforeach() +endif() + +if(OPENCMISS_INSTALL_DIR) + message(STATUS "OPENCMISS_INSTALL_DIR=${OPENCMISS_INSTALL_DIR}") + # Use the OpenCMISS scripts to also allow choosing a separate toolchain + # This file is located at the opencmiss installation rather than the local example + # as it avoids file replication and makes maintenance much easier + if (TOOLCHAIN) + set(_OCTC ${OPENCMISS_INSTALL_DIR}/cmake/OCToolchainCompilers.cmake) + if (EXISTS "${_OCTC}") + include(${_OCTC}) + else() + message(WARNING "TOOLCHAIN specified but OpenCMISS config script could not be found at ${_OCTC}. Trying CMake defaults.") + endif() + unset(_OCTC) + endif() + set(OpenCMISS_DIR "${OPENCMISS_INSTALL_DIR}" CACHE PATH "Path to the found OpenCMISS (SDK) installation") +else() + message(WARNING "No OpenCMISS (SDK) installation directory detected. Using default system environment.") +endif() + \ No newline at end of file diff --git a/FluidMechanics/Darcy/MultiCompartmentStaticDarcy/build_debug/build.sh b/FluidMechanics/Darcy/MultiCompartmentStaticDarcy/build_debug/build.sh new file mode 100644 index 00000000..e6624bac --- /dev/null +++ b/FluidMechanics/Darcy/MultiCompartmentStaticDarcy/build_debug/build.sh @@ -0,0 +1,2 @@ +#ccc && cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all +cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all diff --git a/FluidMechanics/Darcy/QuasistaticMaterial/CMakeLists.txt b/FluidMechanics/Darcy/QuasistaticMaterial/CMakeLists.txt new file mode 100644 index 00000000..a22b61ee --- /dev/null +++ b/FluidMechanics/Darcy/QuasistaticMaterial/CMakeLists.txt @@ -0,0 +1,35 @@ +# 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 C) +enable_language(Fortran OPTIONAL) +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 +# ---------------------- +#add_subdirectory(C) +if (CMAKE_Fortran_COMPILER) + add_subdirectory(Fortran) +endif() diff --git a/FluidMechanics/Darcy/QuasistaticMaterial/Fortran/CMakeLists.txt b/FluidMechanics/Darcy/QuasistaticMaterial/Fortran/CMakeLists.txt new file mode 100644 index 00000000..76fafd74 --- /dev/null +++ b/FluidMechanics/Darcy/QuasistaticMaterial/Fortran/CMakeLists.txt @@ -0,0 +1,60 @@ + +# Add example executable +add_executable(QuasistaticMaterial src/QuasistaticMaterialExample.f90) + +# Turn on Fortran preprocessing (#include directives) +if (MSVC) + set(PROC_OPT "/fpp") +else() + set(PROC_OPT "-cpp") +endif() + +# in debug mode, add flag that make Floating point exceptions fatal +set(OPT "") +if (FALSE) + if(CMAKE_BUILD_TYPE MATCHES DEBUG) + set(OPT "-ffpe-trap=invalid,zero,underflow,overflow,denormal") # GCC: make floating point exceptions fatal + endif() +endif() + +target_compile_options(QuasistaticMaterial PRIVATE ${PROC_OPT} ${OPT} "-fbacktrace") + +# Link to opencmiss +# ----------------- +# +# This simply uses the opencmiss target created by OC_INIT() above. +# +# Alternatively, you can also directly invoke 'find_package(Iron )' 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 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(QuasistaticMaterial PRIVATE opencmiss) + +# Add a simple test that runs the executable +add_test(NAME test_QuasistaticMaterial COMMAND QuasistaticMaterial) +add_opencmiss_environment(test_QuasistaticMaterial) + +################### +# 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. +# diff --git a/FluidMechanics/Darcy/QuasistaticMaterial/src/QuasistaticMaterialExample.f90 b/FluidMechanics/Darcy/QuasistaticMaterial/Fortran/src/QuasistaticMaterialExample.f90 similarity index 100% rename from FluidMechanics/Darcy/QuasistaticMaterial/src/QuasistaticMaterialExample.f90 rename to FluidMechanics/Darcy/QuasistaticMaterial/Fortran/src/QuasistaticMaterialExample.f90 diff --git a/FluidMechanics/Darcy/QuasistaticMaterial/OpenCMISS.cmake b/FluidMechanics/Darcy/QuasistaticMaterial/OpenCMISS.cmake new file mode 100644 index 00000000..3d6cf515 --- /dev/null +++ b/FluidMechanics/Darcy/QuasistaticMaterial/OpenCMISS.cmake @@ -0,0 +1,95 @@ +########################### +# *DO NOT CHANGE THIS FILE* +########################### +# +# Prepares the use of OpenCMISS by scanning at various path locations for OpenCMISS (SDK) installations. +# +# Search order: +# - OPENCMISS_INSTALL_DIR variable +# - OPENCMISS_INSTALL_DIR environment variable +# - OPENCMISS_SDK_DIR variable +# - OPENCMISS_SDK_DIR environment variable +# - [Windows only] The Registry is searched additionally for installed SDKs. +# +# If found +# - Includes the toolchain config script of the found opencmiss installation to enable toolchain selection logic (non-windows) + +# Convenience: The OPENCMISS_INSTALL_DIR may also be defined in the environment and various other places +if (DEFINED OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using specified installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The specified OPENCMISS_INSTALL_DIR '${OPENCMISS_INSTALL_DIR}' does not exist. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_INSTALL_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_INSTALL_DIR}" OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using environment installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The environment variable OPENCMISS_INSTALL_DIR='${OPENCMISS_INSTALL_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if (NOT OPENCMISS_INSTALL_DIR AND DEFINED OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The specified OPENCMISS_SDK_DIR '${OPENCMISS_SDK_DIR}' does not exist. Skipping.") + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_SDK_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_SDK_DIR}" OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using environment SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The environment variable OPENCMISS_SDK_DIR='${OPENCMISS_SDK_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_SDK_DIR) + endif() +endif() +# On windows: check the registry for installed OpenCMISS SDKs +if(NOT OPENCMISS_INSTALL_DIR AND WIN32) + foreach(ROOT HKEY_CURRENT_USER HKEY_LOCAL_MACHINE) + foreach(PACKAGE OpenCMISSUserSDK OpenCMISSDeveloperSDK) + set(_REG_KEY "[${ROOT}\\Software\\Auckland Bioengineering Institute\\${PACKAGE}]") + get_filename_component(OPENCMISS_INSTALL_DIR "${_REG_KEY}" ABSOLUTE) + #message(STATUS "Trying registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Found ${PACKAGE} in Windows registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + break() + else() + unset(OPENCMISS_INSTALL_DIR) + endif() + endforeach() + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + break() + endif() + endforeach() +endif() + +if(OPENCMISS_INSTALL_DIR) + message(STATUS "OPENCMISS_INSTALL_DIR=${OPENCMISS_INSTALL_DIR}") + # Use the OpenCMISS scripts to also allow choosing a separate toolchain + # This file is located at the opencmiss installation rather than the local example + # as it avoids file replication and makes maintenance much easier + if (TOOLCHAIN) + set(_OCTC ${OPENCMISS_INSTALL_DIR}/cmake/OCToolchainCompilers.cmake) + if (EXISTS "${_OCTC}") + include(${_OCTC}) + else() + message(WARNING "TOOLCHAIN specified but OpenCMISS config script could not be found at ${_OCTC}. Trying CMake defaults.") + endif() + unset(_OCTC) + endif() + set(OpenCMISS_DIR "${OPENCMISS_INSTALL_DIR}" CACHE PATH "Path to the found OpenCMISS (SDK) installation") +else() + message(WARNING "No OpenCMISS (SDK) installation directory detected. Using default system environment.") +endif() + \ No newline at end of file diff --git a/FluidMechanics/Darcy/QuasistaticMaterial/build_debug/build.sh b/FluidMechanics/Darcy/QuasistaticMaterial/build_debug/build.sh new file mode 100644 index 00000000..e6624bac --- /dev/null +++ b/FluidMechanics/Darcy/QuasistaticMaterial/build_debug/build.sh @@ -0,0 +1,2 @@ +#ccc && cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all +cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all diff --git a/FluidMechanics/Darcy/Static/CMakeLists.txt b/FluidMechanics/Darcy/Static/CMakeLists.txt new file mode 100644 index 00000000..a22b61ee --- /dev/null +++ b/FluidMechanics/Darcy/Static/CMakeLists.txt @@ -0,0 +1,35 @@ +# 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 C) +enable_language(Fortran OPTIONAL) +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 +# ---------------------- +#add_subdirectory(C) +if (CMAKE_Fortran_COMPILER) + add_subdirectory(Fortran) +endif() diff --git a/FluidMechanics/Darcy/Static/Fortran/CMakeLists.txt b/FluidMechanics/Darcy/Static/Fortran/CMakeLists.txt new file mode 100644 index 00000000..d1b76f7d --- /dev/null +++ b/FluidMechanics/Darcy/Static/Fortran/CMakeLists.txt @@ -0,0 +1,60 @@ + +# Add example executable +add_executable(Static src/StaticExample.f90) + +# Turn on Fortran preprocessing (#include directives) +if (MSVC) + set(PROC_OPT "/fpp") +else() + set(PROC_OPT "-cpp") +endif() + +# in debug mode, add flag that make Floating point exceptions fatal +set(OPT "") +if (FALSE) + if(CMAKE_BUILD_TYPE MATCHES DEBUG) + set(OPT "-ffpe-trap=invalid,zero,underflow,overflow,denormal") # GCC: make floating point exceptions fatal + endif() +endif() + +target_compile_options(Static PRIVATE ${PROC_OPT} ${OPT} "-fbacktrace") + +# Link to opencmiss +# ----------------- +# +# This simply uses the opencmiss target created by OC_INIT() above. +# +# Alternatively, you can also directly invoke 'find_package(Iron )' 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 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(Static PRIVATE opencmiss) + +# Add a simple test that runs the executable +add_test(NAME test_Static COMMAND Static) +add_opencmiss_environment(test_Static) + +################### +# 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. +# diff --git a/FluidMechanics/Darcy/Static/src/StaticExample.f90 b/FluidMechanics/Darcy/Static/Fortran/src/StaticExample.f90 similarity index 100% rename from FluidMechanics/Darcy/Static/src/StaticExample.f90 rename to FluidMechanics/Darcy/Static/Fortran/src/StaticExample.f90 diff --git a/FluidMechanics/Darcy/Static/OpenCMISS.cmake b/FluidMechanics/Darcy/Static/OpenCMISS.cmake new file mode 100644 index 00000000..3d6cf515 --- /dev/null +++ b/FluidMechanics/Darcy/Static/OpenCMISS.cmake @@ -0,0 +1,95 @@ +########################### +# *DO NOT CHANGE THIS FILE* +########################### +# +# Prepares the use of OpenCMISS by scanning at various path locations for OpenCMISS (SDK) installations. +# +# Search order: +# - OPENCMISS_INSTALL_DIR variable +# - OPENCMISS_INSTALL_DIR environment variable +# - OPENCMISS_SDK_DIR variable +# - OPENCMISS_SDK_DIR environment variable +# - [Windows only] The Registry is searched additionally for installed SDKs. +# +# If found +# - Includes the toolchain config script of the found opencmiss installation to enable toolchain selection logic (non-windows) + +# Convenience: The OPENCMISS_INSTALL_DIR may also be defined in the environment and various other places +if (DEFINED OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using specified installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The specified OPENCMISS_INSTALL_DIR '${OPENCMISS_INSTALL_DIR}' does not exist. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_INSTALL_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_INSTALL_DIR}" OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using environment installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The environment variable OPENCMISS_INSTALL_DIR='${OPENCMISS_INSTALL_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if (NOT OPENCMISS_INSTALL_DIR AND DEFINED OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The specified OPENCMISS_SDK_DIR '${OPENCMISS_SDK_DIR}' does not exist. Skipping.") + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_SDK_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_SDK_DIR}" OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using environment SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The environment variable OPENCMISS_SDK_DIR='${OPENCMISS_SDK_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_SDK_DIR) + endif() +endif() +# On windows: check the registry for installed OpenCMISS SDKs +if(NOT OPENCMISS_INSTALL_DIR AND WIN32) + foreach(ROOT HKEY_CURRENT_USER HKEY_LOCAL_MACHINE) + foreach(PACKAGE OpenCMISSUserSDK OpenCMISSDeveloperSDK) + set(_REG_KEY "[${ROOT}\\Software\\Auckland Bioengineering Institute\\${PACKAGE}]") + get_filename_component(OPENCMISS_INSTALL_DIR "${_REG_KEY}" ABSOLUTE) + #message(STATUS "Trying registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Found ${PACKAGE} in Windows registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + break() + else() + unset(OPENCMISS_INSTALL_DIR) + endif() + endforeach() + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + break() + endif() + endforeach() +endif() + +if(OPENCMISS_INSTALL_DIR) + message(STATUS "OPENCMISS_INSTALL_DIR=${OPENCMISS_INSTALL_DIR}") + # Use the OpenCMISS scripts to also allow choosing a separate toolchain + # This file is located at the opencmiss installation rather than the local example + # as it avoids file replication and makes maintenance much easier + if (TOOLCHAIN) + set(_OCTC ${OPENCMISS_INSTALL_DIR}/cmake/OCToolchainCompilers.cmake) + if (EXISTS "${_OCTC}") + include(${_OCTC}) + else() + message(WARNING "TOOLCHAIN specified but OpenCMISS config script could not be found at ${_OCTC}. Trying CMake defaults.") + endif() + unset(_OCTC) + endif() + set(OpenCMISS_DIR "${OPENCMISS_INSTALL_DIR}" CACHE PATH "Path to the found OpenCMISS (SDK) installation") +else() + message(WARNING "No OpenCMISS (SDK) installation directory detected. Using default system environment.") +endif() + \ No newline at end of file diff --git a/FluidMechanics/Darcy/Static/build_debug/build.sh b/FluidMechanics/Darcy/Static/build_debug/build.sh new file mode 100644 index 00000000..e6624bac --- /dev/null +++ b/FluidMechanics/Darcy/Static/build_debug/build.sh @@ -0,0 +1,2 @@ +#ccc && cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all +cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all diff --git a/FluidMechanics/Darcy/temp_memory_issue/CMakeLists.txt b/FluidMechanics/Darcy/temp_memory_issue/CMakeLists.txt new file mode 100644 index 00000000..a22b61ee --- /dev/null +++ b/FluidMechanics/Darcy/temp_memory_issue/CMakeLists.txt @@ -0,0 +1,35 @@ +# 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 C) +enable_language(Fortran OPTIONAL) +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 +# ---------------------- +#add_subdirectory(C) +if (CMAKE_Fortran_COMPILER) + add_subdirectory(Fortran) +endif() diff --git a/FluidMechanics/Darcy/temp_memory_issue/Fortran/CMakeLists.txt b/FluidMechanics/Darcy/temp_memory_issue/Fortran/CMakeLists.txt new file mode 100644 index 00000000..2e89de88 --- /dev/null +++ b/FluidMechanics/Darcy/temp_memory_issue/Fortran/CMakeLists.txt @@ -0,0 +1,60 @@ + +# Add example executable +add_executable(temp_memory_issue src/temp_memory_issueExample.f90) + +# Turn on Fortran preprocessing (#include directives) +if (MSVC) + set(PROC_OPT "/fpp") +else() + set(PROC_OPT "-cpp") +endif() + +# in debug mode, add flag that make Floating point exceptions fatal +set(OPT "") +if (FALSE) + if(CMAKE_BUILD_TYPE MATCHES DEBUG) + set(OPT "-ffpe-trap=invalid,zero,underflow,overflow,denormal") # GCC: make floating point exceptions fatal + endif() +endif() + +target_compile_options(temp_memory_issue PRIVATE ${PROC_OPT} ${OPT} "-fbacktrace") + +# Link to opencmiss +# ----------------- +# +# This simply uses the opencmiss target created by OC_INIT() above. +# +# Alternatively, you can also directly invoke 'find_package(Iron )' 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 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(temp_memory_issue PRIVATE opencmiss) + +# Add a simple test that runs the executable +add_test(NAME test_temp_memory_issue COMMAND temp_memory_issue) +add_opencmiss_environment(test_temp_memory_issue) + +################### +# 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. +# diff --git a/FluidMechanics/Darcy/temp_memory_issue/src/temp_memory_issueExample.f90 b/FluidMechanics/Darcy/temp_memory_issue/Fortran/src/temp_memory_issueExample.f90 similarity index 100% rename from FluidMechanics/Darcy/temp_memory_issue/src/temp_memory_issueExample.f90 rename to FluidMechanics/Darcy/temp_memory_issue/Fortran/src/temp_memory_issueExample.f90 diff --git a/FluidMechanics/Darcy/temp_memory_issue/OpenCMISS.cmake b/FluidMechanics/Darcy/temp_memory_issue/OpenCMISS.cmake new file mode 100644 index 00000000..3d6cf515 --- /dev/null +++ b/FluidMechanics/Darcy/temp_memory_issue/OpenCMISS.cmake @@ -0,0 +1,95 @@ +########################### +# *DO NOT CHANGE THIS FILE* +########################### +# +# Prepares the use of OpenCMISS by scanning at various path locations for OpenCMISS (SDK) installations. +# +# Search order: +# - OPENCMISS_INSTALL_DIR variable +# - OPENCMISS_INSTALL_DIR environment variable +# - OPENCMISS_SDK_DIR variable +# - OPENCMISS_SDK_DIR environment variable +# - [Windows only] The Registry is searched additionally for installed SDKs. +# +# If found +# - Includes the toolchain config script of the found opencmiss installation to enable toolchain selection logic (non-windows) + +# Convenience: The OPENCMISS_INSTALL_DIR may also be defined in the environment and various other places +if (DEFINED OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using specified installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The specified OPENCMISS_INSTALL_DIR '${OPENCMISS_INSTALL_DIR}' does not exist. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_INSTALL_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_INSTALL_DIR}" OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using environment installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The environment variable OPENCMISS_INSTALL_DIR='${OPENCMISS_INSTALL_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if (NOT OPENCMISS_INSTALL_DIR AND DEFINED OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The specified OPENCMISS_SDK_DIR '${OPENCMISS_SDK_DIR}' does not exist. Skipping.") + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_SDK_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_SDK_DIR}" OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using environment SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The environment variable OPENCMISS_SDK_DIR='${OPENCMISS_SDK_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_SDK_DIR) + endif() +endif() +# On windows: check the registry for installed OpenCMISS SDKs +if(NOT OPENCMISS_INSTALL_DIR AND WIN32) + foreach(ROOT HKEY_CURRENT_USER HKEY_LOCAL_MACHINE) + foreach(PACKAGE OpenCMISSUserSDK OpenCMISSDeveloperSDK) + set(_REG_KEY "[${ROOT}\\Software\\Auckland Bioengineering Institute\\${PACKAGE}]") + get_filename_component(OPENCMISS_INSTALL_DIR "${_REG_KEY}" ABSOLUTE) + #message(STATUS "Trying registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Found ${PACKAGE} in Windows registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + break() + else() + unset(OPENCMISS_INSTALL_DIR) + endif() + endforeach() + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + break() + endif() + endforeach() +endif() + +if(OPENCMISS_INSTALL_DIR) + message(STATUS "OPENCMISS_INSTALL_DIR=${OPENCMISS_INSTALL_DIR}") + # Use the OpenCMISS scripts to also allow choosing a separate toolchain + # This file is located at the opencmiss installation rather than the local example + # as it avoids file replication and makes maintenance much easier + if (TOOLCHAIN) + set(_OCTC ${OPENCMISS_INSTALL_DIR}/cmake/OCToolchainCompilers.cmake) + if (EXISTS "${_OCTC}") + include(${_OCTC}) + else() + message(WARNING "TOOLCHAIN specified but OpenCMISS config script could not be found at ${_OCTC}. Trying CMake defaults.") + endif() + unset(_OCTC) + endif() + set(OpenCMISS_DIR "${OPENCMISS_INSTALL_DIR}" CACHE PATH "Path to the found OpenCMISS (SDK) installation") +else() + message(WARNING "No OpenCMISS (SDK) installation directory detected. Using default system environment.") +endif() + \ No newline at end of file diff --git a/FluidMechanics/Darcy/temp_memory_issue/build_debug/build.sh b/FluidMechanics/Darcy/temp_memory_issue/build_debug/build.sh new file mode 100644 index 00000000..e6624bac --- /dev/null +++ b/FluidMechanics/Darcy/temp_memory_issue/build_debug/build.sh @@ -0,0 +1,2 @@ +#ccc && cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all +cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all diff --git a/FluidMechanics/NavierStokes/42Master/CMakeLists.txt b/FluidMechanics/NavierStokes/42Master/CMakeLists.txt new file mode 100644 index 00000000..a22b61ee --- /dev/null +++ b/FluidMechanics/NavierStokes/42Master/CMakeLists.txt @@ -0,0 +1,35 @@ +# 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 C) +enable_language(Fortran OPTIONAL) +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 +# ---------------------- +#add_subdirectory(C) +if (CMAKE_Fortran_COMPILER) + add_subdirectory(Fortran) +endif() diff --git a/FluidMechanics/NavierStokes/42Master/Fortran/CMakeLists.txt b/FluidMechanics/NavierStokes/42Master/Fortran/CMakeLists.txt new file mode 100644 index 00000000..20e09803 --- /dev/null +++ b/FluidMechanics/NavierStokes/42Master/Fortran/CMakeLists.txt @@ -0,0 +1,60 @@ + +# Add example executable +add_executable(42Master src/42MasterExample.f90) + +# Turn on Fortran preprocessing (#include directives) +if (MSVC) + set(PROC_OPT "/fpp") +else() + set(PROC_OPT "-cpp") +endif() + +# in debug mode, add flag that make Floating point exceptions fatal +set(OPT "") +if (FALSE) + if(CMAKE_BUILD_TYPE MATCHES DEBUG) + set(OPT "-ffpe-trap=invalid,zero,underflow,overflow,denormal") # GCC: make floating point exceptions fatal + endif() +endif() + +target_compile_options(42Master PRIVATE ${PROC_OPT} ${OPT} "-fbacktrace") + +# Link to opencmiss +# ----------------- +# +# This simply uses the opencmiss target created by OC_INIT() above. +# +# Alternatively, you can also directly invoke 'find_package(Iron )' 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 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(42Master PRIVATE opencmiss) + +# Add a simple test that runs the executable +add_test(NAME test_42Master COMMAND 42Master) +add_opencmiss_environment(test_42Master) + +################### +# 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. +# diff --git a/FluidMechanics/NavierStokes/42Master/src/42MasterExample.f90 b/FluidMechanics/NavierStokes/42Master/Fortran/src/42MasterExample.f90 similarity index 100% rename from FluidMechanics/NavierStokes/42Master/src/42MasterExample.f90 rename to FluidMechanics/NavierStokes/42Master/Fortran/src/42MasterExample.f90 diff --git a/FluidMechanics/NavierStokes/42Master/OpenCMISS.cmake b/FluidMechanics/NavierStokes/42Master/OpenCMISS.cmake new file mode 100644 index 00000000..3d6cf515 --- /dev/null +++ b/FluidMechanics/NavierStokes/42Master/OpenCMISS.cmake @@ -0,0 +1,95 @@ +########################### +# *DO NOT CHANGE THIS FILE* +########################### +# +# Prepares the use of OpenCMISS by scanning at various path locations for OpenCMISS (SDK) installations. +# +# Search order: +# - OPENCMISS_INSTALL_DIR variable +# - OPENCMISS_INSTALL_DIR environment variable +# - OPENCMISS_SDK_DIR variable +# - OPENCMISS_SDK_DIR environment variable +# - [Windows only] The Registry is searched additionally for installed SDKs. +# +# If found +# - Includes the toolchain config script of the found opencmiss installation to enable toolchain selection logic (non-windows) + +# Convenience: The OPENCMISS_INSTALL_DIR may also be defined in the environment and various other places +if (DEFINED OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using specified installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The specified OPENCMISS_INSTALL_DIR '${OPENCMISS_INSTALL_DIR}' does not exist. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_INSTALL_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_INSTALL_DIR}" OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using environment installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The environment variable OPENCMISS_INSTALL_DIR='${OPENCMISS_INSTALL_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if (NOT OPENCMISS_INSTALL_DIR AND DEFINED OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The specified OPENCMISS_SDK_DIR '${OPENCMISS_SDK_DIR}' does not exist. Skipping.") + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_SDK_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_SDK_DIR}" OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using environment SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The environment variable OPENCMISS_SDK_DIR='${OPENCMISS_SDK_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_SDK_DIR) + endif() +endif() +# On windows: check the registry for installed OpenCMISS SDKs +if(NOT OPENCMISS_INSTALL_DIR AND WIN32) + foreach(ROOT HKEY_CURRENT_USER HKEY_LOCAL_MACHINE) + foreach(PACKAGE OpenCMISSUserSDK OpenCMISSDeveloperSDK) + set(_REG_KEY "[${ROOT}\\Software\\Auckland Bioengineering Institute\\${PACKAGE}]") + get_filename_component(OPENCMISS_INSTALL_DIR "${_REG_KEY}" ABSOLUTE) + #message(STATUS "Trying registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Found ${PACKAGE} in Windows registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + break() + else() + unset(OPENCMISS_INSTALL_DIR) + endif() + endforeach() + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + break() + endif() + endforeach() +endif() + +if(OPENCMISS_INSTALL_DIR) + message(STATUS "OPENCMISS_INSTALL_DIR=${OPENCMISS_INSTALL_DIR}") + # Use the OpenCMISS scripts to also allow choosing a separate toolchain + # This file is located at the opencmiss installation rather than the local example + # as it avoids file replication and makes maintenance much easier + if (TOOLCHAIN) + set(_OCTC ${OPENCMISS_INSTALL_DIR}/cmake/OCToolchainCompilers.cmake) + if (EXISTS "${_OCTC}") + include(${_OCTC}) + else() + message(WARNING "TOOLCHAIN specified but OpenCMISS config script could not be found at ${_OCTC}. Trying CMake defaults.") + endif() + unset(_OCTC) + endif() + set(OpenCMISS_DIR "${OPENCMISS_INSTALL_DIR}" CACHE PATH "Path to the found OpenCMISS (SDK) installation") +else() + message(WARNING "No OpenCMISS (SDK) installation directory detected. Using default system environment.") +endif() + \ No newline at end of file diff --git a/FluidMechanics/NavierStokes/42Master/build_debug/build.sh b/FluidMechanics/NavierStokes/42Master/build_debug/build.sh new file mode 100644 index 00000000..e6624bac --- /dev/null +++ b/FluidMechanics/NavierStokes/42Master/build_debug/build.sh @@ -0,0 +1,2 @@ +#ccc && cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all +cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all diff --git a/FluidMechanics/NavierStokes/Coupled1DCellML/CMakeLists.txt b/FluidMechanics/NavierStokes/Coupled1DCellML/CMakeLists.txt new file mode 100644 index 00000000..a22b61ee --- /dev/null +++ b/FluidMechanics/NavierStokes/Coupled1DCellML/CMakeLists.txt @@ -0,0 +1,35 @@ +# 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 C) +enable_language(Fortran OPTIONAL) +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 +# ---------------------- +#add_subdirectory(C) +if (CMAKE_Fortran_COMPILER) + add_subdirectory(Fortran) +endif() diff --git a/FluidMechanics/NavierStokes/Coupled1DCellML/Fortran/CMakeLists.txt b/FluidMechanics/NavierStokes/Coupled1DCellML/Fortran/CMakeLists.txt new file mode 100644 index 00000000..56eeffea --- /dev/null +++ b/FluidMechanics/NavierStokes/Coupled1DCellML/Fortran/CMakeLists.txt @@ -0,0 +1,60 @@ + +# Add example executable +add_executable(Coupled1DCellML src/FortranExample.f90) + +# Turn on Fortran preprocessing (#include directives) +if (MSVC) + set(PROC_OPT "/fpp") +else() + set(PROC_OPT "-cpp") +endif() + +# in debug mode, add flag that make Floating point exceptions fatal +set(OPT "") +if (FALSE) + if(CMAKE_BUILD_TYPE MATCHES DEBUG) + set(OPT "-ffpe-trap=invalid,zero,underflow,overflow,denormal") # GCC: make floating point exceptions fatal + endif() +endif() + +target_compile_options(Coupled1DCellML PRIVATE ${PROC_OPT} ${OPT} "-fbacktrace") + +# Link to opencmiss +# ----------------- +# +# This simply uses the opencmiss target created by OC_INIT() above. +# +# Alternatively, you can also directly invoke 'find_package(Iron )' 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 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(Coupled1DCellML PRIVATE opencmiss) + +# Add a simple test that runs the executable +add_test(NAME test_Coupled1DCellML COMMAND Coupled1DCellML) +add_opencmiss_environment(test_Coupled1DCellML) + +################### +# 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. +# diff --git a/FluidMechanics/NavierStokes/Coupled1DCellML/OpenCMISS.cmake b/FluidMechanics/NavierStokes/Coupled1DCellML/OpenCMISS.cmake new file mode 100644 index 00000000..3d6cf515 --- /dev/null +++ b/FluidMechanics/NavierStokes/Coupled1DCellML/OpenCMISS.cmake @@ -0,0 +1,95 @@ +########################### +# *DO NOT CHANGE THIS FILE* +########################### +# +# Prepares the use of OpenCMISS by scanning at various path locations for OpenCMISS (SDK) installations. +# +# Search order: +# - OPENCMISS_INSTALL_DIR variable +# - OPENCMISS_INSTALL_DIR environment variable +# - OPENCMISS_SDK_DIR variable +# - OPENCMISS_SDK_DIR environment variable +# - [Windows only] The Registry is searched additionally for installed SDKs. +# +# If found +# - Includes the toolchain config script of the found opencmiss installation to enable toolchain selection logic (non-windows) + +# Convenience: The OPENCMISS_INSTALL_DIR may also be defined in the environment and various other places +if (DEFINED OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using specified installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The specified OPENCMISS_INSTALL_DIR '${OPENCMISS_INSTALL_DIR}' does not exist. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_INSTALL_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_INSTALL_DIR}" OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using environment installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The environment variable OPENCMISS_INSTALL_DIR='${OPENCMISS_INSTALL_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if (NOT OPENCMISS_INSTALL_DIR AND DEFINED OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The specified OPENCMISS_SDK_DIR '${OPENCMISS_SDK_DIR}' does not exist. Skipping.") + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_SDK_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_SDK_DIR}" OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using environment SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The environment variable OPENCMISS_SDK_DIR='${OPENCMISS_SDK_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_SDK_DIR) + endif() +endif() +# On windows: check the registry for installed OpenCMISS SDKs +if(NOT OPENCMISS_INSTALL_DIR AND WIN32) + foreach(ROOT HKEY_CURRENT_USER HKEY_LOCAL_MACHINE) + foreach(PACKAGE OpenCMISSUserSDK OpenCMISSDeveloperSDK) + set(_REG_KEY "[${ROOT}\\Software\\Auckland Bioengineering Institute\\${PACKAGE}]") + get_filename_component(OPENCMISS_INSTALL_DIR "${_REG_KEY}" ABSOLUTE) + #message(STATUS "Trying registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Found ${PACKAGE} in Windows registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + break() + else() + unset(OPENCMISS_INSTALL_DIR) + endif() + endforeach() + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + break() + endif() + endforeach() +endif() + +if(OPENCMISS_INSTALL_DIR) + message(STATUS "OPENCMISS_INSTALL_DIR=${OPENCMISS_INSTALL_DIR}") + # Use the OpenCMISS scripts to also allow choosing a separate toolchain + # This file is located at the opencmiss installation rather than the local example + # as it avoids file replication and makes maintenance much easier + if (TOOLCHAIN) + set(_OCTC ${OPENCMISS_INSTALL_DIR}/cmake/OCToolchainCompilers.cmake) + if (EXISTS "${_OCTC}") + include(${_OCTC}) + else() + message(WARNING "TOOLCHAIN specified but OpenCMISS config script could not be found at ${_OCTC}. Trying CMake defaults.") + endif() + unset(_OCTC) + endif() + set(OpenCMISS_DIR "${OPENCMISS_INSTALL_DIR}" CACHE PATH "Path to the found OpenCMISS (SDK) installation") +else() + message(WARNING "No OpenCMISS (SDK) installation directory detected. Using default system environment.") +endif() + \ No newline at end of file diff --git a/FluidMechanics/NavierStokes/Coupled1DCellML/build_debug/build.sh b/FluidMechanics/NavierStokes/Coupled1DCellML/build_debug/build.sh new file mode 100644 index 00000000..e6624bac --- /dev/null +++ b/FluidMechanics/NavierStokes/Coupled1DCellML/build_debug/build.sh @@ -0,0 +1,2 @@ +#ccc && cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all +cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all diff --git a/FluidMechanics/NavierStokes/Poiseuille/2DChannel/Static/CMakeLists.txt b/FluidMechanics/NavierStokes/Poiseuille/2DChannel/Static/CMakeLists.txt new file mode 100644 index 00000000..a22b61ee --- /dev/null +++ b/FluidMechanics/NavierStokes/Poiseuille/2DChannel/Static/CMakeLists.txt @@ -0,0 +1,35 @@ +# 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 C) +enable_language(Fortran OPTIONAL) +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 +# ---------------------- +#add_subdirectory(C) +if (CMAKE_Fortran_COMPILER) + add_subdirectory(Fortran) +endif() diff --git a/FluidMechanics/NavierStokes/Poiseuille/2DChannel/Static/Fortran/CMakeLists.txt b/FluidMechanics/NavierStokes/Poiseuille/2DChannel/Static/Fortran/CMakeLists.txt new file mode 100644 index 00000000..d1b76f7d --- /dev/null +++ b/FluidMechanics/NavierStokes/Poiseuille/2DChannel/Static/Fortran/CMakeLists.txt @@ -0,0 +1,60 @@ + +# Add example executable +add_executable(Static src/StaticExample.f90) + +# Turn on Fortran preprocessing (#include directives) +if (MSVC) + set(PROC_OPT "/fpp") +else() + set(PROC_OPT "-cpp") +endif() + +# in debug mode, add flag that make Floating point exceptions fatal +set(OPT "") +if (FALSE) + if(CMAKE_BUILD_TYPE MATCHES DEBUG) + set(OPT "-ffpe-trap=invalid,zero,underflow,overflow,denormal") # GCC: make floating point exceptions fatal + endif() +endif() + +target_compile_options(Static PRIVATE ${PROC_OPT} ${OPT} "-fbacktrace") + +# Link to opencmiss +# ----------------- +# +# This simply uses the opencmiss target created by OC_INIT() above. +# +# Alternatively, you can also directly invoke 'find_package(Iron )' 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 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(Static PRIVATE opencmiss) + +# Add a simple test that runs the executable +add_test(NAME test_Static COMMAND Static) +add_opencmiss_environment(test_Static) + +################### +# 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. +# diff --git a/FluidMechanics/NavierStokes/Poiseuille/2DChannel/Static/src/StaticExample.f90 b/FluidMechanics/NavierStokes/Poiseuille/2DChannel/Static/Fortran/src/StaticExample.f90 similarity index 100% rename from FluidMechanics/NavierStokes/Poiseuille/2DChannel/Static/src/StaticExample.f90 rename to FluidMechanics/NavierStokes/Poiseuille/2DChannel/Static/Fortran/src/StaticExample.f90 diff --git a/FluidMechanics/NavierStokes/Poiseuille/2DChannel/Static/OpenCMISS.cmake b/FluidMechanics/NavierStokes/Poiseuille/2DChannel/Static/OpenCMISS.cmake new file mode 100644 index 00000000..3d6cf515 --- /dev/null +++ b/FluidMechanics/NavierStokes/Poiseuille/2DChannel/Static/OpenCMISS.cmake @@ -0,0 +1,95 @@ +########################### +# *DO NOT CHANGE THIS FILE* +########################### +# +# Prepares the use of OpenCMISS by scanning at various path locations for OpenCMISS (SDK) installations. +# +# Search order: +# - OPENCMISS_INSTALL_DIR variable +# - OPENCMISS_INSTALL_DIR environment variable +# - OPENCMISS_SDK_DIR variable +# - OPENCMISS_SDK_DIR environment variable +# - [Windows only] The Registry is searched additionally for installed SDKs. +# +# If found +# - Includes the toolchain config script of the found opencmiss installation to enable toolchain selection logic (non-windows) + +# Convenience: The OPENCMISS_INSTALL_DIR may also be defined in the environment and various other places +if (DEFINED OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using specified installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The specified OPENCMISS_INSTALL_DIR '${OPENCMISS_INSTALL_DIR}' does not exist. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_INSTALL_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_INSTALL_DIR}" OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using environment installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The environment variable OPENCMISS_INSTALL_DIR='${OPENCMISS_INSTALL_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if (NOT OPENCMISS_INSTALL_DIR AND DEFINED OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The specified OPENCMISS_SDK_DIR '${OPENCMISS_SDK_DIR}' does not exist. Skipping.") + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_SDK_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_SDK_DIR}" OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using environment SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The environment variable OPENCMISS_SDK_DIR='${OPENCMISS_SDK_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_SDK_DIR) + endif() +endif() +# On windows: check the registry for installed OpenCMISS SDKs +if(NOT OPENCMISS_INSTALL_DIR AND WIN32) + foreach(ROOT HKEY_CURRENT_USER HKEY_LOCAL_MACHINE) + foreach(PACKAGE OpenCMISSUserSDK OpenCMISSDeveloperSDK) + set(_REG_KEY "[${ROOT}\\Software\\Auckland Bioengineering Institute\\${PACKAGE}]") + get_filename_component(OPENCMISS_INSTALL_DIR "${_REG_KEY}" ABSOLUTE) + #message(STATUS "Trying registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Found ${PACKAGE} in Windows registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + break() + else() + unset(OPENCMISS_INSTALL_DIR) + endif() + endforeach() + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + break() + endif() + endforeach() +endif() + +if(OPENCMISS_INSTALL_DIR) + message(STATUS "OPENCMISS_INSTALL_DIR=${OPENCMISS_INSTALL_DIR}") + # Use the OpenCMISS scripts to also allow choosing a separate toolchain + # This file is located at the opencmiss installation rather than the local example + # as it avoids file replication and makes maintenance much easier + if (TOOLCHAIN) + set(_OCTC ${OPENCMISS_INSTALL_DIR}/cmake/OCToolchainCompilers.cmake) + if (EXISTS "${_OCTC}") + include(${_OCTC}) + else() + message(WARNING "TOOLCHAIN specified but OpenCMISS config script could not be found at ${_OCTC}. Trying CMake defaults.") + endif() + unset(_OCTC) + endif() + set(OpenCMISS_DIR "${OPENCMISS_INSTALL_DIR}" CACHE PATH "Path to the found OpenCMISS (SDK) installation") +else() + message(WARNING "No OpenCMISS (SDK) installation directory detected. Using default system environment.") +endif() + \ No newline at end of file diff --git a/FluidMechanics/NavierStokes/Poiseuille/2DChannel/Static/build_debug/build.sh b/FluidMechanics/NavierStokes/Poiseuille/2DChannel/Static/build_debug/build.sh new file mode 100644 index 00000000..e6624bac --- /dev/null +++ b/FluidMechanics/NavierStokes/Poiseuille/2DChannel/Static/build_debug/build.sh @@ -0,0 +1,2 @@ +#ccc && cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all +cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all diff --git a/FluidMechanics/NavierStokes/RoutineCheck/ALE/CMakeLists.txt b/FluidMechanics/NavierStokes/RoutineCheck/ALE/CMakeLists.txt new file mode 100644 index 00000000..a22b61ee --- /dev/null +++ b/FluidMechanics/NavierStokes/RoutineCheck/ALE/CMakeLists.txt @@ -0,0 +1,35 @@ +# 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 C) +enable_language(Fortran OPTIONAL) +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 +# ---------------------- +#add_subdirectory(C) +if (CMAKE_Fortran_COMPILER) + add_subdirectory(Fortran) +endif() diff --git a/FluidMechanics/NavierStokes/RoutineCheck/ALE/Fortran/CMakeLists.txt b/FluidMechanics/NavierStokes/RoutineCheck/ALE/Fortran/CMakeLists.txt new file mode 100644 index 00000000..80318461 --- /dev/null +++ b/FluidMechanics/NavierStokes/RoutineCheck/ALE/Fortran/CMakeLists.txt @@ -0,0 +1,60 @@ + +# Add example executable +add_executable(ALE src/ALEExample.f90) + +# Turn on Fortran preprocessing (#include directives) +if (MSVC) + set(PROC_OPT "/fpp") +else() + set(PROC_OPT "-cpp") +endif() + +# in debug mode, add flag that make Floating point exceptions fatal +set(OPT "") +if (FALSE) + if(CMAKE_BUILD_TYPE MATCHES DEBUG) + set(OPT "-ffpe-trap=invalid,zero,underflow,overflow,denormal") # GCC: make floating point exceptions fatal + endif() +endif() + +target_compile_options(ALE PRIVATE ${PROC_OPT} ${OPT} "-fbacktrace") + +# Link to opencmiss +# ----------------- +# +# This simply uses the opencmiss target created by OC_INIT() above. +# +# Alternatively, you can also directly invoke 'find_package(Iron )' 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 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(ALE PRIVATE opencmiss) + +# Add a simple test that runs the executable +add_test(NAME test_ALE COMMAND ALE) +add_opencmiss_environment(test_ALE) + +################### +# 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. +# diff --git a/FluidMechanics/NavierStokes/RoutineCheck/ALE/src/ALEExample.f90 b/FluidMechanics/NavierStokes/RoutineCheck/ALE/Fortran/src/ALEExample.f90 similarity index 100% rename from FluidMechanics/NavierStokes/RoutineCheck/ALE/src/ALEExample.f90 rename to FluidMechanics/NavierStokes/RoutineCheck/ALE/Fortran/src/ALEExample.f90 diff --git a/FluidMechanics/NavierStokes/RoutineCheck/ALE/OpenCMISS.cmake b/FluidMechanics/NavierStokes/RoutineCheck/ALE/OpenCMISS.cmake new file mode 100644 index 00000000..3d6cf515 --- /dev/null +++ b/FluidMechanics/NavierStokes/RoutineCheck/ALE/OpenCMISS.cmake @@ -0,0 +1,95 @@ +########################### +# *DO NOT CHANGE THIS FILE* +########################### +# +# Prepares the use of OpenCMISS by scanning at various path locations for OpenCMISS (SDK) installations. +# +# Search order: +# - OPENCMISS_INSTALL_DIR variable +# - OPENCMISS_INSTALL_DIR environment variable +# - OPENCMISS_SDK_DIR variable +# - OPENCMISS_SDK_DIR environment variable +# - [Windows only] The Registry is searched additionally for installed SDKs. +# +# If found +# - Includes the toolchain config script of the found opencmiss installation to enable toolchain selection logic (non-windows) + +# Convenience: The OPENCMISS_INSTALL_DIR may also be defined in the environment and various other places +if (DEFINED OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using specified installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The specified OPENCMISS_INSTALL_DIR '${OPENCMISS_INSTALL_DIR}' does not exist. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_INSTALL_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_INSTALL_DIR}" OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using environment installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The environment variable OPENCMISS_INSTALL_DIR='${OPENCMISS_INSTALL_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if (NOT OPENCMISS_INSTALL_DIR AND DEFINED OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The specified OPENCMISS_SDK_DIR '${OPENCMISS_SDK_DIR}' does not exist. Skipping.") + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_SDK_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_SDK_DIR}" OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using environment SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The environment variable OPENCMISS_SDK_DIR='${OPENCMISS_SDK_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_SDK_DIR) + endif() +endif() +# On windows: check the registry for installed OpenCMISS SDKs +if(NOT OPENCMISS_INSTALL_DIR AND WIN32) + foreach(ROOT HKEY_CURRENT_USER HKEY_LOCAL_MACHINE) + foreach(PACKAGE OpenCMISSUserSDK OpenCMISSDeveloperSDK) + set(_REG_KEY "[${ROOT}\\Software\\Auckland Bioengineering Institute\\${PACKAGE}]") + get_filename_component(OPENCMISS_INSTALL_DIR "${_REG_KEY}" ABSOLUTE) + #message(STATUS "Trying registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Found ${PACKAGE} in Windows registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + break() + else() + unset(OPENCMISS_INSTALL_DIR) + endif() + endforeach() + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + break() + endif() + endforeach() +endif() + +if(OPENCMISS_INSTALL_DIR) + message(STATUS "OPENCMISS_INSTALL_DIR=${OPENCMISS_INSTALL_DIR}") + # Use the OpenCMISS scripts to also allow choosing a separate toolchain + # This file is located at the opencmiss installation rather than the local example + # as it avoids file replication and makes maintenance much easier + if (TOOLCHAIN) + set(_OCTC ${OPENCMISS_INSTALL_DIR}/cmake/OCToolchainCompilers.cmake) + if (EXISTS "${_OCTC}") + include(${_OCTC}) + else() + message(WARNING "TOOLCHAIN specified but OpenCMISS config script could not be found at ${_OCTC}. Trying CMake defaults.") + endif() + unset(_OCTC) + endif() + set(OpenCMISS_DIR "${OPENCMISS_INSTALL_DIR}" CACHE PATH "Path to the found OpenCMISS (SDK) installation") +else() + message(WARNING "No OpenCMISS (SDK) installation directory detected. Using default system environment.") +endif() + \ No newline at end of file diff --git a/FluidMechanics/NavierStokes/RoutineCheck/ALE/build_debug/build.sh b/FluidMechanics/NavierStokes/RoutineCheck/ALE/build_debug/build.sh new file mode 100644 index 00000000..e6624bac --- /dev/null +++ b/FluidMechanics/NavierStokes/RoutineCheck/ALE/build_debug/build.sh @@ -0,0 +1,2 @@ +#ccc && cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all +cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all diff --git a/FluidMechanics/NavierStokes/RoutineCheck/Dynamic/CMakeLists.txt b/FluidMechanics/NavierStokes/RoutineCheck/Dynamic/CMakeLists.txt new file mode 100644 index 00000000..a22b61ee --- /dev/null +++ b/FluidMechanics/NavierStokes/RoutineCheck/Dynamic/CMakeLists.txt @@ -0,0 +1,35 @@ +# 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 C) +enable_language(Fortran OPTIONAL) +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 +# ---------------------- +#add_subdirectory(C) +if (CMAKE_Fortran_COMPILER) + add_subdirectory(Fortran) +endif() diff --git a/FluidMechanics/NavierStokes/RoutineCheck/Dynamic/Fortran/CMakeLists.txt b/FluidMechanics/NavierStokes/RoutineCheck/Dynamic/Fortran/CMakeLists.txt new file mode 100644 index 00000000..b0d7f800 --- /dev/null +++ b/FluidMechanics/NavierStokes/RoutineCheck/Dynamic/Fortran/CMakeLists.txt @@ -0,0 +1,60 @@ + +# Add example executable +add_executable(Dynamic src/DynamicExample.f90) + +# Turn on Fortran preprocessing (#include directives) +if (MSVC) + set(PROC_OPT "/fpp") +else() + set(PROC_OPT "-cpp") +endif() + +# in debug mode, add flag that make Floating point exceptions fatal +set(OPT "") +if (FALSE) + if(CMAKE_BUILD_TYPE MATCHES DEBUG) + set(OPT "-ffpe-trap=invalid,zero,underflow,overflow,denormal") # GCC: make floating point exceptions fatal + endif() +endif() + +target_compile_options(Dynamic PRIVATE ${PROC_OPT} ${OPT} "-fbacktrace") + +# Link to opencmiss +# ----------------- +# +# This simply uses the opencmiss target created by OC_INIT() above. +# +# Alternatively, you can also directly invoke 'find_package(Iron )' 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 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(Dynamic PRIVATE opencmiss) + +# Add a simple test that runs the executable +add_test(NAME test_Dynamic COMMAND Dynamic) +add_opencmiss_environment(test_Dynamic) + +################### +# 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. +# diff --git a/FluidMechanics/NavierStokes/RoutineCheck/Dynamic/src/DynamicExample.f90 b/FluidMechanics/NavierStokes/RoutineCheck/Dynamic/Fortran/src/DynamicExample.f90 similarity index 100% rename from FluidMechanics/NavierStokes/RoutineCheck/Dynamic/src/DynamicExample.f90 rename to FluidMechanics/NavierStokes/RoutineCheck/Dynamic/Fortran/src/DynamicExample.f90 diff --git a/FluidMechanics/NavierStokes/RoutineCheck/Dynamic/OpenCMISS.cmake b/FluidMechanics/NavierStokes/RoutineCheck/Dynamic/OpenCMISS.cmake new file mode 100644 index 00000000..3d6cf515 --- /dev/null +++ b/FluidMechanics/NavierStokes/RoutineCheck/Dynamic/OpenCMISS.cmake @@ -0,0 +1,95 @@ +########################### +# *DO NOT CHANGE THIS FILE* +########################### +# +# Prepares the use of OpenCMISS by scanning at various path locations for OpenCMISS (SDK) installations. +# +# Search order: +# - OPENCMISS_INSTALL_DIR variable +# - OPENCMISS_INSTALL_DIR environment variable +# - OPENCMISS_SDK_DIR variable +# - OPENCMISS_SDK_DIR environment variable +# - [Windows only] The Registry is searched additionally for installed SDKs. +# +# If found +# - Includes the toolchain config script of the found opencmiss installation to enable toolchain selection logic (non-windows) + +# Convenience: The OPENCMISS_INSTALL_DIR may also be defined in the environment and various other places +if (DEFINED OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using specified installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The specified OPENCMISS_INSTALL_DIR '${OPENCMISS_INSTALL_DIR}' does not exist. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_INSTALL_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_INSTALL_DIR}" OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using environment installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The environment variable OPENCMISS_INSTALL_DIR='${OPENCMISS_INSTALL_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if (NOT OPENCMISS_INSTALL_DIR AND DEFINED OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The specified OPENCMISS_SDK_DIR '${OPENCMISS_SDK_DIR}' does not exist. Skipping.") + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_SDK_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_SDK_DIR}" OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using environment SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The environment variable OPENCMISS_SDK_DIR='${OPENCMISS_SDK_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_SDK_DIR) + endif() +endif() +# On windows: check the registry for installed OpenCMISS SDKs +if(NOT OPENCMISS_INSTALL_DIR AND WIN32) + foreach(ROOT HKEY_CURRENT_USER HKEY_LOCAL_MACHINE) + foreach(PACKAGE OpenCMISSUserSDK OpenCMISSDeveloperSDK) + set(_REG_KEY "[${ROOT}\\Software\\Auckland Bioengineering Institute\\${PACKAGE}]") + get_filename_component(OPENCMISS_INSTALL_DIR "${_REG_KEY}" ABSOLUTE) + #message(STATUS "Trying registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Found ${PACKAGE} in Windows registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + break() + else() + unset(OPENCMISS_INSTALL_DIR) + endif() + endforeach() + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + break() + endif() + endforeach() +endif() + +if(OPENCMISS_INSTALL_DIR) + message(STATUS "OPENCMISS_INSTALL_DIR=${OPENCMISS_INSTALL_DIR}") + # Use the OpenCMISS scripts to also allow choosing a separate toolchain + # This file is located at the opencmiss installation rather than the local example + # as it avoids file replication and makes maintenance much easier + if (TOOLCHAIN) + set(_OCTC ${OPENCMISS_INSTALL_DIR}/cmake/OCToolchainCompilers.cmake) + if (EXISTS "${_OCTC}") + include(${_OCTC}) + else() + message(WARNING "TOOLCHAIN specified but OpenCMISS config script could not be found at ${_OCTC}. Trying CMake defaults.") + endif() + unset(_OCTC) + endif() + set(OpenCMISS_DIR "${OPENCMISS_INSTALL_DIR}" CACHE PATH "Path to the found OpenCMISS (SDK) installation") +else() + message(WARNING "No OpenCMISS (SDK) installation directory detected. Using default system environment.") +endif() + \ No newline at end of file diff --git a/FluidMechanics/NavierStokes/RoutineCheck/Dynamic/build_debug/build.sh b/FluidMechanics/NavierStokes/RoutineCheck/Dynamic/build_debug/build.sh new file mode 100644 index 00000000..e6624bac --- /dev/null +++ b/FluidMechanics/NavierStokes/RoutineCheck/Dynamic/build_debug/build.sh @@ -0,0 +1,2 @@ +#ccc && cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all +cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all diff --git a/FluidMechanics/NavierStokes/RoutineCheck/ParallelDynamic/CMakeLists.txt b/FluidMechanics/NavierStokes/RoutineCheck/ParallelDynamic/CMakeLists.txt new file mode 100644 index 00000000..a22b61ee --- /dev/null +++ b/FluidMechanics/NavierStokes/RoutineCheck/ParallelDynamic/CMakeLists.txt @@ -0,0 +1,35 @@ +# 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 C) +enable_language(Fortran OPTIONAL) +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 +# ---------------------- +#add_subdirectory(C) +if (CMAKE_Fortran_COMPILER) + add_subdirectory(Fortran) +endif() diff --git a/FluidMechanics/NavierStokes/RoutineCheck/ParallelDynamic/Fortran/CMakeLists.txt b/FluidMechanics/NavierStokes/RoutineCheck/ParallelDynamic/Fortran/CMakeLists.txt new file mode 100644 index 00000000..e5a509ef --- /dev/null +++ b/FluidMechanics/NavierStokes/RoutineCheck/ParallelDynamic/Fortran/CMakeLists.txt @@ -0,0 +1,60 @@ + +# Add example executable +add_executable(ParallelDynamic src/ParallelDynamicExample.f90) + +# Turn on Fortran preprocessing (#include directives) +if (MSVC) + set(PROC_OPT "/fpp") +else() + set(PROC_OPT "-cpp") +endif() + +# in debug mode, add flag that make Floating point exceptions fatal +set(OPT "") +if (FALSE) + if(CMAKE_BUILD_TYPE MATCHES DEBUG) + set(OPT "-ffpe-trap=invalid,zero,underflow,overflow,denormal") # GCC: make floating point exceptions fatal + endif() +endif() + +target_compile_options(ParallelDynamic PRIVATE ${PROC_OPT} ${OPT} "-fbacktrace") + +# Link to opencmiss +# ----------------- +# +# This simply uses the opencmiss target created by OC_INIT() above. +# +# Alternatively, you can also directly invoke 'find_package(Iron )' 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 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(ParallelDynamic PRIVATE opencmiss) + +# Add a simple test that runs the executable +add_test(NAME test_ParallelDynamic COMMAND ParallelDynamic) +add_opencmiss_environment(test_ParallelDynamic) + +################### +# 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. +# diff --git a/FluidMechanics/NavierStokes/RoutineCheck/ParallelDynamic/src/ParallelDynamicExample.f90 b/FluidMechanics/NavierStokes/RoutineCheck/ParallelDynamic/Fortran/src/ParallelDynamicExample.f90 similarity index 100% rename from FluidMechanics/NavierStokes/RoutineCheck/ParallelDynamic/src/ParallelDynamicExample.f90 rename to FluidMechanics/NavierStokes/RoutineCheck/ParallelDynamic/Fortran/src/ParallelDynamicExample.f90 diff --git a/FluidMechanics/NavierStokes/RoutineCheck/ParallelDynamic/OpenCMISS.cmake b/FluidMechanics/NavierStokes/RoutineCheck/ParallelDynamic/OpenCMISS.cmake new file mode 100644 index 00000000..3d6cf515 --- /dev/null +++ b/FluidMechanics/NavierStokes/RoutineCheck/ParallelDynamic/OpenCMISS.cmake @@ -0,0 +1,95 @@ +########################### +# *DO NOT CHANGE THIS FILE* +########################### +# +# Prepares the use of OpenCMISS by scanning at various path locations for OpenCMISS (SDK) installations. +# +# Search order: +# - OPENCMISS_INSTALL_DIR variable +# - OPENCMISS_INSTALL_DIR environment variable +# - OPENCMISS_SDK_DIR variable +# - OPENCMISS_SDK_DIR environment variable +# - [Windows only] The Registry is searched additionally for installed SDKs. +# +# If found +# - Includes the toolchain config script of the found opencmiss installation to enable toolchain selection logic (non-windows) + +# Convenience: The OPENCMISS_INSTALL_DIR may also be defined in the environment and various other places +if (DEFINED OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using specified installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The specified OPENCMISS_INSTALL_DIR '${OPENCMISS_INSTALL_DIR}' does not exist. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_INSTALL_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_INSTALL_DIR}" OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using environment installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The environment variable OPENCMISS_INSTALL_DIR='${OPENCMISS_INSTALL_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if (NOT OPENCMISS_INSTALL_DIR AND DEFINED OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The specified OPENCMISS_SDK_DIR '${OPENCMISS_SDK_DIR}' does not exist. Skipping.") + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_SDK_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_SDK_DIR}" OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using environment SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The environment variable OPENCMISS_SDK_DIR='${OPENCMISS_SDK_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_SDK_DIR) + endif() +endif() +# On windows: check the registry for installed OpenCMISS SDKs +if(NOT OPENCMISS_INSTALL_DIR AND WIN32) + foreach(ROOT HKEY_CURRENT_USER HKEY_LOCAL_MACHINE) + foreach(PACKAGE OpenCMISSUserSDK OpenCMISSDeveloperSDK) + set(_REG_KEY "[${ROOT}\\Software\\Auckland Bioengineering Institute\\${PACKAGE}]") + get_filename_component(OPENCMISS_INSTALL_DIR "${_REG_KEY}" ABSOLUTE) + #message(STATUS "Trying registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Found ${PACKAGE} in Windows registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + break() + else() + unset(OPENCMISS_INSTALL_DIR) + endif() + endforeach() + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + break() + endif() + endforeach() +endif() + +if(OPENCMISS_INSTALL_DIR) + message(STATUS "OPENCMISS_INSTALL_DIR=${OPENCMISS_INSTALL_DIR}") + # Use the OpenCMISS scripts to also allow choosing a separate toolchain + # This file is located at the opencmiss installation rather than the local example + # as it avoids file replication and makes maintenance much easier + if (TOOLCHAIN) + set(_OCTC ${OPENCMISS_INSTALL_DIR}/cmake/OCToolchainCompilers.cmake) + if (EXISTS "${_OCTC}") + include(${_OCTC}) + else() + message(WARNING "TOOLCHAIN specified but OpenCMISS config script could not be found at ${_OCTC}. Trying CMake defaults.") + endif() + unset(_OCTC) + endif() + set(OpenCMISS_DIR "${OPENCMISS_INSTALL_DIR}" CACHE PATH "Path to the found OpenCMISS (SDK) installation") +else() + message(WARNING "No OpenCMISS (SDK) installation directory detected. Using default system environment.") +endif() + \ No newline at end of file diff --git a/FluidMechanics/NavierStokes/RoutineCheck/ParallelDynamic/build_debug/build.sh b/FluidMechanics/NavierStokes/RoutineCheck/ParallelDynamic/build_debug/build.sh new file mode 100644 index 00000000..e6624bac --- /dev/null +++ b/FluidMechanics/NavierStokes/RoutineCheck/ParallelDynamic/build_debug/build.sh @@ -0,0 +1,2 @@ +#ccc && cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all +cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all diff --git a/FluidMechanics/NavierStokes/RoutineCheck/ParallelStatic/CMakeLists.txt b/FluidMechanics/NavierStokes/RoutineCheck/ParallelStatic/CMakeLists.txt new file mode 100644 index 00000000..a22b61ee --- /dev/null +++ b/FluidMechanics/NavierStokes/RoutineCheck/ParallelStatic/CMakeLists.txt @@ -0,0 +1,35 @@ +# 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 C) +enable_language(Fortran OPTIONAL) +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 +# ---------------------- +#add_subdirectory(C) +if (CMAKE_Fortran_COMPILER) + add_subdirectory(Fortran) +endif() diff --git a/FluidMechanics/NavierStokes/RoutineCheck/ParallelStatic/Fortran/CMakeLists.txt b/FluidMechanics/NavierStokes/RoutineCheck/ParallelStatic/Fortran/CMakeLists.txt new file mode 100644 index 00000000..b1c43e68 --- /dev/null +++ b/FluidMechanics/NavierStokes/RoutineCheck/ParallelStatic/Fortran/CMakeLists.txt @@ -0,0 +1,60 @@ + +# Add example executable +add_executable(ParallelStatic src/ParallelStaticExample.f90) + +# Turn on Fortran preprocessing (#include directives) +if (MSVC) + set(PROC_OPT "/fpp") +else() + set(PROC_OPT "-cpp") +endif() + +# in debug mode, add flag that make Floating point exceptions fatal +set(OPT "") +if (FALSE) + if(CMAKE_BUILD_TYPE MATCHES DEBUG) + set(OPT "-ffpe-trap=invalid,zero,underflow,overflow,denormal") # GCC: make floating point exceptions fatal + endif() +endif() + +target_compile_options(ParallelStatic PRIVATE ${PROC_OPT} ${OPT} "-fbacktrace") + +# Link to opencmiss +# ----------------- +# +# This simply uses the opencmiss target created by OC_INIT() above. +# +# Alternatively, you can also directly invoke 'find_package(Iron )' 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 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(ParallelStatic PRIVATE opencmiss) + +# Add a simple test that runs the executable +add_test(NAME test_ParallelStatic COMMAND ParallelStatic) +add_opencmiss_environment(test_ParallelStatic) + +################### +# 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. +# diff --git a/FluidMechanics/NavierStokes/RoutineCheck/ParallelStatic/src/ParallelStaticExample.f90 b/FluidMechanics/NavierStokes/RoutineCheck/ParallelStatic/Fortran/src/ParallelStaticExample.f90 similarity index 100% rename from FluidMechanics/NavierStokes/RoutineCheck/ParallelStatic/src/ParallelStaticExample.f90 rename to FluidMechanics/NavierStokes/RoutineCheck/ParallelStatic/Fortran/src/ParallelStaticExample.f90 diff --git a/FluidMechanics/NavierStokes/RoutineCheck/ParallelStatic/OpenCMISS.cmake b/FluidMechanics/NavierStokes/RoutineCheck/ParallelStatic/OpenCMISS.cmake new file mode 100644 index 00000000..3d6cf515 --- /dev/null +++ b/FluidMechanics/NavierStokes/RoutineCheck/ParallelStatic/OpenCMISS.cmake @@ -0,0 +1,95 @@ +########################### +# *DO NOT CHANGE THIS FILE* +########################### +# +# Prepares the use of OpenCMISS by scanning at various path locations for OpenCMISS (SDK) installations. +# +# Search order: +# - OPENCMISS_INSTALL_DIR variable +# - OPENCMISS_INSTALL_DIR environment variable +# - OPENCMISS_SDK_DIR variable +# - OPENCMISS_SDK_DIR environment variable +# - [Windows only] The Registry is searched additionally for installed SDKs. +# +# If found +# - Includes the toolchain config script of the found opencmiss installation to enable toolchain selection logic (non-windows) + +# Convenience: The OPENCMISS_INSTALL_DIR may also be defined in the environment and various other places +if (DEFINED OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using specified installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The specified OPENCMISS_INSTALL_DIR '${OPENCMISS_INSTALL_DIR}' does not exist. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_INSTALL_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_INSTALL_DIR}" OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using environment installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The environment variable OPENCMISS_INSTALL_DIR='${OPENCMISS_INSTALL_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if (NOT OPENCMISS_INSTALL_DIR AND DEFINED OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The specified OPENCMISS_SDK_DIR '${OPENCMISS_SDK_DIR}' does not exist. Skipping.") + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_SDK_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_SDK_DIR}" OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using environment SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The environment variable OPENCMISS_SDK_DIR='${OPENCMISS_SDK_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_SDK_DIR) + endif() +endif() +# On windows: check the registry for installed OpenCMISS SDKs +if(NOT OPENCMISS_INSTALL_DIR AND WIN32) + foreach(ROOT HKEY_CURRENT_USER HKEY_LOCAL_MACHINE) + foreach(PACKAGE OpenCMISSUserSDK OpenCMISSDeveloperSDK) + set(_REG_KEY "[${ROOT}\\Software\\Auckland Bioengineering Institute\\${PACKAGE}]") + get_filename_component(OPENCMISS_INSTALL_DIR "${_REG_KEY}" ABSOLUTE) + #message(STATUS "Trying registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Found ${PACKAGE} in Windows registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + break() + else() + unset(OPENCMISS_INSTALL_DIR) + endif() + endforeach() + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + break() + endif() + endforeach() +endif() + +if(OPENCMISS_INSTALL_DIR) + message(STATUS "OPENCMISS_INSTALL_DIR=${OPENCMISS_INSTALL_DIR}") + # Use the OpenCMISS scripts to also allow choosing a separate toolchain + # This file is located at the opencmiss installation rather than the local example + # as it avoids file replication and makes maintenance much easier + if (TOOLCHAIN) + set(_OCTC ${OPENCMISS_INSTALL_DIR}/cmake/OCToolchainCompilers.cmake) + if (EXISTS "${_OCTC}") + include(${_OCTC}) + else() + message(WARNING "TOOLCHAIN specified but OpenCMISS config script could not be found at ${_OCTC}. Trying CMake defaults.") + endif() + unset(_OCTC) + endif() + set(OpenCMISS_DIR "${OPENCMISS_INSTALL_DIR}" CACHE PATH "Path to the found OpenCMISS (SDK) installation") +else() + message(WARNING "No OpenCMISS (SDK) installation directory detected. Using default system environment.") +endif() + \ No newline at end of file diff --git a/FluidMechanics/NavierStokes/RoutineCheck/ParallelStatic/build_debug/build.sh b/FluidMechanics/NavierStokes/RoutineCheck/ParallelStatic/build_debug/build.sh new file mode 100644 index 00000000..e6624bac --- /dev/null +++ b/FluidMechanics/NavierStokes/RoutineCheck/ParallelStatic/build_debug/build.sh @@ -0,0 +1,2 @@ +#ccc && cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all +cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all diff --git a/FluidMechanics/NavierStokes/RoutineCheck/Static/CMakeLists.txt b/FluidMechanics/NavierStokes/RoutineCheck/Static/CMakeLists.txt new file mode 100644 index 00000000..a22b61ee --- /dev/null +++ b/FluidMechanics/NavierStokes/RoutineCheck/Static/CMakeLists.txt @@ -0,0 +1,35 @@ +# 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 C) +enable_language(Fortran OPTIONAL) +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 +# ---------------------- +#add_subdirectory(C) +if (CMAKE_Fortran_COMPILER) + add_subdirectory(Fortran) +endif() diff --git a/FluidMechanics/NavierStokes/RoutineCheck/Static/Fortran/CMakeLists.txt b/FluidMechanics/NavierStokes/RoutineCheck/Static/Fortran/CMakeLists.txt new file mode 100644 index 00000000..d1b76f7d --- /dev/null +++ b/FluidMechanics/NavierStokes/RoutineCheck/Static/Fortran/CMakeLists.txt @@ -0,0 +1,60 @@ + +# Add example executable +add_executable(Static src/StaticExample.f90) + +# Turn on Fortran preprocessing (#include directives) +if (MSVC) + set(PROC_OPT "/fpp") +else() + set(PROC_OPT "-cpp") +endif() + +# in debug mode, add flag that make Floating point exceptions fatal +set(OPT "") +if (FALSE) + if(CMAKE_BUILD_TYPE MATCHES DEBUG) + set(OPT "-ffpe-trap=invalid,zero,underflow,overflow,denormal") # GCC: make floating point exceptions fatal + endif() +endif() + +target_compile_options(Static PRIVATE ${PROC_OPT} ${OPT} "-fbacktrace") + +# Link to opencmiss +# ----------------- +# +# This simply uses the opencmiss target created by OC_INIT() above. +# +# Alternatively, you can also directly invoke 'find_package(Iron )' 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 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(Static PRIVATE opencmiss) + +# Add a simple test that runs the executable +add_test(NAME test_Static COMMAND Static) +add_opencmiss_environment(test_Static) + +################### +# 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. +# diff --git a/FluidMechanics/NavierStokes/RoutineCheck/Static/src/StaticExample.f90 b/FluidMechanics/NavierStokes/RoutineCheck/Static/Fortran/src/StaticExample.f90 similarity index 100% rename from FluidMechanics/NavierStokes/RoutineCheck/Static/src/StaticExample.f90 rename to FluidMechanics/NavierStokes/RoutineCheck/Static/Fortran/src/StaticExample.f90 diff --git a/FluidMechanics/NavierStokes/RoutineCheck/Static/OpenCMISS.cmake b/FluidMechanics/NavierStokes/RoutineCheck/Static/OpenCMISS.cmake new file mode 100644 index 00000000..3d6cf515 --- /dev/null +++ b/FluidMechanics/NavierStokes/RoutineCheck/Static/OpenCMISS.cmake @@ -0,0 +1,95 @@ +########################### +# *DO NOT CHANGE THIS FILE* +########################### +# +# Prepares the use of OpenCMISS by scanning at various path locations for OpenCMISS (SDK) installations. +# +# Search order: +# - OPENCMISS_INSTALL_DIR variable +# - OPENCMISS_INSTALL_DIR environment variable +# - OPENCMISS_SDK_DIR variable +# - OPENCMISS_SDK_DIR environment variable +# - [Windows only] The Registry is searched additionally for installed SDKs. +# +# If found +# - Includes the toolchain config script of the found opencmiss installation to enable toolchain selection logic (non-windows) + +# Convenience: The OPENCMISS_INSTALL_DIR may also be defined in the environment and various other places +if (DEFINED OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using specified installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The specified OPENCMISS_INSTALL_DIR '${OPENCMISS_INSTALL_DIR}' does not exist. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_INSTALL_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_INSTALL_DIR}" OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using environment installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The environment variable OPENCMISS_INSTALL_DIR='${OPENCMISS_INSTALL_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if (NOT OPENCMISS_INSTALL_DIR AND DEFINED OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The specified OPENCMISS_SDK_DIR '${OPENCMISS_SDK_DIR}' does not exist. Skipping.") + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_SDK_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_SDK_DIR}" OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using environment SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The environment variable OPENCMISS_SDK_DIR='${OPENCMISS_SDK_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_SDK_DIR) + endif() +endif() +# On windows: check the registry for installed OpenCMISS SDKs +if(NOT OPENCMISS_INSTALL_DIR AND WIN32) + foreach(ROOT HKEY_CURRENT_USER HKEY_LOCAL_MACHINE) + foreach(PACKAGE OpenCMISSUserSDK OpenCMISSDeveloperSDK) + set(_REG_KEY "[${ROOT}\\Software\\Auckland Bioengineering Institute\\${PACKAGE}]") + get_filename_component(OPENCMISS_INSTALL_DIR "${_REG_KEY}" ABSOLUTE) + #message(STATUS "Trying registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Found ${PACKAGE} in Windows registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + break() + else() + unset(OPENCMISS_INSTALL_DIR) + endif() + endforeach() + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + break() + endif() + endforeach() +endif() + +if(OPENCMISS_INSTALL_DIR) + message(STATUS "OPENCMISS_INSTALL_DIR=${OPENCMISS_INSTALL_DIR}") + # Use the OpenCMISS scripts to also allow choosing a separate toolchain + # This file is located at the opencmiss installation rather than the local example + # as it avoids file replication and makes maintenance much easier + if (TOOLCHAIN) + set(_OCTC ${OPENCMISS_INSTALL_DIR}/cmake/OCToolchainCompilers.cmake) + if (EXISTS "${_OCTC}") + include(${_OCTC}) + else() + message(WARNING "TOOLCHAIN specified but OpenCMISS config script could not be found at ${_OCTC}. Trying CMake defaults.") + endif() + unset(_OCTC) + endif() + set(OpenCMISS_DIR "${OPENCMISS_INSTALL_DIR}" CACHE PATH "Path to the found OpenCMISS (SDK) installation") +else() + message(WARNING "No OpenCMISS (SDK) installation directory detected. Using default system environment.") +endif() + \ No newline at end of file diff --git a/FluidMechanics/NavierStokes/RoutineCheck/Static/build_debug/build.sh b/FluidMechanics/NavierStokes/RoutineCheck/Static/build_debug/build.sh new file mode 100644 index 00000000..e6624bac --- /dev/null +++ b/FluidMechanics/NavierStokes/RoutineCheck/Static/build_debug/build.sh @@ -0,0 +1,2 @@ +#ccc && cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all +cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all diff --git a/FluidMechanics/NavierStokes/Static_FieldML/CMakeLists.txt b/FluidMechanics/NavierStokes/Static_FieldML/CMakeLists.txt new file mode 100644 index 00000000..a22b61ee --- /dev/null +++ b/FluidMechanics/NavierStokes/Static_FieldML/CMakeLists.txt @@ -0,0 +1,35 @@ +# 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 C) +enable_language(Fortran OPTIONAL) +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 +# ---------------------- +#add_subdirectory(C) +if (CMAKE_Fortran_COMPILER) + add_subdirectory(Fortran) +endif() diff --git a/FluidMechanics/NavierStokes/Static_FieldML/Fortran/CMakeLists.txt b/FluidMechanics/NavierStokes/Static_FieldML/Fortran/CMakeLists.txt new file mode 100644 index 00000000..59e91a6f --- /dev/null +++ b/FluidMechanics/NavierStokes/Static_FieldML/Fortran/CMakeLists.txt @@ -0,0 +1,60 @@ + +# Add example executable +add_executable(Static_FieldML src/Static_FieldMLExample.f90) + +# Turn on Fortran preprocessing (#include directives) +if (MSVC) + set(PROC_OPT "/fpp") +else() + set(PROC_OPT "-cpp") +endif() + +# in debug mode, add flag that make Floating point exceptions fatal +set(OPT "") +if (FALSE) + if(CMAKE_BUILD_TYPE MATCHES DEBUG) + set(OPT "-ffpe-trap=invalid,zero,underflow,overflow,denormal") # GCC: make floating point exceptions fatal + endif() +endif() + +target_compile_options(Static_FieldML PRIVATE ${PROC_OPT} ${OPT} "-fbacktrace") + +# Link to opencmiss +# ----------------- +# +# This simply uses the opencmiss target created by OC_INIT() above. +# +# Alternatively, you can also directly invoke 'find_package(Iron )' 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 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(Static_FieldML PRIVATE opencmiss) + +# Add a simple test that runs the executable +add_test(NAME test_Static_FieldML COMMAND Static_FieldML) +add_opencmiss_environment(test_Static_FieldML) + +################### +# 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. +# diff --git a/FluidMechanics/NavierStokes/Static_FieldML/src/Static_FieldMLExample.f90 b/FluidMechanics/NavierStokes/Static_FieldML/Fortran/src/Static_FieldMLExample.f90 similarity index 100% rename from FluidMechanics/NavierStokes/Static_FieldML/src/Static_FieldMLExample.f90 rename to FluidMechanics/NavierStokes/Static_FieldML/Fortran/src/Static_FieldMLExample.f90 diff --git a/FluidMechanics/NavierStokes/Static_FieldML/OpenCMISS.cmake b/FluidMechanics/NavierStokes/Static_FieldML/OpenCMISS.cmake new file mode 100644 index 00000000..3d6cf515 --- /dev/null +++ b/FluidMechanics/NavierStokes/Static_FieldML/OpenCMISS.cmake @@ -0,0 +1,95 @@ +########################### +# *DO NOT CHANGE THIS FILE* +########################### +# +# Prepares the use of OpenCMISS by scanning at various path locations for OpenCMISS (SDK) installations. +# +# Search order: +# - OPENCMISS_INSTALL_DIR variable +# - OPENCMISS_INSTALL_DIR environment variable +# - OPENCMISS_SDK_DIR variable +# - OPENCMISS_SDK_DIR environment variable +# - [Windows only] The Registry is searched additionally for installed SDKs. +# +# If found +# - Includes the toolchain config script of the found opencmiss installation to enable toolchain selection logic (non-windows) + +# Convenience: The OPENCMISS_INSTALL_DIR may also be defined in the environment and various other places +if (DEFINED OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using specified installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The specified OPENCMISS_INSTALL_DIR '${OPENCMISS_INSTALL_DIR}' does not exist. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_INSTALL_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_INSTALL_DIR}" OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using environment installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The environment variable OPENCMISS_INSTALL_DIR='${OPENCMISS_INSTALL_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if (NOT OPENCMISS_INSTALL_DIR AND DEFINED OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The specified OPENCMISS_SDK_DIR '${OPENCMISS_SDK_DIR}' does not exist. Skipping.") + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_SDK_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_SDK_DIR}" OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using environment SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The environment variable OPENCMISS_SDK_DIR='${OPENCMISS_SDK_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_SDK_DIR) + endif() +endif() +# On windows: check the registry for installed OpenCMISS SDKs +if(NOT OPENCMISS_INSTALL_DIR AND WIN32) + foreach(ROOT HKEY_CURRENT_USER HKEY_LOCAL_MACHINE) + foreach(PACKAGE OpenCMISSUserSDK OpenCMISSDeveloperSDK) + set(_REG_KEY "[${ROOT}\\Software\\Auckland Bioengineering Institute\\${PACKAGE}]") + get_filename_component(OPENCMISS_INSTALL_DIR "${_REG_KEY}" ABSOLUTE) + #message(STATUS "Trying registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Found ${PACKAGE} in Windows registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + break() + else() + unset(OPENCMISS_INSTALL_DIR) + endif() + endforeach() + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + break() + endif() + endforeach() +endif() + +if(OPENCMISS_INSTALL_DIR) + message(STATUS "OPENCMISS_INSTALL_DIR=${OPENCMISS_INSTALL_DIR}") + # Use the OpenCMISS scripts to also allow choosing a separate toolchain + # This file is located at the opencmiss installation rather than the local example + # as it avoids file replication and makes maintenance much easier + if (TOOLCHAIN) + set(_OCTC ${OPENCMISS_INSTALL_DIR}/cmake/OCToolchainCompilers.cmake) + if (EXISTS "${_OCTC}") + include(${_OCTC}) + else() + message(WARNING "TOOLCHAIN specified but OpenCMISS config script could not be found at ${_OCTC}. Trying CMake defaults.") + endif() + unset(_OCTC) + endif() + set(OpenCMISS_DIR "${OPENCMISS_INSTALL_DIR}" CACHE PATH "Path to the found OpenCMISS (SDK) installation") +else() + message(WARNING "No OpenCMISS (SDK) installation directory detected. Using default system environment.") +endif() + \ No newline at end of file diff --git a/FluidMechanics/NavierStokes/Static_FieldML/build_debug/build.sh b/FluidMechanics/NavierStokes/Static_FieldML/build_debug/build.sh new file mode 100644 index 00000000..e6624bac --- /dev/null +++ b/FluidMechanics/NavierStokes/Static_FieldML/build_debug/build.sh @@ -0,0 +1,2 @@ +#ccc && cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all +cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all diff --git a/FluidMechanics/NavierStokes/SupgChannel/CMakeLists.txt b/FluidMechanics/NavierStokes/SupgChannel/CMakeLists.txt new file mode 100644 index 00000000..a22b61ee --- /dev/null +++ b/FluidMechanics/NavierStokes/SupgChannel/CMakeLists.txt @@ -0,0 +1,35 @@ +# 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 C) +enable_language(Fortran OPTIONAL) +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 +# ---------------------- +#add_subdirectory(C) +if (CMAKE_Fortran_COMPILER) + add_subdirectory(Fortran) +endif() diff --git a/FluidMechanics/NavierStokes/SupgChannel/Fortran/CMakeLists.txt b/FluidMechanics/NavierStokes/SupgChannel/Fortran/CMakeLists.txt new file mode 100644 index 00000000..f56d0a9c --- /dev/null +++ b/FluidMechanics/NavierStokes/SupgChannel/Fortran/CMakeLists.txt @@ -0,0 +1,60 @@ + +# Add example executable +add_executable(SupgChannel src/SupgChannelExample.f90) + +# Turn on Fortran preprocessing (#include directives) +if (MSVC) + set(PROC_OPT "/fpp") +else() + set(PROC_OPT "-cpp") +endif() + +# in debug mode, add flag that make Floating point exceptions fatal +set(OPT "") +if (FALSE) + if(CMAKE_BUILD_TYPE MATCHES DEBUG) + set(OPT "-ffpe-trap=invalid,zero,underflow,overflow,denormal") # GCC: make floating point exceptions fatal + endif() +endif() + +target_compile_options(SupgChannel PRIVATE ${PROC_OPT} ${OPT} "-fbacktrace") + +# Link to opencmiss +# ----------------- +# +# This simply uses the opencmiss target created by OC_INIT() above. +# +# Alternatively, you can also directly invoke 'find_package(Iron )' 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 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(SupgChannel PRIVATE opencmiss) + +# Add a simple test that runs the executable +add_test(NAME test_SupgChannel COMMAND SupgChannel) +add_opencmiss_environment(test_SupgChannel) + +################### +# 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. +# diff --git a/FluidMechanics/NavierStokes/SupgChannel/src/SupgChannelExample.f90 b/FluidMechanics/NavierStokes/SupgChannel/Fortran/src/SupgChannelExample.f90 similarity index 100% rename from FluidMechanics/NavierStokes/SupgChannel/src/SupgChannelExample.f90 rename to FluidMechanics/NavierStokes/SupgChannel/Fortran/src/SupgChannelExample.f90 diff --git a/FluidMechanics/NavierStokes/SupgChannel/OpenCMISS.cmake b/FluidMechanics/NavierStokes/SupgChannel/OpenCMISS.cmake new file mode 100644 index 00000000..3d6cf515 --- /dev/null +++ b/FluidMechanics/NavierStokes/SupgChannel/OpenCMISS.cmake @@ -0,0 +1,95 @@ +########################### +# *DO NOT CHANGE THIS FILE* +########################### +# +# Prepares the use of OpenCMISS by scanning at various path locations for OpenCMISS (SDK) installations. +# +# Search order: +# - OPENCMISS_INSTALL_DIR variable +# - OPENCMISS_INSTALL_DIR environment variable +# - OPENCMISS_SDK_DIR variable +# - OPENCMISS_SDK_DIR environment variable +# - [Windows only] The Registry is searched additionally for installed SDKs. +# +# If found +# - Includes the toolchain config script of the found opencmiss installation to enable toolchain selection logic (non-windows) + +# Convenience: The OPENCMISS_INSTALL_DIR may also be defined in the environment and various other places +if (DEFINED OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using specified installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The specified OPENCMISS_INSTALL_DIR '${OPENCMISS_INSTALL_DIR}' does not exist. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_INSTALL_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_INSTALL_DIR}" OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using environment installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The environment variable OPENCMISS_INSTALL_DIR='${OPENCMISS_INSTALL_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if (NOT OPENCMISS_INSTALL_DIR AND DEFINED OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The specified OPENCMISS_SDK_DIR '${OPENCMISS_SDK_DIR}' does not exist. Skipping.") + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_SDK_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_SDK_DIR}" OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using environment SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The environment variable OPENCMISS_SDK_DIR='${OPENCMISS_SDK_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_SDK_DIR) + endif() +endif() +# On windows: check the registry for installed OpenCMISS SDKs +if(NOT OPENCMISS_INSTALL_DIR AND WIN32) + foreach(ROOT HKEY_CURRENT_USER HKEY_LOCAL_MACHINE) + foreach(PACKAGE OpenCMISSUserSDK OpenCMISSDeveloperSDK) + set(_REG_KEY "[${ROOT}\\Software\\Auckland Bioengineering Institute\\${PACKAGE}]") + get_filename_component(OPENCMISS_INSTALL_DIR "${_REG_KEY}" ABSOLUTE) + #message(STATUS "Trying registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Found ${PACKAGE} in Windows registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + break() + else() + unset(OPENCMISS_INSTALL_DIR) + endif() + endforeach() + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + break() + endif() + endforeach() +endif() + +if(OPENCMISS_INSTALL_DIR) + message(STATUS "OPENCMISS_INSTALL_DIR=${OPENCMISS_INSTALL_DIR}") + # Use the OpenCMISS scripts to also allow choosing a separate toolchain + # This file is located at the opencmiss installation rather than the local example + # as it avoids file replication and makes maintenance much easier + if (TOOLCHAIN) + set(_OCTC ${OPENCMISS_INSTALL_DIR}/cmake/OCToolchainCompilers.cmake) + if (EXISTS "${_OCTC}") + include(${_OCTC}) + else() + message(WARNING "TOOLCHAIN specified but OpenCMISS config script could not be found at ${_OCTC}. Trying CMake defaults.") + endif() + unset(_OCTC) + endif() + set(OpenCMISS_DIR "${OPENCMISS_INSTALL_DIR}" CACHE PATH "Path to the found OpenCMISS (SDK) installation") +else() + message(WARNING "No OpenCMISS (SDK) installation directory detected. Using default system environment.") +endif() + \ No newline at end of file diff --git a/FluidMechanics/NavierStokes/SupgChannel/build_debug/build.sh b/FluidMechanics/NavierStokes/SupgChannel/build_debug/build.sh new file mode 100644 index 00000000..e6624bac --- /dev/null +++ b/FluidMechanics/NavierStokes/SupgChannel/build_debug/build.sh @@ -0,0 +1,2 @@ +#ccc && cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all +cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all diff --git a/FluidMechanics/NavierStokes/TaylorGreen/CMakeLists.txt b/FluidMechanics/NavierStokes/TaylorGreen/CMakeLists.txt new file mode 100644 index 00000000..a22b61ee --- /dev/null +++ b/FluidMechanics/NavierStokes/TaylorGreen/CMakeLists.txt @@ -0,0 +1,35 @@ +# 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 C) +enable_language(Fortran OPTIONAL) +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 +# ---------------------- +#add_subdirectory(C) +if (CMAKE_Fortran_COMPILER) + add_subdirectory(Fortran) +endif() diff --git a/FluidMechanics/NavierStokes/TaylorGreen/Fortran/CMakeLists.txt b/FluidMechanics/NavierStokes/TaylorGreen/Fortran/CMakeLists.txt new file mode 100644 index 00000000..dced1bcc --- /dev/null +++ b/FluidMechanics/NavierStokes/TaylorGreen/Fortran/CMakeLists.txt @@ -0,0 +1,60 @@ + +# Add example executable +add_executable(TaylorGreen src/TaylorGreenExample.f90) + +# Turn on Fortran preprocessing (#include directives) +if (MSVC) + set(PROC_OPT "/fpp") +else() + set(PROC_OPT "-cpp") +endif() + +# in debug mode, add flag that make Floating point exceptions fatal +set(OPT "") +if (FALSE) + if(CMAKE_BUILD_TYPE MATCHES DEBUG) + set(OPT "-ffpe-trap=invalid,zero,underflow,overflow,denormal") # GCC: make floating point exceptions fatal + endif() +endif() + +target_compile_options(TaylorGreen PRIVATE ${PROC_OPT} ${OPT} "-fbacktrace") + +# Link to opencmiss +# ----------------- +# +# This simply uses the opencmiss target created by OC_INIT() above. +# +# Alternatively, you can also directly invoke 'find_package(Iron )' 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 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(TaylorGreen PRIVATE opencmiss) + +# Add a simple test that runs the executable +add_test(NAME test_TaylorGreen COMMAND TaylorGreen) +add_opencmiss_environment(test_TaylorGreen) + +################### +# 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. +# diff --git a/FluidMechanics/NavierStokes/TaylorGreen/src/TaylorGreenExample.f90 b/FluidMechanics/NavierStokes/TaylorGreen/Fortran/src/TaylorGreenExample.f90 similarity index 100% rename from FluidMechanics/NavierStokes/TaylorGreen/src/TaylorGreenExample.f90 rename to FluidMechanics/NavierStokes/TaylorGreen/Fortran/src/TaylorGreenExample.f90 diff --git a/FluidMechanics/NavierStokes/TaylorGreen/OpenCMISS.cmake b/FluidMechanics/NavierStokes/TaylorGreen/OpenCMISS.cmake new file mode 100644 index 00000000..3d6cf515 --- /dev/null +++ b/FluidMechanics/NavierStokes/TaylorGreen/OpenCMISS.cmake @@ -0,0 +1,95 @@ +########################### +# *DO NOT CHANGE THIS FILE* +########################### +# +# Prepares the use of OpenCMISS by scanning at various path locations for OpenCMISS (SDK) installations. +# +# Search order: +# - OPENCMISS_INSTALL_DIR variable +# - OPENCMISS_INSTALL_DIR environment variable +# - OPENCMISS_SDK_DIR variable +# - OPENCMISS_SDK_DIR environment variable +# - [Windows only] The Registry is searched additionally for installed SDKs. +# +# If found +# - Includes the toolchain config script of the found opencmiss installation to enable toolchain selection logic (non-windows) + +# Convenience: The OPENCMISS_INSTALL_DIR may also be defined in the environment and various other places +if (DEFINED OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using specified installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The specified OPENCMISS_INSTALL_DIR '${OPENCMISS_INSTALL_DIR}' does not exist. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_INSTALL_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_INSTALL_DIR}" OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using environment installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The environment variable OPENCMISS_INSTALL_DIR='${OPENCMISS_INSTALL_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if (NOT OPENCMISS_INSTALL_DIR AND DEFINED OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The specified OPENCMISS_SDK_DIR '${OPENCMISS_SDK_DIR}' does not exist. Skipping.") + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_SDK_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_SDK_DIR}" OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using environment SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The environment variable OPENCMISS_SDK_DIR='${OPENCMISS_SDK_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_SDK_DIR) + endif() +endif() +# On windows: check the registry for installed OpenCMISS SDKs +if(NOT OPENCMISS_INSTALL_DIR AND WIN32) + foreach(ROOT HKEY_CURRENT_USER HKEY_LOCAL_MACHINE) + foreach(PACKAGE OpenCMISSUserSDK OpenCMISSDeveloperSDK) + set(_REG_KEY "[${ROOT}\\Software\\Auckland Bioengineering Institute\\${PACKAGE}]") + get_filename_component(OPENCMISS_INSTALL_DIR "${_REG_KEY}" ABSOLUTE) + #message(STATUS "Trying registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Found ${PACKAGE} in Windows registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + break() + else() + unset(OPENCMISS_INSTALL_DIR) + endif() + endforeach() + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + break() + endif() + endforeach() +endif() + +if(OPENCMISS_INSTALL_DIR) + message(STATUS "OPENCMISS_INSTALL_DIR=${OPENCMISS_INSTALL_DIR}") + # Use the OpenCMISS scripts to also allow choosing a separate toolchain + # This file is located at the opencmiss installation rather than the local example + # as it avoids file replication and makes maintenance much easier + if (TOOLCHAIN) + set(_OCTC ${OPENCMISS_INSTALL_DIR}/cmake/OCToolchainCompilers.cmake) + if (EXISTS "${_OCTC}") + include(${_OCTC}) + else() + message(WARNING "TOOLCHAIN specified but OpenCMISS config script could not be found at ${_OCTC}. Trying CMake defaults.") + endif() + unset(_OCTC) + endif() + set(OpenCMISS_DIR "${OPENCMISS_INSTALL_DIR}" CACHE PATH "Path to the found OpenCMISS (SDK) installation") +else() + message(WARNING "No OpenCMISS (SDK) installation directory detected. Using default system environment.") +endif() + \ No newline at end of file diff --git a/FluidMechanics/NavierStokes/TaylorGreen/build_debug/build.sh b/FluidMechanics/NavierStokes/TaylorGreen/build_debug/build.sh new file mode 100644 index 00000000..e6624bac --- /dev/null +++ b/FluidMechanics/NavierStokes/TaylorGreen/build_debug/build.sh @@ -0,0 +1,2 @@ +#ccc && cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all +cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all diff --git a/FluidMechanics/NavierStokes/temp_tests/DynamicTest_theta_0.5/CMakeLists.txt b/FluidMechanics/NavierStokes/temp_tests/DynamicTest_theta_0.5/CMakeLists.txt new file mode 100644 index 00000000..a22b61ee --- /dev/null +++ b/FluidMechanics/NavierStokes/temp_tests/DynamicTest_theta_0.5/CMakeLists.txt @@ -0,0 +1,35 @@ +# 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 C) +enable_language(Fortran OPTIONAL) +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 +# ---------------------- +#add_subdirectory(C) +if (CMAKE_Fortran_COMPILER) + add_subdirectory(Fortran) +endif() diff --git a/FluidMechanics/NavierStokes/temp_tests/DynamicTest_theta_0.5/Fortran/CMakeLists.txt b/FluidMechanics/NavierStokes/temp_tests/DynamicTest_theta_0.5/Fortran/CMakeLists.txt new file mode 100644 index 00000000..f9e6a8bb --- /dev/null +++ b/FluidMechanics/NavierStokes/temp_tests/DynamicTest_theta_0.5/Fortran/CMakeLists.txt @@ -0,0 +1,60 @@ + +# Add example executable +add_executable(DynamicTest_theta_0.5 src/DynamicTest_theta_0.5Example.f90) + +# Turn on Fortran preprocessing (#include directives) +if (MSVC) + set(PROC_OPT "/fpp") +else() + set(PROC_OPT "-cpp") +endif() + +# in debug mode, add flag that make Floating point exceptions fatal +set(OPT "") +if (FALSE) + if(CMAKE_BUILD_TYPE MATCHES DEBUG) + set(OPT "-ffpe-trap=invalid,zero,underflow,overflow,denormal") # GCC: make floating point exceptions fatal + endif() +endif() + +target_compile_options(DynamicTest_theta_0.5 PRIVATE ${PROC_OPT} ${OPT} "-fbacktrace") + +# Link to opencmiss +# ----------------- +# +# This simply uses the opencmiss target created by OC_INIT() above. +# +# Alternatively, you can also directly invoke 'find_package(Iron )' 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 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(DynamicTest_theta_0.5 PRIVATE opencmiss) + +# Add a simple test that runs the executable +add_test(NAME test_DynamicTest_theta_0.5 COMMAND DynamicTest_theta_0.5) +add_opencmiss_environment(test_DynamicTest_theta_0.5) + +################### +# 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. +# diff --git a/FluidMechanics/NavierStokes/temp_tests/DynamicTest_theta_0.5/src/DynamicTest_theta_0.5Example.f90 b/FluidMechanics/NavierStokes/temp_tests/DynamicTest_theta_0.5/Fortran/src/DynamicTest_theta_0.5Example.f90 similarity index 100% rename from FluidMechanics/NavierStokes/temp_tests/DynamicTest_theta_0.5/src/DynamicTest_theta_0.5Example.f90 rename to FluidMechanics/NavierStokes/temp_tests/DynamicTest_theta_0.5/Fortran/src/DynamicTest_theta_0.5Example.f90 diff --git a/FluidMechanics/NavierStokes/temp_tests/DynamicTest_theta_0.5/OpenCMISS.cmake b/FluidMechanics/NavierStokes/temp_tests/DynamicTest_theta_0.5/OpenCMISS.cmake new file mode 100644 index 00000000..3d6cf515 --- /dev/null +++ b/FluidMechanics/NavierStokes/temp_tests/DynamicTest_theta_0.5/OpenCMISS.cmake @@ -0,0 +1,95 @@ +########################### +# *DO NOT CHANGE THIS FILE* +########################### +# +# Prepares the use of OpenCMISS by scanning at various path locations for OpenCMISS (SDK) installations. +# +# Search order: +# - OPENCMISS_INSTALL_DIR variable +# - OPENCMISS_INSTALL_DIR environment variable +# - OPENCMISS_SDK_DIR variable +# - OPENCMISS_SDK_DIR environment variable +# - [Windows only] The Registry is searched additionally for installed SDKs. +# +# If found +# - Includes the toolchain config script of the found opencmiss installation to enable toolchain selection logic (non-windows) + +# Convenience: The OPENCMISS_INSTALL_DIR may also be defined in the environment and various other places +if (DEFINED OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using specified installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The specified OPENCMISS_INSTALL_DIR '${OPENCMISS_INSTALL_DIR}' does not exist. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_INSTALL_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_INSTALL_DIR}" OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using environment installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The environment variable OPENCMISS_INSTALL_DIR='${OPENCMISS_INSTALL_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if (NOT OPENCMISS_INSTALL_DIR AND DEFINED OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The specified OPENCMISS_SDK_DIR '${OPENCMISS_SDK_DIR}' does not exist. Skipping.") + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_SDK_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_SDK_DIR}" OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using environment SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The environment variable OPENCMISS_SDK_DIR='${OPENCMISS_SDK_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_SDK_DIR) + endif() +endif() +# On windows: check the registry for installed OpenCMISS SDKs +if(NOT OPENCMISS_INSTALL_DIR AND WIN32) + foreach(ROOT HKEY_CURRENT_USER HKEY_LOCAL_MACHINE) + foreach(PACKAGE OpenCMISSUserSDK OpenCMISSDeveloperSDK) + set(_REG_KEY "[${ROOT}\\Software\\Auckland Bioengineering Institute\\${PACKAGE}]") + get_filename_component(OPENCMISS_INSTALL_DIR "${_REG_KEY}" ABSOLUTE) + #message(STATUS "Trying registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Found ${PACKAGE} in Windows registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + break() + else() + unset(OPENCMISS_INSTALL_DIR) + endif() + endforeach() + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + break() + endif() + endforeach() +endif() + +if(OPENCMISS_INSTALL_DIR) + message(STATUS "OPENCMISS_INSTALL_DIR=${OPENCMISS_INSTALL_DIR}") + # Use the OpenCMISS scripts to also allow choosing a separate toolchain + # This file is located at the opencmiss installation rather than the local example + # as it avoids file replication and makes maintenance much easier + if (TOOLCHAIN) + set(_OCTC ${OPENCMISS_INSTALL_DIR}/cmake/OCToolchainCompilers.cmake) + if (EXISTS "${_OCTC}") + include(${_OCTC}) + else() + message(WARNING "TOOLCHAIN specified but OpenCMISS config script could not be found at ${_OCTC}. Trying CMake defaults.") + endif() + unset(_OCTC) + endif() + set(OpenCMISS_DIR "${OPENCMISS_INSTALL_DIR}" CACHE PATH "Path to the found OpenCMISS (SDK) installation") +else() + message(WARNING "No OpenCMISS (SDK) installation directory detected. Using default system environment.") +endif() + \ No newline at end of file diff --git a/FluidMechanics/NavierStokes/temp_tests/DynamicTest_theta_0.5/build_debug/build.sh b/FluidMechanics/NavierStokes/temp_tests/DynamicTest_theta_0.5/build_debug/build.sh new file mode 100644 index 00000000..e6624bac --- /dev/null +++ b/FluidMechanics/NavierStokes/temp_tests/DynamicTest_theta_0.5/build_debug/build.sh @@ -0,0 +1,2 @@ +#ccc && cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all +cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all diff --git a/FluidMechanics/NavierStokes/temp_tests/DynamicTest_theta_1.0/CMakeLists.txt b/FluidMechanics/NavierStokes/temp_tests/DynamicTest_theta_1.0/CMakeLists.txt new file mode 100644 index 00000000..a22b61ee --- /dev/null +++ b/FluidMechanics/NavierStokes/temp_tests/DynamicTest_theta_1.0/CMakeLists.txt @@ -0,0 +1,35 @@ +# 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 C) +enable_language(Fortran OPTIONAL) +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 +# ---------------------- +#add_subdirectory(C) +if (CMAKE_Fortran_COMPILER) + add_subdirectory(Fortran) +endif() diff --git a/FluidMechanics/NavierStokes/temp_tests/DynamicTest_theta_1.0/Fortran/CMakeLists.txt b/FluidMechanics/NavierStokes/temp_tests/DynamicTest_theta_1.0/Fortran/CMakeLists.txt new file mode 100644 index 00000000..22914ad4 --- /dev/null +++ b/FluidMechanics/NavierStokes/temp_tests/DynamicTest_theta_1.0/Fortran/CMakeLists.txt @@ -0,0 +1,60 @@ + +# Add example executable +add_executable(DynamicTest_theta_1.0 src/DynamicTest_theta_1.0Example.f90) + +# Turn on Fortran preprocessing (#include directives) +if (MSVC) + set(PROC_OPT "/fpp") +else() + set(PROC_OPT "-cpp") +endif() + +# in debug mode, add flag that make Floating point exceptions fatal +set(OPT "") +if (FALSE) + if(CMAKE_BUILD_TYPE MATCHES DEBUG) + set(OPT "-ffpe-trap=invalid,zero,underflow,overflow,denormal") # GCC: make floating point exceptions fatal + endif() +endif() + +target_compile_options(DynamicTest_theta_1.0 PRIVATE ${PROC_OPT} ${OPT} "-fbacktrace") + +# Link to opencmiss +# ----------------- +# +# This simply uses the opencmiss target created by OC_INIT() above. +# +# Alternatively, you can also directly invoke 'find_package(Iron )' 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 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(DynamicTest_theta_1.0 PRIVATE opencmiss) + +# Add a simple test that runs the executable +add_test(NAME test_DynamicTest_theta_1.0 COMMAND DynamicTest_theta_1.0) +add_opencmiss_environment(test_DynamicTest_theta_1.0) + +################### +# 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. +# diff --git a/FluidMechanics/NavierStokes/temp_tests/DynamicTest_theta_1.0/src/DynamicTest_theta_1.0Example.f90 b/FluidMechanics/NavierStokes/temp_tests/DynamicTest_theta_1.0/Fortran/src/DynamicTest_theta_1.0Example.f90 similarity index 100% rename from FluidMechanics/NavierStokes/temp_tests/DynamicTest_theta_1.0/src/DynamicTest_theta_1.0Example.f90 rename to FluidMechanics/NavierStokes/temp_tests/DynamicTest_theta_1.0/Fortran/src/DynamicTest_theta_1.0Example.f90 diff --git a/FluidMechanics/NavierStokes/temp_tests/DynamicTest_theta_1.0/OpenCMISS.cmake b/FluidMechanics/NavierStokes/temp_tests/DynamicTest_theta_1.0/OpenCMISS.cmake new file mode 100644 index 00000000..3d6cf515 --- /dev/null +++ b/FluidMechanics/NavierStokes/temp_tests/DynamicTest_theta_1.0/OpenCMISS.cmake @@ -0,0 +1,95 @@ +########################### +# *DO NOT CHANGE THIS FILE* +########################### +# +# Prepares the use of OpenCMISS by scanning at various path locations for OpenCMISS (SDK) installations. +# +# Search order: +# - OPENCMISS_INSTALL_DIR variable +# - OPENCMISS_INSTALL_DIR environment variable +# - OPENCMISS_SDK_DIR variable +# - OPENCMISS_SDK_DIR environment variable +# - [Windows only] The Registry is searched additionally for installed SDKs. +# +# If found +# - Includes the toolchain config script of the found opencmiss installation to enable toolchain selection logic (non-windows) + +# Convenience: The OPENCMISS_INSTALL_DIR may also be defined in the environment and various other places +if (DEFINED OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using specified installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The specified OPENCMISS_INSTALL_DIR '${OPENCMISS_INSTALL_DIR}' does not exist. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_INSTALL_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_INSTALL_DIR}" OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using environment installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The environment variable OPENCMISS_INSTALL_DIR='${OPENCMISS_INSTALL_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if (NOT OPENCMISS_INSTALL_DIR AND DEFINED OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The specified OPENCMISS_SDK_DIR '${OPENCMISS_SDK_DIR}' does not exist. Skipping.") + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_SDK_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_SDK_DIR}" OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using environment SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The environment variable OPENCMISS_SDK_DIR='${OPENCMISS_SDK_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_SDK_DIR) + endif() +endif() +# On windows: check the registry for installed OpenCMISS SDKs +if(NOT OPENCMISS_INSTALL_DIR AND WIN32) + foreach(ROOT HKEY_CURRENT_USER HKEY_LOCAL_MACHINE) + foreach(PACKAGE OpenCMISSUserSDK OpenCMISSDeveloperSDK) + set(_REG_KEY "[${ROOT}\\Software\\Auckland Bioengineering Institute\\${PACKAGE}]") + get_filename_component(OPENCMISS_INSTALL_DIR "${_REG_KEY}" ABSOLUTE) + #message(STATUS "Trying registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Found ${PACKAGE} in Windows registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + break() + else() + unset(OPENCMISS_INSTALL_DIR) + endif() + endforeach() + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + break() + endif() + endforeach() +endif() + +if(OPENCMISS_INSTALL_DIR) + message(STATUS "OPENCMISS_INSTALL_DIR=${OPENCMISS_INSTALL_DIR}") + # Use the OpenCMISS scripts to also allow choosing a separate toolchain + # This file is located at the opencmiss installation rather than the local example + # as it avoids file replication and makes maintenance much easier + if (TOOLCHAIN) + set(_OCTC ${OPENCMISS_INSTALL_DIR}/cmake/OCToolchainCompilers.cmake) + if (EXISTS "${_OCTC}") + include(${_OCTC}) + else() + message(WARNING "TOOLCHAIN specified but OpenCMISS config script could not be found at ${_OCTC}. Trying CMake defaults.") + endif() + unset(_OCTC) + endif() + set(OpenCMISS_DIR "${OPENCMISS_INSTALL_DIR}" CACHE PATH "Path to the found OpenCMISS (SDK) installation") +else() + message(WARNING "No OpenCMISS (SDK) installation directory detected. Using default system environment.") +endif() + \ No newline at end of file diff --git a/FluidMechanics/NavierStokes/temp_tests/DynamicTest_theta_1.0/build_debug/build.sh b/FluidMechanics/NavierStokes/temp_tests/DynamicTest_theta_1.0/build_debug/build.sh new file mode 100644 index 00000000..e6624bac --- /dev/null +++ b/FluidMechanics/NavierStokes/temp_tests/DynamicTest_theta_1.0/build_debug/build.sh @@ -0,0 +1,2 @@ +#ccc && cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all +cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all diff --git a/FluidMechanics/Poiseuille/Static/CMakeLists.txt b/FluidMechanics/Poiseuille/Static/CMakeLists.txt new file mode 100644 index 00000000..a22b61ee --- /dev/null +++ b/FluidMechanics/Poiseuille/Static/CMakeLists.txt @@ -0,0 +1,35 @@ +# 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 C) +enable_language(Fortran OPTIONAL) +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 +# ---------------------- +#add_subdirectory(C) +if (CMAKE_Fortran_COMPILER) + add_subdirectory(Fortran) +endif() diff --git a/FluidMechanics/Poiseuille/Static/Fortran/CMakeLists.txt b/FluidMechanics/Poiseuille/Static/Fortran/CMakeLists.txt new file mode 100644 index 00000000..d1b76f7d --- /dev/null +++ b/FluidMechanics/Poiseuille/Static/Fortran/CMakeLists.txt @@ -0,0 +1,60 @@ + +# Add example executable +add_executable(Static src/StaticExample.f90) + +# Turn on Fortran preprocessing (#include directives) +if (MSVC) + set(PROC_OPT "/fpp") +else() + set(PROC_OPT "-cpp") +endif() + +# in debug mode, add flag that make Floating point exceptions fatal +set(OPT "") +if (FALSE) + if(CMAKE_BUILD_TYPE MATCHES DEBUG) + set(OPT "-ffpe-trap=invalid,zero,underflow,overflow,denormal") # GCC: make floating point exceptions fatal + endif() +endif() + +target_compile_options(Static PRIVATE ${PROC_OPT} ${OPT} "-fbacktrace") + +# Link to opencmiss +# ----------------- +# +# This simply uses the opencmiss target created by OC_INIT() above. +# +# Alternatively, you can also directly invoke 'find_package(Iron )' 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 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(Static PRIVATE opencmiss) + +# Add a simple test that runs the executable +add_test(NAME test_Static COMMAND Static) +add_opencmiss_environment(test_Static) + +################### +# 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. +# diff --git a/FluidMechanics/Poiseuille/Static/src/StaticExample.f90 b/FluidMechanics/Poiseuille/Static/Fortran/src/StaticExample.f90 similarity index 100% rename from FluidMechanics/Poiseuille/Static/src/StaticExample.f90 rename to FluidMechanics/Poiseuille/Static/Fortran/src/StaticExample.f90 diff --git a/FluidMechanics/Poiseuille/Static/OpenCMISS.cmake b/FluidMechanics/Poiseuille/Static/OpenCMISS.cmake new file mode 100644 index 00000000..3d6cf515 --- /dev/null +++ b/FluidMechanics/Poiseuille/Static/OpenCMISS.cmake @@ -0,0 +1,95 @@ +########################### +# *DO NOT CHANGE THIS FILE* +########################### +# +# Prepares the use of OpenCMISS by scanning at various path locations for OpenCMISS (SDK) installations. +# +# Search order: +# - OPENCMISS_INSTALL_DIR variable +# - OPENCMISS_INSTALL_DIR environment variable +# - OPENCMISS_SDK_DIR variable +# - OPENCMISS_SDK_DIR environment variable +# - [Windows only] The Registry is searched additionally for installed SDKs. +# +# If found +# - Includes the toolchain config script of the found opencmiss installation to enable toolchain selection logic (non-windows) + +# Convenience: The OPENCMISS_INSTALL_DIR may also be defined in the environment and various other places +if (DEFINED OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using specified installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The specified OPENCMISS_INSTALL_DIR '${OPENCMISS_INSTALL_DIR}' does not exist. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_INSTALL_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_INSTALL_DIR}" OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using environment installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The environment variable OPENCMISS_INSTALL_DIR='${OPENCMISS_INSTALL_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if (NOT OPENCMISS_INSTALL_DIR AND DEFINED OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The specified OPENCMISS_SDK_DIR '${OPENCMISS_SDK_DIR}' does not exist. Skipping.") + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_SDK_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_SDK_DIR}" OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using environment SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The environment variable OPENCMISS_SDK_DIR='${OPENCMISS_SDK_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_SDK_DIR) + endif() +endif() +# On windows: check the registry for installed OpenCMISS SDKs +if(NOT OPENCMISS_INSTALL_DIR AND WIN32) + foreach(ROOT HKEY_CURRENT_USER HKEY_LOCAL_MACHINE) + foreach(PACKAGE OpenCMISSUserSDK OpenCMISSDeveloperSDK) + set(_REG_KEY "[${ROOT}\\Software\\Auckland Bioengineering Institute\\${PACKAGE}]") + get_filename_component(OPENCMISS_INSTALL_DIR "${_REG_KEY}" ABSOLUTE) + #message(STATUS "Trying registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Found ${PACKAGE} in Windows registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + break() + else() + unset(OPENCMISS_INSTALL_DIR) + endif() + endforeach() + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + break() + endif() + endforeach() +endif() + +if(OPENCMISS_INSTALL_DIR) + message(STATUS "OPENCMISS_INSTALL_DIR=${OPENCMISS_INSTALL_DIR}") + # Use the OpenCMISS scripts to also allow choosing a separate toolchain + # This file is located at the opencmiss installation rather than the local example + # as it avoids file replication and makes maintenance much easier + if (TOOLCHAIN) + set(_OCTC ${OPENCMISS_INSTALL_DIR}/cmake/OCToolchainCompilers.cmake) + if (EXISTS "${_OCTC}") + include(${_OCTC}) + else() + message(WARNING "TOOLCHAIN specified but OpenCMISS config script could not be found at ${_OCTC}. Trying CMake defaults.") + endif() + unset(_OCTC) + endif() + set(OpenCMISS_DIR "${OPENCMISS_INSTALL_DIR}" CACHE PATH "Path to the found OpenCMISS (SDK) installation") +else() + message(WARNING "No OpenCMISS (SDK) installation directory detected. Using default system environment.") +endif() + \ No newline at end of file diff --git a/FluidMechanics/Poiseuille/Static/build_debug/build.sh b/FluidMechanics/Poiseuille/Static/build_debug/build.sh new file mode 100644 index 00000000..e6624bac --- /dev/null +++ b/FluidMechanics/Poiseuille/Static/build_debug/build.sh @@ -0,0 +1,2 @@ +#ccc && cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all +cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all diff --git a/FluidMechanics/SCRATCH/DynamicNavierStokesInParallel/CMakeLists.txt b/FluidMechanics/SCRATCH/DynamicNavierStokesInParallel/CMakeLists.txt new file mode 100644 index 00000000..a22b61ee --- /dev/null +++ b/FluidMechanics/SCRATCH/DynamicNavierStokesInParallel/CMakeLists.txt @@ -0,0 +1,35 @@ +# 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 C) +enable_language(Fortran OPTIONAL) +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 +# ---------------------- +#add_subdirectory(C) +if (CMAKE_Fortran_COMPILER) + add_subdirectory(Fortran) +endif() diff --git a/FluidMechanics/SCRATCH/DynamicNavierStokesInParallel/Fortran/CMakeLists.txt b/FluidMechanics/SCRATCH/DynamicNavierStokesInParallel/Fortran/CMakeLists.txt new file mode 100644 index 00000000..87a40147 --- /dev/null +++ b/FluidMechanics/SCRATCH/DynamicNavierStokesInParallel/Fortran/CMakeLists.txt @@ -0,0 +1,60 @@ + +# Add example executable +add_executable(DynamicNavierStokesInParallel src/DynamicNavierStokesInParallelExample.f90) + +# Turn on Fortran preprocessing (#include directives) +if (MSVC) + set(PROC_OPT "/fpp") +else() + set(PROC_OPT "-cpp") +endif() + +# in debug mode, add flag that make Floating point exceptions fatal +set(OPT "") +if (FALSE) + if(CMAKE_BUILD_TYPE MATCHES DEBUG) + set(OPT "-ffpe-trap=invalid,zero,underflow,overflow,denormal") # GCC: make floating point exceptions fatal + endif() +endif() + +target_compile_options(DynamicNavierStokesInParallel PRIVATE ${PROC_OPT} ${OPT} "-fbacktrace") + +# Link to opencmiss +# ----------------- +# +# This simply uses the opencmiss target created by OC_INIT() above. +# +# Alternatively, you can also directly invoke 'find_package(Iron )' 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 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(DynamicNavierStokesInParallel PRIVATE opencmiss) + +# Add a simple test that runs the executable +add_test(NAME test_DynamicNavierStokesInParallel COMMAND DynamicNavierStokesInParallel) +add_opencmiss_environment(test_DynamicNavierStokesInParallel) + +################### +# 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. +# diff --git a/FluidMechanics/SCRATCH/DynamicNavierStokesInParallel/src/DynamicNavierStokesInParallelExample.f90 b/FluidMechanics/SCRATCH/DynamicNavierStokesInParallel/Fortran/src/DynamicNavierStokesInParallelExample.f90 similarity index 100% rename from FluidMechanics/SCRATCH/DynamicNavierStokesInParallel/src/DynamicNavierStokesInParallelExample.f90 rename to FluidMechanics/SCRATCH/DynamicNavierStokesInParallel/Fortran/src/DynamicNavierStokesInParallelExample.f90 diff --git a/FluidMechanics/SCRATCH/DynamicNavierStokesInParallel/OpenCMISS.cmake b/FluidMechanics/SCRATCH/DynamicNavierStokesInParallel/OpenCMISS.cmake new file mode 100644 index 00000000..3d6cf515 --- /dev/null +++ b/FluidMechanics/SCRATCH/DynamicNavierStokesInParallel/OpenCMISS.cmake @@ -0,0 +1,95 @@ +########################### +# *DO NOT CHANGE THIS FILE* +########################### +# +# Prepares the use of OpenCMISS by scanning at various path locations for OpenCMISS (SDK) installations. +# +# Search order: +# - OPENCMISS_INSTALL_DIR variable +# - OPENCMISS_INSTALL_DIR environment variable +# - OPENCMISS_SDK_DIR variable +# - OPENCMISS_SDK_DIR environment variable +# - [Windows only] The Registry is searched additionally for installed SDKs. +# +# If found +# - Includes the toolchain config script of the found opencmiss installation to enable toolchain selection logic (non-windows) + +# Convenience: The OPENCMISS_INSTALL_DIR may also be defined in the environment and various other places +if (DEFINED OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using specified installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The specified OPENCMISS_INSTALL_DIR '${OPENCMISS_INSTALL_DIR}' does not exist. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_INSTALL_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_INSTALL_DIR}" OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using environment installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The environment variable OPENCMISS_INSTALL_DIR='${OPENCMISS_INSTALL_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if (NOT OPENCMISS_INSTALL_DIR AND DEFINED OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The specified OPENCMISS_SDK_DIR '${OPENCMISS_SDK_DIR}' does not exist. Skipping.") + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_SDK_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_SDK_DIR}" OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using environment SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The environment variable OPENCMISS_SDK_DIR='${OPENCMISS_SDK_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_SDK_DIR) + endif() +endif() +# On windows: check the registry for installed OpenCMISS SDKs +if(NOT OPENCMISS_INSTALL_DIR AND WIN32) + foreach(ROOT HKEY_CURRENT_USER HKEY_LOCAL_MACHINE) + foreach(PACKAGE OpenCMISSUserSDK OpenCMISSDeveloperSDK) + set(_REG_KEY "[${ROOT}\\Software\\Auckland Bioengineering Institute\\${PACKAGE}]") + get_filename_component(OPENCMISS_INSTALL_DIR "${_REG_KEY}" ABSOLUTE) + #message(STATUS "Trying registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Found ${PACKAGE} in Windows registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + break() + else() + unset(OPENCMISS_INSTALL_DIR) + endif() + endforeach() + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + break() + endif() + endforeach() +endif() + +if(OPENCMISS_INSTALL_DIR) + message(STATUS "OPENCMISS_INSTALL_DIR=${OPENCMISS_INSTALL_DIR}") + # Use the OpenCMISS scripts to also allow choosing a separate toolchain + # This file is located at the opencmiss installation rather than the local example + # as it avoids file replication and makes maintenance much easier + if (TOOLCHAIN) + set(_OCTC ${OPENCMISS_INSTALL_DIR}/cmake/OCToolchainCompilers.cmake) + if (EXISTS "${_OCTC}") + include(${_OCTC}) + else() + message(WARNING "TOOLCHAIN specified but OpenCMISS config script could not be found at ${_OCTC}. Trying CMake defaults.") + endif() + unset(_OCTC) + endif() + set(OpenCMISS_DIR "${OPENCMISS_INSTALL_DIR}" CACHE PATH "Path to the found OpenCMISS (SDK) installation") +else() + message(WARNING "No OpenCMISS (SDK) installation directory detected. Using default system environment.") +endif() + \ No newline at end of file diff --git a/FluidMechanics/SCRATCH/DynamicNavierStokesInParallel/build_debug/build.sh b/FluidMechanics/SCRATCH/DynamicNavierStokesInParallel/build_debug/build.sh new file mode 100644 index 00000000..e6624bac --- /dev/null +++ b/FluidMechanics/SCRATCH/DynamicNavierStokesInParallel/build_debug/build.sh @@ -0,0 +1,2 @@ +#ccc && cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all +cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all diff --git a/FluidMechanics/Stokes/42Master/CMakeLists.txt b/FluidMechanics/Stokes/42Master/CMakeLists.txt new file mode 100644 index 00000000..a22b61ee --- /dev/null +++ b/FluidMechanics/Stokes/42Master/CMakeLists.txt @@ -0,0 +1,35 @@ +# 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 C) +enable_language(Fortran OPTIONAL) +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 +# ---------------------- +#add_subdirectory(C) +if (CMAKE_Fortran_COMPILER) + add_subdirectory(Fortran) +endif() diff --git a/FluidMechanics/Stokes/42Master/Fortran/CMakeLists.txt b/FluidMechanics/Stokes/42Master/Fortran/CMakeLists.txt new file mode 100644 index 00000000..20e09803 --- /dev/null +++ b/FluidMechanics/Stokes/42Master/Fortran/CMakeLists.txt @@ -0,0 +1,60 @@ + +# Add example executable +add_executable(42Master src/42MasterExample.f90) + +# Turn on Fortran preprocessing (#include directives) +if (MSVC) + set(PROC_OPT "/fpp") +else() + set(PROC_OPT "-cpp") +endif() + +# in debug mode, add flag that make Floating point exceptions fatal +set(OPT "") +if (FALSE) + if(CMAKE_BUILD_TYPE MATCHES DEBUG) + set(OPT "-ffpe-trap=invalid,zero,underflow,overflow,denormal") # GCC: make floating point exceptions fatal + endif() +endif() + +target_compile_options(42Master PRIVATE ${PROC_OPT} ${OPT} "-fbacktrace") + +# Link to opencmiss +# ----------------- +# +# This simply uses the opencmiss target created by OC_INIT() above. +# +# Alternatively, you can also directly invoke 'find_package(Iron )' 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 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(42Master PRIVATE opencmiss) + +# Add a simple test that runs the executable +add_test(NAME test_42Master COMMAND 42Master) +add_opencmiss_environment(test_42Master) + +################### +# 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. +# diff --git a/FluidMechanics/Stokes/42Master/src/42MasterExample.f90 b/FluidMechanics/Stokes/42Master/Fortran/src/42MasterExample.f90 similarity index 100% rename from FluidMechanics/Stokes/42Master/src/42MasterExample.f90 rename to FluidMechanics/Stokes/42Master/Fortran/src/42MasterExample.f90 diff --git a/FluidMechanics/Stokes/42Master/OpenCMISS.cmake b/FluidMechanics/Stokes/42Master/OpenCMISS.cmake new file mode 100644 index 00000000..3d6cf515 --- /dev/null +++ b/FluidMechanics/Stokes/42Master/OpenCMISS.cmake @@ -0,0 +1,95 @@ +########################### +# *DO NOT CHANGE THIS FILE* +########################### +# +# Prepares the use of OpenCMISS by scanning at various path locations for OpenCMISS (SDK) installations. +# +# Search order: +# - OPENCMISS_INSTALL_DIR variable +# - OPENCMISS_INSTALL_DIR environment variable +# - OPENCMISS_SDK_DIR variable +# - OPENCMISS_SDK_DIR environment variable +# - [Windows only] The Registry is searched additionally for installed SDKs. +# +# If found +# - Includes the toolchain config script of the found opencmiss installation to enable toolchain selection logic (non-windows) + +# Convenience: The OPENCMISS_INSTALL_DIR may also be defined in the environment and various other places +if (DEFINED OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using specified installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The specified OPENCMISS_INSTALL_DIR '${OPENCMISS_INSTALL_DIR}' does not exist. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_INSTALL_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_INSTALL_DIR}" OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using environment installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The environment variable OPENCMISS_INSTALL_DIR='${OPENCMISS_INSTALL_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if (NOT OPENCMISS_INSTALL_DIR AND DEFINED OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The specified OPENCMISS_SDK_DIR '${OPENCMISS_SDK_DIR}' does not exist. Skipping.") + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_SDK_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_SDK_DIR}" OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using environment SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The environment variable OPENCMISS_SDK_DIR='${OPENCMISS_SDK_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_SDK_DIR) + endif() +endif() +# On windows: check the registry for installed OpenCMISS SDKs +if(NOT OPENCMISS_INSTALL_DIR AND WIN32) + foreach(ROOT HKEY_CURRENT_USER HKEY_LOCAL_MACHINE) + foreach(PACKAGE OpenCMISSUserSDK OpenCMISSDeveloperSDK) + set(_REG_KEY "[${ROOT}\\Software\\Auckland Bioengineering Institute\\${PACKAGE}]") + get_filename_component(OPENCMISS_INSTALL_DIR "${_REG_KEY}" ABSOLUTE) + #message(STATUS "Trying registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Found ${PACKAGE} in Windows registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + break() + else() + unset(OPENCMISS_INSTALL_DIR) + endif() + endforeach() + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + break() + endif() + endforeach() +endif() + +if(OPENCMISS_INSTALL_DIR) + message(STATUS "OPENCMISS_INSTALL_DIR=${OPENCMISS_INSTALL_DIR}") + # Use the OpenCMISS scripts to also allow choosing a separate toolchain + # This file is located at the opencmiss installation rather than the local example + # as it avoids file replication and makes maintenance much easier + if (TOOLCHAIN) + set(_OCTC ${OPENCMISS_INSTALL_DIR}/cmake/OCToolchainCompilers.cmake) + if (EXISTS "${_OCTC}") + include(${_OCTC}) + else() + message(WARNING "TOOLCHAIN specified but OpenCMISS config script could not be found at ${_OCTC}. Trying CMake defaults.") + endif() + unset(_OCTC) + endif() + set(OpenCMISS_DIR "${OPENCMISS_INSTALL_DIR}" CACHE PATH "Path to the found OpenCMISS (SDK) installation") +else() + message(WARNING "No OpenCMISS (SDK) installation directory detected. Using default system environment.") +endif() + \ No newline at end of file diff --git a/FluidMechanics/Stokes/42Master/build_debug/build.sh b/FluidMechanics/Stokes/42Master/build_debug/build.sh new file mode 100644 index 00000000..e6624bac --- /dev/null +++ b/FluidMechanics/Stokes/42Master/build_debug/build.sh @@ -0,0 +1,2 @@ +#ccc && cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all +cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all diff --git a/FluidMechanics/Stokes/RoutineCheck/ALE/CMakeLists.txt b/FluidMechanics/Stokes/RoutineCheck/ALE/CMakeLists.txt new file mode 100644 index 00000000..a22b61ee --- /dev/null +++ b/FluidMechanics/Stokes/RoutineCheck/ALE/CMakeLists.txt @@ -0,0 +1,35 @@ +# 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 C) +enable_language(Fortran OPTIONAL) +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 +# ---------------------- +#add_subdirectory(C) +if (CMAKE_Fortran_COMPILER) + add_subdirectory(Fortran) +endif() diff --git a/FluidMechanics/Stokes/RoutineCheck/ALE/Fortran/CMakeLists.txt b/FluidMechanics/Stokes/RoutineCheck/ALE/Fortran/CMakeLists.txt new file mode 100644 index 00000000..80318461 --- /dev/null +++ b/FluidMechanics/Stokes/RoutineCheck/ALE/Fortran/CMakeLists.txt @@ -0,0 +1,60 @@ + +# Add example executable +add_executable(ALE src/ALEExample.f90) + +# Turn on Fortran preprocessing (#include directives) +if (MSVC) + set(PROC_OPT "/fpp") +else() + set(PROC_OPT "-cpp") +endif() + +# in debug mode, add flag that make Floating point exceptions fatal +set(OPT "") +if (FALSE) + if(CMAKE_BUILD_TYPE MATCHES DEBUG) + set(OPT "-ffpe-trap=invalid,zero,underflow,overflow,denormal") # GCC: make floating point exceptions fatal + endif() +endif() + +target_compile_options(ALE PRIVATE ${PROC_OPT} ${OPT} "-fbacktrace") + +# Link to opencmiss +# ----------------- +# +# This simply uses the opencmiss target created by OC_INIT() above. +# +# Alternatively, you can also directly invoke 'find_package(Iron )' 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 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(ALE PRIVATE opencmiss) + +# Add a simple test that runs the executable +add_test(NAME test_ALE COMMAND ALE) +add_opencmiss_environment(test_ALE) + +################### +# 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. +# diff --git a/FluidMechanics/Stokes/RoutineCheck/ALE/src/ALEExample.f90 b/FluidMechanics/Stokes/RoutineCheck/ALE/Fortran/src/ALEExample.f90 similarity index 100% rename from FluidMechanics/Stokes/RoutineCheck/ALE/src/ALEExample.f90 rename to FluidMechanics/Stokes/RoutineCheck/ALE/Fortran/src/ALEExample.f90 diff --git a/FluidMechanics/Stokes/RoutineCheck/ALE/OpenCMISS.cmake b/FluidMechanics/Stokes/RoutineCheck/ALE/OpenCMISS.cmake new file mode 100644 index 00000000..3d6cf515 --- /dev/null +++ b/FluidMechanics/Stokes/RoutineCheck/ALE/OpenCMISS.cmake @@ -0,0 +1,95 @@ +########################### +# *DO NOT CHANGE THIS FILE* +########################### +# +# Prepares the use of OpenCMISS by scanning at various path locations for OpenCMISS (SDK) installations. +# +# Search order: +# - OPENCMISS_INSTALL_DIR variable +# - OPENCMISS_INSTALL_DIR environment variable +# - OPENCMISS_SDK_DIR variable +# - OPENCMISS_SDK_DIR environment variable +# - [Windows only] The Registry is searched additionally for installed SDKs. +# +# If found +# - Includes the toolchain config script of the found opencmiss installation to enable toolchain selection logic (non-windows) + +# Convenience: The OPENCMISS_INSTALL_DIR may also be defined in the environment and various other places +if (DEFINED OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using specified installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The specified OPENCMISS_INSTALL_DIR '${OPENCMISS_INSTALL_DIR}' does not exist. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_INSTALL_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_INSTALL_DIR}" OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using environment installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The environment variable OPENCMISS_INSTALL_DIR='${OPENCMISS_INSTALL_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if (NOT OPENCMISS_INSTALL_DIR AND DEFINED OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The specified OPENCMISS_SDK_DIR '${OPENCMISS_SDK_DIR}' does not exist. Skipping.") + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_SDK_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_SDK_DIR}" OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using environment SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The environment variable OPENCMISS_SDK_DIR='${OPENCMISS_SDK_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_SDK_DIR) + endif() +endif() +# On windows: check the registry for installed OpenCMISS SDKs +if(NOT OPENCMISS_INSTALL_DIR AND WIN32) + foreach(ROOT HKEY_CURRENT_USER HKEY_LOCAL_MACHINE) + foreach(PACKAGE OpenCMISSUserSDK OpenCMISSDeveloperSDK) + set(_REG_KEY "[${ROOT}\\Software\\Auckland Bioengineering Institute\\${PACKAGE}]") + get_filename_component(OPENCMISS_INSTALL_DIR "${_REG_KEY}" ABSOLUTE) + #message(STATUS "Trying registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Found ${PACKAGE} in Windows registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + break() + else() + unset(OPENCMISS_INSTALL_DIR) + endif() + endforeach() + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + break() + endif() + endforeach() +endif() + +if(OPENCMISS_INSTALL_DIR) + message(STATUS "OPENCMISS_INSTALL_DIR=${OPENCMISS_INSTALL_DIR}") + # Use the OpenCMISS scripts to also allow choosing a separate toolchain + # This file is located at the opencmiss installation rather than the local example + # as it avoids file replication and makes maintenance much easier + if (TOOLCHAIN) + set(_OCTC ${OPENCMISS_INSTALL_DIR}/cmake/OCToolchainCompilers.cmake) + if (EXISTS "${_OCTC}") + include(${_OCTC}) + else() + message(WARNING "TOOLCHAIN specified but OpenCMISS config script could not be found at ${_OCTC}. Trying CMake defaults.") + endif() + unset(_OCTC) + endif() + set(OpenCMISS_DIR "${OPENCMISS_INSTALL_DIR}" CACHE PATH "Path to the found OpenCMISS (SDK) installation") +else() + message(WARNING "No OpenCMISS (SDK) installation directory detected. Using default system environment.") +endif() + \ No newline at end of file diff --git a/FluidMechanics/Stokes/RoutineCheck/ALE/build_debug/build.sh b/FluidMechanics/Stokes/RoutineCheck/ALE/build_debug/build.sh new file mode 100644 index 00000000..e6624bac --- /dev/null +++ b/FluidMechanics/Stokes/RoutineCheck/ALE/build_debug/build.sh @@ -0,0 +1,2 @@ +#ccc && cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all +cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all diff --git a/FluidMechanics/Stokes/RoutineCheck/Dynamic/CMakeLists.txt b/FluidMechanics/Stokes/RoutineCheck/Dynamic/CMakeLists.txt new file mode 100644 index 00000000..a22b61ee --- /dev/null +++ b/FluidMechanics/Stokes/RoutineCheck/Dynamic/CMakeLists.txt @@ -0,0 +1,35 @@ +# 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 C) +enable_language(Fortran OPTIONAL) +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 +# ---------------------- +#add_subdirectory(C) +if (CMAKE_Fortran_COMPILER) + add_subdirectory(Fortran) +endif() diff --git a/FluidMechanics/Stokes/RoutineCheck/Dynamic/Fortran/CMakeLists.txt b/FluidMechanics/Stokes/RoutineCheck/Dynamic/Fortran/CMakeLists.txt new file mode 100644 index 00000000..b0d7f800 --- /dev/null +++ b/FluidMechanics/Stokes/RoutineCheck/Dynamic/Fortran/CMakeLists.txt @@ -0,0 +1,60 @@ + +# Add example executable +add_executable(Dynamic src/DynamicExample.f90) + +# Turn on Fortran preprocessing (#include directives) +if (MSVC) + set(PROC_OPT "/fpp") +else() + set(PROC_OPT "-cpp") +endif() + +# in debug mode, add flag that make Floating point exceptions fatal +set(OPT "") +if (FALSE) + if(CMAKE_BUILD_TYPE MATCHES DEBUG) + set(OPT "-ffpe-trap=invalid,zero,underflow,overflow,denormal") # GCC: make floating point exceptions fatal + endif() +endif() + +target_compile_options(Dynamic PRIVATE ${PROC_OPT} ${OPT} "-fbacktrace") + +# Link to opencmiss +# ----------------- +# +# This simply uses the opencmiss target created by OC_INIT() above. +# +# Alternatively, you can also directly invoke 'find_package(Iron )' 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 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(Dynamic PRIVATE opencmiss) + +# Add a simple test that runs the executable +add_test(NAME test_Dynamic COMMAND Dynamic) +add_opencmiss_environment(test_Dynamic) + +################### +# 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. +# diff --git a/FluidMechanics/Stokes/RoutineCheck/Dynamic/src/DynamicExample.f90 b/FluidMechanics/Stokes/RoutineCheck/Dynamic/Fortran/src/DynamicExample.f90 similarity index 100% rename from FluidMechanics/Stokes/RoutineCheck/Dynamic/src/DynamicExample.f90 rename to FluidMechanics/Stokes/RoutineCheck/Dynamic/Fortran/src/DynamicExample.f90 diff --git a/FluidMechanics/Stokes/RoutineCheck/Dynamic/OpenCMISS.cmake b/FluidMechanics/Stokes/RoutineCheck/Dynamic/OpenCMISS.cmake new file mode 100644 index 00000000..3d6cf515 --- /dev/null +++ b/FluidMechanics/Stokes/RoutineCheck/Dynamic/OpenCMISS.cmake @@ -0,0 +1,95 @@ +########################### +# *DO NOT CHANGE THIS FILE* +########################### +# +# Prepares the use of OpenCMISS by scanning at various path locations for OpenCMISS (SDK) installations. +# +# Search order: +# - OPENCMISS_INSTALL_DIR variable +# - OPENCMISS_INSTALL_DIR environment variable +# - OPENCMISS_SDK_DIR variable +# - OPENCMISS_SDK_DIR environment variable +# - [Windows only] The Registry is searched additionally for installed SDKs. +# +# If found +# - Includes the toolchain config script of the found opencmiss installation to enable toolchain selection logic (non-windows) + +# Convenience: The OPENCMISS_INSTALL_DIR may also be defined in the environment and various other places +if (DEFINED OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using specified installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The specified OPENCMISS_INSTALL_DIR '${OPENCMISS_INSTALL_DIR}' does not exist. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_INSTALL_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_INSTALL_DIR}" OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using environment installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The environment variable OPENCMISS_INSTALL_DIR='${OPENCMISS_INSTALL_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if (NOT OPENCMISS_INSTALL_DIR AND DEFINED OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The specified OPENCMISS_SDK_DIR '${OPENCMISS_SDK_DIR}' does not exist. Skipping.") + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_SDK_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_SDK_DIR}" OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using environment SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The environment variable OPENCMISS_SDK_DIR='${OPENCMISS_SDK_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_SDK_DIR) + endif() +endif() +# On windows: check the registry for installed OpenCMISS SDKs +if(NOT OPENCMISS_INSTALL_DIR AND WIN32) + foreach(ROOT HKEY_CURRENT_USER HKEY_LOCAL_MACHINE) + foreach(PACKAGE OpenCMISSUserSDK OpenCMISSDeveloperSDK) + set(_REG_KEY "[${ROOT}\\Software\\Auckland Bioengineering Institute\\${PACKAGE}]") + get_filename_component(OPENCMISS_INSTALL_DIR "${_REG_KEY}" ABSOLUTE) + #message(STATUS "Trying registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Found ${PACKAGE} in Windows registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + break() + else() + unset(OPENCMISS_INSTALL_DIR) + endif() + endforeach() + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + break() + endif() + endforeach() +endif() + +if(OPENCMISS_INSTALL_DIR) + message(STATUS "OPENCMISS_INSTALL_DIR=${OPENCMISS_INSTALL_DIR}") + # Use the OpenCMISS scripts to also allow choosing a separate toolchain + # This file is located at the opencmiss installation rather than the local example + # as it avoids file replication and makes maintenance much easier + if (TOOLCHAIN) + set(_OCTC ${OPENCMISS_INSTALL_DIR}/cmake/OCToolchainCompilers.cmake) + if (EXISTS "${_OCTC}") + include(${_OCTC}) + else() + message(WARNING "TOOLCHAIN specified but OpenCMISS config script could not be found at ${_OCTC}. Trying CMake defaults.") + endif() + unset(_OCTC) + endif() + set(OpenCMISS_DIR "${OPENCMISS_INSTALL_DIR}" CACHE PATH "Path to the found OpenCMISS (SDK) installation") +else() + message(WARNING "No OpenCMISS (SDK) installation directory detected. Using default system environment.") +endif() + \ No newline at end of file diff --git a/FluidMechanics/Stokes/RoutineCheck/Dynamic/build_debug/build.sh b/FluidMechanics/Stokes/RoutineCheck/Dynamic/build_debug/build.sh new file mode 100644 index 00000000..e6624bac --- /dev/null +++ b/FluidMechanics/Stokes/RoutineCheck/Dynamic/build_debug/build.sh @@ -0,0 +1,2 @@ +#ccc && cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all +cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all diff --git a/FluidMechanics/Stokes/RoutineCheck/Static/CMakeLists.txt b/FluidMechanics/Stokes/RoutineCheck/Static/CMakeLists.txt new file mode 100644 index 00000000..a22b61ee --- /dev/null +++ b/FluidMechanics/Stokes/RoutineCheck/Static/CMakeLists.txt @@ -0,0 +1,35 @@ +# 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 C) +enable_language(Fortran OPTIONAL) +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 +# ---------------------- +#add_subdirectory(C) +if (CMAKE_Fortran_COMPILER) + add_subdirectory(Fortran) +endif() diff --git a/FluidMechanics/Stokes/RoutineCheck/Static/Fortran/CMakeLists.txt b/FluidMechanics/Stokes/RoutineCheck/Static/Fortran/CMakeLists.txt new file mode 100644 index 00000000..d1b76f7d --- /dev/null +++ b/FluidMechanics/Stokes/RoutineCheck/Static/Fortran/CMakeLists.txt @@ -0,0 +1,60 @@ + +# Add example executable +add_executable(Static src/StaticExample.f90) + +# Turn on Fortran preprocessing (#include directives) +if (MSVC) + set(PROC_OPT "/fpp") +else() + set(PROC_OPT "-cpp") +endif() + +# in debug mode, add flag that make Floating point exceptions fatal +set(OPT "") +if (FALSE) + if(CMAKE_BUILD_TYPE MATCHES DEBUG) + set(OPT "-ffpe-trap=invalid,zero,underflow,overflow,denormal") # GCC: make floating point exceptions fatal + endif() +endif() + +target_compile_options(Static PRIVATE ${PROC_OPT} ${OPT} "-fbacktrace") + +# Link to opencmiss +# ----------------- +# +# This simply uses the opencmiss target created by OC_INIT() above. +# +# Alternatively, you can also directly invoke 'find_package(Iron )' 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 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(Static PRIVATE opencmiss) + +# Add a simple test that runs the executable +add_test(NAME test_Static COMMAND Static) +add_opencmiss_environment(test_Static) + +################### +# 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. +# diff --git a/FluidMechanics/Stokes/RoutineCheck/Static/src/StaticExample.f90 b/FluidMechanics/Stokes/RoutineCheck/Static/Fortran/src/StaticExample.f90 similarity index 100% rename from FluidMechanics/Stokes/RoutineCheck/Static/src/StaticExample.f90 rename to FluidMechanics/Stokes/RoutineCheck/Static/Fortran/src/StaticExample.f90 diff --git a/FluidMechanics/Stokes/RoutineCheck/Static/OpenCMISS.cmake b/FluidMechanics/Stokes/RoutineCheck/Static/OpenCMISS.cmake new file mode 100644 index 00000000..3d6cf515 --- /dev/null +++ b/FluidMechanics/Stokes/RoutineCheck/Static/OpenCMISS.cmake @@ -0,0 +1,95 @@ +########################### +# *DO NOT CHANGE THIS FILE* +########################### +# +# Prepares the use of OpenCMISS by scanning at various path locations for OpenCMISS (SDK) installations. +# +# Search order: +# - OPENCMISS_INSTALL_DIR variable +# - OPENCMISS_INSTALL_DIR environment variable +# - OPENCMISS_SDK_DIR variable +# - OPENCMISS_SDK_DIR environment variable +# - [Windows only] The Registry is searched additionally for installed SDKs. +# +# If found +# - Includes the toolchain config script of the found opencmiss installation to enable toolchain selection logic (non-windows) + +# Convenience: The OPENCMISS_INSTALL_DIR may also be defined in the environment and various other places +if (DEFINED OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using specified installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The specified OPENCMISS_INSTALL_DIR '${OPENCMISS_INSTALL_DIR}' does not exist. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_INSTALL_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_INSTALL_DIR}" OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using environment installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The environment variable OPENCMISS_INSTALL_DIR='${OPENCMISS_INSTALL_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if (NOT OPENCMISS_INSTALL_DIR AND DEFINED OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The specified OPENCMISS_SDK_DIR '${OPENCMISS_SDK_DIR}' does not exist. Skipping.") + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_SDK_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_SDK_DIR}" OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using environment SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The environment variable OPENCMISS_SDK_DIR='${OPENCMISS_SDK_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_SDK_DIR) + endif() +endif() +# On windows: check the registry for installed OpenCMISS SDKs +if(NOT OPENCMISS_INSTALL_DIR AND WIN32) + foreach(ROOT HKEY_CURRENT_USER HKEY_LOCAL_MACHINE) + foreach(PACKAGE OpenCMISSUserSDK OpenCMISSDeveloperSDK) + set(_REG_KEY "[${ROOT}\\Software\\Auckland Bioengineering Institute\\${PACKAGE}]") + get_filename_component(OPENCMISS_INSTALL_DIR "${_REG_KEY}" ABSOLUTE) + #message(STATUS "Trying registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Found ${PACKAGE} in Windows registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + break() + else() + unset(OPENCMISS_INSTALL_DIR) + endif() + endforeach() + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + break() + endif() + endforeach() +endif() + +if(OPENCMISS_INSTALL_DIR) + message(STATUS "OPENCMISS_INSTALL_DIR=${OPENCMISS_INSTALL_DIR}") + # Use the OpenCMISS scripts to also allow choosing a separate toolchain + # This file is located at the opencmiss installation rather than the local example + # as it avoids file replication and makes maintenance much easier + if (TOOLCHAIN) + set(_OCTC ${OPENCMISS_INSTALL_DIR}/cmake/OCToolchainCompilers.cmake) + if (EXISTS "${_OCTC}") + include(${_OCTC}) + else() + message(WARNING "TOOLCHAIN specified but OpenCMISS config script could not be found at ${_OCTC}. Trying CMake defaults.") + endif() + unset(_OCTC) + endif() + set(OpenCMISS_DIR "${OPENCMISS_INSTALL_DIR}" CACHE PATH "Path to the found OpenCMISS (SDK) installation") +else() + message(WARNING "No OpenCMISS (SDK) installation directory detected. Using default system environment.") +endif() + \ No newline at end of file diff --git a/FluidMechanics/Stokes/RoutineCheck/Static/build_debug/build.sh b/FluidMechanics/Stokes/RoutineCheck/Static/build_debug/build.sh new file mode 100644 index 00000000..e6624bac --- /dev/null +++ b/FluidMechanics/Stokes/RoutineCheck/Static/build_debug/build.sh @@ -0,0 +1,2 @@ +#ccc && cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all +cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all diff --git a/InterfaceExamples/CoupledFluidSolid/CMakeLists.txt b/InterfaceExamples/CoupledFluidSolid/CMakeLists.txt new file mode 100644 index 00000000..a22b61ee --- /dev/null +++ b/InterfaceExamples/CoupledFluidSolid/CMakeLists.txt @@ -0,0 +1,35 @@ +# 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 C) +enable_language(Fortran OPTIONAL) +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 +# ---------------------- +#add_subdirectory(C) +if (CMAKE_Fortran_COMPILER) + add_subdirectory(Fortran) +endif() diff --git a/InterfaceExamples/CoupledFluidSolid/Fortran/CMakeLists.txt b/InterfaceExamples/CoupledFluidSolid/Fortran/CMakeLists.txt new file mode 100644 index 00000000..7480a563 --- /dev/null +++ b/InterfaceExamples/CoupledFluidSolid/Fortran/CMakeLists.txt @@ -0,0 +1,60 @@ + +# Add example executable +add_executable(CoupledFluidSolid src/FortranExample.f90) + +# Turn on Fortran preprocessing (#include directives) +if (MSVC) + set(PROC_OPT "/fpp") +else() + set(PROC_OPT "-cpp") +endif() + +# in debug mode, add flag that make Floating point exceptions fatal +set(OPT "") +if (FALSE) + if(CMAKE_BUILD_TYPE MATCHES DEBUG) + set(OPT "-ffpe-trap=invalid,zero,underflow,overflow,denormal") # GCC: make floating point exceptions fatal + endif() +endif() + +target_compile_options(CoupledFluidSolid PRIVATE ${PROC_OPT} ${OPT} "-fbacktrace") + +# Link to opencmiss +# ----------------- +# +# This simply uses the opencmiss target created by OC_INIT() above. +# +# Alternatively, you can also directly invoke 'find_package(Iron )' 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 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(CoupledFluidSolid PRIVATE opencmiss) + +# Add a simple test that runs the executable +add_test(NAME test_CoupledFluidSolid COMMAND CoupledFluidSolid) +add_opencmiss_environment(test_CoupledFluidSolid) + +################### +# 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. +# diff --git a/InterfaceExamples/CoupledFluidSolid/Fortran/OpenCMISS.cmake b/InterfaceExamples/CoupledFluidSolid/Fortran/OpenCMISS.cmake new file mode 100644 index 00000000..3d6cf515 --- /dev/null +++ b/InterfaceExamples/CoupledFluidSolid/Fortran/OpenCMISS.cmake @@ -0,0 +1,95 @@ +########################### +# *DO NOT CHANGE THIS FILE* +########################### +# +# Prepares the use of OpenCMISS by scanning at various path locations for OpenCMISS (SDK) installations. +# +# Search order: +# - OPENCMISS_INSTALL_DIR variable +# - OPENCMISS_INSTALL_DIR environment variable +# - OPENCMISS_SDK_DIR variable +# - OPENCMISS_SDK_DIR environment variable +# - [Windows only] The Registry is searched additionally for installed SDKs. +# +# If found +# - Includes the toolchain config script of the found opencmiss installation to enable toolchain selection logic (non-windows) + +# Convenience: The OPENCMISS_INSTALL_DIR may also be defined in the environment and various other places +if (DEFINED OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using specified installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The specified OPENCMISS_INSTALL_DIR '${OPENCMISS_INSTALL_DIR}' does not exist. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_INSTALL_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_INSTALL_DIR}" OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using environment installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The environment variable OPENCMISS_INSTALL_DIR='${OPENCMISS_INSTALL_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if (NOT OPENCMISS_INSTALL_DIR AND DEFINED OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The specified OPENCMISS_SDK_DIR '${OPENCMISS_SDK_DIR}' does not exist. Skipping.") + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_SDK_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_SDK_DIR}" OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using environment SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The environment variable OPENCMISS_SDK_DIR='${OPENCMISS_SDK_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_SDK_DIR) + endif() +endif() +# On windows: check the registry for installed OpenCMISS SDKs +if(NOT OPENCMISS_INSTALL_DIR AND WIN32) + foreach(ROOT HKEY_CURRENT_USER HKEY_LOCAL_MACHINE) + foreach(PACKAGE OpenCMISSUserSDK OpenCMISSDeveloperSDK) + set(_REG_KEY "[${ROOT}\\Software\\Auckland Bioengineering Institute\\${PACKAGE}]") + get_filename_component(OPENCMISS_INSTALL_DIR "${_REG_KEY}" ABSOLUTE) + #message(STATUS "Trying registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Found ${PACKAGE} in Windows registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + break() + else() + unset(OPENCMISS_INSTALL_DIR) + endif() + endforeach() + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + break() + endif() + endforeach() +endif() + +if(OPENCMISS_INSTALL_DIR) + message(STATUS "OPENCMISS_INSTALL_DIR=${OPENCMISS_INSTALL_DIR}") + # Use the OpenCMISS scripts to also allow choosing a separate toolchain + # This file is located at the opencmiss installation rather than the local example + # as it avoids file replication and makes maintenance much easier + if (TOOLCHAIN) + set(_OCTC ${OPENCMISS_INSTALL_DIR}/cmake/OCToolchainCompilers.cmake) + if (EXISTS "${_OCTC}") + include(${_OCTC}) + else() + message(WARNING "TOOLCHAIN specified but OpenCMISS config script could not be found at ${_OCTC}. Trying CMake defaults.") + endif() + unset(_OCTC) + endif() + set(OpenCMISS_DIR "${OPENCMISS_INSTALL_DIR}" CACHE PATH "Path to the found OpenCMISS (SDK) installation") +else() + message(WARNING "No OpenCMISS (SDK) installation directory detected. Using default system environment.") +endif() + \ No newline at end of file diff --git a/InterfaceExamples/CoupledFluidSolid/OpenCMISS.cmake b/InterfaceExamples/CoupledFluidSolid/OpenCMISS.cmake new file mode 100644 index 00000000..3d6cf515 --- /dev/null +++ b/InterfaceExamples/CoupledFluidSolid/OpenCMISS.cmake @@ -0,0 +1,95 @@ +########################### +# *DO NOT CHANGE THIS FILE* +########################### +# +# Prepares the use of OpenCMISS by scanning at various path locations for OpenCMISS (SDK) installations. +# +# Search order: +# - OPENCMISS_INSTALL_DIR variable +# - OPENCMISS_INSTALL_DIR environment variable +# - OPENCMISS_SDK_DIR variable +# - OPENCMISS_SDK_DIR environment variable +# - [Windows only] The Registry is searched additionally for installed SDKs. +# +# If found +# - Includes the toolchain config script of the found opencmiss installation to enable toolchain selection logic (non-windows) + +# Convenience: The OPENCMISS_INSTALL_DIR may also be defined in the environment and various other places +if (DEFINED OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using specified installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The specified OPENCMISS_INSTALL_DIR '${OPENCMISS_INSTALL_DIR}' does not exist. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_INSTALL_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_INSTALL_DIR}" OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using environment installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The environment variable OPENCMISS_INSTALL_DIR='${OPENCMISS_INSTALL_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if (NOT OPENCMISS_INSTALL_DIR AND DEFINED OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The specified OPENCMISS_SDK_DIR '${OPENCMISS_SDK_DIR}' does not exist. Skipping.") + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_SDK_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_SDK_DIR}" OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using environment SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The environment variable OPENCMISS_SDK_DIR='${OPENCMISS_SDK_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_SDK_DIR) + endif() +endif() +# On windows: check the registry for installed OpenCMISS SDKs +if(NOT OPENCMISS_INSTALL_DIR AND WIN32) + foreach(ROOT HKEY_CURRENT_USER HKEY_LOCAL_MACHINE) + foreach(PACKAGE OpenCMISSUserSDK OpenCMISSDeveloperSDK) + set(_REG_KEY "[${ROOT}\\Software\\Auckland Bioengineering Institute\\${PACKAGE}]") + get_filename_component(OPENCMISS_INSTALL_DIR "${_REG_KEY}" ABSOLUTE) + #message(STATUS "Trying registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Found ${PACKAGE} in Windows registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + break() + else() + unset(OPENCMISS_INSTALL_DIR) + endif() + endforeach() + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + break() + endif() + endforeach() +endif() + +if(OPENCMISS_INSTALL_DIR) + message(STATUS "OPENCMISS_INSTALL_DIR=${OPENCMISS_INSTALL_DIR}") + # Use the OpenCMISS scripts to also allow choosing a separate toolchain + # This file is located at the opencmiss installation rather than the local example + # as it avoids file replication and makes maintenance much easier + if (TOOLCHAIN) + set(_OCTC ${OPENCMISS_INSTALL_DIR}/cmake/OCToolchainCompilers.cmake) + if (EXISTS "${_OCTC}") + include(${_OCTC}) + else() + message(WARNING "TOOLCHAIN specified but OpenCMISS config script could not be found at ${_OCTC}. Trying CMake defaults.") + endif() + unset(_OCTC) + endif() + set(OpenCMISS_DIR "${OPENCMISS_INSTALL_DIR}" CACHE PATH "Path to the found OpenCMISS (SDK) installation") +else() + message(WARNING "No OpenCMISS (SDK) installation directory detected. Using default system environment.") +endif() + \ No newline at end of file diff --git a/InterfaceExamples/CoupledFluidSolid/build_debug/build.sh b/InterfaceExamples/CoupledFluidSolid/build_debug/build.sh new file mode 100644 index 00000000..e6624bac --- /dev/null +++ b/InterfaceExamples/CoupledFluidSolid/build_debug/build.sh @@ -0,0 +1,2 @@ +#ccc && cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all +cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all diff --git a/InterfaceExamples/CoupledLaplace/CMakeLists.txt b/InterfaceExamples/CoupledLaplace/CMakeLists.txt new file mode 100644 index 00000000..a22b61ee --- /dev/null +++ b/InterfaceExamples/CoupledLaplace/CMakeLists.txt @@ -0,0 +1,35 @@ +# 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 C) +enable_language(Fortran OPTIONAL) +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 +# ---------------------- +#add_subdirectory(C) +if (CMAKE_Fortran_COMPILER) + add_subdirectory(Fortran) +endif() diff --git a/InterfaceExamples/CoupledLaplace/Fortran/CMakeLists.txt b/InterfaceExamples/CoupledLaplace/Fortran/CMakeLists.txt new file mode 100644 index 00000000..bcc05faf --- /dev/null +++ b/InterfaceExamples/CoupledLaplace/Fortran/CMakeLists.txt @@ -0,0 +1,60 @@ + +# Add example executable +add_executable(CoupledLaplace src/CoupledLaplaceExample.f90) + +# Turn on Fortran preprocessing (#include directives) +if (MSVC) + set(PROC_OPT "/fpp") +else() + set(PROC_OPT "-cpp") +endif() + +# in debug mode, add flag that make Floating point exceptions fatal +set(OPT "") +if (FALSE) + if(CMAKE_BUILD_TYPE MATCHES DEBUG) + set(OPT "-ffpe-trap=invalid,zero,underflow,overflow,denormal") # GCC: make floating point exceptions fatal + endif() +endif() + +target_compile_options(CoupledLaplace PRIVATE ${PROC_OPT} ${OPT} "-fbacktrace") + +# Link to opencmiss +# ----------------- +# +# This simply uses the opencmiss target created by OC_INIT() above. +# +# Alternatively, you can also directly invoke 'find_package(Iron )' 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 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(CoupledLaplace PRIVATE opencmiss) + +# Add a simple test that runs the executable +add_test(NAME test_CoupledLaplace COMMAND CoupledLaplace) +add_opencmiss_environment(test_CoupledLaplace) + +################### +# 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. +# diff --git a/InterfaceExamples/CoupledLaplace/src/CoupledLaplaceExample.f90 b/InterfaceExamples/CoupledLaplace/Fortran/src/CoupledLaplaceExample.f90 similarity index 100% rename from InterfaceExamples/CoupledLaplace/src/CoupledLaplaceExample.f90 rename to InterfaceExamples/CoupledLaplace/Fortran/src/CoupledLaplaceExample.f90 diff --git a/InterfaceExamples/CoupledLaplace/OpenCMISS.cmake b/InterfaceExamples/CoupledLaplace/OpenCMISS.cmake new file mode 100644 index 00000000..3d6cf515 --- /dev/null +++ b/InterfaceExamples/CoupledLaplace/OpenCMISS.cmake @@ -0,0 +1,95 @@ +########################### +# *DO NOT CHANGE THIS FILE* +########################### +# +# Prepares the use of OpenCMISS by scanning at various path locations for OpenCMISS (SDK) installations. +# +# Search order: +# - OPENCMISS_INSTALL_DIR variable +# - OPENCMISS_INSTALL_DIR environment variable +# - OPENCMISS_SDK_DIR variable +# - OPENCMISS_SDK_DIR environment variable +# - [Windows only] The Registry is searched additionally for installed SDKs. +# +# If found +# - Includes the toolchain config script of the found opencmiss installation to enable toolchain selection logic (non-windows) + +# Convenience: The OPENCMISS_INSTALL_DIR may also be defined in the environment and various other places +if (DEFINED OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using specified installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The specified OPENCMISS_INSTALL_DIR '${OPENCMISS_INSTALL_DIR}' does not exist. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_INSTALL_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_INSTALL_DIR}" OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using environment installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The environment variable OPENCMISS_INSTALL_DIR='${OPENCMISS_INSTALL_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if (NOT OPENCMISS_INSTALL_DIR AND DEFINED OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The specified OPENCMISS_SDK_DIR '${OPENCMISS_SDK_DIR}' does not exist. Skipping.") + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_SDK_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_SDK_DIR}" OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using environment SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The environment variable OPENCMISS_SDK_DIR='${OPENCMISS_SDK_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_SDK_DIR) + endif() +endif() +# On windows: check the registry for installed OpenCMISS SDKs +if(NOT OPENCMISS_INSTALL_DIR AND WIN32) + foreach(ROOT HKEY_CURRENT_USER HKEY_LOCAL_MACHINE) + foreach(PACKAGE OpenCMISSUserSDK OpenCMISSDeveloperSDK) + set(_REG_KEY "[${ROOT}\\Software\\Auckland Bioengineering Institute\\${PACKAGE}]") + get_filename_component(OPENCMISS_INSTALL_DIR "${_REG_KEY}" ABSOLUTE) + #message(STATUS "Trying registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Found ${PACKAGE} in Windows registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + break() + else() + unset(OPENCMISS_INSTALL_DIR) + endif() + endforeach() + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + break() + endif() + endforeach() +endif() + +if(OPENCMISS_INSTALL_DIR) + message(STATUS "OPENCMISS_INSTALL_DIR=${OPENCMISS_INSTALL_DIR}") + # Use the OpenCMISS scripts to also allow choosing a separate toolchain + # This file is located at the opencmiss installation rather than the local example + # as it avoids file replication and makes maintenance much easier + if (TOOLCHAIN) + set(_OCTC ${OPENCMISS_INSTALL_DIR}/cmake/OCToolchainCompilers.cmake) + if (EXISTS "${_OCTC}") + include(${_OCTC}) + else() + message(WARNING "TOOLCHAIN specified but OpenCMISS config script could not be found at ${_OCTC}. Trying CMake defaults.") + endif() + unset(_OCTC) + endif() + set(OpenCMISS_DIR "${OPENCMISS_INSTALL_DIR}" CACHE PATH "Path to the found OpenCMISS (SDK) installation") +else() + message(WARNING "No OpenCMISS (SDK) installation directory detected. Using default system environment.") +endif() + \ No newline at end of file diff --git a/InterfaceExamples/CoupledLaplace/build_debug/build.sh b/InterfaceExamples/CoupledLaplace/build_debug/build.sh new file mode 100644 index 00000000..e6624bac --- /dev/null +++ b/InterfaceExamples/CoupledLaplace/build_debug/build.sh @@ -0,0 +1,2 @@ +#ccc && cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all +cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all diff --git a/InterfaceExamples/InputCoupledLaplace/CMakeLists.txt b/InterfaceExamples/InputCoupledLaplace/CMakeLists.txt new file mode 100644 index 00000000..a22b61ee --- /dev/null +++ b/InterfaceExamples/InputCoupledLaplace/CMakeLists.txt @@ -0,0 +1,35 @@ +# 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 C) +enable_language(Fortran OPTIONAL) +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 +# ---------------------- +#add_subdirectory(C) +if (CMAKE_Fortran_COMPILER) + add_subdirectory(Fortran) +endif() diff --git a/InterfaceExamples/InputCoupledLaplace/Fortran/CMakeLists.txt b/InterfaceExamples/InputCoupledLaplace/Fortran/CMakeLists.txt new file mode 100644 index 00000000..1470edf5 --- /dev/null +++ b/InterfaceExamples/InputCoupledLaplace/Fortran/CMakeLists.txt @@ -0,0 +1,60 @@ + +# Add example executable +add_executable(InputCoupledLaplace src/InputCoupledLaplaceExample.f90) + +# Turn on Fortran preprocessing (#include directives) +if (MSVC) + set(PROC_OPT "/fpp") +else() + set(PROC_OPT "-cpp") +endif() + +# in debug mode, add flag that make Floating point exceptions fatal +set(OPT "") +if (FALSE) + if(CMAKE_BUILD_TYPE MATCHES DEBUG) + set(OPT "-ffpe-trap=invalid,zero,underflow,overflow,denormal") # GCC: make floating point exceptions fatal + endif() +endif() + +target_compile_options(InputCoupledLaplace PRIVATE ${PROC_OPT} ${OPT} "-fbacktrace") + +# Link to opencmiss +# ----------------- +# +# This simply uses the opencmiss target created by OC_INIT() above. +# +# Alternatively, you can also directly invoke 'find_package(Iron )' 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 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(InputCoupledLaplace PRIVATE opencmiss) + +# Add a simple test that runs the executable +add_test(NAME test_InputCoupledLaplace COMMAND InputCoupledLaplace) +add_opencmiss_environment(test_InputCoupledLaplace) + +################### +# 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. +# diff --git a/InterfaceExamples/InputCoupledLaplace/src/InputCoupledLaplaceExample.f90 b/InterfaceExamples/InputCoupledLaplace/Fortran/src/InputCoupledLaplaceExample.f90 similarity index 100% rename from InterfaceExamples/InputCoupledLaplace/src/InputCoupledLaplaceExample.f90 rename to InterfaceExamples/InputCoupledLaplace/Fortran/src/InputCoupledLaplaceExample.f90 diff --git a/InterfaceExamples/InputCoupledLaplace/OpenCMISS.cmake b/InterfaceExamples/InputCoupledLaplace/OpenCMISS.cmake new file mode 100644 index 00000000..3d6cf515 --- /dev/null +++ b/InterfaceExamples/InputCoupledLaplace/OpenCMISS.cmake @@ -0,0 +1,95 @@ +########################### +# *DO NOT CHANGE THIS FILE* +########################### +# +# Prepares the use of OpenCMISS by scanning at various path locations for OpenCMISS (SDK) installations. +# +# Search order: +# - OPENCMISS_INSTALL_DIR variable +# - OPENCMISS_INSTALL_DIR environment variable +# - OPENCMISS_SDK_DIR variable +# - OPENCMISS_SDK_DIR environment variable +# - [Windows only] The Registry is searched additionally for installed SDKs. +# +# If found +# - Includes the toolchain config script of the found opencmiss installation to enable toolchain selection logic (non-windows) + +# Convenience: The OPENCMISS_INSTALL_DIR may also be defined in the environment and various other places +if (DEFINED OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using specified installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The specified OPENCMISS_INSTALL_DIR '${OPENCMISS_INSTALL_DIR}' does not exist. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_INSTALL_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_INSTALL_DIR}" OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using environment installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The environment variable OPENCMISS_INSTALL_DIR='${OPENCMISS_INSTALL_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if (NOT OPENCMISS_INSTALL_DIR AND DEFINED OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The specified OPENCMISS_SDK_DIR '${OPENCMISS_SDK_DIR}' does not exist. Skipping.") + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_SDK_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_SDK_DIR}" OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using environment SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The environment variable OPENCMISS_SDK_DIR='${OPENCMISS_SDK_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_SDK_DIR) + endif() +endif() +# On windows: check the registry for installed OpenCMISS SDKs +if(NOT OPENCMISS_INSTALL_DIR AND WIN32) + foreach(ROOT HKEY_CURRENT_USER HKEY_LOCAL_MACHINE) + foreach(PACKAGE OpenCMISSUserSDK OpenCMISSDeveloperSDK) + set(_REG_KEY "[${ROOT}\\Software\\Auckland Bioengineering Institute\\${PACKAGE}]") + get_filename_component(OPENCMISS_INSTALL_DIR "${_REG_KEY}" ABSOLUTE) + #message(STATUS "Trying registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Found ${PACKAGE} in Windows registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + break() + else() + unset(OPENCMISS_INSTALL_DIR) + endif() + endforeach() + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + break() + endif() + endforeach() +endif() + +if(OPENCMISS_INSTALL_DIR) + message(STATUS "OPENCMISS_INSTALL_DIR=${OPENCMISS_INSTALL_DIR}") + # Use the OpenCMISS scripts to also allow choosing a separate toolchain + # This file is located at the opencmiss installation rather than the local example + # as it avoids file replication and makes maintenance much easier + if (TOOLCHAIN) + set(_OCTC ${OPENCMISS_INSTALL_DIR}/cmake/OCToolchainCompilers.cmake) + if (EXISTS "${_OCTC}") + include(${_OCTC}) + else() + message(WARNING "TOOLCHAIN specified but OpenCMISS config script could not be found at ${_OCTC}. Trying CMake defaults.") + endif() + unset(_OCTC) + endif() + set(OpenCMISS_DIR "${OPENCMISS_INSTALL_DIR}" CACHE PATH "Path to the found OpenCMISS (SDK) installation") +else() + message(WARNING "No OpenCMISS (SDK) installation directory detected. Using default system environment.") +endif() + \ No newline at end of file diff --git a/InterfaceExamples/InputCoupledLaplace/build_debug/build.sh b/InterfaceExamples/InputCoupledLaplace/build_debug/build.sh new file mode 100644 index 00000000..e6624bac --- /dev/null +++ b/InterfaceExamples/InputCoupledLaplace/build_debug/build.sh @@ -0,0 +1,2 @@ +#ccc && cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all +cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all diff --git a/InterfaceExamples/InputCoupledStokes/CMakeLists.txt b/InterfaceExamples/InputCoupledStokes/CMakeLists.txt new file mode 100644 index 00000000..a22b61ee --- /dev/null +++ b/InterfaceExamples/InputCoupledStokes/CMakeLists.txt @@ -0,0 +1,35 @@ +# 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 C) +enable_language(Fortran OPTIONAL) +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 +# ---------------------- +#add_subdirectory(C) +if (CMAKE_Fortran_COMPILER) + add_subdirectory(Fortran) +endif() diff --git a/InterfaceExamples/InputCoupledStokes/Fortran/CMakeLists.txt b/InterfaceExamples/InputCoupledStokes/Fortran/CMakeLists.txt new file mode 100644 index 00000000..29da4516 --- /dev/null +++ b/InterfaceExamples/InputCoupledStokes/Fortran/CMakeLists.txt @@ -0,0 +1,60 @@ + +# Add example executable +add_executable(InputCoupledStokes src/InputCoupledStokesExample.f90) + +# Turn on Fortran preprocessing (#include directives) +if (MSVC) + set(PROC_OPT "/fpp") +else() + set(PROC_OPT "-cpp") +endif() + +# in debug mode, add flag that make Floating point exceptions fatal +set(OPT "") +if (FALSE) + if(CMAKE_BUILD_TYPE MATCHES DEBUG) + set(OPT "-ffpe-trap=invalid,zero,underflow,overflow,denormal") # GCC: make floating point exceptions fatal + endif() +endif() + +target_compile_options(InputCoupledStokes PRIVATE ${PROC_OPT} ${OPT} "-fbacktrace") + +# Link to opencmiss +# ----------------- +# +# This simply uses the opencmiss target created by OC_INIT() above. +# +# Alternatively, you can also directly invoke 'find_package(Iron )' 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 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(InputCoupledStokes PRIVATE opencmiss) + +# Add a simple test that runs the executable +add_test(NAME test_InputCoupledStokes COMMAND InputCoupledStokes) +add_opencmiss_environment(test_InputCoupledStokes) + +################### +# 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. +# diff --git a/InterfaceExamples/InputCoupledStokes/src/InputCoupledStokesExample.f90 b/InterfaceExamples/InputCoupledStokes/Fortran/src/InputCoupledStokesExample.f90 similarity index 100% rename from InterfaceExamples/InputCoupledStokes/src/InputCoupledStokesExample.f90 rename to InterfaceExamples/InputCoupledStokes/Fortran/src/InputCoupledStokesExample.f90 diff --git a/InterfaceExamples/InputCoupledStokes/OpenCMISS.cmake b/InterfaceExamples/InputCoupledStokes/OpenCMISS.cmake new file mode 100644 index 00000000..3d6cf515 --- /dev/null +++ b/InterfaceExamples/InputCoupledStokes/OpenCMISS.cmake @@ -0,0 +1,95 @@ +########################### +# *DO NOT CHANGE THIS FILE* +########################### +# +# Prepares the use of OpenCMISS by scanning at various path locations for OpenCMISS (SDK) installations. +# +# Search order: +# - OPENCMISS_INSTALL_DIR variable +# - OPENCMISS_INSTALL_DIR environment variable +# - OPENCMISS_SDK_DIR variable +# - OPENCMISS_SDK_DIR environment variable +# - [Windows only] The Registry is searched additionally for installed SDKs. +# +# If found +# - Includes the toolchain config script of the found opencmiss installation to enable toolchain selection logic (non-windows) + +# Convenience: The OPENCMISS_INSTALL_DIR may also be defined in the environment and various other places +if (DEFINED OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using specified installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The specified OPENCMISS_INSTALL_DIR '${OPENCMISS_INSTALL_DIR}' does not exist. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_INSTALL_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_INSTALL_DIR}" OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using environment installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The environment variable OPENCMISS_INSTALL_DIR='${OPENCMISS_INSTALL_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if (NOT OPENCMISS_INSTALL_DIR AND DEFINED OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The specified OPENCMISS_SDK_DIR '${OPENCMISS_SDK_DIR}' does not exist. Skipping.") + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_SDK_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_SDK_DIR}" OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using environment SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The environment variable OPENCMISS_SDK_DIR='${OPENCMISS_SDK_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_SDK_DIR) + endif() +endif() +# On windows: check the registry for installed OpenCMISS SDKs +if(NOT OPENCMISS_INSTALL_DIR AND WIN32) + foreach(ROOT HKEY_CURRENT_USER HKEY_LOCAL_MACHINE) + foreach(PACKAGE OpenCMISSUserSDK OpenCMISSDeveloperSDK) + set(_REG_KEY "[${ROOT}\\Software\\Auckland Bioengineering Institute\\${PACKAGE}]") + get_filename_component(OPENCMISS_INSTALL_DIR "${_REG_KEY}" ABSOLUTE) + #message(STATUS "Trying registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Found ${PACKAGE} in Windows registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + break() + else() + unset(OPENCMISS_INSTALL_DIR) + endif() + endforeach() + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + break() + endif() + endforeach() +endif() + +if(OPENCMISS_INSTALL_DIR) + message(STATUS "OPENCMISS_INSTALL_DIR=${OPENCMISS_INSTALL_DIR}") + # Use the OpenCMISS scripts to also allow choosing a separate toolchain + # This file is located at the opencmiss installation rather than the local example + # as it avoids file replication and makes maintenance much easier + if (TOOLCHAIN) + set(_OCTC ${OPENCMISS_INSTALL_DIR}/cmake/OCToolchainCompilers.cmake) + if (EXISTS "${_OCTC}") + include(${_OCTC}) + else() + message(WARNING "TOOLCHAIN specified but OpenCMISS config script could not be found at ${_OCTC}. Trying CMake defaults.") + endif() + unset(_OCTC) + endif() + set(OpenCMISS_DIR "${OPENCMISS_INSTALL_DIR}" CACHE PATH "Path to the found OpenCMISS (SDK) installation") +else() + message(WARNING "No OpenCMISS (SDK) installation directory detected. Using default system environment.") +endif() + \ No newline at end of file diff --git a/InterfaceExamples/InputCoupledStokes/build_debug/build.sh b/InterfaceExamples/InputCoupledStokes/build_debug/build.sh new file mode 100644 index 00000000..e6624bac --- /dev/null +++ b/InterfaceExamples/InputCoupledStokes/build_debug/build.sh @@ -0,0 +1,2 @@ +#ccc && cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all +cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all diff --git a/InterfaceExamples/InputUnCoupledLaplace/CMakeLists.txt b/InterfaceExamples/InputUnCoupledLaplace/CMakeLists.txt new file mode 100644 index 00000000..a22b61ee --- /dev/null +++ b/InterfaceExamples/InputUnCoupledLaplace/CMakeLists.txt @@ -0,0 +1,35 @@ +# 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 C) +enable_language(Fortran OPTIONAL) +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 +# ---------------------- +#add_subdirectory(C) +if (CMAKE_Fortran_COMPILER) + add_subdirectory(Fortran) +endif() diff --git a/InterfaceExamples/InputUnCoupledLaplace/Fortran/CMakeLists.txt b/InterfaceExamples/InputUnCoupledLaplace/Fortran/CMakeLists.txt new file mode 100644 index 00000000..6c248128 --- /dev/null +++ b/InterfaceExamples/InputUnCoupledLaplace/Fortran/CMakeLists.txt @@ -0,0 +1,60 @@ + +# Add example executable +add_executable(InputUnCoupledLaplace src/InputUnCoupledLaplaceExample.f90) + +# Turn on Fortran preprocessing (#include directives) +if (MSVC) + set(PROC_OPT "/fpp") +else() + set(PROC_OPT "-cpp") +endif() + +# in debug mode, add flag that make Floating point exceptions fatal +set(OPT "") +if (FALSE) + if(CMAKE_BUILD_TYPE MATCHES DEBUG) + set(OPT "-ffpe-trap=invalid,zero,underflow,overflow,denormal") # GCC: make floating point exceptions fatal + endif() +endif() + +target_compile_options(InputUnCoupledLaplace PRIVATE ${PROC_OPT} ${OPT} "-fbacktrace") + +# Link to opencmiss +# ----------------- +# +# This simply uses the opencmiss target created by OC_INIT() above. +# +# Alternatively, you can also directly invoke 'find_package(Iron )' 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 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(InputUnCoupledLaplace PRIVATE opencmiss) + +# Add a simple test that runs the executable +add_test(NAME test_InputUnCoupledLaplace COMMAND InputUnCoupledLaplace) +add_opencmiss_environment(test_InputUnCoupledLaplace) + +################### +# 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. +# diff --git a/InterfaceExamples/InputUnCoupledLaplace/src/InputUnCoupledLaplaceExample.f90 b/InterfaceExamples/InputUnCoupledLaplace/Fortran/src/InputUnCoupledLaplaceExample.f90 similarity index 100% rename from InterfaceExamples/InputUnCoupledLaplace/src/InputUnCoupledLaplaceExample.f90 rename to InterfaceExamples/InputUnCoupledLaplace/Fortran/src/InputUnCoupledLaplaceExample.f90 diff --git a/InterfaceExamples/InputUnCoupledLaplace/OpenCMISS.cmake b/InterfaceExamples/InputUnCoupledLaplace/OpenCMISS.cmake new file mode 100644 index 00000000..3d6cf515 --- /dev/null +++ b/InterfaceExamples/InputUnCoupledLaplace/OpenCMISS.cmake @@ -0,0 +1,95 @@ +########################### +# *DO NOT CHANGE THIS FILE* +########################### +# +# Prepares the use of OpenCMISS by scanning at various path locations for OpenCMISS (SDK) installations. +# +# Search order: +# - OPENCMISS_INSTALL_DIR variable +# - OPENCMISS_INSTALL_DIR environment variable +# - OPENCMISS_SDK_DIR variable +# - OPENCMISS_SDK_DIR environment variable +# - [Windows only] The Registry is searched additionally for installed SDKs. +# +# If found +# - Includes the toolchain config script of the found opencmiss installation to enable toolchain selection logic (non-windows) + +# Convenience: The OPENCMISS_INSTALL_DIR may also be defined in the environment and various other places +if (DEFINED OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using specified installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The specified OPENCMISS_INSTALL_DIR '${OPENCMISS_INSTALL_DIR}' does not exist. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_INSTALL_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_INSTALL_DIR}" OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using environment installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The environment variable OPENCMISS_INSTALL_DIR='${OPENCMISS_INSTALL_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if (NOT OPENCMISS_INSTALL_DIR AND DEFINED OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The specified OPENCMISS_SDK_DIR '${OPENCMISS_SDK_DIR}' does not exist. Skipping.") + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_SDK_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_SDK_DIR}" OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using environment SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The environment variable OPENCMISS_SDK_DIR='${OPENCMISS_SDK_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_SDK_DIR) + endif() +endif() +# On windows: check the registry for installed OpenCMISS SDKs +if(NOT OPENCMISS_INSTALL_DIR AND WIN32) + foreach(ROOT HKEY_CURRENT_USER HKEY_LOCAL_MACHINE) + foreach(PACKAGE OpenCMISSUserSDK OpenCMISSDeveloperSDK) + set(_REG_KEY "[${ROOT}\\Software\\Auckland Bioengineering Institute\\${PACKAGE}]") + get_filename_component(OPENCMISS_INSTALL_DIR "${_REG_KEY}" ABSOLUTE) + #message(STATUS "Trying registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Found ${PACKAGE} in Windows registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + break() + else() + unset(OPENCMISS_INSTALL_DIR) + endif() + endforeach() + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + break() + endif() + endforeach() +endif() + +if(OPENCMISS_INSTALL_DIR) + message(STATUS "OPENCMISS_INSTALL_DIR=${OPENCMISS_INSTALL_DIR}") + # Use the OpenCMISS scripts to also allow choosing a separate toolchain + # This file is located at the opencmiss installation rather than the local example + # as it avoids file replication and makes maintenance much easier + if (TOOLCHAIN) + set(_OCTC ${OPENCMISS_INSTALL_DIR}/cmake/OCToolchainCompilers.cmake) + if (EXISTS "${_OCTC}") + include(${_OCTC}) + else() + message(WARNING "TOOLCHAIN specified but OpenCMISS config script could not be found at ${_OCTC}. Trying CMake defaults.") + endif() + unset(_OCTC) + endif() + set(OpenCMISS_DIR "${OPENCMISS_INSTALL_DIR}" CACHE PATH "Path to the found OpenCMISS (SDK) installation") +else() + message(WARNING "No OpenCMISS (SDK) installation directory detected. Using default system environment.") +endif() + \ No newline at end of file diff --git a/InterfaceExamples/InputUnCoupledLaplace/build_debug/build.sh b/InterfaceExamples/InputUnCoupledLaplace/build_debug/build.sh new file mode 100644 index 00000000..e6624bac --- /dev/null +++ b/InterfaceExamples/InputUnCoupledLaplace/build_debug/build.sh @@ -0,0 +1,2 @@ +#ccc && cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all +cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all diff --git a/InterfaceExamples/UnCoupledLaplace/CMakeLists.txt b/InterfaceExamples/UnCoupledLaplace/CMakeLists.txt new file mode 100644 index 00000000..a22b61ee --- /dev/null +++ b/InterfaceExamples/UnCoupledLaplace/CMakeLists.txt @@ -0,0 +1,35 @@ +# 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 C) +enable_language(Fortran OPTIONAL) +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 +# ---------------------- +#add_subdirectory(C) +if (CMAKE_Fortran_COMPILER) + add_subdirectory(Fortran) +endif() diff --git a/InterfaceExamples/UnCoupledLaplace/Fortran/CMakeLists.txt b/InterfaceExamples/UnCoupledLaplace/Fortran/CMakeLists.txt new file mode 100644 index 00000000..4df9f6d9 --- /dev/null +++ b/InterfaceExamples/UnCoupledLaplace/Fortran/CMakeLists.txt @@ -0,0 +1,60 @@ + +# Add example executable +add_executable(UnCoupledLaplace src/UnCoupledLaplaceExample.f90) + +# Turn on Fortran preprocessing (#include directives) +if (MSVC) + set(PROC_OPT "/fpp") +else() + set(PROC_OPT "-cpp") +endif() + +# in debug mode, add flag that make Floating point exceptions fatal +set(OPT "") +if (FALSE) + if(CMAKE_BUILD_TYPE MATCHES DEBUG) + set(OPT "-ffpe-trap=invalid,zero,underflow,overflow,denormal") # GCC: make floating point exceptions fatal + endif() +endif() + +target_compile_options(UnCoupledLaplace PRIVATE ${PROC_OPT} ${OPT} "-fbacktrace") + +# Link to opencmiss +# ----------------- +# +# This simply uses the opencmiss target created by OC_INIT() above. +# +# Alternatively, you can also directly invoke 'find_package(Iron )' 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 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(UnCoupledLaplace PRIVATE opencmiss) + +# Add a simple test that runs the executable +add_test(NAME test_UnCoupledLaplace COMMAND UnCoupledLaplace) +add_opencmiss_environment(test_UnCoupledLaplace) + +################### +# 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. +# diff --git a/InterfaceExamples/UnCoupledLaplace/src/UnCoupledLaplaceExample.f90 b/InterfaceExamples/UnCoupledLaplace/Fortran/src/UnCoupledLaplaceExample.f90 similarity index 100% rename from InterfaceExamples/UnCoupledLaplace/src/UnCoupledLaplaceExample.f90 rename to InterfaceExamples/UnCoupledLaplace/Fortran/src/UnCoupledLaplaceExample.f90 diff --git a/InterfaceExamples/UnCoupledLaplace/OpenCMISS.cmake b/InterfaceExamples/UnCoupledLaplace/OpenCMISS.cmake new file mode 100644 index 00000000..3d6cf515 --- /dev/null +++ b/InterfaceExamples/UnCoupledLaplace/OpenCMISS.cmake @@ -0,0 +1,95 @@ +########################### +# *DO NOT CHANGE THIS FILE* +########################### +# +# Prepares the use of OpenCMISS by scanning at various path locations for OpenCMISS (SDK) installations. +# +# Search order: +# - OPENCMISS_INSTALL_DIR variable +# - OPENCMISS_INSTALL_DIR environment variable +# - OPENCMISS_SDK_DIR variable +# - OPENCMISS_SDK_DIR environment variable +# - [Windows only] The Registry is searched additionally for installed SDKs. +# +# If found +# - Includes the toolchain config script of the found opencmiss installation to enable toolchain selection logic (non-windows) + +# Convenience: The OPENCMISS_INSTALL_DIR may also be defined in the environment and various other places +if (DEFINED OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using specified installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The specified OPENCMISS_INSTALL_DIR '${OPENCMISS_INSTALL_DIR}' does not exist. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_INSTALL_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_INSTALL_DIR}" OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using environment installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The environment variable OPENCMISS_INSTALL_DIR='${OPENCMISS_INSTALL_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if (NOT OPENCMISS_INSTALL_DIR AND DEFINED OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The specified OPENCMISS_SDK_DIR '${OPENCMISS_SDK_DIR}' does not exist. Skipping.") + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_SDK_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_SDK_DIR}" OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using environment SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The environment variable OPENCMISS_SDK_DIR='${OPENCMISS_SDK_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_SDK_DIR) + endif() +endif() +# On windows: check the registry for installed OpenCMISS SDKs +if(NOT OPENCMISS_INSTALL_DIR AND WIN32) + foreach(ROOT HKEY_CURRENT_USER HKEY_LOCAL_MACHINE) + foreach(PACKAGE OpenCMISSUserSDK OpenCMISSDeveloperSDK) + set(_REG_KEY "[${ROOT}\\Software\\Auckland Bioengineering Institute\\${PACKAGE}]") + get_filename_component(OPENCMISS_INSTALL_DIR "${_REG_KEY}" ABSOLUTE) + #message(STATUS "Trying registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Found ${PACKAGE} in Windows registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + break() + else() + unset(OPENCMISS_INSTALL_DIR) + endif() + endforeach() + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + break() + endif() + endforeach() +endif() + +if(OPENCMISS_INSTALL_DIR) + message(STATUS "OPENCMISS_INSTALL_DIR=${OPENCMISS_INSTALL_DIR}") + # Use the OpenCMISS scripts to also allow choosing a separate toolchain + # This file is located at the opencmiss installation rather than the local example + # as it avoids file replication and makes maintenance much easier + if (TOOLCHAIN) + set(_OCTC ${OPENCMISS_INSTALL_DIR}/cmake/OCToolchainCompilers.cmake) + if (EXISTS "${_OCTC}") + include(${_OCTC}) + else() + message(WARNING "TOOLCHAIN specified but OpenCMISS config script could not be found at ${_OCTC}. Trying CMake defaults.") + endif() + unset(_OCTC) + endif() + set(OpenCMISS_DIR "${OPENCMISS_INSTALL_DIR}" CACHE PATH "Path to the found OpenCMISS (SDK) installation") +else() + message(WARNING "No OpenCMISS (SDK) installation directory detected. Using default system environment.") +endif() + \ No newline at end of file diff --git a/InterfaceExamples/UnCoupledLaplace/build_debug/build.sh b/InterfaceExamples/UnCoupledLaplace/build_debug/build.sh new file mode 100644 index 00000000..e6624bac --- /dev/null +++ b/InterfaceExamples/UnCoupledLaplace/build_debug/build.sh @@ -0,0 +1,2 @@ +#ccc && cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all +cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all diff --git a/LinearElasticity/2DExtensionPlaneStressLagrangeBasis/CMakeLists.txt b/LinearElasticity/2DExtensionPlaneStressLagrangeBasis/CMakeLists.txt new file mode 100644 index 00000000..a22b61ee --- /dev/null +++ b/LinearElasticity/2DExtensionPlaneStressLagrangeBasis/CMakeLists.txt @@ -0,0 +1,35 @@ +# 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 C) +enable_language(Fortran OPTIONAL) +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 +# ---------------------- +#add_subdirectory(C) +if (CMAKE_Fortran_COMPILER) + add_subdirectory(Fortran) +endif() diff --git a/LinearElasticity/2DExtensionPlaneStressLagrangeBasis/Fortran/CMakeLists.txt b/LinearElasticity/2DExtensionPlaneStressLagrangeBasis/Fortran/CMakeLists.txt new file mode 100644 index 00000000..c16cc7b1 --- /dev/null +++ b/LinearElasticity/2DExtensionPlaneStressLagrangeBasis/Fortran/CMakeLists.txt @@ -0,0 +1,60 @@ + +# Add example executable +add_executable(2DExtensionPlaneStressLagrangeBasis src/2DExtensionPlaneStressLagrangeBasisExample.f90) + +# Turn on Fortran preprocessing (#include directives) +if (MSVC) + set(PROC_OPT "/fpp") +else() + set(PROC_OPT "-cpp") +endif() + +# in debug mode, add flag that make Floating point exceptions fatal +set(OPT "") +if (FALSE) + if(CMAKE_BUILD_TYPE MATCHES DEBUG) + set(OPT "-ffpe-trap=invalid,zero,underflow,overflow,denormal") # GCC: make floating point exceptions fatal + endif() +endif() + +target_compile_options(2DExtensionPlaneStressLagrangeBasis PRIVATE ${PROC_OPT} ${OPT} "-fbacktrace") + +# Link to opencmiss +# ----------------- +# +# This simply uses the opencmiss target created by OC_INIT() above. +# +# Alternatively, you can also directly invoke 'find_package(Iron )' 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 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(2DExtensionPlaneStressLagrangeBasis PRIVATE opencmiss) + +# Add a simple test that runs the executable +add_test(NAME test_2DExtensionPlaneStressLagrangeBasis COMMAND 2DExtensionPlaneStressLagrangeBasis) +add_opencmiss_environment(test_2DExtensionPlaneStressLagrangeBasis) + +################### +# 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. +# diff --git a/LinearElasticity/2DExtensionPlaneStressLagrangeBasis/src/2DExtensionPlaneStressLagrangeBasisExample.f90 b/LinearElasticity/2DExtensionPlaneStressLagrangeBasis/Fortran/src/2DExtensionPlaneStressLagrangeBasisExample.f90 similarity index 100% rename from LinearElasticity/2DExtensionPlaneStressLagrangeBasis/src/2DExtensionPlaneStressLagrangeBasisExample.f90 rename to LinearElasticity/2DExtensionPlaneStressLagrangeBasis/Fortran/src/2DExtensionPlaneStressLagrangeBasisExample.f90 diff --git a/LinearElasticity/2DExtensionPlaneStressLagrangeBasis/OpenCMISS.cmake b/LinearElasticity/2DExtensionPlaneStressLagrangeBasis/OpenCMISS.cmake new file mode 100644 index 00000000..3d6cf515 --- /dev/null +++ b/LinearElasticity/2DExtensionPlaneStressLagrangeBasis/OpenCMISS.cmake @@ -0,0 +1,95 @@ +########################### +# *DO NOT CHANGE THIS FILE* +########################### +# +# Prepares the use of OpenCMISS by scanning at various path locations for OpenCMISS (SDK) installations. +# +# Search order: +# - OPENCMISS_INSTALL_DIR variable +# - OPENCMISS_INSTALL_DIR environment variable +# - OPENCMISS_SDK_DIR variable +# - OPENCMISS_SDK_DIR environment variable +# - [Windows only] The Registry is searched additionally for installed SDKs. +# +# If found +# - Includes the toolchain config script of the found opencmiss installation to enable toolchain selection logic (non-windows) + +# Convenience: The OPENCMISS_INSTALL_DIR may also be defined in the environment and various other places +if (DEFINED OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using specified installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The specified OPENCMISS_INSTALL_DIR '${OPENCMISS_INSTALL_DIR}' does not exist. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_INSTALL_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_INSTALL_DIR}" OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using environment installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The environment variable OPENCMISS_INSTALL_DIR='${OPENCMISS_INSTALL_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if (NOT OPENCMISS_INSTALL_DIR AND DEFINED OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The specified OPENCMISS_SDK_DIR '${OPENCMISS_SDK_DIR}' does not exist. Skipping.") + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_SDK_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_SDK_DIR}" OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using environment SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The environment variable OPENCMISS_SDK_DIR='${OPENCMISS_SDK_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_SDK_DIR) + endif() +endif() +# On windows: check the registry for installed OpenCMISS SDKs +if(NOT OPENCMISS_INSTALL_DIR AND WIN32) + foreach(ROOT HKEY_CURRENT_USER HKEY_LOCAL_MACHINE) + foreach(PACKAGE OpenCMISSUserSDK OpenCMISSDeveloperSDK) + set(_REG_KEY "[${ROOT}\\Software\\Auckland Bioengineering Institute\\${PACKAGE}]") + get_filename_component(OPENCMISS_INSTALL_DIR "${_REG_KEY}" ABSOLUTE) + #message(STATUS "Trying registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Found ${PACKAGE} in Windows registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + break() + else() + unset(OPENCMISS_INSTALL_DIR) + endif() + endforeach() + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + break() + endif() + endforeach() +endif() + +if(OPENCMISS_INSTALL_DIR) + message(STATUS "OPENCMISS_INSTALL_DIR=${OPENCMISS_INSTALL_DIR}") + # Use the OpenCMISS scripts to also allow choosing a separate toolchain + # This file is located at the opencmiss installation rather than the local example + # as it avoids file replication and makes maintenance much easier + if (TOOLCHAIN) + set(_OCTC ${OPENCMISS_INSTALL_DIR}/cmake/OCToolchainCompilers.cmake) + if (EXISTS "${_OCTC}") + include(${_OCTC}) + else() + message(WARNING "TOOLCHAIN specified but OpenCMISS config script could not be found at ${_OCTC}. Trying CMake defaults.") + endif() + unset(_OCTC) + endif() + set(OpenCMISS_DIR "${OPENCMISS_INSTALL_DIR}" CACHE PATH "Path to the found OpenCMISS (SDK) installation") +else() + message(WARNING "No OpenCMISS (SDK) installation directory detected. Using default system environment.") +endif() + \ No newline at end of file diff --git a/LinearElasticity/2DExtensionPlaneStressLagrangeBasis/build_debug/build.sh b/LinearElasticity/2DExtensionPlaneStressLagrangeBasis/build_debug/build.sh new file mode 100644 index 00000000..e6624bac --- /dev/null +++ b/LinearElasticity/2DExtensionPlaneStressLagrangeBasis/build_debug/build.sh @@ -0,0 +1,2 @@ +#ccc && cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all +cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all diff --git a/LinearElasticity/3DExtensionHermiteBasis/CMakeLists.txt b/LinearElasticity/3DExtensionHermiteBasis/CMakeLists.txt new file mode 100644 index 00000000..a22b61ee --- /dev/null +++ b/LinearElasticity/3DExtensionHermiteBasis/CMakeLists.txt @@ -0,0 +1,35 @@ +# 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 C) +enable_language(Fortran OPTIONAL) +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 +# ---------------------- +#add_subdirectory(C) +if (CMAKE_Fortran_COMPILER) + add_subdirectory(Fortran) +endif() diff --git a/LinearElasticity/3DExtensionHermiteBasis/Fortran/CMakeLists.txt b/LinearElasticity/3DExtensionHermiteBasis/Fortran/CMakeLists.txt new file mode 100644 index 00000000..28ea81f3 --- /dev/null +++ b/LinearElasticity/3DExtensionHermiteBasis/Fortran/CMakeLists.txt @@ -0,0 +1,60 @@ + +# Add example executable +add_executable(3DExtensionHermiteBasis src/3DExtensionHermiteBasisExample.f90) + +# Turn on Fortran preprocessing (#include directives) +if (MSVC) + set(PROC_OPT "/fpp") +else() + set(PROC_OPT "-cpp") +endif() + +# in debug mode, add flag that make Floating point exceptions fatal +set(OPT "") +if (FALSE) + if(CMAKE_BUILD_TYPE MATCHES DEBUG) + set(OPT "-ffpe-trap=invalid,zero,underflow,overflow,denormal") # GCC: make floating point exceptions fatal + endif() +endif() + +target_compile_options(3DExtensionHermiteBasis PRIVATE ${PROC_OPT} ${OPT} "-fbacktrace") + +# Link to opencmiss +# ----------------- +# +# This simply uses the opencmiss target created by OC_INIT() above. +# +# Alternatively, you can also directly invoke 'find_package(Iron )' 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 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(3DExtensionHermiteBasis PRIVATE opencmiss) + +# Add a simple test that runs the executable +add_test(NAME test_3DExtensionHermiteBasis COMMAND 3DExtensionHermiteBasis) +add_opencmiss_environment(test_3DExtensionHermiteBasis) + +################### +# 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. +# diff --git a/LinearElasticity/3DExtensionHermiteBasis/src/3DExtensionHermiteBasisExample.f90 b/LinearElasticity/3DExtensionHermiteBasis/Fortran/src/3DExtensionHermiteBasisExample.f90 similarity index 100% rename from LinearElasticity/3DExtensionHermiteBasis/src/3DExtensionHermiteBasisExample.f90 rename to LinearElasticity/3DExtensionHermiteBasis/Fortran/src/3DExtensionHermiteBasisExample.f90 diff --git a/LinearElasticity/3DExtensionHermiteBasis/OpenCMISS.cmake b/LinearElasticity/3DExtensionHermiteBasis/OpenCMISS.cmake new file mode 100644 index 00000000..3d6cf515 --- /dev/null +++ b/LinearElasticity/3DExtensionHermiteBasis/OpenCMISS.cmake @@ -0,0 +1,95 @@ +########################### +# *DO NOT CHANGE THIS FILE* +########################### +# +# Prepares the use of OpenCMISS by scanning at various path locations for OpenCMISS (SDK) installations. +# +# Search order: +# - OPENCMISS_INSTALL_DIR variable +# - OPENCMISS_INSTALL_DIR environment variable +# - OPENCMISS_SDK_DIR variable +# - OPENCMISS_SDK_DIR environment variable +# - [Windows only] The Registry is searched additionally for installed SDKs. +# +# If found +# - Includes the toolchain config script of the found opencmiss installation to enable toolchain selection logic (non-windows) + +# Convenience: The OPENCMISS_INSTALL_DIR may also be defined in the environment and various other places +if (DEFINED OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using specified installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The specified OPENCMISS_INSTALL_DIR '${OPENCMISS_INSTALL_DIR}' does not exist. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_INSTALL_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_INSTALL_DIR}" OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using environment installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The environment variable OPENCMISS_INSTALL_DIR='${OPENCMISS_INSTALL_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if (NOT OPENCMISS_INSTALL_DIR AND DEFINED OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The specified OPENCMISS_SDK_DIR '${OPENCMISS_SDK_DIR}' does not exist. Skipping.") + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_SDK_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_SDK_DIR}" OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using environment SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The environment variable OPENCMISS_SDK_DIR='${OPENCMISS_SDK_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_SDK_DIR) + endif() +endif() +# On windows: check the registry for installed OpenCMISS SDKs +if(NOT OPENCMISS_INSTALL_DIR AND WIN32) + foreach(ROOT HKEY_CURRENT_USER HKEY_LOCAL_MACHINE) + foreach(PACKAGE OpenCMISSUserSDK OpenCMISSDeveloperSDK) + set(_REG_KEY "[${ROOT}\\Software\\Auckland Bioengineering Institute\\${PACKAGE}]") + get_filename_component(OPENCMISS_INSTALL_DIR "${_REG_KEY}" ABSOLUTE) + #message(STATUS "Trying registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Found ${PACKAGE} in Windows registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + break() + else() + unset(OPENCMISS_INSTALL_DIR) + endif() + endforeach() + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + break() + endif() + endforeach() +endif() + +if(OPENCMISS_INSTALL_DIR) + message(STATUS "OPENCMISS_INSTALL_DIR=${OPENCMISS_INSTALL_DIR}") + # Use the OpenCMISS scripts to also allow choosing a separate toolchain + # This file is located at the opencmiss installation rather than the local example + # as it avoids file replication and makes maintenance much easier + if (TOOLCHAIN) + set(_OCTC ${OPENCMISS_INSTALL_DIR}/cmake/OCToolchainCompilers.cmake) + if (EXISTS "${_OCTC}") + include(${_OCTC}) + else() + message(WARNING "TOOLCHAIN specified but OpenCMISS config script could not be found at ${_OCTC}. Trying CMake defaults.") + endif() + unset(_OCTC) + endif() + set(OpenCMISS_DIR "${OPENCMISS_INSTALL_DIR}" CACHE PATH "Path to the found OpenCMISS (SDK) installation") +else() + message(WARNING "No OpenCMISS (SDK) installation directory detected. Using default system environment.") +endif() + \ No newline at end of file diff --git a/LinearElasticity/3DExtensionHermiteBasis/build_debug/build.sh b/LinearElasticity/3DExtensionHermiteBasis/build_debug/build.sh new file mode 100644 index 00000000..e6624bac --- /dev/null +++ b/LinearElasticity/3DExtensionHermiteBasis/build_debug/build.sh @@ -0,0 +1,2 @@ +#ccc && cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all +cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all diff --git a/LinearElasticity/3DExtensionLagrangeBasis/CMakeLists.txt b/LinearElasticity/3DExtensionLagrangeBasis/CMakeLists.txt new file mode 100644 index 00000000..a22b61ee --- /dev/null +++ b/LinearElasticity/3DExtensionLagrangeBasis/CMakeLists.txt @@ -0,0 +1,35 @@ +# 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 C) +enable_language(Fortran OPTIONAL) +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 +# ---------------------- +#add_subdirectory(C) +if (CMAKE_Fortran_COMPILER) + add_subdirectory(Fortran) +endif() diff --git a/LinearElasticity/3DExtensionLagrangeBasis/Fortran/CMakeLists.txt b/LinearElasticity/3DExtensionLagrangeBasis/Fortran/CMakeLists.txt new file mode 100644 index 00000000..36e232aa --- /dev/null +++ b/LinearElasticity/3DExtensionLagrangeBasis/Fortran/CMakeLists.txt @@ -0,0 +1,60 @@ + +# Add example executable +add_executable(3DExtensionLagrangeBasis src/3DExtensionLagrangeBasisExample.f90) + +# Turn on Fortran preprocessing (#include directives) +if (MSVC) + set(PROC_OPT "/fpp") +else() + set(PROC_OPT "-cpp") +endif() + +# in debug mode, add flag that make Floating point exceptions fatal +set(OPT "") +if (FALSE) + if(CMAKE_BUILD_TYPE MATCHES DEBUG) + set(OPT "-ffpe-trap=invalid,zero,underflow,overflow,denormal") # GCC: make floating point exceptions fatal + endif() +endif() + +target_compile_options(3DExtensionLagrangeBasis PRIVATE ${PROC_OPT} ${OPT} "-fbacktrace") + +# Link to opencmiss +# ----------------- +# +# This simply uses the opencmiss target created by OC_INIT() above. +# +# Alternatively, you can also directly invoke 'find_package(Iron )' 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 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(3DExtensionLagrangeBasis PRIVATE opencmiss) + +# Add a simple test that runs the executable +add_test(NAME test_3DExtensionLagrangeBasis COMMAND 3DExtensionLagrangeBasis) +add_opencmiss_environment(test_3DExtensionLagrangeBasis) + +################### +# 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. +# diff --git a/LinearElasticity/3DExtensionLagrangeBasis/src/3DExtensionLagrangeBasisExample.f90 b/LinearElasticity/3DExtensionLagrangeBasis/Fortran/src/3DExtensionLagrangeBasisExample.f90 similarity index 100% rename from LinearElasticity/3DExtensionLagrangeBasis/src/3DExtensionLagrangeBasisExample.f90 rename to LinearElasticity/3DExtensionLagrangeBasis/Fortran/src/3DExtensionLagrangeBasisExample.f90 diff --git a/LinearElasticity/3DExtensionLagrangeBasis/OpenCMISS.cmake b/LinearElasticity/3DExtensionLagrangeBasis/OpenCMISS.cmake new file mode 100644 index 00000000..3d6cf515 --- /dev/null +++ b/LinearElasticity/3DExtensionLagrangeBasis/OpenCMISS.cmake @@ -0,0 +1,95 @@ +########################### +# *DO NOT CHANGE THIS FILE* +########################### +# +# Prepares the use of OpenCMISS by scanning at various path locations for OpenCMISS (SDK) installations. +# +# Search order: +# - OPENCMISS_INSTALL_DIR variable +# - OPENCMISS_INSTALL_DIR environment variable +# - OPENCMISS_SDK_DIR variable +# - OPENCMISS_SDK_DIR environment variable +# - [Windows only] The Registry is searched additionally for installed SDKs. +# +# If found +# - Includes the toolchain config script of the found opencmiss installation to enable toolchain selection logic (non-windows) + +# Convenience: The OPENCMISS_INSTALL_DIR may also be defined in the environment and various other places +if (DEFINED OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using specified installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The specified OPENCMISS_INSTALL_DIR '${OPENCMISS_INSTALL_DIR}' does not exist. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_INSTALL_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_INSTALL_DIR}" OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using environment installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The environment variable OPENCMISS_INSTALL_DIR='${OPENCMISS_INSTALL_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if (NOT OPENCMISS_INSTALL_DIR AND DEFINED OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The specified OPENCMISS_SDK_DIR '${OPENCMISS_SDK_DIR}' does not exist. Skipping.") + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_SDK_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_SDK_DIR}" OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using environment SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The environment variable OPENCMISS_SDK_DIR='${OPENCMISS_SDK_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_SDK_DIR) + endif() +endif() +# On windows: check the registry for installed OpenCMISS SDKs +if(NOT OPENCMISS_INSTALL_DIR AND WIN32) + foreach(ROOT HKEY_CURRENT_USER HKEY_LOCAL_MACHINE) + foreach(PACKAGE OpenCMISSUserSDK OpenCMISSDeveloperSDK) + set(_REG_KEY "[${ROOT}\\Software\\Auckland Bioengineering Institute\\${PACKAGE}]") + get_filename_component(OPENCMISS_INSTALL_DIR "${_REG_KEY}" ABSOLUTE) + #message(STATUS "Trying registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Found ${PACKAGE} in Windows registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + break() + else() + unset(OPENCMISS_INSTALL_DIR) + endif() + endforeach() + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + break() + endif() + endforeach() +endif() + +if(OPENCMISS_INSTALL_DIR) + message(STATUS "OPENCMISS_INSTALL_DIR=${OPENCMISS_INSTALL_DIR}") + # Use the OpenCMISS scripts to also allow choosing a separate toolchain + # This file is located at the opencmiss installation rather than the local example + # as it avoids file replication and makes maintenance much easier + if (TOOLCHAIN) + set(_OCTC ${OPENCMISS_INSTALL_DIR}/cmake/OCToolchainCompilers.cmake) + if (EXISTS "${_OCTC}") + include(${_OCTC}) + else() + message(WARNING "TOOLCHAIN specified but OpenCMISS config script could not be found at ${_OCTC}. Trying CMake defaults.") + endif() + unset(_OCTC) + endif() + set(OpenCMISS_DIR "${OPENCMISS_INSTALL_DIR}" CACHE PATH "Path to the found OpenCMISS (SDK) installation") +else() + message(WARNING "No OpenCMISS (SDK) installation directory detected. Using default system environment.") +endif() + \ No newline at end of file diff --git a/LinearElasticity/3DExtensionLagrangeBasis/build_debug/build.sh b/LinearElasticity/3DExtensionLagrangeBasis/build_debug/build.sh new file mode 100644 index 00000000..e6624bac --- /dev/null +++ b/LinearElasticity/3DExtensionLagrangeBasis/build_debug/build.sh @@ -0,0 +1,2 @@ +#ccc && cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all +cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all diff --git a/LinearElasticity/Analytic/CantileverBeam/CMakeLists.txt b/LinearElasticity/Analytic/CantileverBeam/CMakeLists.txt new file mode 100644 index 00000000..a22b61ee --- /dev/null +++ b/LinearElasticity/Analytic/CantileverBeam/CMakeLists.txt @@ -0,0 +1,35 @@ +# 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 C) +enable_language(Fortran OPTIONAL) +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 +# ---------------------- +#add_subdirectory(C) +if (CMAKE_Fortran_COMPILER) + add_subdirectory(Fortran) +endif() diff --git a/LinearElasticity/Analytic/CantileverBeam/Fortran/CMakeLists.txt b/LinearElasticity/Analytic/CantileverBeam/Fortran/CMakeLists.txt new file mode 100644 index 00000000..eebeadf8 --- /dev/null +++ b/LinearElasticity/Analytic/CantileverBeam/Fortran/CMakeLists.txt @@ -0,0 +1,60 @@ + +# Add example executable +add_executable(CantileverBeam src/CantileverBeamExample.f90) + +# Turn on Fortran preprocessing (#include directives) +if (MSVC) + set(PROC_OPT "/fpp") +else() + set(PROC_OPT "-cpp") +endif() + +# in debug mode, add flag that make Floating point exceptions fatal +set(OPT "") +if (FALSE) + if(CMAKE_BUILD_TYPE MATCHES DEBUG) + set(OPT "-ffpe-trap=invalid,zero,underflow,overflow,denormal") # GCC: make floating point exceptions fatal + endif() +endif() + +target_compile_options(CantileverBeam PRIVATE ${PROC_OPT} ${OPT} "-fbacktrace") + +# Link to opencmiss +# ----------------- +# +# This simply uses the opencmiss target created by OC_INIT() above. +# +# Alternatively, you can also directly invoke 'find_package(Iron )' 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 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(CantileverBeam PRIVATE opencmiss) + +# Add a simple test that runs the executable +add_test(NAME test_CantileverBeam COMMAND CantileverBeam) +add_opencmiss_environment(test_CantileverBeam) + +################### +# 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. +# diff --git a/LinearElasticity/Analytic/CantileverBeam/src/CantileverBeamExample.f90 b/LinearElasticity/Analytic/CantileverBeam/Fortran/src/CantileverBeamExample.f90 similarity index 100% rename from LinearElasticity/Analytic/CantileverBeam/src/CantileverBeamExample.f90 rename to LinearElasticity/Analytic/CantileverBeam/Fortran/src/CantileverBeamExample.f90 diff --git a/LinearElasticity/Analytic/CantileverBeam/OpenCMISS.cmake b/LinearElasticity/Analytic/CantileverBeam/OpenCMISS.cmake new file mode 100644 index 00000000..3d6cf515 --- /dev/null +++ b/LinearElasticity/Analytic/CantileverBeam/OpenCMISS.cmake @@ -0,0 +1,95 @@ +########################### +# *DO NOT CHANGE THIS FILE* +########################### +# +# Prepares the use of OpenCMISS by scanning at various path locations for OpenCMISS (SDK) installations. +# +# Search order: +# - OPENCMISS_INSTALL_DIR variable +# - OPENCMISS_INSTALL_DIR environment variable +# - OPENCMISS_SDK_DIR variable +# - OPENCMISS_SDK_DIR environment variable +# - [Windows only] The Registry is searched additionally for installed SDKs. +# +# If found +# - Includes the toolchain config script of the found opencmiss installation to enable toolchain selection logic (non-windows) + +# Convenience: The OPENCMISS_INSTALL_DIR may also be defined in the environment and various other places +if (DEFINED OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using specified installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The specified OPENCMISS_INSTALL_DIR '${OPENCMISS_INSTALL_DIR}' does not exist. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_INSTALL_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_INSTALL_DIR}" OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using environment installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The environment variable OPENCMISS_INSTALL_DIR='${OPENCMISS_INSTALL_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if (NOT OPENCMISS_INSTALL_DIR AND DEFINED OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The specified OPENCMISS_SDK_DIR '${OPENCMISS_SDK_DIR}' does not exist. Skipping.") + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_SDK_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_SDK_DIR}" OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using environment SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The environment variable OPENCMISS_SDK_DIR='${OPENCMISS_SDK_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_SDK_DIR) + endif() +endif() +# On windows: check the registry for installed OpenCMISS SDKs +if(NOT OPENCMISS_INSTALL_DIR AND WIN32) + foreach(ROOT HKEY_CURRENT_USER HKEY_LOCAL_MACHINE) + foreach(PACKAGE OpenCMISSUserSDK OpenCMISSDeveloperSDK) + set(_REG_KEY "[${ROOT}\\Software\\Auckland Bioengineering Institute\\${PACKAGE}]") + get_filename_component(OPENCMISS_INSTALL_DIR "${_REG_KEY}" ABSOLUTE) + #message(STATUS "Trying registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Found ${PACKAGE} in Windows registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + break() + else() + unset(OPENCMISS_INSTALL_DIR) + endif() + endforeach() + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + break() + endif() + endforeach() +endif() + +if(OPENCMISS_INSTALL_DIR) + message(STATUS "OPENCMISS_INSTALL_DIR=${OPENCMISS_INSTALL_DIR}") + # Use the OpenCMISS scripts to also allow choosing a separate toolchain + # This file is located at the opencmiss installation rather than the local example + # as it avoids file replication and makes maintenance much easier + if (TOOLCHAIN) + set(_OCTC ${OPENCMISS_INSTALL_DIR}/cmake/OCToolchainCompilers.cmake) + if (EXISTS "${_OCTC}") + include(${_OCTC}) + else() + message(WARNING "TOOLCHAIN specified but OpenCMISS config script could not be found at ${_OCTC}. Trying CMake defaults.") + endif() + unset(_OCTC) + endif() + set(OpenCMISS_DIR "${OPENCMISS_INSTALL_DIR}" CACHE PATH "Path to the found OpenCMISS (SDK) installation") +else() + message(WARNING "No OpenCMISS (SDK) installation directory detected. Using default system environment.") +endif() + \ No newline at end of file diff --git a/LinearElasticity/Analytic/CantileverBeam/build_debug/build.sh b/LinearElasticity/Analytic/CantileverBeam/build_debug/build.sh new file mode 100644 index 00000000..e6624bac --- /dev/null +++ b/LinearElasticity/Analytic/CantileverBeam/build_debug/build.sh @@ -0,0 +1,2 @@ +#ccc && cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all +cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all diff --git a/LinearElasticity/Analytic/Extension/CMakeLists.txt b/LinearElasticity/Analytic/Extension/CMakeLists.txt new file mode 100644 index 00000000..a22b61ee --- /dev/null +++ b/LinearElasticity/Analytic/Extension/CMakeLists.txt @@ -0,0 +1,35 @@ +# 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 C) +enable_language(Fortran OPTIONAL) +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 +# ---------------------- +#add_subdirectory(C) +if (CMAKE_Fortran_COMPILER) + add_subdirectory(Fortran) +endif() diff --git a/LinearElasticity/Analytic/Extension/Fortran/CMakeLists.txt b/LinearElasticity/Analytic/Extension/Fortran/CMakeLists.txt new file mode 100644 index 00000000..54c08fb2 --- /dev/null +++ b/LinearElasticity/Analytic/Extension/Fortran/CMakeLists.txt @@ -0,0 +1,60 @@ + +# Add example executable +add_executable(Extension src/ExtensionExample.f90) + +# Turn on Fortran preprocessing (#include directives) +if (MSVC) + set(PROC_OPT "/fpp") +else() + set(PROC_OPT "-cpp") +endif() + +# in debug mode, add flag that make Floating point exceptions fatal +set(OPT "") +if (FALSE) + if(CMAKE_BUILD_TYPE MATCHES DEBUG) + set(OPT "-ffpe-trap=invalid,zero,underflow,overflow,denormal") # GCC: make floating point exceptions fatal + endif() +endif() + +target_compile_options(Extension PRIVATE ${PROC_OPT} ${OPT} "-fbacktrace") + +# Link to opencmiss +# ----------------- +# +# This simply uses the opencmiss target created by OC_INIT() above. +# +# Alternatively, you can also directly invoke 'find_package(Iron )' 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 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(Extension PRIVATE opencmiss) + +# Add a simple test that runs the executable +add_test(NAME test_Extension COMMAND Extension) +add_opencmiss_environment(test_Extension) + +################### +# 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. +# diff --git a/LinearElasticity/Analytic/Extension/src/ExtensionExample.f90 b/LinearElasticity/Analytic/Extension/Fortran/src/ExtensionExample.f90 similarity index 100% rename from LinearElasticity/Analytic/Extension/src/ExtensionExample.f90 rename to LinearElasticity/Analytic/Extension/Fortran/src/ExtensionExample.f90 diff --git a/LinearElasticity/Analytic/Extension/OpenCMISS.cmake b/LinearElasticity/Analytic/Extension/OpenCMISS.cmake new file mode 100644 index 00000000..3d6cf515 --- /dev/null +++ b/LinearElasticity/Analytic/Extension/OpenCMISS.cmake @@ -0,0 +1,95 @@ +########################### +# *DO NOT CHANGE THIS FILE* +########################### +# +# Prepares the use of OpenCMISS by scanning at various path locations for OpenCMISS (SDK) installations. +# +# Search order: +# - OPENCMISS_INSTALL_DIR variable +# - OPENCMISS_INSTALL_DIR environment variable +# - OPENCMISS_SDK_DIR variable +# - OPENCMISS_SDK_DIR environment variable +# - [Windows only] The Registry is searched additionally for installed SDKs. +# +# If found +# - Includes the toolchain config script of the found opencmiss installation to enable toolchain selection logic (non-windows) + +# Convenience: The OPENCMISS_INSTALL_DIR may also be defined in the environment and various other places +if (DEFINED OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using specified installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The specified OPENCMISS_INSTALL_DIR '${OPENCMISS_INSTALL_DIR}' does not exist. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_INSTALL_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_INSTALL_DIR}" OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using environment installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The environment variable OPENCMISS_INSTALL_DIR='${OPENCMISS_INSTALL_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if (NOT OPENCMISS_INSTALL_DIR AND DEFINED OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The specified OPENCMISS_SDK_DIR '${OPENCMISS_SDK_DIR}' does not exist. Skipping.") + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_SDK_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_SDK_DIR}" OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using environment SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The environment variable OPENCMISS_SDK_DIR='${OPENCMISS_SDK_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_SDK_DIR) + endif() +endif() +# On windows: check the registry for installed OpenCMISS SDKs +if(NOT OPENCMISS_INSTALL_DIR AND WIN32) + foreach(ROOT HKEY_CURRENT_USER HKEY_LOCAL_MACHINE) + foreach(PACKAGE OpenCMISSUserSDK OpenCMISSDeveloperSDK) + set(_REG_KEY "[${ROOT}\\Software\\Auckland Bioengineering Institute\\${PACKAGE}]") + get_filename_component(OPENCMISS_INSTALL_DIR "${_REG_KEY}" ABSOLUTE) + #message(STATUS "Trying registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Found ${PACKAGE} in Windows registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + break() + else() + unset(OPENCMISS_INSTALL_DIR) + endif() + endforeach() + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + break() + endif() + endforeach() +endif() + +if(OPENCMISS_INSTALL_DIR) + message(STATUS "OPENCMISS_INSTALL_DIR=${OPENCMISS_INSTALL_DIR}") + # Use the OpenCMISS scripts to also allow choosing a separate toolchain + # This file is located at the opencmiss installation rather than the local example + # as it avoids file replication and makes maintenance much easier + if (TOOLCHAIN) + set(_OCTC ${OPENCMISS_INSTALL_DIR}/cmake/OCToolchainCompilers.cmake) + if (EXISTS "${_OCTC}") + include(${_OCTC}) + else() + message(WARNING "TOOLCHAIN specified but OpenCMISS config script could not be found at ${_OCTC}. Trying CMake defaults.") + endif() + unset(_OCTC) + endif() + set(OpenCMISS_DIR "${OPENCMISS_INSTALL_DIR}" CACHE PATH "Path to the found OpenCMISS (SDK) installation") +else() + message(WARNING "No OpenCMISS (SDK) installation directory detected. Using default system environment.") +endif() + \ No newline at end of file diff --git a/LinearElasticity/Analytic/Extension/build_debug/build.sh b/LinearElasticity/Analytic/Extension/build_debug/build.sh new file mode 100644 index 00000000..e6624bac --- /dev/null +++ b/LinearElasticity/Analytic/Extension/build_debug/build.sh @@ -0,0 +1,2 @@ +#ccc && cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all +cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all diff --git a/Meshes/1DCubicHermite/CMakeLists.txt b/Meshes/1DCubicHermite/CMakeLists.txt new file mode 100644 index 00000000..a22b61ee --- /dev/null +++ b/Meshes/1DCubicHermite/CMakeLists.txt @@ -0,0 +1,35 @@ +# 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 C) +enable_language(Fortran OPTIONAL) +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 +# ---------------------- +#add_subdirectory(C) +if (CMAKE_Fortran_COMPILER) + add_subdirectory(Fortran) +endif() diff --git a/Meshes/1DCubicHermite/Fortran/CMakeLists.txt b/Meshes/1DCubicHermite/Fortran/CMakeLists.txt new file mode 100644 index 00000000..293a8510 --- /dev/null +++ b/Meshes/1DCubicHermite/Fortran/CMakeLists.txt @@ -0,0 +1,60 @@ + +# Add example executable +add_executable(1DCubicHermite src/1DCubicHermiteExample.f90) + +# Turn on Fortran preprocessing (#include directives) +if (MSVC) + set(PROC_OPT "/fpp") +else() + set(PROC_OPT "-cpp") +endif() + +# in debug mode, add flag that make Floating point exceptions fatal +set(OPT "") +if (FALSE) + if(CMAKE_BUILD_TYPE MATCHES DEBUG) + set(OPT "-ffpe-trap=invalid,zero,underflow,overflow,denormal") # GCC: make floating point exceptions fatal + endif() +endif() + +target_compile_options(1DCubicHermite PRIVATE ${PROC_OPT} ${OPT} "-fbacktrace") + +# Link to opencmiss +# ----------------- +# +# This simply uses the opencmiss target created by OC_INIT() above. +# +# Alternatively, you can also directly invoke 'find_package(Iron )' 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 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(1DCubicHermite PRIVATE opencmiss) + +# Add a simple test that runs the executable +add_test(NAME test_1DCubicHermite COMMAND 1DCubicHermite) +add_opencmiss_environment(test_1DCubicHermite) + +################### +# 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. +# diff --git a/Meshes/1DCubicHermite/src/1DCubicHermiteExample.f90 b/Meshes/1DCubicHermite/Fortran/src/1DCubicHermiteExample.f90 similarity index 100% rename from Meshes/1DCubicHermite/src/1DCubicHermiteExample.f90 rename to Meshes/1DCubicHermite/Fortran/src/1DCubicHermiteExample.f90 diff --git a/Meshes/1DCubicHermite/OpenCMISS.cmake b/Meshes/1DCubicHermite/OpenCMISS.cmake new file mode 100644 index 00000000..3d6cf515 --- /dev/null +++ b/Meshes/1DCubicHermite/OpenCMISS.cmake @@ -0,0 +1,95 @@ +########################### +# *DO NOT CHANGE THIS FILE* +########################### +# +# Prepares the use of OpenCMISS by scanning at various path locations for OpenCMISS (SDK) installations. +# +# Search order: +# - OPENCMISS_INSTALL_DIR variable +# - OPENCMISS_INSTALL_DIR environment variable +# - OPENCMISS_SDK_DIR variable +# - OPENCMISS_SDK_DIR environment variable +# - [Windows only] The Registry is searched additionally for installed SDKs. +# +# If found +# - Includes the toolchain config script of the found opencmiss installation to enable toolchain selection logic (non-windows) + +# Convenience: The OPENCMISS_INSTALL_DIR may also be defined in the environment and various other places +if (DEFINED OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using specified installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The specified OPENCMISS_INSTALL_DIR '${OPENCMISS_INSTALL_DIR}' does not exist. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_INSTALL_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_INSTALL_DIR}" OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using environment installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The environment variable OPENCMISS_INSTALL_DIR='${OPENCMISS_INSTALL_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if (NOT OPENCMISS_INSTALL_DIR AND DEFINED OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The specified OPENCMISS_SDK_DIR '${OPENCMISS_SDK_DIR}' does not exist. Skipping.") + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_SDK_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_SDK_DIR}" OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using environment SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The environment variable OPENCMISS_SDK_DIR='${OPENCMISS_SDK_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_SDK_DIR) + endif() +endif() +# On windows: check the registry for installed OpenCMISS SDKs +if(NOT OPENCMISS_INSTALL_DIR AND WIN32) + foreach(ROOT HKEY_CURRENT_USER HKEY_LOCAL_MACHINE) + foreach(PACKAGE OpenCMISSUserSDK OpenCMISSDeveloperSDK) + set(_REG_KEY "[${ROOT}\\Software\\Auckland Bioengineering Institute\\${PACKAGE}]") + get_filename_component(OPENCMISS_INSTALL_DIR "${_REG_KEY}" ABSOLUTE) + #message(STATUS "Trying registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Found ${PACKAGE} in Windows registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + break() + else() + unset(OPENCMISS_INSTALL_DIR) + endif() + endforeach() + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + break() + endif() + endforeach() +endif() + +if(OPENCMISS_INSTALL_DIR) + message(STATUS "OPENCMISS_INSTALL_DIR=${OPENCMISS_INSTALL_DIR}") + # Use the OpenCMISS scripts to also allow choosing a separate toolchain + # This file is located at the opencmiss installation rather than the local example + # as it avoids file replication and makes maintenance much easier + if (TOOLCHAIN) + set(_OCTC ${OPENCMISS_INSTALL_DIR}/cmake/OCToolchainCompilers.cmake) + if (EXISTS "${_OCTC}") + include(${_OCTC}) + else() + message(WARNING "TOOLCHAIN specified but OpenCMISS config script could not be found at ${_OCTC}. Trying CMake defaults.") + endif() + unset(_OCTC) + endif() + set(OpenCMISS_DIR "${OPENCMISS_INSTALL_DIR}" CACHE PATH "Path to the found OpenCMISS (SDK) installation") +else() + message(WARNING "No OpenCMISS (SDK) installation directory detected. Using default system environment.") +endif() + \ No newline at end of file diff --git a/Meshes/1DCubicHermite/build_debug/build.sh b/Meshes/1DCubicHermite/build_debug/build.sh new file mode 100644 index 00000000..e6624bac --- /dev/null +++ b/Meshes/1DCubicHermite/build_debug/build.sh @@ -0,0 +1,2 @@ +#ccc && cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all +cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all diff --git a/Meshes/LagrangeSimplexMesh/CMakeLists.txt b/Meshes/LagrangeSimplexMesh/CMakeLists.txt new file mode 100644 index 00000000..a22b61ee --- /dev/null +++ b/Meshes/LagrangeSimplexMesh/CMakeLists.txt @@ -0,0 +1,35 @@ +# 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 C) +enable_language(Fortran OPTIONAL) +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 +# ---------------------- +#add_subdirectory(C) +if (CMAKE_Fortran_COMPILER) + add_subdirectory(Fortran) +endif() diff --git a/Meshes/LagrangeSimplexMesh/Fortran/CMakeLists.txt b/Meshes/LagrangeSimplexMesh/Fortran/CMakeLists.txt new file mode 100644 index 00000000..9df15542 --- /dev/null +++ b/Meshes/LagrangeSimplexMesh/Fortran/CMakeLists.txt @@ -0,0 +1,60 @@ + +# Add example executable +add_executable(LagrangeSimplexMesh src/LagrangeSimplexMeshExample.f90) + +# Turn on Fortran preprocessing (#include directives) +if (MSVC) + set(PROC_OPT "/fpp") +else() + set(PROC_OPT "-cpp") +endif() + +# in debug mode, add flag that make Floating point exceptions fatal +set(OPT "") +if (FALSE) + if(CMAKE_BUILD_TYPE MATCHES DEBUG) + set(OPT "-ffpe-trap=invalid,zero,underflow,overflow,denormal") # GCC: make floating point exceptions fatal + endif() +endif() + +target_compile_options(LagrangeSimplexMesh PRIVATE ${PROC_OPT} ${OPT} "-fbacktrace") + +# Link to opencmiss +# ----------------- +# +# This simply uses the opencmiss target created by OC_INIT() above. +# +# Alternatively, you can also directly invoke 'find_package(Iron )' 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 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(LagrangeSimplexMesh PRIVATE opencmiss) + +# Add a simple test that runs the executable +add_test(NAME test_LagrangeSimplexMesh COMMAND LagrangeSimplexMesh) +add_opencmiss_environment(test_LagrangeSimplexMesh) + +################### +# 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. +# diff --git a/Meshes/LagrangeSimplexMesh/src/LagrangeSimplexMeshExample.f90 b/Meshes/LagrangeSimplexMesh/Fortran/src/LagrangeSimplexMeshExample.f90 similarity index 100% rename from Meshes/LagrangeSimplexMesh/src/LagrangeSimplexMeshExample.f90 rename to Meshes/LagrangeSimplexMesh/Fortran/src/LagrangeSimplexMeshExample.f90 diff --git a/Meshes/LagrangeSimplexMesh/OpenCMISS.cmake b/Meshes/LagrangeSimplexMesh/OpenCMISS.cmake new file mode 100644 index 00000000..3d6cf515 --- /dev/null +++ b/Meshes/LagrangeSimplexMesh/OpenCMISS.cmake @@ -0,0 +1,95 @@ +########################### +# *DO NOT CHANGE THIS FILE* +########################### +# +# Prepares the use of OpenCMISS by scanning at various path locations for OpenCMISS (SDK) installations. +# +# Search order: +# - OPENCMISS_INSTALL_DIR variable +# - OPENCMISS_INSTALL_DIR environment variable +# - OPENCMISS_SDK_DIR variable +# - OPENCMISS_SDK_DIR environment variable +# - [Windows only] The Registry is searched additionally for installed SDKs. +# +# If found +# - Includes the toolchain config script of the found opencmiss installation to enable toolchain selection logic (non-windows) + +# Convenience: The OPENCMISS_INSTALL_DIR may also be defined in the environment and various other places +if (DEFINED OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using specified installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The specified OPENCMISS_INSTALL_DIR '${OPENCMISS_INSTALL_DIR}' does not exist. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_INSTALL_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_INSTALL_DIR}" OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using environment installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The environment variable OPENCMISS_INSTALL_DIR='${OPENCMISS_INSTALL_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if (NOT OPENCMISS_INSTALL_DIR AND DEFINED OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The specified OPENCMISS_SDK_DIR '${OPENCMISS_SDK_DIR}' does not exist. Skipping.") + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_SDK_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_SDK_DIR}" OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using environment SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The environment variable OPENCMISS_SDK_DIR='${OPENCMISS_SDK_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_SDK_DIR) + endif() +endif() +# On windows: check the registry for installed OpenCMISS SDKs +if(NOT OPENCMISS_INSTALL_DIR AND WIN32) + foreach(ROOT HKEY_CURRENT_USER HKEY_LOCAL_MACHINE) + foreach(PACKAGE OpenCMISSUserSDK OpenCMISSDeveloperSDK) + set(_REG_KEY "[${ROOT}\\Software\\Auckland Bioengineering Institute\\${PACKAGE}]") + get_filename_component(OPENCMISS_INSTALL_DIR "${_REG_KEY}" ABSOLUTE) + #message(STATUS "Trying registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Found ${PACKAGE} in Windows registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + break() + else() + unset(OPENCMISS_INSTALL_DIR) + endif() + endforeach() + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + break() + endif() + endforeach() +endif() + +if(OPENCMISS_INSTALL_DIR) + message(STATUS "OPENCMISS_INSTALL_DIR=${OPENCMISS_INSTALL_DIR}") + # Use the OpenCMISS scripts to also allow choosing a separate toolchain + # This file is located at the opencmiss installation rather than the local example + # as it avoids file replication and makes maintenance much easier + if (TOOLCHAIN) + set(_OCTC ${OPENCMISS_INSTALL_DIR}/cmake/OCToolchainCompilers.cmake) + if (EXISTS "${_OCTC}") + include(${_OCTC}) + else() + message(WARNING "TOOLCHAIN specified but OpenCMISS config script could not be found at ${_OCTC}. Trying CMake defaults.") + endif() + unset(_OCTC) + endif() + set(OpenCMISS_DIR "${OPENCMISS_INSTALL_DIR}" CACHE PATH "Path to the found OpenCMISS (SDK) installation") +else() + message(WARNING "No OpenCMISS (SDK) installation directory detected. Using default system environment.") +endif() + \ No newline at end of file diff --git a/Meshes/LagrangeSimplexMesh/build_debug/build.sh b/Meshes/LagrangeSimplexMesh/build_debug/build.sh new file mode 100644 index 00000000..e6624bac --- /dev/null +++ b/Meshes/LagrangeSimplexMesh/build_debug/build.sh @@ -0,0 +1,2 @@ +#ccc && cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all +cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all diff --git a/Meshes/MoreComplexMesh/CMakeLists.txt b/Meshes/MoreComplexMesh/CMakeLists.txt new file mode 100644 index 00000000..a22b61ee --- /dev/null +++ b/Meshes/MoreComplexMesh/CMakeLists.txt @@ -0,0 +1,35 @@ +# 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 C) +enable_language(Fortran OPTIONAL) +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 +# ---------------------- +#add_subdirectory(C) +if (CMAKE_Fortran_COMPILER) + add_subdirectory(Fortran) +endif() diff --git a/Meshes/MoreComplexMesh/Fortran/CMakeLists.txt b/Meshes/MoreComplexMesh/Fortran/CMakeLists.txt new file mode 100644 index 00000000..2bdc6cc5 --- /dev/null +++ b/Meshes/MoreComplexMesh/Fortran/CMakeLists.txt @@ -0,0 +1,60 @@ + +# Add example executable +add_executable(MoreComplexMesh src/MoreComplexMeshExample.f90) + +# Turn on Fortran preprocessing (#include directives) +if (MSVC) + set(PROC_OPT "/fpp") +else() + set(PROC_OPT "-cpp") +endif() + +# in debug mode, add flag that make Floating point exceptions fatal +set(OPT "") +if (FALSE) + if(CMAKE_BUILD_TYPE MATCHES DEBUG) + set(OPT "-ffpe-trap=invalid,zero,underflow,overflow,denormal") # GCC: make floating point exceptions fatal + endif() +endif() + +target_compile_options(MoreComplexMesh PRIVATE ${PROC_OPT} ${OPT} "-fbacktrace") + +# Link to opencmiss +# ----------------- +# +# This simply uses the opencmiss target created by OC_INIT() above. +# +# Alternatively, you can also directly invoke 'find_package(Iron )' 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 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(MoreComplexMesh PRIVATE opencmiss) + +# Add a simple test that runs the executable +add_test(NAME test_MoreComplexMesh COMMAND MoreComplexMesh) +add_opencmiss_environment(test_MoreComplexMesh) + +################### +# 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. +# diff --git a/Meshes/MoreComplexMesh/src/MoreComplexMeshExample.f90 b/Meshes/MoreComplexMesh/Fortran/src/MoreComplexMeshExample.f90 similarity index 100% rename from Meshes/MoreComplexMesh/src/MoreComplexMeshExample.f90 rename to Meshes/MoreComplexMesh/Fortran/src/MoreComplexMeshExample.f90 diff --git a/Meshes/MoreComplexMesh/OpenCMISS.cmake b/Meshes/MoreComplexMesh/OpenCMISS.cmake new file mode 100644 index 00000000..3d6cf515 --- /dev/null +++ b/Meshes/MoreComplexMesh/OpenCMISS.cmake @@ -0,0 +1,95 @@ +########################### +# *DO NOT CHANGE THIS FILE* +########################### +# +# Prepares the use of OpenCMISS by scanning at various path locations for OpenCMISS (SDK) installations. +# +# Search order: +# - OPENCMISS_INSTALL_DIR variable +# - OPENCMISS_INSTALL_DIR environment variable +# - OPENCMISS_SDK_DIR variable +# - OPENCMISS_SDK_DIR environment variable +# - [Windows only] The Registry is searched additionally for installed SDKs. +# +# If found +# - Includes the toolchain config script of the found opencmiss installation to enable toolchain selection logic (non-windows) + +# Convenience: The OPENCMISS_INSTALL_DIR may also be defined in the environment and various other places +if (DEFINED OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using specified installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The specified OPENCMISS_INSTALL_DIR '${OPENCMISS_INSTALL_DIR}' does not exist. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_INSTALL_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_INSTALL_DIR}" OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using environment installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The environment variable OPENCMISS_INSTALL_DIR='${OPENCMISS_INSTALL_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if (NOT OPENCMISS_INSTALL_DIR AND DEFINED OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The specified OPENCMISS_SDK_DIR '${OPENCMISS_SDK_DIR}' does not exist. Skipping.") + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_SDK_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_SDK_DIR}" OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using environment SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The environment variable OPENCMISS_SDK_DIR='${OPENCMISS_SDK_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_SDK_DIR) + endif() +endif() +# On windows: check the registry for installed OpenCMISS SDKs +if(NOT OPENCMISS_INSTALL_DIR AND WIN32) + foreach(ROOT HKEY_CURRENT_USER HKEY_LOCAL_MACHINE) + foreach(PACKAGE OpenCMISSUserSDK OpenCMISSDeveloperSDK) + set(_REG_KEY "[${ROOT}\\Software\\Auckland Bioengineering Institute\\${PACKAGE}]") + get_filename_component(OPENCMISS_INSTALL_DIR "${_REG_KEY}" ABSOLUTE) + #message(STATUS "Trying registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Found ${PACKAGE} in Windows registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + break() + else() + unset(OPENCMISS_INSTALL_DIR) + endif() + endforeach() + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + break() + endif() + endforeach() +endif() + +if(OPENCMISS_INSTALL_DIR) + message(STATUS "OPENCMISS_INSTALL_DIR=${OPENCMISS_INSTALL_DIR}") + # Use the OpenCMISS scripts to also allow choosing a separate toolchain + # This file is located at the opencmiss installation rather than the local example + # as it avoids file replication and makes maintenance much easier + if (TOOLCHAIN) + set(_OCTC ${OPENCMISS_INSTALL_DIR}/cmake/OCToolchainCompilers.cmake) + if (EXISTS "${_OCTC}") + include(${_OCTC}) + else() + message(WARNING "TOOLCHAIN specified but OpenCMISS config script could not be found at ${_OCTC}. Trying CMake defaults.") + endif() + unset(_OCTC) + endif() + set(OpenCMISS_DIR "${OPENCMISS_INSTALL_DIR}" CACHE PATH "Path to the found OpenCMISS (SDK) installation") +else() + message(WARNING "No OpenCMISS (SDK) installation directory detected. Using default system environment.") +endif() + \ No newline at end of file diff --git a/Meshes/MoreComplexMesh/build_debug/build.sh b/Meshes/MoreComplexMesh/build_debug/build.sh new file mode 100644 index 00000000..e6624bac --- /dev/null +++ b/Meshes/MoreComplexMesh/build_debug/build.sh @@ -0,0 +1,2 @@ +#ccc && cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all +cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all diff --git a/Meshes/MoreComplexMeshC/CMakeLists.txt b/Meshes/MoreComplexMeshC/CMakeLists.txt new file mode 100644 index 00000000..a22b61ee --- /dev/null +++ b/Meshes/MoreComplexMeshC/CMakeLists.txt @@ -0,0 +1,35 @@ +# 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 C) +enable_language(Fortran OPTIONAL) +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 +# ---------------------- +#add_subdirectory(C) +if (CMAKE_Fortran_COMPILER) + add_subdirectory(Fortran) +endif() diff --git a/Meshes/MoreComplexMeshC/Fortran/CMakeLists.txt b/Meshes/MoreComplexMeshC/Fortran/CMakeLists.txt new file mode 100644 index 00000000..e4043e37 --- /dev/null +++ b/Meshes/MoreComplexMeshC/Fortran/CMakeLists.txt @@ -0,0 +1,60 @@ + +# Add example executable +add_executable(MoreComplexMeshC src/MoreComplexMeshCExample.c) + +# Turn on Fortran preprocessing (#include directives) +if (MSVC) + set(PROC_OPT "/fpp") +else() + set(PROC_OPT "-cpp") +endif() + +# in debug mode, add flag that make Floating point exceptions fatal +set(OPT "") +if (FALSE) + if(CMAKE_BUILD_TYPE MATCHES DEBUG) + set(OPT "-ffpe-trap=invalid,zero,underflow,overflow,denormal") # GCC: make floating point exceptions fatal + endif() +endif() + +target_compile_options(MoreComplexMeshC PRIVATE ${PROC_OPT} ${OPT} "-fbacktrace") + +# Link to opencmiss +# ----------------- +# +# This simply uses the opencmiss target created by OC_INIT() above. +# +# Alternatively, you can also directly invoke 'find_package(Iron )' 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 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(MoreComplexMeshC PRIVATE opencmiss) + +# Add a simple test that runs the executable +add_test(NAME test_MoreComplexMeshC COMMAND MoreComplexMeshC) +add_opencmiss_environment(test_MoreComplexMeshC) + +################### +# 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. +# diff --git a/Meshes/MoreComplexMeshC/src/MoreComplexMeshCExample.c b/Meshes/MoreComplexMeshC/Fortran/src/MoreComplexMeshCExample.c similarity index 100% rename from Meshes/MoreComplexMeshC/src/MoreComplexMeshCExample.c rename to Meshes/MoreComplexMeshC/Fortran/src/MoreComplexMeshCExample.c diff --git a/Meshes/MoreComplexMeshC/OpenCMISS.cmake b/Meshes/MoreComplexMeshC/OpenCMISS.cmake new file mode 100644 index 00000000..3d6cf515 --- /dev/null +++ b/Meshes/MoreComplexMeshC/OpenCMISS.cmake @@ -0,0 +1,95 @@ +########################### +# *DO NOT CHANGE THIS FILE* +########################### +# +# Prepares the use of OpenCMISS by scanning at various path locations for OpenCMISS (SDK) installations. +# +# Search order: +# - OPENCMISS_INSTALL_DIR variable +# - OPENCMISS_INSTALL_DIR environment variable +# - OPENCMISS_SDK_DIR variable +# - OPENCMISS_SDK_DIR environment variable +# - [Windows only] The Registry is searched additionally for installed SDKs. +# +# If found +# - Includes the toolchain config script of the found opencmiss installation to enable toolchain selection logic (non-windows) + +# Convenience: The OPENCMISS_INSTALL_DIR may also be defined in the environment and various other places +if (DEFINED OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using specified installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The specified OPENCMISS_INSTALL_DIR '${OPENCMISS_INSTALL_DIR}' does not exist. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_INSTALL_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_INSTALL_DIR}" OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using environment installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The environment variable OPENCMISS_INSTALL_DIR='${OPENCMISS_INSTALL_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if (NOT OPENCMISS_INSTALL_DIR AND DEFINED OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The specified OPENCMISS_SDK_DIR '${OPENCMISS_SDK_DIR}' does not exist. Skipping.") + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_SDK_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_SDK_DIR}" OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using environment SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The environment variable OPENCMISS_SDK_DIR='${OPENCMISS_SDK_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_SDK_DIR) + endif() +endif() +# On windows: check the registry for installed OpenCMISS SDKs +if(NOT OPENCMISS_INSTALL_DIR AND WIN32) + foreach(ROOT HKEY_CURRENT_USER HKEY_LOCAL_MACHINE) + foreach(PACKAGE OpenCMISSUserSDK OpenCMISSDeveloperSDK) + set(_REG_KEY "[${ROOT}\\Software\\Auckland Bioengineering Institute\\${PACKAGE}]") + get_filename_component(OPENCMISS_INSTALL_DIR "${_REG_KEY}" ABSOLUTE) + #message(STATUS "Trying registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Found ${PACKAGE} in Windows registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + break() + else() + unset(OPENCMISS_INSTALL_DIR) + endif() + endforeach() + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + break() + endif() + endforeach() +endif() + +if(OPENCMISS_INSTALL_DIR) + message(STATUS "OPENCMISS_INSTALL_DIR=${OPENCMISS_INSTALL_DIR}") + # Use the OpenCMISS scripts to also allow choosing a separate toolchain + # This file is located at the opencmiss installation rather than the local example + # as it avoids file replication and makes maintenance much easier + if (TOOLCHAIN) + set(_OCTC ${OPENCMISS_INSTALL_DIR}/cmake/OCToolchainCompilers.cmake) + if (EXISTS "${_OCTC}") + include(${_OCTC}) + else() + message(WARNING "TOOLCHAIN specified but OpenCMISS config script could not be found at ${_OCTC}. Trying CMake defaults.") + endif() + unset(_OCTC) + endif() + set(OpenCMISS_DIR "${OPENCMISS_INSTALL_DIR}" CACHE PATH "Path to the found OpenCMISS (SDK) installation") +else() + message(WARNING "No OpenCMISS (SDK) installation directory detected. Using default system environment.") +endif() + \ No newline at end of file diff --git a/Meshes/MoreComplexMeshC/build_debug/build.sh b/Meshes/MoreComplexMeshC/build_debug/build.sh new file mode 100644 index 00000000..e6624bac --- /dev/null +++ b/Meshes/MoreComplexMeshC/build_debug/build.sh @@ -0,0 +1,2 @@ +#ccc && cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all +cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all diff --git a/Meshes/MultipleMeshComponents/CMakeLists.txt b/Meshes/MultipleMeshComponents/CMakeLists.txt new file mode 100644 index 00000000..a22b61ee --- /dev/null +++ b/Meshes/MultipleMeshComponents/CMakeLists.txt @@ -0,0 +1,35 @@ +# 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 C) +enable_language(Fortran OPTIONAL) +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 +# ---------------------- +#add_subdirectory(C) +if (CMAKE_Fortran_COMPILER) + add_subdirectory(Fortran) +endif() diff --git a/Meshes/MultipleMeshComponents/Fortran/CMakeLists.txt b/Meshes/MultipleMeshComponents/Fortran/CMakeLists.txt new file mode 100644 index 00000000..6c10abcd --- /dev/null +++ b/Meshes/MultipleMeshComponents/Fortran/CMakeLists.txt @@ -0,0 +1,60 @@ + +# Add example executable +add_executable(MultipleMeshComponents src/MultipleMeshComponentsExample.f90) + +# Turn on Fortran preprocessing (#include directives) +if (MSVC) + set(PROC_OPT "/fpp") +else() + set(PROC_OPT "-cpp") +endif() + +# in debug mode, add flag that make Floating point exceptions fatal +set(OPT "") +if (FALSE) + if(CMAKE_BUILD_TYPE MATCHES DEBUG) + set(OPT "-ffpe-trap=invalid,zero,underflow,overflow,denormal") # GCC: make floating point exceptions fatal + endif() +endif() + +target_compile_options(MultipleMeshComponents PRIVATE ${PROC_OPT} ${OPT} "-fbacktrace") + +# Link to opencmiss +# ----------------- +# +# This simply uses the opencmiss target created by OC_INIT() above. +# +# Alternatively, you can also directly invoke 'find_package(Iron )' 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 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(MultipleMeshComponents PRIVATE opencmiss) + +# Add a simple test that runs the executable +add_test(NAME test_MultipleMeshComponents COMMAND MultipleMeshComponents) +add_opencmiss_environment(test_MultipleMeshComponents) + +################### +# 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. +# diff --git a/Meshes/MultipleMeshComponents/src/MultipleMeshComponentsExample.f90 b/Meshes/MultipleMeshComponents/Fortran/src/MultipleMeshComponentsExample.f90 similarity index 100% rename from Meshes/MultipleMeshComponents/src/MultipleMeshComponentsExample.f90 rename to Meshes/MultipleMeshComponents/Fortran/src/MultipleMeshComponentsExample.f90 diff --git a/Meshes/MultipleMeshComponents/OpenCMISS.cmake b/Meshes/MultipleMeshComponents/OpenCMISS.cmake new file mode 100644 index 00000000..3d6cf515 --- /dev/null +++ b/Meshes/MultipleMeshComponents/OpenCMISS.cmake @@ -0,0 +1,95 @@ +########################### +# *DO NOT CHANGE THIS FILE* +########################### +# +# Prepares the use of OpenCMISS by scanning at various path locations for OpenCMISS (SDK) installations. +# +# Search order: +# - OPENCMISS_INSTALL_DIR variable +# - OPENCMISS_INSTALL_DIR environment variable +# - OPENCMISS_SDK_DIR variable +# - OPENCMISS_SDK_DIR environment variable +# - [Windows only] The Registry is searched additionally for installed SDKs. +# +# If found +# - Includes the toolchain config script of the found opencmiss installation to enable toolchain selection logic (non-windows) + +# Convenience: The OPENCMISS_INSTALL_DIR may also be defined in the environment and various other places +if (DEFINED OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using specified installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The specified OPENCMISS_INSTALL_DIR '${OPENCMISS_INSTALL_DIR}' does not exist. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_INSTALL_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_INSTALL_DIR}" OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using environment installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The environment variable OPENCMISS_INSTALL_DIR='${OPENCMISS_INSTALL_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if (NOT OPENCMISS_INSTALL_DIR AND DEFINED OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The specified OPENCMISS_SDK_DIR '${OPENCMISS_SDK_DIR}' does not exist. Skipping.") + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_SDK_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_SDK_DIR}" OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using environment SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The environment variable OPENCMISS_SDK_DIR='${OPENCMISS_SDK_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_SDK_DIR) + endif() +endif() +# On windows: check the registry for installed OpenCMISS SDKs +if(NOT OPENCMISS_INSTALL_DIR AND WIN32) + foreach(ROOT HKEY_CURRENT_USER HKEY_LOCAL_MACHINE) + foreach(PACKAGE OpenCMISSUserSDK OpenCMISSDeveloperSDK) + set(_REG_KEY "[${ROOT}\\Software\\Auckland Bioengineering Institute\\${PACKAGE}]") + get_filename_component(OPENCMISS_INSTALL_DIR "${_REG_KEY}" ABSOLUTE) + #message(STATUS "Trying registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Found ${PACKAGE} in Windows registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + break() + else() + unset(OPENCMISS_INSTALL_DIR) + endif() + endforeach() + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + break() + endif() + endforeach() +endif() + +if(OPENCMISS_INSTALL_DIR) + message(STATUS "OPENCMISS_INSTALL_DIR=${OPENCMISS_INSTALL_DIR}") + # Use the OpenCMISS scripts to also allow choosing a separate toolchain + # This file is located at the opencmiss installation rather than the local example + # as it avoids file replication and makes maintenance much easier + if (TOOLCHAIN) + set(_OCTC ${OPENCMISS_INSTALL_DIR}/cmake/OCToolchainCompilers.cmake) + if (EXISTS "${_OCTC}") + include(${_OCTC}) + else() + message(WARNING "TOOLCHAIN specified but OpenCMISS config script could not be found at ${_OCTC}. Trying CMake defaults.") + endif() + unset(_OCTC) + endif() + set(OpenCMISS_DIR "${OPENCMISS_INSTALL_DIR}" CACHE PATH "Path to the found OpenCMISS (SDK) installation") +else() + message(WARNING "No OpenCMISS (SDK) installation directory detected. Using default system environment.") +endif() + \ No newline at end of file diff --git a/Meshes/MultipleMeshComponents/build_debug/build.sh b/Meshes/MultipleMeshComponents/build_debug/build.sh new file mode 100644 index 00000000..e6624bac --- /dev/null +++ b/Meshes/MultipleMeshComponents/build_debug/build.sh @@ -0,0 +1,2 @@ +#ccc && cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all +cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all diff --git a/Meshes/Simplex/Tetrahedral/Cubic/CMakeLists.txt b/Meshes/Simplex/Tetrahedral/Cubic/CMakeLists.txt new file mode 100644 index 00000000..a22b61ee --- /dev/null +++ b/Meshes/Simplex/Tetrahedral/Cubic/CMakeLists.txt @@ -0,0 +1,35 @@ +# 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 C) +enable_language(Fortran OPTIONAL) +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 +# ---------------------- +#add_subdirectory(C) +if (CMAKE_Fortran_COMPILER) + add_subdirectory(Fortran) +endif() diff --git a/Meshes/Simplex/Tetrahedral/Cubic/Fortran/CMakeLists.txt b/Meshes/Simplex/Tetrahedral/Cubic/Fortran/CMakeLists.txt new file mode 100644 index 00000000..2e1a82bc --- /dev/null +++ b/Meshes/Simplex/Tetrahedral/Cubic/Fortran/CMakeLists.txt @@ -0,0 +1,60 @@ + +# Add example executable +add_executable(Cubic src/CubicExample.f90) + +# Turn on Fortran preprocessing (#include directives) +if (MSVC) + set(PROC_OPT "/fpp") +else() + set(PROC_OPT "-cpp") +endif() + +# in debug mode, add flag that make Floating point exceptions fatal +set(OPT "") +if (FALSE) + if(CMAKE_BUILD_TYPE MATCHES DEBUG) + set(OPT "-ffpe-trap=invalid,zero,underflow,overflow,denormal") # GCC: make floating point exceptions fatal + endif() +endif() + +target_compile_options(Cubic PRIVATE ${PROC_OPT} ${OPT} "-fbacktrace") + +# Link to opencmiss +# ----------------- +# +# This simply uses the opencmiss target created by OC_INIT() above. +# +# Alternatively, you can also directly invoke 'find_package(Iron )' 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 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(Cubic PRIVATE opencmiss) + +# Add a simple test that runs the executable +add_test(NAME test_Cubic COMMAND Cubic) +add_opencmiss_environment(test_Cubic) + +################### +# 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. +# diff --git a/Meshes/Simplex/Tetrahedral/Cubic/src/CubicExample.f90 b/Meshes/Simplex/Tetrahedral/Cubic/Fortran/src/CubicExample.f90 similarity index 100% rename from Meshes/Simplex/Tetrahedral/Cubic/src/CubicExample.f90 rename to Meshes/Simplex/Tetrahedral/Cubic/Fortran/src/CubicExample.f90 diff --git a/Meshes/Simplex/Tetrahedral/Cubic/OpenCMISS.cmake b/Meshes/Simplex/Tetrahedral/Cubic/OpenCMISS.cmake new file mode 100644 index 00000000..3d6cf515 --- /dev/null +++ b/Meshes/Simplex/Tetrahedral/Cubic/OpenCMISS.cmake @@ -0,0 +1,95 @@ +########################### +# *DO NOT CHANGE THIS FILE* +########################### +# +# Prepares the use of OpenCMISS by scanning at various path locations for OpenCMISS (SDK) installations. +# +# Search order: +# - OPENCMISS_INSTALL_DIR variable +# - OPENCMISS_INSTALL_DIR environment variable +# - OPENCMISS_SDK_DIR variable +# - OPENCMISS_SDK_DIR environment variable +# - [Windows only] The Registry is searched additionally for installed SDKs. +# +# If found +# - Includes the toolchain config script of the found opencmiss installation to enable toolchain selection logic (non-windows) + +# Convenience: The OPENCMISS_INSTALL_DIR may also be defined in the environment and various other places +if (DEFINED OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using specified installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The specified OPENCMISS_INSTALL_DIR '${OPENCMISS_INSTALL_DIR}' does not exist. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_INSTALL_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_INSTALL_DIR}" OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using environment installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The environment variable OPENCMISS_INSTALL_DIR='${OPENCMISS_INSTALL_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if (NOT OPENCMISS_INSTALL_DIR AND DEFINED OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The specified OPENCMISS_SDK_DIR '${OPENCMISS_SDK_DIR}' does not exist. Skipping.") + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_SDK_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_SDK_DIR}" OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using environment SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The environment variable OPENCMISS_SDK_DIR='${OPENCMISS_SDK_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_SDK_DIR) + endif() +endif() +# On windows: check the registry for installed OpenCMISS SDKs +if(NOT OPENCMISS_INSTALL_DIR AND WIN32) + foreach(ROOT HKEY_CURRENT_USER HKEY_LOCAL_MACHINE) + foreach(PACKAGE OpenCMISSUserSDK OpenCMISSDeveloperSDK) + set(_REG_KEY "[${ROOT}\\Software\\Auckland Bioengineering Institute\\${PACKAGE}]") + get_filename_component(OPENCMISS_INSTALL_DIR "${_REG_KEY}" ABSOLUTE) + #message(STATUS "Trying registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Found ${PACKAGE} in Windows registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + break() + else() + unset(OPENCMISS_INSTALL_DIR) + endif() + endforeach() + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + break() + endif() + endforeach() +endif() + +if(OPENCMISS_INSTALL_DIR) + message(STATUS "OPENCMISS_INSTALL_DIR=${OPENCMISS_INSTALL_DIR}") + # Use the OpenCMISS scripts to also allow choosing a separate toolchain + # This file is located at the opencmiss installation rather than the local example + # as it avoids file replication and makes maintenance much easier + if (TOOLCHAIN) + set(_OCTC ${OPENCMISS_INSTALL_DIR}/cmake/OCToolchainCompilers.cmake) + if (EXISTS "${_OCTC}") + include(${_OCTC}) + else() + message(WARNING "TOOLCHAIN specified but OpenCMISS config script could not be found at ${_OCTC}. Trying CMake defaults.") + endif() + unset(_OCTC) + endif() + set(OpenCMISS_DIR "${OPENCMISS_INSTALL_DIR}" CACHE PATH "Path to the found OpenCMISS (SDK) installation") +else() + message(WARNING "No OpenCMISS (SDK) installation directory detected. Using default system environment.") +endif() + \ No newline at end of file diff --git a/Meshes/Simplex/Tetrahedral/Cubic/build_debug/build.sh b/Meshes/Simplex/Tetrahedral/Cubic/build_debug/build.sh new file mode 100644 index 00000000..e6624bac --- /dev/null +++ b/Meshes/Simplex/Tetrahedral/Cubic/build_debug/build.sh @@ -0,0 +1,2 @@ +#ccc && cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all +cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all diff --git a/Meshes/Simplex/Tetrahedral/Linear/CMakeLists.txt b/Meshes/Simplex/Tetrahedral/Linear/CMakeLists.txt new file mode 100644 index 00000000..a22b61ee --- /dev/null +++ b/Meshes/Simplex/Tetrahedral/Linear/CMakeLists.txt @@ -0,0 +1,35 @@ +# 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 C) +enable_language(Fortran OPTIONAL) +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 +# ---------------------- +#add_subdirectory(C) +if (CMAKE_Fortran_COMPILER) + add_subdirectory(Fortran) +endif() diff --git a/Meshes/Simplex/Tetrahedral/Linear/Fortran/CMakeLists.txt b/Meshes/Simplex/Tetrahedral/Linear/Fortran/CMakeLists.txt new file mode 100644 index 00000000..78e65438 --- /dev/null +++ b/Meshes/Simplex/Tetrahedral/Linear/Fortran/CMakeLists.txt @@ -0,0 +1,60 @@ + +# Add example executable +add_executable(Linear src/LinearExample.f90) + +# Turn on Fortran preprocessing (#include directives) +if (MSVC) + set(PROC_OPT "/fpp") +else() + set(PROC_OPT "-cpp") +endif() + +# in debug mode, add flag that make Floating point exceptions fatal +set(OPT "") +if (FALSE) + if(CMAKE_BUILD_TYPE MATCHES DEBUG) + set(OPT "-ffpe-trap=invalid,zero,underflow,overflow,denormal") # GCC: make floating point exceptions fatal + endif() +endif() + +target_compile_options(Linear PRIVATE ${PROC_OPT} ${OPT} "-fbacktrace") + +# Link to opencmiss +# ----------------- +# +# This simply uses the opencmiss target created by OC_INIT() above. +# +# Alternatively, you can also directly invoke 'find_package(Iron )' 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 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(Linear PRIVATE opencmiss) + +# Add a simple test that runs the executable +add_test(NAME test_Linear COMMAND Linear) +add_opencmiss_environment(test_Linear) + +################### +# 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. +# diff --git a/Meshes/Simplex/Tetrahedral/Linear/src/LinearExample.f90 b/Meshes/Simplex/Tetrahedral/Linear/Fortran/src/LinearExample.f90 similarity index 100% rename from Meshes/Simplex/Tetrahedral/Linear/src/LinearExample.f90 rename to Meshes/Simplex/Tetrahedral/Linear/Fortran/src/LinearExample.f90 diff --git a/Meshes/Simplex/Tetrahedral/Linear/OpenCMISS.cmake b/Meshes/Simplex/Tetrahedral/Linear/OpenCMISS.cmake new file mode 100644 index 00000000..3d6cf515 --- /dev/null +++ b/Meshes/Simplex/Tetrahedral/Linear/OpenCMISS.cmake @@ -0,0 +1,95 @@ +########################### +# *DO NOT CHANGE THIS FILE* +########################### +# +# Prepares the use of OpenCMISS by scanning at various path locations for OpenCMISS (SDK) installations. +# +# Search order: +# - OPENCMISS_INSTALL_DIR variable +# - OPENCMISS_INSTALL_DIR environment variable +# - OPENCMISS_SDK_DIR variable +# - OPENCMISS_SDK_DIR environment variable +# - [Windows only] The Registry is searched additionally for installed SDKs. +# +# If found +# - Includes the toolchain config script of the found opencmiss installation to enable toolchain selection logic (non-windows) + +# Convenience: The OPENCMISS_INSTALL_DIR may also be defined in the environment and various other places +if (DEFINED OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using specified installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The specified OPENCMISS_INSTALL_DIR '${OPENCMISS_INSTALL_DIR}' does not exist. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_INSTALL_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_INSTALL_DIR}" OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using environment installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The environment variable OPENCMISS_INSTALL_DIR='${OPENCMISS_INSTALL_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if (NOT OPENCMISS_INSTALL_DIR AND DEFINED OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The specified OPENCMISS_SDK_DIR '${OPENCMISS_SDK_DIR}' does not exist. Skipping.") + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_SDK_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_SDK_DIR}" OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using environment SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The environment variable OPENCMISS_SDK_DIR='${OPENCMISS_SDK_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_SDK_DIR) + endif() +endif() +# On windows: check the registry for installed OpenCMISS SDKs +if(NOT OPENCMISS_INSTALL_DIR AND WIN32) + foreach(ROOT HKEY_CURRENT_USER HKEY_LOCAL_MACHINE) + foreach(PACKAGE OpenCMISSUserSDK OpenCMISSDeveloperSDK) + set(_REG_KEY "[${ROOT}\\Software\\Auckland Bioengineering Institute\\${PACKAGE}]") + get_filename_component(OPENCMISS_INSTALL_DIR "${_REG_KEY}" ABSOLUTE) + #message(STATUS "Trying registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Found ${PACKAGE} in Windows registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + break() + else() + unset(OPENCMISS_INSTALL_DIR) + endif() + endforeach() + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + break() + endif() + endforeach() +endif() + +if(OPENCMISS_INSTALL_DIR) + message(STATUS "OPENCMISS_INSTALL_DIR=${OPENCMISS_INSTALL_DIR}") + # Use the OpenCMISS scripts to also allow choosing a separate toolchain + # This file is located at the opencmiss installation rather than the local example + # as it avoids file replication and makes maintenance much easier + if (TOOLCHAIN) + set(_OCTC ${OPENCMISS_INSTALL_DIR}/cmake/OCToolchainCompilers.cmake) + if (EXISTS "${_OCTC}") + include(${_OCTC}) + else() + message(WARNING "TOOLCHAIN specified but OpenCMISS config script could not be found at ${_OCTC}. Trying CMake defaults.") + endif() + unset(_OCTC) + endif() + set(OpenCMISS_DIR "${OPENCMISS_INSTALL_DIR}" CACHE PATH "Path to the found OpenCMISS (SDK) installation") +else() + message(WARNING "No OpenCMISS (SDK) installation directory detected. Using default system environment.") +endif() + \ No newline at end of file diff --git a/Meshes/Simplex/Tetrahedral/Linear/build_debug/build.sh b/Meshes/Simplex/Tetrahedral/Linear/build_debug/build.sh new file mode 100644 index 00000000..e6624bac --- /dev/null +++ b/Meshes/Simplex/Tetrahedral/Linear/build_debug/build.sh @@ -0,0 +1,2 @@ +#ccc && cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all +cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all diff --git a/Meshes/Simplex/Tetrahedral/Quadratic/CMakeLists.txt b/Meshes/Simplex/Tetrahedral/Quadratic/CMakeLists.txt new file mode 100644 index 00000000..a22b61ee --- /dev/null +++ b/Meshes/Simplex/Tetrahedral/Quadratic/CMakeLists.txt @@ -0,0 +1,35 @@ +# 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 C) +enable_language(Fortran OPTIONAL) +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 +# ---------------------- +#add_subdirectory(C) +if (CMAKE_Fortran_COMPILER) + add_subdirectory(Fortran) +endif() diff --git a/Meshes/Simplex/Tetrahedral/Quadratic/Fortran/CMakeLists.txt b/Meshes/Simplex/Tetrahedral/Quadratic/Fortran/CMakeLists.txt new file mode 100644 index 00000000..36193b4d --- /dev/null +++ b/Meshes/Simplex/Tetrahedral/Quadratic/Fortran/CMakeLists.txt @@ -0,0 +1,60 @@ + +# Add example executable +add_executable(Quadratic src/QuadraticExample.f90) + +# Turn on Fortran preprocessing (#include directives) +if (MSVC) + set(PROC_OPT "/fpp") +else() + set(PROC_OPT "-cpp") +endif() + +# in debug mode, add flag that make Floating point exceptions fatal +set(OPT "") +if (FALSE) + if(CMAKE_BUILD_TYPE MATCHES DEBUG) + set(OPT "-ffpe-trap=invalid,zero,underflow,overflow,denormal") # GCC: make floating point exceptions fatal + endif() +endif() + +target_compile_options(Quadratic PRIVATE ${PROC_OPT} ${OPT} "-fbacktrace") + +# Link to opencmiss +# ----------------- +# +# This simply uses the opencmiss target created by OC_INIT() above. +# +# Alternatively, you can also directly invoke 'find_package(Iron )' 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 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(Quadratic PRIVATE opencmiss) + +# Add a simple test that runs the executable +add_test(NAME test_Quadratic COMMAND Quadratic) +add_opencmiss_environment(test_Quadratic) + +################### +# 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. +# diff --git a/Meshes/Simplex/Tetrahedral/Quadratic/src/QuadraticExample.f90 b/Meshes/Simplex/Tetrahedral/Quadratic/Fortran/src/QuadraticExample.f90 similarity index 100% rename from Meshes/Simplex/Tetrahedral/Quadratic/src/QuadraticExample.f90 rename to Meshes/Simplex/Tetrahedral/Quadratic/Fortran/src/QuadraticExample.f90 diff --git a/Meshes/Simplex/Tetrahedral/Quadratic/OpenCMISS.cmake b/Meshes/Simplex/Tetrahedral/Quadratic/OpenCMISS.cmake new file mode 100644 index 00000000..3d6cf515 --- /dev/null +++ b/Meshes/Simplex/Tetrahedral/Quadratic/OpenCMISS.cmake @@ -0,0 +1,95 @@ +########################### +# *DO NOT CHANGE THIS FILE* +########################### +# +# Prepares the use of OpenCMISS by scanning at various path locations for OpenCMISS (SDK) installations. +# +# Search order: +# - OPENCMISS_INSTALL_DIR variable +# - OPENCMISS_INSTALL_DIR environment variable +# - OPENCMISS_SDK_DIR variable +# - OPENCMISS_SDK_DIR environment variable +# - [Windows only] The Registry is searched additionally for installed SDKs. +# +# If found +# - Includes the toolchain config script of the found opencmiss installation to enable toolchain selection logic (non-windows) + +# Convenience: The OPENCMISS_INSTALL_DIR may also be defined in the environment and various other places +if (DEFINED OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using specified installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The specified OPENCMISS_INSTALL_DIR '${OPENCMISS_INSTALL_DIR}' does not exist. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_INSTALL_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_INSTALL_DIR}" OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using environment installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The environment variable OPENCMISS_INSTALL_DIR='${OPENCMISS_INSTALL_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if (NOT OPENCMISS_INSTALL_DIR AND DEFINED OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The specified OPENCMISS_SDK_DIR '${OPENCMISS_SDK_DIR}' does not exist. Skipping.") + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_SDK_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_SDK_DIR}" OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using environment SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The environment variable OPENCMISS_SDK_DIR='${OPENCMISS_SDK_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_SDK_DIR) + endif() +endif() +# On windows: check the registry for installed OpenCMISS SDKs +if(NOT OPENCMISS_INSTALL_DIR AND WIN32) + foreach(ROOT HKEY_CURRENT_USER HKEY_LOCAL_MACHINE) + foreach(PACKAGE OpenCMISSUserSDK OpenCMISSDeveloperSDK) + set(_REG_KEY "[${ROOT}\\Software\\Auckland Bioengineering Institute\\${PACKAGE}]") + get_filename_component(OPENCMISS_INSTALL_DIR "${_REG_KEY}" ABSOLUTE) + #message(STATUS "Trying registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Found ${PACKAGE} in Windows registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + break() + else() + unset(OPENCMISS_INSTALL_DIR) + endif() + endforeach() + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + break() + endif() + endforeach() +endif() + +if(OPENCMISS_INSTALL_DIR) + message(STATUS "OPENCMISS_INSTALL_DIR=${OPENCMISS_INSTALL_DIR}") + # Use the OpenCMISS scripts to also allow choosing a separate toolchain + # This file is located at the opencmiss installation rather than the local example + # as it avoids file replication and makes maintenance much easier + if (TOOLCHAIN) + set(_OCTC ${OPENCMISS_INSTALL_DIR}/cmake/OCToolchainCompilers.cmake) + if (EXISTS "${_OCTC}") + include(${_OCTC}) + else() + message(WARNING "TOOLCHAIN specified but OpenCMISS config script could not be found at ${_OCTC}. Trying CMake defaults.") + endif() + unset(_OCTC) + endif() + set(OpenCMISS_DIR "${OPENCMISS_INSTALL_DIR}" CACHE PATH "Path to the found OpenCMISS (SDK) installation") +else() + message(WARNING "No OpenCMISS (SDK) installation directory detected. Using default system environment.") +endif() + \ No newline at end of file diff --git a/Meshes/Simplex/Tetrahedral/Quadratic/build_debug/build.sh b/Meshes/Simplex/Tetrahedral/Quadratic/build_debug/build.sh new file mode 100644 index 00000000..e6624bac --- /dev/null +++ b/Meshes/Simplex/Tetrahedral/Quadratic/build_debug/build.sh @@ -0,0 +1,2 @@ +#ccc && cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all +cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all diff --git a/Meshes/Simplex/Triangular/Cubic/CMakeLists.txt b/Meshes/Simplex/Triangular/Cubic/CMakeLists.txt new file mode 100644 index 00000000..a22b61ee --- /dev/null +++ b/Meshes/Simplex/Triangular/Cubic/CMakeLists.txt @@ -0,0 +1,35 @@ +# 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 C) +enable_language(Fortran OPTIONAL) +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 +# ---------------------- +#add_subdirectory(C) +if (CMAKE_Fortran_COMPILER) + add_subdirectory(Fortran) +endif() diff --git a/Meshes/Simplex/Triangular/Cubic/Fortran/CMakeLists.txt b/Meshes/Simplex/Triangular/Cubic/Fortran/CMakeLists.txt new file mode 100644 index 00000000..2e1a82bc --- /dev/null +++ b/Meshes/Simplex/Triangular/Cubic/Fortran/CMakeLists.txt @@ -0,0 +1,60 @@ + +# Add example executable +add_executable(Cubic src/CubicExample.f90) + +# Turn on Fortran preprocessing (#include directives) +if (MSVC) + set(PROC_OPT "/fpp") +else() + set(PROC_OPT "-cpp") +endif() + +# in debug mode, add flag that make Floating point exceptions fatal +set(OPT "") +if (FALSE) + if(CMAKE_BUILD_TYPE MATCHES DEBUG) + set(OPT "-ffpe-trap=invalid,zero,underflow,overflow,denormal") # GCC: make floating point exceptions fatal + endif() +endif() + +target_compile_options(Cubic PRIVATE ${PROC_OPT} ${OPT} "-fbacktrace") + +# Link to opencmiss +# ----------------- +# +# This simply uses the opencmiss target created by OC_INIT() above. +# +# Alternatively, you can also directly invoke 'find_package(Iron )' 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 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(Cubic PRIVATE opencmiss) + +# Add a simple test that runs the executable +add_test(NAME test_Cubic COMMAND Cubic) +add_opencmiss_environment(test_Cubic) + +################### +# 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. +# diff --git a/Meshes/Simplex/Triangular/Cubic/src/CubicExample.f90 b/Meshes/Simplex/Triangular/Cubic/Fortran/src/CubicExample.f90 similarity index 100% rename from Meshes/Simplex/Triangular/Cubic/src/CubicExample.f90 rename to Meshes/Simplex/Triangular/Cubic/Fortran/src/CubicExample.f90 diff --git a/Meshes/Simplex/Triangular/Cubic/OpenCMISS.cmake b/Meshes/Simplex/Triangular/Cubic/OpenCMISS.cmake new file mode 100644 index 00000000..3d6cf515 --- /dev/null +++ b/Meshes/Simplex/Triangular/Cubic/OpenCMISS.cmake @@ -0,0 +1,95 @@ +########################### +# *DO NOT CHANGE THIS FILE* +########################### +# +# Prepares the use of OpenCMISS by scanning at various path locations for OpenCMISS (SDK) installations. +# +# Search order: +# - OPENCMISS_INSTALL_DIR variable +# - OPENCMISS_INSTALL_DIR environment variable +# - OPENCMISS_SDK_DIR variable +# - OPENCMISS_SDK_DIR environment variable +# - [Windows only] The Registry is searched additionally for installed SDKs. +# +# If found +# - Includes the toolchain config script of the found opencmiss installation to enable toolchain selection logic (non-windows) + +# Convenience: The OPENCMISS_INSTALL_DIR may also be defined in the environment and various other places +if (DEFINED OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using specified installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The specified OPENCMISS_INSTALL_DIR '${OPENCMISS_INSTALL_DIR}' does not exist. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_INSTALL_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_INSTALL_DIR}" OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using environment installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The environment variable OPENCMISS_INSTALL_DIR='${OPENCMISS_INSTALL_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if (NOT OPENCMISS_INSTALL_DIR AND DEFINED OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The specified OPENCMISS_SDK_DIR '${OPENCMISS_SDK_DIR}' does not exist. Skipping.") + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_SDK_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_SDK_DIR}" OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using environment SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The environment variable OPENCMISS_SDK_DIR='${OPENCMISS_SDK_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_SDK_DIR) + endif() +endif() +# On windows: check the registry for installed OpenCMISS SDKs +if(NOT OPENCMISS_INSTALL_DIR AND WIN32) + foreach(ROOT HKEY_CURRENT_USER HKEY_LOCAL_MACHINE) + foreach(PACKAGE OpenCMISSUserSDK OpenCMISSDeveloperSDK) + set(_REG_KEY "[${ROOT}\\Software\\Auckland Bioengineering Institute\\${PACKAGE}]") + get_filename_component(OPENCMISS_INSTALL_DIR "${_REG_KEY}" ABSOLUTE) + #message(STATUS "Trying registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Found ${PACKAGE} in Windows registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + break() + else() + unset(OPENCMISS_INSTALL_DIR) + endif() + endforeach() + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + break() + endif() + endforeach() +endif() + +if(OPENCMISS_INSTALL_DIR) + message(STATUS "OPENCMISS_INSTALL_DIR=${OPENCMISS_INSTALL_DIR}") + # Use the OpenCMISS scripts to also allow choosing a separate toolchain + # This file is located at the opencmiss installation rather than the local example + # as it avoids file replication and makes maintenance much easier + if (TOOLCHAIN) + set(_OCTC ${OPENCMISS_INSTALL_DIR}/cmake/OCToolchainCompilers.cmake) + if (EXISTS "${_OCTC}") + include(${_OCTC}) + else() + message(WARNING "TOOLCHAIN specified but OpenCMISS config script could not be found at ${_OCTC}. Trying CMake defaults.") + endif() + unset(_OCTC) + endif() + set(OpenCMISS_DIR "${OPENCMISS_INSTALL_DIR}" CACHE PATH "Path to the found OpenCMISS (SDK) installation") +else() + message(WARNING "No OpenCMISS (SDK) installation directory detected. Using default system environment.") +endif() + \ No newline at end of file diff --git a/Meshes/Simplex/Triangular/Cubic/build_debug/build.sh b/Meshes/Simplex/Triangular/Cubic/build_debug/build.sh new file mode 100644 index 00000000..e6624bac --- /dev/null +++ b/Meshes/Simplex/Triangular/Cubic/build_debug/build.sh @@ -0,0 +1,2 @@ +#ccc && cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all +cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all diff --git a/Meshes/Simplex/Triangular/Linear/CMakeLists.txt b/Meshes/Simplex/Triangular/Linear/CMakeLists.txt new file mode 100644 index 00000000..a22b61ee --- /dev/null +++ b/Meshes/Simplex/Triangular/Linear/CMakeLists.txt @@ -0,0 +1,35 @@ +# 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 C) +enable_language(Fortran OPTIONAL) +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 +# ---------------------- +#add_subdirectory(C) +if (CMAKE_Fortran_COMPILER) + add_subdirectory(Fortran) +endif() diff --git a/Meshes/Simplex/Triangular/Linear/Fortran/CMakeLists.txt b/Meshes/Simplex/Triangular/Linear/Fortran/CMakeLists.txt new file mode 100644 index 00000000..78e65438 --- /dev/null +++ b/Meshes/Simplex/Triangular/Linear/Fortran/CMakeLists.txt @@ -0,0 +1,60 @@ + +# Add example executable +add_executable(Linear src/LinearExample.f90) + +# Turn on Fortran preprocessing (#include directives) +if (MSVC) + set(PROC_OPT "/fpp") +else() + set(PROC_OPT "-cpp") +endif() + +# in debug mode, add flag that make Floating point exceptions fatal +set(OPT "") +if (FALSE) + if(CMAKE_BUILD_TYPE MATCHES DEBUG) + set(OPT "-ffpe-trap=invalid,zero,underflow,overflow,denormal") # GCC: make floating point exceptions fatal + endif() +endif() + +target_compile_options(Linear PRIVATE ${PROC_OPT} ${OPT} "-fbacktrace") + +# Link to opencmiss +# ----------------- +# +# This simply uses the opencmiss target created by OC_INIT() above. +# +# Alternatively, you can also directly invoke 'find_package(Iron )' 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 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(Linear PRIVATE opencmiss) + +# Add a simple test that runs the executable +add_test(NAME test_Linear COMMAND Linear) +add_opencmiss_environment(test_Linear) + +################### +# 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. +# diff --git a/Meshes/Simplex/Triangular/Linear/src/LinearExample.f90 b/Meshes/Simplex/Triangular/Linear/Fortran/src/LinearExample.f90 similarity index 100% rename from Meshes/Simplex/Triangular/Linear/src/LinearExample.f90 rename to Meshes/Simplex/Triangular/Linear/Fortran/src/LinearExample.f90 diff --git a/Meshes/Simplex/Triangular/Linear/OpenCMISS.cmake b/Meshes/Simplex/Triangular/Linear/OpenCMISS.cmake new file mode 100644 index 00000000..3d6cf515 --- /dev/null +++ b/Meshes/Simplex/Triangular/Linear/OpenCMISS.cmake @@ -0,0 +1,95 @@ +########################### +# *DO NOT CHANGE THIS FILE* +########################### +# +# Prepares the use of OpenCMISS by scanning at various path locations for OpenCMISS (SDK) installations. +# +# Search order: +# - OPENCMISS_INSTALL_DIR variable +# - OPENCMISS_INSTALL_DIR environment variable +# - OPENCMISS_SDK_DIR variable +# - OPENCMISS_SDK_DIR environment variable +# - [Windows only] The Registry is searched additionally for installed SDKs. +# +# If found +# - Includes the toolchain config script of the found opencmiss installation to enable toolchain selection logic (non-windows) + +# Convenience: The OPENCMISS_INSTALL_DIR may also be defined in the environment and various other places +if (DEFINED OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using specified installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The specified OPENCMISS_INSTALL_DIR '${OPENCMISS_INSTALL_DIR}' does not exist. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_INSTALL_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_INSTALL_DIR}" OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using environment installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The environment variable OPENCMISS_INSTALL_DIR='${OPENCMISS_INSTALL_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if (NOT OPENCMISS_INSTALL_DIR AND DEFINED OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The specified OPENCMISS_SDK_DIR '${OPENCMISS_SDK_DIR}' does not exist. Skipping.") + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_SDK_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_SDK_DIR}" OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using environment SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The environment variable OPENCMISS_SDK_DIR='${OPENCMISS_SDK_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_SDK_DIR) + endif() +endif() +# On windows: check the registry for installed OpenCMISS SDKs +if(NOT OPENCMISS_INSTALL_DIR AND WIN32) + foreach(ROOT HKEY_CURRENT_USER HKEY_LOCAL_MACHINE) + foreach(PACKAGE OpenCMISSUserSDK OpenCMISSDeveloperSDK) + set(_REG_KEY "[${ROOT}\\Software\\Auckland Bioengineering Institute\\${PACKAGE}]") + get_filename_component(OPENCMISS_INSTALL_DIR "${_REG_KEY}" ABSOLUTE) + #message(STATUS "Trying registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Found ${PACKAGE} in Windows registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + break() + else() + unset(OPENCMISS_INSTALL_DIR) + endif() + endforeach() + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + break() + endif() + endforeach() +endif() + +if(OPENCMISS_INSTALL_DIR) + message(STATUS "OPENCMISS_INSTALL_DIR=${OPENCMISS_INSTALL_DIR}") + # Use the OpenCMISS scripts to also allow choosing a separate toolchain + # This file is located at the opencmiss installation rather than the local example + # as it avoids file replication and makes maintenance much easier + if (TOOLCHAIN) + set(_OCTC ${OPENCMISS_INSTALL_DIR}/cmake/OCToolchainCompilers.cmake) + if (EXISTS "${_OCTC}") + include(${_OCTC}) + else() + message(WARNING "TOOLCHAIN specified but OpenCMISS config script could not be found at ${_OCTC}. Trying CMake defaults.") + endif() + unset(_OCTC) + endif() + set(OpenCMISS_DIR "${OPENCMISS_INSTALL_DIR}" CACHE PATH "Path to the found OpenCMISS (SDK) installation") +else() + message(WARNING "No OpenCMISS (SDK) installation directory detected. Using default system environment.") +endif() + \ No newline at end of file diff --git a/Meshes/Simplex/Triangular/Linear/build_debug/build.sh b/Meshes/Simplex/Triangular/Linear/build_debug/build.sh new file mode 100644 index 00000000..e6624bac --- /dev/null +++ b/Meshes/Simplex/Triangular/Linear/build_debug/build.sh @@ -0,0 +1,2 @@ +#ccc && cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all +cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all diff --git a/Meshes/Simplex/Triangular/Quadratic/CMakeLists.txt b/Meshes/Simplex/Triangular/Quadratic/CMakeLists.txt new file mode 100644 index 00000000..a22b61ee --- /dev/null +++ b/Meshes/Simplex/Triangular/Quadratic/CMakeLists.txt @@ -0,0 +1,35 @@ +# 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 C) +enable_language(Fortran OPTIONAL) +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 +# ---------------------- +#add_subdirectory(C) +if (CMAKE_Fortran_COMPILER) + add_subdirectory(Fortran) +endif() diff --git a/Meshes/Simplex/Triangular/Quadratic/Fortran/CMakeLists.txt b/Meshes/Simplex/Triangular/Quadratic/Fortran/CMakeLists.txt new file mode 100644 index 00000000..36193b4d --- /dev/null +++ b/Meshes/Simplex/Triangular/Quadratic/Fortran/CMakeLists.txt @@ -0,0 +1,60 @@ + +# Add example executable +add_executable(Quadratic src/QuadraticExample.f90) + +# Turn on Fortran preprocessing (#include directives) +if (MSVC) + set(PROC_OPT "/fpp") +else() + set(PROC_OPT "-cpp") +endif() + +# in debug mode, add flag that make Floating point exceptions fatal +set(OPT "") +if (FALSE) + if(CMAKE_BUILD_TYPE MATCHES DEBUG) + set(OPT "-ffpe-trap=invalid,zero,underflow,overflow,denormal") # GCC: make floating point exceptions fatal + endif() +endif() + +target_compile_options(Quadratic PRIVATE ${PROC_OPT} ${OPT} "-fbacktrace") + +# Link to opencmiss +# ----------------- +# +# This simply uses the opencmiss target created by OC_INIT() above. +# +# Alternatively, you can also directly invoke 'find_package(Iron )' 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 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(Quadratic PRIVATE opencmiss) + +# Add a simple test that runs the executable +add_test(NAME test_Quadratic COMMAND Quadratic) +add_opencmiss_environment(test_Quadratic) + +################### +# 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. +# diff --git a/Meshes/Simplex/Triangular/Quadratic/src/QuadraticExample.f90 b/Meshes/Simplex/Triangular/Quadratic/Fortran/src/QuadraticExample.f90 similarity index 100% rename from Meshes/Simplex/Triangular/Quadratic/src/QuadraticExample.f90 rename to Meshes/Simplex/Triangular/Quadratic/Fortran/src/QuadraticExample.f90 diff --git a/Meshes/Simplex/Triangular/Quadratic/OpenCMISS.cmake b/Meshes/Simplex/Triangular/Quadratic/OpenCMISS.cmake new file mode 100644 index 00000000..3d6cf515 --- /dev/null +++ b/Meshes/Simplex/Triangular/Quadratic/OpenCMISS.cmake @@ -0,0 +1,95 @@ +########################### +# *DO NOT CHANGE THIS FILE* +########################### +# +# Prepares the use of OpenCMISS by scanning at various path locations for OpenCMISS (SDK) installations. +# +# Search order: +# - OPENCMISS_INSTALL_DIR variable +# - OPENCMISS_INSTALL_DIR environment variable +# - OPENCMISS_SDK_DIR variable +# - OPENCMISS_SDK_DIR environment variable +# - [Windows only] The Registry is searched additionally for installed SDKs. +# +# If found +# - Includes the toolchain config script of the found opencmiss installation to enable toolchain selection logic (non-windows) + +# Convenience: The OPENCMISS_INSTALL_DIR may also be defined in the environment and various other places +if (DEFINED OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using specified installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The specified OPENCMISS_INSTALL_DIR '${OPENCMISS_INSTALL_DIR}' does not exist. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_INSTALL_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_INSTALL_DIR}" OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using environment installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The environment variable OPENCMISS_INSTALL_DIR='${OPENCMISS_INSTALL_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if (NOT OPENCMISS_INSTALL_DIR AND DEFINED OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The specified OPENCMISS_SDK_DIR '${OPENCMISS_SDK_DIR}' does not exist. Skipping.") + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_SDK_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_SDK_DIR}" OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using environment SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The environment variable OPENCMISS_SDK_DIR='${OPENCMISS_SDK_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_SDK_DIR) + endif() +endif() +# On windows: check the registry for installed OpenCMISS SDKs +if(NOT OPENCMISS_INSTALL_DIR AND WIN32) + foreach(ROOT HKEY_CURRENT_USER HKEY_LOCAL_MACHINE) + foreach(PACKAGE OpenCMISSUserSDK OpenCMISSDeveloperSDK) + set(_REG_KEY "[${ROOT}\\Software\\Auckland Bioengineering Institute\\${PACKAGE}]") + get_filename_component(OPENCMISS_INSTALL_DIR "${_REG_KEY}" ABSOLUTE) + #message(STATUS "Trying registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Found ${PACKAGE} in Windows registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + break() + else() + unset(OPENCMISS_INSTALL_DIR) + endif() + endforeach() + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + break() + endif() + endforeach() +endif() + +if(OPENCMISS_INSTALL_DIR) + message(STATUS "OPENCMISS_INSTALL_DIR=${OPENCMISS_INSTALL_DIR}") + # Use the OpenCMISS scripts to also allow choosing a separate toolchain + # This file is located at the opencmiss installation rather than the local example + # as it avoids file replication and makes maintenance much easier + if (TOOLCHAIN) + set(_OCTC ${OPENCMISS_INSTALL_DIR}/cmake/OCToolchainCompilers.cmake) + if (EXISTS "${_OCTC}") + include(${_OCTC}) + else() + message(WARNING "TOOLCHAIN specified but OpenCMISS config script could not be found at ${_OCTC}. Trying CMake defaults.") + endif() + unset(_OCTC) + endif() + set(OpenCMISS_DIR "${OPENCMISS_INSTALL_DIR}" CACHE PATH "Path to the found OpenCMISS (SDK) installation") +else() + message(WARNING "No OpenCMISS (SDK) installation directory detected. Using default system environment.") +endif() + \ No newline at end of file diff --git a/Meshes/Simplex/Triangular/Quadratic/build_debug/build.sh b/Meshes/Simplex/Triangular/Quadratic/build_debug/build.sh new file mode 100644 index 00000000..e6624bac --- /dev/null +++ b/Meshes/Simplex/Triangular/Quadratic/build_debug/build.sh @@ -0,0 +1,2 @@ +#ccc && cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all +cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all diff --git a/Meshes/Simplex/Triangular/QuadraticSimplexManual/CMakeLists.txt b/Meshes/Simplex/Triangular/QuadraticSimplexManual/CMakeLists.txt new file mode 100644 index 00000000..a22b61ee --- /dev/null +++ b/Meshes/Simplex/Triangular/QuadraticSimplexManual/CMakeLists.txt @@ -0,0 +1,35 @@ +# 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 C) +enable_language(Fortran OPTIONAL) +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 +# ---------------------- +#add_subdirectory(C) +if (CMAKE_Fortran_COMPILER) + add_subdirectory(Fortran) +endif() diff --git a/Meshes/Simplex/Triangular/QuadraticSimplexManual/Fortran/CMakeLists.txt b/Meshes/Simplex/Triangular/QuadraticSimplexManual/Fortran/CMakeLists.txt new file mode 100644 index 00000000..41467b5e --- /dev/null +++ b/Meshes/Simplex/Triangular/QuadraticSimplexManual/Fortran/CMakeLists.txt @@ -0,0 +1,60 @@ + +# Add example executable +add_executable(QuadraticSimplexManual src/SimplexMeshExample.f90) + +# Turn on Fortran preprocessing (#include directives) +if (MSVC) + set(PROC_OPT "/fpp") +else() + set(PROC_OPT "-cpp") +endif() + +# in debug mode, add flag that make Floating point exceptions fatal +set(OPT "") +if (FALSE) + if(CMAKE_BUILD_TYPE MATCHES DEBUG) + set(OPT "-ffpe-trap=invalid,zero,underflow,overflow,denormal") # GCC: make floating point exceptions fatal + endif() +endif() + +target_compile_options(QuadraticSimplexManual PRIVATE ${PROC_OPT} ${OPT} "-fbacktrace") + +# Link to opencmiss +# ----------------- +# +# This simply uses the opencmiss target created by OC_INIT() above. +# +# Alternatively, you can also directly invoke 'find_package(Iron )' 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 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(QuadraticSimplexManual PRIVATE opencmiss) + +# Add a simple test that runs the executable +add_test(NAME test_QuadraticSimplexManual COMMAND QuadraticSimplexManual) +add_opencmiss_environment(test_QuadraticSimplexManual) + +################### +# 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. +# diff --git a/Meshes/Simplex/Triangular/QuadraticSimplexManual/src/SimplexMeshExample.f90 b/Meshes/Simplex/Triangular/QuadraticSimplexManual/Fortran/src/SimplexMeshExample.f90 similarity index 100% rename from Meshes/Simplex/Triangular/QuadraticSimplexManual/src/SimplexMeshExample.f90 rename to Meshes/Simplex/Triangular/QuadraticSimplexManual/Fortran/src/SimplexMeshExample.f90 diff --git a/Meshes/Simplex/Triangular/QuadraticSimplexManual/OpenCMISS.cmake b/Meshes/Simplex/Triangular/QuadraticSimplexManual/OpenCMISS.cmake new file mode 100644 index 00000000..3d6cf515 --- /dev/null +++ b/Meshes/Simplex/Triangular/QuadraticSimplexManual/OpenCMISS.cmake @@ -0,0 +1,95 @@ +########################### +# *DO NOT CHANGE THIS FILE* +########################### +# +# Prepares the use of OpenCMISS by scanning at various path locations for OpenCMISS (SDK) installations. +# +# Search order: +# - OPENCMISS_INSTALL_DIR variable +# - OPENCMISS_INSTALL_DIR environment variable +# - OPENCMISS_SDK_DIR variable +# - OPENCMISS_SDK_DIR environment variable +# - [Windows only] The Registry is searched additionally for installed SDKs. +# +# If found +# - Includes the toolchain config script of the found opencmiss installation to enable toolchain selection logic (non-windows) + +# Convenience: The OPENCMISS_INSTALL_DIR may also be defined in the environment and various other places +if (DEFINED OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using specified installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The specified OPENCMISS_INSTALL_DIR '${OPENCMISS_INSTALL_DIR}' does not exist. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_INSTALL_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_INSTALL_DIR}" OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using environment installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The environment variable OPENCMISS_INSTALL_DIR='${OPENCMISS_INSTALL_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if (NOT OPENCMISS_INSTALL_DIR AND DEFINED OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The specified OPENCMISS_SDK_DIR '${OPENCMISS_SDK_DIR}' does not exist. Skipping.") + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_SDK_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_SDK_DIR}" OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using environment SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The environment variable OPENCMISS_SDK_DIR='${OPENCMISS_SDK_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_SDK_DIR) + endif() +endif() +# On windows: check the registry for installed OpenCMISS SDKs +if(NOT OPENCMISS_INSTALL_DIR AND WIN32) + foreach(ROOT HKEY_CURRENT_USER HKEY_LOCAL_MACHINE) + foreach(PACKAGE OpenCMISSUserSDK OpenCMISSDeveloperSDK) + set(_REG_KEY "[${ROOT}\\Software\\Auckland Bioengineering Institute\\${PACKAGE}]") + get_filename_component(OPENCMISS_INSTALL_DIR "${_REG_KEY}" ABSOLUTE) + #message(STATUS "Trying registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Found ${PACKAGE} in Windows registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + break() + else() + unset(OPENCMISS_INSTALL_DIR) + endif() + endforeach() + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + break() + endif() + endforeach() +endif() + +if(OPENCMISS_INSTALL_DIR) + message(STATUS "OPENCMISS_INSTALL_DIR=${OPENCMISS_INSTALL_DIR}") + # Use the OpenCMISS scripts to also allow choosing a separate toolchain + # This file is located at the opencmiss installation rather than the local example + # as it avoids file replication and makes maintenance much easier + if (TOOLCHAIN) + set(_OCTC ${OPENCMISS_INSTALL_DIR}/cmake/OCToolchainCompilers.cmake) + if (EXISTS "${_OCTC}") + include(${_OCTC}) + else() + message(WARNING "TOOLCHAIN specified but OpenCMISS config script could not be found at ${_OCTC}. Trying CMake defaults.") + endif() + unset(_OCTC) + endif() + set(OpenCMISS_DIR "${OPENCMISS_INSTALL_DIR}" CACHE PATH "Path to the found OpenCMISS (SDK) installation") +else() + message(WARNING "No OpenCMISS (SDK) installation directory detected. Using default system environment.") +endif() + \ No newline at end of file diff --git a/Meshes/Simplex/Triangular/QuadraticSimplexManual/build_debug/build.sh b/Meshes/Simplex/Triangular/QuadraticSimplexManual/build_debug/build.sh new file mode 100644 index 00000000..e6624bac --- /dev/null +++ b/Meshes/Simplex/Triangular/QuadraticSimplexManual/build_debug/build.sh @@ -0,0 +1,2 @@ +#ccc && cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all +cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all diff --git a/Meshes/Versions3DLaplace/CMakeLists.txt b/Meshes/Versions3DLaplace/CMakeLists.txt new file mode 100644 index 00000000..a22b61ee --- /dev/null +++ b/Meshes/Versions3DLaplace/CMakeLists.txt @@ -0,0 +1,35 @@ +# 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 C) +enable_language(Fortran OPTIONAL) +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 +# ---------------------- +#add_subdirectory(C) +if (CMAKE_Fortran_COMPILER) + add_subdirectory(Fortran) +endif() diff --git a/Meshes/Versions3DLaplace/Fortran/CMakeLists.txt b/Meshes/Versions3DLaplace/Fortran/CMakeLists.txt new file mode 100644 index 00000000..67c46664 --- /dev/null +++ b/Meshes/Versions3DLaplace/Fortran/CMakeLists.txt @@ -0,0 +1,60 @@ + +# Add example executable +add_executable(Versions3DLaplace src/Versions3DLaplaceExample.f90) + +# Turn on Fortran preprocessing (#include directives) +if (MSVC) + set(PROC_OPT "/fpp") +else() + set(PROC_OPT "-cpp") +endif() + +# in debug mode, add flag that make Floating point exceptions fatal +set(OPT "") +if (FALSE) + if(CMAKE_BUILD_TYPE MATCHES DEBUG) + set(OPT "-ffpe-trap=invalid,zero,underflow,overflow,denormal") # GCC: make floating point exceptions fatal + endif() +endif() + +target_compile_options(Versions3DLaplace PRIVATE ${PROC_OPT} ${OPT} "-fbacktrace") + +# Link to opencmiss +# ----------------- +# +# This simply uses the opencmiss target created by OC_INIT() above. +# +# Alternatively, you can also directly invoke 'find_package(Iron )' 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 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(Versions3DLaplace PRIVATE opencmiss) + +# Add a simple test that runs the executable +add_test(NAME test_Versions3DLaplace COMMAND Versions3DLaplace) +add_opencmiss_environment(test_Versions3DLaplace) + +################### +# 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. +# diff --git a/Meshes/Versions3DLaplace/src/Versions3DLaplaceExample.f90 b/Meshes/Versions3DLaplace/Fortran/src/Versions3DLaplaceExample.f90 similarity index 100% rename from Meshes/Versions3DLaplace/src/Versions3DLaplaceExample.f90 rename to Meshes/Versions3DLaplace/Fortran/src/Versions3DLaplaceExample.f90 diff --git a/Meshes/Versions3DLaplace/OpenCMISS.cmake b/Meshes/Versions3DLaplace/OpenCMISS.cmake new file mode 100644 index 00000000..3d6cf515 --- /dev/null +++ b/Meshes/Versions3DLaplace/OpenCMISS.cmake @@ -0,0 +1,95 @@ +########################### +# *DO NOT CHANGE THIS FILE* +########################### +# +# Prepares the use of OpenCMISS by scanning at various path locations for OpenCMISS (SDK) installations. +# +# Search order: +# - OPENCMISS_INSTALL_DIR variable +# - OPENCMISS_INSTALL_DIR environment variable +# - OPENCMISS_SDK_DIR variable +# - OPENCMISS_SDK_DIR environment variable +# - [Windows only] The Registry is searched additionally for installed SDKs. +# +# If found +# - Includes the toolchain config script of the found opencmiss installation to enable toolchain selection logic (non-windows) + +# Convenience: The OPENCMISS_INSTALL_DIR may also be defined in the environment and various other places +if (DEFINED OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using specified installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The specified OPENCMISS_INSTALL_DIR '${OPENCMISS_INSTALL_DIR}' does not exist. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_INSTALL_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_INSTALL_DIR}" OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using environment installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The environment variable OPENCMISS_INSTALL_DIR='${OPENCMISS_INSTALL_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if (NOT OPENCMISS_INSTALL_DIR AND DEFINED OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The specified OPENCMISS_SDK_DIR '${OPENCMISS_SDK_DIR}' does not exist. Skipping.") + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_SDK_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_SDK_DIR}" OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using environment SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The environment variable OPENCMISS_SDK_DIR='${OPENCMISS_SDK_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_SDK_DIR) + endif() +endif() +# On windows: check the registry for installed OpenCMISS SDKs +if(NOT OPENCMISS_INSTALL_DIR AND WIN32) + foreach(ROOT HKEY_CURRENT_USER HKEY_LOCAL_MACHINE) + foreach(PACKAGE OpenCMISSUserSDK OpenCMISSDeveloperSDK) + set(_REG_KEY "[${ROOT}\\Software\\Auckland Bioengineering Institute\\${PACKAGE}]") + get_filename_component(OPENCMISS_INSTALL_DIR "${_REG_KEY}" ABSOLUTE) + #message(STATUS "Trying registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Found ${PACKAGE} in Windows registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + break() + else() + unset(OPENCMISS_INSTALL_DIR) + endif() + endforeach() + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + break() + endif() + endforeach() +endif() + +if(OPENCMISS_INSTALL_DIR) + message(STATUS "OPENCMISS_INSTALL_DIR=${OPENCMISS_INSTALL_DIR}") + # Use the OpenCMISS scripts to also allow choosing a separate toolchain + # This file is located at the opencmiss installation rather than the local example + # as it avoids file replication and makes maintenance much easier + if (TOOLCHAIN) + set(_OCTC ${OPENCMISS_INSTALL_DIR}/cmake/OCToolchainCompilers.cmake) + if (EXISTS "${_OCTC}") + include(${_OCTC}) + else() + message(WARNING "TOOLCHAIN specified but OpenCMISS config script could not be found at ${_OCTC}. Trying CMake defaults.") + endif() + unset(_OCTC) + endif() + set(OpenCMISS_DIR "${OPENCMISS_INSTALL_DIR}" CACHE PATH "Path to the found OpenCMISS (SDK) installation") +else() + message(WARNING "No OpenCMISS (SDK) installation directory detected. Using default system environment.") +endif() + \ No newline at end of file diff --git a/Meshes/Versions3DLaplace/build_debug/build.sh b/Meshes/Versions3DLaplace/build_debug/build.sh new file mode 100644 index 00000000..e6624bac --- /dev/null +++ b/Meshes/Versions3DLaplace/build_debug/build.sh @@ -0,0 +1,2 @@ +#ccc && cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all +cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all diff --git a/MultiPhysics/BioelectricFiniteElasticity/GudunovMonodomainElasticity1D3DMesh/simple_geometry/CMakeLists.txt b/MultiPhysics/BioelectricFiniteElasticity/GudunovMonodomainElasticity1D3DMesh/simple_geometry/CMakeLists.txt new file mode 100644 index 00000000..a22b61ee --- /dev/null +++ b/MultiPhysics/BioelectricFiniteElasticity/GudunovMonodomainElasticity1D3DMesh/simple_geometry/CMakeLists.txt @@ -0,0 +1,35 @@ +# 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 C) +enable_language(Fortran OPTIONAL) +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 +# ---------------------- +#add_subdirectory(C) +if (CMAKE_Fortran_COMPILER) + add_subdirectory(Fortran) +endif() diff --git a/MultiPhysics/BioelectricFiniteElasticity/GudunovMonodomainElasticity1D3DMesh/simple_geometry/Fortran/CMakeLists.txt b/MultiPhysics/BioelectricFiniteElasticity/GudunovMonodomainElasticity1D3DMesh/simple_geometry/Fortran/CMakeLists.txt new file mode 100644 index 00000000..1a6da7cd --- /dev/null +++ b/MultiPhysics/BioelectricFiniteElasticity/GudunovMonodomainElasticity1D3DMesh/simple_geometry/Fortran/CMakeLists.txt @@ -0,0 +1,60 @@ + +# Add example executable +add_executable(simple_geometry src/simple_geometryExample.f90) + +# Turn on Fortran preprocessing (#include directives) +if (MSVC) + set(PROC_OPT "/fpp") +else() + set(PROC_OPT "-cpp") +endif() + +# in debug mode, add flag that make Floating point exceptions fatal +set(OPT "") +if (FALSE) + if(CMAKE_BUILD_TYPE MATCHES DEBUG) + set(OPT "-ffpe-trap=invalid,zero,underflow,overflow,denormal") # GCC: make floating point exceptions fatal + endif() +endif() + +target_compile_options(simple_geometry PRIVATE ${PROC_OPT} ${OPT} "-fbacktrace") + +# Link to opencmiss +# ----------------- +# +# This simply uses the opencmiss target created by OC_INIT() above. +# +# Alternatively, you can also directly invoke 'find_package(Iron )' 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 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(simple_geometry PRIVATE opencmiss) + +# Add a simple test that runs the executable +add_test(NAME test_simple_geometry COMMAND simple_geometry) +add_opencmiss_environment(test_simple_geometry) + +################### +# 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. +# diff --git a/MultiPhysics/BioelectricFiniteElasticity/GudunovMonodomainElasticity1D3DMesh/simple_geometry/src/simple_geometryExample.f90 b/MultiPhysics/BioelectricFiniteElasticity/GudunovMonodomainElasticity1D3DMesh/simple_geometry/Fortran/src/simple_geometryExample.f90 similarity index 100% rename from MultiPhysics/BioelectricFiniteElasticity/GudunovMonodomainElasticity1D3DMesh/simple_geometry/src/simple_geometryExample.f90 rename to MultiPhysics/BioelectricFiniteElasticity/GudunovMonodomainElasticity1D3DMesh/simple_geometry/Fortran/src/simple_geometryExample.f90 diff --git a/MultiPhysics/BioelectricFiniteElasticity/GudunovMonodomainElasticity1D3DMesh/simple_geometry/OpenCMISS.cmake b/MultiPhysics/BioelectricFiniteElasticity/GudunovMonodomainElasticity1D3DMesh/simple_geometry/OpenCMISS.cmake new file mode 100644 index 00000000..3d6cf515 --- /dev/null +++ b/MultiPhysics/BioelectricFiniteElasticity/GudunovMonodomainElasticity1D3DMesh/simple_geometry/OpenCMISS.cmake @@ -0,0 +1,95 @@ +########################### +# *DO NOT CHANGE THIS FILE* +########################### +# +# Prepares the use of OpenCMISS by scanning at various path locations for OpenCMISS (SDK) installations. +# +# Search order: +# - OPENCMISS_INSTALL_DIR variable +# - OPENCMISS_INSTALL_DIR environment variable +# - OPENCMISS_SDK_DIR variable +# - OPENCMISS_SDK_DIR environment variable +# - [Windows only] The Registry is searched additionally for installed SDKs. +# +# If found +# - Includes the toolchain config script of the found opencmiss installation to enable toolchain selection logic (non-windows) + +# Convenience: The OPENCMISS_INSTALL_DIR may also be defined in the environment and various other places +if (DEFINED OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using specified installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The specified OPENCMISS_INSTALL_DIR '${OPENCMISS_INSTALL_DIR}' does not exist. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_INSTALL_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_INSTALL_DIR}" OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using environment installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The environment variable OPENCMISS_INSTALL_DIR='${OPENCMISS_INSTALL_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if (NOT OPENCMISS_INSTALL_DIR AND DEFINED OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The specified OPENCMISS_SDK_DIR '${OPENCMISS_SDK_DIR}' does not exist. Skipping.") + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_SDK_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_SDK_DIR}" OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using environment SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The environment variable OPENCMISS_SDK_DIR='${OPENCMISS_SDK_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_SDK_DIR) + endif() +endif() +# On windows: check the registry for installed OpenCMISS SDKs +if(NOT OPENCMISS_INSTALL_DIR AND WIN32) + foreach(ROOT HKEY_CURRENT_USER HKEY_LOCAL_MACHINE) + foreach(PACKAGE OpenCMISSUserSDK OpenCMISSDeveloperSDK) + set(_REG_KEY "[${ROOT}\\Software\\Auckland Bioengineering Institute\\${PACKAGE}]") + get_filename_component(OPENCMISS_INSTALL_DIR "${_REG_KEY}" ABSOLUTE) + #message(STATUS "Trying registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Found ${PACKAGE} in Windows registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + break() + else() + unset(OPENCMISS_INSTALL_DIR) + endif() + endforeach() + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + break() + endif() + endforeach() +endif() + +if(OPENCMISS_INSTALL_DIR) + message(STATUS "OPENCMISS_INSTALL_DIR=${OPENCMISS_INSTALL_DIR}") + # Use the OpenCMISS scripts to also allow choosing a separate toolchain + # This file is located at the opencmiss installation rather than the local example + # as it avoids file replication and makes maintenance much easier + if (TOOLCHAIN) + set(_OCTC ${OPENCMISS_INSTALL_DIR}/cmake/OCToolchainCompilers.cmake) + if (EXISTS "${_OCTC}") + include(${_OCTC}) + else() + message(WARNING "TOOLCHAIN specified but OpenCMISS config script could not be found at ${_OCTC}. Trying CMake defaults.") + endif() + unset(_OCTC) + endif() + set(OpenCMISS_DIR "${OPENCMISS_INSTALL_DIR}" CACHE PATH "Path to the found OpenCMISS (SDK) installation") +else() + message(WARNING "No OpenCMISS (SDK) installation directory detected. Using default system environment.") +endif() + \ No newline at end of file diff --git a/MultiPhysics/BioelectricFiniteElasticity/GudunovMonodomainElasticity1D3DMesh/simple_geometry/build_debug/build.sh b/MultiPhysics/BioelectricFiniteElasticity/GudunovMonodomainElasticity1D3DMesh/simple_geometry/build_debug/build.sh new file mode 100644 index 00000000..e6624bac --- /dev/null +++ b/MultiPhysics/BioelectricFiniteElasticity/GudunovMonodomainElasticity1D3DMesh/simple_geometry/build_debug/build.sh @@ -0,0 +1,2 @@ +#ccc && cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all +cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all diff --git a/MultiPhysics/BioelectricFiniteElasticity/GudunovMonodomainElasticity1D3DMesh/titin_10/CMakeLists.txt b/MultiPhysics/BioelectricFiniteElasticity/GudunovMonodomainElasticity1D3DMesh/titin_10/CMakeLists.txt new file mode 100644 index 00000000..a22b61ee --- /dev/null +++ b/MultiPhysics/BioelectricFiniteElasticity/GudunovMonodomainElasticity1D3DMesh/titin_10/CMakeLists.txt @@ -0,0 +1,35 @@ +# 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 C) +enable_language(Fortran OPTIONAL) +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 +# ---------------------- +#add_subdirectory(C) +if (CMAKE_Fortran_COMPILER) + add_subdirectory(Fortran) +endif() diff --git a/MultiPhysics/BioelectricFiniteElasticity/GudunovMonodomainElasticity1D3DMesh/titin_10/Fortran/CMakeLists.txt b/MultiPhysics/BioelectricFiniteElasticity/GudunovMonodomainElasticity1D3DMesh/titin_10/Fortran/CMakeLists.txt new file mode 100644 index 00000000..b4813d14 --- /dev/null +++ b/MultiPhysics/BioelectricFiniteElasticity/GudunovMonodomainElasticity1D3DMesh/titin_10/Fortran/CMakeLists.txt @@ -0,0 +1,60 @@ + +# Add example executable +add_executable(titin_10 src/titin_10Example.f90) + +# Turn on Fortran preprocessing (#include directives) +if (MSVC) + set(PROC_OPT "/fpp") +else() + set(PROC_OPT "-cpp") +endif() + +# in debug mode, add flag that make Floating point exceptions fatal +set(OPT "") +if (FALSE) + if(CMAKE_BUILD_TYPE MATCHES DEBUG) + set(OPT "-ffpe-trap=invalid,zero,underflow,overflow,denormal") # GCC: make floating point exceptions fatal + endif() +endif() + +target_compile_options(titin_10 PRIVATE ${PROC_OPT} ${OPT} "-fbacktrace") + +# Link to opencmiss +# ----------------- +# +# This simply uses the opencmiss target created by OC_INIT() above. +# +# Alternatively, you can also directly invoke 'find_package(Iron )' 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 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(titin_10 PRIVATE opencmiss) + +# Add a simple test that runs the executable +add_test(NAME test_titin_10 COMMAND titin_10) +add_opencmiss_environment(test_titin_10) + +################### +# 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. +# diff --git a/MultiPhysics/BioelectricFiniteElasticity/GudunovMonodomainElasticity1D3DMesh/titin_10/src/titin_10Example.f90 b/MultiPhysics/BioelectricFiniteElasticity/GudunovMonodomainElasticity1D3DMesh/titin_10/Fortran/src/titin_10Example.f90 similarity index 100% rename from MultiPhysics/BioelectricFiniteElasticity/GudunovMonodomainElasticity1D3DMesh/titin_10/src/titin_10Example.f90 rename to MultiPhysics/BioelectricFiniteElasticity/GudunovMonodomainElasticity1D3DMesh/titin_10/Fortran/src/titin_10Example.f90 diff --git a/MultiPhysics/BioelectricFiniteElasticity/GudunovMonodomainElasticity1D3DMesh/titin_10/OpenCMISS.cmake b/MultiPhysics/BioelectricFiniteElasticity/GudunovMonodomainElasticity1D3DMesh/titin_10/OpenCMISS.cmake new file mode 100644 index 00000000..3d6cf515 --- /dev/null +++ b/MultiPhysics/BioelectricFiniteElasticity/GudunovMonodomainElasticity1D3DMesh/titin_10/OpenCMISS.cmake @@ -0,0 +1,95 @@ +########################### +# *DO NOT CHANGE THIS FILE* +########################### +# +# Prepares the use of OpenCMISS by scanning at various path locations for OpenCMISS (SDK) installations. +# +# Search order: +# - OPENCMISS_INSTALL_DIR variable +# - OPENCMISS_INSTALL_DIR environment variable +# - OPENCMISS_SDK_DIR variable +# - OPENCMISS_SDK_DIR environment variable +# - [Windows only] The Registry is searched additionally for installed SDKs. +# +# If found +# - Includes the toolchain config script of the found opencmiss installation to enable toolchain selection logic (non-windows) + +# Convenience: The OPENCMISS_INSTALL_DIR may also be defined in the environment and various other places +if (DEFINED OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using specified installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The specified OPENCMISS_INSTALL_DIR '${OPENCMISS_INSTALL_DIR}' does not exist. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_INSTALL_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_INSTALL_DIR}" OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using environment installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The environment variable OPENCMISS_INSTALL_DIR='${OPENCMISS_INSTALL_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if (NOT OPENCMISS_INSTALL_DIR AND DEFINED OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The specified OPENCMISS_SDK_DIR '${OPENCMISS_SDK_DIR}' does not exist. Skipping.") + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_SDK_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_SDK_DIR}" OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using environment SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The environment variable OPENCMISS_SDK_DIR='${OPENCMISS_SDK_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_SDK_DIR) + endif() +endif() +# On windows: check the registry for installed OpenCMISS SDKs +if(NOT OPENCMISS_INSTALL_DIR AND WIN32) + foreach(ROOT HKEY_CURRENT_USER HKEY_LOCAL_MACHINE) + foreach(PACKAGE OpenCMISSUserSDK OpenCMISSDeveloperSDK) + set(_REG_KEY "[${ROOT}\\Software\\Auckland Bioengineering Institute\\${PACKAGE}]") + get_filename_component(OPENCMISS_INSTALL_DIR "${_REG_KEY}" ABSOLUTE) + #message(STATUS "Trying registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Found ${PACKAGE} in Windows registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + break() + else() + unset(OPENCMISS_INSTALL_DIR) + endif() + endforeach() + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + break() + endif() + endforeach() +endif() + +if(OPENCMISS_INSTALL_DIR) + message(STATUS "OPENCMISS_INSTALL_DIR=${OPENCMISS_INSTALL_DIR}") + # Use the OpenCMISS scripts to also allow choosing a separate toolchain + # This file is located at the opencmiss installation rather than the local example + # as it avoids file replication and makes maintenance much easier + if (TOOLCHAIN) + set(_OCTC ${OPENCMISS_INSTALL_DIR}/cmake/OCToolchainCompilers.cmake) + if (EXISTS "${_OCTC}") + include(${_OCTC}) + else() + message(WARNING "TOOLCHAIN specified but OpenCMISS config script could not be found at ${_OCTC}. Trying CMake defaults.") + endif() + unset(_OCTC) + endif() + set(OpenCMISS_DIR "${OPENCMISS_INSTALL_DIR}" CACHE PATH "Path to the found OpenCMISS (SDK) installation") +else() + message(WARNING "No OpenCMISS (SDK) installation directory detected. Using default system environment.") +endif() + \ No newline at end of file diff --git a/MultiPhysics/BioelectricFiniteElasticity/GudunovMonodomainElasticity1D3DMesh/titin_10/build_debug/build.sh b/MultiPhysics/BioelectricFiniteElasticity/GudunovMonodomainElasticity1D3DMesh/titin_10/build_debug/build.sh new file mode 100644 index 00000000..e6624bac --- /dev/null +++ b/MultiPhysics/BioelectricFiniteElasticity/GudunovMonodomainElasticity1D3DMesh/titin_10/build_debug/build.sh @@ -0,0 +1,2 @@ +#ccc && cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all +cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all diff --git a/MultiPhysics/BioelectricFiniteElasticity/GudunovMonodomainElasticity1D3DMesh/while_loop/CMakeLists.txt b/MultiPhysics/BioelectricFiniteElasticity/GudunovMonodomainElasticity1D3DMesh/while_loop/CMakeLists.txt new file mode 100644 index 00000000..a22b61ee --- /dev/null +++ b/MultiPhysics/BioelectricFiniteElasticity/GudunovMonodomainElasticity1D3DMesh/while_loop/CMakeLists.txt @@ -0,0 +1,35 @@ +# 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 C) +enable_language(Fortran OPTIONAL) +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 +# ---------------------- +#add_subdirectory(C) +if (CMAKE_Fortran_COMPILER) + add_subdirectory(Fortran) +endif() diff --git a/MultiPhysics/BioelectricFiniteElasticity/GudunovMonodomainElasticity1D3DMesh/while_loop/Fortran/CMakeLists.txt b/MultiPhysics/BioelectricFiniteElasticity/GudunovMonodomainElasticity1D3DMesh/while_loop/Fortran/CMakeLists.txt new file mode 100644 index 00000000..9effedf2 --- /dev/null +++ b/MultiPhysics/BioelectricFiniteElasticity/GudunovMonodomainElasticity1D3DMesh/while_loop/Fortran/CMakeLists.txt @@ -0,0 +1,60 @@ + +# Add example executable +add_executable(while_loop src/while_loopExample.f90) + +# Turn on Fortran preprocessing (#include directives) +if (MSVC) + set(PROC_OPT "/fpp") +else() + set(PROC_OPT "-cpp") +endif() + +# in debug mode, add flag that make Floating point exceptions fatal +set(OPT "") +if (FALSE) + if(CMAKE_BUILD_TYPE MATCHES DEBUG) + set(OPT "-ffpe-trap=invalid,zero,underflow,overflow,denormal") # GCC: make floating point exceptions fatal + endif() +endif() + +target_compile_options(while_loop PRIVATE ${PROC_OPT} ${OPT} "-fbacktrace") + +# Link to opencmiss +# ----------------- +# +# This simply uses the opencmiss target created by OC_INIT() above. +# +# Alternatively, you can also directly invoke 'find_package(Iron )' 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 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(while_loop PRIVATE opencmiss) + +# Add a simple test that runs the executable +add_test(NAME test_while_loop COMMAND while_loop) +add_opencmiss_environment(test_while_loop) + +################### +# 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. +# diff --git a/MultiPhysics/BioelectricFiniteElasticity/GudunovMonodomainElasticity1D3DMesh/while_loop/src/while_loopExample.f90 b/MultiPhysics/BioelectricFiniteElasticity/GudunovMonodomainElasticity1D3DMesh/while_loop/Fortran/src/while_loopExample.f90 similarity index 100% rename from MultiPhysics/BioelectricFiniteElasticity/GudunovMonodomainElasticity1D3DMesh/while_loop/src/while_loopExample.f90 rename to MultiPhysics/BioelectricFiniteElasticity/GudunovMonodomainElasticity1D3DMesh/while_loop/Fortran/src/while_loopExample.f90 diff --git a/MultiPhysics/BioelectricFiniteElasticity/GudunovMonodomainElasticity1D3DMesh/while_loop/OpenCMISS.cmake b/MultiPhysics/BioelectricFiniteElasticity/GudunovMonodomainElasticity1D3DMesh/while_loop/OpenCMISS.cmake new file mode 100644 index 00000000..3d6cf515 --- /dev/null +++ b/MultiPhysics/BioelectricFiniteElasticity/GudunovMonodomainElasticity1D3DMesh/while_loop/OpenCMISS.cmake @@ -0,0 +1,95 @@ +########################### +# *DO NOT CHANGE THIS FILE* +########################### +# +# Prepares the use of OpenCMISS by scanning at various path locations for OpenCMISS (SDK) installations. +# +# Search order: +# - OPENCMISS_INSTALL_DIR variable +# - OPENCMISS_INSTALL_DIR environment variable +# - OPENCMISS_SDK_DIR variable +# - OPENCMISS_SDK_DIR environment variable +# - [Windows only] The Registry is searched additionally for installed SDKs. +# +# If found +# - Includes the toolchain config script of the found opencmiss installation to enable toolchain selection logic (non-windows) + +# Convenience: The OPENCMISS_INSTALL_DIR may also be defined in the environment and various other places +if (DEFINED OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using specified installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The specified OPENCMISS_INSTALL_DIR '${OPENCMISS_INSTALL_DIR}' does not exist. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_INSTALL_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_INSTALL_DIR}" OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using environment installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The environment variable OPENCMISS_INSTALL_DIR='${OPENCMISS_INSTALL_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if (NOT OPENCMISS_INSTALL_DIR AND DEFINED OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The specified OPENCMISS_SDK_DIR '${OPENCMISS_SDK_DIR}' does not exist. Skipping.") + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_SDK_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_SDK_DIR}" OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using environment SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The environment variable OPENCMISS_SDK_DIR='${OPENCMISS_SDK_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_SDK_DIR) + endif() +endif() +# On windows: check the registry for installed OpenCMISS SDKs +if(NOT OPENCMISS_INSTALL_DIR AND WIN32) + foreach(ROOT HKEY_CURRENT_USER HKEY_LOCAL_MACHINE) + foreach(PACKAGE OpenCMISSUserSDK OpenCMISSDeveloperSDK) + set(_REG_KEY "[${ROOT}\\Software\\Auckland Bioengineering Institute\\${PACKAGE}]") + get_filename_component(OPENCMISS_INSTALL_DIR "${_REG_KEY}" ABSOLUTE) + #message(STATUS "Trying registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Found ${PACKAGE} in Windows registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + break() + else() + unset(OPENCMISS_INSTALL_DIR) + endif() + endforeach() + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + break() + endif() + endforeach() +endif() + +if(OPENCMISS_INSTALL_DIR) + message(STATUS "OPENCMISS_INSTALL_DIR=${OPENCMISS_INSTALL_DIR}") + # Use the OpenCMISS scripts to also allow choosing a separate toolchain + # This file is located at the opencmiss installation rather than the local example + # as it avoids file replication and makes maintenance much easier + if (TOOLCHAIN) + set(_OCTC ${OPENCMISS_INSTALL_DIR}/cmake/OCToolchainCompilers.cmake) + if (EXISTS "${_OCTC}") + include(${_OCTC}) + else() + message(WARNING "TOOLCHAIN specified but OpenCMISS config script could not be found at ${_OCTC}. Trying CMake defaults.") + endif() + unset(_OCTC) + endif() + set(OpenCMISS_DIR "${OPENCMISS_INSTALL_DIR}" CACHE PATH "Path to the found OpenCMISS (SDK) installation") +else() + message(WARNING "No OpenCMISS (SDK) installation directory detected. Using default system environment.") +endif() + \ No newline at end of file diff --git a/MultiPhysics/BioelectricFiniteElasticity/GudunovMonodomainElasticity1D3DMesh/while_loop/build_debug/build.sh b/MultiPhysics/BioelectricFiniteElasticity/GudunovMonodomainElasticity1D3DMesh/while_loop/build_debug/build.sh new file mode 100644 index 00000000..e6624bac --- /dev/null +++ b/MultiPhysics/BioelectricFiniteElasticity/GudunovMonodomainElasticity1D3DMesh/while_loop/build_debug/build.sh @@ -0,0 +1,2 @@ +#ccc && cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all +cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all diff --git a/MultiPhysics/BioelectricFiniteElasticity/GudunovMonodomainElasticitySameMesh/CMakeLists.txt b/MultiPhysics/BioelectricFiniteElasticity/GudunovMonodomainElasticitySameMesh/CMakeLists.txt new file mode 100644 index 00000000..a22b61ee --- /dev/null +++ b/MultiPhysics/BioelectricFiniteElasticity/GudunovMonodomainElasticitySameMesh/CMakeLists.txt @@ -0,0 +1,35 @@ +# 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 C) +enable_language(Fortran OPTIONAL) +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 +# ---------------------- +#add_subdirectory(C) +if (CMAKE_Fortran_COMPILER) + add_subdirectory(Fortran) +endif() diff --git a/MultiPhysics/BioelectricFiniteElasticity/GudunovMonodomainElasticitySameMesh/Fortran/CMakeLists.txt b/MultiPhysics/BioelectricFiniteElasticity/GudunovMonodomainElasticitySameMesh/Fortran/CMakeLists.txt new file mode 100644 index 00000000..a3337589 --- /dev/null +++ b/MultiPhysics/BioelectricFiniteElasticity/GudunovMonodomainElasticitySameMesh/Fortran/CMakeLists.txt @@ -0,0 +1,60 @@ + +# Add example executable +add_executable(GudunovMonodomainElasticitySameMesh src/GudunovMonodomainElasticitySameMeshExample.f90) + +# Turn on Fortran preprocessing (#include directives) +if (MSVC) + set(PROC_OPT "/fpp") +else() + set(PROC_OPT "-cpp") +endif() + +# in debug mode, add flag that make Floating point exceptions fatal +set(OPT "") +if (FALSE) + if(CMAKE_BUILD_TYPE MATCHES DEBUG) + set(OPT "-ffpe-trap=invalid,zero,underflow,overflow,denormal") # GCC: make floating point exceptions fatal + endif() +endif() + +target_compile_options(GudunovMonodomainElasticitySameMesh PRIVATE ${PROC_OPT} ${OPT} "-fbacktrace") + +# Link to opencmiss +# ----------------- +# +# This simply uses the opencmiss target created by OC_INIT() above. +# +# Alternatively, you can also directly invoke 'find_package(Iron )' 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 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(GudunovMonodomainElasticitySameMesh PRIVATE opencmiss) + +# Add a simple test that runs the executable +add_test(NAME test_GudunovMonodomainElasticitySameMesh COMMAND GudunovMonodomainElasticitySameMesh) +add_opencmiss_environment(test_GudunovMonodomainElasticitySameMesh) + +################### +# 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. +# diff --git a/MultiPhysics/BioelectricFiniteElasticity/GudunovMonodomainElasticitySameMesh/src/GudunovMonodomainElasticitySameMeshExample.f90 b/MultiPhysics/BioelectricFiniteElasticity/GudunovMonodomainElasticitySameMesh/Fortran/src/GudunovMonodomainElasticitySameMeshExample.f90 similarity index 100% rename from MultiPhysics/BioelectricFiniteElasticity/GudunovMonodomainElasticitySameMesh/src/GudunovMonodomainElasticitySameMeshExample.f90 rename to MultiPhysics/BioelectricFiniteElasticity/GudunovMonodomainElasticitySameMesh/Fortran/src/GudunovMonodomainElasticitySameMeshExample.f90 diff --git a/MultiPhysics/BioelectricFiniteElasticity/GudunovMonodomainElasticitySameMesh/OpenCMISS.cmake b/MultiPhysics/BioelectricFiniteElasticity/GudunovMonodomainElasticitySameMesh/OpenCMISS.cmake new file mode 100644 index 00000000..3d6cf515 --- /dev/null +++ b/MultiPhysics/BioelectricFiniteElasticity/GudunovMonodomainElasticitySameMesh/OpenCMISS.cmake @@ -0,0 +1,95 @@ +########################### +# *DO NOT CHANGE THIS FILE* +########################### +# +# Prepares the use of OpenCMISS by scanning at various path locations for OpenCMISS (SDK) installations. +# +# Search order: +# - OPENCMISS_INSTALL_DIR variable +# - OPENCMISS_INSTALL_DIR environment variable +# - OPENCMISS_SDK_DIR variable +# - OPENCMISS_SDK_DIR environment variable +# - [Windows only] The Registry is searched additionally for installed SDKs. +# +# If found +# - Includes the toolchain config script of the found opencmiss installation to enable toolchain selection logic (non-windows) + +# Convenience: The OPENCMISS_INSTALL_DIR may also be defined in the environment and various other places +if (DEFINED OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using specified installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The specified OPENCMISS_INSTALL_DIR '${OPENCMISS_INSTALL_DIR}' does not exist. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_INSTALL_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_INSTALL_DIR}" OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using environment installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The environment variable OPENCMISS_INSTALL_DIR='${OPENCMISS_INSTALL_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if (NOT OPENCMISS_INSTALL_DIR AND DEFINED OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The specified OPENCMISS_SDK_DIR '${OPENCMISS_SDK_DIR}' does not exist. Skipping.") + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_SDK_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_SDK_DIR}" OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using environment SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The environment variable OPENCMISS_SDK_DIR='${OPENCMISS_SDK_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_SDK_DIR) + endif() +endif() +# On windows: check the registry for installed OpenCMISS SDKs +if(NOT OPENCMISS_INSTALL_DIR AND WIN32) + foreach(ROOT HKEY_CURRENT_USER HKEY_LOCAL_MACHINE) + foreach(PACKAGE OpenCMISSUserSDK OpenCMISSDeveloperSDK) + set(_REG_KEY "[${ROOT}\\Software\\Auckland Bioengineering Institute\\${PACKAGE}]") + get_filename_component(OPENCMISS_INSTALL_DIR "${_REG_KEY}" ABSOLUTE) + #message(STATUS "Trying registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Found ${PACKAGE} in Windows registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + break() + else() + unset(OPENCMISS_INSTALL_DIR) + endif() + endforeach() + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + break() + endif() + endforeach() +endif() + +if(OPENCMISS_INSTALL_DIR) + message(STATUS "OPENCMISS_INSTALL_DIR=${OPENCMISS_INSTALL_DIR}") + # Use the OpenCMISS scripts to also allow choosing a separate toolchain + # This file is located at the opencmiss installation rather than the local example + # as it avoids file replication and makes maintenance much easier + if (TOOLCHAIN) + set(_OCTC ${OPENCMISS_INSTALL_DIR}/cmake/OCToolchainCompilers.cmake) + if (EXISTS "${_OCTC}") + include(${_OCTC}) + else() + message(WARNING "TOOLCHAIN specified but OpenCMISS config script could not be found at ${_OCTC}. Trying CMake defaults.") + endif() + unset(_OCTC) + endif() + set(OpenCMISS_DIR "${OPENCMISS_INSTALL_DIR}" CACHE PATH "Path to the found OpenCMISS (SDK) installation") +else() + message(WARNING "No OpenCMISS (SDK) installation directory detected. Using default system environment.") +endif() + \ No newline at end of file diff --git a/MultiPhysics/BioelectricFiniteElasticity/GudunovMonodomainElasticitySameMesh/build_debug/build.sh b/MultiPhysics/BioelectricFiniteElasticity/GudunovMonodomainElasticitySameMesh/build_debug/build.sh new file mode 100644 index 00000000..e6624bac --- /dev/null +++ b/MultiPhysics/BioelectricFiniteElasticity/GudunovMonodomainElasticitySameMesh/build_debug/build.sh @@ -0,0 +1,2 @@ +#ccc && cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all +cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all diff --git a/MultiPhysics/CoupledDiffusionAdvectionDiffusion/CMakeLists.txt b/MultiPhysics/CoupledDiffusionAdvectionDiffusion/CMakeLists.txt new file mode 100644 index 00000000..a22b61ee --- /dev/null +++ b/MultiPhysics/CoupledDiffusionAdvectionDiffusion/CMakeLists.txt @@ -0,0 +1,35 @@ +# 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 C) +enable_language(Fortran OPTIONAL) +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 +# ---------------------- +#add_subdirectory(C) +if (CMAKE_Fortran_COMPILER) + add_subdirectory(Fortran) +endif() diff --git a/MultiPhysics/CoupledDiffusionAdvectionDiffusion/Fortran/CMakeLists.txt b/MultiPhysics/CoupledDiffusionAdvectionDiffusion/Fortran/CMakeLists.txt new file mode 100644 index 00000000..0fce269b --- /dev/null +++ b/MultiPhysics/CoupledDiffusionAdvectionDiffusion/Fortran/CMakeLists.txt @@ -0,0 +1,60 @@ + +# Add example executable +add_executable(CoupledDiffusionAdvectionDiffusion src/CoupledDiffusionAdvectionDiffusionExample.f90 src/CoupledDiffusionAdvectionDiffusionExample_old.f90) + +# Turn on Fortran preprocessing (#include directives) +if (MSVC) + set(PROC_OPT "/fpp") +else() + set(PROC_OPT "-cpp") +endif() + +# in debug mode, add flag that make Floating point exceptions fatal +set(OPT "") +if (FALSE) + if(CMAKE_BUILD_TYPE MATCHES DEBUG) + set(OPT "-ffpe-trap=invalid,zero,underflow,overflow,denormal") # GCC: make floating point exceptions fatal + endif() +endif() + +target_compile_options(CoupledDiffusionAdvectionDiffusion PRIVATE ${PROC_OPT} ${OPT} "-fbacktrace") + +# Link to opencmiss +# ----------------- +# +# This simply uses the opencmiss target created by OC_INIT() above. +# +# Alternatively, you can also directly invoke 'find_package(Iron )' 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 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(CoupledDiffusionAdvectionDiffusion PRIVATE opencmiss) + +# Add a simple test that runs the executable +add_test(NAME test_CoupledDiffusionAdvectionDiffusion COMMAND CoupledDiffusionAdvectionDiffusion) +add_opencmiss_environment(test_CoupledDiffusionAdvectionDiffusion) + +################### +# 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. +# diff --git a/MultiPhysics/CoupledDiffusionAdvectionDiffusion/src/CoupledDiffusionAdvectionDiffusionExample.f90 b/MultiPhysics/CoupledDiffusionAdvectionDiffusion/Fortran/src/CoupledDiffusionAdvectionDiffusionExample.f90 similarity index 100% rename from MultiPhysics/CoupledDiffusionAdvectionDiffusion/src/CoupledDiffusionAdvectionDiffusionExample.f90 rename to MultiPhysics/CoupledDiffusionAdvectionDiffusion/Fortran/src/CoupledDiffusionAdvectionDiffusionExample.f90 diff --git a/MultiPhysics/CoupledDiffusionAdvectionDiffusion/src/CoupledDiffusionAdvectionDiffusionExample_old.f90 b/MultiPhysics/CoupledDiffusionAdvectionDiffusion/Fortran/src/CoupledDiffusionAdvectionDiffusionExample_old.f90 similarity index 100% rename from MultiPhysics/CoupledDiffusionAdvectionDiffusion/src/CoupledDiffusionAdvectionDiffusionExample_old.f90 rename to MultiPhysics/CoupledDiffusionAdvectionDiffusion/Fortran/src/CoupledDiffusionAdvectionDiffusionExample_old.f90 diff --git a/MultiPhysics/CoupledDiffusionAdvectionDiffusion/OpenCMISS.cmake b/MultiPhysics/CoupledDiffusionAdvectionDiffusion/OpenCMISS.cmake new file mode 100644 index 00000000..3d6cf515 --- /dev/null +++ b/MultiPhysics/CoupledDiffusionAdvectionDiffusion/OpenCMISS.cmake @@ -0,0 +1,95 @@ +########################### +# *DO NOT CHANGE THIS FILE* +########################### +# +# Prepares the use of OpenCMISS by scanning at various path locations for OpenCMISS (SDK) installations. +# +# Search order: +# - OPENCMISS_INSTALL_DIR variable +# - OPENCMISS_INSTALL_DIR environment variable +# - OPENCMISS_SDK_DIR variable +# - OPENCMISS_SDK_DIR environment variable +# - [Windows only] The Registry is searched additionally for installed SDKs. +# +# If found +# - Includes the toolchain config script of the found opencmiss installation to enable toolchain selection logic (non-windows) + +# Convenience: The OPENCMISS_INSTALL_DIR may also be defined in the environment and various other places +if (DEFINED OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using specified installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The specified OPENCMISS_INSTALL_DIR '${OPENCMISS_INSTALL_DIR}' does not exist. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_INSTALL_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_INSTALL_DIR}" OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using environment installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The environment variable OPENCMISS_INSTALL_DIR='${OPENCMISS_INSTALL_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if (NOT OPENCMISS_INSTALL_DIR AND DEFINED OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The specified OPENCMISS_SDK_DIR '${OPENCMISS_SDK_DIR}' does not exist. Skipping.") + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_SDK_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_SDK_DIR}" OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using environment SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The environment variable OPENCMISS_SDK_DIR='${OPENCMISS_SDK_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_SDK_DIR) + endif() +endif() +# On windows: check the registry for installed OpenCMISS SDKs +if(NOT OPENCMISS_INSTALL_DIR AND WIN32) + foreach(ROOT HKEY_CURRENT_USER HKEY_LOCAL_MACHINE) + foreach(PACKAGE OpenCMISSUserSDK OpenCMISSDeveloperSDK) + set(_REG_KEY "[${ROOT}\\Software\\Auckland Bioengineering Institute\\${PACKAGE}]") + get_filename_component(OPENCMISS_INSTALL_DIR "${_REG_KEY}" ABSOLUTE) + #message(STATUS "Trying registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Found ${PACKAGE} in Windows registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + break() + else() + unset(OPENCMISS_INSTALL_DIR) + endif() + endforeach() + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + break() + endif() + endforeach() +endif() + +if(OPENCMISS_INSTALL_DIR) + message(STATUS "OPENCMISS_INSTALL_DIR=${OPENCMISS_INSTALL_DIR}") + # Use the OpenCMISS scripts to also allow choosing a separate toolchain + # This file is located at the opencmiss installation rather than the local example + # as it avoids file replication and makes maintenance much easier + if (TOOLCHAIN) + set(_OCTC ${OPENCMISS_INSTALL_DIR}/cmake/OCToolchainCompilers.cmake) + if (EXISTS "${_OCTC}") + include(${_OCTC}) + else() + message(WARNING "TOOLCHAIN specified but OpenCMISS config script could not be found at ${_OCTC}. Trying CMake defaults.") + endif() + unset(_OCTC) + endif() + set(OpenCMISS_DIR "${OPENCMISS_INSTALL_DIR}" CACHE PATH "Path to the found OpenCMISS (SDK) installation") +else() + message(WARNING "No OpenCMISS (SDK) installation directory detected. Using default system environment.") +endif() + \ No newline at end of file diff --git a/MultiPhysics/CoupledDiffusionAdvectionDiffusion/build_debug/build.sh b/MultiPhysics/CoupledDiffusionAdvectionDiffusion/build_debug/build.sh new file mode 100644 index 00000000..e6624bac --- /dev/null +++ b/MultiPhysics/CoupledDiffusionAdvectionDiffusion/build_debug/build.sh @@ -0,0 +1,2 @@ +#ccc && cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all +cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all diff --git a/MultiPhysics/CoupledDiffusionDiffusion/CoupledDiffusionDiffusion/CMakeLists.txt b/MultiPhysics/CoupledDiffusionDiffusion/CoupledDiffusionDiffusion/CMakeLists.txt new file mode 100644 index 00000000..a22b61ee --- /dev/null +++ b/MultiPhysics/CoupledDiffusionDiffusion/CoupledDiffusionDiffusion/CMakeLists.txt @@ -0,0 +1,35 @@ +# 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 C) +enable_language(Fortran OPTIONAL) +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 +# ---------------------- +#add_subdirectory(C) +if (CMAKE_Fortran_COMPILER) + add_subdirectory(Fortran) +endif() diff --git a/MultiPhysics/CoupledDiffusionDiffusion/CoupledDiffusionDiffusion/Fortran/CMakeLists.txt b/MultiPhysics/CoupledDiffusionDiffusion/CoupledDiffusionDiffusion/Fortran/CMakeLists.txt new file mode 100644 index 00000000..fc100426 --- /dev/null +++ b/MultiPhysics/CoupledDiffusionDiffusion/CoupledDiffusionDiffusion/Fortran/CMakeLists.txt @@ -0,0 +1,60 @@ + +# Add example executable +add_executable(CoupledDiffusionDiffusion src/CoupledDiffusionDiffusionExample.f90) + +# Turn on Fortran preprocessing (#include directives) +if (MSVC) + set(PROC_OPT "/fpp") +else() + set(PROC_OPT "-cpp") +endif() + +# in debug mode, add flag that make Floating point exceptions fatal +set(OPT "") +if (FALSE) + if(CMAKE_BUILD_TYPE MATCHES DEBUG) + set(OPT "-ffpe-trap=invalid,zero,underflow,overflow,denormal") # GCC: make floating point exceptions fatal + endif() +endif() + +target_compile_options(CoupledDiffusionDiffusion PRIVATE ${PROC_OPT} ${OPT} "-fbacktrace") + +# Link to opencmiss +# ----------------- +# +# This simply uses the opencmiss target created by OC_INIT() above. +# +# Alternatively, you can also directly invoke 'find_package(Iron )' 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 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(CoupledDiffusionDiffusion PRIVATE opencmiss) + +# Add a simple test that runs the executable +add_test(NAME test_CoupledDiffusionDiffusion COMMAND CoupledDiffusionDiffusion) +add_opencmiss_environment(test_CoupledDiffusionDiffusion) + +################### +# 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. +# diff --git a/MultiPhysics/CoupledDiffusionDiffusion/CoupledDiffusionDiffusion/src/CoupledDiffusionDiffusionExample.f90 b/MultiPhysics/CoupledDiffusionDiffusion/CoupledDiffusionDiffusion/Fortran/src/CoupledDiffusionDiffusionExample.f90 similarity index 100% rename from MultiPhysics/CoupledDiffusionDiffusion/CoupledDiffusionDiffusion/src/CoupledDiffusionDiffusionExample.f90 rename to MultiPhysics/CoupledDiffusionDiffusion/CoupledDiffusionDiffusion/Fortran/src/CoupledDiffusionDiffusionExample.f90 diff --git a/MultiPhysics/CoupledDiffusionDiffusion/CoupledDiffusionDiffusion/OpenCMISS.cmake b/MultiPhysics/CoupledDiffusionDiffusion/CoupledDiffusionDiffusion/OpenCMISS.cmake new file mode 100644 index 00000000..3d6cf515 --- /dev/null +++ b/MultiPhysics/CoupledDiffusionDiffusion/CoupledDiffusionDiffusion/OpenCMISS.cmake @@ -0,0 +1,95 @@ +########################### +# *DO NOT CHANGE THIS FILE* +########################### +# +# Prepares the use of OpenCMISS by scanning at various path locations for OpenCMISS (SDK) installations. +# +# Search order: +# - OPENCMISS_INSTALL_DIR variable +# - OPENCMISS_INSTALL_DIR environment variable +# - OPENCMISS_SDK_DIR variable +# - OPENCMISS_SDK_DIR environment variable +# - [Windows only] The Registry is searched additionally for installed SDKs. +# +# If found +# - Includes the toolchain config script of the found opencmiss installation to enable toolchain selection logic (non-windows) + +# Convenience: The OPENCMISS_INSTALL_DIR may also be defined in the environment and various other places +if (DEFINED OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using specified installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The specified OPENCMISS_INSTALL_DIR '${OPENCMISS_INSTALL_DIR}' does not exist. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_INSTALL_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_INSTALL_DIR}" OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using environment installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The environment variable OPENCMISS_INSTALL_DIR='${OPENCMISS_INSTALL_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if (NOT OPENCMISS_INSTALL_DIR AND DEFINED OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The specified OPENCMISS_SDK_DIR '${OPENCMISS_SDK_DIR}' does not exist. Skipping.") + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_SDK_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_SDK_DIR}" OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using environment SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The environment variable OPENCMISS_SDK_DIR='${OPENCMISS_SDK_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_SDK_DIR) + endif() +endif() +# On windows: check the registry for installed OpenCMISS SDKs +if(NOT OPENCMISS_INSTALL_DIR AND WIN32) + foreach(ROOT HKEY_CURRENT_USER HKEY_LOCAL_MACHINE) + foreach(PACKAGE OpenCMISSUserSDK OpenCMISSDeveloperSDK) + set(_REG_KEY "[${ROOT}\\Software\\Auckland Bioengineering Institute\\${PACKAGE}]") + get_filename_component(OPENCMISS_INSTALL_DIR "${_REG_KEY}" ABSOLUTE) + #message(STATUS "Trying registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Found ${PACKAGE} in Windows registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + break() + else() + unset(OPENCMISS_INSTALL_DIR) + endif() + endforeach() + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + break() + endif() + endforeach() +endif() + +if(OPENCMISS_INSTALL_DIR) + message(STATUS "OPENCMISS_INSTALL_DIR=${OPENCMISS_INSTALL_DIR}") + # Use the OpenCMISS scripts to also allow choosing a separate toolchain + # This file is located at the opencmiss installation rather than the local example + # as it avoids file replication and makes maintenance much easier + if (TOOLCHAIN) + set(_OCTC ${OPENCMISS_INSTALL_DIR}/cmake/OCToolchainCompilers.cmake) + if (EXISTS "${_OCTC}") + include(${_OCTC}) + else() + message(WARNING "TOOLCHAIN specified but OpenCMISS config script could not be found at ${_OCTC}. Trying CMake defaults.") + endif() + unset(_OCTC) + endif() + set(OpenCMISS_DIR "${OPENCMISS_INSTALL_DIR}" CACHE PATH "Path to the found OpenCMISS (SDK) installation") +else() + message(WARNING "No OpenCMISS (SDK) installation directory detected. Using default system environment.") +endif() + \ No newline at end of file diff --git a/MultiPhysics/CoupledDiffusionDiffusion/CoupledDiffusionDiffusion/build_debug/build.sh b/MultiPhysics/CoupledDiffusionDiffusion/CoupledDiffusionDiffusion/build_debug/build.sh new file mode 100644 index 00000000..e6624bac --- /dev/null +++ b/MultiPhysics/CoupledDiffusionDiffusion/CoupledDiffusionDiffusion/build_debug/build.sh @@ -0,0 +1,2 @@ +#ccc && cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all +cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all diff --git a/MultiPhysics/CoupledDiffusionDiffusion/MonolithicAnalyticTestThreeCompThreeDim/CMakeLists.txt b/MultiPhysics/CoupledDiffusionDiffusion/MonolithicAnalyticTestThreeCompThreeDim/CMakeLists.txt new file mode 100644 index 00000000..a22b61ee --- /dev/null +++ b/MultiPhysics/CoupledDiffusionDiffusion/MonolithicAnalyticTestThreeCompThreeDim/CMakeLists.txt @@ -0,0 +1,35 @@ +# 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 C) +enable_language(Fortran OPTIONAL) +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 +# ---------------------- +#add_subdirectory(C) +if (CMAKE_Fortran_COMPILER) + add_subdirectory(Fortran) +endif() diff --git a/MultiPhysics/CoupledDiffusionDiffusion/MonolithicAnalyticTestThreeCompThreeDim/Fortran/CMakeLists.txt b/MultiPhysics/CoupledDiffusionDiffusion/MonolithicAnalyticTestThreeCompThreeDim/Fortran/CMakeLists.txt new file mode 100644 index 00000000..f89e43b1 --- /dev/null +++ b/MultiPhysics/CoupledDiffusionDiffusion/MonolithicAnalyticTestThreeCompThreeDim/Fortran/CMakeLists.txt @@ -0,0 +1,60 @@ + +# Add example executable +add_executable(MonolithicAnalyticTestThreeCompThreeDim src/MonolithicAnalyticTestThreeCompThreeDimExample.f90) + +# Turn on Fortran preprocessing (#include directives) +if (MSVC) + set(PROC_OPT "/fpp") +else() + set(PROC_OPT "-cpp") +endif() + +# in debug mode, add flag that make Floating point exceptions fatal +set(OPT "") +if (FALSE) + if(CMAKE_BUILD_TYPE MATCHES DEBUG) + set(OPT "-ffpe-trap=invalid,zero,underflow,overflow,denormal") # GCC: make floating point exceptions fatal + endif() +endif() + +target_compile_options(MonolithicAnalyticTestThreeCompThreeDim PRIVATE ${PROC_OPT} ${OPT} "-fbacktrace") + +# Link to opencmiss +# ----------------- +# +# This simply uses the opencmiss target created by OC_INIT() above. +# +# Alternatively, you can also directly invoke 'find_package(Iron )' 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 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(MonolithicAnalyticTestThreeCompThreeDim PRIVATE opencmiss) + +# Add a simple test that runs the executable +add_test(NAME test_MonolithicAnalyticTestThreeCompThreeDim COMMAND MonolithicAnalyticTestThreeCompThreeDim) +add_opencmiss_environment(test_MonolithicAnalyticTestThreeCompThreeDim) + +################### +# 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. +# diff --git a/MultiPhysics/CoupledDiffusionDiffusion/MonolithicAnalyticTestThreeCompThreeDim/src/MonolithicAnalyticTestThreeCompThreeDimExample.f90 b/MultiPhysics/CoupledDiffusionDiffusion/MonolithicAnalyticTestThreeCompThreeDim/Fortran/src/MonolithicAnalyticTestThreeCompThreeDimExample.f90 similarity index 100% rename from MultiPhysics/CoupledDiffusionDiffusion/MonolithicAnalyticTestThreeCompThreeDim/src/MonolithicAnalyticTestThreeCompThreeDimExample.f90 rename to MultiPhysics/CoupledDiffusionDiffusion/MonolithicAnalyticTestThreeCompThreeDim/Fortran/src/MonolithicAnalyticTestThreeCompThreeDimExample.f90 diff --git a/MultiPhysics/CoupledDiffusionDiffusion/MonolithicAnalyticTestThreeCompThreeDim/OpenCMISS.cmake b/MultiPhysics/CoupledDiffusionDiffusion/MonolithicAnalyticTestThreeCompThreeDim/OpenCMISS.cmake new file mode 100644 index 00000000..3d6cf515 --- /dev/null +++ b/MultiPhysics/CoupledDiffusionDiffusion/MonolithicAnalyticTestThreeCompThreeDim/OpenCMISS.cmake @@ -0,0 +1,95 @@ +########################### +# *DO NOT CHANGE THIS FILE* +########################### +# +# Prepares the use of OpenCMISS by scanning at various path locations for OpenCMISS (SDK) installations. +# +# Search order: +# - OPENCMISS_INSTALL_DIR variable +# - OPENCMISS_INSTALL_DIR environment variable +# - OPENCMISS_SDK_DIR variable +# - OPENCMISS_SDK_DIR environment variable +# - [Windows only] The Registry is searched additionally for installed SDKs. +# +# If found +# - Includes the toolchain config script of the found opencmiss installation to enable toolchain selection logic (non-windows) + +# Convenience: The OPENCMISS_INSTALL_DIR may also be defined in the environment and various other places +if (DEFINED OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using specified installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The specified OPENCMISS_INSTALL_DIR '${OPENCMISS_INSTALL_DIR}' does not exist. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_INSTALL_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_INSTALL_DIR}" OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using environment installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The environment variable OPENCMISS_INSTALL_DIR='${OPENCMISS_INSTALL_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if (NOT OPENCMISS_INSTALL_DIR AND DEFINED OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The specified OPENCMISS_SDK_DIR '${OPENCMISS_SDK_DIR}' does not exist. Skipping.") + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_SDK_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_SDK_DIR}" OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using environment SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The environment variable OPENCMISS_SDK_DIR='${OPENCMISS_SDK_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_SDK_DIR) + endif() +endif() +# On windows: check the registry for installed OpenCMISS SDKs +if(NOT OPENCMISS_INSTALL_DIR AND WIN32) + foreach(ROOT HKEY_CURRENT_USER HKEY_LOCAL_MACHINE) + foreach(PACKAGE OpenCMISSUserSDK OpenCMISSDeveloperSDK) + set(_REG_KEY "[${ROOT}\\Software\\Auckland Bioengineering Institute\\${PACKAGE}]") + get_filename_component(OPENCMISS_INSTALL_DIR "${_REG_KEY}" ABSOLUTE) + #message(STATUS "Trying registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Found ${PACKAGE} in Windows registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + break() + else() + unset(OPENCMISS_INSTALL_DIR) + endif() + endforeach() + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + break() + endif() + endforeach() +endif() + +if(OPENCMISS_INSTALL_DIR) + message(STATUS "OPENCMISS_INSTALL_DIR=${OPENCMISS_INSTALL_DIR}") + # Use the OpenCMISS scripts to also allow choosing a separate toolchain + # This file is located at the opencmiss installation rather than the local example + # as it avoids file replication and makes maintenance much easier + if (TOOLCHAIN) + set(_OCTC ${OPENCMISS_INSTALL_DIR}/cmake/OCToolchainCompilers.cmake) + if (EXISTS "${_OCTC}") + include(${_OCTC}) + else() + message(WARNING "TOOLCHAIN specified but OpenCMISS config script could not be found at ${_OCTC}. Trying CMake defaults.") + endif() + unset(_OCTC) + endif() + set(OpenCMISS_DIR "${OPENCMISS_INSTALL_DIR}" CACHE PATH "Path to the found OpenCMISS (SDK) installation") +else() + message(WARNING "No OpenCMISS (SDK) installation directory detected. Using default system environment.") +endif() + \ No newline at end of file diff --git a/MultiPhysics/CoupledDiffusionDiffusion/MonolithicAnalyticTestThreeCompThreeDim/build_debug/build.sh b/MultiPhysics/CoupledDiffusionDiffusion/MonolithicAnalyticTestThreeCompThreeDim/build_debug/build.sh new file mode 100644 index 00000000..e6624bac --- /dev/null +++ b/MultiPhysics/CoupledDiffusionDiffusion/MonolithicAnalyticTestThreeCompThreeDim/build_debug/build.sh @@ -0,0 +1,2 @@ +#ccc && cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all +cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all diff --git a/MultiPhysics/CoupledDiffusionDiffusion/MonolithicSchemeTest/CMakeLists.txt b/MultiPhysics/CoupledDiffusionDiffusion/MonolithicSchemeTest/CMakeLists.txt new file mode 100644 index 00000000..a22b61ee --- /dev/null +++ b/MultiPhysics/CoupledDiffusionDiffusion/MonolithicSchemeTest/CMakeLists.txt @@ -0,0 +1,35 @@ +# 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 C) +enable_language(Fortran OPTIONAL) +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 +# ---------------------- +#add_subdirectory(C) +if (CMAKE_Fortran_COMPILER) + add_subdirectory(Fortran) +endif() diff --git a/MultiPhysics/CoupledDiffusionDiffusion/MonolithicSchemeTest/Fortran/CMakeLists.txt b/MultiPhysics/CoupledDiffusionDiffusion/MonolithicSchemeTest/Fortran/CMakeLists.txt new file mode 100644 index 00000000..44a2cb71 --- /dev/null +++ b/MultiPhysics/CoupledDiffusionDiffusion/MonolithicSchemeTest/Fortran/CMakeLists.txt @@ -0,0 +1,60 @@ + +# Add example executable +add_executable(MonolithicSchemeTest src/MonolithicSchemeTestExample.f90) + +# Turn on Fortran preprocessing (#include directives) +if (MSVC) + set(PROC_OPT "/fpp") +else() + set(PROC_OPT "-cpp") +endif() + +# in debug mode, add flag that make Floating point exceptions fatal +set(OPT "") +if (FALSE) + if(CMAKE_BUILD_TYPE MATCHES DEBUG) + set(OPT "-ffpe-trap=invalid,zero,underflow,overflow,denormal") # GCC: make floating point exceptions fatal + endif() +endif() + +target_compile_options(MonolithicSchemeTest PRIVATE ${PROC_OPT} ${OPT} "-fbacktrace") + +# Link to opencmiss +# ----------------- +# +# This simply uses the opencmiss target created by OC_INIT() above. +# +# Alternatively, you can also directly invoke 'find_package(Iron )' 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 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(MonolithicSchemeTest PRIVATE opencmiss) + +# Add a simple test that runs the executable +add_test(NAME test_MonolithicSchemeTest COMMAND MonolithicSchemeTest) +add_opencmiss_environment(test_MonolithicSchemeTest) + +################### +# 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. +# diff --git a/MultiPhysics/CoupledDiffusionDiffusion/MonolithicSchemeTest/src/MonolithicSchemeTestExample.f90 b/MultiPhysics/CoupledDiffusionDiffusion/MonolithicSchemeTest/Fortran/src/MonolithicSchemeTestExample.f90 similarity index 100% rename from MultiPhysics/CoupledDiffusionDiffusion/MonolithicSchemeTest/src/MonolithicSchemeTestExample.f90 rename to MultiPhysics/CoupledDiffusionDiffusion/MonolithicSchemeTest/Fortran/src/MonolithicSchemeTestExample.f90 diff --git a/MultiPhysics/CoupledDiffusionDiffusion/MonolithicSchemeTest/OpenCMISS.cmake b/MultiPhysics/CoupledDiffusionDiffusion/MonolithicSchemeTest/OpenCMISS.cmake new file mode 100644 index 00000000..3d6cf515 --- /dev/null +++ b/MultiPhysics/CoupledDiffusionDiffusion/MonolithicSchemeTest/OpenCMISS.cmake @@ -0,0 +1,95 @@ +########################### +# *DO NOT CHANGE THIS FILE* +########################### +# +# Prepares the use of OpenCMISS by scanning at various path locations for OpenCMISS (SDK) installations. +# +# Search order: +# - OPENCMISS_INSTALL_DIR variable +# - OPENCMISS_INSTALL_DIR environment variable +# - OPENCMISS_SDK_DIR variable +# - OPENCMISS_SDK_DIR environment variable +# - [Windows only] The Registry is searched additionally for installed SDKs. +# +# If found +# - Includes the toolchain config script of the found opencmiss installation to enable toolchain selection logic (non-windows) + +# Convenience: The OPENCMISS_INSTALL_DIR may also be defined in the environment and various other places +if (DEFINED OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using specified installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The specified OPENCMISS_INSTALL_DIR '${OPENCMISS_INSTALL_DIR}' does not exist. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_INSTALL_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_INSTALL_DIR}" OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using environment installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The environment variable OPENCMISS_INSTALL_DIR='${OPENCMISS_INSTALL_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if (NOT OPENCMISS_INSTALL_DIR AND DEFINED OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The specified OPENCMISS_SDK_DIR '${OPENCMISS_SDK_DIR}' does not exist. Skipping.") + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_SDK_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_SDK_DIR}" OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using environment SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The environment variable OPENCMISS_SDK_DIR='${OPENCMISS_SDK_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_SDK_DIR) + endif() +endif() +# On windows: check the registry for installed OpenCMISS SDKs +if(NOT OPENCMISS_INSTALL_DIR AND WIN32) + foreach(ROOT HKEY_CURRENT_USER HKEY_LOCAL_MACHINE) + foreach(PACKAGE OpenCMISSUserSDK OpenCMISSDeveloperSDK) + set(_REG_KEY "[${ROOT}\\Software\\Auckland Bioengineering Institute\\${PACKAGE}]") + get_filename_component(OPENCMISS_INSTALL_DIR "${_REG_KEY}" ABSOLUTE) + #message(STATUS "Trying registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Found ${PACKAGE} in Windows registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + break() + else() + unset(OPENCMISS_INSTALL_DIR) + endif() + endforeach() + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + break() + endif() + endforeach() +endif() + +if(OPENCMISS_INSTALL_DIR) + message(STATUS "OPENCMISS_INSTALL_DIR=${OPENCMISS_INSTALL_DIR}") + # Use the OpenCMISS scripts to also allow choosing a separate toolchain + # This file is located at the opencmiss installation rather than the local example + # as it avoids file replication and makes maintenance much easier + if (TOOLCHAIN) + set(_OCTC ${OPENCMISS_INSTALL_DIR}/cmake/OCToolchainCompilers.cmake) + if (EXISTS "${_OCTC}") + include(${_OCTC}) + else() + message(WARNING "TOOLCHAIN specified but OpenCMISS config script could not be found at ${_OCTC}. Trying CMake defaults.") + endif() + unset(_OCTC) + endif() + set(OpenCMISS_DIR "${OPENCMISS_INSTALL_DIR}" CACHE PATH "Path to the found OpenCMISS (SDK) installation") +else() + message(WARNING "No OpenCMISS (SDK) installation directory detected. Using default system environment.") +endif() + \ No newline at end of file diff --git a/MultiPhysics/CoupledDiffusionDiffusion/MonolithicSchemeTest/build_debug/build.sh b/MultiPhysics/CoupledDiffusionDiffusion/MonolithicSchemeTest/build_debug/build.sh new file mode 100644 index 00000000..e6624bac --- /dev/null +++ b/MultiPhysics/CoupledDiffusionDiffusion/MonolithicSchemeTest/build_debug/build.sh @@ -0,0 +1,2 @@ +#ccc && cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all +cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all diff --git a/MultiPhysics/CoupledDiffusionDiffusion/MonolithicSchemeTestAnalytic/CMakeLists.txt b/MultiPhysics/CoupledDiffusionDiffusion/MonolithicSchemeTestAnalytic/CMakeLists.txt new file mode 100644 index 00000000..a22b61ee --- /dev/null +++ b/MultiPhysics/CoupledDiffusionDiffusion/MonolithicSchemeTestAnalytic/CMakeLists.txt @@ -0,0 +1,35 @@ +# 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 C) +enable_language(Fortran OPTIONAL) +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 +# ---------------------- +#add_subdirectory(C) +if (CMAKE_Fortran_COMPILER) + add_subdirectory(Fortran) +endif() diff --git a/MultiPhysics/CoupledDiffusionDiffusion/MonolithicSchemeTestAnalytic/Fortran/CMakeLists.txt b/MultiPhysics/CoupledDiffusionDiffusion/MonolithicSchemeTestAnalytic/Fortran/CMakeLists.txt new file mode 100644 index 00000000..f492b50d --- /dev/null +++ b/MultiPhysics/CoupledDiffusionDiffusion/MonolithicSchemeTestAnalytic/Fortran/CMakeLists.txt @@ -0,0 +1,60 @@ + +# Add example executable +add_executable(MonolithicSchemeTestAnalytic src/MonolithicSchemeTestAnalyticExample.f90) + +# Turn on Fortran preprocessing (#include directives) +if (MSVC) + set(PROC_OPT "/fpp") +else() + set(PROC_OPT "-cpp") +endif() + +# in debug mode, add flag that make Floating point exceptions fatal +set(OPT "") +if (FALSE) + if(CMAKE_BUILD_TYPE MATCHES DEBUG) + set(OPT "-ffpe-trap=invalid,zero,underflow,overflow,denormal") # GCC: make floating point exceptions fatal + endif() +endif() + +target_compile_options(MonolithicSchemeTestAnalytic PRIVATE ${PROC_OPT} ${OPT} "-fbacktrace") + +# Link to opencmiss +# ----------------- +# +# This simply uses the opencmiss target created by OC_INIT() above. +# +# Alternatively, you can also directly invoke 'find_package(Iron )' 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 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(MonolithicSchemeTestAnalytic PRIVATE opencmiss) + +# Add a simple test that runs the executable +add_test(NAME test_MonolithicSchemeTestAnalytic COMMAND MonolithicSchemeTestAnalytic) +add_opencmiss_environment(test_MonolithicSchemeTestAnalytic) + +################### +# 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. +# diff --git a/MultiPhysics/CoupledDiffusionDiffusion/MonolithicSchemeTestAnalytic/src/MonolithicSchemeTestAnalyticExample.f90 b/MultiPhysics/CoupledDiffusionDiffusion/MonolithicSchemeTestAnalytic/Fortran/src/MonolithicSchemeTestAnalyticExample.f90 similarity index 100% rename from MultiPhysics/CoupledDiffusionDiffusion/MonolithicSchemeTestAnalytic/src/MonolithicSchemeTestAnalyticExample.f90 rename to MultiPhysics/CoupledDiffusionDiffusion/MonolithicSchemeTestAnalytic/Fortran/src/MonolithicSchemeTestAnalyticExample.f90 diff --git a/MultiPhysics/CoupledDiffusionDiffusion/MonolithicSchemeTestAnalytic/OpenCMISS.cmake b/MultiPhysics/CoupledDiffusionDiffusion/MonolithicSchemeTestAnalytic/OpenCMISS.cmake new file mode 100644 index 00000000..3d6cf515 --- /dev/null +++ b/MultiPhysics/CoupledDiffusionDiffusion/MonolithicSchemeTestAnalytic/OpenCMISS.cmake @@ -0,0 +1,95 @@ +########################### +# *DO NOT CHANGE THIS FILE* +########################### +# +# Prepares the use of OpenCMISS by scanning at various path locations for OpenCMISS (SDK) installations. +# +# Search order: +# - OPENCMISS_INSTALL_DIR variable +# - OPENCMISS_INSTALL_DIR environment variable +# - OPENCMISS_SDK_DIR variable +# - OPENCMISS_SDK_DIR environment variable +# - [Windows only] The Registry is searched additionally for installed SDKs. +# +# If found +# - Includes the toolchain config script of the found opencmiss installation to enable toolchain selection logic (non-windows) + +# Convenience: The OPENCMISS_INSTALL_DIR may also be defined in the environment and various other places +if (DEFINED OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using specified installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The specified OPENCMISS_INSTALL_DIR '${OPENCMISS_INSTALL_DIR}' does not exist. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_INSTALL_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_INSTALL_DIR}" OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using environment installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The environment variable OPENCMISS_INSTALL_DIR='${OPENCMISS_INSTALL_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if (NOT OPENCMISS_INSTALL_DIR AND DEFINED OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The specified OPENCMISS_SDK_DIR '${OPENCMISS_SDK_DIR}' does not exist. Skipping.") + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_SDK_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_SDK_DIR}" OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using environment SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The environment variable OPENCMISS_SDK_DIR='${OPENCMISS_SDK_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_SDK_DIR) + endif() +endif() +# On windows: check the registry for installed OpenCMISS SDKs +if(NOT OPENCMISS_INSTALL_DIR AND WIN32) + foreach(ROOT HKEY_CURRENT_USER HKEY_LOCAL_MACHINE) + foreach(PACKAGE OpenCMISSUserSDK OpenCMISSDeveloperSDK) + set(_REG_KEY "[${ROOT}\\Software\\Auckland Bioengineering Institute\\${PACKAGE}]") + get_filename_component(OPENCMISS_INSTALL_DIR "${_REG_KEY}" ABSOLUTE) + #message(STATUS "Trying registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Found ${PACKAGE} in Windows registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + break() + else() + unset(OPENCMISS_INSTALL_DIR) + endif() + endforeach() + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + break() + endif() + endforeach() +endif() + +if(OPENCMISS_INSTALL_DIR) + message(STATUS "OPENCMISS_INSTALL_DIR=${OPENCMISS_INSTALL_DIR}") + # Use the OpenCMISS scripts to also allow choosing a separate toolchain + # This file is located at the opencmiss installation rather than the local example + # as it avoids file replication and makes maintenance much easier + if (TOOLCHAIN) + set(_OCTC ${OPENCMISS_INSTALL_DIR}/cmake/OCToolchainCompilers.cmake) + if (EXISTS "${_OCTC}") + include(${_OCTC}) + else() + message(WARNING "TOOLCHAIN specified but OpenCMISS config script could not be found at ${_OCTC}. Trying CMake defaults.") + endif() + unset(_OCTC) + endif() + set(OpenCMISS_DIR "${OPENCMISS_INSTALL_DIR}" CACHE PATH "Path to the found OpenCMISS (SDK) installation") +else() + message(WARNING "No OpenCMISS (SDK) installation directory detected. Using default system environment.") +endif() + \ No newline at end of file diff --git a/MultiPhysics/CoupledDiffusionDiffusion/MonolithicSchemeTestAnalytic/build_debug/build.sh b/MultiPhysics/CoupledDiffusionDiffusion/MonolithicSchemeTestAnalytic/build_debug/build.sh new file mode 100644 index 00000000..e6624bac --- /dev/null +++ b/MultiPhysics/CoupledDiffusionDiffusion/MonolithicSchemeTestAnalytic/build_debug/build.sh @@ -0,0 +1,2 @@ +#ccc && cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all +cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all diff --git a/MultiPhysics/CoupledDiffusionDiffusion/MonolithicSchemeTest_FieldML/CMakeLists.txt b/MultiPhysics/CoupledDiffusionDiffusion/MonolithicSchemeTest_FieldML/CMakeLists.txt new file mode 100644 index 00000000..a22b61ee --- /dev/null +++ b/MultiPhysics/CoupledDiffusionDiffusion/MonolithicSchemeTest_FieldML/CMakeLists.txt @@ -0,0 +1,35 @@ +# 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 C) +enable_language(Fortran OPTIONAL) +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 +# ---------------------- +#add_subdirectory(C) +if (CMAKE_Fortran_COMPILER) + add_subdirectory(Fortran) +endif() diff --git a/MultiPhysics/CoupledDiffusionDiffusion/MonolithicSchemeTest_FieldML/Fortran/CMakeLists.txt b/MultiPhysics/CoupledDiffusionDiffusion/MonolithicSchemeTest_FieldML/Fortran/CMakeLists.txt new file mode 100644 index 00000000..0bc41fdf --- /dev/null +++ b/MultiPhysics/CoupledDiffusionDiffusion/MonolithicSchemeTest_FieldML/Fortran/CMakeLists.txt @@ -0,0 +1,60 @@ + +# Add example executable +add_executable(MonolithicSchemeTest_FieldML src/MonolithicSchemeTest_FieldMLExample.f90) + +# Turn on Fortran preprocessing (#include directives) +if (MSVC) + set(PROC_OPT "/fpp") +else() + set(PROC_OPT "-cpp") +endif() + +# in debug mode, add flag that make Floating point exceptions fatal +set(OPT "") +if (FALSE) + if(CMAKE_BUILD_TYPE MATCHES DEBUG) + set(OPT "-ffpe-trap=invalid,zero,underflow,overflow,denormal") # GCC: make floating point exceptions fatal + endif() +endif() + +target_compile_options(MonolithicSchemeTest_FieldML PRIVATE ${PROC_OPT} ${OPT} "-fbacktrace") + +# Link to opencmiss +# ----------------- +# +# This simply uses the opencmiss target created by OC_INIT() above. +# +# Alternatively, you can also directly invoke 'find_package(Iron )' 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 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(MonolithicSchemeTest_FieldML PRIVATE opencmiss) + +# Add a simple test that runs the executable +add_test(NAME test_MonolithicSchemeTest_FieldML COMMAND MonolithicSchemeTest_FieldML) +add_opencmiss_environment(test_MonolithicSchemeTest_FieldML) + +################### +# 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. +# diff --git a/MultiPhysics/CoupledDiffusionDiffusion/MonolithicSchemeTest_FieldML/src/MonolithicSchemeTest_FieldMLExample.f90 b/MultiPhysics/CoupledDiffusionDiffusion/MonolithicSchemeTest_FieldML/Fortran/src/MonolithicSchemeTest_FieldMLExample.f90 similarity index 100% rename from MultiPhysics/CoupledDiffusionDiffusion/MonolithicSchemeTest_FieldML/src/MonolithicSchemeTest_FieldMLExample.f90 rename to MultiPhysics/CoupledDiffusionDiffusion/MonolithicSchemeTest_FieldML/Fortran/src/MonolithicSchemeTest_FieldMLExample.f90 diff --git a/MultiPhysics/CoupledDiffusionDiffusion/MonolithicSchemeTest_FieldML/OpenCMISS.cmake b/MultiPhysics/CoupledDiffusionDiffusion/MonolithicSchemeTest_FieldML/OpenCMISS.cmake new file mode 100644 index 00000000..3d6cf515 --- /dev/null +++ b/MultiPhysics/CoupledDiffusionDiffusion/MonolithicSchemeTest_FieldML/OpenCMISS.cmake @@ -0,0 +1,95 @@ +########################### +# *DO NOT CHANGE THIS FILE* +########################### +# +# Prepares the use of OpenCMISS by scanning at various path locations for OpenCMISS (SDK) installations. +# +# Search order: +# - OPENCMISS_INSTALL_DIR variable +# - OPENCMISS_INSTALL_DIR environment variable +# - OPENCMISS_SDK_DIR variable +# - OPENCMISS_SDK_DIR environment variable +# - [Windows only] The Registry is searched additionally for installed SDKs. +# +# If found +# - Includes the toolchain config script of the found opencmiss installation to enable toolchain selection logic (non-windows) + +# Convenience: The OPENCMISS_INSTALL_DIR may also be defined in the environment and various other places +if (DEFINED OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using specified installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The specified OPENCMISS_INSTALL_DIR '${OPENCMISS_INSTALL_DIR}' does not exist. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_INSTALL_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_INSTALL_DIR}" OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using environment installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The environment variable OPENCMISS_INSTALL_DIR='${OPENCMISS_INSTALL_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if (NOT OPENCMISS_INSTALL_DIR AND DEFINED OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The specified OPENCMISS_SDK_DIR '${OPENCMISS_SDK_DIR}' does not exist. Skipping.") + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_SDK_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_SDK_DIR}" OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using environment SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The environment variable OPENCMISS_SDK_DIR='${OPENCMISS_SDK_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_SDK_DIR) + endif() +endif() +# On windows: check the registry for installed OpenCMISS SDKs +if(NOT OPENCMISS_INSTALL_DIR AND WIN32) + foreach(ROOT HKEY_CURRENT_USER HKEY_LOCAL_MACHINE) + foreach(PACKAGE OpenCMISSUserSDK OpenCMISSDeveloperSDK) + set(_REG_KEY "[${ROOT}\\Software\\Auckland Bioengineering Institute\\${PACKAGE}]") + get_filename_component(OPENCMISS_INSTALL_DIR "${_REG_KEY}" ABSOLUTE) + #message(STATUS "Trying registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Found ${PACKAGE} in Windows registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + break() + else() + unset(OPENCMISS_INSTALL_DIR) + endif() + endforeach() + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + break() + endif() + endforeach() +endif() + +if(OPENCMISS_INSTALL_DIR) + message(STATUS "OPENCMISS_INSTALL_DIR=${OPENCMISS_INSTALL_DIR}") + # Use the OpenCMISS scripts to also allow choosing a separate toolchain + # This file is located at the opencmiss installation rather than the local example + # as it avoids file replication and makes maintenance much easier + if (TOOLCHAIN) + set(_OCTC ${OPENCMISS_INSTALL_DIR}/cmake/OCToolchainCompilers.cmake) + if (EXISTS "${_OCTC}") + include(${_OCTC}) + else() + message(WARNING "TOOLCHAIN specified but OpenCMISS config script could not be found at ${_OCTC}. Trying CMake defaults.") + endif() + unset(_OCTC) + endif() + set(OpenCMISS_DIR "${OPENCMISS_INSTALL_DIR}" CACHE PATH "Path to the found OpenCMISS (SDK) installation") +else() + message(WARNING "No OpenCMISS (SDK) installation directory detected. Using default system environment.") +endif() + \ No newline at end of file diff --git a/MultiPhysics/CoupledDiffusionDiffusion/MonolithicSchemeTest_FieldML/build_debug/build.sh b/MultiPhysics/CoupledDiffusionDiffusion/MonolithicSchemeTest_FieldML/build_debug/build.sh new file mode 100644 index 00000000..e6624bac --- /dev/null +++ b/MultiPhysics/CoupledDiffusionDiffusion/MonolithicSchemeTest_FieldML/build_debug/build.sh @@ -0,0 +1,2 @@ +#ccc && cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all +cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all diff --git a/MultiPhysics/MultiCompTransport/MultiCompAdvectionDiffusion/MonolithicSchemeAdvectionDiffusion_FieldML/CMakeLists.txt b/MultiPhysics/MultiCompTransport/MultiCompAdvectionDiffusion/MonolithicSchemeAdvectionDiffusion_FieldML/CMakeLists.txt new file mode 100644 index 00000000..a22b61ee --- /dev/null +++ b/MultiPhysics/MultiCompTransport/MultiCompAdvectionDiffusion/MonolithicSchemeAdvectionDiffusion_FieldML/CMakeLists.txt @@ -0,0 +1,35 @@ +# 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 C) +enable_language(Fortran OPTIONAL) +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 +# ---------------------- +#add_subdirectory(C) +if (CMAKE_Fortran_COMPILER) + add_subdirectory(Fortran) +endif() diff --git a/MultiPhysics/MultiCompTransport/MultiCompAdvectionDiffusion/MonolithicSchemeAdvectionDiffusion_FieldML/Fortran/CMakeLists.txt b/MultiPhysics/MultiCompTransport/MultiCompAdvectionDiffusion/MonolithicSchemeAdvectionDiffusion_FieldML/Fortran/CMakeLists.txt new file mode 100644 index 00000000..c50ad3bd --- /dev/null +++ b/MultiPhysics/MultiCompTransport/MultiCompAdvectionDiffusion/MonolithicSchemeAdvectionDiffusion_FieldML/Fortran/CMakeLists.txt @@ -0,0 +1,60 @@ + +# Add example executable +add_executable(MonolithicSchemeAdvectionDiffusion_FieldML src/MonolithicSchemeAdvectionDiffusion_FieldMLExample.f90) + +# Turn on Fortran preprocessing (#include directives) +if (MSVC) + set(PROC_OPT "/fpp") +else() + set(PROC_OPT "-cpp") +endif() + +# in debug mode, add flag that make Floating point exceptions fatal +set(OPT "") +if (FALSE) + if(CMAKE_BUILD_TYPE MATCHES DEBUG) + set(OPT "-ffpe-trap=invalid,zero,underflow,overflow,denormal") # GCC: make floating point exceptions fatal + endif() +endif() + +target_compile_options(MonolithicSchemeAdvectionDiffusion_FieldML PRIVATE ${PROC_OPT} ${OPT} "-fbacktrace") + +# Link to opencmiss +# ----------------- +# +# This simply uses the opencmiss target created by OC_INIT() above. +# +# Alternatively, you can also directly invoke 'find_package(Iron )' 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 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(MonolithicSchemeAdvectionDiffusion_FieldML PRIVATE opencmiss) + +# Add a simple test that runs the executable +add_test(NAME test_MonolithicSchemeAdvectionDiffusion_FieldML COMMAND MonolithicSchemeAdvectionDiffusion_FieldML) +add_opencmiss_environment(test_MonolithicSchemeAdvectionDiffusion_FieldML) + +################### +# 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. +# diff --git a/MultiPhysics/MultiCompTransport/MultiCompAdvectionDiffusion/MonolithicSchemeAdvectionDiffusion_FieldML/src/MonolithicSchemeAdvectionDiffusion_FieldMLExample.f90 b/MultiPhysics/MultiCompTransport/MultiCompAdvectionDiffusion/MonolithicSchemeAdvectionDiffusion_FieldML/Fortran/src/MonolithicSchemeAdvectionDiffusion_FieldMLExample.f90 similarity index 100% rename from MultiPhysics/MultiCompTransport/MultiCompAdvectionDiffusion/MonolithicSchemeAdvectionDiffusion_FieldML/src/MonolithicSchemeAdvectionDiffusion_FieldMLExample.f90 rename to MultiPhysics/MultiCompTransport/MultiCompAdvectionDiffusion/MonolithicSchemeAdvectionDiffusion_FieldML/Fortran/src/MonolithicSchemeAdvectionDiffusion_FieldMLExample.f90 diff --git a/MultiPhysics/MultiCompTransport/MultiCompAdvectionDiffusion/MonolithicSchemeAdvectionDiffusion_FieldML/OpenCMISS.cmake b/MultiPhysics/MultiCompTransport/MultiCompAdvectionDiffusion/MonolithicSchemeAdvectionDiffusion_FieldML/OpenCMISS.cmake new file mode 100644 index 00000000..3d6cf515 --- /dev/null +++ b/MultiPhysics/MultiCompTransport/MultiCompAdvectionDiffusion/MonolithicSchemeAdvectionDiffusion_FieldML/OpenCMISS.cmake @@ -0,0 +1,95 @@ +########################### +# *DO NOT CHANGE THIS FILE* +########################### +# +# Prepares the use of OpenCMISS by scanning at various path locations for OpenCMISS (SDK) installations. +# +# Search order: +# - OPENCMISS_INSTALL_DIR variable +# - OPENCMISS_INSTALL_DIR environment variable +# - OPENCMISS_SDK_DIR variable +# - OPENCMISS_SDK_DIR environment variable +# - [Windows only] The Registry is searched additionally for installed SDKs. +# +# If found +# - Includes the toolchain config script of the found opencmiss installation to enable toolchain selection logic (non-windows) + +# Convenience: The OPENCMISS_INSTALL_DIR may also be defined in the environment and various other places +if (DEFINED OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using specified installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The specified OPENCMISS_INSTALL_DIR '${OPENCMISS_INSTALL_DIR}' does not exist. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_INSTALL_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_INSTALL_DIR}" OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using environment installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The environment variable OPENCMISS_INSTALL_DIR='${OPENCMISS_INSTALL_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if (NOT OPENCMISS_INSTALL_DIR AND DEFINED OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The specified OPENCMISS_SDK_DIR '${OPENCMISS_SDK_DIR}' does not exist. Skipping.") + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_SDK_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_SDK_DIR}" OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using environment SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The environment variable OPENCMISS_SDK_DIR='${OPENCMISS_SDK_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_SDK_DIR) + endif() +endif() +# On windows: check the registry for installed OpenCMISS SDKs +if(NOT OPENCMISS_INSTALL_DIR AND WIN32) + foreach(ROOT HKEY_CURRENT_USER HKEY_LOCAL_MACHINE) + foreach(PACKAGE OpenCMISSUserSDK OpenCMISSDeveloperSDK) + set(_REG_KEY "[${ROOT}\\Software\\Auckland Bioengineering Institute\\${PACKAGE}]") + get_filename_component(OPENCMISS_INSTALL_DIR "${_REG_KEY}" ABSOLUTE) + #message(STATUS "Trying registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Found ${PACKAGE} in Windows registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + break() + else() + unset(OPENCMISS_INSTALL_DIR) + endif() + endforeach() + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + break() + endif() + endforeach() +endif() + +if(OPENCMISS_INSTALL_DIR) + message(STATUS "OPENCMISS_INSTALL_DIR=${OPENCMISS_INSTALL_DIR}") + # Use the OpenCMISS scripts to also allow choosing a separate toolchain + # This file is located at the opencmiss installation rather than the local example + # as it avoids file replication and makes maintenance much easier + if (TOOLCHAIN) + set(_OCTC ${OPENCMISS_INSTALL_DIR}/cmake/OCToolchainCompilers.cmake) + if (EXISTS "${_OCTC}") + include(${_OCTC}) + else() + message(WARNING "TOOLCHAIN specified but OpenCMISS config script could not be found at ${_OCTC}. Trying CMake defaults.") + endif() + unset(_OCTC) + endif() + set(OpenCMISS_DIR "${OPENCMISS_INSTALL_DIR}" CACHE PATH "Path to the found OpenCMISS (SDK) installation") +else() + message(WARNING "No OpenCMISS (SDK) installation directory detected. Using default system environment.") +endif() + \ No newline at end of file diff --git a/MultiPhysics/MultiCompTransport/MultiCompAdvectionDiffusion/MonolithicSchemeAdvectionDiffusion_FieldML/build_debug/build.sh b/MultiPhysics/MultiCompTransport/MultiCompAdvectionDiffusion/MonolithicSchemeAdvectionDiffusion_FieldML/build_debug/build.sh new file mode 100644 index 00000000..e6624bac --- /dev/null +++ b/MultiPhysics/MultiCompTransport/MultiCompAdvectionDiffusion/MonolithicSchemeAdvectionDiffusion_FieldML/build_debug/build.sh @@ -0,0 +1,2 @@ +#ccc && cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all +cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all diff --git a/MultiPhysics/Poroelasticity/FiniteElasticityDarcy/CylinderInflationDrivenDarcy/CMakeLists.txt b/MultiPhysics/Poroelasticity/FiniteElasticityDarcy/CylinderInflationDrivenDarcy/CMakeLists.txt new file mode 100644 index 00000000..a22b61ee --- /dev/null +++ b/MultiPhysics/Poroelasticity/FiniteElasticityDarcy/CylinderInflationDrivenDarcy/CMakeLists.txt @@ -0,0 +1,35 @@ +# 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 C) +enable_language(Fortran OPTIONAL) +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 +# ---------------------- +#add_subdirectory(C) +if (CMAKE_Fortran_COMPILER) + add_subdirectory(Fortran) +endif() diff --git a/MultiPhysics/Poroelasticity/FiniteElasticityDarcy/CylinderInflationDrivenDarcy/Fortran/CMakeLists.txt b/MultiPhysics/Poroelasticity/FiniteElasticityDarcy/CylinderInflationDrivenDarcy/Fortran/CMakeLists.txt new file mode 100644 index 00000000..75c0e4f3 --- /dev/null +++ b/MultiPhysics/Poroelasticity/FiniteElasticityDarcy/CylinderInflationDrivenDarcy/Fortran/CMakeLists.txt @@ -0,0 +1,60 @@ + +# Add example executable +add_executable(CylinderInflationDrivenDarcy src/CylinderInflationDrivenDarcyExample.f90) + +# Turn on Fortran preprocessing (#include directives) +if (MSVC) + set(PROC_OPT "/fpp") +else() + set(PROC_OPT "-cpp") +endif() + +# in debug mode, add flag that make Floating point exceptions fatal +set(OPT "") +if (FALSE) + if(CMAKE_BUILD_TYPE MATCHES DEBUG) + set(OPT "-ffpe-trap=invalid,zero,underflow,overflow,denormal") # GCC: make floating point exceptions fatal + endif() +endif() + +target_compile_options(CylinderInflationDrivenDarcy PRIVATE ${PROC_OPT} ${OPT} "-fbacktrace") + +# Link to opencmiss +# ----------------- +# +# This simply uses the opencmiss target created by OC_INIT() above. +# +# Alternatively, you can also directly invoke 'find_package(Iron )' 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 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(CylinderInflationDrivenDarcy PRIVATE opencmiss) + +# Add a simple test that runs the executable +add_test(NAME test_CylinderInflationDrivenDarcy COMMAND CylinderInflationDrivenDarcy) +add_opencmiss_environment(test_CylinderInflationDrivenDarcy) + +################### +# 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. +# diff --git a/MultiPhysics/Poroelasticity/FiniteElasticityDarcy/CylinderInflationDrivenDarcy/src/CylinderInflationDrivenDarcyExample.f90 b/MultiPhysics/Poroelasticity/FiniteElasticityDarcy/CylinderInflationDrivenDarcy/Fortran/src/CylinderInflationDrivenDarcyExample.f90 similarity index 100% rename from MultiPhysics/Poroelasticity/FiniteElasticityDarcy/CylinderInflationDrivenDarcy/src/CylinderInflationDrivenDarcyExample.f90 rename to MultiPhysics/Poroelasticity/FiniteElasticityDarcy/CylinderInflationDrivenDarcy/Fortran/src/CylinderInflationDrivenDarcyExample.f90 diff --git a/MultiPhysics/Poroelasticity/FiniteElasticityDarcy/CylinderInflationDrivenDarcy/OpenCMISS.cmake b/MultiPhysics/Poroelasticity/FiniteElasticityDarcy/CylinderInflationDrivenDarcy/OpenCMISS.cmake new file mode 100644 index 00000000..3d6cf515 --- /dev/null +++ b/MultiPhysics/Poroelasticity/FiniteElasticityDarcy/CylinderInflationDrivenDarcy/OpenCMISS.cmake @@ -0,0 +1,95 @@ +########################### +# *DO NOT CHANGE THIS FILE* +########################### +# +# Prepares the use of OpenCMISS by scanning at various path locations for OpenCMISS (SDK) installations. +# +# Search order: +# - OPENCMISS_INSTALL_DIR variable +# - OPENCMISS_INSTALL_DIR environment variable +# - OPENCMISS_SDK_DIR variable +# - OPENCMISS_SDK_DIR environment variable +# - [Windows only] The Registry is searched additionally for installed SDKs. +# +# If found +# - Includes the toolchain config script of the found opencmiss installation to enable toolchain selection logic (non-windows) + +# Convenience: The OPENCMISS_INSTALL_DIR may also be defined in the environment and various other places +if (DEFINED OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using specified installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The specified OPENCMISS_INSTALL_DIR '${OPENCMISS_INSTALL_DIR}' does not exist. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_INSTALL_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_INSTALL_DIR}" OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using environment installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The environment variable OPENCMISS_INSTALL_DIR='${OPENCMISS_INSTALL_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if (NOT OPENCMISS_INSTALL_DIR AND DEFINED OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The specified OPENCMISS_SDK_DIR '${OPENCMISS_SDK_DIR}' does not exist. Skipping.") + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_SDK_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_SDK_DIR}" OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using environment SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The environment variable OPENCMISS_SDK_DIR='${OPENCMISS_SDK_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_SDK_DIR) + endif() +endif() +# On windows: check the registry for installed OpenCMISS SDKs +if(NOT OPENCMISS_INSTALL_DIR AND WIN32) + foreach(ROOT HKEY_CURRENT_USER HKEY_LOCAL_MACHINE) + foreach(PACKAGE OpenCMISSUserSDK OpenCMISSDeveloperSDK) + set(_REG_KEY "[${ROOT}\\Software\\Auckland Bioengineering Institute\\${PACKAGE}]") + get_filename_component(OPENCMISS_INSTALL_DIR "${_REG_KEY}" ABSOLUTE) + #message(STATUS "Trying registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Found ${PACKAGE} in Windows registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + break() + else() + unset(OPENCMISS_INSTALL_DIR) + endif() + endforeach() + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + break() + endif() + endforeach() +endif() + +if(OPENCMISS_INSTALL_DIR) + message(STATUS "OPENCMISS_INSTALL_DIR=${OPENCMISS_INSTALL_DIR}") + # Use the OpenCMISS scripts to also allow choosing a separate toolchain + # This file is located at the opencmiss installation rather than the local example + # as it avoids file replication and makes maintenance much easier + if (TOOLCHAIN) + set(_OCTC ${OPENCMISS_INSTALL_DIR}/cmake/OCToolchainCompilers.cmake) + if (EXISTS "${_OCTC}") + include(${_OCTC}) + else() + message(WARNING "TOOLCHAIN specified but OpenCMISS config script could not be found at ${_OCTC}. Trying CMake defaults.") + endif() + unset(_OCTC) + endif() + set(OpenCMISS_DIR "${OPENCMISS_INSTALL_DIR}" CACHE PATH "Path to the found OpenCMISS (SDK) installation") +else() + message(WARNING "No OpenCMISS (SDK) installation directory detected. Using default system environment.") +endif() + \ No newline at end of file diff --git a/MultiPhysics/Poroelasticity/FiniteElasticityDarcy/CylinderInflationDrivenDarcy/build_debug/build.sh b/MultiPhysics/Poroelasticity/FiniteElasticityDarcy/CylinderInflationDrivenDarcy/build_debug/build.sh new file mode 100644 index 00000000..e6624bac --- /dev/null +++ b/MultiPhysics/Poroelasticity/FiniteElasticityDarcy/CylinderInflationDrivenDarcy/build_debug/build.sh @@ -0,0 +1,2 @@ +#ccc && cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all +cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all diff --git a/MultiPhysics/Poroelasticity/FiniteElasticityDarcy/CylinderInflationDrivenMultiCompDarcy/CMakeLists.txt b/MultiPhysics/Poroelasticity/FiniteElasticityDarcy/CylinderInflationDrivenMultiCompDarcy/CMakeLists.txt new file mode 100644 index 00000000..a22b61ee --- /dev/null +++ b/MultiPhysics/Poroelasticity/FiniteElasticityDarcy/CylinderInflationDrivenMultiCompDarcy/CMakeLists.txt @@ -0,0 +1,35 @@ +# 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 C) +enable_language(Fortran OPTIONAL) +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 +# ---------------------- +#add_subdirectory(C) +if (CMAKE_Fortran_COMPILER) + add_subdirectory(Fortran) +endif() diff --git a/MultiPhysics/Poroelasticity/FiniteElasticityDarcy/CylinderInflationDrivenMultiCompDarcy/Fortran/CMakeLists.txt b/MultiPhysics/Poroelasticity/FiniteElasticityDarcy/CylinderInflationDrivenMultiCompDarcy/Fortran/CMakeLists.txt new file mode 100644 index 00000000..90dd8b72 --- /dev/null +++ b/MultiPhysics/Poroelasticity/FiniteElasticityDarcy/CylinderInflationDrivenMultiCompDarcy/Fortran/CMakeLists.txt @@ -0,0 +1,60 @@ + +# Add example executable +add_executable(CylinderInflationDrivenMultiCompDarcy src/CylinderInflationDrivenMultiCompDarcyExample.f90) + +# Turn on Fortran preprocessing (#include directives) +if (MSVC) + set(PROC_OPT "/fpp") +else() + set(PROC_OPT "-cpp") +endif() + +# in debug mode, add flag that make Floating point exceptions fatal +set(OPT "") +if (FALSE) + if(CMAKE_BUILD_TYPE MATCHES DEBUG) + set(OPT "-ffpe-trap=invalid,zero,underflow,overflow,denormal") # GCC: make floating point exceptions fatal + endif() +endif() + +target_compile_options(CylinderInflationDrivenMultiCompDarcy PRIVATE ${PROC_OPT} ${OPT} "-fbacktrace") + +# Link to opencmiss +# ----------------- +# +# This simply uses the opencmiss target created by OC_INIT() above. +# +# Alternatively, you can also directly invoke 'find_package(Iron )' 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 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(CylinderInflationDrivenMultiCompDarcy PRIVATE opencmiss) + +# Add a simple test that runs the executable +add_test(NAME test_CylinderInflationDrivenMultiCompDarcy COMMAND CylinderInflationDrivenMultiCompDarcy) +add_opencmiss_environment(test_CylinderInflationDrivenMultiCompDarcy) + +################### +# 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. +# diff --git a/MultiPhysics/Poroelasticity/FiniteElasticityDarcy/CylinderInflationDrivenMultiCompDarcy/src/CylinderInflationDrivenMultiCompDarcyExample.f90 b/MultiPhysics/Poroelasticity/FiniteElasticityDarcy/CylinderInflationDrivenMultiCompDarcy/Fortran/src/CylinderInflationDrivenMultiCompDarcyExample.f90 similarity index 100% rename from MultiPhysics/Poroelasticity/FiniteElasticityDarcy/CylinderInflationDrivenMultiCompDarcy/src/CylinderInflationDrivenMultiCompDarcyExample.f90 rename to MultiPhysics/Poroelasticity/FiniteElasticityDarcy/CylinderInflationDrivenMultiCompDarcy/Fortran/src/CylinderInflationDrivenMultiCompDarcyExample.f90 diff --git a/MultiPhysics/Poroelasticity/FiniteElasticityDarcy/CylinderInflationDrivenMultiCompDarcy/OpenCMISS.cmake b/MultiPhysics/Poroelasticity/FiniteElasticityDarcy/CylinderInflationDrivenMultiCompDarcy/OpenCMISS.cmake new file mode 100644 index 00000000..3d6cf515 --- /dev/null +++ b/MultiPhysics/Poroelasticity/FiniteElasticityDarcy/CylinderInflationDrivenMultiCompDarcy/OpenCMISS.cmake @@ -0,0 +1,95 @@ +########################### +# *DO NOT CHANGE THIS FILE* +########################### +# +# Prepares the use of OpenCMISS by scanning at various path locations for OpenCMISS (SDK) installations. +# +# Search order: +# - OPENCMISS_INSTALL_DIR variable +# - OPENCMISS_INSTALL_DIR environment variable +# - OPENCMISS_SDK_DIR variable +# - OPENCMISS_SDK_DIR environment variable +# - [Windows only] The Registry is searched additionally for installed SDKs. +# +# If found +# - Includes the toolchain config script of the found opencmiss installation to enable toolchain selection logic (non-windows) + +# Convenience: The OPENCMISS_INSTALL_DIR may also be defined in the environment and various other places +if (DEFINED OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using specified installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The specified OPENCMISS_INSTALL_DIR '${OPENCMISS_INSTALL_DIR}' does not exist. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_INSTALL_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_INSTALL_DIR}" OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using environment installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The environment variable OPENCMISS_INSTALL_DIR='${OPENCMISS_INSTALL_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if (NOT OPENCMISS_INSTALL_DIR AND DEFINED OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The specified OPENCMISS_SDK_DIR '${OPENCMISS_SDK_DIR}' does not exist. Skipping.") + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_SDK_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_SDK_DIR}" OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using environment SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The environment variable OPENCMISS_SDK_DIR='${OPENCMISS_SDK_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_SDK_DIR) + endif() +endif() +# On windows: check the registry for installed OpenCMISS SDKs +if(NOT OPENCMISS_INSTALL_DIR AND WIN32) + foreach(ROOT HKEY_CURRENT_USER HKEY_LOCAL_MACHINE) + foreach(PACKAGE OpenCMISSUserSDK OpenCMISSDeveloperSDK) + set(_REG_KEY "[${ROOT}\\Software\\Auckland Bioengineering Institute\\${PACKAGE}]") + get_filename_component(OPENCMISS_INSTALL_DIR "${_REG_KEY}" ABSOLUTE) + #message(STATUS "Trying registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Found ${PACKAGE} in Windows registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + break() + else() + unset(OPENCMISS_INSTALL_DIR) + endif() + endforeach() + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + break() + endif() + endforeach() +endif() + +if(OPENCMISS_INSTALL_DIR) + message(STATUS "OPENCMISS_INSTALL_DIR=${OPENCMISS_INSTALL_DIR}") + # Use the OpenCMISS scripts to also allow choosing a separate toolchain + # This file is located at the opencmiss installation rather than the local example + # as it avoids file replication and makes maintenance much easier + if (TOOLCHAIN) + set(_OCTC ${OPENCMISS_INSTALL_DIR}/cmake/OCToolchainCompilers.cmake) + if (EXISTS "${_OCTC}") + include(${_OCTC}) + else() + message(WARNING "TOOLCHAIN specified but OpenCMISS config script could not be found at ${_OCTC}. Trying CMake defaults.") + endif() + unset(_OCTC) + endif() + set(OpenCMISS_DIR "${OPENCMISS_INSTALL_DIR}" CACHE PATH "Path to the found OpenCMISS (SDK) installation") +else() + message(WARNING "No OpenCMISS (SDK) installation directory detected. Using default system environment.") +endif() + \ No newline at end of file diff --git a/MultiPhysics/Poroelasticity/FiniteElasticityDarcy/CylinderInflationDrivenMultiCompDarcy/build_debug/build.sh b/MultiPhysics/Poroelasticity/FiniteElasticityDarcy/CylinderInflationDrivenMultiCompDarcy/build_debug/build.sh new file mode 100644 index 00000000..e6624bac --- /dev/null +++ b/MultiPhysics/Poroelasticity/FiniteElasticityDarcy/CylinderInflationDrivenMultiCompDarcy/build_debug/build.sh @@ -0,0 +1,2 @@ +#ccc && cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all +cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all diff --git a/MultiPhysics/Poroelasticity/FiniteElasticityDarcy/IncompElastDrivenDarcy_AnalyticDarcy/CMakeLists.txt b/MultiPhysics/Poroelasticity/FiniteElasticityDarcy/IncompElastDrivenDarcy_AnalyticDarcy/CMakeLists.txt new file mode 100644 index 00000000..a22b61ee --- /dev/null +++ b/MultiPhysics/Poroelasticity/FiniteElasticityDarcy/IncompElastDrivenDarcy_AnalyticDarcy/CMakeLists.txt @@ -0,0 +1,35 @@ +# 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 C) +enable_language(Fortran OPTIONAL) +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 +# ---------------------- +#add_subdirectory(C) +if (CMAKE_Fortran_COMPILER) + add_subdirectory(Fortran) +endif() diff --git a/MultiPhysics/Poroelasticity/FiniteElasticityDarcy/IncompElastDrivenDarcy_AnalyticDarcy/Fortran/CMakeLists.txt b/MultiPhysics/Poroelasticity/FiniteElasticityDarcy/IncompElastDrivenDarcy_AnalyticDarcy/Fortran/CMakeLists.txt new file mode 100644 index 00000000..a6a12071 --- /dev/null +++ b/MultiPhysics/Poroelasticity/FiniteElasticityDarcy/IncompElastDrivenDarcy_AnalyticDarcy/Fortran/CMakeLists.txt @@ -0,0 +1,60 @@ + +# Add example executable +add_executable(IncompElastDrivenDarcy_AnalyticDarcy src/IncompElastDrivenDarcy_AnalyticDarcyExample.f90) + +# Turn on Fortran preprocessing (#include directives) +if (MSVC) + set(PROC_OPT "/fpp") +else() + set(PROC_OPT "-cpp") +endif() + +# in debug mode, add flag that make Floating point exceptions fatal +set(OPT "") +if (FALSE) + if(CMAKE_BUILD_TYPE MATCHES DEBUG) + set(OPT "-ffpe-trap=invalid,zero,underflow,overflow,denormal") # GCC: make floating point exceptions fatal + endif() +endif() + +target_compile_options(IncompElastDrivenDarcy_AnalyticDarcy PRIVATE ${PROC_OPT} ${OPT} "-fbacktrace") + +# Link to opencmiss +# ----------------- +# +# This simply uses the opencmiss target created by OC_INIT() above. +# +# Alternatively, you can also directly invoke 'find_package(Iron )' 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 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(IncompElastDrivenDarcy_AnalyticDarcy PRIVATE opencmiss) + +# Add a simple test that runs the executable +add_test(NAME test_IncompElastDrivenDarcy_AnalyticDarcy COMMAND IncompElastDrivenDarcy_AnalyticDarcy) +add_opencmiss_environment(test_IncompElastDrivenDarcy_AnalyticDarcy) + +################### +# 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. +# diff --git a/MultiPhysics/Poroelasticity/FiniteElasticityDarcy/IncompElastDrivenDarcy_AnalyticDarcy/src/IncompElastDrivenDarcy_AnalyticDarcyExample.f90 b/MultiPhysics/Poroelasticity/FiniteElasticityDarcy/IncompElastDrivenDarcy_AnalyticDarcy/Fortran/src/IncompElastDrivenDarcy_AnalyticDarcyExample.f90 similarity index 100% rename from MultiPhysics/Poroelasticity/FiniteElasticityDarcy/IncompElastDrivenDarcy_AnalyticDarcy/src/IncompElastDrivenDarcy_AnalyticDarcyExample.f90 rename to MultiPhysics/Poroelasticity/FiniteElasticityDarcy/IncompElastDrivenDarcy_AnalyticDarcy/Fortran/src/IncompElastDrivenDarcy_AnalyticDarcyExample.f90 diff --git a/MultiPhysics/Poroelasticity/FiniteElasticityDarcy/IncompElastDrivenDarcy_AnalyticDarcy/OpenCMISS.cmake b/MultiPhysics/Poroelasticity/FiniteElasticityDarcy/IncompElastDrivenDarcy_AnalyticDarcy/OpenCMISS.cmake new file mode 100644 index 00000000..3d6cf515 --- /dev/null +++ b/MultiPhysics/Poroelasticity/FiniteElasticityDarcy/IncompElastDrivenDarcy_AnalyticDarcy/OpenCMISS.cmake @@ -0,0 +1,95 @@ +########################### +# *DO NOT CHANGE THIS FILE* +########################### +# +# Prepares the use of OpenCMISS by scanning at various path locations for OpenCMISS (SDK) installations. +# +# Search order: +# - OPENCMISS_INSTALL_DIR variable +# - OPENCMISS_INSTALL_DIR environment variable +# - OPENCMISS_SDK_DIR variable +# - OPENCMISS_SDK_DIR environment variable +# - [Windows only] The Registry is searched additionally for installed SDKs. +# +# If found +# - Includes the toolchain config script of the found opencmiss installation to enable toolchain selection logic (non-windows) + +# Convenience: The OPENCMISS_INSTALL_DIR may also be defined in the environment and various other places +if (DEFINED OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using specified installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The specified OPENCMISS_INSTALL_DIR '${OPENCMISS_INSTALL_DIR}' does not exist. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_INSTALL_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_INSTALL_DIR}" OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using environment installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The environment variable OPENCMISS_INSTALL_DIR='${OPENCMISS_INSTALL_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if (NOT OPENCMISS_INSTALL_DIR AND DEFINED OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The specified OPENCMISS_SDK_DIR '${OPENCMISS_SDK_DIR}' does not exist. Skipping.") + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_SDK_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_SDK_DIR}" OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using environment SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The environment variable OPENCMISS_SDK_DIR='${OPENCMISS_SDK_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_SDK_DIR) + endif() +endif() +# On windows: check the registry for installed OpenCMISS SDKs +if(NOT OPENCMISS_INSTALL_DIR AND WIN32) + foreach(ROOT HKEY_CURRENT_USER HKEY_LOCAL_MACHINE) + foreach(PACKAGE OpenCMISSUserSDK OpenCMISSDeveloperSDK) + set(_REG_KEY "[${ROOT}\\Software\\Auckland Bioengineering Institute\\${PACKAGE}]") + get_filename_component(OPENCMISS_INSTALL_DIR "${_REG_KEY}" ABSOLUTE) + #message(STATUS "Trying registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Found ${PACKAGE} in Windows registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + break() + else() + unset(OPENCMISS_INSTALL_DIR) + endif() + endforeach() + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + break() + endif() + endforeach() +endif() + +if(OPENCMISS_INSTALL_DIR) + message(STATUS "OPENCMISS_INSTALL_DIR=${OPENCMISS_INSTALL_DIR}") + # Use the OpenCMISS scripts to also allow choosing a separate toolchain + # This file is located at the opencmiss installation rather than the local example + # as it avoids file replication and makes maintenance much easier + if (TOOLCHAIN) + set(_OCTC ${OPENCMISS_INSTALL_DIR}/cmake/OCToolchainCompilers.cmake) + if (EXISTS "${_OCTC}") + include(${_OCTC}) + else() + message(WARNING "TOOLCHAIN specified but OpenCMISS config script could not be found at ${_OCTC}. Trying CMake defaults.") + endif() + unset(_OCTC) + endif() + set(OpenCMISS_DIR "${OPENCMISS_INSTALL_DIR}" CACHE PATH "Path to the found OpenCMISS (SDK) installation") +else() + message(WARNING "No OpenCMISS (SDK) installation directory detected. Using default system environment.") +endif() + \ No newline at end of file diff --git a/MultiPhysics/Poroelasticity/FiniteElasticityDarcy/IncompElastDrivenDarcy_AnalyticDarcy/build_debug/build.sh b/MultiPhysics/Poroelasticity/FiniteElasticityDarcy/IncompElastDrivenDarcy_AnalyticDarcy/build_debug/build.sh new file mode 100644 index 00000000..e6624bac --- /dev/null +++ b/MultiPhysics/Poroelasticity/FiniteElasticityDarcy/IncompElastDrivenDarcy_AnalyticDarcy/build_debug/build.sh @@ -0,0 +1,2 @@ +#ccc && cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all +cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all diff --git a/MultiPhysics/Poroelasticity/FiniteElasticityDarcy/IncompressibleElasticityDrivenDarcy/CMakeLists.txt b/MultiPhysics/Poroelasticity/FiniteElasticityDarcy/IncompressibleElasticityDrivenDarcy/CMakeLists.txt new file mode 100644 index 00000000..a22b61ee --- /dev/null +++ b/MultiPhysics/Poroelasticity/FiniteElasticityDarcy/IncompressibleElasticityDrivenDarcy/CMakeLists.txt @@ -0,0 +1,35 @@ +# 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 C) +enable_language(Fortran OPTIONAL) +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 +# ---------------------- +#add_subdirectory(C) +if (CMAKE_Fortran_COMPILER) + add_subdirectory(Fortran) +endif() diff --git a/MultiPhysics/Poroelasticity/FiniteElasticityDarcy/IncompressibleElasticityDrivenDarcy/Fortran/CMakeLists.txt b/MultiPhysics/Poroelasticity/FiniteElasticityDarcy/IncompressibleElasticityDrivenDarcy/Fortran/CMakeLists.txt new file mode 100644 index 00000000..10f5c7ae --- /dev/null +++ b/MultiPhysics/Poroelasticity/FiniteElasticityDarcy/IncompressibleElasticityDrivenDarcy/Fortran/CMakeLists.txt @@ -0,0 +1,60 @@ + +# Add example executable +add_executable(IncompressibleElasticityDrivenDarcy src/IncompressibleElasticityDrivenDarcyExample.f90) + +# Turn on Fortran preprocessing (#include directives) +if (MSVC) + set(PROC_OPT "/fpp") +else() + set(PROC_OPT "-cpp") +endif() + +# in debug mode, add flag that make Floating point exceptions fatal +set(OPT "") +if (FALSE) + if(CMAKE_BUILD_TYPE MATCHES DEBUG) + set(OPT "-ffpe-trap=invalid,zero,underflow,overflow,denormal") # GCC: make floating point exceptions fatal + endif() +endif() + +target_compile_options(IncompressibleElasticityDrivenDarcy PRIVATE ${PROC_OPT} ${OPT} "-fbacktrace") + +# Link to opencmiss +# ----------------- +# +# This simply uses the opencmiss target created by OC_INIT() above. +# +# Alternatively, you can also directly invoke 'find_package(Iron )' 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 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(IncompressibleElasticityDrivenDarcy PRIVATE opencmiss) + +# Add a simple test that runs the executable +add_test(NAME test_IncompressibleElasticityDrivenDarcy COMMAND IncompressibleElasticityDrivenDarcy) +add_opencmiss_environment(test_IncompressibleElasticityDrivenDarcy) + +################### +# 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. +# diff --git a/MultiPhysics/Poroelasticity/FiniteElasticityDarcy/IncompressibleElasticityDrivenDarcy/src/IncompressibleElasticityDrivenDarcyExample.f90 b/MultiPhysics/Poroelasticity/FiniteElasticityDarcy/IncompressibleElasticityDrivenDarcy/Fortran/src/IncompressibleElasticityDrivenDarcyExample.f90 similarity index 100% rename from MultiPhysics/Poroelasticity/FiniteElasticityDarcy/IncompressibleElasticityDrivenDarcy/src/IncompressibleElasticityDrivenDarcyExample.f90 rename to MultiPhysics/Poroelasticity/FiniteElasticityDarcy/IncompressibleElasticityDrivenDarcy/Fortran/src/IncompressibleElasticityDrivenDarcyExample.f90 diff --git a/MultiPhysics/Poroelasticity/FiniteElasticityDarcy/IncompressibleElasticityDrivenDarcy/OpenCMISS.cmake b/MultiPhysics/Poroelasticity/FiniteElasticityDarcy/IncompressibleElasticityDrivenDarcy/OpenCMISS.cmake new file mode 100644 index 00000000..3d6cf515 --- /dev/null +++ b/MultiPhysics/Poroelasticity/FiniteElasticityDarcy/IncompressibleElasticityDrivenDarcy/OpenCMISS.cmake @@ -0,0 +1,95 @@ +########################### +# *DO NOT CHANGE THIS FILE* +########################### +# +# Prepares the use of OpenCMISS by scanning at various path locations for OpenCMISS (SDK) installations. +# +# Search order: +# - OPENCMISS_INSTALL_DIR variable +# - OPENCMISS_INSTALL_DIR environment variable +# - OPENCMISS_SDK_DIR variable +# - OPENCMISS_SDK_DIR environment variable +# - [Windows only] The Registry is searched additionally for installed SDKs. +# +# If found +# - Includes the toolchain config script of the found opencmiss installation to enable toolchain selection logic (non-windows) + +# Convenience: The OPENCMISS_INSTALL_DIR may also be defined in the environment and various other places +if (DEFINED OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using specified installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The specified OPENCMISS_INSTALL_DIR '${OPENCMISS_INSTALL_DIR}' does not exist. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_INSTALL_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_INSTALL_DIR}" OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using environment installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The environment variable OPENCMISS_INSTALL_DIR='${OPENCMISS_INSTALL_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if (NOT OPENCMISS_INSTALL_DIR AND DEFINED OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The specified OPENCMISS_SDK_DIR '${OPENCMISS_SDK_DIR}' does not exist. Skipping.") + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_SDK_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_SDK_DIR}" OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using environment SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The environment variable OPENCMISS_SDK_DIR='${OPENCMISS_SDK_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_SDK_DIR) + endif() +endif() +# On windows: check the registry for installed OpenCMISS SDKs +if(NOT OPENCMISS_INSTALL_DIR AND WIN32) + foreach(ROOT HKEY_CURRENT_USER HKEY_LOCAL_MACHINE) + foreach(PACKAGE OpenCMISSUserSDK OpenCMISSDeveloperSDK) + set(_REG_KEY "[${ROOT}\\Software\\Auckland Bioengineering Institute\\${PACKAGE}]") + get_filename_component(OPENCMISS_INSTALL_DIR "${_REG_KEY}" ABSOLUTE) + #message(STATUS "Trying registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Found ${PACKAGE} in Windows registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + break() + else() + unset(OPENCMISS_INSTALL_DIR) + endif() + endforeach() + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + break() + endif() + endforeach() +endif() + +if(OPENCMISS_INSTALL_DIR) + message(STATUS "OPENCMISS_INSTALL_DIR=${OPENCMISS_INSTALL_DIR}") + # Use the OpenCMISS scripts to also allow choosing a separate toolchain + # This file is located at the opencmiss installation rather than the local example + # as it avoids file replication and makes maintenance much easier + if (TOOLCHAIN) + set(_OCTC ${OPENCMISS_INSTALL_DIR}/cmake/OCToolchainCompilers.cmake) + if (EXISTS "${_OCTC}") + include(${_OCTC}) + else() + message(WARNING "TOOLCHAIN specified but OpenCMISS config script could not be found at ${_OCTC}. Trying CMake defaults.") + endif() + unset(_OCTC) + endif() + set(OpenCMISS_DIR "${OPENCMISS_INSTALL_DIR}" CACHE PATH "Path to the found OpenCMISS (SDK) installation") +else() + message(WARNING "No OpenCMISS (SDK) installation directory detected. Using default system environment.") +endif() + \ No newline at end of file diff --git a/MultiPhysics/Poroelasticity/FiniteElasticityDarcy/IncompressibleElasticityDrivenDarcy/build_debug/build.sh b/MultiPhysics/Poroelasticity/FiniteElasticityDarcy/IncompressibleElasticityDrivenDarcy/build_debug/build.sh new file mode 100644 index 00000000..e6624bac --- /dev/null +++ b/MultiPhysics/Poroelasticity/FiniteElasticityDarcy/IncompressibleElasticityDrivenDarcy/build_debug/build.sh @@ -0,0 +1,2 @@ +#ccc && cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all +cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all diff --git a/MultiPhysics/Poroelasticity/FiniteElasticityDarcy/IncompressibleElasticityDrivenDarcyIO/CMakeLists.txt b/MultiPhysics/Poroelasticity/FiniteElasticityDarcy/IncompressibleElasticityDrivenDarcyIO/CMakeLists.txt new file mode 100644 index 00000000..a22b61ee --- /dev/null +++ b/MultiPhysics/Poroelasticity/FiniteElasticityDarcy/IncompressibleElasticityDrivenDarcyIO/CMakeLists.txt @@ -0,0 +1,35 @@ +# 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 C) +enable_language(Fortran OPTIONAL) +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 +# ---------------------- +#add_subdirectory(C) +if (CMAKE_Fortran_COMPILER) + add_subdirectory(Fortran) +endif() diff --git a/MultiPhysics/Poroelasticity/FiniteElasticityDarcy/IncompressibleElasticityDrivenDarcyIO/Fortran/CMakeLists.txt b/MultiPhysics/Poroelasticity/FiniteElasticityDarcy/IncompressibleElasticityDrivenDarcyIO/Fortran/CMakeLists.txt new file mode 100644 index 00000000..56c7961a --- /dev/null +++ b/MultiPhysics/Poroelasticity/FiniteElasticityDarcy/IncompressibleElasticityDrivenDarcyIO/Fortran/CMakeLists.txt @@ -0,0 +1,60 @@ + +# Add example executable +add_executable(IncompressibleElasticityDrivenDarcyIO src/IncompressibleElasticityDrivenDarcyIOExample.f90) + +# Turn on Fortran preprocessing (#include directives) +if (MSVC) + set(PROC_OPT "/fpp") +else() + set(PROC_OPT "-cpp") +endif() + +# in debug mode, add flag that make Floating point exceptions fatal +set(OPT "") +if (FALSE) + if(CMAKE_BUILD_TYPE MATCHES DEBUG) + set(OPT "-ffpe-trap=invalid,zero,underflow,overflow,denormal") # GCC: make floating point exceptions fatal + endif() +endif() + +target_compile_options(IncompressibleElasticityDrivenDarcyIO PRIVATE ${PROC_OPT} ${OPT} "-fbacktrace") + +# Link to opencmiss +# ----------------- +# +# This simply uses the opencmiss target created by OC_INIT() above. +# +# Alternatively, you can also directly invoke 'find_package(Iron )' 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 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(IncompressibleElasticityDrivenDarcyIO PRIVATE opencmiss) + +# Add a simple test that runs the executable +add_test(NAME test_IncompressibleElasticityDrivenDarcyIO COMMAND IncompressibleElasticityDrivenDarcyIO) +add_opencmiss_environment(test_IncompressibleElasticityDrivenDarcyIO) + +################### +# 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. +# diff --git a/MultiPhysics/Poroelasticity/FiniteElasticityDarcy/IncompressibleElasticityDrivenDarcyIO/src/IncompressibleElasticityDrivenDarcyIOExample.f90 b/MultiPhysics/Poroelasticity/FiniteElasticityDarcy/IncompressibleElasticityDrivenDarcyIO/Fortran/src/IncompressibleElasticityDrivenDarcyIOExample.f90 similarity index 100% rename from MultiPhysics/Poroelasticity/FiniteElasticityDarcy/IncompressibleElasticityDrivenDarcyIO/src/IncompressibleElasticityDrivenDarcyIOExample.f90 rename to MultiPhysics/Poroelasticity/FiniteElasticityDarcy/IncompressibleElasticityDrivenDarcyIO/Fortran/src/IncompressibleElasticityDrivenDarcyIOExample.f90 diff --git a/MultiPhysics/Poroelasticity/FiniteElasticityDarcy/IncompressibleElasticityDrivenDarcyIO/OpenCMISS.cmake b/MultiPhysics/Poroelasticity/FiniteElasticityDarcy/IncompressibleElasticityDrivenDarcyIO/OpenCMISS.cmake new file mode 100644 index 00000000..3d6cf515 --- /dev/null +++ b/MultiPhysics/Poroelasticity/FiniteElasticityDarcy/IncompressibleElasticityDrivenDarcyIO/OpenCMISS.cmake @@ -0,0 +1,95 @@ +########################### +# *DO NOT CHANGE THIS FILE* +########################### +# +# Prepares the use of OpenCMISS by scanning at various path locations for OpenCMISS (SDK) installations. +# +# Search order: +# - OPENCMISS_INSTALL_DIR variable +# - OPENCMISS_INSTALL_DIR environment variable +# - OPENCMISS_SDK_DIR variable +# - OPENCMISS_SDK_DIR environment variable +# - [Windows only] The Registry is searched additionally for installed SDKs. +# +# If found +# - Includes the toolchain config script of the found opencmiss installation to enable toolchain selection logic (non-windows) + +# Convenience: The OPENCMISS_INSTALL_DIR may also be defined in the environment and various other places +if (DEFINED OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using specified installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The specified OPENCMISS_INSTALL_DIR '${OPENCMISS_INSTALL_DIR}' does not exist. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_INSTALL_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_INSTALL_DIR}" OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using environment installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The environment variable OPENCMISS_INSTALL_DIR='${OPENCMISS_INSTALL_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if (NOT OPENCMISS_INSTALL_DIR AND DEFINED OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The specified OPENCMISS_SDK_DIR '${OPENCMISS_SDK_DIR}' does not exist. Skipping.") + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_SDK_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_SDK_DIR}" OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using environment SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The environment variable OPENCMISS_SDK_DIR='${OPENCMISS_SDK_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_SDK_DIR) + endif() +endif() +# On windows: check the registry for installed OpenCMISS SDKs +if(NOT OPENCMISS_INSTALL_DIR AND WIN32) + foreach(ROOT HKEY_CURRENT_USER HKEY_LOCAL_MACHINE) + foreach(PACKAGE OpenCMISSUserSDK OpenCMISSDeveloperSDK) + set(_REG_KEY "[${ROOT}\\Software\\Auckland Bioengineering Institute\\${PACKAGE}]") + get_filename_component(OPENCMISS_INSTALL_DIR "${_REG_KEY}" ABSOLUTE) + #message(STATUS "Trying registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Found ${PACKAGE} in Windows registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + break() + else() + unset(OPENCMISS_INSTALL_DIR) + endif() + endforeach() + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + break() + endif() + endforeach() +endif() + +if(OPENCMISS_INSTALL_DIR) + message(STATUS "OPENCMISS_INSTALL_DIR=${OPENCMISS_INSTALL_DIR}") + # Use the OpenCMISS scripts to also allow choosing a separate toolchain + # This file is located at the opencmiss installation rather than the local example + # as it avoids file replication and makes maintenance much easier + if (TOOLCHAIN) + set(_OCTC ${OPENCMISS_INSTALL_DIR}/cmake/OCToolchainCompilers.cmake) + if (EXISTS "${_OCTC}") + include(${_OCTC}) + else() + message(WARNING "TOOLCHAIN specified but OpenCMISS config script could not be found at ${_OCTC}. Trying CMake defaults.") + endif() + unset(_OCTC) + endif() + set(OpenCMISS_DIR "${OPENCMISS_INSTALL_DIR}" CACHE PATH "Path to the found OpenCMISS (SDK) installation") +else() + message(WARNING "No OpenCMISS (SDK) installation directory detected. Using default system environment.") +endif() + \ No newline at end of file diff --git a/MultiPhysics/Poroelasticity/FiniteElasticityDarcy/IncompressibleElasticityDrivenDarcyIO/build_debug/build.sh b/MultiPhysics/Poroelasticity/FiniteElasticityDarcy/IncompressibleElasticityDrivenDarcyIO/build_debug/build.sh new file mode 100644 index 00000000..e6624bac --- /dev/null +++ b/MultiPhysics/Poroelasticity/FiniteElasticityDarcy/IncompressibleElasticityDrivenDarcyIO/build_debug/build.sh @@ -0,0 +1,2 @@ +#ccc && cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all +cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all diff --git a/MultiPhysics/Poroelasticity/FiniteElasticityDarcy/IncompressibleElasticityDrivenDarcyIO2/CMakeLists.txt b/MultiPhysics/Poroelasticity/FiniteElasticityDarcy/IncompressibleElasticityDrivenDarcyIO2/CMakeLists.txt new file mode 100644 index 00000000..a22b61ee --- /dev/null +++ b/MultiPhysics/Poroelasticity/FiniteElasticityDarcy/IncompressibleElasticityDrivenDarcyIO2/CMakeLists.txt @@ -0,0 +1,35 @@ +# 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 C) +enable_language(Fortran OPTIONAL) +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 +# ---------------------- +#add_subdirectory(C) +if (CMAKE_Fortran_COMPILER) + add_subdirectory(Fortran) +endif() diff --git a/MultiPhysics/Poroelasticity/FiniteElasticityDarcy/IncompressibleElasticityDrivenDarcyIO2/Fortran/CMakeLists.txt b/MultiPhysics/Poroelasticity/FiniteElasticityDarcy/IncompressibleElasticityDrivenDarcyIO2/Fortran/CMakeLists.txt new file mode 100644 index 00000000..bd8461aa --- /dev/null +++ b/MultiPhysics/Poroelasticity/FiniteElasticityDarcy/IncompressibleElasticityDrivenDarcyIO2/Fortran/CMakeLists.txt @@ -0,0 +1,60 @@ + +# Add example executable +add_executable(IncompressibleElasticityDrivenDarcyIO2 src/IncompressibleElasticityDrivenDarcyIO2Example.f90) + +# Turn on Fortran preprocessing (#include directives) +if (MSVC) + set(PROC_OPT "/fpp") +else() + set(PROC_OPT "-cpp") +endif() + +# in debug mode, add flag that make Floating point exceptions fatal +set(OPT "") +if (FALSE) + if(CMAKE_BUILD_TYPE MATCHES DEBUG) + set(OPT "-ffpe-trap=invalid,zero,underflow,overflow,denormal") # GCC: make floating point exceptions fatal + endif() +endif() + +target_compile_options(IncompressibleElasticityDrivenDarcyIO2 PRIVATE ${PROC_OPT} ${OPT} "-fbacktrace") + +# Link to opencmiss +# ----------------- +# +# This simply uses the opencmiss target created by OC_INIT() above. +# +# Alternatively, you can also directly invoke 'find_package(Iron )' 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 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(IncompressibleElasticityDrivenDarcyIO2 PRIVATE opencmiss) + +# Add a simple test that runs the executable +add_test(NAME test_IncompressibleElasticityDrivenDarcyIO2 COMMAND IncompressibleElasticityDrivenDarcyIO2) +add_opencmiss_environment(test_IncompressibleElasticityDrivenDarcyIO2) + +################### +# 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. +# diff --git a/MultiPhysics/Poroelasticity/FiniteElasticityDarcy/IncompressibleElasticityDrivenDarcyIO2/src/IncompressibleElasticityDrivenDarcyIO2Example.f90 b/MultiPhysics/Poroelasticity/FiniteElasticityDarcy/IncompressibleElasticityDrivenDarcyIO2/Fortran/src/IncompressibleElasticityDrivenDarcyIO2Example.f90 similarity index 100% rename from MultiPhysics/Poroelasticity/FiniteElasticityDarcy/IncompressibleElasticityDrivenDarcyIO2/src/IncompressibleElasticityDrivenDarcyIO2Example.f90 rename to MultiPhysics/Poroelasticity/FiniteElasticityDarcy/IncompressibleElasticityDrivenDarcyIO2/Fortran/src/IncompressibleElasticityDrivenDarcyIO2Example.f90 diff --git a/MultiPhysics/Poroelasticity/FiniteElasticityDarcy/IncompressibleElasticityDrivenDarcyIO2/OpenCMISS.cmake b/MultiPhysics/Poroelasticity/FiniteElasticityDarcy/IncompressibleElasticityDrivenDarcyIO2/OpenCMISS.cmake new file mode 100644 index 00000000..3d6cf515 --- /dev/null +++ b/MultiPhysics/Poroelasticity/FiniteElasticityDarcy/IncompressibleElasticityDrivenDarcyIO2/OpenCMISS.cmake @@ -0,0 +1,95 @@ +########################### +# *DO NOT CHANGE THIS FILE* +########################### +# +# Prepares the use of OpenCMISS by scanning at various path locations for OpenCMISS (SDK) installations. +# +# Search order: +# - OPENCMISS_INSTALL_DIR variable +# - OPENCMISS_INSTALL_DIR environment variable +# - OPENCMISS_SDK_DIR variable +# - OPENCMISS_SDK_DIR environment variable +# - [Windows only] The Registry is searched additionally for installed SDKs. +# +# If found +# - Includes the toolchain config script of the found opencmiss installation to enable toolchain selection logic (non-windows) + +# Convenience: The OPENCMISS_INSTALL_DIR may also be defined in the environment and various other places +if (DEFINED OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using specified installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The specified OPENCMISS_INSTALL_DIR '${OPENCMISS_INSTALL_DIR}' does not exist. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_INSTALL_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_INSTALL_DIR}" OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using environment installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The environment variable OPENCMISS_INSTALL_DIR='${OPENCMISS_INSTALL_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if (NOT OPENCMISS_INSTALL_DIR AND DEFINED OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The specified OPENCMISS_SDK_DIR '${OPENCMISS_SDK_DIR}' does not exist. Skipping.") + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_SDK_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_SDK_DIR}" OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using environment SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The environment variable OPENCMISS_SDK_DIR='${OPENCMISS_SDK_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_SDK_DIR) + endif() +endif() +# On windows: check the registry for installed OpenCMISS SDKs +if(NOT OPENCMISS_INSTALL_DIR AND WIN32) + foreach(ROOT HKEY_CURRENT_USER HKEY_LOCAL_MACHINE) + foreach(PACKAGE OpenCMISSUserSDK OpenCMISSDeveloperSDK) + set(_REG_KEY "[${ROOT}\\Software\\Auckland Bioengineering Institute\\${PACKAGE}]") + get_filename_component(OPENCMISS_INSTALL_DIR "${_REG_KEY}" ABSOLUTE) + #message(STATUS "Trying registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Found ${PACKAGE} in Windows registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + break() + else() + unset(OPENCMISS_INSTALL_DIR) + endif() + endforeach() + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + break() + endif() + endforeach() +endif() + +if(OPENCMISS_INSTALL_DIR) + message(STATUS "OPENCMISS_INSTALL_DIR=${OPENCMISS_INSTALL_DIR}") + # Use the OpenCMISS scripts to also allow choosing a separate toolchain + # This file is located at the opencmiss installation rather than the local example + # as it avoids file replication and makes maintenance much easier + if (TOOLCHAIN) + set(_OCTC ${OPENCMISS_INSTALL_DIR}/cmake/OCToolchainCompilers.cmake) + if (EXISTS "${_OCTC}") + include(${_OCTC}) + else() + message(WARNING "TOOLCHAIN specified but OpenCMISS config script could not be found at ${_OCTC}. Trying CMake defaults.") + endif() + unset(_OCTC) + endif() + set(OpenCMISS_DIR "${OPENCMISS_INSTALL_DIR}" CACHE PATH "Path to the found OpenCMISS (SDK) installation") +else() + message(WARNING "No OpenCMISS (SDK) installation directory detected. Using default system environment.") +endif() + \ No newline at end of file diff --git a/MultiPhysics/Poroelasticity/FiniteElasticityDarcy/IncompressibleElasticityDrivenDarcyIO2/build_debug/build.sh b/MultiPhysics/Poroelasticity/FiniteElasticityDarcy/IncompressibleElasticityDrivenDarcyIO2/build_debug/build.sh new file mode 100644 index 00000000..e6624bac --- /dev/null +++ b/MultiPhysics/Poroelasticity/FiniteElasticityDarcy/IncompressibleElasticityDrivenDarcyIO2/build_debug/build.sh @@ -0,0 +1,2 @@ +#ccc && cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all +cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all diff --git a/MultiPhysics/Poroelasticity/FiniteElasticityDarcy/IncompressibleElasticityDrivenDarcyIO3/CMakeLists.txt b/MultiPhysics/Poroelasticity/FiniteElasticityDarcy/IncompressibleElasticityDrivenDarcyIO3/CMakeLists.txt new file mode 100644 index 00000000..a22b61ee --- /dev/null +++ b/MultiPhysics/Poroelasticity/FiniteElasticityDarcy/IncompressibleElasticityDrivenDarcyIO3/CMakeLists.txt @@ -0,0 +1,35 @@ +# 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 C) +enable_language(Fortran OPTIONAL) +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 +# ---------------------- +#add_subdirectory(C) +if (CMAKE_Fortran_COMPILER) + add_subdirectory(Fortran) +endif() diff --git a/MultiPhysics/Poroelasticity/FiniteElasticityDarcy/IncompressibleElasticityDrivenDarcyIO3/Fortran/CMakeLists.txt b/MultiPhysics/Poroelasticity/FiniteElasticityDarcy/IncompressibleElasticityDrivenDarcyIO3/Fortran/CMakeLists.txt new file mode 100644 index 00000000..c3723240 --- /dev/null +++ b/MultiPhysics/Poroelasticity/FiniteElasticityDarcy/IncompressibleElasticityDrivenDarcyIO3/Fortran/CMakeLists.txt @@ -0,0 +1,60 @@ + +# Add example executable +add_executable(IncompressibleElasticityDrivenDarcyIO3 src/IncompressibleElasticityDrivenDarcyIO3Example.f90) + +# Turn on Fortran preprocessing (#include directives) +if (MSVC) + set(PROC_OPT "/fpp") +else() + set(PROC_OPT "-cpp") +endif() + +# in debug mode, add flag that make Floating point exceptions fatal +set(OPT "") +if (FALSE) + if(CMAKE_BUILD_TYPE MATCHES DEBUG) + set(OPT "-ffpe-trap=invalid,zero,underflow,overflow,denormal") # GCC: make floating point exceptions fatal + endif() +endif() + +target_compile_options(IncompressibleElasticityDrivenDarcyIO3 PRIVATE ${PROC_OPT} ${OPT} "-fbacktrace") + +# Link to opencmiss +# ----------------- +# +# This simply uses the opencmiss target created by OC_INIT() above. +# +# Alternatively, you can also directly invoke 'find_package(Iron )' 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 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(IncompressibleElasticityDrivenDarcyIO3 PRIVATE opencmiss) + +# Add a simple test that runs the executable +add_test(NAME test_IncompressibleElasticityDrivenDarcyIO3 COMMAND IncompressibleElasticityDrivenDarcyIO3) +add_opencmiss_environment(test_IncompressibleElasticityDrivenDarcyIO3) + +################### +# 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. +# diff --git a/MultiPhysics/Poroelasticity/FiniteElasticityDarcy/IncompressibleElasticityDrivenDarcyIO3/src/IncompressibleElasticityDrivenDarcyIO3Example.f90 b/MultiPhysics/Poroelasticity/FiniteElasticityDarcy/IncompressibleElasticityDrivenDarcyIO3/Fortran/src/IncompressibleElasticityDrivenDarcyIO3Example.f90 similarity index 100% rename from MultiPhysics/Poroelasticity/FiniteElasticityDarcy/IncompressibleElasticityDrivenDarcyIO3/src/IncompressibleElasticityDrivenDarcyIO3Example.f90 rename to MultiPhysics/Poroelasticity/FiniteElasticityDarcy/IncompressibleElasticityDrivenDarcyIO3/Fortran/src/IncompressibleElasticityDrivenDarcyIO3Example.f90 diff --git a/MultiPhysics/Poroelasticity/FiniteElasticityDarcy/IncompressibleElasticityDrivenDarcyIO3/OpenCMISS.cmake b/MultiPhysics/Poroelasticity/FiniteElasticityDarcy/IncompressibleElasticityDrivenDarcyIO3/OpenCMISS.cmake new file mode 100644 index 00000000..3d6cf515 --- /dev/null +++ b/MultiPhysics/Poroelasticity/FiniteElasticityDarcy/IncompressibleElasticityDrivenDarcyIO3/OpenCMISS.cmake @@ -0,0 +1,95 @@ +########################### +# *DO NOT CHANGE THIS FILE* +########################### +# +# Prepares the use of OpenCMISS by scanning at various path locations for OpenCMISS (SDK) installations. +# +# Search order: +# - OPENCMISS_INSTALL_DIR variable +# - OPENCMISS_INSTALL_DIR environment variable +# - OPENCMISS_SDK_DIR variable +# - OPENCMISS_SDK_DIR environment variable +# - [Windows only] The Registry is searched additionally for installed SDKs. +# +# If found +# - Includes the toolchain config script of the found opencmiss installation to enable toolchain selection logic (non-windows) + +# Convenience: The OPENCMISS_INSTALL_DIR may also be defined in the environment and various other places +if (DEFINED OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using specified installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The specified OPENCMISS_INSTALL_DIR '${OPENCMISS_INSTALL_DIR}' does not exist. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_INSTALL_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_INSTALL_DIR}" OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using environment installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The environment variable OPENCMISS_INSTALL_DIR='${OPENCMISS_INSTALL_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if (NOT OPENCMISS_INSTALL_DIR AND DEFINED OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The specified OPENCMISS_SDK_DIR '${OPENCMISS_SDK_DIR}' does not exist. Skipping.") + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_SDK_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_SDK_DIR}" OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using environment SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The environment variable OPENCMISS_SDK_DIR='${OPENCMISS_SDK_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_SDK_DIR) + endif() +endif() +# On windows: check the registry for installed OpenCMISS SDKs +if(NOT OPENCMISS_INSTALL_DIR AND WIN32) + foreach(ROOT HKEY_CURRENT_USER HKEY_LOCAL_MACHINE) + foreach(PACKAGE OpenCMISSUserSDK OpenCMISSDeveloperSDK) + set(_REG_KEY "[${ROOT}\\Software\\Auckland Bioengineering Institute\\${PACKAGE}]") + get_filename_component(OPENCMISS_INSTALL_DIR "${_REG_KEY}" ABSOLUTE) + #message(STATUS "Trying registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Found ${PACKAGE} in Windows registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + break() + else() + unset(OPENCMISS_INSTALL_DIR) + endif() + endforeach() + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + break() + endif() + endforeach() +endif() + +if(OPENCMISS_INSTALL_DIR) + message(STATUS "OPENCMISS_INSTALL_DIR=${OPENCMISS_INSTALL_DIR}") + # Use the OpenCMISS scripts to also allow choosing a separate toolchain + # This file is located at the opencmiss installation rather than the local example + # as it avoids file replication and makes maintenance much easier + if (TOOLCHAIN) + set(_OCTC ${OPENCMISS_INSTALL_DIR}/cmake/OCToolchainCompilers.cmake) + if (EXISTS "${_OCTC}") + include(${_OCTC}) + else() + message(WARNING "TOOLCHAIN specified but OpenCMISS config script could not be found at ${_OCTC}. Trying CMake defaults.") + endif() + unset(_OCTC) + endif() + set(OpenCMISS_DIR "${OPENCMISS_INSTALL_DIR}" CACHE PATH "Path to the found OpenCMISS (SDK) installation") +else() + message(WARNING "No OpenCMISS (SDK) installation directory detected. Using default system environment.") +endif() + \ No newline at end of file diff --git a/MultiPhysics/Poroelasticity/FiniteElasticityDarcy/IncompressibleElasticityDrivenDarcyIO3/build_debug/build.sh b/MultiPhysics/Poroelasticity/FiniteElasticityDarcy/IncompressibleElasticityDrivenDarcyIO3/build_debug/build.sh new file mode 100644 index 00000000..e6624bac --- /dev/null +++ b/MultiPhysics/Poroelasticity/FiniteElasticityDarcy/IncompressibleElasticityDrivenDarcyIO3/build_debug/build.sh @@ -0,0 +1,2 @@ +#ccc && cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all +cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all diff --git a/MultiPhysics/Poroelasticity/FiniteElasticityDarcy/IncompressibleElasticityDrivenDarcyMatSolve/CMakeLists.txt b/MultiPhysics/Poroelasticity/FiniteElasticityDarcy/IncompressibleElasticityDrivenDarcyMatSolve/CMakeLists.txt new file mode 100644 index 00000000..a22b61ee --- /dev/null +++ b/MultiPhysics/Poroelasticity/FiniteElasticityDarcy/IncompressibleElasticityDrivenDarcyMatSolve/CMakeLists.txt @@ -0,0 +1,35 @@ +# 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 C) +enable_language(Fortran OPTIONAL) +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 +# ---------------------- +#add_subdirectory(C) +if (CMAKE_Fortran_COMPILER) + add_subdirectory(Fortran) +endif() diff --git a/MultiPhysics/Poroelasticity/FiniteElasticityDarcy/IncompressibleElasticityDrivenDarcyMatSolve/Fortran/CMakeLists.txt b/MultiPhysics/Poroelasticity/FiniteElasticityDarcy/IncompressibleElasticityDrivenDarcyMatSolve/Fortran/CMakeLists.txt new file mode 100644 index 00000000..4735b14d --- /dev/null +++ b/MultiPhysics/Poroelasticity/FiniteElasticityDarcy/IncompressibleElasticityDrivenDarcyMatSolve/Fortran/CMakeLists.txt @@ -0,0 +1,60 @@ + +# Add example executable +add_executable(IncompressibleElasticityDrivenDarcyMatSolve src/IncompressibleElasticityDrivenDarcyMatSolveExample.f90) + +# Turn on Fortran preprocessing (#include directives) +if (MSVC) + set(PROC_OPT "/fpp") +else() + set(PROC_OPT "-cpp") +endif() + +# in debug mode, add flag that make Floating point exceptions fatal +set(OPT "") +if (FALSE) + if(CMAKE_BUILD_TYPE MATCHES DEBUG) + set(OPT "-ffpe-trap=invalid,zero,underflow,overflow,denormal") # GCC: make floating point exceptions fatal + endif() +endif() + +target_compile_options(IncompressibleElasticityDrivenDarcyMatSolve PRIVATE ${PROC_OPT} ${OPT} "-fbacktrace") + +# Link to opencmiss +# ----------------- +# +# This simply uses the opencmiss target created by OC_INIT() above. +# +# Alternatively, you can also directly invoke 'find_package(Iron )' 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 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(IncompressibleElasticityDrivenDarcyMatSolve PRIVATE opencmiss) + +# Add a simple test that runs the executable +add_test(NAME test_IncompressibleElasticityDrivenDarcyMatSolve COMMAND IncompressibleElasticityDrivenDarcyMatSolve) +add_opencmiss_environment(test_IncompressibleElasticityDrivenDarcyMatSolve) + +################### +# 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. +# diff --git a/MultiPhysics/Poroelasticity/FiniteElasticityDarcy/IncompressibleElasticityDrivenDarcyMatSolve/src/IncompressibleElasticityDrivenDarcyMatSolveExample.f90 b/MultiPhysics/Poroelasticity/FiniteElasticityDarcy/IncompressibleElasticityDrivenDarcyMatSolve/Fortran/src/IncompressibleElasticityDrivenDarcyMatSolveExample.f90 similarity index 100% rename from MultiPhysics/Poroelasticity/FiniteElasticityDarcy/IncompressibleElasticityDrivenDarcyMatSolve/src/IncompressibleElasticityDrivenDarcyMatSolveExample.f90 rename to MultiPhysics/Poroelasticity/FiniteElasticityDarcy/IncompressibleElasticityDrivenDarcyMatSolve/Fortran/src/IncompressibleElasticityDrivenDarcyMatSolveExample.f90 diff --git a/MultiPhysics/Poroelasticity/FiniteElasticityDarcy/IncompressibleElasticityDrivenDarcyMatSolve/OpenCMISS.cmake b/MultiPhysics/Poroelasticity/FiniteElasticityDarcy/IncompressibleElasticityDrivenDarcyMatSolve/OpenCMISS.cmake new file mode 100644 index 00000000..3d6cf515 --- /dev/null +++ b/MultiPhysics/Poroelasticity/FiniteElasticityDarcy/IncompressibleElasticityDrivenDarcyMatSolve/OpenCMISS.cmake @@ -0,0 +1,95 @@ +########################### +# *DO NOT CHANGE THIS FILE* +########################### +# +# Prepares the use of OpenCMISS by scanning at various path locations for OpenCMISS (SDK) installations. +# +# Search order: +# - OPENCMISS_INSTALL_DIR variable +# - OPENCMISS_INSTALL_DIR environment variable +# - OPENCMISS_SDK_DIR variable +# - OPENCMISS_SDK_DIR environment variable +# - [Windows only] The Registry is searched additionally for installed SDKs. +# +# If found +# - Includes the toolchain config script of the found opencmiss installation to enable toolchain selection logic (non-windows) + +# Convenience: The OPENCMISS_INSTALL_DIR may also be defined in the environment and various other places +if (DEFINED OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using specified installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The specified OPENCMISS_INSTALL_DIR '${OPENCMISS_INSTALL_DIR}' does not exist. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_INSTALL_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_INSTALL_DIR}" OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using environment installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The environment variable OPENCMISS_INSTALL_DIR='${OPENCMISS_INSTALL_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if (NOT OPENCMISS_INSTALL_DIR AND DEFINED OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The specified OPENCMISS_SDK_DIR '${OPENCMISS_SDK_DIR}' does not exist. Skipping.") + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_SDK_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_SDK_DIR}" OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using environment SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The environment variable OPENCMISS_SDK_DIR='${OPENCMISS_SDK_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_SDK_DIR) + endif() +endif() +# On windows: check the registry for installed OpenCMISS SDKs +if(NOT OPENCMISS_INSTALL_DIR AND WIN32) + foreach(ROOT HKEY_CURRENT_USER HKEY_LOCAL_MACHINE) + foreach(PACKAGE OpenCMISSUserSDK OpenCMISSDeveloperSDK) + set(_REG_KEY "[${ROOT}\\Software\\Auckland Bioengineering Institute\\${PACKAGE}]") + get_filename_component(OPENCMISS_INSTALL_DIR "${_REG_KEY}" ABSOLUTE) + #message(STATUS "Trying registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Found ${PACKAGE} in Windows registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + break() + else() + unset(OPENCMISS_INSTALL_DIR) + endif() + endforeach() + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + break() + endif() + endforeach() +endif() + +if(OPENCMISS_INSTALL_DIR) + message(STATUS "OPENCMISS_INSTALL_DIR=${OPENCMISS_INSTALL_DIR}") + # Use the OpenCMISS scripts to also allow choosing a separate toolchain + # This file is located at the opencmiss installation rather than the local example + # as it avoids file replication and makes maintenance much easier + if (TOOLCHAIN) + set(_OCTC ${OPENCMISS_INSTALL_DIR}/cmake/OCToolchainCompilers.cmake) + if (EXISTS "${_OCTC}") + include(${_OCTC}) + else() + message(WARNING "TOOLCHAIN specified but OpenCMISS config script could not be found at ${_OCTC}. Trying CMake defaults.") + endif() + unset(_OCTC) + endif() + set(OpenCMISS_DIR "${OPENCMISS_INSTALL_DIR}" CACHE PATH "Path to the found OpenCMISS (SDK) installation") +else() + message(WARNING "No OpenCMISS (SDK) installation directory detected. Using default system environment.") +endif() + \ No newline at end of file diff --git a/MultiPhysics/Poroelasticity/FiniteElasticityDarcy/IncompressibleElasticityDrivenDarcyMatSolve/build_debug/build.sh b/MultiPhysics/Poroelasticity/FiniteElasticityDarcy/IncompressibleElasticityDrivenDarcyMatSolve/build_debug/build.sh new file mode 100644 index 00000000..e6624bac --- /dev/null +++ b/MultiPhysics/Poroelasticity/FiniteElasticityDarcy/IncompressibleElasticityDrivenDarcyMatSolve/build_debug/build.sh @@ -0,0 +1,2 @@ +#ccc && cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all +cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all diff --git a/MultiPhysics/Poroelasticity/FiniteElasticityDarcy/IncompressibleElasticityDrivenMultiCompDarcy/CMakeLists.txt b/MultiPhysics/Poroelasticity/FiniteElasticityDarcy/IncompressibleElasticityDrivenMultiCompDarcy/CMakeLists.txt new file mode 100644 index 00000000..a22b61ee --- /dev/null +++ b/MultiPhysics/Poroelasticity/FiniteElasticityDarcy/IncompressibleElasticityDrivenMultiCompDarcy/CMakeLists.txt @@ -0,0 +1,35 @@ +# 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 C) +enable_language(Fortran OPTIONAL) +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 +# ---------------------- +#add_subdirectory(C) +if (CMAKE_Fortran_COMPILER) + add_subdirectory(Fortran) +endif() diff --git a/MultiPhysics/Poroelasticity/FiniteElasticityDarcy/IncompressibleElasticityDrivenMultiCompDarcy/Fortran/CMakeLists.txt b/MultiPhysics/Poroelasticity/FiniteElasticityDarcy/IncompressibleElasticityDrivenMultiCompDarcy/Fortran/CMakeLists.txt new file mode 100644 index 00000000..e0a66874 --- /dev/null +++ b/MultiPhysics/Poroelasticity/FiniteElasticityDarcy/IncompressibleElasticityDrivenMultiCompDarcy/Fortran/CMakeLists.txt @@ -0,0 +1,60 @@ + +# Add example executable +add_executable(IncompressibleElasticityDrivenMultiCompDarcy src/IncompressibleElasticityDrivenMultiCompDarcyExample.f90) + +# Turn on Fortran preprocessing (#include directives) +if (MSVC) + set(PROC_OPT "/fpp") +else() + set(PROC_OPT "-cpp") +endif() + +# in debug mode, add flag that make Floating point exceptions fatal +set(OPT "") +if (FALSE) + if(CMAKE_BUILD_TYPE MATCHES DEBUG) + set(OPT "-ffpe-trap=invalid,zero,underflow,overflow,denormal") # GCC: make floating point exceptions fatal + endif() +endif() + +target_compile_options(IncompressibleElasticityDrivenMultiCompDarcy PRIVATE ${PROC_OPT} ${OPT} "-fbacktrace") + +# Link to opencmiss +# ----------------- +# +# This simply uses the opencmiss target created by OC_INIT() above. +# +# Alternatively, you can also directly invoke 'find_package(Iron )' 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 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(IncompressibleElasticityDrivenMultiCompDarcy PRIVATE opencmiss) + +# Add a simple test that runs the executable +add_test(NAME test_IncompressibleElasticityDrivenMultiCompDarcy COMMAND IncompressibleElasticityDrivenMultiCompDarcy) +add_opencmiss_environment(test_IncompressibleElasticityDrivenMultiCompDarcy) + +################### +# 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. +# diff --git a/MultiPhysics/Poroelasticity/FiniteElasticityDarcy/IncompressibleElasticityDrivenMultiCompDarcy/src/IncompressibleElasticityDrivenMultiCompDarcyExample.f90 b/MultiPhysics/Poroelasticity/FiniteElasticityDarcy/IncompressibleElasticityDrivenMultiCompDarcy/Fortran/src/IncompressibleElasticityDrivenMultiCompDarcyExample.f90 similarity index 100% rename from MultiPhysics/Poroelasticity/FiniteElasticityDarcy/IncompressibleElasticityDrivenMultiCompDarcy/src/IncompressibleElasticityDrivenMultiCompDarcyExample.f90 rename to MultiPhysics/Poroelasticity/FiniteElasticityDarcy/IncompressibleElasticityDrivenMultiCompDarcy/Fortran/src/IncompressibleElasticityDrivenMultiCompDarcyExample.f90 diff --git a/MultiPhysics/Poroelasticity/FiniteElasticityDarcy/IncompressibleElasticityDrivenMultiCompDarcy/OpenCMISS.cmake b/MultiPhysics/Poroelasticity/FiniteElasticityDarcy/IncompressibleElasticityDrivenMultiCompDarcy/OpenCMISS.cmake new file mode 100644 index 00000000..3d6cf515 --- /dev/null +++ b/MultiPhysics/Poroelasticity/FiniteElasticityDarcy/IncompressibleElasticityDrivenMultiCompDarcy/OpenCMISS.cmake @@ -0,0 +1,95 @@ +########################### +# *DO NOT CHANGE THIS FILE* +########################### +# +# Prepares the use of OpenCMISS by scanning at various path locations for OpenCMISS (SDK) installations. +# +# Search order: +# - OPENCMISS_INSTALL_DIR variable +# - OPENCMISS_INSTALL_DIR environment variable +# - OPENCMISS_SDK_DIR variable +# - OPENCMISS_SDK_DIR environment variable +# - [Windows only] The Registry is searched additionally for installed SDKs. +# +# If found +# - Includes the toolchain config script of the found opencmiss installation to enable toolchain selection logic (non-windows) + +# Convenience: The OPENCMISS_INSTALL_DIR may also be defined in the environment and various other places +if (DEFINED OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using specified installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The specified OPENCMISS_INSTALL_DIR '${OPENCMISS_INSTALL_DIR}' does not exist. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_INSTALL_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_INSTALL_DIR}" OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using environment installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The environment variable OPENCMISS_INSTALL_DIR='${OPENCMISS_INSTALL_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if (NOT OPENCMISS_INSTALL_DIR AND DEFINED OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The specified OPENCMISS_SDK_DIR '${OPENCMISS_SDK_DIR}' does not exist. Skipping.") + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_SDK_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_SDK_DIR}" OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using environment SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The environment variable OPENCMISS_SDK_DIR='${OPENCMISS_SDK_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_SDK_DIR) + endif() +endif() +# On windows: check the registry for installed OpenCMISS SDKs +if(NOT OPENCMISS_INSTALL_DIR AND WIN32) + foreach(ROOT HKEY_CURRENT_USER HKEY_LOCAL_MACHINE) + foreach(PACKAGE OpenCMISSUserSDK OpenCMISSDeveloperSDK) + set(_REG_KEY "[${ROOT}\\Software\\Auckland Bioengineering Institute\\${PACKAGE}]") + get_filename_component(OPENCMISS_INSTALL_DIR "${_REG_KEY}" ABSOLUTE) + #message(STATUS "Trying registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Found ${PACKAGE} in Windows registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + break() + else() + unset(OPENCMISS_INSTALL_DIR) + endif() + endforeach() + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + break() + endif() + endforeach() +endif() + +if(OPENCMISS_INSTALL_DIR) + message(STATUS "OPENCMISS_INSTALL_DIR=${OPENCMISS_INSTALL_DIR}") + # Use the OpenCMISS scripts to also allow choosing a separate toolchain + # This file is located at the opencmiss installation rather than the local example + # as it avoids file replication and makes maintenance much easier + if (TOOLCHAIN) + set(_OCTC ${OPENCMISS_INSTALL_DIR}/cmake/OCToolchainCompilers.cmake) + if (EXISTS "${_OCTC}") + include(${_OCTC}) + else() + message(WARNING "TOOLCHAIN specified but OpenCMISS config script could not be found at ${_OCTC}. Trying CMake defaults.") + endif() + unset(_OCTC) + endif() + set(OpenCMISS_DIR "${OPENCMISS_INSTALL_DIR}" CACHE PATH "Path to the found OpenCMISS (SDK) installation") +else() + message(WARNING "No OpenCMISS (SDK) installation directory detected. Using default system environment.") +endif() + \ No newline at end of file diff --git a/MultiPhysics/Poroelasticity/FiniteElasticityDarcy/IncompressibleElasticityDrivenMultiCompDarcy/build_debug/build.sh b/MultiPhysics/Poroelasticity/FiniteElasticityDarcy/IncompressibleElasticityDrivenMultiCompDarcy/build_debug/build.sh new file mode 100644 index 00000000..e6624bac --- /dev/null +++ b/MultiPhysics/Poroelasticity/FiniteElasticityDarcy/IncompressibleElasticityDrivenMultiCompDarcy/build_debug/build.sh @@ -0,0 +1,2 @@ +#ccc && cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all +cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all diff --git a/MultiPhysics/Poroelasticity/FiniteElasticityDarcy/IncompressibleElasticityDrivenMultiCompDarcyIO/CMakeLists.txt b/MultiPhysics/Poroelasticity/FiniteElasticityDarcy/IncompressibleElasticityDrivenMultiCompDarcyIO/CMakeLists.txt new file mode 100644 index 00000000..a22b61ee --- /dev/null +++ b/MultiPhysics/Poroelasticity/FiniteElasticityDarcy/IncompressibleElasticityDrivenMultiCompDarcyIO/CMakeLists.txt @@ -0,0 +1,35 @@ +# 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 C) +enable_language(Fortran OPTIONAL) +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 +# ---------------------- +#add_subdirectory(C) +if (CMAKE_Fortran_COMPILER) + add_subdirectory(Fortran) +endif() diff --git a/MultiPhysics/Poroelasticity/FiniteElasticityDarcy/IncompressibleElasticityDrivenMultiCompDarcyIO/Fortran/CMakeLists.txt b/MultiPhysics/Poroelasticity/FiniteElasticityDarcy/IncompressibleElasticityDrivenMultiCompDarcyIO/Fortran/CMakeLists.txt new file mode 100644 index 00000000..89df600d --- /dev/null +++ b/MultiPhysics/Poroelasticity/FiniteElasticityDarcy/IncompressibleElasticityDrivenMultiCompDarcyIO/Fortran/CMakeLists.txt @@ -0,0 +1,60 @@ + +# Add example executable +add_executable(IncompressibleElasticityDrivenMultiCompDarcyIO src/IncompressibleElasticityDrivenMultiCompDarcyIOExample.f90) + +# Turn on Fortran preprocessing (#include directives) +if (MSVC) + set(PROC_OPT "/fpp") +else() + set(PROC_OPT "-cpp") +endif() + +# in debug mode, add flag that make Floating point exceptions fatal +set(OPT "") +if (FALSE) + if(CMAKE_BUILD_TYPE MATCHES DEBUG) + set(OPT "-ffpe-trap=invalid,zero,underflow,overflow,denormal") # GCC: make floating point exceptions fatal + endif() +endif() + +target_compile_options(IncompressibleElasticityDrivenMultiCompDarcyIO PRIVATE ${PROC_OPT} ${OPT} "-fbacktrace") + +# Link to opencmiss +# ----------------- +# +# This simply uses the opencmiss target created by OC_INIT() above. +# +# Alternatively, you can also directly invoke 'find_package(Iron )' 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 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(IncompressibleElasticityDrivenMultiCompDarcyIO PRIVATE opencmiss) + +# Add a simple test that runs the executable +add_test(NAME test_IncompressibleElasticityDrivenMultiCompDarcyIO COMMAND IncompressibleElasticityDrivenMultiCompDarcyIO) +add_opencmiss_environment(test_IncompressibleElasticityDrivenMultiCompDarcyIO) + +################### +# 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. +# diff --git a/MultiPhysics/Poroelasticity/FiniteElasticityDarcy/IncompressibleElasticityDrivenMultiCompDarcyIO/src/IncompressibleElasticityDrivenMultiCompDarcyIOExample.f90 b/MultiPhysics/Poroelasticity/FiniteElasticityDarcy/IncompressibleElasticityDrivenMultiCompDarcyIO/Fortran/src/IncompressibleElasticityDrivenMultiCompDarcyIOExample.f90 similarity index 100% rename from MultiPhysics/Poroelasticity/FiniteElasticityDarcy/IncompressibleElasticityDrivenMultiCompDarcyIO/src/IncompressibleElasticityDrivenMultiCompDarcyIOExample.f90 rename to MultiPhysics/Poroelasticity/FiniteElasticityDarcy/IncompressibleElasticityDrivenMultiCompDarcyIO/Fortran/src/IncompressibleElasticityDrivenMultiCompDarcyIOExample.f90 diff --git a/MultiPhysics/Poroelasticity/FiniteElasticityDarcy/IncompressibleElasticityDrivenMultiCompDarcyIO/OpenCMISS.cmake b/MultiPhysics/Poroelasticity/FiniteElasticityDarcy/IncompressibleElasticityDrivenMultiCompDarcyIO/OpenCMISS.cmake new file mode 100644 index 00000000..3d6cf515 --- /dev/null +++ b/MultiPhysics/Poroelasticity/FiniteElasticityDarcy/IncompressibleElasticityDrivenMultiCompDarcyIO/OpenCMISS.cmake @@ -0,0 +1,95 @@ +########################### +# *DO NOT CHANGE THIS FILE* +########################### +# +# Prepares the use of OpenCMISS by scanning at various path locations for OpenCMISS (SDK) installations. +# +# Search order: +# - OPENCMISS_INSTALL_DIR variable +# - OPENCMISS_INSTALL_DIR environment variable +# - OPENCMISS_SDK_DIR variable +# - OPENCMISS_SDK_DIR environment variable +# - [Windows only] The Registry is searched additionally for installed SDKs. +# +# If found +# - Includes the toolchain config script of the found opencmiss installation to enable toolchain selection logic (non-windows) + +# Convenience: The OPENCMISS_INSTALL_DIR may also be defined in the environment and various other places +if (DEFINED OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using specified installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The specified OPENCMISS_INSTALL_DIR '${OPENCMISS_INSTALL_DIR}' does not exist. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_INSTALL_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_INSTALL_DIR}" OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using environment installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The environment variable OPENCMISS_INSTALL_DIR='${OPENCMISS_INSTALL_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if (NOT OPENCMISS_INSTALL_DIR AND DEFINED OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The specified OPENCMISS_SDK_DIR '${OPENCMISS_SDK_DIR}' does not exist. Skipping.") + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_SDK_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_SDK_DIR}" OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using environment SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The environment variable OPENCMISS_SDK_DIR='${OPENCMISS_SDK_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_SDK_DIR) + endif() +endif() +# On windows: check the registry for installed OpenCMISS SDKs +if(NOT OPENCMISS_INSTALL_DIR AND WIN32) + foreach(ROOT HKEY_CURRENT_USER HKEY_LOCAL_MACHINE) + foreach(PACKAGE OpenCMISSUserSDK OpenCMISSDeveloperSDK) + set(_REG_KEY "[${ROOT}\\Software\\Auckland Bioengineering Institute\\${PACKAGE}]") + get_filename_component(OPENCMISS_INSTALL_DIR "${_REG_KEY}" ABSOLUTE) + #message(STATUS "Trying registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Found ${PACKAGE} in Windows registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + break() + else() + unset(OPENCMISS_INSTALL_DIR) + endif() + endforeach() + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + break() + endif() + endforeach() +endif() + +if(OPENCMISS_INSTALL_DIR) + message(STATUS "OPENCMISS_INSTALL_DIR=${OPENCMISS_INSTALL_DIR}") + # Use the OpenCMISS scripts to also allow choosing a separate toolchain + # This file is located at the opencmiss installation rather than the local example + # as it avoids file replication and makes maintenance much easier + if (TOOLCHAIN) + set(_OCTC ${OPENCMISS_INSTALL_DIR}/cmake/OCToolchainCompilers.cmake) + if (EXISTS "${_OCTC}") + include(${_OCTC}) + else() + message(WARNING "TOOLCHAIN specified but OpenCMISS config script could not be found at ${_OCTC}. Trying CMake defaults.") + endif() + unset(_OCTC) + endif() + set(OpenCMISS_DIR "${OPENCMISS_INSTALL_DIR}" CACHE PATH "Path to the found OpenCMISS (SDK) installation") +else() + message(WARNING "No OpenCMISS (SDK) installation directory detected. Using default system environment.") +endif() + \ No newline at end of file diff --git a/MultiPhysics/Poroelasticity/FiniteElasticityDarcy/IncompressibleElasticityDrivenMultiCompDarcyIO/build_debug/build.sh b/MultiPhysics/Poroelasticity/FiniteElasticityDarcy/IncompressibleElasticityDrivenMultiCompDarcyIO/build_debug/build.sh new file mode 100644 index 00000000..e6624bac --- /dev/null +++ b/MultiPhysics/Poroelasticity/FiniteElasticityDarcy/IncompressibleElasticityDrivenMultiCompDarcyIO/build_debug/build.sh @@ -0,0 +1,2 @@ +#ccc && cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all +cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all diff --git a/MultiPhysics/Poroelasticity/FiniteElasticityDarcy/InriaModel/CMakeLists.txt b/MultiPhysics/Poroelasticity/FiniteElasticityDarcy/InriaModel/CMakeLists.txt new file mode 100644 index 00000000..a22b61ee --- /dev/null +++ b/MultiPhysics/Poroelasticity/FiniteElasticityDarcy/InriaModel/CMakeLists.txt @@ -0,0 +1,35 @@ +# 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 C) +enable_language(Fortran OPTIONAL) +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 +# ---------------------- +#add_subdirectory(C) +if (CMAKE_Fortran_COMPILER) + add_subdirectory(Fortran) +endif() diff --git a/MultiPhysics/Poroelasticity/FiniteElasticityDarcy/InriaModel/Fortran/CMakeLists.txt b/MultiPhysics/Poroelasticity/FiniteElasticityDarcy/InriaModel/Fortran/CMakeLists.txt new file mode 100644 index 00000000..fe950854 --- /dev/null +++ b/MultiPhysics/Poroelasticity/FiniteElasticityDarcy/InriaModel/Fortran/CMakeLists.txt @@ -0,0 +1,60 @@ + +# Add example executable +add_executable(InriaModel src/InriaModelExample.f90) + +# Turn on Fortran preprocessing (#include directives) +if (MSVC) + set(PROC_OPT "/fpp") +else() + set(PROC_OPT "-cpp") +endif() + +# in debug mode, add flag that make Floating point exceptions fatal +set(OPT "") +if (FALSE) + if(CMAKE_BUILD_TYPE MATCHES DEBUG) + set(OPT "-ffpe-trap=invalid,zero,underflow,overflow,denormal") # GCC: make floating point exceptions fatal + endif() +endif() + +target_compile_options(InriaModel PRIVATE ${PROC_OPT} ${OPT} "-fbacktrace") + +# Link to opencmiss +# ----------------- +# +# This simply uses the opencmiss target created by OC_INIT() above. +# +# Alternatively, you can also directly invoke 'find_package(Iron )' 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 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(InriaModel PRIVATE opencmiss) + +# Add a simple test that runs the executable +add_test(NAME test_InriaModel COMMAND InriaModel) +add_opencmiss_environment(test_InriaModel) + +################### +# 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. +# diff --git a/MultiPhysics/Poroelasticity/FiniteElasticityDarcy/InriaModel/src/InriaModelExample.f90 b/MultiPhysics/Poroelasticity/FiniteElasticityDarcy/InriaModel/Fortran/src/InriaModelExample.f90 similarity index 100% rename from MultiPhysics/Poroelasticity/FiniteElasticityDarcy/InriaModel/src/InriaModelExample.f90 rename to MultiPhysics/Poroelasticity/FiniteElasticityDarcy/InriaModel/Fortran/src/InriaModelExample.f90 diff --git a/MultiPhysics/Poroelasticity/FiniteElasticityDarcy/InriaModel/OpenCMISS.cmake b/MultiPhysics/Poroelasticity/FiniteElasticityDarcy/InriaModel/OpenCMISS.cmake new file mode 100644 index 00000000..3d6cf515 --- /dev/null +++ b/MultiPhysics/Poroelasticity/FiniteElasticityDarcy/InriaModel/OpenCMISS.cmake @@ -0,0 +1,95 @@ +########################### +# *DO NOT CHANGE THIS FILE* +########################### +# +# Prepares the use of OpenCMISS by scanning at various path locations for OpenCMISS (SDK) installations. +# +# Search order: +# - OPENCMISS_INSTALL_DIR variable +# - OPENCMISS_INSTALL_DIR environment variable +# - OPENCMISS_SDK_DIR variable +# - OPENCMISS_SDK_DIR environment variable +# - [Windows only] The Registry is searched additionally for installed SDKs. +# +# If found +# - Includes the toolchain config script of the found opencmiss installation to enable toolchain selection logic (non-windows) + +# Convenience: The OPENCMISS_INSTALL_DIR may also be defined in the environment and various other places +if (DEFINED OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using specified installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The specified OPENCMISS_INSTALL_DIR '${OPENCMISS_INSTALL_DIR}' does not exist. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_INSTALL_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_INSTALL_DIR}" OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using environment installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The environment variable OPENCMISS_INSTALL_DIR='${OPENCMISS_INSTALL_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if (NOT OPENCMISS_INSTALL_DIR AND DEFINED OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The specified OPENCMISS_SDK_DIR '${OPENCMISS_SDK_DIR}' does not exist. Skipping.") + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_SDK_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_SDK_DIR}" OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using environment SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The environment variable OPENCMISS_SDK_DIR='${OPENCMISS_SDK_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_SDK_DIR) + endif() +endif() +# On windows: check the registry for installed OpenCMISS SDKs +if(NOT OPENCMISS_INSTALL_DIR AND WIN32) + foreach(ROOT HKEY_CURRENT_USER HKEY_LOCAL_MACHINE) + foreach(PACKAGE OpenCMISSUserSDK OpenCMISSDeveloperSDK) + set(_REG_KEY "[${ROOT}\\Software\\Auckland Bioengineering Institute\\${PACKAGE}]") + get_filename_component(OPENCMISS_INSTALL_DIR "${_REG_KEY}" ABSOLUTE) + #message(STATUS "Trying registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Found ${PACKAGE} in Windows registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + break() + else() + unset(OPENCMISS_INSTALL_DIR) + endif() + endforeach() + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + break() + endif() + endforeach() +endif() + +if(OPENCMISS_INSTALL_DIR) + message(STATUS "OPENCMISS_INSTALL_DIR=${OPENCMISS_INSTALL_DIR}") + # Use the OpenCMISS scripts to also allow choosing a separate toolchain + # This file is located at the opencmiss installation rather than the local example + # as it avoids file replication and makes maintenance much easier + if (TOOLCHAIN) + set(_OCTC ${OPENCMISS_INSTALL_DIR}/cmake/OCToolchainCompilers.cmake) + if (EXISTS "${_OCTC}") + include(${_OCTC}) + else() + message(WARNING "TOOLCHAIN specified but OpenCMISS config script could not be found at ${_OCTC}. Trying CMake defaults.") + endif() + unset(_OCTC) + endif() + set(OpenCMISS_DIR "${OPENCMISS_INSTALL_DIR}" CACHE PATH "Path to the found OpenCMISS (SDK) installation") +else() + message(WARNING "No OpenCMISS (SDK) installation directory detected. Using default system environment.") +endif() + \ No newline at end of file diff --git a/MultiPhysics/Poroelasticity/FiniteElasticityDarcy/InriaModel/build_debug/build.sh b/MultiPhysics/Poroelasticity/FiniteElasticityDarcy/InriaModel/build_debug/build.sh new file mode 100644 index 00000000..e6624bac --- /dev/null +++ b/MultiPhysics/Poroelasticity/FiniteElasticityDarcy/InriaModel/build_debug/build.sh @@ -0,0 +1,2 @@ +#ccc && cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all +cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all diff --git a/MultiPhysics/Poroelasticity/FiniteElasticityDarcy/QuadraticEllipsoidDrivenDarcy/CMakeLists.txt b/MultiPhysics/Poroelasticity/FiniteElasticityDarcy/QuadraticEllipsoidDrivenDarcy/CMakeLists.txt new file mode 100644 index 00000000..a22b61ee --- /dev/null +++ b/MultiPhysics/Poroelasticity/FiniteElasticityDarcy/QuadraticEllipsoidDrivenDarcy/CMakeLists.txt @@ -0,0 +1,35 @@ +# 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 C) +enable_language(Fortran OPTIONAL) +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 +# ---------------------- +#add_subdirectory(C) +if (CMAKE_Fortran_COMPILER) + add_subdirectory(Fortran) +endif() diff --git a/MultiPhysics/Poroelasticity/FiniteElasticityDarcy/QuadraticEllipsoidDrivenDarcy/Fortran/CMakeLists.txt b/MultiPhysics/Poroelasticity/FiniteElasticityDarcy/QuadraticEllipsoidDrivenDarcy/Fortran/CMakeLists.txt new file mode 100644 index 00000000..77a5ac5d --- /dev/null +++ b/MultiPhysics/Poroelasticity/FiniteElasticityDarcy/QuadraticEllipsoidDrivenDarcy/Fortran/CMakeLists.txt @@ -0,0 +1,60 @@ + +# Add example executable +add_executable(QuadraticEllipsoidDrivenDarcy src/QuadraticEllipsoidDrivenDarcyExample.f90) + +# Turn on Fortran preprocessing (#include directives) +if (MSVC) + set(PROC_OPT "/fpp") +else() + set(PROC_OPT "-cpp") +endif() + +# in debug mode, add flag that make Floating point exceptions fatal +set(OPT "") +if (FALSE) + if(CMAKE_BUILD_TYPE MATCHES DEBUG) + set(OPT "-ffpe-trap=invalid,zero,underflow,overflow,denormal") # GCC: make floating point exceptions fatal + endif() +endif() + +target_compile_options(QuadraticEllipsoidDrivenDarcy PRIVATE ${PROC_OPT} ${OPT} "-fbacktrace") + +# Link to opencmiss +# ----------------- +# +# This simply uses the opencmiss target created by OC_INIT() above. +# +# Alternatively, you can also directly invoke 'find_package(Iron )' 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 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(QuadraticEllipsoidDrivenDarcy PRIVATE opencmiss) + +# Add a simple test that runs the executable +add_test(NAME test_QuadraticEllipsoidDrivenDarcy COMMAND QuadraticEllipsoidDrivenDarcy) +add_opencmiss_environment(test_QuadraticEllipsoidDrivenDarcy) + +################### +# 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. +# diff --git a/MultiPhysics/Poroelasticity/FiniteElasticityDarcy/QuadraticEllipsoidDrivenDarcy/src/QuadraticEllipsoidDrivenDarcyExample.f90 b/MultiPhysics/Poroelasticity/FiniteElasticityDarcy/QuadraticEllipsoidDrivenDarcy/Fortran/src/QuadraticEllipsoidDrivenDarcyExample.f90 similarity index 100% rename from MultiPhysics/Poroelasticity/FiniteElasticityDarcy/QuadraticEllipsoidDrivenDarcy/src/QuadraticEllipsoidDrivenDarcyExample.f90 rename to MultiPhysics/Poroelasticity/FiniteElasticityDarcy/QuadraticEllipsoidDrivenDarcy/Fortran/src/QuadraticEllipsoidDrivenDarcyExample.f90 diff --git a/MultiPhysics/Poroelasticity/FiniteElasticityDarcy/QuadraticEllipsoidDrivenDarcy/OpenCMISS.cmake b/MultiPhysics/Poroelasticity/FiniteElasticityDarcy/QuadraticEllipsoidDrivenDarcy/OpenCMISS.cmake new file mode 100644 index 00000000..3d6cf515 --- /dev/null +++ b/MultiPhysics/Poroelasticity/FiniteElasticityDarcy/QuadraticEllipsoidDrivenDarcy/OpenCMISS.cmake @@ -0,0 +1,95 @@ +########################### +# *DO NOT CHANGE THIS FILE* +########################### +# +# Prepares the use of OpenCMISS by scanning at various path locations for OpenCMISS (SDK) installations. +# +# Search order: +# - OPENCMISS_INSTALL_DIR variable +# - OPENCMISS_INSTALL_DIR environment variable +# - OPENCMISS_SDK_DIR variable +# - OPENCMISS_SDK_DIR environment variable +# - [Windows only] The Registry is searched additionally for installed SDKs. +# +# If found +# - Includes the toolchain config script of the found opencmiss installation to enable toolchain selection logic (non-windows) + +# Convenience: The OPENCMISS_INSTALL_DIR may also be defined in the environment and various other places +if (DEFINED OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using specified installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The specified OPENCMISS_INSTALL_DIR '${OPENCMISS_INSTALL_DIR}' does not exist. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_INSTALL_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_INSTALL_DIR}" OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using environment installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The environment variable OPENCMISS_INSTALL_DIR='${OPENCMISS_INSTALL_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if (NOT OPENCMISS_INSTALL_DIR AND DEFINED OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The specified OPENCMISS_SDK_DIR '${OPENCMISS_SDK_DIR}' does not exist. Skipping.") + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_SDK_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_SDK_DIR}" OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using environment SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The environment variable OPENCMISS_SDK_DIR='${OPENCMISS_SDK_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_SDK_DIR) + endif() +endif() +# On windows: check the registry for installed OpenCMISS SDKs +if(NOT OPENCMISS_INSTALL_DIR AND WIN32) + foreach(ROOT HKEY_CURRENT_USER HKEY_LOCAL_MACHINE) + foreach(PACKAGE OpenCMISSUserSDK OpenCMISSDeveloperSDK) + set(_REG_KEY "[${ROOT}\\Software\\Auckland Bioengineering Institute\\${PACKAGE}]") + get_filename_component(OPENCMISS_INSTALL_DIR "${_REG_KEY}" ABSOLUTE) + #message(STATUS "Trying registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Found ${PACKAGE} in Windows registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + break() + else() + unset(OPENCMISS_INSTALL_DIR) + endif() + endforeach() + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + break() + endif() + endforeach() +endif() + +if(OPENCMISS_INSTALL_DIR) + message(STATUS "OPENCMISS_INSTALL_DIR=${OPENCMISS_INSTALL_DIR}") + # Use the OpenCMISS scripts to also allow choosing a separate toolchain + # This file is located at the opencmiss installation rather than the local example + # as it avoids file replication and makes maintenance much easier + if (TOOLCHAIN) + set(_OCTC ${OPENCMISS_INSTALL_DIR}/cmake/OCToolchainCompilers.cmake) + if (EXISTS "${_OCTC}") + include(${_OCTC}) + else() + message(WARNING "TOOLCHAIN specified but OpenCMISS config script could not be found at ${_OCTC}. Trying CMake defaults.") + endif() + unset(_OCTC) + endif() + set(OpenCMISS_DIR "${OPENCMISS_INSTALL_DIR}" CACHE PATH "Path to the found OpenCMISS (SDK) installation") +else() + message(WARNING "No OpenCMISS (SDK) installation directory detected. Using default system environment.") +endif() + \ No newline at end of file diff --git a/MultiPhysics/Poroelasticity/FiniteElasticityDarcy/QuadraticEllipsoidDrivenDarcy/build_debug/build.sh b/MultiPhysics/Poroelasticity/FiniteElasticityDarcy/QuadraticEllipsoidDrivenDarcy/build_debug/build.sh new file mode 100644 index 00000000..e6624bac --- /dev/null +++ b/MultiPhysics/Poroelasticity/FiniteElasticityDarcy/QuadraticEllipsoidDrivenDarcy/build_debug/build.sh @@ -0,0 +1,2 @@ +#ccc && cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all +cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all diff --git a/MultiPhysics/Poroelasticity/FiniteElasticityDarcy/QuadraticEllipsoidDrivenMultiCompDarcy/CMakeLists.txt b/MultiPhysics/Poroelasticity/FiniteElasticityDarcy/QuadraticEllipsoidDrivenMultiCompDarcy/CMakeLists.txt new file mode 100644 index 00000000..a22b61ee --- /dev/null +++ b/MultiPhysics/Poroelasticity/FiniteElasticityDarcy/QuadraticEllipsoidDrivenMultiCompDarcy/CMakeLists.txt @@ -0,0 +1,35 @@ +# 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 C) +enable_language(Fortran OPTIONAL) +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 +# ---------------------- +#add_subdirectory(C) +if (CMAKE_Fortran_COMPILER) + add_subdirectory(Fortran) +endif() diff --git a/MultiPhysics/Poroelasticity/FiniteElasticityDarcy/QuadraticEllipsoidDrivenMultiCompDarcy/Fortran/CMakeLists.txt b/MultiPhysics/Poroelasticity/FiniteElasticityDarcy/QuadraticEllipsoidDrivenMultiCompDarcy/Fortran/CMakeLists.txt new file mode 100644 index 00000000..402d64b2 --- /dev/null +++ b/MultiPhysics/Poroelasticity/FiniteElasticityDarcy/QuadraticEllipsoidDrivenMultiCompDarcy/Fortran/CMakeLists.txt @@ -0,0 +1,60 @@ + +# Add example executable +add_executable(QuadraticEllipsoidDrivenMultiCompDarcy src/QuadraticEllipsoidDrivenMultiCompDarcyExample.f90) + +# Turn on Fortran preprocessing (#include directives) +if (MSVC) + set(PROC_OPT "/fpp") +else() + set(PROC_OPT "-cpp") +endif() + +# in debug mode, add flag that make Floating point exceptions fatal +set(OPT "") +if (FALSE) + if(CMAKE_BUILD_TYPE MATCHES DEBUG) + set(OPT "-ffpe-trap=invalid,zero,underflow,overflow,denormal") # GCC: make floating point exceptions fatal + endif() +endif() + +target_compile_options(QuadraticEllipsoidDrivenMultiCompDarcy PRIVATE ${PROC_OPT} ${OPT} "-fbacktrace") + +# Link to opencmiss +# ----------------- +# +# This simply uses the opencmiss target created by OC_INIT() above. +# +# Alternatively, you can also directly invoke 'find_package(Iron )' 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 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(QuadraticEllipsoidDrivenMultiCompDarcy PRIVATE opencmiss) + +# Add a simple test that runs the executable +add_test(NAME test_QuadraticEllipsoidDrivenMultiCompDarcy COMMAND QuadraticEllipsoidDrivenMultiCompDarcy) +add_opencmiss_environment(test_QuadraticEllipsoidDrivenMultiCompDarcy) + +################### +# 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. +# diff --git a/MultiPhysics/Poroelasticity/FiniteElasticityDarcy/QuadraticEllipsoidDrivenMultiCompDarcy/src/QuadraticEllipsoidDrivenMultiCompDarcyExample.f90 b/MultiPhysics/Poroelasticity/FiniteElasticityDarcy/QuadraticEllipsoidDrivenMultiCompDarcy/Fortran/src/QuadraticEllipsoidDrivenMultiCompDarcyExample.f90 similarity index 100% rename from MultiPhysics/Poroelasticity/FiniteElasticityDarcy/QuadraticEllipsoidDrivenMultiCompDarcy/src/QuadraticEllipsoidDrivenMultiCompDarcyExample.f90 rename to MultiPhysics/Poroelasticity/FiniteElasticityDarcy/QuadraticEllipsoidDrivenMultiCompDarcy/Fortran/src/QuadraticEllipsoidDrivenMultiCompDarcyExample.f90 diff --git a/MultiPhysics/Poroelasticity/FiniteElasticityDarcy/QuadraticEllipsoidDrivenMultiCompDarcy/OpenCMISS.cmake b/MultiPhysics/Poroelasticity/FiniteElasticityDarcy/QuadraticEllipsoidDrivenMultiCompDarcy/OpenCMISS.cmake new file mode 100644 index 00000000..3d6cf515 --- /dev/null +++ b/MultiPhysics/Poroelasticity/FiniteElasticityDarcy/QuadraticEllipsoidDrivenMultiCompDarcy/OpenCMISS.cmake @@ -0,0 +1,95 @@ +########################### +# *DO NOT CHANGE THIS FILE* +########################### +# +# Prepares the use of OpenCMISS by scanning at various path locations for OpenCMISS (SDK) installations. +# +# Search order: +# - OPENCMISS_INSTALL_DIR variable +# - OPENCMISS_INSTALL_DIR environment variable +# - OPENCMISS_SDK_DIR variable +# - OPENCMISS_SDK_DIR environment variable +# - [Windows only] The Registry is searched additionally for installed SDKs. +# +# If found +# - Includes the toolchain config script of the found opencmiss installation to enable toolchain selection logic (non-windows) + +# Convenience: The OPENCMISS_INSTALL_DIR may also be defined in the environment and various other places +if (DEFINED OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using specified installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The specified OPENCMISS_INSTALL_DIR '${OPENCMISS_INSTALL_DIR}' does not exist. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_INSTALL_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_INSTALL_DIR}" OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using environment installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The environment variable OPENCMISS_INSTALL_DIR='${OPENCMISS_INSTALL_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if (NOT OPENCMISS_INSTALL_DIR AND DEFINED OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The specified OPENCMISS_SDK_DIR '${OPENCMISS_SDK_DIR}' does not exist. Skipping.") + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_SDK_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_SDK_DIR}" OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using environment SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The environment variable OPENCMISS_SDK_DIR='${OPENCMISS_SDK_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_SDK_DIR) + endif() +endif() +# On windows: check the registry for installed OpenCMISS SDKs +if(NOT OPENCMISS_INSTALL_DIR AND WIN32) + foreach(ROOT HKEY_CURRENT_USER HKEY_LOCAL_MACHINE) + foreach(PACKAGE OpenCMISSUserSDK OpenCMISSDeveloperSDK) + set(_REG_KEY "[${ROOT}\\Software\\Auckland Bioengineering Institute\\${PACKAGE}]") + get_filename_component(OPENCMISS_INSTALL_DIR "${_REG_KEY}" ABSOLUTE) + #message(STATUS "Trying registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Found ${PACKAGE} in Windows registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + break() + else() + unset(OPENCMISS_INSTALL_DIR) + endif() + endforeach() + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + break() + endif() + endforeach() +endif() + +if(OPENCMISS_INSTALL_DIR) + message(STATUS "OPENCMISS_INSTALL_DIR=${OPENCMISS_INSTALL_DIR}") + # Use the OpenCMISS scripts to also allow choosing a separate toolchain + # This file is located at the opencmiss installation rather than the local example + # as it avoids file replication and makes maintenance much easier + if (TOOLCHAIN) + set(_OCTC ${OPENCMISS_INSTALL_DIR}/cmake/OCToolchainCompilers.cmake) + if (EXISTS "${_OCTC}") + include(${_OCTC}) + else() + message(WARNING "TOOLCHAIN specified but OpenCMISS config script could not be found at ${_OCTC}. Trying CMake defaults.") + endif() + unset(_OCTC) + endif() + set(OpenCMISS_DIR "${OPENCMISS_INSTALL_DIR}" CACHE PATH "Path to the found OpenCMISS (SDK) installation") +else() + message(WARNING "No OpenCMISS (SDK) installation directory detected. Using default system environment.") +endif() + \ No newline at end of file diff --git a/MultiPhysics/Poroelasticity/FiniteElasticityDarcy/QuadraticEllipsoidDrivenMultiCompDarcy/build_debug/build.sh b/MultiPhysics/Poroelasticity/FiniteElasticityDarcy/QuadraticEllipsoidDrivenMultiCompDarcy/build_debug/build.sh new file mode 100644 index 00000000..e6624bac --- /dev/null +++ b/MultiPhysics/Poroelasticity/FiniteElasticityDarcy/QuadraticEllipsoidDrivenMultiCompDarcy/build_debug/build.sh @@ -0,0 +1,2 @@ +#ccc && cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all +cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all diff --git a/MultiPhysics/Poroelasticity/FiniteElasticityDarcy/SameRegionSameMesh/CMakeLists.txt b/MultiPhysics/Poroelasticity/FiniteElasticityDarcy/SameRegionSameMesh/CMakeLists.txt new file mode 100644 index 00000000..a22b61ee --- /dev/null +++ b/MultiPhysics/Poroelasticity/FiniteElasticityDarcy/SameRegionSameMesh/CMakeLists.txt @@ -0,0 +1,35 @@ +# 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 C) +enable_language(Fortran OPTIONAL) +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 +# ---------------------- +#add_subdirectory(C) +if (CMAKE_Fortran_COMPILER) + add_subdirectory(Fortran) +endif() diff --git a/MultiPhysics/Poroelasticity/FiniteElasticityDarcy/SameRegionSameMesh/Fortran/CMakeLists.txt b/MultiPhysics/Poroelasticity/FiniteElasticityDarcy/SameRegionSameMesh/Fortran/CMakeLists.txt new file mode 100644 index 00000000..3e94c509 --- /dev/null +++ b/MultiPhysics/Poroelasticity/FiniteElasticityDarcy/SameRegionSameMesh/Fortran/CMakeLists.txt @@ -0,0 +1,60 @@ + +# Add example executable +add_executable(SameRegionSameMesh src/SameRegionSameMeshExample.f90) + +# Turn on Fortran preprocessing (#include directives) +if (MSVC) + set(PROC_OPT "/fpp") +else() + set(PROC_OPT "-cpp") +endif() + +# in debug mode, add flag that make Floating point exceptions fatal +set(OPT "") +if (FALSE) + if(CMAKE_BUILD_TYPE MATCHES DEBUG) + set(OPT "-ffpe-trap=invalid,zero,underflow,overflow,denormal") # GCC: make floating point exceptions fatal + endif() +endif() + +target_compile_options(SameRegionSameMesh PRIVATE ${PROC_OPT} ${OPT} "-fbacktrace") + +# Link to opencmiss +# ----------------- +# +# This simply uses the opencmiss target created by OC_INIT() above. +# +# Alternatively, you can also directly invoke 'find_package(Iron )' 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 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(SameRegionSameMesh PRIVATE opencmiss) + +# Add a simple test that runs the executable +add_test(NAME test_SameRegionSameMesh COMMAND SameRegionSameMesh) +add_opencmiss_environment(test_SameRegionSameMesh) + +################### +# 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. +# diff --git a/MultiPhysics/Poroelasticity/FiniteElasticityDarcy/SameRegionSameMesh/src/SameRegionSameMeshExample.f90 b/MultiPhysics/Poroelasticity/FiniteElasticityDarcy/SameRegionSameMesh/Fortran/src/SameRegionSameMeshExample.f90 similarity index 100% rename from MultiPhysics/Poroelasticity/FiniteElasticityDarcy/SameRegionSameMesh/src/SameRegionSameMeshExample.f90 rename to MultiPhysics/Poroelasticity/FiniteElasticityDarcy/SameRegionSameMesh/Fortran/src/SameRegionSameMeshExample.f90 diff --git a/MultiPhysics/Poroelasticity/FiniteElasticityDarcy/SameRegionSameMesh/OpenCMISS.cmake b/MultiPhysics/Poroelasticity/FiniteElasticityDarcy/SameRegionSameMesh/OpenCMISS.cmake new file mode 100644 index 00000000..3d6cf515 --- /dev/null +++ b/MultiPhysics/Poroelasticity/FiniteElasticityDarcy/SameRegionSameMesh/OpenCMISS.cmake @@ -0,0 +1,95 @@ +########################### +# *DO NOT CHANGE THIS FILE* +########################### +# +# Prepares the use of OpenCMISS by scanning at various path locations for OpenCMISS (SDK) installations. +# +# Search order: +# - OPENCMISS_INSTALL_DIR variable +# - OPENCMISS_INSTALL_DIR environment variable +# - OPENCMISS_SDK_DIR variable +# - OPENCMISS_SDK_DIR environment variable +# - [Windows only] The Registry is searched additionally for installed SDKs. +# +# If found +# - Includes the toolchain config script of the found opencmiss installation to enable toolchain selection logic (non-windows) + +# Convenience: The OPENCMISS_INSTALL_DIR may also be defined in the environment and various other places +if (DEFINED OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using specified installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The specified OPENCMISS_INSTALL_DIR '${OPENCMISS_INSTALL_DIR}' does not exist. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_INSTALL_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_INSTALL_DIR}" OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using environment installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The environment variable OPENCMISS_INSTALL_DIR='${OPENCMISS_INSTALL_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if (NOT OPENCMISS_INSTALL_DIR AND DEFINED OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The specified OPENCMISS_SDK_DIR '${OPENCMISS_SDK_DIR}' does not exist. Skipping.") + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_SDK_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_SDK_DIR}" OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using environment SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The environment variable OPENCMISS_SDK_DIR='${OPENCMISS_SDK_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_SDK_DIR) + endif() +endif() +# On windows: check the registry for installed OpenCMISS SDKs +if(NOT OPENCMISS_INSTALL_DIR AND WIN32) + foreach(ROOT HKEY_CURRENT_USER HKEY_LOCAL_MACHINE) + foreach(PACKAGE OpenCMISSUserSDK OpenCMISSDeveloperSDK) + set(_REG_KEY "[${ROOT}\\Software\\Auckland Bioengineering Institute\\${PACKAGE}]") + get_filename_component(OPENCMISS_INSTALL_DIR "${_REG_KEY}" ABSOLUTE) + #message(STATUS "Trying registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Found ${PACKAGE} in Windows registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + break() + else() + unset(OPENCMISS_INSTALL_DIR) + endif() + endforeach() + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + break() + endif() + endforeach() +endif() + +if(OPENCMISS_INSTALL_DIR) + message(STATUS "OPENCMISS_INSTALL_DIR=${OPENCMISS_INSTALL_DIR}") + # Use the OpenCMISS scripts to also allow choosing a separate toolchain + # This file is located at the opencmiss installation rather than the local example + # as it avoids file replication and makes maintenance much easier + if (TOOLCHAIN) + set(_OCTC ${OPENCMISS_INSTALL_DIR}/cmake/OCToolchainCompilers.cmake) + if (EXISTS "${_OCTC}") + include(${_OCTC}) + else() + message(WARNING "TOOLCHAIN specified but OpenCMISS config script could not be found at ${_OCTC}. Trying CMake defaults.") + endif() + unset(_OCTC) + endif() + set(OpenCMISS_DIR "${OPENCMISS_INSTALL_DIR}" CACHE PATH "Path to the found OpenCMISS (SDK) installation") +else() + message(WARNING "No OpenCMISS (SDK) installation directory detected. Using default system environment.") +endif() + \ No newline at end of file diff --git a/MultiPhysics/Poroelasticity/FiniteElasticityDarcy/SameRegionSameMesh/build_debug/build.sh b/MultiPhysics/Poroelasticity/FiniteElasticityDarcy/SameRegionSameMesh/build_debug/build.sh new file mode 100644 index 00000000..e6624bac --- /dev/null +++ b/MultiPhysics/Poroelasticity/FiniteElasticityDarcy/SameRegionSameMesh/build_debug/build.sh @@ -0,0 +1,2 @@ +#ccc && cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all +cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all diff --git a/MultiPhysics/Poroelasticity/FiniteElasticityFluidPressure/Cantilever/CMakeLists.txt b/MultiPhysics/Poroelasticity/FiniteElasticityFluidPressure/Cantilever/CMakeLists.txt new file mode 100644 index 00000000..a22b61ee --- /dev/null +++ b/MultiPhysics/Poroelasticity/FiniteElasticityFluidPressure/Cantilever/CMakeLists.txt @@ -0,0 +1,35 @@ +# 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 C) +enable_language(Fortran OPTIONAL) +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 +# ---------------------- +#add_subdirectory(C) +if (CMAKE_Fortran_COMPILER) + add_subdirectory(Fortran) +endif() diff --git a/MultiPhysics/Poroelasticity/FiniteElasticityFluidPressure/Cantilever/Fortran/CMakeLists.txt b/MultiPhysics/Poroelasticity/FiniteElasticityFluidPressure/Cantilever/Fortran/CMakeLists.txt new file mode 100644 index 00000000..903c30d8 --- /dev/null +++ b/MultiPhysics/Poroelasticity/FiniteElasticityFluidPressure/Cantilever/Fortran/CMakeLists.txt @@ -0,0 +1,60 @@ + +# Add example executable +add_executable(Cantilever src/CantileverExample.f90) + +# Turn on Fortran preprocessing (#include directives) +if (MSVC) + set(PROC_OPT "/fpp") +else() + set(PROC_OPT "-cpp") +endif() + +# in debug mode, add flag that make Floating point exceptions fatal +set(OPT "") +if (FALSE) + if(CMAKE_BUILD_TYPE MATCHES DEBUG) + set(OPT "-ffpe-trap=invalid,zero,underflow,overflow,denormal") # GCC: make floating point exceptions fatal + endif() +endif() + +target_compile_options(Cantilever PRIVATE ${PROC_OPT} ${OPT} "-fbacktrace") + +# Link to opencmiss +# ----------------- +# +# This simply uses the opencmiss target created by OC_INIT() above. +# +# Alternatively, you can also directly invoke 'find_package(Iron )' 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 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(Cantilever PRIVATE opencmiss) + +# Add a simple test that runs the executable +add_test(NAME test_Cantilever COMMAND Cantilever) +add_opencmiss_environment(test_Cantilever) + +################### +# 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. +# diff --git a/MultiPhysics/Poroelasticity/FiniteElasticityFluidPressure/Cantilever/src/CantileverExample.f90 b/MultiPhysics/Poroelasticity/FiniteElasticityFluidPressure/Cantilever/Fortran/src/CantileverExample.f90 similarity index 100% rename from MultiPhysics/Poroelasticity/FiniteElasticityFluidPressure/Cantilever/src/CantileverExample.f90 rename to MultiPhysics/Poroelasticity/FiniteElasticityFluidPressure/Cantilever/Fortran/src/CantileverExample.f90 diff --git a/MultiPhysics/Poroelasticity/FiniteElasticityFluidPressure/Cantilever/OpenCMISS.cmake b/MultiPhysics/Poroelasticity/FiniteElasticityFluidPressure/Cantilever/OpenCMISS.cmake new file mode 100644 index 00000000..3d6cf515 --- /dev/null +++ b/MultiPhysics/Poroelasticity/FiniteElasticityFluidPressure/Cantilever/OpenCMISS.cmake @@ -0,0 +1,95 @@ +########################### +# *DO NOT CHANGE THIS FILE* +########################### +# +# Prepares the use of OpenCMISS by scanning at various path locations for OpenCMISS (SDK) installations. +# +# Search order: +# - OPENCMISS_INSTALL_DIR variable +# - OPENCMISS_INSTALL_DIR environment variable +# - OPENCMISS_SDK_DIR variable +# - OPENCMISS_SDK_DIR environment variable +# - [Windows only] The Registry is searched additionally for installed SDKs. +# +# If found +# - Includes the toolchain config script of the found opencmiss installation to enable toolchain selection logic (non-windows) + +# Convenience: The OPENCMISS_INSTALL_DIR may also be defined in the environment and various other places +if (DEFINED OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using specified installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The specified OPENCMISS_INSTALL_DIR '${OPENCMISS_INSTALL_DIR}' does not exist. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_INSTALL_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_INSTALL_DIR}" OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using environment installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The environment variable OPENCMISS_INSTALL_DIR='${OPENCMISS_INSTALL_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if (NOT OPENCMISS_INSTALL_DIR AND DEFINED OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The specified OPENCMISS_SDK_DIR '${OPENCMISS_SDK_DIR}' does not exist. Skipping.") + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_SDK_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_SDK_DIR}" OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using environment SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The environment variable OPENCMISS_SDK_DIR='${OPENCMISS_SDK_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_SDK_DIR) + endif() +endif() +# On windows: check the registry for installed OpenCMISS SDKs +if(NOT OPENCMISS_INSTALL_DIR AND WIN32) + foreach(ROOT HKEY_CURRENT_USER HKEY_LOCAL_MACHINE) + foreach(PACKAGE OpenCMISSUserSDK OpenCMISSDeveloperSDK) + set(_REG_KEY "[${ROOT}\\Software\\Auckland Bioengineering Institute\\${PACKAGE}]") + get_filename_component(OPENCMISS_INSTALL_DIR "${_REG_KEY}" ABSOLUTE) + #message(STATUS "Trying registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Found ${PACKAGE} in Windows registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + break() + else() + unset(OPENCMISS_INSTALL_DIR) + endif() + endforeach() + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + break() + endif() + endforeach() +endif() + +if(OPENCMISS_INSTALL_DIR) + message(STATUS "OPENCMISS_INSTALL_DIR=${OPENCMISS_INSTALL_DIR}") + # Use the OpenCMISS scripts to also allow choosing a separate toolchain + # This file is located at the opencmiss installation rather than the local example + # as it avoids file replication and makes maintenance much easier + if (TOOLCHAIN) + set(_OCTC ${OPENCMISS_INSTALL_DIR}/cmake/OCToolchainCompilers.cmake) + if (EXISTS "${_OCTC}") + include(${_OCTC}) + else() + message(WARNING "TOOLCHAIN specified but OpenCMISS config script could not be found at ${_OCTC}. Trying CMake defaults.") + endif() + unset(_OCTC) + endif() + set(OpenCMISS_DIR "${OPENCMISS_INSTALL_DIR}" CACHE PATH "Path to the found OpenCMISS (SDK) installation") +else() + message(WARNING "No OpenCMISS (SDK) installation directory detected. Using default system environment.") +endif() + \ No newline at end of file diff --git a/MultiPhysics/Poroelasticity/FiniteElasticityFluidPressure/Cantilever/build_debug/build.sh b/MultiPhysics/Poroelasticity/FiniteElasticityFluidPressure/Cantilever/build_debug/build.sh new file mode 100644 index 00000000..e6624bac --- /dev/null +++ b/MultiPhysics/Poroelasticity/FiniteElasticityFluidPressure/Cantilever/build_debug/build.sh @@ -0,0 +1,2 @@ +#ccc && cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all +cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all diff --git a/MultiPhysics/Poroelasticity/FiniteElasticityFluidPressure/StaticExtension/CMakeLists.txt b/MultiPhysics/Poroelasticity/FiniteElasticityFluidPressure/StaticExtension/CMakeLists.txt new file mode 100644 index 00000000..a22b61ee --- /dev/null +++ b/MultiPhysics/Poroelasticity/FiniteElasticityFluidPressure/StaticExtension/CMakeLists.txt @@ -0,0 +1,35 @@ +# 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 C) +enable_language(Fortran OPTIONAL) +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 +# ---------------------- +#add_subdirectory(C) +if (CMAKE_Fortran_COMPILER) + add_subdirectory(Fortran) +endif() diff --git a/MultiPhysics/Poroelasticity/FiniteElasticityFluidPressure/StaticExtension/Fortran/CMakeLists.txt b/MultiPhysics/Poroelasticity/FiniteElasticityFluidPressure/StaticExtension/Fortran/CMakeLists.txt new file mode 100644 index 00000000..7f48f045 --- /dev/null +++ b/MultiPhysics/Poroelasticity/FiniteElasticityFluidPressure/StaticExtension/Fortran/CMakeLists.txt @@ -0,0 +1,60 @@ + +# Add example executable +add_executable(StaticExtension src/StaticExtensionExample.f90) + +# Turn on Fortran preprocessing (#include directives) +if (MSVC) + set(PROC_OPT "/fpp") +else() + set(PROC_OPT "-cpp") +endif() + +# in debug mode, add flag that make Floating point exceptions fatal +set(OPT "") +if (FALSE) + if(CMAKE_BUILD_TYPE MATCHES DEBUG) + set(OPT "-ffpe-trap=invalid,zero,underflow,overflow,denormal") # GCC: make floating point exceptions fatal + endif() +endif() + +target_compile_options(StaticExtension PRIVATE ${PROC_OPT} ${OPT} "-fbacktrace") + +# Link to opencmiss +# ----------------- +# +# This simply uses the opencmiss target created by OC_INIT() above. +# +# Alternatively, you can also directly invoke 'find_package(Iron )' 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 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(StaticExtension PRIVATE opencmiss) + +# Add a simple test that runs the executable +add_test(NAME test_StaticExtension COMMAND StaticExtension) +add_opencmiss_environment(test_StaticExtension) + +################### +# 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. +# diff --git a/MultiPhysics/Poroelasticity/FiniteElasticityFluidPressure/StaticExtension/src/StaticExtensionExample.f90 b/MultiPhysics/Poroelasticity/FiniteElasticityFluidPressure/StaticExtension/Fortran/src/StaticExtensionExample.f90 similarity index 100% rename from MultiPhysics/Poroelasticity/FiniteElasticityFluidPressure/StaticExtension/src/StaticExtensionExample.f90 rename to MultiPhysics/Poroelasticity/FiniteElasticityFluidPressure/StaticExtension/Fortran/src/StaticExtensionExample.f90 diff --git a/MultiPhysics/Poroelasticity/FiniteElasticityFluidPressure/StaticExtension/OpenCMISS.cmake b/MultiPhysics/Poroelasticity/FiniteElasticityFluidPressure/StaticExtension/OpenCMISS.cmake new file mode 100644 index 00000000..3d6cf515 --- /dev/null +++ b/MultiPhysics/Poroelasticity/FiniteElasticityFluidPressure/StaticExtension/OpenCMISS.cmake @@ -0,0 +1,95 @@ +########################### +# *DO NOT CHANGE THIS FILE* +########################### +# +# Prepares the use of OpenCMISS by scanning at various path locations for OpenCMISS (SDK) installations. +# +# Search order: +# - OPENCMISS_INSTALL_DIR variable +# - OPENCMISS_INSTALL_DIR environment variable +# - OPENCMISS_SDK_DIR variable +# - OPENCMISS_SDK_DIR environment variable +# - [Windows only] The Registry is searched additionally for installed SDKs. +# +# If found +# - Includes the toolchain config script of the found opencmiss installation to enable toolchain selection logic (non-windows) + +# Convenience: The OPENCMISS_INSTALL_DIR may also be defined in the environment and various other places +if (DEFINED OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using specified installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The specified OPENCMISS_INSTALL_DIR '${OPENCMISS_INSTALL_DIR}' does not exist. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_INSTALL_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_INSTALL_DIR}" OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using environment installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The environment variable OPENCMISS_INSTALL_DIR='${OPENCMISS_INSTALL_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if (NOT OPENCMISS_INSTALL_DIR AND DEFINED OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The specified OPENCMISS_SDK_DIR '${OPENCMISS_SDK_DIR}' does not exist. Skipping.") + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_SDK_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_SDK_DIR}" OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using environment SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The environment variable OPENCMISS_SDK_DIR='${OPENCMISS_SDK_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_SDK_DIR) + endif() +endif() +# On windows: check the registry for installed OpenCMISS SDKs +if(NOT OPENCMISS_INSTALL_DIR AND WIN32) + foreach(ROOT HKEY_CURRENT_USER HKEY_LOCAL_MACHINE) + foreach(PACKAGE OpenCMISSUserSDK OpenCMISSDeveloperSDK) + set(_REG_KEY "[${ROOT}\\Software\\Auckland Bioengineering Institute\\${PACKAGE}]") + get_filename_component(OPENCMISS_INSTALL_DIR "${_REG_KEY}" ABSOLUTE) + #message(STATUS "Trying registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Found ${PACKAGE} in Windows registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + break() + else() + unset(OPENCMISS_INSTALL_DIR) + endif() + endforeach() + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + break() + endif() + endforeach() +endif() + +if(OPENCMISS_INSTALL_DIR) + message(STATUS "OPENCMISS_INSTALL_DIR=${OPENCMISS_INSTALL_DIR}") + # Use the OpenCMISS scripts to also allow choosing a separate toolchain + # This file is located at the opencmiss installation rather than the local example + # as it avoids file replication and makes maintenance much easier + if (TOOLCHAIN) + set(_OCTC ${OPENCMISS_INSTALL_DIR}/cmake/OCToolchainCompilers.cmake) + if (EXISTS "${_OCTC}") + include(${_OCTC}) + else() + message(WARNING "TOOLCHAIN specified but OpenCMISS config script could not be found at ${_OCTC}. Trying CMake defaults.") + endif() + unset(_OCTC) + endif() + set(OpenCMISS_DIR "${OPENCMISS_INSTALL_DIR}" CACHE PATH "Path to the found OpenCMISS (SDK) installation") +else() + message(WARNING "No OpenCMISS (SDK) installation directory detected. Using default system environment.") +endif() + \ No newline at end of file diff --git a/MultiPhysics/Poroelasticity/FiniteElasticityFluidPressure/StaticExtension/build_debug/build.sh b/MultiPhysics/Poroelasticity/FiniteElasticityFluidPressure/StaticExtension/build_debug/build.sh new file mode 100644 index 00000000..e6624bac --- /dev/null +++ b/MultiPhysics/Poroelasticity/FiniteElasticityFluidPressure/StaticExtension/build_debug/build.sh @@ -0,0 +1,2 @@ +#ccc && cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all +cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all diff --git a/TwoRegions/CMakeLists.txt b/TwoRegions/CMakeLists.txt new file mode 100644 index 00000000..a22b61ee --- /dev/null +++ b/TwoRegions/CMakeLists.txt @@ -0,0 +1,35 @@ +# 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 C) +enable_language(Fortran OPTIONAL) +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 +# ---------------------- +#add_subdirectory(C) +if (CMAKE_Fortran_COMPILER) + add_subdirectory(Fortran) +endif() diff --git a/TwoRegions/Fortran/CMakeLists.txt b/TwoRegions/Fortran/CMakeLists.txt new file mode 100644 index 00000000..6cf55aca --- /dev/null +++ b/TwoRegions/Fortran/CMakeLists.txt @@ -0,0 +1,60 @@ + +# Add example executable +add_executable(TwoRegions src/TwoRegionsExample.f90) + +# Turn on Fortran preprocessing (#include directives) +if (MSVC) + set(PROC_OPT "/fpp") +else() + set(PROC_OPT "-cpp") +endif() + +# in debug mode, add flag that make Floating point exceptions fatal +set(OPT "") +if (FALSE) + if(CMAKE_BUILD_TYPE MATCHES DEBUG) + set(OPT "-ffpe-trap=invalid,zero,underflow,overflow,denormal") # GCC: make floating point exceptions fatal + endif() +endif() + +target_compile_options(TwoRegions PRIVATE ${PROC_OPT} ${OPT} "-fbacktrace") + +# Link to opencmiss +# ----------------- +# +# This simply uses the opencmiss target created by OC_INIT() above. +# +# Alternatively, you can also directly invoke 'find_package(Iron )' 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 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(TwoRegions PRIVATE opencmiss) + +# Add a simple test that runs the executable +add_test(NAME test_TwoRegions COMMAND TwoRegions) +add_opencmiss_environment(test_TwoRegions) + +################### +# 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. +# diff --git a/TwoRegions/src/TwoRegionsExample.f90 b/TwoRegions/Fortran/src/TwoRegionsExample.f90 similarity index 100% rename from TwoRegions/src/TwoRegionsExample.f90 rename to TwoRegions/Fortran/src/TwoRegionsExample.f90 diff --git a/TwoRegions/OpenCMISS.cmake b/TwoRegions/OpenCMISS.cmake new file mode 100644 index 00000000..3d6cf515 --- /dev/null +++ b/TwoRegions/OpenCMISS.cmake @@ -0,0 +1,95 @@ +########################### +# *DO NOT CHANGE THIS FILE* +########################### +# +# Prepares the use of OpenCMISS by scanning at various path locations for OpenCMISS (SDK) installations. +# +# Search order: +# - OPENCMISS_INSTALL_DIR variable +# - OPENCMISS_INSTALL_DIR environment variable +# - OPENCMISS_SDK_DIR variable +# - OPENCMISS_SDK_DIR environment variable +# - [Windows only] The Registry is searched additionally for installed SDKs. +# +# If found +# - Includes the toolchain config script of the found opencmiss installation to enable toolchain selection logic (non-windows) + +# Convenience: The OPENCMISS_INSTALL_DIR may also be defined in the environment and various other places +if (DEFINED OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using specified installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The specified OPENCMISS_INSTALL_DIR '${OPENCMISS_INSTALL_DIR}' does not exist. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_INSTALL_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_INSTALL_DIR}" OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using environment installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The environment variable OPENCMISS_INSTALL_DIR='${OPENCMISS_INSTALL_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if (NOT OPENCMISS_INSTALL_DIR AND DEFINED OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The specified OPENCMISS_SDK_DIR '${OPENCMISS_SDK_DIR}' does not exist. Skipping.") + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_SDK_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_SDK_DIR}" OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using environment SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The environment variable OPENCMISS_SDK_DIR='${OPENCMISS_SDK_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_SDK_DIR) + endif() +endif() +# On windows: check the registry for installed OpenCMISS SDKs +if(NOT OPENCMISS_INSTALL_DIR AND WIN32) + foreach(ROOT HKEY_CURRENT_USER HKEY_LOCAL_MACHINE) + foreach(PACKAGE OpenCMISSUserSDK OpenCMISSDeveloperSDK) + set(_REG_KEY "[${ROOT}\\Software\\Auckland Bioengineering Institute\\${PACKAGE}]") + get_filename_component(OPENCMISS_INSTALL_DIR "${_REG_KEY}" ABSOLUTE) + #message(STATUS "Trying registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Found ${PACKAGE} in Windows registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + break() + else() + unset(OPENCMISS_INSTALL_DIR) + endif() + endforeach() + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + break() + endif() + endforeach() +endif() + +if(OPENCMISS_INSTALL_DIR) + message(STATUS "OPENCMISS_INSTALL_DIR=${OPENCMISS_INSTALL_DIR}") + # Use the OpenCMISS scripts to also allow choosing a separate toolchain + # This file is located at the opencmiss installation rather than the local example + # as it avoids file replication and makes maintenance much easier + if (TOOLCHAIN) + set(_OCTC ${OPENCMISS_INSTALL_DIR}/cmake/OCToolchainCompilers.cmake) + if (EXISTS "${_OCTC}") + include(${_OCTC}) + else() + message(WARNING "TOOLCHAIN specified but OpenCMISS config script could not be found at ${_OCTC}. Trying CMake defaults.") + endif() + unset(_OCTC) + endif() + set(OpenCMISS_DIR "${OPENCMISS_INSTALL_DIR}" CACHE PATH "Path to the found OpenCMISS (SDK) installation") +else() + message(WARNING "No OpenCMISS (SDK) installation directory detected. Using default system environment.") +endif() + \ No newline at end of file diff --git a/TwoRegions/build_debug/build.sh b/TwoRegions/build_debug/build.sh new file mode 100644 index 00000000..e6624bac --- /dev/null +++ b/TwoRegions/build_debug/build.sh @@ -0,0 +1,2 @@ +#ccc && cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all +cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all diff --git a/cellml/CMakeLists.txt b/cellml/CMakeLists.txt new file mode 100644 index 00000000..a22b61ee --- /dev/null +++ b/cellml/CMakeLists.txt @@ -0,0 +1,35 @@ +# 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 C) +enable_language(Fortran OPTIONAL) +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 +# ---------------------- +#add_subdirectory(C) +if (CMAKE_Fortran_COMPILER) + add_subdirectory(Fortran) +endif() diff --git a/cellml/Fortran/CMakeLists.txt b/cellml/Fortran/CMakeLists.txt new file mode 100644 index 00000000..e06c6dff --- /dev/null +++ b/cellml/Fortran/CMakeLists.txt @@ -0,0 +1,60 @@ + +# Add example executable +add_executable(cellml src/FortranExample.f90) + +# Turn on Fortran preprocessing (#include directives) +if (MSVC) + set(PROC_OPT "/fpp") +else() + set(PROC_OPT "-cpp") +endif() + +# in debug mode, add flag that make Floating point exceptions fatal +set(OPT "") +if (FALSE) + if(CMAKE_BUILD_TYPE MATCHES DEBUG) + set(OPT "-ffpe-trap=invalid,zero,underflow,overflow,denormal") # GCC: make floating point exceptions fatal + endif() +endif() + +target_compile_options(cellml PRIVATE ${PROC_OPT} ${OPT} "-fbacktrace") + +# Link to opencmiss +# ----------------- +# +# This simply uses the opencmiss target created by OC_INIT() above. +# +# Alternatively, you can also directly invoke 'find_package(Iron )' 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 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(cellml PRIVATE opencmiss) + +# Add a simple test that runs the executable +add_test(NAME test_cellml COMMAND cellml) +add_opencmiss_environment(test_cellml) + +################### +# 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. +# diff --git a/cellml/OpenCMISS.cmake b/cellml/OpenCMISS.cmake new file mode 100644 index 00000000..3d6cf515 --- /dev/null +++ b/cellml/OpenCMISS.cmake @@ -0,0 +1,95 @@ +########################### +# *DO NOT CHANGE THIS FILE* +########################### +# +# Prepares the use of OpenCMISS by scanning at various path locations for OpenCMISS (SDK) installations. +# +# Search order: +# - OPENCMISS_INSTALL_DIR variable +# - OPENCMISS_INSTALL_DIR environment variable +# - OPENCMISS_SDK_DIR variable +# - OPENCMISS_SDK_DIR environment variable +# - [Windows only] The Registry is searched additionally for installed SDKs. +# +# If found +# - Includes the toolchain config script of the found opencmiss installation to enable toolchain selection logic (non-windows) + +# Convenience: The OPENCMISS_INSTALL_DIR may also be defined in the environment and various other places +if (DEFINED OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using specified installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The specified OPENCMISS_INSTALL_DIR '${OPENCMISS_INSTALL_DIR}' does not exist. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_INSTALL_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_INSTALL_DIR}" OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using environment installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The environment variable OPENCMISS_INSTALL_DIR='${OPENCMISS_INSTALL_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if (NOT OPENCMISS_INSTALL_DIR AND DEFINED OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The specified OPENCMISS_SDK_DIR '${OPENCMISS_SDK_DIR}' does not exist. Skipping.") + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_SDK_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_SDK_DIR}" OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using environment SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The environment variable OPENCMISS_SDK_DIR='${OPENCMISS_SDK_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_SDK_DIR) + endif() +endif() +# On windows: check the registry for installed OpenCMISS SDKs +if(NOT OPENCMISS_INSTALL_DIR AND WIN32) + foreach(ROOT HKEY_CURRENT_USER HKEY_LOCAL_MACHINE) + foreach(PACKAGE OpenCMISSUserSDK OpenCMISSDeveloperSDK) + set(_REG_KEY "[${ROOT}\\Software\\Auckland Bioengineering Institute\\${PACKAGE}]") + get_filename_component(OPENCMISS_INSTALL_DIR "${_REG_KEY}" ABSOLUTE) + #message(STATUS "Trying registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Found ${PACKAGE} in Windows registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + break() + else() + unset(OPENCMISS_INSTALL_DIR) + endif() + endforeach() + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + break() + endif() + endforeach() +endif() + +if(OPENCMISS_INSTALL_DIR) + message(STATUS "OPENCMISS_INSTALL_DIR=${OPENCMISS_INSTALL_DIR}") + # Use the OpenCMISS scripts to also allow choosing a separate toolchain + # This file is located at the opencmiss installation rather than the local example + # as it avoids file replication and makes maintenance much easier + if (TOOLCHAIN) + set(_OCTC ${OPENCMISS_INSTALL_DIR}/cmake/OCToolchainCompilers.cmake) + if (EXISTS "${_OCTC}") + include(${_OCTC}) + else() + message(WARNING "TOOLCHAIN specified but OpenCMISS config script could not be found at ${_OCTC}. Trying CMake defaults.") + endif() + unset(_OCTC) + endif() + set(OpenCMISS_DIR "${OPENCMISS_INSTALL_DIR}" CACHE PATH "Path to the found OpenCMISS (SDK) installation") +else() + message(WARNING "No OpenCMISS (SDK) installation directory detected. Using default system environment.") +endif() + \ No newline at end of file diff --git a/cellml/build_debug/build.sh b/cellml/build_debug/build.sh new file mode 100644 index 00000000..e6624bac --- /dev/null +++ b/cellml/build_debug/build.sh @@ -0,0 +1,2 @@ +#ccc && cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all +cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all diff --git a/cellml/model-integration/CMakeLists.txt b/cellml/model-integration/CMakeLists.txt new file mode 100644 index 00000000..a22b61ee --- /dev/null +++ b/cellml/model-integration/CMakeLists.txt @@ -0,0 +1,35 @@ +# 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 C) +enable_language(Fortran OPTIONAL) +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 +# ---------------------- +#add_subdirectory(C) +if (CMAKE_Fortran_COMPILER) + add_subdirectory(Fortran) +endif() diff --git a/cellml/model-integration/Fortran/CMakeLists.txt b/cellml/model-integration/Fortran/CMakeLists.txt new file mode 100644 index 00000000..9ff021fe --- /dev/null +++ b/cellml/model-integration/Fortran/CMakeLists.txt @@ -0,0 +1,60 @@ + +# Add example executable +add_executable(model-integration src/FortranExample.f90) + +# Turn on Fortran preprocessing (#include directives) +if (MSVC) + set(PROC_OPT "/fpp") +else() + set(PROC_OPT "-cpp") +endif() + +# in debug mode, add flag that make Floating point exceptions fatal +set(OPT "") +if (FALSE) + if(CMAKE_BUILD_TYPE MATCHES DEBUG) + set(OPT "-ffpe-trap=invalid,zero,underflow,overflow,denormal") # GCC: make floating point exceptions fatal + endif() +endif() + +target_compile_options(model-integration PRIVATE ${PROC_OPT} ${OPT} "-fbacktrace") + +# Link to opencmiss +# ----------------- +# +# This simply uses the opencmiss target created by OC_INIT() above. +# +# Alternatively, you can also directly invoke 'find_package(Iron )' 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 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(model-integration PRIVATE opencmiss) + +# Add a simple test that runs the executable +add_test(NAME test_model-integration COMMAND model-integration) +add_opencmiss_environment(test_model-integration) + +################### +# 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. +# diff --git a/cellml/model-integration/OpenCMISS.cmake b/cellml/model-integration/OpenCMISS.cmake new file mode 100644 index 00000000..3d6cf515 --- /dev/null +++ b/cellml/model-integration/OpenCMISS.cmake @@ -0,0 +1,95 @@ +########################### +# *DO NOT CHANGE THIS FILE* +########################### +# +# Prepares the use of OpenCMISS by scanning at various path locations for OpenCMISS (SDK) installations. +# +# Search order: +# - OPENCMISS_INSTALL_DIR variable +# - OPENCMISS_INSTALL_DIR environment variable +# - OPENCMISS_SDK_DIR variable +# - OPENCMISS_SDK_DIR environment variable +# - [Windows only] The Registry is searched additionally for installed SDKs. +# +# If found +# - Includes the toolchain config script of the found opencmiss installation to enable toolchain selection logic (non-windows) + +# Convenience: The OPENCMISS_INSTALL_DIR may also be defined in the environment and various other places +if (DEFINED OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using specified installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The specified OPENCMISS_INSTALL_DIR '${OPENCMISS_INSTALL_DIR}' does not exist. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_INSTALL_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_INSTALL_DIR}" OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using environment installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The environment variable OPENCMISS_INSTALL_DIR='${OPENCMISS_INSTALL_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if (NOT OPENCMISS_INSTALL_DIR AND DEFINED OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The specified OPENCMISS_SDK_DIR '${OPENCMISS_SDK_DIR}' does not exist. Skipping.") + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_SDK_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_SDK_DIR}" OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using environment SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The environment variable OPENCMISS_SDK_DIR='${OPENCMISS_SDK_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_SDK_DIR) + endif() +endif() +# On windows: check the registry for installed OpenCMISS SDKs +if(NOT OPENCMISS_INSTALL_DIR AND WIN32) + foreach(ROOT HKEY_CURRENT_USER HKEY_LOCAL_MACHINE) + foreach(PACKAGE OpenCMISSUserSDK OpenCMISSDeveloperSDK) + set(_REG_KEY "[${ROOT}\\Software\\Auckland Bioengineering Institute\\${PACKAGE}]") + get_filename_component(OPENCMISS_INSTALL_DIR "${_REG_KEY}" ABSOLUTE) + #message(STATUS "Trying registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Found ${PACKAGE} in Windows registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + break() + else() + unset(OPENCMISS_INSTALL_DIR) + endif() + endforeach() + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + break() + endif() + endforeach() +endif() + +if(OPENCMISS_INSTALL_DIR) + message(STATUS "OPENCMISS_INSTALL_DIR=${OPENCMISS_INSTALL_DIR}") + # Use the OpenCMISS scripts to also allow choosing a separate toolchain + # This file is located at the opencmiss installation rather than the local example + # as it avoids file replication and makes maintenance much easier + if (TOOLCHAIN) + set(_OCTC ${OPENCMISS_INSTALL_DIR}/cmake/OCToolchainCompilers.cmake) + if (EXISTS "${_OCTC}") + include(${_OCTC}) + else() + message(WARNING "TOOLCHAIN specified but OpenCMISS config script could not be found at ${_OCTC}. Trying CMake defaults.") + endif() + unset(_OCTC) + endif() + set(OpenCMISS_DIR "${OPENCMISS_INSTALL_DIR}" CACHE PATH "Path to the found OpenCMISS (SDK) installation") +else() + message(WARNING "No OpenCMISS (SDK) installation directory detected. Using default system environment.") +endif() + \ No newline at end of file diff --git a/cellml/model-integration/build_debug/build.sh b/cellml/model-integration/build_debug/build.sh new file mode 100644 index 00000000..e6624bac --- /dev/null +++ b/cellml/model-integration/build_debug/build.sh @@ -0,0 +1,2 @@ +#ccc && cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all +cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all diff --git a/define-geometry-and-export/CMakeLists.txt b/define-geometry-and-export/CMakeLists.txt new file mode 100644 index 00000000..a22b61ee --- /dev/null +++ b/define-geometry-and-export/CMakeLists.txt @@ -0,0 +1,35 @@ +# 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 C) +enable_language(Fortran OPTIONAL) +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 +# ---------------------- +#add_subdirectory(C) +if (CMAKE_Fortran_COMPILER) + add_subdirectory(Fortran) +endif() diff --git a/define-geometry-and-export/Fortran/CMakeLists.txt b/define-geometry-and-export/Fortran/CMakeLists.txt new file mode 100644 index 00000000..ebe0ede0 --- /dev/null +++ b/define-geometry-and-export/Fortran/CMakeLists.txt @@ -0,0 +1,60 @@ + +# Add example executable +add_executable(define-geometry-and-export src/define-geometry-and-exportExample.f90) + +# Turn on Fortran preprocessing (#include directives) +if (MSVC) + set(PROC_OPT "/fpp") +else() + set(PROC_OPT "-cpp") +endif() + +# in debug mode, add flag that make Floating point exceptions fatal +set(OPT "") +if (FALSE) + if(CMAKE_BUILD_TYPE MATCHES DEBUG) + set(OPT "-ffpe-trap=invalid,zero,underflow,overflow,denormal") # GCC: make floating point exceptions fatal + endif() +endif() + +target_compile_options(define-geometry-and-export PRIVATE ${PROC_OPT} ${OPT} "-fbacktrace") + +# Link to opencmiss +# ----------------- +# +# This simply uses the opencmiss target created by OC_INIT() above. +# +# Alternatively, you can also directly invoke 'find_package(Iron )' 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 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(define-geometry-and-export PRIVATE opencmiss) + +# Add a simple test that runs the executable +add_test(NAME test_define-geometry-and-export COMMAND define-geometry-and-export) +add_opencmiss_environment(test_define-geometry-and-export) + +################### +# 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. +# diff --git a/define-geometry-and-export/src/define-geometry-and-exportExample.f90 b/define-geometry-and-export/Fortran/src/define-geometry-and-exportExample.f90 similarity index 100% rename from define-geometry-and-export/src/define-geometry-and-exportExample.f90 rename to define-geometry-and-export/Fortran/src/define-geometry-and-exportExample.f90 diff --git a/define-geometry-and-export/OpenCMISS.cmake b/define-geometry-and-export/OpenCMISS.cmake new file mode 100644 index 00000000..3d6cf515 --- /dev/null +++ b/define-geometry-and-export/OpenCMISS.cmake @@ -0,0 +1,95 @@ +########################### +# *DO NOT CHANGE THIS FILE* +########################### +# +# Prepares the use of OpenCMISS by scanning at various path locations for OpenCMISS (SDK) installations. +# +# Search order: +# - OPENCMISS_INSTALL_DIR variable +# - OPENCMISS_INSTALL_DIR environment variable +# - OPENCMISS_SDK_DIR variable +# - OPENCMISS_SDK_DIR environment variable +# - [Windows only] The Registry is searched additionally for installed SDKs. +# +# If found +# - Includes the toolchain config script of the found opencmiss installation to enable toolchain selection logic (non-windows) + +# Convenience: The OPENCMISS_INSTALL_DIR may also be defined in the environment and various other places +if (DEFINED OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using specified installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The specified OPENCMISS_INSTALL_DIR '${OPENCMISS_INSTALL_DIR}' does not exist. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_INSTALL_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_INSTALL_DIR}" OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using environment installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The environment variable OPENCMISS_INSTALL_DIR='${OPENCMISS_INSTALL_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if (NOT OPENCMISS_INSTALL_DIR AND DEFINED OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The specified OPENCMISS_SDK_DIR '${OPENCMISS_SDK_DIR}' does not exist. Skipping.") + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_SDK_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_SDK_DIR}" OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using environment SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The environment variable OPENCMISS_SDK_DIR='${OPENCMISS_SDK_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_SDK_DIR) + endif() +endif() +# On windows: check the registry for installed OpenCMISS SDKs +if(NOT OPENCMISS_INSTALL_DIR AND WIN32) + foreach(ROOT HKEY_CURRENT_USER HKEY_LOCAL_MACHINE) + foreach(PACKAGE OpenCMISSUserSDK OpenCMISSDeveloperSDK) + set(_REG_KEY "[${ROOT}\\Software\\Auckland Bioengineering Institute\\${PACKAGE}]") + get_filename_component(OPENCMISS_INSTALL_DIR "${_REG_KEY}" ABSOLUTE) + #message(STATUS "Trying registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Found ${PACKAGE} in Windows registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + break() + else() + unset(OPENCMISS_INSTALL_DIR) + endif() + endforeach() + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + break() + endif() + endforeach() +endif() + +if(OPENCMISS_INSTALL_DIR) + message(STATUS "OPENCMISS_INSTALL_DIR=${OPENCMISS_INSTALL_DIR}") + # Use the OpenCMISS scripts to also allow choosing a separate toolchain + # This file is located at the opencmiss installation rather than the local example + # as it avoids file replication and makes maintenance much easier + if (TOOLCHAIN) + set(_OCTC ${OPENCMISS_INSTALL_DIR}/cmake/OCToolchainCompilers.cmake) + if (EXISTS "${_OCTC}") + include(${_OCTC}) + else() + message(WARNING "TOOLCHAIN specified but OpenCMISS config script could not be found at ${_OCTC}. Trying CMake defaults.") + endif() + unset(_OCTC) + endif() + set(OpenCMISS_DIR "${OPENCMISS_INSTALL_DIR}" CACHE PATH "Path to the found OpenCMISS (SDK) installation") +else() + message(WARNING "No OpenCMISS (SDK) installation directory detected. Using default system environment.") +endif() + \ No newline at end of file diff --git a/define-geometry-and-export/build_debug/build.sh b/define-geometry-and-export/build_debug/build.sh new file mode 100644 index 00000000..e6624bac --- /dev/null +++ b/define-geometry-and-export/build_debug/build.sh @@ -0,0 +1,2 @@ +#ccc && cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all +cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all diff --git a/scripts/create_cmakefiles.py b/scripts/create_cmakefiles.py new file mode 100755 index 00000000..522ef4a1 --- /dev/null +++ b/scripts/create_cmakefiles.py @@ -0,0 +1,114 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +import sys +import numpy as np +import matplotlib.pyplot as plt +import csv +import collections +import copy +from sets import Set +import os +from shutil import copyfile + +cmake_content = """ +# Add example executable +add_executable({executable_name} {src}) + +# Turn on Fortran preprocessing (#include directives) +if (MSVC) + set(PROC_OPT "/fpp") +else() + set(PROC_OPT "-cpp") +endif() + +# in debug mode, add flag that make Floating point exceptions fatal +set(OPT "") +if (FALSE) + if(CMAKE_BUILD_TYPE MATCHES DEBUG) + set(OPT "-ffpe-trap=invalid,zero,underflow,overflow,denormal") # GCC: make floating point exceptions fatal + endif() +endif() + +target_compile_options({executable_name} PRIVATE ${PROC_OPT} ${OPT} "-fbacktrace") + +# Link to opencmiss +# ----------------- +# +# This simply uses the opencmiss target created by OC_INIT() above. +# +# Alternatively, you can also directly invoke 'find_package(Iron )' 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 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({executable_name} PRIVATE opencmiss) + +# Add a simple test that runs the executable +add_test(NAME test_{executable_name} COMMAND {executable_name}) +add_opencmiss_environment(test_{executable_name}) + +################### +# 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. +# +""" + + +for (dirpath, subdirectories, filenames) in os.walk(".."): + print "directory {}".format(dirpath) + src_found = False + if "src" in subdirectories: + directory_content = os.listdir(os.path.join(dirpath, "src")) + if os.path.basename(dirpath) != "Fortran": + #os.mkdir("Fortran") + print 'rename "{}" to "{}"'.format(os.path.join(dirpath,"src"), os.path.join(dirpath,"Fortran","src")) + try: + os.mkdir(os.path.join(dirpath,"Fortran")) + except: + pass + os.rename(os.path.join(dirpath,"src"), os.path.join(dirpath,"Fortran","src")) + src_found = True + + if "Fortran" in subdirectories: + src_found = True + + if src_found: + print "process directory {}".format(dirpath) + + + copyfile("resources/CMakeLists-1.txt", os.path.join(dirpath,"CMakeLists.txt")) + copyfile("resources/OpenCMISS.cmake", os.path.join(dirpath,"OpenCMISS.cmake")) + + src_files = os.listdir(os.path.join(dirpath, "Fortran","src")) + src_string = "" + for filename in src_files: + src_string += " src/"+filename + executable_name = os.path.basename(dirpath) + + with open(os.path.join(dirpath,"Fortran","CMakeLists.txt"),'w') as file: + file.write(cmake_content.format(src=src_string, executable_name=executable_name, PROC_OPT="{PROC_OPT}", OPT="{OPT}", EXAMPLE_BINARY="{EXAMPLE_BINARY}")) + + try: + os.mkdir(os.path.join(dirpath,"build_debug")) + except: + pass + copyfile("resources/build.sh", os.path.join(dirpath,"build_debug","build.sh")) diff --git a/scripts/resources/CMakeLists-1.txt b/scripts/resources/CMakeLists-1.txt new file mode 100644 index 00000000..a22b61ee --- /dev/null +++ b/scripts/resources/CMakeLists-1.txt @@ -0,0 +1,35 @@ +# 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 C) +enable_language(Fortran OPTIONAL) +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 +# ---------------------- +#add_subdirectory(C) +if (CMAKE_Fortran_COMPILER) + add_subdirectory(Fortran) +endif() diff --git a/scripts/resources/OpenCMISS.cmake b/scripts/resources/OpenCMISS.cmake new file mode 100644 index 00000000..3d6cf515 --- /dev/null +++ b/scripts/resources/OpenCMISS.cmake @@ -0,0 +1,95 @@ +########################### +# *DO NOT CHANGE THIS FILE* +########################### +# +# Prepares the use of OpenCMISS by scanning at various path locations for OpenCMISS (SDK) installations. +# +# Search order: +# - OPENCMISS_INSTALL_DIR variable +# - OPENCMISS_INSTALL_DIR environment variable +# - OPENCMISS_SDK_DIR variable +# - OPENCMISS_SDK_DIR environment variable +# - [Windows only] The Registry is searched additionally for installed SDKs. +# +# If found +# - Includes the toolchain config script of the found opencmiss installation to enable toolchain selection logic (non-windows) + +# Convenience: The OPENCMISS_INSTALL_DIR may also be defined in the environment and various other places +if (DEFINED OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using specified installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The specified OPENCMISS_INSTALL_DIR '${OPENCMISS_INSTALL_DIR}' does not exist. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_INSTALL_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_INSTALL_DIR}" OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using environment installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The environment variable OPENCMISS_INSTALL_DIR='${OPENCMISS_INSTALL_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if (NOT OPENCMISS_INSTALL_DIR AND DEFINED OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The specified OPENCMISS_SDK_DIR '${OPENCMISS_SDK_DIR}' does not exist. Skipping.") + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_SDK_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_SDK_DIR}" OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using environment SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The environment variable OPENCMISS_SDK_DIR='${OPENCMISS_SDK_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_SDK_DIR) + endif() +endif() +# On windows: check the registry for installed OpenCMISS SDKs +if(NOT OPENCMISS_INSTALL_DIR AND WIN32) + foreach(ROOT HKEY_CURRENT_USER HKEY_LOCAL_MACHINE) + foreach(PACKAGE OpenCMISSUserSDK OpenCMISSDeveloperSDK) + set(_REG_KEY "[${ROOT}\\Software\\Auckland Bioengineering Institute\\${PACKAGE}]") + get_filename_component(OPENCMISS_INSTALL_DIR "${_REG_KEY}" ABSOLUTE) + #message(STATUS "Trying registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Found ${PACKAGE} in Windows registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + break() + else() + unset(OPENCMISS_INSTALL_DIR) + endif() + endforeach() + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + break() + endif() + endforeach() +endif() + +if(OPENCMISS_INSTALL_DIR) + message(STATUS "OPENCMISS_INSTALL_DIR=${OPENCMISS_INSTALL_DIR}") + # Use the OpenCMISS scripts to also allow choosing a separate toolchain + # This file is located at the opencmiss installation rather than the local example + # as it avoids file replication and makes maintenance much easier + if (TOOLCHAIN) + set(_OCTC ${OPENCMISS_INSTALL_DIR}/cmake/OCToolchainCompilers.cmake) + if (EXISTS "${_OCTC}") + include(${_OCTC}) + else() + message(WARNING "TOOLCHAIN specified but OpenCMISS config script could not be found at ${_OCTC}. Trying CMake defaults.") + endif() + unset(_OCTC) + endif() + set(OpenCMISS_DIR "${OPENCMISS_INSTALL_DIR}" CACHE PATH "Path to the found OpenCMISS (SDK) installation") +else() + message(WARNING "No OpenCMISS (SDK) installation directory detected. Using default system environment.") +endif() + \ No newline at end of file diff --git a/scripts/resources/build.sh b/scripts/resources/build.sh new file mode 100755 index 00000000..e6624bac --- /dev/null +++ b/scripts/resources/build.sh @@ -0,0 +1,2 @@ +#ccc && cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all +cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all diff --git a/simple-field-manipulation-direct-access/CMakeLists.txt b/simple-field-manipulation-direct-access/CMakeLists.txt new file mode 100644 index 00000000..a22b61ee --- /dev/null +++ b/simple-field-manipulation-direct-access/CMakeLists.txt @@ -0,0 +1,35 @@ +# 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 C) +enable_language(Fortran OPTIONAL) +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 +# ---------------------- +#add_subdirectory(C) +if (CMAKE_Fortran_COMPILER) + add_subdirectory(Fortran) +endif() diff --git a/simple-field-manipulation-direct-access/Fortran/CMakeLists.txt b/simple-field-manipulation-direct-access/Fortran/CMakeLists.txt new file mode 100644 index 00000000..559a1911 --- /dev/null +++ b/simple-field-manipulation-direct-access/Fortran/CMakeLists.txt @@ -0,0 +1,60 @@ + +# Add example executable +add_executable(simple-field-manipulation-direct-access src/simple-field-manipulation-direct-accessExample.f90) + +# Turn on Fortran preprocessing (#include directives) +if (MSVC) + set(PROC_OPT "/fpp") +else() + set(PROC_OPT "-cpp") +endif() + +# in debug mode, add flag that make Floating point exceptions fatal +set(OPT "") +if (FALSE) + if(CMAKE_BUILD_TYPE MATCHES DEBUG) + set(OPT "-ffpe-trap=invalid,zero,underflow,overflow,denormal") # GCC: make floating point exceptions fatal + endif() +endif() + +target_compile_options(simple-field-manipulation-direct-access PRIVATE ${PROC_OPT} ${OPT} "-fbacktrace") + +# Link to opencmiss +# ----------------- +# +# This simply uses the opencmiss target created by OC_INIT() above. +# +# Alternatively, you can also directly invoke 'find_package(Iron )' 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 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(simple-field-manipulation-direct-access PRIVATE opencmiss) + +# Add a simple test that runs the executable +add_test(NAME test_simple-field-manipulation-direct-access COMMAND simple-field-manipulation-direct-access) +add_opencmiss_environment(test_simple-field-manipulation-direct-access) + +################### +# 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. +# diff --git a/simple-field-manipulation-direct-access/src/simple-field-manipulation-direct-accessExample.f90 b/simple-field-manipulation-direct-access/Fortran/src/simple-field-manipulation-direct-accessExample.f90 similarity index 100% rename from simple-field-manipulation-direct-access/src/simple-field-manipulation-direct-accessExample.f90 rename to simple-field-manipulation-direct-access/Fortran/src/simple-field-manipulation-direct-accessExample.f90 diff --git a/simple-field-manipulation-direct-access/OpenCMISS.cmake b/simple-field-manipulation-direct-access/OpenCMISS.cmake new file mode 100644 index 00000000..3d6cf515 --- /dev/null +++ b/simple-field-manipulation-direct-access/OpenCMISS.cmake @@ -0,0 +1,95 @@ +########################### +# *DO NOT CHANGE THIS FILE* +########################### +# +# Prepares the use of OpenCMISS by scanning at various path locations for OpenCMISS (SDK) installations. +# +# Search order: +# - OPENCMISS_INSTALL_DIR variable +# - OPENCMISS_INSTALL_DIR environment variable +# - OPENCMISS_SDK_DIR variable +# - OPENCMISS_SDK_DIR environment variable +# - [Windows only] The Registry is searched additionally for installed SDKs. +# +# If found +# - Includes the toolchain config script of the found opencmiss installation to enable toolchain selection logic (non-windows) + +# Convenience: The OPENCMISS_INSTALL_DIR may also be defined in the environment and various other places +if (DEFINED OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using specified installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The specified OPENCMISS_INSTALL_DIR '${OPENCMISS_INSTALL_DIR}' does not exist. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_INSTALL_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_INSTALL_DIR}" OPENCMISS_INSTALL_DIR) + get_filename_component(OPENCMISS_INSTALL_DIR "${OPENCMISS_INSTALL_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Using environment installation directory '${OPENCMISS_INSTALL_DIR}'") + else() + message(WARNING "The environment variable OPENCMISS_INSTALL_DIR='${OPENCMISS_INSTALL_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_INSTALL_DIR) + endif() +endif() +if (NOT OPENCMISS_INSTALL_DIR AND DEFINED OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The specified OPENCMISS_SDK_DIR '${OPENCMISS_SDK_DIR}' does not exist. Skipping.") + endif() +endif() +if(NOT OPENCMISS_INSTALL_DIR AND NOT "$ENV{OPENCMISS_SDK_DIR}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{OPENCMISS_SDK_DIR}" OPENCMISS_SDK_DIR) + get_filename_component(OPENCMISS_SDK_DIR "${OPENCMISS_SDK_DIR}" ABSOLUTE) + if (EXISTS "${OPENCMISS_SDK_DIR}") + message(STATUS "Using environment SDK installation directory: ${OPENCMISS_SDK_DIR}") + set(OPENCMISS_INSTALL_DIR "${OPENCMISS_SDK_DIR}") + else() + message(WARNING "The environment variable OPENCMISS_SDK_DIR='${OPENCMISS_SDK_DIR}' contains an invalid path. Skipping.") + unset(OPENCMISS_SDK_DIR) + endif() +endif() +# On windows: check the registry for installed OpenCMISS SDKs +if(NOT OPENCMISS_INSTALL_DIR AND WIN32) + foreach(ROOT HKEY_CURRENT_USER HKEY_LOCAL_MACHINE) + foreach(PACKAGE OpenCMISSUserSDK OpenCMISSDeveloperSDK) + set(_REG_KEY "[${ROOT}\\Software\\Auckland Bioengineering Institute\\${PACKAGE}]") + get_filename_component(OPENCMISS_INSTALL_DIR "${_REG_KEY}" ABSOLUTE) + #message(STATUS "Trying registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + message(STATUS "Found ${PACKAGE} in Windows registry key ${_REG_KEY}: ${OPENCMISS_INSTALL_DIR}") + break() + else() + unset(OPENCMISS_INSTALL_DIR) + endif() + endforeach() + if (EXISTS "${OPENCMISS_INSTALL_DIR}") + break() + endif() + endforeach() +endif() + +if(OPENCMISS_INSTALL_DIR) + message(STATUS "OPENCMISS_INSTALL_DIR=${OPENCMISS_INSTALL_DIR}") + # Use the OpenCMISS scripts to also allow choosing a separate toolchain + # This file is located at the opencmiss installation rather than the local example + # as it avoids file replication and makes maintenance much easier + if (TOOLCHAIN) + set(_OCTC ${OPENCMISS_INSTALL_DIR}/cmake/OCToolchainCompilers.cmake) + if (EXISTS "${_OCTC}") + include(${_OCTC}) + else() + message(WARNING "TOOLCHAIN specified but OpenCMISS config script could not be found at ${_OCTC}. Trying CMake defaults.") + endif() + unset(_OCTC) + endif() + set(OpenCMISS_DIR "${OPENCMISS_INSTALL_DIR}" CACHE PATH "Path to the found OpenCMISS (SDK) installation") +else() + message(WARNING "No OpenCMISS (SDK) installation directory detected. Using default system environment.") +endif() + \ No newline at end of file diff --git a/simple-field-manipulation-direct-access/build_debug/build.sh b/simple-field-manipulation-direct-access/build_debug/build.sh new file mode 100644 index 00000000..e6624bac --- /dev/null +++ b/simple-field-manipulation-direct-access/build_debug/build.sh @@ -0,0 +1,2 @@ +#ccc && cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all +cmake -DOPENCMISS_BUILD_TYPE=DEBUG -DCMAKE_BUILD_TYPE=DEBUG .. && make all