[hpx] add some features, fix some bugs (#25059)

* refine hpx port

* v db

* add tcmalloc on unix

* refine comment

* v db

* remove hardcoded mpi dep

* v db

* portfile cleanup

* v db

* add pkgconf as a dep

* v db

* [snappy] remove debug suffix and add pc file

* hpx pass through _HOST_TRIPLET for pkgconf

* v db

* fix snappy in ffmpeg

* v db

* fix name clash of output names

* v db

* remove tcmalloc

* v db

* remove bin dir; seems empty on !windows

* v db

* b v

* v db

* baseline stuff

* fix jemalloc missing msvc_compat headers

* v db

* install usage for hpx

* v db

* Update versions/f-/ffmpeg.json

* revert v db

* bump ffmpeg

* v db

* remove jemalloc since I can force it thorugh the triplet any way.

* v db

Co-authored-by: Jack·Boos·Yu <47264268+JackBoosY@users.noreply.github.com>
This commit is contained in:
Alexander Neumann 2022-09-19 21:30:40 +02:00 committed by GitHub
parent 63bbbfab92
commit 2b35366a5d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
19 changed files with 213 additions and 44 deletions

View File

@ -31,7 +31,7 @@ index bd2de34..fba948a 100755
require libsmbclient libsmbclient.h smbc_init -lsmbclient; }
-enabled libsnappy && require libsnappy snappy-c.h snappy_compress -lsnappy -lstdc++
+if enabled debug_configure; then
+ enabled libsnappy && require libsnappy snappy-c.h snappy_compress -lsnappyd -lstdc++
+ enabled libsnappy && require libsnappy snappy-c.h snappy_compress -lsnappy -lstdc++
+else
+ enabled libsnappy && require libsnappy snappy-c.h snappy_compress -lsnappy -lstdc++
+fi

View File

