From 455223d009fc6fef0d9293e511d64e9e372abdb0 Mon Sep 17 00:00:00 2001 From: Stefano Sinigardi Date: Wed, 31 Jul 2019 23:47:59 +0200 Subject: [PATCH] [OpenMPI] add a new port (#7142) * [OpenMPI] add a new port * [OpenMPI] enable VCPKG_CONCURRENCY * [OpenMPI] fix prefix * [OpenMPI] fix license installation, compatible with single config build * [many ports] enable portable mpi implementation * [bond] Update Haskell stack SHA512 --- ports/bond/CONTROL | 12 +-- ports/boost-mpi/CONTROL | 4 +- ports/boost-vcpkg-helpers/generate-ports.ps1 | 2 +- ports/hdf5/CONTROL | 4 +- ports/hypre/CONTROL | 2 +- ports/kealib/CONTROL | 4 +- ports/mpi/CONTROL | 4 + ports/mpi/portfile.cmake | 3 + ports/msmpi/portfile.cmake | 4 + ports/openmpi/CONTROL | 4 + ports/openmpi/portfile.cmake | 100 +++++++++++++++++++ ports/parmetis/CONTROL | 2 +- ports/vtk/CONTROL | 4 +- 13 files changed, 132 insertions(+), 17 deletions(-) create mode 100644 ports/mpi/CONTROL create mode 100644 ports/mpi/portfile.cmake create mode 100644 ports/openmpi/CONTROL create mode 100644 ports/openmpi/portfile.cmake diff --git a/ports/bond/CONTROL b/ports/bond/CONTROL index 6e5daf0a9015b5..a4361dfb0420d4 100644 --- a/ports/bond/CONTROL +++ b/ports/bond/CONTROL @@ -1,6 +1,6 @@ -Source: bond -Maintainer: bond@microsoft.com -Version: 8.1.0-2 -Description: Bond is a cross-platform framework for working with schematized data. It supports cross-language de/serialization and powerful generic mechanisms for efficiently manipulating data. Bond is broadly used at Microsoft in high scale services. -Homepage: https://github.com/Microsoft/bond -Build-Depends: rapidjson, boost-config, boost-utility, boost-assign +Source: bond +Maintainer: bond@microsoft.com +Version: 8.1.0-2 +Description: Bond is a cross-platform framework for working with schematized data. It supports cross-language de/serialization and powerful generic mechanisms for efficiently manipulating data. Bond is broadly used at Microsoft in high scale services. +Homepage: https://github.com/Microsoft/bond +Build-Depends: rapidjson, boost-config, boost-utility, boost-assign diff --git a/ports/boost-mpi/CONTROL b/ports/boost-mpi/CONTROL index 3e788cd09aeb3b..8440a2f9590baf 100644 --- a/ports/boost-mpi/CONTROL +++ b/ports/boost-mpi/CONTROL @@ -1,6 +1,6 @@ # Automatically generated by boost-vcpkg-helpers/generate-ports.ps1 Source: boost-mpi -Version: 1.70.0-1 -Build-Depends: boost-assert, boost-build, boost-compatibility, boost-config, boost-core, boost-foreach, boost-function, boost-graph, boost-integer, boost-iterator, boost-lexical-cast, boost-math, boost-modular-build-helper, boost-mpl, boost-optional, boost-property-map, boost-python (windows), boost-serialization, boost-smart-ptr, boost-static-assert, boost-throw-exception, boost-type-traits, boost-utility, boost-vcpkg-helpers, msmpi +Version: 1.70.0-2 +Build-Depends: boost-assert, boost-build, boost-compatibility, boost-config, boost-core, boost-foreach, boost-function, boost-graph, boost-integer, boost-iterator, boost-lexical-cast, boost-math, boost-modular-build-helper, boost-mpl, boost-optional, boost-property-map, boost-python (windows), boost-serialization, boost-smart-ptr, boost-static-assert, boost-throw-exception, boost-type-traits, boost-utility, boost-vcpkg-helpers, mpi Homepage: https://github.com/boostorg/mpi Description: Boost mpi module diff --git a/ports/boost-vcpkg-helpers/generate-ports.ps1 b/ports/boost-vcpkg-helpers/generate-ports.ps1 index 7ab6c968096560..8a6dc79d10ff5f 100644 --- a/ports/boost-vcpkg-helpers/generate-ports.ps1 +++ b/ports/boost-vcpkg-helpers/generate-ports.ps1 @@ -368,7 +368,7 @@ foreach ($library in $libraries) } elseif ($library -eq "mpi") { - $deps += @("msmpi") + $deps += @("mpi") } Generate ` diff --git a/ports/hdf5/CONTROL b/ports/hdf5/CONTROL index 18f03e4871491d..542062c5067a10 100644 --- a/ports/hdf5/CONTROL +++ b/ports/hdf5/CONTROL @@ -1,12 +1,12 @@ Source: hdf5 -Version: 1.10.5-7 +Version: 1.10.5-8 Homepage: https://www.hdfgroup.org/downloads/hdf5/ Description: HDF5 is a data model, library, and file format for storing and managing data Build-Depends: zlib, szip Feature: parallel Description: parallel support for HDF5 -Build-Depends: msmpi +Build-Depends: mpi Feature: cpp Description: Builds cpp lib diff --git a/ports/hypre/CONTROL b/ports/hypre/CONTROL index 6151eca3b5a7cb..91d281589a325b 100644 --- a/ports/hypre/CONTROL +++ b/ports/hypre/CONTROL @@ -2,4 +2,4 @@ Source: hypre Version: 2.11.2-2 Homepage: https://computation.llnl.gov/projects/hypre-scalable-linear-solvers-multigrid-methods Description: SCALABLE LINEAR SOLVERS AND MULTIGRID METHODS -Build-Depends: msmpi +Build-Depends: mpi diff --git a/ports/kealib/CONTROL b/ports/kealib/CONTROL index 9e2b6549c6bec5..bb2b4cd48773e6 100644 --- a/ports/kealib/CONTROL +++ b/ports/kealib/CONTROL @@ -1,9 +1,9 @@ Source: kealib -Version: 1.4.11 +Version: 1.4.11-1 Build-Depends: hdf5[cpp], zlib, szip Homepage: https://bitbucket.org/chchrsc/kealib Description: kealib is gdal model using HDF5 standard. Feature: parallel Description: Use parallel support for HDF5 -Build-Depends: hdf5[parallel], msmpi +Build-Depends: hdf5[parallel], mpi diff --git a/ports/mpi/CONTROL b/ports/mpi/CONTROL new file mode 100644 index 00000000000000..b5db97f1338293 --- /dev/null +++ b/ports/mpi/CONTROL @@ -0,0 +1,4 @@ +Source: mpi +Version: 1 +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. +Build-Depends: msmpi (windows), openmpi (!windows) diff --git a/ports/mpi/portfile.cmake b/ports/mpi/portfile.cmake new file mode 100644 index 00000000000000..e46edeb4354dde --- /dev/null +++ b/ports/mpi/portfile.cmake @@ -0,0 +1,3 @@ +include(vcpkg_common_functions) + +set(VCPKG_POLICY_EMPTY_PACKAGE enabled) diff --git a/ports/msmpi/portfile.cmake b/ports/msmpi/portfile.cmake index c55a494124575c..10482cb0a026e9 100644 --- a/ports/msmpi/portfile.cmake +++ b/ports/msmpi/portfile.cmake @@ -1,5 +1,9 @@ include(vcpkg_common_functions) +if(VCPKG_CMAKE_SYSTEM_NAME) + message(FATAL_ERROR "This port is only for building msmpi on Windows Desktop") +endif() + set(MSMPI_VERSION "10.0.12498") set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/msmpi-${MSMPI_VERSION}) diff --git a/ports/openmpi/CONTROL b/ports/openmpi/CONTROL new file mode 100644 index 00000000000000..6ea5a17c124926 --- /dev/null +++ b/ports/openmpi/CONTROL @@ -0,0 +1,4 @@ +Source: openmpi +Version: 4.0.1 +Homepage: https://www.open-mpi.org/ +Description: The Open MPI Project is an open source Message Passing Interface implementation that is developed and maintained by a consortium of academic, research, and industry partners. Open MPI is therefore able to combine the expertise, technologies, and resources from all across the High Performance Computing community in order to build the best MPI library available. Open MPI offers advantages for system and software vendors, application developers and computer science researchers. diff --git a/ports/openmpi/portfile.cmake b/ports/openmpi/portfile.cmake new file mode 100644 index 00000000000000..9f69f9f9bfe621 --- /dev/null +++ b/ports/openmpi/portfile.cmake @@ -0,0 +1,100 @@ +include(vcpkg_common_functions) + +if(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore" OR NOT VCPKG_CMAKE_SYSTEM_NAME) + message(FATAL_ERROR "This port is only for openmpi on Unix-like systems") +endif() + +vcpkg_check_linkage(ONLY_DYNAMIC_LIBRARY) + +set(OpenMPI_FULL_VERSION "4.0.1") +set(OpenMPI_SHORT_VERSION "4.0") + +vcpkg_download_distfile(ARCHIVE + URLS "https://download.open-mpi.org/release/open-mpi/v${OpenMPI_SHORT_VERSION}/openmpi-${OpenMPI_FULL_VERSION}.tar.gz" + FILENAME "openmpi-${OpenMPI_FULL_VERSION}.tar.gz" + SHA512 760716974cb6b25ad820184622e1ee7926bc6fda87db6b574f76792bc1ca99522e52195866c14b7cb2df5a4981efdaf9f71d2c5533cc0e8e45c2c4b3b74cbacc +) + +if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release") + list(APPEND BUILD_TYPES "release") +endif() +if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug") + list(APPEND BUILD_TYPES "debug") +endif() + +set(SOURCE_PATH_DEBUG ${CURRENT_BUILDTREES_DIR}/src-${TARGET_TRIPLET}-debug/openmpi-${OpenMPI_FULL_VERSION}) +set(SOURCE_PATH_RELEASE ${CURRENT_BUILDTREES_DIR}/src-${TARGET_TRIPLET}-release/openmpi-${OpenMPI_FULL_VERSION}) +set(OUT_PATH_DEBUG ${SOURCE_PATH_RELEASE}/../../make-build-${TARGET_TRIPLET}-debug) +set(OUT_PATH_RELEASE ${SOURCE_PATH_RELEASE}/../../make-build-${TARGET_TRIPLET}-release) +file(REMOVE_RECURSE ${CURRENT_BUILDTREES_DIR}/src-${TARGET_TRIPLET}-debug/) +file(REMOVE_RECURSE ${CURRENT_BUILDTREES_DIR}/src-${TARGET_TRIPLET}-release/) +file(MAKE_DIRECTORY ${OUT_PATH_DEBUG}) +file(MAKE_DIRECTORY ${OUT_PATH_RELEASE}) + +foreach(BUILD_TYPE IN LISTS BUILD_TYPES) + vcpkg_extract_source_archive(${ARCHIVE} ${CURRENT_BUILDTREES_DIR}/src-${TARGET_TRIPLET}-${BUILD_TYPE}) + #vcpkg_apply_patches(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src-${TARGET_TRIPLET}-${BUILD_TYPE}/openmpi-${OpenMPI_FULL_VERSION} PATCHES patch.file) +endforeach() + +vcpkg_find_acquire_program(PERL) +get_filename_component(PERL_PATH ${PERL} DIRECTORY) +vcpkg_add_to_path(${PERL_PATH}) + +set(BASH bash) + +if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug") + message(STATUS "Configuring ${TARGET_TRIPLET}-dbg") + vcpkg_execute_required_process( + COMMAND ${BASH} --noprofile --norc -c "${SOURCE_PATH_DEBUG}/configure --prefix=${OUT_PATH_DEBUG} --enable-debug" + WORKING_DIRECTORY "${SOURCE_PATH_DEBUG}" + LOGNAME "config-${TARGET_TRIPLET}-dbg" + ) + message(STATUS "Building ${TARGET_TRIPLET}-dbg") + vcpkg_execute_required_process( + COMMAND ${BASH} --noprofile --norc -c "make -j ${VCPKG_CONCURRENCY}" + NO_PARALLEL_COMMAND ${BASH} --noprofile --norc -c "make" + WORKING_DIRECTORY "${SOURCE_PATH_DEBUG}" + LOGNAME "make-build-${TARGET_TRIPLET}-dbg" + ) + message(STATUS "Installing ${TARGET_TRIPLET}-dbg") + vcpkg_execute_required_process( + COMMAND ${BASH} --noprofile --norc -c "make install" + WORKING_DIRECTORY "${SOURCE_PATH_DEBUG}" + LOGNAME "make-install-${TARGET_TRIPLET}-dbg" + ) + file(COPY ${OUT_PATH_DEBUG}/lib DESTINATION ${CURRENT_PACKAGES_DIR}/debug) + message(STATUS "Installing ${TARGET_TRIPLET}-dbg done") +endif() + +if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release") + message(STATUS "Configuring ${TARGET_TRIPLET}-rel") + vcpkg_execute_required_process( + COMMAND ${BASH} --noprofile --norc -c "${SOURCE_PATH_RELEASE}/configure --prefix=${OUT_PATH_RELEASE}" + WORKING_DIRECTORY "${SOURCE_PATH_RELEASE}" + LOGNAME "config-${TARGET_TRIPLET}-rel" + ) + message(STATUS "Building ${TARGET_TRIPLET}-rel") + vcpkg_execute_required_process( + COMMAND ${BASH} --noprofile --norc -c "make -j ${VCPKG_CONCURRENCY}" + NO_PARALLEL_COMMAND ${BASH} --noprofile --norc -c "make" + WORKING_DIRECTORY "${SOURCE_PATH_RELEASE}" + LOGNAME "make-build-${TARGET_TRIPLET}-rel" + ) + message(STATUS "Installing ${TARGET_TRIPLET}-rel") + vcpkg_execute_required_process( + COMMAND ${BASH} --noprofile --norc -c "make install" + WORKING_DIRECTORY "${SOURCE_PATH_RELEASE}" + LOGNAME "make-install-${TARGET_TRIPLET}-rel" + ) + file(COPY ${OUT_PATH_RELEASE}/lib DESTINATION ${CURRENT_PACKAGES_DIR}) + file(COPY ${OUT_PATH_RELEASE}/include DESTINATION ${CURRENT_PACKAGES_DIR}) + file(COPY ${OUT_PATH_RELEASE}/share DESTINATION ${CURRENT_PACKAGES_DIR}) + file(COPY ${OUT_PATH_RELEASE}/bin DESTINATION ${CURRENT_PACKAGES_DIR}) + message(STATUS "Installing ${TARGET_TRIPLET}-rel done") +endif() + +if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug") + file(INSTALL ${SOURCE_PATH_DEBUG}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/openmpi RENAME copyright) +else() + file(INSTALL ${SOURCE_PATH_RELEASE}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/openmpi RENAME copyright) +endif() diff --git a/ports/parmetis/CONTROL b/ports/parmetis/CONTROL index ca5e4fe80798ef..c98d4869ff5a32 100644 --- a/ports/parmetis/CONTROL +++ b/ports/parmetis/CONTROL @@ -2,4 +2,4 @@ Source: parmetis Version: 4.0.3-3 Homepage: https://glaros.dtc.umn.edu/gkhome/metis/parmetis/overview Description: Parallel Graph Partitioning and Fill-reducing Matrix Ordering -Build-Depends: metis, msmpi +Build-Depends: metis, mpi diff --git a/ports/vtk/CONTROL b/ports/vtk/CONTROL index 7b07132d25f46d..c44c77880644df 100644 --- a/ports/vtk/CONTROL +++ b/ports/vtk/CONTROL @@ -1,5 +1,5 @@ Source: vtk -Version: 8.2.0-4 +Version: 8.2.0-5 Description: Software system for 3D computer graphics, image processing, and visualization Homepage: https://github.com/Kitware/VTK Build-Depends: zlib, libpng, tiff, libxml2, jsoncpp, glew, freetype, expat, hdf5, libjpeg-turbo, proj4, lz4, libtheora, atlmfc (windows), eigen3, double-conversion, pugixml, libharu, sqlite3, netcdf-c @@ -14,7 +14,7 @@ Build-Depends: qt5 Feature: mpi Description: MPI functionality for VTK -Build-Depends: msmpi, hdf5[parallel] +Build-Depends: mpi, hdf5[parallel] Feature: python Description: Python functionality for VTK