| 1 |
# |
| 2 |
# Advanced Simulation Library <http://asl.org.il> |
| 3 |
# |
| 4 |
# Copyright 2015 Avtech Scientific <http://avtechscientific.com> |
| 5 |
# |
| 6 |
# |
| 7 |
# This file is part of Advanced Simulation Library (ASL). |
| 8 |
# |
| 9 |
# ASL is free software: you can redistribute it and/or modify it |
| 10 |
# under the terms of the GNU Affero General Public License as |
| 11 |
# published by the Free Software Foundation, version 3 of the License. |
| 12 |
# |
| 13 |
# ASL is distributed in the hope that it will be useful, |
| 14 |
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 15 |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 16 |
# GNU Affero General Public License for more details. |
| 17 |
# |
| 18 |
# You should have received a copy of the GNU Affero General Public License |
| 19 |
# along with ASL. If not, see <http://www.gnu.org/licenses/>. |
| 20 |
# |
| 21 |
|
| 22 |
|
| 23 |
project(ASL) |
| 24 |
|
| 25 |
# After switching to 3.1 - remove FindOpenCL.cmake from the distribution |
| 26 |
# since it is supported by the cmake itself. |
| 27 |
cmake_minimum_required(VERSION 3.0.2 FATAL_ERROR) |
| 28 |
|
| 29 |
# Set version number |
| 30 |
set(ASL_VERSION_MAJOR 0) |
| 31 |
set(ASL_VERSION_MINOR 1) |
| 32 |
set(ASL_VERSION_PATCH 7) |
| 33 |
|
| 34 |
set(ASL_VERSION ${ASL_VERSION_MAJOR}.${ASL_VERSION_MINOR}.${ASL_VERSION_PATCH}) |
| 35 |
|
| 36 |
if (CMAKE_VERSION VERSION_LESS 3.1.0) |
| 37 |
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fpermissive -std=c++11") |
| 38 |
else() |
| 39 |
set(CMAKE_CXX_STANDARD 11) |
| 40 |
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fpermissive") |
| 41 |
endif() |
| 42 |
|
| 43 |
# Enable supplied cmake includes and modules |
| 44 |
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/" "${CMAKE_SOURCE_DIR}/cmake/Modules/") |
| 45 |
|
| 46 |
# Add ASL cmake definitions |
| 47 |
include(ASLPaths) |
| 48 |
include(ASLBuildOptions) |
| 49 |
include(ASLBuildFunctions) |
| 50 |
|
| 51 |
# Find dependencies |
| 52 |
find_package(OpenCL 1.1 REQUIRED) |
| 53 |
# ToDo: check - system component might be not needed any longer on new versions of Boost |
| 54 |
find_package(Boost 1.53 REQUIRED COMPONENTS program_options filesystem system) |
| 55 |
# ToDo: remove support for VTK 6.1 at some point in future |
| 56 |
find_package(VTK 6.1 QUIET COMPONENTS vtkRenderingCore vtkImagingCore vtkFiltersCore vtkIOCore vtkIOGeometry vtkIOLegacy vtkIOXML vtkIOMINC vtkCommonCore vtkViewsCore vtkftgl vtksys vtkDICOMParser vtkexpat vtkzlib NO_MODULE) |
| 57 |
if(NOT VTK_FOUND) |
| 58 |
find_package(VTK 7.0 REQUIRED COMPONENTS vtkRenderingCore vtkImagingCore vtkFiltersCore vtkIOCore vtkIOGeometry vtkIOLegacy vtkIOXML vtkIOMINC vtkCommonCore vtkViewsCore vtksys vtkDICOMParser vtkexpat vtkzlib NO_MODULE) |
| 59 |
endif() |
| 60 |
include(${VTK_USE_FILE}) |
| 61 |
|
| 62 |
include_directories(SYSTEM ${OpenCL_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS}) |
| 63 |
|
| 64 |
add_subdirectory(src) |
| 65 |
add_subdirectory(utilities) |
| 66 |
|
| 67 |
if (WITH_EXAMPLES) |
| 68 |
add_subdirectory(examples) |
| 69 |
endif() |
| 70 |
|
| 71 |
if (WITH_API_DOC) |
| 72 |
add_subdirectory(doc) |
| 73 |
endif() |
| 74 |
|
| 75 |
if (WITH_TESTS) |
| 76 |
# Test labels: |
| 77 |
# DoublePrecision - tests that use double precision (will fail if device does not support it) |
| 78 |
# IO - Input/Output tests (disabled for now) |
| 79 |
# Performance - performance tests |
| 80 |
# |
| 81 |
# Run them e.g.: `ctest [-C Release|Debug] -L Performance` |
| 82 |
# Exclude some of them: `ctest -LE DoublePrecision -LE Performance` |
| 83 |
enable_testing() |
| 84 |
add_subdirectory(test) |
| 85 |
endif() |
| 86 |
|
| 87 |
# Packaging |
| 88 |
set(CPACK_GENERATOR "TGZ") |
| 89 |
set(CPACK_SOURCE_GENERATOR "TGZ") |
| 90 |
set(CPACK_PACKAGE_VERSION_MAJOR ${ASL_VERSION_MAJOR}) |
| 91 |
set(CPACK_PACKAGE_VERSION_MINOR ${ASL_VERSION_MINOR}) |
| 92 |
set(CPACK_PACKAGE_VERSION_PATCH ${ASL_VERSION_PATCH}) |
| 93 |
set(CPACK_RESOURCE_FILE_LICENSE "${PROJECT_SOURCE_DIR}/LICENSE") |
| 94 |
set(CPACK_RESOURCE_FILE_README "${PROJECT_SOURCE_DIR}/README.org") |
| 95 |
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Advanced Simulation Library is a free and open source hardware accelerated multiphysics simulation platform.") |
| 96 |
set(CPACK_PACKAGE_DESCRIPTION "Advanced Simulation Library (ASL) is a free and open source hardware accelerated multiphysics simulation platform (and an extensible general purpose tool for solving Partial Differential Equations). Its computational engine is written in OpenCL and utilizes matrix-free solution techniques which enable extraordinarily high performance, memory efficiency and deployability on a variety of massively parallel architectures, ranging from inexpensive FPGAs, DSPs and GPUs up to heterogeneous clusters and supercomputers. The engine is hidden entirely behind simple C++ classes, so that no OpenCL knowledge is required from application programmers. Mesh-free, immersed boundary approach allows to move from CAD directly to simulation drastically reducing pre-processing efforts and amount of potential errors. ASL can be used to model various coupled physical and chemical phenomena and employed in a multitude of fields: computational fluid dynamics, virtual sensing, industrial process data validation and reconciliation, image-guided surgery, computer-aided engineering, design space exploration, crystallography, etc..") |
| 97 |
set(CPACK_PACKAGE_VENDOR "Avtech Scientific") |
| 98 |
set(CPACK_PACKAGE_CONTACT "http://avtechscientific.com/contact") |
| 99 |
|
| 100 |
## .deb-specific |
| 101 |
set(CPACK_DEBIAN_PACKAGE_HOMEPAGE "http://asl.org.il") |
| 102 |
set(CPACK_DEBIAN_PACKAGE_SECTION "science") |
| 103 |
set(CPACK_DEBIAN_PACKAGE_SUGGESTS "paraview") |
| 104 |
set(CPACK_DEBIAN_PACKAGE_DESCRIPTION "${CPACK_PACKAGE_DESCRIPTION_SUMMARY}\n${CPACK_PACKAGE_DESCRIPTION}") |
| 105 |
|
| 106 |
## .rpm-specific |
| 107 |
set(CPACK_RPM_PACKAGE_URL "http://asl.org.il") |
| 108 |
|
| 109 |
## NSIS-specific |
| 110 |
set(CPACK_NSIS_URL_INFO_ABOUT "http:\\\\\\\\asl.org.il") |
| 111 |
|
| 112 |
include(CPack) |
| 113 |
|
| 114 |
|
| 115 |
# Config (after package definitions, because CPACK_PACKAGE_DESCRIPTION_SUMMARY |
| 116 |
# is used for pkgconfig. |
| 117 |
|
| 118 |
## ASLConfig.cmake |
| 119 |
include(CMakePackageConfigHelpers) |
| 120 |
|
| 121 |
# ASL conforms to Semantic Versioning scheme <http://semver.org/> |
| 122 |
# Switch to COMPATIBILITY SameMajorVersion on ASL_VERSION 1.0.0 |
| 123 |
# Till then use COMPATIBILITY ExactVersion |
| 124 |
write_basic_package_version_file( |
| 125 |
"${CMAKE_CURRENT_BINARY_DIR}/ASLConfigVersion.cmake" |
| 126 |
VERSION ${ASL_VERSION} |
| 127 |
COMPATIBILITY ExactVersion |
| 128 |
) |
| 129 |
|
| 130 |
export(EXPORT ASLTargets |
| 131 |
FILE "${CMAKE_CURRENT_BINARY_DIR}/ASLTargets.cmake" |
| 132 |
NAMESPACE ASL:: |
| 133 |
) |
| 134 |
|
| 135 |
set(ConfigPackageLocation ${CMAKE_INSTALL_LIBDIR}/cmake/ASL) |
| 136 |
|
| 137 |
configure_package_config_file( |
| 138 |
${CMAKE_SOURCE_DIR}/cmake/ASLConfig.cmake.in |
| 139 |
${CMAKE_CURRENT_BINARY_DIR}/ASLConfig.cmake |
| 140 |
INSTALL_DESTINATION ${ConfigPackageLocation} |
| 141 |
) |
| 142 |
|
| 143 |
install(EXPORT ASLTargets |
| 144 |
FILE |
| 145 |
ASLTargets.cmake |
| 146 |
NAMESPACE |
| 147 |
ASL:: |
| 148 |
DESTINATION |
| 149 |
${ConfigPackageLocation} |
| 150 |
) |
| 151 |
|
| 152 |
install(FILES |
| 153 |
"${CMAKE_CURRENT_BINARY_DIR}/ASLConfig.cmake" |
| 154 |
"${CMAKE_CURRENT_BINARY_DIR}/ASLConfigVersion.cmake" |
| 155 |
DESTINATION |
| 156 |
${ConfigPackageLocation} |
| 157 |
COMPONENT |
| 158 |
Devel |
| 159 |
) |
| 160 |
|
| 161 |
|
| 162 |
## ASL.pc |
| 163 |
|
| 164 |
### Read the composed list of all sublibs from the ASL_SUBLIBS_GLOBAL_PROPERTY |
| 165 |
get_property(ASL_SUBLIBS GLOBAL PROPERTY ASL_SUBLIBS_GLOBAL_PROPERTY) |
| 166 |
|
| 167 |
configure_file( |
| 168 |
${CMAKE_SOURCE_DIR}/cmake/ASL.pc.in |
| 169 |
${CMAKE_CURRENT_BINARY_DIR}/ASL.pc |
| 170 |
@ONLY |
| 171 |
) |
| 172 |
|
| 173 |
install(FILES |
| 174 |
${CMAKE_CURRENT_BINARY_DIR}/ASL.pc |
| 175 |
DESTINATION |
| 176 |
${CMAKE_INSTALL_LIBDIR}/pkgconfig |
| 177 |
) |