Commit bc2557c8 authored by Steffen Vogel's avatar Steffen Vogel 🎅🏼
Browse files

cmake: add detection of Sundials on Linux based builds

parent af772c13
......@@ -5,7 +5,7 @@ project(DPsim CXX)
set(CMAKE_CXX_STANDARD 17)
add_definitions(-D_SILENCE_ALL_CXX17_DEPRECATION_WARNINGS)
set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/CMake")
set(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/CMake;${PROJECT_SOURCE_DIR}/Dependencies/libcps/CMake")
set(PROJECT_AUTHOR "Institute for Automation of Complex Power Systems, RWTH Aachen University")
set(PROJECT_COPYRIGHT "2017, Institute for Automation of Complex Power Systems, RWTH Aachen University")
......@@ -54,6 +54,7 @@ add_subdirectory(Dependencies/libcps)
find_package(PythonInterp 3.6)
find_package(PythonLibs 3.6)
find_package(Sundials)
if(PythonInterp_FOUND AND PythonLibs_FOUND)
set(Python_FOUND ON)
......@@ -71,6 +72,7 @@ option(WITH_SHMEM "Enable shared memory interface" ${VILLASnode_FOUND})
option(WITH_RT "Enable real-time features" ${Linux_FOUND})
option(WITH_PYTHON "Enable Python support" ${Python_FOUND})
option(WITH_CIM "Enable support for parsing CIM files" ${CIMpp_FOUND})
option(WITH_SUNDIALS "Enable sundials solver suite" ${Sundials_FOUND})
configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/Include/dpsim/Config.h.in
......
Subproject commit c10917ed20470f6a5328b23bb039a72e5d799fb3
Subproject commit 248f84c99394c0352bdabb2d3b3781ed8628c7ef
......@@ -36,3 +36,4 @@
#cmakedefine WITH_SHMEM
#cmakedefine WITH_CIM
#cmakedefine WITH_PYTHON
#cmakedefine WITH_SUNDIALS
......@@ -40,6 +40,7 @@ RUN dnf -y install \
villas-node-devel \
expat-devel \
graphviz-devel \
sundials-devel \
libcimpp16v29a \
spdlog
......
......@@ -26,7 +26,8 @@ RUN apt-get -y install \
graphviz \
python3-pip \
python3-dev \
libeigen3-dev
libeigen3-dev \
libsundials-serial-dev
# Python Packages
ADD requirements.txt .
......
add_library(dpsim
set(SOURCES
Simulation.cpp
Utils.cpp
MNASolver.cpp
Utils.cpp
)
set(LIBRARIES cps)
......@@ -21,6 +21,13 @@ if(WITH_RT)
list(APPEND SOURCES RealTimeSimulation.cpp)
endif()
if(WITH_SUNDIALS)
list(APPEND SOURCES DAESolver.cpp)
list(APPEND INCLUDE_DIRS ${SUNDIALS_INCLUDE_DIRS})
list(APPEND LIBRARIES ${SUNDIALS_LIBRARIES})
endif()
if(WITH_PYTHON)
list(APPEND INCLUDE_DIRS ${PYTHON_INCLUDE_DIRS})
list(APPEND LIBRARIES ${PYTHON_LIBRARIES})
......@@ -28,6 +35,7 @@ if(WITH_PYTHON)
add_subdirectory(Python)
endif()
add_library(dpsim)
target_sources(dpsim PRIVATE ${SOURCES})
target_link_libraries(dpsim ${LIBRARIES})
target_include_directories(dpsim PRIVATE ${INCLUDE_DIRS})
......
Markdown is supported
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