mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-12-27 18:31:15 +08:00
[boost-python] Try to fix build issue on Linux (#9780)
* [boost-python] Try to fix build issue on Linux * Update baseline: enable boost-python:x64-linux * Fix number of processor detection on Linux: use CMake module * Fix user-config.jam configuration on Linux * Update baseline: enable boost-mpi:x64-linux * Fix build boost-regex[icu] on Linux, issue #4962
This commit is contained in:
parent
1e697e97da
commit
1c414f9192
@ -122,17 +122,8 @@ endif()
|
||||
|
||||
configure_file(${CMAKE_CURRENT_LIST_DIR}/user-config.jam ${CMAKE_CURRENT_BINARY_DIR}/user-config.jam @ONLY)
|
||||
|
||||
set(NUMBER_OF_PROCESSORS 1)
|
||||
if(DEFINED ENV{NUMBER_OF_PROCESSORS})
|
||||
set(NUMBER_OF_PROCESSORS $ENV{NUMBER_OF_PROCESSORS})
|
||||
elseif(CMAKE_HOST_LINUX)
|
||||
execute_process(
|
||||
COMMAND nproc
|
||||
OUTPUT_VARIABLE NUMBER_OF_PROCESSORS
|
||||
)
|
||||
string(REPLACE "\n" "" NUMBER_OF_PROCESSORS "${NUMBER_OF_PROCESSORS}")
|
||||
string(REPLACE " " "" NUMBER_OF_PROCESSORS "${NUMBER_OF_PROCESSORS}")
|
||||
endif()
|
||||
include(ProcessorCount)
|
||||
ProcessorCount(NUMBER_OF_PROCESSORS)
|
||||
if(NOT NUMBER_OF_PROCESSORS)
|
||||
set(NUMBER_OF_PROCESSORS 1)
|
||||
endif()
|
||||
|
@ -75,17 +75,35 @@ function(boost_modular_build)
|
||||
# endif()
|
||||
|
||||
if(VCPKG_CMAKE_SYSTEM_NAME AND NOT VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")
|
||||
set(configure_option)
|
||||
if(DEFINED _bm_BOOST_CMAKE_FRAGMENT)
|
||||
set(fragment_option "-DBOOST_CMAKE_FRAGMENT=${_bm_BOOST_CMAKE_FRAGMENT}")
|
||||
list(APPEND configure_option "-DBOOST_CMAKE_FRAGMENT=${_bm_BOOST_CMAKE_FRAGMENT}")
|
||||
endif()
|
||||
if(DEFINED VCPKG_PYTHON_EXECUTABLE)
|
||||
list(APPEND configure_option "-DVCPKG_PYTHON_EXECUTABLE=${VCPKG_PYTHON_EXECUTABLE}")
|
||||
endif()
|
||||
if(DEFINED VCPKG_PYTHON_INCLUDE)
|
||||
list(APPEND configure_option "-DVCPKG_PYTHON_INCLUDE=${VCPKG_PYTHON_INCLUDE}")
|
||||
endif()
|
||||
if(DEFINED VCPKG_PYTHON_LIBS_RELEASE)
|
||||
list(APPEND configure_option "-DVCPKG_PYTHON_LIBS_RELEASE=${VCPKG_PYTHON_LIBS_RELEASE}")
|
||||
endif()
|
||||
if(DEFINED VCPKG_PYTHON_LIBS_DEBUG)
|
||||
list(APPEND configure_option "-DVCPKG_PYTHON_LIBS_DEBUG=${VCPKG_PYTHON_LIBS_DEBUG}")
|
||||
endif()
|
||||
if(DEFINED VCPKG_PYTHON_VERSION)
|
||||
list(APPEND configure_option "-DVCPKG_PYTHON_VERSION=${VCPKG_PYTHON_VERSION}")
|
||||
endif()
|
||||
vcpkg_configure_cmake(
|
||||
SOURCE_PATH ${CURRENT_INSTALLED_DIR}/share/boost-build
|
||||
PREFER_NINJA
|
||||
OPTIONS
|
||||
"-DPORT=${PORT}"
|
||||
"-DCURRENT_INSTALLED_DIR=${CURRENT_INSTALLED_DIR}"
|
||||
"-DB2_EXE=${B2_EXE}"
|
||||
"-DSOURCE_PATH=${_bm_SOURCE_PATH}"
|
||||
"-DBOOST_BUILD_PATH=${BOOST_BUILD_PATH}"
|
||||
${fragment_option}
|
||||
${configure_option}
|
||||
)
|
||||
vcpkg_install_cmake()
|
||||
|
||||
@ -126,15 +144,10 @@ function(boost_modular_build)
|
||||
${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel
|
||||
)
|
||||
|
||||
if(DEFINED ENV{NUMBER_OF_PROCESSORS})
|
||||
set(NUMBER_OF_PROCESSORS $ENV{NUMBER_OF_PROCESSORS})
|
||||
else()
|
||||
execute_process(
|
||||
COMMAND nproc
|
||||
OUTPUT_VARIABLE NUMBER_OF_PROCESSORS
|
||||
)
|
||||
string(REPLACE "\n" "" NUMBER_OF_PROCESSORS "${NUMBER_OF_PROCESSORS}")
|
||||
string(REPLACE " " "" NUMBER_OF_PROCESSORS "${NUMBER_OF_PROCESSORS}")
|
||||
include(ProcessorCount)
|
||||
ProcessorCount(NUMBER_OF_PROCESSORS)
|
||||
if(NOT NUMBER_OF_PROCESSORS)
|
||||
set(NUMBER_OF_PROCESSORS 1)
|
||||
endif()
|
||||
|
||||
######################
|
||||
@ -195,7 +208,6 @@ function(boost_modular_build)
|
||||
list(APPEND _bm_OPTIONS_DBG "cxxflags=${VCPKG_CXX_FLAGS_DEBUG}")
|
||||
endif()
|
||||
|
||||
|
||||
if(VCPKG_C_FLAGS)
|
||||
list(APPEND _bm_OPTIONS "cflags=${VCPKG_C_FLAGS}")
|
||||
endif()
|
||||
@ -208,7 +220,6 @@ function(boost_modular_build)
|
||||
list(APPEND _bm_OPTIONS_DBG "cflags=${VCPKG_C_FLAGS_DEBUG}")
|
||||
endif()
|
||||
|
||||
|
||||
if(VCPKG_LINKER_FLAGS)
|
||||
list(APPEND _bm_OPTIONS "linkflags=${VCPKG_LINKER_FLAGS}")
|
||||
endif()
|
||||
@ -221,7 +232,6 @@ function(boost_modular_build)
|
||||
list(APPEND _bm_OPTIONS_DBG "linkflags=${VCPKG_LINKER_FLAGS_DEBUG}")
|
||||
endif()
|
||||
|
||||
|
||||
# Add build type specific options
|
||||
if(VCPKG_CRT_LINKAGE STREQUAL "dynamic")
|
||||
list(APPEND _bm_OPTIONS runtime-link=shared)
|
||||
@ -246,7 +256,7 @@ function(boost_modular_build)
|
||||
endif()
|
||||
|
||||
file(TO_CMAKE_PATH "${_bm_DIR}/nothing.bat" NOTHING_BAT)
|
||||
set(TOOLSET_OPTIONS " <cxxflags>/EHsc <compileflags>-Zm800 <compileflags>-nologo")
|
||||
set(TOOLSET_OPTIONS "<cxxflags>/EHsc <compileflags>-Zm800 <compileflags>-nologo")
|
||||
if(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")
|
||||
if(NOT VCPKG_PLATFORM_TOOLSET MATCHES "v140")
|
||||
find_path(PATH_TO_CL cl.exe)
|
||||
|
@ -2,10 +2,11 @@ import toolset ;
|
||||
|
||||
if "@VCPKG_PLATFORM_TOOLSET@" != "external"
|
||||
{
|
||||
using msvc : : cl.exe :
|
||||
<setup>"@NOTHING_BAT@"
|
||||
@TOOLSET_OPTIONS@
|
||||
;
|
||||
using msvc : : cl.exe
|
||||
:
|
||||
<setup>"@NOTHING_BAT@"
|
||||
@TOOLSET_OPTIONS@
|
||||
;
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -23,8 +24,8 @@ else
|
||||
|
||||
if "@PORT@" = "boost-python"
|
||||
{
|
||||
using python : @PYTHON_VERSION@ : : "@PYTHON_INCLUDE_PATH@" : "@PYTHONLIBS_RELEASE@" ;
|
||||
using python : @PYTHON_VERSION@ : : "@PYTHON_INCLUDE_PATH@" : "@PYTHONLIBS_DEBUG@" : <python-debugging>on ;
|
||||
using python : @VCPKG_PYTHON_VERSION@ : "@VCPKG_PYTHON_EXECUTABLE@" : "@VCPKG_PYTHON_INCLUDE@" : "@VCPKG_PYTHON_LIBS_RELEASE@" ;
|
||||
using python : @VCPKG_PYTHON_VERSION@ : "@VCPKG_PYTHON_EXECUTABLE@" : "@VCPKG_PYTHON_INCLUDE@" : "@VCPKG_PYTHON_LIBS_DEBUG@" : <python-debugging>on ;
|
||||
}
|
||||
|
||||
if "@PORT@" = "boost-mpi"
|
||||
@ -37,16 +38,30 @@ if "@PORT@" = "boost-mpi"
|
||||
|
||||
project user-config : ;
|
||||
|
||||
lib advapi32 ;
|
||||
if "@VCPKG_PLATFORM_TOOLSET@" != "external"
|
||||
{
|
||||
lib advapi32 ;
|
||||
|
||||
lib icuuc : : <file>"@CURRENT_INSTALLED_DIR@/lib/icuuc.lib" <variant>release : : <library>advapi32 ;
|
||||
lib icuuc : : <file>"@CURRENT_INSTALLED_DIR@/debug/lib/icuucd.lib" <variant>debug : : <library>advapi32 ;
|
||||
lib icuuc : : <file>"@CURRENT_INSTALLED_DIR@/lib/icuuc.lib" <variant>release : : <library>advapi32 ;
|
||||
lib icuuc : : <file>"@CURRENT_INSTALLED_DIR@/debug/lib/icuucd.lib" <variant>debug : : <library>advapi32 ;
|
||||
|
||||
lib icuin : : <file>"@CURRENT_INSTALLED_DIR@/lib/icuin.lib" <variant>release : : ;
|
||||
lib icuin : : <file>"@CURRENT_INSTALLED_DIR@/debug/lib/icuind.lib" <variant>debug : : ;
|
||||
lib icuin : : <file>"@CURRENT_INSTALLED_DIR@/lib/icuin.lib" <variant>release : : ;
|
||||
lib icuin : : <file>"@CURRENT_INSTALLED_DIR@/debug/lib/icuind.lib" <variant>debug : : ;
|
||||
|
||||
lib icudt : : <file>"@CURRENT_INSTALLED_DIR@/lib/icudt.lib" <variant>release : : ;
|
||||
lib icudt : : <file>"@CURRENT_INSTALLED_DIR@/debug/lib/icudtd.lib" <variant>debug : : ;
|
||||
lib icudt : : <file>"@CURRENT_INSTALLED_DIR@/lib/icudt.lib" <variant>release : : ;
|
||||
lib icudt : : <file>"@CURRENT_INSTALLED_DIR@/debug/lib/icudtd.lib" <variant>debug : : ;
|
||||
}
|
||||
else
|
||||
{
|
||||
lib icuuc : : <file>"@CURRENT_INSTALLED_DIR@/lib/libicuuc.a" <variant>release : : ;
|
||||
lib icuuc : : <file>"@CURRENT_INSTALLED_DIR@/debug/lib/libicuuc.a" <variant>debug : : ;
|
||||
|
||||
lib icuin : : <file>"@CURRENT_INSTALLED_DIR@/lib/libicui18n.a" <variant>release : : ;
|
||||
lib icuin : : <file>"@CURRENT_INSTALLED_DIR@/debug/lib/libicui18n.a" <variant>debug : : ;
|
||||
|
||||
lib icudt : : <file>"@CURRENT_INSTALLED_DIR@/lib/libicudata.a" <variant>release : : ;
|
||||
lib icudt : : <file>"@CURRENT_INSTALLED_DIR@/debug/lib/libicudata.a" <variant>debug : : ;
|
||||
}
|
||||
|
||||
lib iconv : : <file>"@LIBICONV_LIBRARY@" <link>shared <runtime-link>shared <variant>release : : ;
|
||||
lib iconv : : <file>"@LIBICONV_LIBRARY@" <link>shared <runtime-link>shared <variant>debug : : ;
|
||||
|
@ -1,6 +1,6 @@
|
||||
# Automatically generated by boost-vcpkg-helpers/generate-ports.ps1
|
||||
Source: boost-python
|
||||
Version: 1.72.0
|
||||
Build-Depends: boost-bind, boost-compatibility, boost-config, boost-conversion, boost-core, boost-detail, boost-foreach, boost-function, boost-graph, boost-integer, boost-iterator, boost-lexical-cast, boost-math, boost-mpl, boost-numeric-conversion, boost-preprocessor, boost-property-map, boost-smart-ptr, boost-static-assert, boost-tuple, boost-type-traits, boost-utility, boost-vcpkg-helpers, python3 (!osx&!linux)
|
||||
Version: 1.72.0-1
|
||||
Build-Depends: boost-bind, boost-compatibility, boost-config, boost-conversion, boost-core, boost-detail, boost-foreach, boost-function, boost-graph, boost-integer, boost-iterator, boost-lexical-cast, boost-math, boost-mpl, boost-numeric-conversion, boost-preprocessor, boost-property-map, boost-smart-ptr, boost-static-assert, boost-tuple, boost-type-traits, boost-utility, boost-vcpkg-helpers, python3
|
||||
Homepage: https://github.com/boostorg/python
|
||||
Description: Boost python module
|
||||
|
@ -10,11 +10,14 @@ vcpkg_from_github(
|
||||
HEAD_REF master
|
||||
)
|
||||
|
||||
# Find Python. Can't use find_package here, but we already know where everything is
|
||||
file(GLOB PYTHON_INCLUDE_PATH "${CURRENT_INSTALLED_DIR}/include/python3.*")
|
||||
set(PYTHONLIBS_RELEASE "${CURRENT_INSTALLED_DIR}/lib")
|
||||
set(PYTHONLIBS_DEBUG "${CURRENT_INSTALLED_DIR}/debug/lib")
|
||||
string(REGEX REPLACE ".*python([0-9\.]+)$" "\\1" PYTHON_VERSION "${PYTHON_INCLUDE_PATH}")
|
||||
# Find Python3 executable
|
||||
vcpkg_find_acquire_program(PYTHON3)
|
||||
set(VCPKG_PYTHON_EXECUTABLE "${PYTHON3}")
|
||||
# Find Python3 libraries. Can't use find_package here, but we already know where everything is
|
||||
file(GLOB VCPKG_PYTHON_INCLUDE "${CURRENT_INSTALLED_DIR}/include/python3.*")
|
||||
set(VCPKG_PYTHON_LIBS_RELEASE "${CURRENT_INSTALLED_DIR}/lib")
|
||||
set(VCPKG_PYTHON_LIBS_DEBUG "${CURRENT_INSTALLED_DIR}/debug/lib")
|
||||
string(REGEX REPLACE ".*python([0-9\.]+).*" "\\1" VCPKG_PYTHON_VERSION "${VCPKG_PYTHON_INCLUDE}")
|
||||
include(${CURRENT_INSTALLED_DIR}/share/boost-build/boost-modular-build.cmake)
|
||||
boost_modular_build(SOURCE_PATH ${SOURCE_PATH})
|
||||
include(${CURRENT_INSTALLED_DIR}/share/boost-vcpkg-helpers/boost-modular-headers.cmake)
|
||||
|
@ -46,9 +46,9 @@ function Generate()
|
||||
$controlDeps = ($Depends | sort) -join ", "
|
||||
|
||||
$versionSuffix = ""
|
||||
if ($Name -eq "iostreams")
|
||||
if ($PortName -eq "iostreams" -or $PortName -eq "python")
|
||||
{
|
||||
$versionsuffix = "-1"
|
||||
$versionSuffix = "-1"
|
||||
}
|
||||
|
||||
mkdir "$portsDir/boost-$PortName" -erroraction SilentlyContinue | out-null
|
||||
@ -363,7 +363,7 @@ foreach ($library in $libraries)
|
||||
|
||||
if ($library -eq "python")
|
||||
{
|
||||
$deps += @("python3 (!osx&!linux)")
|
||||
$deps += @("python3")
|
||||
$needsBuild = $true
|
||||
}
|
||||
elseif ($library -eq "iostreams")
|
||||
|
@ -1,5 +1,8 @@
|
||||
# Find Python. Can't use find_package here, but we already know where everything is
|
||||
file(GLOB PYTHON_INCLUDE_PATH "${CURRENT_INSTALLED_DIR}/include/python3.*")
|
||||
set(PYTHONLIBS_RELEASE "${CURRENT_INSTALLED_DIR}/lib")
|
||||
set(PYTHONLIBS_DEBUG "${CURRENT_INSTALLED_DIR}/debug/lib")
|
||||
string(REGEX REPLACE ".*python([0-9\.]+)$" "\\1" PYTHON_VERSION "${PYTHON_INCLUDE_PATH}")
|
||||
# Find Python3 executable
|
||||
vcpkg_find_acquire_program(PYTHON3)
|
||||
set(VCPKG_PYTHON_EXECUTABLE "${PYTHON3}")
|
||||
# Find Python3 libraries. Can't use find_package here, but we already know where everything is
|
||||
file(GLOB VCPKG_PYTHON_INCLUDE "${CURRENT_INSTALLED_DIR}/include/python3.*")
|
||||
set(VCPKG_PYTHON_LIBS_RELEASE "${CURRENT_INSTALLED_DIR}/lib")
|
||||
set(VCPKG_PYTHON_LIBS_DEBUG "${CURRENT_INSTALLED_DIR}/debug/lib")
|
||||
string(REGEX REPLACE ".*python([0-9\.]+).*" "\\1" VCPKG_PYTHON_VERSION "${VCPKG_PYTHON_INCLUDE}")
|
||||
|
@ -171,8 +171,6 @@ boost-locale:arm-uwp=fail
|
||||
boost-locale:x64-uwp=fail
|
||||
boost-log:arm-uwp=fail
|
||||
boost-log:x64-uwp=fail
|
||||
boost-python:x64-linux=ignore
|
||||
boost-mpi:x64-linux=fail
|
||||
boost-mpi:x64-osx=fail
|
||||
boost-stacktrace:arm-uwp=fail
|
||||
boost-stacktrace:x64-uwp=fail
|
||||
|
Loading…
x
Reference in New Issue
Block a user