@ -1,7 +1,7 @@
{
"name": "ffmpeg",
"version": "4.4.1",
"port-version": 17,
"port-version": 18,
"description": [
"a library to decode, encode, transcode, mux, demux, stream, filter and play pretty much anything that humans and machines have created.",
"FFmpeg is the leading multimedia framework, able to decode, encode, transcode, mux, demux, stream, filter and play pretty much anything that humans and machines have created. It supports the most obscure ancient formats up to the cutting edge. No matter if they were designed by some standards committee, the community or a corporation. It is also highly portable: FFmpeg compiles, runs, and passes our testing infrastructure FATE across Linux, Mac OS X, Microsoft Windows, the BSDs, Solaris, etc. under a wide variety of build environments, machine architectures, and configurations."

21
ports/hpx/fix-debug.patch Normal file
View File

@ -0,0 +1,21 @@
diff --git a/cmake/HPX_CompilerFlagsTargets.cmake b/cmake/HPX_CompilerFlagsTargets.cmake
index 5bf4649..0912503 100644
--- a/cmake/HPX_CompilerFlagsTargets.cmake
+++ b/cmake/HPX_CompilerFlagsTargets.cmake
@@ -15,14 +15,8 @@ target_compile_features(hpx_public_flags INTERFACE cxx_std_${HPX_CXX_STANDARD})
# Set other flags that should always be set
-# HPX_DEBUG must be set without a generator expression as it determines ABI
-# compatibility. Projects in Release mode using HPX in Debug mode must have
-# HPX_DEBUG set, and projects in Debug mode using HPX in Release mode must not
-# have HPX_DEBUG set. HPX_DEBUG must also not be set by projects using HPX.
-if(${CMAKE_BUILD_TYPE} STREQUAL "Debug")
- target_compile_definitions(hpx_private_flags INTERFACE HPX_DEBUG)
- target_compile_definitions(hpx_public_flags INTERFACE HPX_DEBUG)
-endif()
+target_compile_definitions(hpx_private_flags INTERFACE $<$<CONFIG:DEBUG>:HPX_DEBUG>)
+target_compile_definitions(hpx_public_flags INTERFACE $<$<CONFIG:DEBUG>:HPX_DEBUG>)
target_compile_definitions(
hpx_private_flags

View File

@ -0,0 +1,24 @@
diff --git a/cmake/HPX_GeneratePackageUtils.cmake b/cmake/HPX_GeneratePackageUtils.cmake
index 3ec8002..b098465 100644
--- a/cmake/HPX_AddModule.cmake
+++ b/cmake/HPX_AddModule.cmake
@@ -437,7 +437,7 @@ function(add_hpx_module libname modulename)
elseif(MSVC)
set(_module_target hpx_${modulename})
target_link_libraries(
- hpx_${libname} PRIVATE -WHOLEARCHIVE:$<TARGET_FILE:hpx_${modulename}>
+ hpx_${libname} PRIVATE -WHOLEARCHIVE:$<TARGET_FILE:$<TARGET_NAME:hpx_${modulename}>>
)
endif()
target_link_libraries(hpx_${libname} PRIVATE ${_module_target})
--- a/cmake/HPX_GeneratePackageUtils.cmake
+++ b/cmake/HPX_GeneratePackageUtils.cmake
@@ -101,7 +101,7 @@ function(
)
set(_libraries
${_libraries}
- $<INSTALL_INTERFACE:${CMAKE_INSTALL_LIBDIR}/$<TARGET_FILE_NAME:${target}>>$<BUILD_INTERFACE:$<TARGET_FILE:${target}>>
+ $<INSTALL_INTERFACE:${CMAKE_INSTALL_LIBDIR}/$<TARGET_FILE_NAME:$<TARGET_NAME:${target}>>>$<BUILD_INTERFACE:$<TARGET_FILE:${target}>>
)
endif()
elseif("${dep_target}" MATCHES "^-l")

View File

@ -0,0 +1,13 @@
diff --git a/cmake/HPX_AddComponent.cmake b/cmake/HPX_AddComponent.cmake
index 129a87ced..b45feb3f5 100644
--- a/cmake/HPX_AddComponent.cmake
+++ b/cmake/HPX_AddComponent.cmake
@@ -303,7 +303,7 @@ function(add_hpx_component name)
hpx_setup_target(
${name}_component
TYPE COMPONENT
- NAME ${name}
+ NAME ${name}_component
FOLDER ${${name}_FOLDER}
COMPILE_FLAGS ${${name}_COMPILE_FLAGS}
LINK_FLAGS ${${name}_LINK_FLAGS}

12
ports/hpx/format.patch Normal file
View File

@ -0,0 +1,12 @@
diff --git a/components/iostreams/include/hpx/components/iostreams/ostream.hpp b/components/iostreams/include/hpx/components/iostreams/ostream.hpp
index 423f4728d00..dda4b059796 100644
--- a/components/iostreams/include/hpx/components/iostreams/ostream.hpp
+++ b/components/iostreams/include/hpx/components/iostreams/ostream.hpp
@@ -398,6 +398,6 @@ namespace hpx { namespace util {
hpx::iostreams::ostream<Char, Sink>& os, std::string const& format_str,
Args const&... args)
{
- return os << format(format_str, args...);
+ return os << hpx::util::format(format_str, args...);
}
}} // namespace hpx::util

View File

@ -1,4 +1,7 @@
vcpkg_check_linkage(ONLY_DYNAMIC_LIBRARY)
if(VCPKG_TARGET_IS_WINDOWS)
vcpkg_check_linkage(ONLY_DYNAMIC_LIBRARY)
endif()
string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" HPX_WITH_STATIC_LINKING)
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
@ -8,16 +11,28 @@ vcpkg_from_github(
HEAD_REF stable
PATCHES
fix-dependency-hwloc.patch
format.patch
fix-export.patch
fix-debug.patch
fix_output_name_clash.patch
)
set(HPX_WITH_MALLOC system)
if(VCPKG_TARGET_IS_LINUX)
# This is done at the request of the hpx maintainers; see
# https://github.com/microsoft/vcpkg/pull/21673#issuecomment-979904882
# It must match when gperftools is treated as a dependency of this port.
set(HPX_WITH_MALLOC tcmalloc)
vcpkg_check_features(
OUT_FEATURE_OPTIONS FEATURE_OPTIONS
FEATURES
"zlib" HPX_WITH_COMPRESSION_ZLIB
"snappy" HPX_WITH_COMPRESSION_SNAPPY
"bzip2" HPX_WITH_COMPRESSION_BZIP2
"cuda" HPX_WITH_CUDA
"mpi" HPX_WITH_PARCELPORT_MPI
"mpi" HPX_WITH_PARCELPORT_MPI_MULTITHREADED
)
if(NOT VCPKG_TARGET_ARCHITECTURE MATCHES "(x64|x86)")
list(APPEND FEATURE_OPTIONS "-DHPX_WITH_GENERIC_CONTEXT_COROUTINES=ON")
endif()
file(REMOVE "${SOURCE_PATH}/cmake/FindBZip2.cmake") # Outdated
vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
@ -28,9 +43,15 @@ vcpkg_cmake_configure(
-DHPX_WITH_TOOLS=OFF
-DHPX_WITH_RUNTIME=OFF
-DHPX_USE_CMAKE_CXX_STANDARD=ON
"-DHPX_WITH_MALLOC=${HPX_WITH_MALLOC}"
${FEATURE_OPTIONS}
-DHPX_WITH_PKGCONFIG=OFF
-DHPX_WITH_STATIC_LINKING=${HPX_WITH_STATIC_LINKING}
-DHPX_WITH_PARCELPORT_TCP=ON
-DHPX_WITH_THREAD_TARGET_ADDRESS=ON
-DHPX_WITH_CHECK_MODULE_DEPENDENCIES=ON
-DHPX_WITH_THREAD_IDLE_RATES=ON
-DVCPKG_HOST_TRIPLET=${_HOST_TRIPLET}
)
vcpkg_cmake_install()
# post build cleanup
@ -64,30 +85,6 @@ file(INSTALL
"${SOURCE_PATH}/LICENSE_1_0.txt"
DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
file(GLOB DLLS "${CURRENT_PACKAGES_DIR}/lib/*.dll")
if(DLLS)
file(COPY ${DLLS} DESTINATION "${CURRENT_PACKAGES_DIR}/bin")
file(REMOVE ${DLLS})
endif()
file(GLOB DLLS "${CURRENT_PACKAGES_DIR}/lib/hpx/*.dll")
if(DLLS)
file(COPY ${DLLS} DESTINATION "${CURRENT_PACKAGES_DIR}/bin/hpx")
file(REMOVE ${DLLS})
endif()
file(GLOB DLLS "${CURRENT_PACKAGES_DIR}/debug/lib/*.dll")
if(DLLS)
file(COPY ${DLLS} DESTINATION "${CURRENT_PACKAGES_DIR}/debug/bin")
file(REMOVE ${DLLS})
endif()
file(GLOB DLLS "${CURRENT_PACKAGES_DIR}/debug/lib/hpx/*.dll")
if(DLLS)
file(COPY ${DLLS} DESTINATION "${CURRENT_PACKAGES_DIR}/debug/bin/hpx")
file(REMOVE ${DLLS})
endif()
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")
@ -96,4 +93,13 @@ vcpkg_fixup_pkgconfig()
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/bin/hpxcxx" "\"${CURRENT_PACKAGES_DIR}\"" "os.path.dirname(os.path.dirname(os.path.realpath(__file__)))")
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/debug/bin/hpxcxx" "\"${CURRENT_PACKAGES_DIR}/debug\"" "os.path.dirname(os.path.dirname(os.path.realpath(__file__)))")
vcpkg_copy_pdbs()
file(REMOVE "${CURRENT_PACKAGES_DIR}/bin/hpxcxx" "${CURRENT_PACKAGES_DIR}/debug/bin/hpxcxx")
file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/tools/${PORT}")
file(RENAME "${CURRENT_PACKAGES_DIR}/bin/hpxrun.py" "${CURRENT_PACKAGES_DIR}/tools/${PORT}/hpxrun.py")
if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/bin" "${CURRENT_PACKAGES_DIR}/debug/bin")
endif()
configure_file("${CMAKE_CURRENT_LIST_DIR}/usage" "${CURRENT_PACKAGES_DIR}/share/${PORT}/usage" COPYONLY)

4
ports/hpx/usage Normal file
View File

@ -0,0 +1,4 @@
The port hpx provides CMake targets:
find_package(HPX REQUIRED)
target_link_libraries(main PRIVATE HPX::hpx)

View File

@ -1,6 +1,7 @@
{
"name": "hpx",
"version": "1.8.0",
"port-version": 1,
"description": [
"The C++ Standards Library for Concurrency and Parallelism",
"HPX is a C++ Standards Library for Concurrency and Parallelism. It implements all of the corresponding facilities as defined by the C++ Standard. Additionally, in HPX we implement functionalities proposed as part of the ongoing C++ standardization process. We also extend the C++ Standard APIs to the distributed case."
@ -28,6 +29,10 @@
"platform": "linux"
},
"hwloc",
{
"name": "pkgconf",
"host": true
},
{
"name": "vcpkg-cmake",
"host": true
@ -36,5 +41,43 @@
"name": "vcpkg-cmake-config",
"host": true
}
]
],
"default-features": [
"bzip2",
"mpi",
"snappy",
"zlib"
],
"features": {
"bzip2": {
"description": "Build with bzip2 compression",
"dependencies": [
"bzip2"
]
},
"cuda": {
"description": "Build with CUDA support",
"dependencies": [
"cuda"
]
},
"mpi": {
"description": "Build with MPI parcelport",
"dependencies": [
"mpi"
]
},
"snappy": {
"description": "Build with snappy compression",
"dependencies": [
"snappy"
]
},
"zlib": {
"description": "Build with zlib compression",
"dependencies": [
"zlib"
]
}
}
}

