Skip to content

Commit

Permalink
msvc: Simplify installation of OpenMP DLL and fix tests execution
Browse files Browse the repository at this point in the history
Test executables should use the same VCRedist libraries as Talipot
to avoid runtime errors due to binary incompatibility with those
installed on the system.

https://learn.microsoft.com/en-us/cpp/porting/binary-compat-2015-2017
  • Loading branch information
anlambert committed Jun 7, 2024
1 parent 3af8ce5 commit db9d75a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 61 deletions.
6 changes: 5 additions & 1 deletion .github/workflows/windows-msvc-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,11 @@ jobs:
%CLCACHE_MSBUILD_CONF%
- name: Run Talipot unit tests
working-directory: ./build
run: ctest --force-new-ctest-process --output-on-failure --build-config "Release"
run: |
xcopy C:\talipot\bin\msvcp* tests\plugins
xcopy C:\talipot\bin\vc* tests\plugins
xcopy C:\talipot\bin\concrt* tests\plugins
ctest --force-new-ctest-process --output-on-failure --build-config "Release"
- name: Check Talipot application can be executed
working-directory: C:/talipot/bin
run: talipot --check-application-starts --debug-plugins-load
Expand Down
63 changes: 3 additions & 60 deletions bundlers/win/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,68 +10,11 @@ CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/Talipot.nsi.in
${CMAKE_CURRENT_BINARY_DIR}/Talipot.nsi @ONLY)

IF(MSVC)
INCLUDE(InstallRequiredSystemLibraries)

IF(OPENMP_FOUND)
IF(MSVC90)
INSTALL(
PROGRAMS
"${MSVC90_REDIST_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.VC90.OPENMP/vcomp90.dll"
DESTINATION ${TalipotBinInstallDir})
ENDIF(MSVC90)

IF(MSVC10)
INSTALL(
PROGRAMS
"${MSVC10_REDIST_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.VC100.OPENMP/vcomp100.dll"
DESTINATION ${TalipotBinInstallDir})
ENDIF(MSVC10)

IF(MSVC11)
INSTALL(
PROGRAMS
"${MSVC11_REDIST_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.VC110.OPENMP/vcomp110.dll"
DESTINATION ${TalipotBinInstallDir})
ENDIF(MSVC11)

IF(MSVC12)
INSTALL(
PROGRAMS
"${MSVC12_REDIST_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.VC120.OPENMP/vcomp120.dll"
DESTINATION ${TalipotBinInstallDir})
ENDIF(MSVC12)

IF(MSVC_VERSION EQUAL 1900)
INSTALL(
PROGRAMS
"${MSVC_REDIST_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.VC140.OPENMP/vcomp140.dll"
DESTINATION ${TalipotBinInstallDir})
ELSEIF(MSVC_VERSION EQUAL 1910)
# Visual Studio 2017
INSTALL(
PROGRAMS
"${MSVC_REDIST_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.VC150.OPENMP/vcomp140.dll"
DESTINATION ${TalipotBinInstallDir})

ELSEIF(MSVC_VERSION GREATER 1910 AND MSVC_VERSION LESS 1920)
# Visual Studio 2019
INSTALL(
PROGRAMS
"${MSVC_REDIST_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.VC141.OPENMP/vcomp140.dll"
DESTINATION ${TalipotBinInstallDir})
ELSEIF(MSVC_VERSION GREATER_EQUAL 1920 AND MSVC_VERSION LESS 1930)
INSTALL(
PROGRAMS
"${MSVC_REDIST_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.VC142.OPENMP/vcomp140.dll"
DESTINATION ${TalipotBinInstallDir})
ELSEIF(MSVC_VERSION GREATER_EQUAL 1930)
# Visual Studio 2022
INSTALL(
PROGRAMS
"${MSVC_REDIST_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.VC143.OPENMP/vcomp140.dll"
DESTINATION ${TalipotBinInstallDir})
ENDIF()
SET(CMAKE_INSTALL_OPENMP_LIBRARIES TRUE)
ENDIF(OPENMP_FOUND)

INCLUDE(InstallRequiredSystemLibraries)
ENDIF(MSVC)

# initialize the list of bundle libs (second arg of FIXUP_BUNDLE), updated in
Expand Down

0 comments on commit db9d75a

Please sign in to comment.