Commit 823a9a84 authored by Dave Moxey's avatar Dave Moxey

Merge branch 'fix/boost-compiler' into 'master'

Adjust third-party boost build for different toolset choices

See merge request !886
parents cb12dfd5 a1b976ac
Pipeline #1155 passed with stages
in 10 minutes and 20 seconds
......@@ -39,6 +39,8 @@ v5.0.0
- Fix minor bug in ARPACK thirdparty build cmake (!874)
- Added in sum factorisation version for pyramid expnasions and orthogonal
expansion in pyramids (!750)
- Adjust boost third-party compilation to account for different toolset
choices (!886)
- Switch MeshGraph to use factory pattern and add HDF5 geometry support (!900,
!904, !941)
- Restructure the low energy preconditioner to handle pyramidic and variable
......
CMAKE_MINIMUM_REQUIRED(VERSION 2.8.8)
CMAKE_MINIMUM_REQUIRED(VERSION 2.8.11)
SET(CMAKE_BUILD_TYPE Release CACHE STRING "Choose the type of build,
options are: None(CMAKE_CXX_FLAGS or CMAKE_C_FLAGS used) Debug Release
RelWithDebInfo MinSizeRel.")
......
......@@ -77,23 +77,48 @@ IF (THIRDPARTY_BUILD_BOOST)
ENDIF ()
ENDIF()
# Build Boost
# Build Boost: first need to select toolset. Some will have specific
# versions.
SET(TOOLSET_VERSION "")
IF (APPLE)
# macOS should have the darwin toolset regardless of gcc/clang.
SET(TOOLSET darwin)
ELSEIF (WIN32)
IF (MSVC10)
SET(TOOLSET msvc-10.0)
ELSEIF (MSVC11)
SET(TOOLSET msvc-11.0)
ELSEIF (MSVC12)
SET(TOOLSET msvc-12.0)
ELSEIF (MSVC14)
SET(TOOLSET msvc-14.0)
ELSEIF (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
SET(TOOLSET msvc)
IF (MSVC_VERSION EQUAL 1600)
SET(TOOLSET_VERSION 10.0) # Visual Studio 2010
ELSEIF (MSVC_VERSION EQUAL 1700)
SET(TOOLSET_VERSION 11.0) # Visual Studio 2012
ELSEIF (MSVC_VERSION EQUAL 1800)
SET(TOOLSET_VERSION 12.0) # Visual Studio 2013
ELSEIF (MSVC_VERSION EQUAL 1900)
SET(TOOLSET_VERSION 14.0) # Visual Studio 2015
ELSEIF (MSVC_VERSION GREATER 1909 AND MSVC_VERSION LESS 1920)
SET(TOOLSET_VERSION 14.1) # Visual Studio 2017
ELSEIF (MSVC_VERSION GREATER 1919 AND MSVC_VERSION LESS 1930)
SET(TOOLSET_VERSION 14.2) # Visual Studio 2019
ENDIF()
ELSEIF(CMAKE_CXX_COMPILER_ID STREQUAL "Cray")
SET(TOOLSET cray)
ELSEIF(CMAKE_CXX_COMPILER_ID STREQUAL "Intel")
SET(TOOLSET intel)
ELSEIF(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
SET(TOOLSET gcc)
SET(TOOLSET_VERSION ${CMAKE_CXX_COMPILER_VERSION})
ELSEIF(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
SET(TOOLSET clang)
SET(TOOLSET_VERSION ${CMAKE_CXX_COMPILER_VERSION})
ELSE()
MESSAGE(STATUS "Unknown compiler for boost, assuming gcc toolset")
SET(TOOLSET gcc)
ENDIF()
IF (TOOLSET_VERSION STREQUAL "")
SET(TOOLSET_CMDLINE ${TOOLSET})
ELSE()
SET(TOOLSET_CMDLINE ${TOOLSET}-${TOOLSET_VERSION})
ENDIF()
IF (NOT WIN32)
EXTERNALPROJECT_ADD(
boost
......@@ -106,7 +131,7 @@ IF (THIRDPARTY_BUILD_BOOST)
BINARY_DIR ${TPBUILD}/boost
TMP_DIR ${TPBUILD}/boost-tmp
INSTALL_DIR ${TPDIST}
CONFIGURE_COMMAND CC=${CMAKE_C_COMPILER} CXX=${CMAKE_CXX_COMPILER} ./bootstrap.sh --prefix=${TPDIST}
CONFIGURE_COMMAND ./bootstrap.sh
BUILD_COMMAND NO_BZIP2=1 ./b2
variant=release
link=shared
......@@ -114,7 +139,8 @@ IF (THIRDPARTY_BUILD_BOOST)
cxxflags="-w"
linkflags="-L${TPDIST}/lib"
${BOOST_FLAGS} ${BOOST_LIB_LIST}
--layout=system toolset=${TOOLSET} install
--prefix=${TPDIST}
--layout=system toolset=${TOOLSET_CMDLINE} install
INSTALL_COMMAND ""
)
ELSE ()
......@@ -136,7 +162,7 @@ IF (THIRDPARTY_BUILD_BOOST)
INSTALL_DIR ${TPDIST}
CONFIGURE_COMMAND call bootstrap.bat
BUILD_COMMAND b2 variant=release
toolset=${TOOLSET}
toolset=${TOOLSET_CMDLINE}
address-model=${ADDRESS_MODEL}
link=shared
runtime-link=shared
......@@ -153,11 +179,24 @@ IF (THIRDPARTY_BUILD_BOOST)
IF (APPLE)
EXTERNALPROJECT_ADD_STEP(boost patch-install-path
COMMAND sed -i ".bak" "s|-install_name \"|&${TPDIST}/lib/|" ${TPBUILD}/boost/tools/build/src/tools/darwin.jam
COMMAND sed -i ".bak" "s|-install_name \"|&${TPDIST}/lib/|"
${TPBUILD}/boost/tools/build/src/tools/darwin.jam
DEPENDERS build
DEPENDEES download)
ENDIF (APPLE)
# Write to jamfile to use appropriate toolset.
SET(cmd_string "using ${TOOLSET} : ${TOOLSET_VERSION}")
SET(cmd_string "${cmd_string} : ${CMAKE_CXX_COMPILER} $<SEMICOLON>")
IF (UNIX)
EXTERNALPROJECT_ADD_STEP(boost conf-project-conf
COMMAND cmake -E echo "${cmd_string}" >
${TPBUILD}/boost/tools/build/src/user-config.jam
DEPENDERS build
DEPENDEES configure)
ENDIF()
# If building ThirdParty zlib, force zlib build before boost
IF (THIRDPARTY_BUILD_ZLIB)
ADD_DEPENDENCIES(boost zlib-1.2.7)
......
......@@ -56,7 +56,7 @@ installed system-wide).
Package & Req. & Sys. & User & Auto. & Note \\
\midrule
C++ compiler & \cmark & \cmark & & & gcc, icc, etc, supporting C++11 \\
CMake $>2.8.8$ & \cmark & \cmark & \cmark & & Ncurses
CMake $>2.8.11$ & \cmark & \cmark & \cmark & & Ncurses
GUI optional
\\
BLAS & \cmark & \cmark & \cmark & \cmark & Or MKL,
......@@ -218,7 +218,7 @@ system-wide).
Package & Req. & MacPorts & User & Auto. & Note \\
\midrule
Xcode & \cmark & & & & Provides developer tools \\
CMake $>2.8.8$ & \cmark & \texttt{cmake} & \cmark & & Ncurses
CMake $>2.8.11$ & \cmark & \texttt{cmake} & \cmark & & Ncurses
GUI optional \\
BLAS & \cmark & & & & Part of
Xcode \\
......@@ -732,4 +732,4 @@ There are also a number of additional options to fine-tune the build:
hostfile, enabling this option adds the command line argument
\inltt{-hostfile hostfile} to the command line arguments when tests are run
with \inltt{ctest} or the \inltt{Tester} executable.
\end{itemize}
\ No newline at end of file
\end{itemize}
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