Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exclude unnecessary files from the lib/OMSimulator folder #952

Merged
merged 1 commit into from
Feb 17, 2021

Conversation

lochel
Copy link
Member

@lochel lochel commented Feb 17, 2021

Related Issues

Purpose

This should exclude unnecessary files from the lib/OMSimulator folder.

@lochel lochel added the CI/MINGW32 Activate mingw32 build and test in PR label Feb 17, 2021
@lochel
Copy link
Member Author

lochel commented Feb 17, 2021

@adeas31 I could only test it on linux and there we copy the lib instead of bin folder. Please test it on Windows if you can and let me know what other files I have to exclude.

@lochel lochel removed the CI/MINGW32 Activate mingw32 build and test in PR label Feb 17, 2021
@AnHeuermann
Copy link
Member

Before:

Andreas@DESKTOP-OSJIVA0 MINGW64 /d/workspace/OpenModelica
# ls build/lib/OMSimulator/
__init__.py               libhdf5-0.dll                libpcre2-posix-2.dll                    libsundials_sunnonlinsolnewton.dll  Qt5OpenGL.dll
assetimporters            libiconv-2.dll               libpcre32-0.dll                         libsystre-0.dll                     Qt5Positioning.dll
audio                     libicudt67.dll               libpcrecpp-0.dll                        libszip.dll                         Qt5PrintSupport.dll
bearer                    libicudtd67.dll              libpcreposix-0.dll                      libtre-5.dll                        Qt5Qml.dll
blas_win32_MT.dll         libicuin67.dll               libpng16-16.dll                         libunistring-2.dll                  Qt5QmlModels.dll
canbus                    libicuind67.dll              libquadmath-0.dll                       libwebp-7.dll                       Qt5Quick.dll
capi.py                   libicuuc67.dll               libsqlite3-0.dll                        libwinpthread-1.dll                 Qt5Sensors.dll
designer                  libicuucd67.dll              libstdc++-6.dll                         libwoff2common.dll                  Qt5Sql.dll
gamepads                  libintl-8.dll                libsundials_arkode.dll                  libwoff2dec.dll                     Qt5Svg.dll
generic                   libjpeg-8.dll                libsundials_cvode.dll                   libxml2-2.dll                       Qt5WebChannel.dll
geometryloaders           liblzma-5.dll                libsundials_cvodes.dll                  libxslt-1.dll                       Qt5WebKit.dll
geoservices               libnghttp2-14.dll            libsundials_ida.dll                     libzmq.dll                          Qt5WebKitWidgets.dll
iconengines               libomopcua.dll               libsundials_idas.dll                    libzstd.dll                         Qt5Widgets.dll
imageformats              libOMSimulator.dll           libsundials_kinsol.dll                  mediaservice                        Qt5Xml.dll
lapack_win32_MT.dll       libomtlmsimulator.dll        libsundials_nvecmanyvector.dll          Model.py                            Qt5XmlPatterns.dll
libbrotlicommon.dll       libopenblas.dll              libsundials_nvecserial.dll              NewAPI.py                           renderers
libbrotlidec.dll          libOpenModelicaCompiler.dll  libsundials_sunlinsolband.dll           omniORB420_rt.dll                   renderplugins
libbz2-1.dll              libOpenThreads.dll           libsundials_sunlinsoldense.dll          omnithread40_rt.dll                 sceneparsers
libdouble-conversion.dll  libosg.dll                   libsundials_sunlinsolklu.dll            OMSimulator.py                      Scope.py
libexpat.dll              libosgDB.dll                 libsundials_sunlinsollapackband.dll     platforminputcontexts               sensorgestures
libexpat-1.dll            libosgGA.dll                 libsundials_sunlinsollapackdense.dll    platforms                           sensors
libffi-7.dll              libosgText.dll               libsundials_sunlinsolpcg.dll            playlistformats                     sqldrivers
libfontconfig-1.dll       libosgUtil.dll               libsundials_sunlinsolspbcgs.dll         position                            styles
libfreetype-6.dll         libosgViewer.dll             libsundials_sunlinsolspfgmr.dll         printsupport                        texttospeech
libgcc_s_seh-1.dll        libp11-kit-0.dll             libsundials_sunlinsolspgmr.dll          qmltooling                          Types.py
libgfortran-5.dll         libpcre-1.dll                libsundials_sunlinsolsptfqmr.dll        Qt5Core.dll                         virtualkeyboard
libglib-2.0-0.dll         libpcre16-0.dll              libsundials_sunmatrixband.dll           Qt5Gui.dll                          zlib1.dll
libgomp-1.dll             libpcre2-16-0.dll            libsundials_sunmatrixdense.dll          Qt5Multimedia.dll
libgraphite2.dll          libpcre2-32-0.dll            libsundials_sunmatrixsparse.dll         Qt5MultimediaWidgets.dll
libharfbuzz-0.dll         libpcre2-8-0.dll             libsundials_sunnonlinsolfixedpoint.dll  Qt5Network.dll

