Commit dfd9faa2 authored by David Thompson's avatar David Thompson

Use a newer boost than the common superbuild.

This is an attempt to work around an MSVC 2015 internal
compiler error.

This also bumps remus to catch a fix for a link-error
bug in the newer boost.
parent 8b66bbf8
Pipeline #147386 failed with stage
......@@ -256,7 +256,12 @@ set(qt5_skip_modules
set(BOOST_ADDITIONAL_LIBRARIES "" CACHE STRING "Additional boost libraries to build and package")
mark_as_advanced(BOOST_ADDITIONAL_LIBRARIES)
set(boost_minimum_version 1.64.0)
if (WIN32)
# Minimum boost required to avoid internal compiler error with MSVC 2015:
set(boost_minimum_version 1.71.0)
else()
set(boost_minimum_version 1.64.0)
endif()
set(boost_libraries
atomic
chrono
......
set(boost_platform_options)
if (CMAKE_CXX_COMPILER_ID MATCHES "Clang" AND NOT
(CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang" AND
CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 10.0.1.10010046))
# Set the platform to be clang if using it.
list(APPEND boost_platform_options
toolset=clang)
endif ()
if (cxx11_enabled)
list(APPEND boost_platform_options
cxxflags=${CMAKE_CXX11_STANDARD_COMPILE_OPTION})
endif ()
if (NOT APPLE)
list(APPEND boost_platform_options
hardcode-dll-paths=true
"dll-path='\\$ORIGIN'")
endif ()
include(boost.common)
if (APPLE)
superbuild_apply_patch(boost osx-rpath
"Remove @rpath from the install name of Boost's libraries")
superbuild_project_add_step(fix-install-names
COMMAND "${CMAKE_COMMAND}"
"-Dlibdir:PATH=<INSTALL_DIR>/lib"
-P "${CMAKE_CURRENT_LIST_DIR}/scripts/boost.fix-install-names.cmake"
DEPENDEES install
COMMENT ""
WORKING_DIRECTORY <INSTALL_DIR>/lib)
endif ()
diff -Nr -U5 boost_1_59_0/tools/build/src/tools/clang-darwin.jam boost_1_59_0.osx-rpath/tools/build/src/tools/clang-darwin.jam
--- boost_1_59_0/tools/build/src/tools/clang-darwin.jam 2015-08-11 09:53:51.000000000 -0400
+++ boost_1_59_0.osx-rpath/tools/build/src/tools/clang-darwin.jam 2015-12-09 18:11:47.051499473 -0500
@@ -183,7 +183,7 @@
"$(CONFIG_COMMAND)" $(USER_OPTIONS) -L"$(LINKPATH)" -o "$(<)" "$(>)" "$(LIBRARIES)" $(START-GROUP) $(FINDLIBS-ST-PFX) -l$(FINDLIBS-ST) $(FINDLIBS-SA-PFX) -l$(FINDLIBS-SA) $(END-GROUP) $(OPTIONS)
}
actions link.dll bind LIBRARIES
{
- "$(CONFIG_COMMAND)" $(USER_OPTIONS) -L"$(LINKPATH)" -o "$(<)" -single_module -dynamiclib -install_name "@rpath/$(<[1]:D=)" "$(>)" "$(LIBRARIES)" $(START-GROUP) $(FINDLIBS-ST-PFX) -l$(FINDLIBS-ST) $(FINDLIBS-SA-PFX) -l$(FINDLIBS-SA) $(END-GROUP) $(OPTIONS)
+ "$(CONFIG_COMMAND)" $(USER_OPTIONS) -L"$(LINKPATH)" -o "$(<)" -single_module -dynamiclib -headerpad_max_install_names -install_name "$(<[1]:D=)" "$(>)" "$(LIBRARIES)" $(START-GROUP) $(FINDLIBS-ST-PFX) -l$(FINDLIBS-ST) $(FINDLIBS-SA-PFX) -l$(FINDLIBS-SA) $(END-GROUP) $(OPTIONS)
}
file(GLOB boost_libraries "libboost_*.dylib")
foreach (boost_library IN LISTS boost_libraries)
# Fix the ID of the library to be a full path.
execute_process(
COMMAND install_name_tool
-id "${boost_library}"
"${boost_library}"
RESULT_VARIABLE res)
if (res)
message(FATAL_ERROR "Failed to update library ID of ${boost_library}")
endif ()
# Find the other Boost libraries linked to fix them.
execute_process(
COMMAND otool
-L
"${boost_library}"
OUTPUT_VARIABLE out
RESULT_VARIABLE res)
if (res)
message(FATAL_ERROR "Failed to update library ID of ${boost_library}")
endif ()
# Extract out the Boost libraries.
string(REGEX MATCHALL "\tlibboost_[^.]*\\.dylib" linked_libraries "${out}")
string(REPLACE "\t" "" linked_libraries "${linked_libraries}")
set(args)
foreach (linked_library IN LISTS linked_libraries)
list(APPEND args
-change "${linked_library}" "${libdir}/${linked_library}")
endforeach ()
# If there are any libraries to change, do so.
if (args)
execute_process(
COMMAND install_name_tool
${args}
"${boost_library}"
RESULT_VARIABLE res)
if (res)
message(FATAL_ERROR "Failed to update linked library IDs of ${boost_library}")
endif ()
endif ()
endforeach ()
set(boost_options)
set(boost_use_static)
if (BUILD_SHARED_LIBS)
list(APPEND boost_options
link=shared)
set(boost_use_static OFF)
else ()
list(APPEND boost_options
link=static)
set(boost_use_static ON)
endif ()
list(APPEND boost_options
--prefix=<INSTALL_DIR>
--includedir=<INSTALL_DIR>/include)
if (NOT boost_libraries)
# Boost's build system is silly and builds all by default, but doesn't have a
# flag to say "build no libraries". We add this so we get a small build, but
# we also get an install rule for all of the headers.
set(boost_libraries
system)
endif ()
foreach (boost_library IN LISTS boost_libraries)
list(APPEND boost_options
--with-${boost_library})
endforeach ()
if (WIN32)
set(boost_build_commands
CONFIGURE_COMMAND
<SOURCE_DIR>/bootstrap.bat
BUILD_COMMAND
<SOURCE_DIR>/b2
${boost_options}
${boost_platform_options}
${boost_extra_options}
install
INSTALL_COMMAND
"")
else ()
set(boost_build_commands
CONFIGURE_COMMAND
<SOURCE_DIR>/bootstrap.sh
BUILD_COMMAND
<SOURCE_DIR>/b2
${boost_options}
${boost_platform_options}
${boost_extra_options}
INSTALL_COMMAND
<SOURCE_DIR>/b2
${boost_options}
${boost_platform_options}
${boost_extra_options}
install)
endif ()
superbuild_add_project(boost
CAN_USE_SYSTEM
BUILD_IN_SOURCE 1
DEPENDS_OPTIONAL cxx11
"${boost_build_commands}"
${boost_extra_arguments})
superbuild_add_extra_cmake_args(
-DBOOST_ROOT:PATH=<INSTALL_DIR>
-DBoost_USE_STATIC_LIBS:BOOL=${boost_use_static})
find_package(Boost ${boost_minimum_version} REQUIRED
COMPONENTS
${boost_libraries})
superbuild_add_extra_cmake_args(
-DBoost_NO_SYSTEM_PATHS:BOOL=ON
-DBOOST_INCLUDEDIR:PATH=${Boost_INCLUDE_DIR})
set(boost_platform_options)
# 8.0 and below unsupported anyways.
if (NOT MSVC_VERSION VERSION_GREATER 1400)
message(FATAL_ERROR "At least Visual Studio 9.0 is required")
elseif (NOT MSVC_VERSION VERSION_GREATER 1500)
set(msvc_ver 9.0)
elseif (NOT MSVC_VERSION VERSION_GREATER 1600)
set(msvc_ver 10.0)
elseif (NOT MSVC_VERSION VERSION_GREATER 1700)
set(msvc_ver 11.0)
elseif (NOT MSVC_VERSION VERSION_GREATER 1800)
set(msvc_ver 12.0)
elseif (NOT MSVC_VERSION VERSION_GREATER 1900)
set(msvc_ver 14.0)
elseif (NOT MSVC_VERSION VERSION_GREATER 1910)
set(msvc_ver 14.1)
elseif (NOT MSVC_VERSION VERSION_GREATER 1920)
set(msvc_ver 15.0)
else ()
message(FATAL_ERROR "Unrecognized MSVC version: ${MSVC_VERSION}")
endif ()
list(APPEND boost_platform_options
"--toolset=msvc-${msvc_ver}")
if (superbuild_is_64bit)
list(APPEND boost_platform_options
address-model=64)
else ()
list(APPEND boost_platform_options
address-model=32)
endif ()
include(boost.common)
# This patch is applied so that a rogue junction is not left inside of the
# build tree for dashboard machines. CMake cannot delete such files, so we just
# remove the code which creates such things here.
superbuild_apply_patch(boost no-junction-test
"Assume junctions work on Windows")
superbuild_project_add_step(boost-copylibs
COMMAND "${CMAKE_COMMAND}"
-Dinstall_location:PATH=<INSTALL_DIR>
-P "${CMAKE_CURRENT_LIST_DIR}/scripts/boost.copylibs.cmake"
DEPENDEES install
COMMENT "Copy .dll files to the bin/ directory"
WORKING_DIRECTORY <SOURCE_DIR>)
--- a/tools/build/src/tools/link.jam
+++ b/tools/build/src/tools/link.jam
@@ -61,35 +61,14 @@
}
if [ os.name ] = NT
{
-# Test for Windows junctions (mklink /J)
+.can-junction = true ;
+
rule can-junction ( project )
{
- if ! $(.can-junction)
- {
- local root-project = [ get-root-project $(project) ] ;
-
- local source-target = [ new file-target test-junction-source : :
- $(project) : [ new action : common.mkdir ] ] ;
- local target = [ new file-target test-junction : :
- $(project) : [ new action $(source-target) : link.junction ] ] ;
-
- if [ configure.try-build $(target) : [ property-set.empty ] : "junctions supported" ]
- {
- .can-junction = true ;
- }
- else
- {
- .can-junction = false ;
- }
- }
- if $(.can-junction) = true
- {
- return true ;
- }
}
}
else
{
file(
COPY "${install_location}/lib/"
DESTINATION "${install_location}/bin"
FILES_MATCHING
PATTERN "boost*.dll")
cmake_minimum_required(VERSION 3.0)
project(standalone-boost)
function (superbuild_find_projects var)
set(projects
boost
cxx11
zlib)
set("${var}"
${projects}
PARENT_SCOPE)
endfunction ()
function (superbuild_sanity_check)
if (NOT boost_enabled)
message(FATAL_ERROR "Boost must be enabled.")
endif ()
endfunction ()
set(_superbuild_default_boost ON)
set(boost_libraries ""
CACHE STRING "The list of Boost libraries to build.")
set(boost_install_location ""
CACHE PATH "Location to install Boost to.")
if (NOT boost_install_location)
message(FATAL_ERROR "boost_install_location is not set!")
endif ()
set(superbuild_install_location "${boost_install_location}")
get_filename_component(sb_dir "${CMAKE_CURRENT_LIST_DIR}" DIRECTORY)
add_subdirectory("${sb_dir}" "${CMAKE_CURRENT_BINARY_DIR}/superbuild")
superbuild_set_revision(boost
URL "https://www.paraview.org/files/dependencies/boost_1_66_0.tar.bz2"
URL_MD5 b2dfbd6c717be4a7bb2d88018eaccf75)
URL "https://www.paraview.org/files/dependencies/boost_1_71_0.tar.bz2"
URL_MD5 4cdf9b5c2dc01fb2b7b733d5af30e558
)
# While the goal is to be consistent with a SHA on ParaView's main fork, CMB
# frequently uses a custom fork of ParaView in order to maintain functionality
......@@ -114,7 +115,7 @@ superbuild_set_revision(zeromq
# Use remus from Fri Sep 1 15:56:16 2017 +0000
superbuild_set_revision(remus
GIT_REPOSITORY "https://gitlab.kitware.com/cmb/remus.git"
GIT_TAG 85355887b0da9d8b81bf1de999ba3a0f3ea7eb80)
GIT_TAG 405a0e9f2d8b826a0fe7d538e80678b5dee29880)
superbuild_set_revision(gdal
# https://github.com/judajake/gdal-svn.git
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment