Skip to content

Commit 99b75c4

Browse files
committed
Link with KINSOL driver in case of static builds
1 parent 6861bde commit 99b75c4

File tree

3 files changed

+31
-3
lines changed

3 files changed

+31
-3
lines changed

.jenkins/version_llvm.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
f09947f8e5e9d026157666ffcdc59468d88a6343
1+
431a672b7cbbdcad0a0fd9d799ca33d8a3f7084f

lib/Simulation/CMakeLists.txt

+24-2
Original file line numberDiff line numberDiff line change
@@ -9,23 +9,45 @@ marco_add_runtime_static_library(OptionsSimulation_static
99
${OPTIONS_SRC})
1010

1111
# Declare the library driving the simulation.
12+
# Both the versions lead to static objects, but differ in the linked libraries.
13+
# The '_static' version depends only on static libraries.
1214
marco_add_runtime_static_library(Simulation
1315
CLI.cpp
1416
Profiler.cpp
1517
Runtime.cpp
1618
Scheduler.cpp)
1719

18-
target_link_libraries(Simulation
19-
PUBLIC
20+
target_compile_definitions(Simulation PUBLIC SHARED_DEPS)
21+
22+
marco_add_runtime_static_library(Simulation_static
23+
CLI.cpp
24+
Profiler.cpp
25+
Runtime.cpp
26+
Scheduler.cpp)
27+
28+
set(SIMULATION_LINKED_LIBS
2029
CLI
2130
Modeling
2231
Multithreading
2332
OptionsSimulation)
2433

34+
target_link_libraries(Simulation
35+
PUBLIC
36+
${SIMULATION_LINKED_LIBS}
37+
DriverKINSOL)
38+
39+
target_link_libraries(Simulation_static
40+
PUBLIC
41+
${SIMULATION_LINKED_LIBS})
42+
2543
if (MARCO_PROFILING)
2644
target_link_libraries(Simulation
2745
PUBLIC
2846
Profiling)
47+
48+
target_link_libraries(Simulation_static
49+
PUBLIC
50+
Profiling)
2951
endif()
3052

3153
# Declare the library used to make the simulation executable.

lib/Simulation/Runtime.cpp

+6
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#include "marco/Runtime/Simulation/Runtime.h"
22
#include "marco/Runtime/CLI/CLI.h"
33
#include "marco/Runtime/Drivers/Driver.h"
4+
#include "marco/Runtime/Drivers/KINSOL/CLI.h"
45
#include "marco/Runtime/Multithreading/CLI.h"
56
#include "marco/Runtime/Printers/Printer.h"
67
#include "marco/Runtime/Profiling/Profiling.h"
@@ -240,6 +241,11 @@ void runtimeDeinit(Simulation &simulationInfo) {
240241
#endif
241242

242243
cli += driver->getCLIOptions();
244+
245+
#ifdef SHARED_DEPS
246+
cli += std::make_unique<sundials::kinsol::CommandLineOptions>();
247+
#endif
248+
243249
cli += printer->getCLIOptions();
244250

245251
argh::parser cmdl(argc, argv);

0 commit comments

Comments
 (0)