After:

Andreas@DESKTOP-OSJIVA0 MINGW64 /d/workspace/OpenModelica
# ls build/lib/OMSimulator/
__init__.py  capi.py  libOMSimulator.dll  libomtlmsimulator.dll  Model.py  NewAPI.py  OMSimulator.py  Scope.py  Types.py

Copy link
Member

@AnHeuermann AnHeuermann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can have a list with every item we want to install for now. There are not that many of them.

@@ -22,14 +22,14 @@ install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/Types.py" DESTINATION ${CMAKE_INSTALL

IF (WIN32 AND MSVC)
install(FILES OMSimulatorPython3.bat DESTINATION ${CMAKE_INSTALL_PREFIX}/bin PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ)
install(DIRECTORY ${CMAKE_INSTALL_PREFIX}/bin/ DESTINATION ${CMAKE_INSTALL_PREFIX}/lib/OMSimulator FILES_MATCHING PATTERN "*.dll" PATTERN "OMSimulator" EXCLUDE PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ)
install(DIRECTORY ${CMAKE_INSTALL_PREFIX}/bin/ DESTINATION ${CMAKE_INSTALL_PREFIX}/lib/OMSimulator FILES_MATCHING PATTERN "*imulator*.dll" PATTERN "OMSimulator" EXCLUDE PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have a bunch of libsundials_[...].dll. We actually don't need all of them, but a few are important.
I think for you it worked, because OMSimulator uses (nearly) the same version of SUNDIALS as OpenModelica, which has them as well.

We should come up with a smart way of adding 3rdParty libs OpenModelica and OMSimulator are using, so we only end up with one set of them and not two.
Also I need to change the installation of OMSimulator-3rdParty/cvode to only copy the libs we actually use in OMSimulator to install/.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apparently OMSimualtor.exe works finde without those libs. Strange. Did we compile it statically?

Copy link
Member

@AnHeuermann AnHeuermann Feb 17, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@adeas31
Copy link
Member

adeas31 commented Feb 17, 2021

For me its slightly better but the qt plugins folders are still there but they are empty.

image

@lochel
Copy link
Member Author

lochel commented Feb 17, 2021

Unfortunately excluding empty directories is not that easy in cmake, but I can exclude them by name.

@AnHeuermann
Copy link
Member

Oh, and I have libOMSimulator in build/bin/ and in build/lib/OMSimulator. We should remove the one from bin(?)

@lochel
Copy link
Member Author

lochel commented Feb 17, 2021

I think it is needed in bin

@AnHeuermann
Copy link
Member

For Linux I have a similar problem. libOMSimulator.so is at two places.

andreas@DESKTOP-OSJIVA0:~/workspace/OpenModelica$ ls build/lib/x86_64-linux-gnu/omc/
libOMSimulator.a  libOMSimulator.so  libOMSimulatorLua.a  libomtlmsimulator.so

andreas@DESKTOP-OSJIVA0:~/workspace/OpenModelica$ ls build/lib/OMSimulator/
Model.py  NewAPI.py  OMSimulator.py  Scope.py  Types.py  __init__.py  capi.py  x86_64-linux-gnu

andreas@DESKTOP-OSJIVA0:~/workspace/OpenModelica$ ls build/lib/OMSimulator/x86_64-linux-gnu/omc/
libOMSimulator.so  libomtlmsimulator.so

@adeas31
Copy link
Member

adeas31 commented Feb 17, 2021

I also think is needed in bin. @AnHeuermann you also have libOpenModelicaCompiler.dll at two places. Is because we install all libs in lib folder and then copy them to bin at least for Windows.

@AnHeuermann
Copy link
Member

Ah I see. The files are not that big (3MB), so it doesn't really matter. Otherwise a link could be a better solution.

@lochel
Copy link
Member Author

lochel commented Feb 17, 2021

I agree with @adeas31 that having those libs in two places is not a big problem and it is certainly not in the scope f this pull request.

Copy link
Member

@AnHeuermann AnHeuermann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems to work.

@lochel lochel merged commit ac94aaf into OpenModelica:master Feb 17, 2021
@lochel lochel deleted the install branch February 17, 2021 11:20
@adeas31
Copy link
Member

adeas31 commented Feb 17, 2021

So you didn't remove the empty qt plugin directories, right?

@lochel
Copy link
Member Author

lochel commented Feb 17, 2021

No, the empty folders are still there. I don't know how to remove them. Are they problematic?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants