Skip to content

Commit

Permalink
[cmake] Prefer static versions of the libraries.
Browse files Browse the repository at this point in the history
  - We sometimes have both static and dynmaic versions of some libraries.
    e.g. right now sundials libs are built as both static and dynamic
    since the CPP runtime needs dynamic versions and FMUs need static
    versions.

    So make sure we link to the static ones when building static versions
    of FMUs
  • Loading branch information
mahge committed Sep 26, 2021
1 parent 347c240 commit 1bffd04
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion OMCompiler/Compiler/runtime/CMakeLists.txt
Expand Up @@ -279,7 +279,7 @@ else()
set(RT_LDFLAGS_GENERATED_CODE " -lOpenModelicaRuntimeC -lomcmemory -llapack -lblas -lm -lpthread -rdynamic")
set(RT_LDFLAGS_GENERATED_CODE_SIM " -lSimulationRuntimeC -lOptimizationRuntime -lOpenModelicaRuntimeC -lomcmemory -lzlib -llapack -lblas -lm -ldl -lpthread -lgfortran -lstdc++ -rdynamic -Wl,--no-undefined")
set(RT_LDFLAGS_GENERATED_CODE_SOURCE_FMU " -lOpenModelicaFMIRuntimeC -llapack -lblas -lm -lpthread -rdynamic -Wl,--no-undefined")
set(RT_LDFLAGS_GENERATED_CODE_SOURCE_FMU_STATIC " -lOpenModelicaFMIRuntimeC -lomcgc -lipopt -lcoinmumps -lcminpack -lexpat -lcdaskr -lsundials_cvode -lsundials_kinsol -lsundials_idas -lsundials_sunlinsollapackdense -lsundials_sunlinsolklu -llis -lumfpack -lklu -lamd -lbtf -lcolamd -lsuitesparseconfig -llapack -lblas -lm -ldl -lpthread -lgfortran -lstdc++ -rdynamic -Wl,--no-undefined")
set(RT_LDFLAGS_GENERATED_CODE_SOURCE_FMU_STATIC "-Wl,-Bstatic -lOpenModelicaFMIRuntimeC -lomcgc -lipopt -lcoinmumps -lcminpack -lexpat -lcdaskr -lsundials_cvode -lsundials_kinsol -lsundials_idas -lsundials_sunlinsollapackdense -lsundials_sunlinsolklu -llis -lumfpack -lklu -lamd -lbtf -lcolamd -lsuitesparseconfig -llapack -lblas -Wl,-Bdynamic -lm -ldl -lpthread -lgfortran -lstdc++ -rdynamic -Wl,--no-undefined")


configure_file(${CMAKE_CURRENT_SOURCE_DIR}/../Util/Autoconf.mo.in ${CMAKE_CURRENT_SOURCE_DIR}/../Util/Autoconf.mo)
Expand Down

0 comments on commit 1bffd04

Please sign in to comment.