Skip to content

Commit

Permalink
Added Fastor (#77)
Browse files Browse the repository at this point in the history
* Added Fastor to `algebra-plugins`
  • Loading branch information
wermos authored Oct 13, 2022
1 parent 03e0145 commit 73c29e9
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 0 deletions.
16 changes: 16 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ option( ALGEBRA_PLUGINS_INCLUDE_SMATRIX
"Include Smatrix types in Algebra Plugins" FALSE )
option( ALGEBRA_PLUGINS_INCLUDE_VC
"Include Vc types in Algebra Plugins" FALSE )
option( ALGEBRA_PLUGINS_INCLUDE_FASTOR
"Include Fastor types in Algebra Plugins" FALSE )
option( ALGEBRA_PLUGINS_INCLUDE_VECMEM
"Include VecMem types in Algebra Plugins" FALSE )
option( ALGEBRA_PLUGINS_BUILD_TESTING "Build the unit tests of Algebra Plugins"
Expand Down Expand Up @@ -139,6 +141,20 @@ if( ALGEBRA_PLUGINS_SETUP_VC )
endif()
endif()

# Set up Fastor.
option( ALGEBRA_PLUGINS_SETUP_FASTOR
"Set up the Fastor target(s) explicitly" FALSE )
option( ALGEBRA_PLUGINS_USE_SYSTEM_FASTOR
"Pick up an existing installation of Fastor from the build environment"
TRUE )
if( ALGEBRA_PLUGINS_SETUP_FASTOR )
if( ALGEBRA_PLUGINS_USE_SYSTEM_FASTOR )
find_package( Fastor 0.6.3 REQUIRED )
else()
add_subdirectory( extern/fastor )
endif()
endif()

# Undo the developer flag suppression.
if( _unsetDevWarningFlag )
unset( CMAKE_SUPPRESS_DEVELOPER_WARNINGS )
Expand Down
30 changes: 30 additions & 0 deletions extern/fastor/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Algebra plugins library, part of the ACTS project (R&D line)
#
# (c) 2022 CERN for the benefit of the ACTS project
#
# Mozilla Public License Version 2.0

# CMake include(s).
cmake_minimum_required( VERSION 3.11 )
include( FetchContent )

# Tell the user what's happening.
message( STATUS "Building Fastor as part of the Algebra Plugins project" )

# Declare where to get Fastor from.
# We need to use this alternative syntax for FetchContent_Declare because the
# latest release for Fastor does not have a CMakeLists.txt file.
set( ALGEBRA_PLUGINS_FASTOR_SOURCE
"fastor;GIT_REPOSITORY;https://github.com/romeric/Fastor.git;GIT_TAG;6d7216f304d60d92b9b042566d4d6e94c65086a3"
CACHE STRING "Source for Fastor, when built as part of this project" )
mark_as_advanced( ALGEBRA_PLUGINS_FASTOR_SOURCE )
FetchContent_Declare( fastor ${ALGEBRA_PLUGINS_FASTOR_SOURCE} )

# Options used in the build of Fastor.
set(BUILD_TESTING OFF CACHE BOOL "Don't build the Fastor tests")
add_compile_definitions(FASTOR_ENABLE_RUNTIME_CHECKS=0)

# Get it into the current directory.
FetchContent_Populate( fastor )
add_subdirectory( "${fastor_SOURCE_DIR}" "${fastor_BINARY_DIR}"
EXCLUDE_FROM_ALL )
4 changes: 4 additions & 0 deletions extern/fastor/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Build Recipe for Fastor

This directory holds a simple build recipe for the
[Fastor](https://github.com/romeric/Fastor) project.

0 comments on commit 73c29e9

Please sign in to comment.