View File

@ -22,6 +22,8 @@ vcpkg_configure_make(
vcpkg_install_make()
if(VCPKG_TARGET_IS_WINDOWS)
file(COPY "${SOURCE_PATH}/include/msvc_compat/strings.h" DESTINATION "${CURRENT_PACKAGES_DIR}/include/jemalloc/msvc_compat")
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/jemalloc/jemalloc.h" "<strings.h>" "\"msvc_compat/strings.h\"")
if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic")
file(COPY "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/lib/jemalloc.lib" DESTINATION "${CURRENT_PACKAGES_DIR}/lib")
file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/bin")

View File

@ -1,6 +1,7 @@
{
"name": "jemalloc",
"version": "5.3.0",
"port-version": 1,
"description": "jemalloc is a general purpose malloc(3) implementation that emphasizes fragmentation avoidance and scalable concurrency support",
"homepage": "https://jemalloc.net/",
"license": "BSD-2-Clause"

View File

@ -1,7 +1,10 @@
file(READ "${CURRENT_PORT_DIR}/vcpkg.json" manifest)
string(JSON version GET "${manifest}" version)
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO google/snappy
REF 1.1.9
REF ${version}
SHA512 f1f8a90f5f7f23310423574b1d8c9acb84c66ea620f3999d1060395205e5760883476837aba02f0aa913af60819e34c625d8308c18a5d7a9c4e190f35968b024
HEAD_REF master
PATCHES
@ -13,12 +16,21 @@ vcpkg_cmake_configure(
OPTIONS
-DSNAPPY_BUILD_TESTS=OFF
-DSNAPPY_BUILD_BENCHMARKS=OFF
-DCMAKE_DEBUG_POSTFIX=d
)
vcpkg_cmake_install()
vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/Snappy)
vcpkg_copy_pdbs()
string(JSON version GET "${manifest}" version)
string(JSON description GET "${manifest}" description)
set(name "${PORT}")
configure_file("${CURRENT_PORT_DIR}/${PORT}.pc.in" "${CURRENT_PACKAGES_DIR}/lib/pkgconfig/${PORT}.pc" @ONLY)
if(NOT VCPKG_BUILD_TYPE)
configure_file("${CURRENT_PORT_DIR}/${PORT}.pc.in" "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/${PORT}.pc" @ONLY)
endif()
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
file(INSTALL "${SOURCE_PATH}/COPYING" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)

