Opened 5 years ago

Last modified 5 years ago

#5520 new defect

OMSI build fails with newer sundials

Reported by: perost Owned by: sjoelund.se
Priority: normal Milestone: Future
Component: Build Environment Version: v1.14.0-dev-nightly
Keywords: Cc: wbraun, niklwors, AnHeuermann

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 Changed 5 years ago by sjoelund.se

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.

comment:2 Changed 5 years ago by AnHeuermann

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 Changed 5 years ago by sjoelund.se

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 Changed 5 years ago by AnHeuermann

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

https://test.openmodelica.org/jenkins/blue/organizations/jenkins/OpenModelica/detail/PR-248/38/pipeline/39

Last edited 5 years ago by AnHeuermann (previous) (diff)

comment:5 Changed 5 years ago by sjoelund.se

On the Mac machine, sundials in macports is still installed and our version should preferably be detected (and linked).

comment:6 Changed 5 years ago by sjoelund.se

That log seems to suggest also sundials_config.h is detected properly

Note: See TracTickets for help on using tickets.