Skip to content

Commit

Permalink
[boost-math] Fix build on x64-linux-dynamic, add feature legacy (#38728)
Browse files Browse the repository at this point in the history
Fixes #38725
Fixes #38714
Fixed #38955
  • Loading branch information
Osyotr authored May 30, 2024
1 parent 37630ac commit 0151c07
Show file tree
Hide file tree
Showing 15 changed files with 66 additions and 16 deletions.
3 changes: 0 additions & 3 deletions ports/autodock-vina/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ set(CMAKE_CXX_STANDARD 11)
find_package(Boost REQUIRED COMPONENTS
filesystem
log
math_tr1
program_options
random
serialization
Expand Down Expand Up @@ -63,7 +62,6 @@ target_link_libraries(vina
Boost::boost
Boost::filesystem
Boost::log
Boost::math_tr1
Boost::program_options
Boost::random
Boost::serialization
Expand All @@ -76,7 +74,6 @@ target_link_libraries(vina_split
Boost::boost
Boost::filesystem
Boost::log
Boost::math_tr1
Boost::program_options
Boost::random
Boost::serialization
Expand Down
2 changes: 1 addition & 1 deletion ports/autodock-vina/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "autodock-vina",
"version-semver": "1.2.5",
"port-version": 2,
"port-version": 3,
"description": "AutoDock Vina is one of the fastest and most widely used open-source docking engines.",
"homepage": "http://vina.scripps.edu/",
"dependencies": [
Expand Down
8 changes: 6 additions & 2 deletions ports/boost-math/build-old-libs.patch
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt
index 7e7790271c..cd08a77e4a 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -41,6 +41,104 @@ else()
@@ -41,6 +41,108 @@ else()

endif()

+option(BOOST_MATH_BUILD_WITH_LEGACY_FUNCTIONS "" OFF)
+if(BOOST_MATH_BUILD_WITH_LEGACY_FUNCTIONS)
+include(CheckCXXSourceCompiles)
+set(CMAKE_REQUIRED_LIBRARIES Boost::config)
+set(CMAKE_REQUIRED_INCLUDES "${CMAKE_CURRENT_SOURCE_DIR}/include")
Expand Down Expand Up @@ -80,9 +82,11 @@ index 7e7790271c..cd08a77e4a 100644
+
+foreach(type IN LISTS types)
+ add_library(boost_math_tr1${type} ${TR1_SOURCES${type}})
+ target_link_libraries(boost_math_tr1${type} PUBLIC Boost::config)
+ target_include_directories(boost_math_tr1${type} PRIVATE src/tr1)
+ target_include_directories(boost_math_tr1${type} PRIVATE include)
+ add_library(boost_math_c99${type} ${C99_SOURCES${type}})
+ target_link_libraries(boost_math_c99${type} PUBLIC Boost::config)
+ target_include_directories(boost_math_c99${type} PRIVATE src/tr1)
+ target_include_directories(boost_math_c99${type} PRIVATE include)
+ if(BUILD_SHARED_LIBS)
Expand All @@ -102,7 +106,7 @@ index 7e7790271c..cd08a77e4a 100644
+ boost_install_target(TARGET boost_math_tr1${type} VERSION ${BOOST_SUPERPROJECT_VERSION})
+ boost_install_target(TARGET boost_math_c99${type} VERSION ${BOOST_SUPERPROJECT_VERSION})
+endforeach()
+
+endif()
+
# Only enable tests when we're the root project
if(CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
Expand Down
10 changes: 10 additions & 0 deletions ports/boost-math/features.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
vcpkg_check_features(
OUT_FEATURE_OPTIONS
FEATURE_OPTIONS
FEATURES
"legacy" BOOST_MATH_BUILD_WITH_LEGACY_FUNCTIONS
)

if(NOT BOOST_MATH_BUILD_WITH_LEGACY_FUNCTIONS)
set(Z_VCPKG_BOOST_FORCE_HEADER_ONLY ON)
endif()
1 change: 1 addition & 0 deletions ports/boost-math/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ vcpkg_from_github(
)

set(FEATURE_OPTIONS "")
include("${CMAKE_CURRENT_LIST_DIR}/features.cmake")
boost_configure_and_install(
SOURCE_PATH "${SOURCE_PATH}"
OPTIONS ${FEATURE_OPTIONS}
Expand Down
9 changes: 7 additions & 2 deletions ports/boost-math/vcpkg.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"$comment": "Automatically generated by scripts/boost/generate-ports.ps1",
"name": "boost-math",
"version": "1.85.0",
"port-version": 1,
"port-version": 2,
"description": "Boost math module",
"homepage": "https://www.boost.org/libs/math",
"license": "BSL-1.0",
Expand Down Expand Up @@ -56,5 +56,10 @@
"name": "boost-throw-exception",
"version>=": "1.85.0"
}
]
],
"features": {
"legacy": {
"description": "Build the legacy C99 and TR1 libraries"
}
}
}
9 changes: 7 additions & 2 deletions ports/cctag/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "cctag",
"version-semver": "1.0.2",
"port-version": 6,
"port-version": 7,
"maintainers": "alicevision-team@googlegroups.com",
"description": "Computer vision library for detecting CCTag markers made up of concentric circles",
"homepage": "https://github.com/alicevision/CCTag",
Expand All @@ -18,7 +18,12 @@
"boost-foreach",
"boost-iterator",
"boost-lexical-cast",
"boost-math",
{
"name": "boost-math",
"features": [
"legacy"
]
},
"boost-mpl",
"boost-multi-array",
"boost-program-options",
Expand Down
2 changes: 1 addition & 1 deletion ports/vcpkg-boost/boost-install.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ function(boost_configure_and_install)
set(boost_lib_name_config "${boost_lib_name}")

set(headers_only OFF)
if(NOT EXISTS "${arg_SOURCE_PATH}/src") # regex|system|math are header only and only install libs due to compat
if(NOT EXISTS "${arg_SOURCE_PATH}/src" OR Z_VCPKG_BOOST_FORCE_HEADER_ONLY) # regex|system|math are header only and only install libs due to compat
set(headers_only ON)
set(VCPKG_BUILD_TYPE release)
endif()
Expand Down
2 changes: 1 addition & 1 deletion ports/vcpkg-boost/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "vcpkg-boost",
"version-date": "2024-04-25",
"version-date": "2024-05-15",
"license": "MIT"
}
8 changes: 8 additions & 0 deletions scripts/boost/generate-ports.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ $semverVersion = ($version -replace "(\d+(\.\d+){1,3}).*", "`$1")
$defaultPortVersion = 1
$portVersions = @{
'boost-container' = 1;
'boost-math' = 2;
}

function Get-PortVersion {
Expand Down Expand Up @@ -108,6 +109,13 @@ $portData = @{
}
};
"boost-log" = @{ "supports" = "!uwp & !emscripten" };
"boost-math" = @{
"features" = @{
"legacy" = @{
"description" = "Build the legacy C99 and TR1 libraries";
}
}
};
"boost-mpi" = @{
"dependencies" = @("mpi");
"supports" = "!uwp";
Expand Down
5 changes: 5 additions & 0 deletions versions/a-/autodock-vina.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "17529fd4b800ef3453f99cf2607e64fea59f6481",
"version-semver": "1.2.5",
"port-version": 3
},
{
"git-tree": "0a1f8b9271d163893c7bcb8f7097e38be9888519",
"version-semver": "1.2.5",
Expand Down
5 changes: 5 additions & 0 deletions versions/b-/boost-math.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "ac6833c403ae80c2a96e0a04795df91b1197999c",
"version": "1.85.0",
"port-version": 2
},
{
"git-tree": "073abacf431a555a65b186e63482d3ff47b0e615",
"version": "1.85.0",
Expand Down
8 changes: 4 additions & 4 deletions versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@
},
"autodock-vina": {
"baseline": "1.2.5",
"port-version": 2
"port-version": 3
},
"avcpp": {
"baseline": "2.4.0",
Expand Down Expand Up @@ -1022,7 +1022,7 @@
},
"boost-math": {
"baseline": "1.85.0",
"port-version": 1
"port-version": 2
},
"boost-metaparse": {
"baseline": "1.85.0",
Expand Down Expand Up @@ -1526,7 +1526,7 @@
},
"cctag": {
"baseline": "1.0.2",
"port-version": 6
"port-version": 7
},
"cctz": {
"baseline": "2.4",
Expand Down Expand Up @@ -9061,7 +9061,7 @@
"port-version": 0
},
"vcpkg-boost": {
"baseline": "2024-04-25",
"baseline": "2024-05-15",
"port-version": 0
},
"vcpkg-cmake": {
Expand Down
5 changes: 5 additions & 0 deletions versions/c-/cctag.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "bc6878b6e5119f0b4b5f90b4b09e02bd50c9b213",
"version-semver": "1.0.2",
"port-version": 7
},
{
"git-tree": "56e88632d9e1fd1d826e9486e66533cb8baddef8",
"version-semver": "1.0.2",
Expand Down
5 changes: 5 additions & 0 deletions versions/v-/vcpkg-boost.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "aca8ab6ec76d120c4482a629de23cad5ad7e4643",
"version-date": "2024-05-15",
"port-version": 0
},
{
"git-tree": "885223b657578128c0556fe6b53cfec8cbf50e12",
"version-date": "2024-04-25",
Expand Down

0 comments on commit 0151c07

Please sign in to comment.