10
ports/snappy/snappy.pc.in Normal file
View File

@ -0,0 +1,10 @@
prefix=${pcfiledir}/../..
exec_prefix=${prefix}
libdir=${prefix}/lib
includedir=${prefix}/include
Name: @name@
Description: @description@
Version: @version@
Libs: -L${libdir} -l@libname@
Cflags: -I${includedir}

View File

@ -1,9 +1,10 @@
{
"name": "snappy",
"version": "1.1.9",
"port-version": 2,
"port-version": 3,
"description": "A fast compressor/decompressor.",
"homepage": "https://github.com/google/snappy",
"license": null,
"dependencies": [
{
"name": "vcpkg-cmake",

View File

@ -2282,7 +2282,7 @@
},
"ffmpeg": {
"baseline": "4.4.1",
"port-version": 17
"port-version": 18
},
"ffnvcodec": {
"baseline": "11.1.5.0",
@ -2898,7 +2898,7 @@
},
"hpx": {
"baseline": "1.8.0",
"port-version": 0
"port-version": 1
},
"http-parser": {
"baseline": "2.9.4",
@ -3146,7 +3146,7 @@
},
"jemalloc": {
"baseline": "5.3.0",
"port-version": 0
"port-version": 1
},
"jinja2cpplight": {
"baseline": "2018-05-08",
@ -6818,7 +6818,7 @@
},
"snappy": {
"baseline": "1.1.9",
"port-version": 2
"port-version": 3
},
"sndfile": {
"baseline": "0",

View File

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "65fe58cd3c36c19b6ad4b104b9ff57c506009e9a",
"version": "4.4.1",
"port-version": 18
},
{
"git-tree": "197609d70edc506c0257721d873b1eb3b93ba4b8",
"version": "4.4.1",

View File

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "aaf58e8627662fd841d011ea7e71d23507573772",
"version": "1.8.0",
"port-version": 1
},
{
"git-tree": "2bd151915f73223a06d9470f38f56d253392a484",
"version": "1.8.0",

View File

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "96ec9736a357ac7af9b108bcc8e9d237cfb18a43",
"version": "5.3.0",
"port-version": 1
},
{
"git-tree": "6baf5d3d5e323c49a4f91a2e67f778421af4a4c5",
"version": "5.3.0",

View File

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "00bd59377f162448da6b19382a7ca392b1761f22",
"version": "1.1.9",
"port-version": 3
},
{
"git-tree": "7122115f0f35f7f90f7a7adc1d15a4b6f7af5315",
"version": "1.1.9",