Skip to content

Commit

Permalink
[OSX] Check dylib and binaries for relative paths (#916)
Browse files Browse the repository at this point in the history
* Check dylib and binaries for relative paths
* Fix dylib IDs, rpath, etc in various places
* Add sanity check for OMEdit (OSX only; check that OMEdit --help works)

Co-authored-by: AnHeuermann <andreas.heuermann@liu.se>
  • Loading branch information
sjoelund and AnHeuermann committed Jun 3, 2020
1 parent cc6d66f commit 58b509d
Show file tree
Hide file tree
Showing 4 changed files with 123 additions and 18 deletions.
5 changes: 5 additions & 0 deletions Jenkinsfile
Expand Up @@ -102,6 +102,11 @@ pipeline {
sh "${env.GMAKE} --version"
common.buildOMC('cc', 'c++', "OMPCC='gcc-mp-5 -fopenmp -mno-avx' GNUCXX=g++-mp-5 FC=gfortran-mp-5 LDFLAGS=-L${env.MACPORTS}/lib CPPFLAGS=-I${env.MACPORTS}/include --without-omlibrary")
common.buildGUI('', false)
sh label: "Look for relative paths in dylibs", script: '! ( find build/ -name "*.dylib" -exec otool -L {} ";" | tr -d "\t" | grep -v : | grep -v "^[/@]" )'
sh label: "Look for relative paths in bin folder", script: '! ( find build/bin -type f -exec otool -L {} ";" | tr -d "\t" | grep -v : | grep -v "^[/@]" )'
// TODO: OMCppOSUSimulation throws error for help display
//sh label: "Sanity check for Cpp runtime", script: "./build/bin/OMCppOSUSimulation --help"
sh label: "Sanity check for OMEdit", script: "./build/Applications/OMEdit.app/Contents/MacOS/OMEdit --help"
}
}
}
Expand Down
34 changes: 27 additions & 7 deletions OMCompiler/Makefile.common
Expand Up @@ -505,13 +505,33 @@ $(builddir_lib_omc)/libsundials_ida.a: 3rdParty/sundials/CMakeLists.txt
(cp -pfr 3rdParty/sundials/build/include/* $(OMBUILDDIR)/include/omc/c/sundials)
# copy the libs to the build/lib/omc directory
(cp -pf 3rdParty/sundials/build/lib/* $(builddir_lib_omc))
test ! `uname` = Darwin || install_name_tool -id @rpath/libsundials_arkode.0.dylib "$(builddir_lib_omc)/libsundials_nvecserial.0.dylib"
test ! `uname` = Darwin || install_name_tool -id @rpath/libsundials_cvode.0.dylib "$(builddir_lib_omc)/libsundials_nvecserial.0.dylib"
test ! `uname` = Darwin || install_name_tool -id @rpath/libsundials_cvodes.0.dylib "$(builddir_lib_omc)/libsundials_nvecserial.0.dylib"
test ! `uname` = Darwin || install_name_tool -id @rpath/libsundials_ida.0.dylib "$(builddir_lib_omc)/libsundials_nvecserial.0.dylib"
test ! `uname` = Darwin || install_name_tool -id @rpath/libsundials_idas.0.dylib "$(builddir_lib_omc)/libsundials_nvecserial.0.dylib"
test ! `uname` = Darwin || install_name_tool -id @rpath/libsundials_kinsol.0.dylib "$(builddir_lib_omc)/libsundials_nvecserial.0.dylib"
test ! `uname` = Darwin || install_name_tool -id @rpath/libsundials_nvecserial.0.dylib "$(builddir_lib_omc)/libsundials_nvecserial.0.dylib"
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"
test ! `uname` = Darwin || install_name_tool -id @rpath/libsundials_arkode.dylib "$(builddir_lib_omc)/libsundials_arkode.dylib"

test ! `uname` = Darwin || install_name_tool -id @rpath/libsundials_cvode.1.0.0.dylib "$(builddir_lib_omc)/libsundials_cvode.1.0.0.dylib"
test ! `uname` = Darwin || install_name_tool -id @rpath/libsundials_cvode.1.dylib "$(builddir_lib_omc)/libsundials_cvode.1.dylib"
test ! `uname` = Darwin || install_name_tool -id @rpath/libsundials_cvode.dylib "$(builddir_lib_omc)/libsundials_cvode.dylib"

test ! `uname` = Darwin || install_name_tool -id @rpath/libsundials_cvodes.2.0.0.dylib "$(builddir_lib_omc)/libsundials_cvodes.2.0.0.dylib"
test ! `uname` = Darwin || install_name_tool -id @rpath/libsundials_cvodes.2.dylib "$(builddir_lib_omc)/libsundials_cvodes.2.dylib"
test ! `uname` = Darwin || install_name_tool -id @rpath/libsundials_cvodes.dylib "$(builddir_lib_omc)/libsundials_cvodes.dylib"

test ! `uname` = Darwin || install_name_tool -id @rpath/libsundials_ida.2.0.0.dylib "$(builddir_lib_omc)/libsundials_ida.2.0.0.dylib"
test ! `uname` = Darwin || install_name_tool -id @rpath/libsundials_ida.2.dylib "$(builddir_lib_omc)/libsundials_ida.2.dylib"
test ! `uname` = Darwin || install_name_tool -id @rpath/libsundials_ida.dylib "$(builddir_lib_omc)/libsundials_ida.dylib"

test ! `uname` = Darwin || install_name_tool -id @rpath/libsundials_idas.0.0.0.dylib "$(builddir_lib_omc)/libsundials_idas.0.0.0.dylib"
test ! `uname` = Darwin || install_name_tool -id @rpath/libsundials_idas.0.dylib "$(builddir_lib_omc)/libsundials_idas.0.dylib"
test ! `uname` = Darwin || install_name_tool -id @rpath/libsundials_idas.dylib "$(builddir_lib_omc)/libsundials_idas.dylib"

test ! `uname` = Darwin || install_name_tool -id @rpath/libsundials_kinsol.1.0.0.dylib "$(builddir_lib_omc)/libsundials_kinsol.1.0.0.dylib"
test ! `uname` = Darwin || install_name_tool -id @rpath/libsundials_kinsol.1.dylib "$(builddir_lib_omc)/libsundials_kinsol.1.dylib"
test ! `uname` = Darwin || install_name_tool -id @rpath/libsundials_kinsol.dylib "$(builddir_lib_omc)/libsundials_kinsol.dylib"

test ! `uname` = Darwin || install_name_tool -id @rpath/libsundials_nvecserial.0.0.2.dylib "$(builddir_lib_omc)/libsundials_nvecserial.0.0.2.dylib"
test ! `uname` = Darwin || install_name_tool -id @rpath/libsundials_nvecserial.0.dylib "$(builddir_lib_omc)/libsundials_nvecserial.0.dylib"
test ! `uname` = Darwin || install_name_tool -id @rpath/libsundials_nvecserial.dylib "$(builddir_lib_omc)/libsundials_nvecserial.dylib"
# copy the dlls to the build bin directory
test ! "$(SHREXT)" = ".dll" || (cp -pf 3rdParty/sundials/build/lib/*$(SHREXT) $(builddir_bin))
@touch "$@"
Expand Down
100 changes: 89 additions & 11 deletions OMCompiler/Makefile.omsi.common
Expand Up @@ -85,17 +85,95 @@ OMSICPP: omc

OMSICPPinstall: copycppheader OMSICPP
$(MAKE) -C SimulationRuntime/OMSICpp/ -f $(defaultMakefileTarget) CC="$(CC)" CXX="$(CXX)" install ANALYZATION_MODE="$(ANALYZATION_MODE)" $(CMAKE_ARGS) OMBUILDDIR=$(OMBUILDDIR) LIB_OMC=$(LIB_OMC)
test ! `uname` = Darwin || install_name_tool -id @rpath/OMSICpp/libOMCppCVode.dylib $(OMBUILDDIR)/$(LIB_OMC)/OMSICpp/libOMCppCVode.dylib
test ! `uname` = Darwin || install_name_tool -id @rpath/OMSICpp/libOMCppDataExchange.dylib $(OMBUILDDIR)/$(LIB_OMC)/OMSICpp/libOMCppDataExchange.dylib
test ! `uname` = Darwin || install_name_tool -id @rpath/OMSICpp/libOMCppEuler.dylib $(OMBUILDDIR)/$(LIB_OMC)/OMSICpp/libOMCppEuler.dylib
test ! `uname` = Darwin || install_name_tool -id @rpath/OMSICpp/libOMCppNewton.dylib $(OMBUILDDIR)/$(LIB_OMC)/OMSICpp/libOMCppNewton.dylib
test ! `uname` = Darwin || install_name_tool -id @rpath/OMSICpp/libOMCppSimulationSettings.dylib $(OMBUILDDIR)/$(LIB_OMC)/OMSICpp/libOMCppSimulationSettings.dylib
test ! `uname` = Darwin || install_name_tool -id @rpath/OMSICpp/libOMCppSolver.dylib $(OMBUILDDIR)/$(LIB_OMC)/OMSICpp/libOMCppSolver.dylib
test ! `uname` = Darwin || install_name_tool -id @rpath/OMSICpp/libOMCppSystemBase.dylib $(OMBUILDDIR)/$(LIB_OMC)/OMSICpp/libOMCppSystemBase.dylib
test ! `uname` = Darwin || install_name_tool -id @rpath/OMSICpp/libOMCppExtendedSystem.dylib $(OMBUILDDIR)/$(LIB_OMC)/OMSICpp/libOMCppExtendedSystem.dylib
test ! `uname` = Darwin || install_name_tool -id @rpath/OMSICpp/libOMCppSystemOMSI.dylib $(OMBUILDDIR)/$(LIB_OMC)/OMSICpp/libOMCppSystemOMSI.dylib
test ! `uname` = Darwin || install_name_tool -change libOMCppSolver.dylib @rpath/OMSICpp/libOMCppSolver.dylib $(OMBUILDDIR)/$(LIB_OMC)/OMSICpp/libOMCppCVode.dylib
test ! `uname` = Darwin || install_name_tool -change libOMCppSolver.dylib @rpath/OMSICpp/libOMCppSolver.dylib $(OMBUILDDIR)/$(LIB_OMC)/OMSICpp/libOMCppEuler.dylib
# TODO: Fix this chaos!
# Correct every lib directly after it is compiled and before it is linked to the next target!
# Add RPATH handling to SimulationRuntime/OMSICpp/CMakeLists.txt
test ! `uname` = Darwin || install_name_tool -id @rpath/libOMCppDataExchange.dylib $(OMBUILDDIR)/$(LIB_OMC)/omsicpp/libOMCppDataExchange.dylib
test ! `uname` = Darwin || install_name_tool -change libOMCppExtensionUtilities.dylib @rpath/libOMCppDataExchange.dylib $(OMBUILDDIR)/$(LIB_OMC)/omsicpp/libOMCppDataExchange.dylib

test ! `uname` = Darwin || install_name_tool -id @rpath/libOMCppMath.dylib $(OMBUILDDIR)/$(LIB_OMC)/omsicpp/libOMCppMath.dylib
test ! `uname` = Darwin || install_name_tool -id @rpath/libOMCppExtensionUtilities.dylib $(OMBUILDDIR)/$(LIB_OMC)/omsicpp/libOMCppExtensionUtilities.dylib
test ! `uname` = Darwin || install_name_tool -id @rpath/libOMCppModelicaUtilities.dylib $(OMBUILDDIR)/$(LIB_OMC)/omsicpp/libOMCppModelicaUtilities.dylib

test ! `uname` = Darwin || install_name_tool -id @rpath/libOMCppEuler.dylib $(OMBUILDDIR)/$(LIB_OMC)/omsicpp/libOMCppEuler.dylib
test ! `uname` = Darwin || install_name_tool -change libOMCppSolver.dylib @rpath/libOMCppSolver.dylib $(OMBUILDDIR)/$(LIB_OMC)/omsicpp/libOMCppEuler.dylib
test ! `uname` = Darwin || install_name_tool -change libOMCppMath.dylib @rpath/libOMCppMath.dylib $(OMBUILDDIR)/$(LIB_OMC)/omsicpp/libOMCppEuler.dylib
test ! `uname` = Darwin || install_name_tool -change libOMCppExtensionUtilities.dylib @rpath/libOMCppExtensionUtilities.dylib $(OMBUILDDIR)/$(LIB_OMC)/omsicpp/libOMCppEuler.dylib

test ! `uname` = Darwin || install_name_tool -id @rpath/libOMCppRTEuler.dylib $(OMBUILDDIR)/$(LIB_OMC)/omsicpp/libOMCppRTEuler.dylib
test ! `uname` = Darwin || install_name_tool -change libOMCppSolver.dylib @rpath/libOMCppSolver.dylib $(OMBUILDDIR)/$(LIB_OMC)/omsicpp/libOMCppRTEuler.dylib
test ! `uname` = Darwin || install_name_tool -change libOMCppMath.dylib @rpath/libOMCppMath.dylib $(OMBUILDDIR)/$(LIB_OMC)/omsicpp/libOMCppRTEuler.dylib
test ! `uname` = Darwin || install_name_tool -change libOMCppExtensionUtilities.dylib @rpath/libOMCppExtensionUtilities.dylib $(OMBUILDDIR)/$(LIB_OMC)/omsicpp/libOMCppRTEuler.dylib

test ! `uname` = Darwin || install_name_tool -id @rpath/libOMCppRK12.dylib $(OMBUILDDIR)/$(LIB_OMC)/omsicpp/libOMCppRK12.dylib
test ! `uname` = Darwin || install_name_tool -change libOMCppSolver.dylib @rpath/libOMCppSolver.dylib $(OMBUILDDIR)/$(LIB_OMC)/omsicpp/libOMCppRK12.dylib
test ! `uname` = Darwin || install_name_tool -change libOMCppMath.dylib @rpath/libOMCppMath.dylib $(OMBUILDDIR)/$(LIB_OMC)/omsicpp/libOMCppRK12.dylib
test ! `uname` = Darwin || install_name_tool -change libOMCppExtensionUtilities.dylib @rpath/libOMCppExtensionUtilities.dylib $(OMBUILDDIR)/$(LIB_OMC)/omsicpp/libOMCppRK12.dylib

test ! `uname` = Darwin || install_name_tool -id @rpath/libOMCppNewton.dylib $(OMBUILDDIR)/$(LIB_OMC)/omsicpp/libOMCppNewton.dylib
test ! `uname` = Darwin || install_name_tool -change libOMCppSolver.dylib @rpath/libOMCppSolver.dylib $(OMBUILDDIR)/$(LIB_OMC)/omsicpp/libOMCppNewton.dylib
test ! `uname` = Darwin || install_name_tool -change libOMCppMath.dylib @rpath/libOMCppMath.dylib $(OMBUILDDIR)/$(LIB_OMC)/omsicpp/libOMCppNewton.dylib
test ! `uname` = Darwin || install_name_tool -change libOMCppExtensionUtilities.dylib @rpath/libOMCppExtensionUtilities.dylib $(OMBUILDDIR)/$(LIB_OMC)/omsicpp/libOMCppNewton.dylib

test ! `uname` = Darwin || install_name_tool -id @rpath/libOMCppSimulationSettings.dylib $(OMBUILDDIR)/$(LIB_OMC)/omsicpp/libOMCppSimulationSettings.dylib
test ! `uname` = Darwin || install_name_tool -change libOMCppExtensionUtilities.dylib @rpath/libOMCppExtensionUtilities.dylib $(OMBUILDDIR)/$(LIB_OMC)/omsicpp/libOMCppSimulationSettings.dylib

test ! `uname` = Darwin || install_name_tool -id @rpath/libOMCppSolver.dylib $(OMBUILDDIR)/$(LIB_OMC)/omsicpp/libOMCppSolver.dylib
test ! `uname` = Darwin || install_name_tool -change libOMCppMath.dylib @rpath/libOMCppMath.dylib $(OMBUILDDIR)/$(LIB_OMC)/omsicpp/libOMCppSolver.dylib
test ! `uname` = Darwin || install_name_tool -change libOMCppExtensionUtilities.dylib @rpath/libOMCppExtensionUtilities.dylib $(OMBUILDDIR)/$(LIB_OMC)/omsicpp/libOMCppSolver.dylib

test ! `uname` = Darwin || install_name_tool -id @rpath/libOMCppSystemBase.dylib $(OMBUILDDIR)/$(LIB_OMC)/omsicpp/libOMCppSystemBase.dylib
test ! `uname` = Darwin || install_name_tool -change libOMCppSimulationSettings.dylib @rpath/libOMCppSimulationSettings.dylib $(OMBUILDDIR)/$(LIB_OMC)/omsicpp/libOMCppSystemBase.dylib
test ! `uname` = Darwin || install_name_tool -change libOMCppExtensionUtilities.dylib @rpath/libOMCppExtensionUtilities.dylib $(OMBUILDDIR)/$(LIB_OMC)/omsicpp/libOMCppSystemBase.dylib

test ! `uname` = Darwin || install_name_tool -id @rpath/libOMCppIDA.dylib $(OMBUILDDIR)/$(LIB_OMC)/omsicpp/libOMCppIDA.dylib
test ! `uname` = Darwin || install_name_tool -change libOMCppSolver.dylib @rpath/libOMCppSolver.dylib $(OMBUILDDIR)/$(LIB_OMC)/omsicpp/libOMCppIDA.dylib
test ! `uname` = Darwin || install_name_tool -change libOMCppExtensionUtilities.dylib @rpath/libOMCppExtensionUtilities.dylib $(OMBUILDDIR)/$(LIB_OMC)/omsicpp/libOMCppIDA.dylib
test ! `uname` = Darwin || install_name_tool -change libOMCppMath.dylib @rpath/libOMCppMath.dylib $(OMBUILDDIR)/$(LIB_OMC)/omsicpp/libOMCppIDA.dylib

test ! `uname` = Darwin || install_name_tool -id @rpath/libOMCppFMU.dylib $(OMBUILDDIR)/$(LIB_OMC)/omsicpp/libOMCppFMU.dylib
test ! `uname` = Darwin || install_name_tool -change libOMCppExtensionUtilities.dylib @rpath/libOMCppExtensionUtilities.dylib $(OMBUILDDIR)/$(LIB_OMC)/omsicpp/libOMCppFMU.dylib

test ! `uname` = Darwin || install_name_tool -id @rpath/libOMCppKinsol.dylib $(OMBUILDDIR)/$(LIB_OMC)/omsicpp/libOMCppKinsol.dylib
test ! `uname` = Darwin || install_name_tool -change libOMCppSolver.dylib @rpath/libOMCppSolver.dylib $(OMBUILDDIR)/$(LIB_OMC)/omsicpp/libOMCppKinsol.dylib
test ! `uname` = Darwin || install_name_tool -change libOMCppExtensionUtilities.dylib @rpath/libOMCppExtensionUtilities.dylib $(OMBUILDDIR)/$(LIB_OMC)/omsicpp/libOMCppKinsol.dylib
test ! `uname` = Darwin || install_name_tool -change libOMCppMath.dylib @rpath/libOMCppMath.dylib $(OMBUILDDIR)/$(LIB_OMC)/omsicpp/libOMCppKinsol.dylib

test ! `uname` = Darwin || install_name_tool -id @rpath/libOMCppExtendedSystem.dylib $(OMBUILDDIR)/$(LIB_OMC)/omsicpp/libOMCppExtendedSystem.dylib
test ! `uname` = Darwin || install_name_tool -change libOMCppSystemBase.dylib @rpath/libOMCppSystemBase.dylib $(OMBUILDDIR)/$(LIB_OMC)/omsicpp/libOMCppExtendedSystem.dylib
test ! `uname` = Darwin || install_name_tool -change libOMCppSimulationSettings.dylib @rpath/libOMCppSimulationSettings.dylib $(OMBUILDDIR)/$(LIB_OMC)/omsicpp/libOMCppExtendedSystem.dylib
test ! `uname` = Darwin || install_name_tool -change libOMCppExtensionUtilities.dylib @rpath/libOMCppExtensionUtilities.dylib $(OMBUILDDIR)/$(LIB_OMC)/omsicpp/libOMCppExtendedSystem.dylib

test ! `uname` = Darwin || install_name_tool -id @rpath/libOMCppSystemOMSI.dylib $(OMBUILDDIR)/$(LIB_OMC)/omsicpp/libOMCppSystemOMSI.dylib
test ! `uname` = Darwin || install_name_tool -change libOMCppExtendedSystem.dylib @rpath/libOMCppExtendedSystem.dylib $(OMBUILDDIR)/$(LIB_OMC)/omsicpp/libOMCppSystemOMSI.dylib
test ! `uname` = Darwin || install_name_tool -change libOMCppSystemBase.dylib @rpath/libOMCppSystemBase.dylib $(OMBUILDDIR)/$(LIB_OMC)/omsicpp/libOMCppSystemOMSI.dylib
test ! `uname` = Darwin || install_name_tool -change libOMCppSimulationSettings.dylib @rpath/libOMCppSimulationSettings.dylib $(OMBUILDDIR)/$(LIB_OMC)/omsicpp/libOMCppSystemOMSI.dylib
test ! `uname` = Darwin || install_name_tool -change libOMCppExtensionUtilities.dylib @rpath/libOMCppExtensionUtilities.dylib $(OMBUILDDIR)/$(LIB_OMC)/omsicpp/libOMCppSystemOMSI.dylib

test ! `uname` = Darwin || install_name_tool -id @rpath/libOMCppCVode.dylib $(OMBUILDDIR)/$(LIB_OMC)/omsicpp/libOMCppCVode.dylib
test ! `uname` = Darwin || install_name_tool -change libOMCppSolver.dylib @rpath/libOMCppSolver.dylib $(OMBUILDDIR)/$(LIB_OMC)/omsicpp/libOMCppCVode.dylib
test ! `uname` = Darwin || install_name_tool -change libOMCppExtensionUtilities.dylib @rpath/libOMCppExtensionUtilities.dylib $(OMBUILDDIR)/$(LIB_OMC)/omsicpp/libOMCppCVode.dylib
test ! `uname` = Darwin || install_name_tool -change libOMCppMath.dylib @rpath/libOMCppMath.dylib $(OMBUILDDIR)/$(LIB_OMC)/omsicpp/libOMCppCVode.dylib

test ! `uname` = Darwin || install_name_tool -id @rpath/libOMCppUmfPack.dylib $(OMBUILDDIR)/$(LIB_OMC)/omsicpp/libOMCppUmfPack.dylib
test ! `uname` = Darwin || install_name_tool -change libOMCppSolver.dylib @rpath/libOMCppSolver.dylib $(OMBUILDDIR)/$(LIB_OMC)/omsicpp/libOMCppUmfPack.dylib
test ! `uname` = Darwin || install_name_tool -change libOMCppMath.dylib @rpath/libOMCppMath.dylib $(OMBUILDDIR)/$(LIB_OMC)/omsicpp/libOMCppUmfPack.dylib
test ! `uname` = Darwin || install_name_tool -change libOMCppExtensionUtilities.dylib @rpath/libOMCppExtensionUtilities.dylib $(OMBUILDDIR)/$(LIB_OMC)/omsicpp/libOMCppUmfPack.dylib

test ! `uname` = Darwin || install_name_tool -id @rpath/libOMCppLinearSolver.dylib $(OMBUILDDIR)/$(LIB_OMC)/omsicpp/libOMCppLinearSolver.dylib
test ! `uname` = Darwin || install_name_tool -change libOMCppSolver.dylib @rpath/libOMCppSolver.dylib $(OMBUILDDIR)/$(LIB_OMC)/omsicpp/libOMCppLinearSolver.dylib
test ! `uname` = Darwin || install_name_tool -change libOMCppExtensionUtilities.dylib @rpath/libOMCppExtensionUtilities.dylib $(OMBUILDDIR)/$(LIB_OMC)/omsicpp/libOMCppLinearSolver.dylib
test ! `uname` = Darwin || install_name_tool -change libOMCppMath.dylib @rpath/libOMCppMath.dylib $(OMBUILDDIR)/$(LIB_OMC)/omsicpp/libOMCppLinearSolver.dylib

test ! `uname` = Darwin || install_name_tool -id @rpath/libOMCppSimController.dylib $(OMBUILDDIR)/$(LIB_OMC)/omsicpp/libOMCppSimController.dylib
test ! `uname` = Darwin || install_name_tool -change libOMCppModelicaUtilities.dylib @rpath/libOMCppModelicaUtilities.dylib $(OMBUILDDIR)/$(LIB_OMC)/omsicpp/libOMCppSimController.dylib
test ! `uname` = Darwin || install_name_tool -change libOMCppExtensionUtilities.dylib @rpath/libOMCppExtensionUtilities.dylib $(OMBUILDDIR)/$(LIB_OMC)/omsicpp/libOMCppSimController.dylib

# This should be done somewhere else as well...
test ! `uname` = Darwin || install_name_tool -add_rpath @executable_path/../$(LIB_OMC)/omsicpp/ $(OMBUILDDIR)/bin/OMCppOSUSimulation
test ! `uname` = Darwin || install_name_tool -change libOMCppExtensionUtilities.dylib @rpath/libOMCppExtensionUtilities.dylib $(OMBUILDDIR)/bin/OMCppOSUSimulation
test ! `uname` = Darwin || install_name_tool -change libOMCppModelicaUtilities.dylib @rpath/libOMCppModelicaUtilities.dylib $(OMBUILDDIR)/bin/OMCppOSUSimulation

OMSICPPclean:
$(MAKE) -C SimulationRuntime/OMSICpp/ -f $(defaultMakefileTarget) clean OMBUILDDIR=$(OMBUILDDIR)
rm -rf $(OMBUILDDIR)/$(LIB_OMC)/omsicpp
2 changes: 2 additions & 0 deletions OMCompiler/SimulationRuntime/c/Makefile.common
Expand Up @@ -287,6 +287,8 @@ install: bootstrap-dependencies $(LIBSIMULATION) $(LIBFMIRUNTIME) $(ALL_OBJS) fm
test ! -f libSimulationRuntimeC.bc || cp libSimulationRuntimeC.bc $(builddir_lib)/emcc/libSimulationRuntimeC.so
test ! `uname` = Darwin || install_name_tool -change libsundials_idas.0.dylib @rpath/libsundials_idas.0.dylib $(builddir_lib)/$(LIBFMIRUNTIME)
test ! `uname` = Darwin || install_name_tool -change libsundials_ida.2.dylib @rpath/libsundials_ida.2.dylib $(builddir_lib)/$(LIBFMIRUNTIME)
test ! `uname` = Darwin || install_name_tool -change libsundials_cvodes.2.dylib @rpath/libsundials_cvodes.2.dylib $(builddir_lib)/$(LIBFMIRUNTIME)
test ! `uname` = Darwin || install_name_tool -change libsundials_cvode.1.dylib @rpath/libsundials_cvode.1.dylib $(builddir_lib)/$(LIBFMIRUNTIME)
test ! `uname` = Darwin || install_name_tool -change libsundials_nvecserial.0.dylib @rpath/libsundials_nvecserial.0.dylib $(builddir_lib)/$(LIBFMIRUNTIME)
test ! `uname` = Darwin || install_name_tool -change libsundials_kinsol.1.dylib @rpath/libsundials_kinsol.1.dylib $(builddir_lib)/$(LIBFMIRUNTIME)
# C runtime libs
Expand Down

0 comments on commit 58b509d

Please sign in to comment.