Skip to content

Commit

Permalink
Fix copying of sundials libraries (#6933)
Browse files Browse the repository at this point in the history
Some OSes use lib64, some use lib, some use lib/x86_64-linux-gnu.
And some use different paths in the package builder for the OS.
  • Loading branch information
sjoelund committed Nov 15, 2020
1 parent 6cc808c commit dc1bf4d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
3 changes: 1 addition & 2 deletions OMCompiler/Makefile.common
Expand Up @@ -622,8 +622,7 @@ $(builddir_lib_omc)/libsundials_ida.a: 3rdParty/sundials-5.4.0/CMakeLists.txt
(cp -pfr 3rdParty/sundials-5.4.0/build/include/* $(OMBUILDDIR)/include/omc/c/sundials)
cp 3rdParty/sundials-5.4.0/src/kinsol/kinsol_impl.h $(OMBUILDDIR)/include/omc/c/sundials/kinsol/
# copy the libs to the build/lib/omc directory
if test -d 3rdParty/sundials-5.4.0/build/lib64/ ; then mv 3rdParty/sundials-5.4.0/build/lib64 3rdParty/sundials-5.4.0/build/lib ; fi
(cp -pf 3rdParty/sundials-5.4.0/build/lib/* $(builddir_lib_omc))
find 3rdParty/sundials-5.4.0/build/lib* -xtype f -exec cp -pf {} $(builddir_lib_omc) ";"

test ! `uname` = Darwin || install_name_tool -id @rpath/libsundials_arkode.1.0.0.dylib "$(builddir_lib_omc)/libsundials_arkode.1.0.0.dylib"
test ! `uname` = Darwin || install_name_tool -id @rpath/libsundials_arkode.1.dylib "$(builddir_lib_omc)/libsundials_arkode.1.dylib"
Expand Down
5 changes: 3 additions & 2 deletions OMCompiler/SimulationRuntime/OMSI/solver/CMakeLists.txt
Expand Up @@ -24,7 +24,7 @@ ELSE()
FIND_PACKAGE(LAPACK)
ENDIF()

IF (BLAS_FOUND STREQUAL "NOTFOUND")
IF (BLAS_FSOUND STREQUAL "NOTFOUND")
MESSAGE(FATAL_ERROR "Error: Blas Libraries not found!")
ENDIF()
IF (LAPACK_FOUND STREQUAL "NOTFOUND")
Expand All @@ -48,13 +48,14 @@ ENDIF(MSVC)
IF(MSVC)
SET(SUNDIALS_PATH ${OMCTRUNCHOME}/OMCompiler/3rdParty/sundials-5.4.0/build_msvc)
ELSE(MSVC)
# Shouldn't this point to the build directory with the installed libraries?
SET(SUNDIALS_PATH ${OMCTRUNCHOME}/OMCompiler/3rdParty/sundials-5.4.0/build)
ENDIF(MSVC)
GET_FILENAME_COMPONENT(SUNDIALS_PATH "${SUNDIALS_PATH}" ABSOLUTE)
MESSAGE(STATUS "Sundials PATH:")
MESSAGE(STATUS "${SUNDIALS_PATH}")

FIND_PATH(SUNDIALS_LIB_DIR NAMES sundials_nvecserial libsundials_nvecserial sundials_nvecserial.dll libsundials_nvecserial.so sundials_nvecserial.a libsundials_nvecserial.a sundials_nvecserial.lib PATHS ${SUNDIALS_PATH}/lib)
FIND_PATH(SUNDIALS_LIB_DIR NAMES sundials_nvecserial libsundials_nvecserial sundials_nvecserial.dll libsundials_nvecserial.so sundials_nvecserial.a libsundials_nvecserial.a sundials_nvecserial.lib PATHS ${SUNDIALS_PATH}/lib ${SUNDIALS_PATH}/lib64)

MESSAGE(STATUS "Sundials libs:")
MESSAGE(STATUS "${SUNDIALS_LIB_DIR}")
Expand Down

0 comments on commit dc1bf4d

Please sign in to comment.