diff --git a/ports/mpi/portfile.cmake b/ports/mpi/portfile.cmake index 065116c276a..89bec5e34c6 100644 --- a/ports/mpi/portfile.cmake +++ b/ports/mpi/portfile.cmake @@ -1 +1,5 @@ set(VCPKG_POLICY_EMPTY_PACKAGE enabled) + +if (VCPKG_TARGET_IS_WINDOWS) + file(INSTALL "${CURRENT_INSTALLED_DIR}/share/msmpi/mpi-wrapper.cmake" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME vcpkg-cmake-wrapper.cmake) +endif() diff --git a/ports/mpi/vcpkg.json b/ports/mpi/vcpkg.json index 386b978bd9c..2d5bbaddfd8 100644 --- a/ports/mpi/vcpkg.json +++ b/ports/mpi/vcpkg.json @@ -1,8 +1,9 @@ { "name": "mpi", "version-string": "1", - "port-version": 2, + "port-version": 3, "description": "Message Passing Interface (MPI) is a standardized and portable message-passing standard designed by a group of researchers from academia and industry to function on a wide variety of parallel computing architectures. The standard defines the syntax and semantics of a core of library routines useful to a wide range of users writing portable message-passing programs in C, C++, and Fortran. There are several well-tested and efficient implementations of MPI, many of which are open-source or in the public domain.", + "license": null, "supports": "!uwp", "dependencies": [ { diff --git a/ports/msmpi/mpi-wrapper.cmake b/ports/msmpi/mpi-wrapper.cmake new file mode 100644 index 00000000000..03fc46c4f5f --- /dev/null +++ b/ports/msmpi/mpi-wrapper.cmake @@ -0,0 +1,9 @@ +get_filename_component(_IMPORT_PREFIX "${CMAKE_CURRENT_LIST_FILE}" PATH) +get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH) +get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH) + +# Suitable for FindMPI.cmake line 937 +set(ENV{MSMPI_INC} "${_IMPORT_PREFIX}/include") +unset(_IMPORT_PREFIX) + +_find_package(${ARGS}) diff --git a/ports/msmpi/portfile.cmake b/ports/msmpi/portfile.cmake index c94e2c30490..75dd3905251 100644 --- a/ports/msmpi/portfile.cmake +++ b/ports/msmpi/portfile.cmake @@ -1,5 +1,5 @@ set(MSMPI_VERSION "10.1.12498") -set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/msmpi-${MSMPI_VERSION}) +set(SOURCE_PATH "${CURRENT_BUILDTREES_DIR}/src/msmpi-${MSMPI_VERSION}") vcpkg_download_distfile(SDK_ARCHIVE URLS "https://download.microsoft.com/download/a/5/2/a5207ca5-1203-491a-8fb8-906fd68ae623/msmpisdk.msi" @@ -27,10 +27,10 @@ if(EXISTS "${SYSTEM_MPIEXEC_FILEPATH}") set(MPIEXEC_VERSION_LOGNAME "mpiexec-version") vcpkg_execute_required_process( COMMAND ${SYSTEM_MPIEXEC_FILEPATH} - WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR} + WORKING_DIRECTORY "${CURRENT_BUILDTREES_DIR}" LOGNAME ${MPIEXEC_VERSION_LOGNAME} ) - file(READ ${CURRENT_BUILDTREES_DIR}/${MPIEXEC_VERSION_LOGNAME}-out.log MPIEXEC_OUTPUT) + file(READ "${CURRENT_BUILDTREES_DIR}/${MPIEXEC_VERSION_LOGNAME}-out.log" MPIEXEC_OUTPUT) if(MPIEXEC_OUTPUT MATCHES "\\[Version ([0-9]+\\.[0-9]+\\.[0-9]+)\\.[0-9]+\\]") if(NOT CMAKE_MATCH_1 STREQUAL MSMPI_VERSION) @@ -69,13 +69,13 @@ file(TO_NATIVE_PATH "${CURRENT_BUILDTREES_DIR}/msiexec-${TARGET_TRIPLET}.log" MS set(PARAM_MSI "/a \"${SDK_ARCHIVE}\"") set(PARAM_LOG "/log \"${MSIEXEC_LOG_PATH}\"") set(PARAM_TARGET_DIR "TARGETDIR=\"${SDK_SOURCE_DIR}\"") -set(SCRIPT_FILE ${CURRENT_BUILDTREES_DIR}/msiextract-msmpi.bat) +set(SCRIPT_FILE "${CURRENT_BUILDTREES_DIR}/msiextract-msmpi.bat") # Write the command out to a script file and run that to avoid weird escaping behavior when spaces are present file(WRITE ${SCRIPT_FILE} "msiexec ${PARAM_MSI} /qn ${PARAM_LOG} ${PARAM_TARGET_DIR}") vcpkg_execute_required_process( COMMAND ${SCRIPT_FILE} - WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR} + WORKING_DIRECTORY "${CURRENT_BUILDTREES_DIR}" LOGNAME extract-sdk ) @@ -92,34 +92,37 @@ file(INSTALL "${SOURCE_INCLUDE_PATH}/pmidbg.h" "${SOURCE_INCLUDE_PATH}/${TRIPLET_SYSTEM_ARCH}/mpifptr.h" DESTINATION - ${CURRENT_PACKAGES_DIR}/include + "${CURRENT_PACKAGES_DIR}/include" ) # NOTE: since the binary distribution does not include any debug libraries we always install the release libraries SET(VCPKG_POLICY_ONLY_RELEASE_CRT enabled) file(GLOB STATIC_LIBS - ${SOURCE_LIB_PATH}/${TRIPLET_SYSTEM_ARCH}/msmpifec.lib - ${SOURCE_LIB_PATH}/${TRIPLET_SYSTEM_ARCH}/msmpifmc.lib - ${SOURCE_LIB_PATH}/${TRIPLET_SYSTEM_ARCH}/msmpifes.lib - ${SOURCE_LIB_PATH}/${TRIPLET_SYSTEM_ARCH}/msmpifms.lib + "${SOURCE_LIB_PATH}/${TRIPLET_SYSTEM_ARCH}/msmpifec.lib" + "${SOURCE_LIB_PATH}/${TRIPLET_SYSTEM_ARCH}/msmpifmc.lib" + "${SOURCE_LIB_PATH}/${TRIPLET_SYSTEM_ARCH}/msmpifes.lib" + "${SOURCE_LIB_PATH}/${TRIPLET_SYSTEM_ARCH}/msmpifms.lib" ) file(INSTALL "${SOURCE_LIB_PATH}/${TRIPLET_SYSTEM_ARCH}/msmpi.lib" - DESTINATION ${CURRENT_PACKAGES_DIR}/lib + DESTINATION "${CURRENT_PACKAGES_DIR}/lib" ) file(INSTALL "${SOURCE_LIB_PATH}/${TRIPLET_SYSTEM_ARCH}/msmpi.lib" - DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib + DESTINATION "${CURRENT_PACKAGES_DIR}/debug/lib" ) if(VCPKG_CRT_LINKAGE STREQUAL "static") - file(INSTALL ${STATIC_LIBS} DESTINATION ${CURRENT_PACKAGES_DIR}/lib) - file(INSTALL ${STATIC_LIBS} DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib) + file(INSTALL ${STATIC_LIBS} DESTINATION "${CURRENT_PACKAGES_DIR}/lib") + file(INSTALL ${STATIC_LIBS} DESTINATION "${CURRENT_PACKAGES_DIR}/debug/lib") endif() + +file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/mpi-wrapper.cmake" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}") + # Handle copyright -file(COPY "${SOURCE_PATH}/sdk/PFiles/Microsoft SDKs/MPI/License/MicrosoftMPI-SDK-EULA.rtf" DESTINATION ${CURRENT_PACKAGES_DIR}/share/msmpi) -file(COPY "${SOURCE_PATH}/sdk/PFiles/Microsoft SDKs/MPI/License/MPI-SDK-TPN.txt" DESTINATION ${CURRENT_PACKAGES_DIR}/share/msmpi) -file(WRITE ${CURRENT_PACKAGES_DIR}/share/msmpi/copyright "See the accompanying MicrosoftMPI-SDK-EULA.rtf and MPI-SDK-TPN.txt") +file(COPY "${SOURCE_PATH}/sdk/PFiles/Microsoft SDKs/MPI/License/MicrosoftMPI-SDK-EULA.rtf" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}") +file(COPY "${SOURCE_PATH}/sdk/PFiles/Microsoft SDKs/MPI/License/MPI-SDK-TPN.txt" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}") +file(WRITE "${CURRENT_PACKAGES_DIR}/share/${PORT}/copyright" "See the accompanying MicrosoftMPI-SDK-EULA.rtf and MPI-SDK-TPN.txt") diff --git a/ports/msmpi/vcpkg.json b/ports/msmpi/vcpkg.json index d220c1d6189..97257148269 100644 --- a/ports/msmpi/vcpkg.json +++ b/ports/msmpi/vcpkg.json @@ -1,7 +1,7 @@ { "name": "msmpi", "version": "10.1.12498", - "port-version": 3, + "port-version": 4, "description": "Microsoft MPI (MS-MPI) is a Microsoft implementation of the Message Passing Interface standard for developing and running parallel applications on the Windows platform.", "homepage": "https://docs.microsoft.com/en-us/message-passing-interface/microsoft-mpi", "license": "MIT", diff --git a/versions/baseline.json b/versions/baseline.json index ecb06f74b35..887b8ddded5 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -4658,7 +4658,7 @@ }, "mpi": { "baseline": "1", - "port-version": 2 + "port-version": 3 }, "mpir": { "baseline": "2022-03-02", @@ -4710,7 +4710,7 @@ }, "msmpi": { "baseline": "10.1.12498", - "port-version": 3 + "port-version": 4 }, "mstch": { "baseline": "1.0.2", diff --git a/versions/m-/mpi.json b/versions/m-/mpi.json index 599d1b627a8..d177803d619 100644 --- a/versions/m-/mpi.json +++ b/versions/m-/mpi.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "2eacb3d18a3407d1ceb6211ee7cad0b157249d22", + "version-string": "1", + "port-version": 3 + }, { "git-tree": "783aea281dc7cdf59ec0636bd60c2feaef6595b4", "version-string": "1", diff --git a/versions/m-/msmpi.json b/versions/m-/msmpi.json index 16149fa9555..1cca454f394 100644 --- a/versions/m-/msmpi.json +++ b/versions/m-/msmpi.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "d3ccfae00ebdaac2c41fa2acfa59b862171be3ae", + "version": "10.1.12498", + "port-version": 4 + }, { "git-tree": "92f5e217faeaf4ec7e205a56bfff3a13b75e0393", "version": "10.1.12498",