Opened 5 years ago
Last modified 5 years ago
#5520 new defect
OMSI build fails with newer sundials
Reported by: | Per Östlund | Owned by: | Martin Sjölund |
---|---|---|---|
Priority: | normal | Milestone: | Future |
Component: | Build Environment | Version: | v1.14.0-dev-nightly |
Keywords: | Cc: | Willi Braun, Niklas Worschech, Andreas Heuermann |
Description
OMSI failed to build for me with an error from SimulationRuntime/OMSI/solver/CMakeLists.txt:
CMake Error at solver/CMakeLists.txt:63 (STRING): STRING sub-command REGEX, mode REPLACE needs at least 6 arguments total to command.
It's looking for the pattern #define SUNDIALS_PACKAGE_VERSION "..."
in sundials_config.h
to determine the sundials version, but it wasn't working on my system. The reason turned out to be that I had sundials 4.1.0 installed (3rdParty has 2.6.2), where SUNDIALS_PACKAGE_VERSION
has been changed to SUNDIALS_VERSION
.
I "solved" it by uninstalling sundials, since I wasn't sure why I even had it installed. But this should be fixed anyway, either by ignoring system-installed sundials or making the version detection more robust.
Change History (6)
comment:1 by , 5 years ago
comment:2 by , 5 years ago
PR #248 should fix the problem. As you said in newer sundials version the define for SUNDIALS_PACKAGE_VERSION is different but checked from CMake now as well.
comment:3 by , 5 years ago
That still uses FIND_PATH(SUNDIALS_INCLUDE_DIR "sundials/sundials_config.h" ${SUNDIALS_PATH}/include NO_DEFAULT_PATH)
, which is broken and finds the system version of Sundials instead of the one we compile (at least on OSX). You'll get mixed versions of the sundials version you link and compile against.
comment:4 by , 5 years ago
On the mac machine used by Jenkins it seems that omc is build and there is also Sundials installed on the system (Or did you removed it in the last days?)
The used Sundials libs for OMSISolver are
-- Used Sundials libraries: /Users/hudson/jenkins-slave/ws/OpenModelica_PR-248/OMCompiler/3rdParty/sundials/build/lib/libsundials_nvecserial.dylib;/Users/hudson/jenkins-slave/ws/OpenModelica_PR-248/OMCompiler/3rdParty/sundials/build/lib/libsundials_kinsol.dylib
comment:5 by , 5 years ago
On the Mac machine, sundials in macports is still installed and our version should preferably be detected (and linked).
The problem is that cmake doesn't do what the documentation says for find_path - it will look through default paths even if you tell it not to. So it should look for the config.h in the location we know it's installed into.