Changeset d632ee4a in OpenModelica


Ignore:
Timestamp:
2022-05-17T16:19:19+02:00 (2 years ago)
Author:
GitHub <noreply@…>
Branches:
maintenance/v1.20, maintenance/v1.21, maintenance/v1.22, maintenance/v1.23, master
Children:
4a24650, f18a4b21
Parents:
d1015711
git-author:
Mahder Gebremedhin <mahge@…> (05/17/22 16:19:19)
git-committer:
GitHub <noreply@…> (05/17/22 16:19:19)
Message:

Minor fixes for ModelicaExternalC and CPP runtime builds. (#8972)

  • ModelicaExternalC stand alone CMake build:
    • Link to libm only on Unix.
    • Export all symbols with MSVC. This is not needed right now as the stand alone build is only meant to be used for the Autoconf build system. The CMake build system has another (not the standalone) CMake file that it uses that is integrated in to the whole OpenModelica build.
  • CPP runtime
    • Fix the install directory for CPP runtime shared libs. They want to be in the lib folder even on Windows (instead of the bin dir). The should be fixed from the other side and the libraries should be added into the bin dir together with the other DLLs OpenModelica builds.
  • Remove unnecessary manually set LPACK libraries string. It is not needed.
Location:
OMCompiler/SimulationRuntime
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • OMCompiler/SimulationRuntime/ModelicaExternalC/MEC_standalone_2.8.cmake

    ra71d04e rd632ee4a  
    1414link_directories(${CMAKE_INSTALL_LIBDIR} ${CMAKE_INSTALL_BINDIR})
    1515
    16 # Set the rpath to the same dir as the destination of the libs
    17 # when installing. This should be enough since the dependencies
    18 # (libOpenModelicaRuntimeC and libomcgc) should end up in the same
    19 # dir as well (lib/<arch>/omc/ on linux or bin/ on Windows).
    20 set(CMAKE_INSTALL_RPATH $ORIGIN)
     16# Set the rpath to the one dir up as the destination of the libs
     17# when installing is an 'ffi' directory in the lib directory.
     18# See the install commnad at the end of this file. If that is
     19# changed make sure to adjust this as well.
     20if(APPLE)
     21  set(CMAKE_INSTALL_RPATH "@loader_path/../../${CMAKE_INSTALL_LIBDIR}")
     22else()
     23  set(CMAKE_INSTALL_RPATH "$ORIGIN;$ORIGIN/../../${CMAKE_INSTALL_LIBDIR}")
     24endif()
    2125
    2226## ModelicaExternalC #########################################################################
     
    3034add_library(omc::simrt::Modelica::ExternalC ALIAS ModelicaExternalC)
    3135
    32 target_link_libraries(ModelicaExternalC PUBLIC m)
     36if(UNIX)
     37  target_link_libraries(ModelicaExternalC PUBLIC m)
     38endif()
     39
    3340target_link_libraries(ModelicaExternalC PUBLIC OpenModelicaRuntimeC)
    3441target_link_libraries(ModelicaExternalC PUBLIC omcgc)
     
    4047                      PROPERTIES OUTPUT_NAME ModelicaExternalC CLEAN_DIRECT_OUTPUT 1)
    4148
    42 target_link_libraries(ModelicaExternalC_shared PUBLIC m)
     49if(UNIX)
     50  target_link_libraries(ModelicaExternalC_shared PUBLIC m)
     51endif()
     52
    4353target_link_libraries(ModelicaExternalC_shared PUBLIC OpenModelicaRuntimeC)
    4454target_link_libraries(ModelicaExternalC_shared PUBLIC omcgc)
    4555
    46 if(WIN32)
     56if(MINGW)
    4757  set_target_properties(ModelicaExternalC_shared PROPERTIES LINK_FLAGS "-Wl,--export-all-symbols")
     58elseif(MSVC)
     59  set_target_properties(ModelicaExternalC_shared PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS true)
    4860endif()
    4961
     
    7183target_link_libraries(ModelicaMatIO_shared PUBLIC OpenModelicaRuntimeC)
    7284target_link_libraries(ModelicaMatIO_shared PUBLIC omcgc)
    73 if(WIN32)
     85
     86if(MINGW)
    7487  set_target_properties(ModelicaMatIO_shared PROPERTIES LINK_FLAGS "-Wl,--export-all-symbols")
     88elseif(MSVC)
     89  set_target_properties(ModelicaMatIO_shared PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS true)
    7590endif()
    7691
     
    91106
    92107target_link_libraries(ModelicaIO_shared PUBLIC ModelicaMatIO_shared)
    93 if(WIN32)
     108if(MINGW)
    94109  set_target_properties(ModelicaIO_shared PROPERTIES LINK_FLAGS "-Wl,--export-all-symbols")
     110elseif(MSVC)
     111  set_target_properties(ModelicaIO_shared PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS true)
    95112endif()
    96113
     
    108125
    109126target_link_libraries(ModelicaStandardTables PUBLIC ModelicaIO)
    110 target_link_libraries(ModelicaStandardTables PUBLIC m)
     127if(UNIX)
     128  target_link_libraries(ModelicaStandardTables PUBLIC m)
     129endif()
    111130
    112131# Shared version
     
    120139
    121140target_link_libraries(ModelicaStandardTables_shared PUBLIC ModelicaIO_shared)
    122 target_link_libraries(ModelicaStandardTables_shared PUBLIC m)
    123 if(WIN32)
     141if(UNIX)
     142  target_link_libraries(ModelicaStandardTables_shared PUBLIC m)
     143endif()
     144
     145if(MINGW)
    124146  set_target_properties(ModelicaStandardTables_shared PROPERTIES LINK_FLAGS "-Wl,--export-all-symbols")
     147elseif(MSVC)
     148  set_target_properties(ModelicaStandardTables_shared PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS true)
    125149endif()
    126150
  • OMCompiler/SimulationRuntime/cpp/Core/CMakeLists.txt

    rd9b9ced9 rd632ee4a  
    88set(Boost_LIBS_ ".")
    99set(LAPACK_LIBS_ ".")
    10 set(LAPACK_LIBRARIES_ "-llapack -lblas")
     10set(LAPACK_LIBRARIES_ "")
    1111set(SYSTEM_CFLAGS ${SYSTEM_CFLAGS} "-DOMC_BUILD -fPIC -DUSE_THREAD")
    1212
  • OMCompiler/SimulationRuntime/cpp/cmake_3.14.cmake

    rf6dfe83 rd632ee4a  
    66# CPP libs should be installed to in lib/<arch>/omc/cpp/ for now.
    77set(CMAKE_INSTALL_LIBDIR ${CMAKE_INSTALL_LIBDIR}/cpp)
     8set(CMAKE_INSTALL_BINDIR ${CMAKE_INSTALL_LIBDIR})
    89# CPP headers are installed in include/omc/cpp for now.
    910set(CMAKE_INSTALL_INCLUDEDIR ${CMAKE_INSTALL_INCLUDEDIR}/cpp)
Note: See TracChangeset for help on using the changeset viewer.