Commit a27fe266 authored by Philipp Fensch's avatar Philipp Fensch
Browse files

Added CUDA-Option to cmake-files

parent bb2f12f0
cmake_minimum_required(VERSION 3.5)
project(DPsim CXX)
project(DPsim CXX CUDA)
if(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME)
set(TOPLEVEL_PROJECT ON)
......@@ -86,17 +86,18 @@ endif()
# Options
include(CMakeDependentOption)
option(BUILD_SHARED_LIBS "Build shared library" OFF)
option(BUILD_EXAMPLES "Build C++ examples" ON)
option(BUILD_SHARED_LIBS "Build shared library" OFF)
option(BUILD_EXAMPLES "Build C++ examples" ON )
option(COMPARE_REFERENCE "Download reference results and compare" OFF)
option(WITH_CUDA "Enable CUDA-based parallelisation" ON )
cmake_dependent_option(WITH_GSL "Enable GSL" ON "GSL_FOUND" OFF)
cmake_dependent_option(WITH_SUNDIALS "Enable sundials solver suite" ON "Sundials_FOUND" OFF)
cmake_dependent_option(WITH_SHMEM "Enable shared memory interface" ON "VILLASnode_FOUND" OFF)
cmake_dependent_option(WITH_RT "Enable real-time features" ON "Linux_FOUND" OFF)
cmake_dependent_option(WITH_GSL "Enable GSL" ON "GSL_FOUND" OFF)
cmake_dependent_option(WITH_SUNDIALS "Enable sundials solver suite" ON "Sundials_FOUND" OFF)
cmake_dependent_option(WITH_SHMEM "Enable shared memory interface" ON "VILLASnode_FOUND" OFF)
cmake_dependent_option(WITH_RT "Enable real-time features" ON "Linux_FOUND" OFF)
cmake_dependent_option(WITH_PYTHON "Enable Python support" OFF "Python_FOUND" OFF)
cmake_dependent_option(WITH_CIM "Enable support for parsing CIM files" ON "CIMpp_FOUND" OFF)
cmake_dependent_option(WITH_OPENMP "Enable OpenMP-based parallelisation" ON "OPENMP_FOUND" OFF)
cmake_dependent_option(WITH_CIM "Enable support for parsing CIM files" ON "CIMpp_FOUND" OFF)
cmake_dependent_option(WITH_OPENMP "Enable OpenMP-based parallelisation" ON "OPENMP_FOUND" OFF)
configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/Include/dpsim/Config.h.in
......
......@@ -48,12 +48,12 @@ elseif("${CMAKE_SYSTEM}" MATCHES "Darwin")
endif()
include(CMakeDependentOption)
cmake_dependent_option(WITH_NUMPY "Enable NumPy" ON "NumPy_FOUND" OFF)
cmake_dependent_option(WITH_GSL "Enable GSL" ON "GSL_FOUND" OFF)
cmake_dependent_option(WITH_SUNDIALS "Enable sundials solver suite" ON "Sundials_FOUND" OFF)
cmake_dependent_option(WITH_PYTHON "Enable Python support" ON "Python_FOUND" OFF)
cmake_dependent_option(WITH_CIM "Enable support for parsing CIM files" ON "CIMpp_FOUND" OFF)
cmake_dependent_option(WITH_GRAPHVIZ "Enable support for Graphviz Graphs" ON "Graphviz_FOUND" OFF)
cmake_dependent_option(WITH_GSL "Enable GSL" ON "GSL_FOUND" OFF)
cmake_dependent_option(WITH_SUNDIALS "Enable sundials solver suite" ON "Sundials_FOUND" OFF)
cmake_dependent_option(WITH_PYTHON "Enable Python support" ON "Python_FOUND" OFF)
cmake_dependent_option(WITH_NUMPY "Enable NumPy" ON "NumPy_FOUND;WITH_PYTHON" OFF)
cmake_dependent_option(WITH_CIM "Enable support for parsing CIM files" ON "CIMpp_FOUND" OFF)
cmake_dependent_option(WITH_GRAPHVIZ "Enable support for Graphviz Graphs" ON "Graphviz_FOUND" OFF)
# Show feature summary
include(FeatureSummary)
......
......@@ -56,6 +56,15 @@ if(WITH_SHMEM)
list(APPEND INCLUDE_DIRS ${VILLASNODE_INCLUDE_DIRS})
endif()
if(WITH_CUDA)
list(APPEND SOURCES
MNASolverGpu.cpp
)
list(APPEND INCLUDE_DIRS ${CUDA_INCLUDE_DIRS} ${CMAKE_CUDA_TOOLKIT_INCLUDE_DIRECTORIES})
endif()
if(WITH_OPENMP)
list(APPEND SOURCES
OpenMPLevelScheduler.cpp
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment