From e2c989cd187e5aeccc83255836d0aff5e688b69a Mon Sep 17 00:00:00 2001 From: Matt Borland Date: Mon, 16 Jan 2023 11:13:04 -0800 Subject: [PATCH] Add M1 testing to drone (#868) --- .drone.star | 2 + .drone/drone.sh | 55 ++++++++++++++++++++++++++ include/boost/math/tools/promotion.hpp | 2 +- 3 files changed, 58 insertions(+), 1 deletion(-) create mode 100644 .drone/drone.sh diff --git a/.drone.star b/.drone.star index bdf0a4a2f..5c4cc5db8 100644 --- a/.drone.star +++ b/.drone.star @@ -57,6 +57,8 @@ def main(ctx): result.append(linux_cxx("Ubuntu g++ s390s " + cxx + " " + suite, "g++", packages="g++", buildtype="boost", image="cppalliance/droneubuntu2204:multiarch", arch="s390x", environment={'TOOLSET': 'gcc', 'COMPILER': 'g++', 'CXXSTD': cxx, 'TEST_SUITE': suite, }, globalenv=globalenv)) for cxx in gnu_non_native: result.append(linux_cxx("Ubuntu g++ ARM64" + cxx + " " + suite, "g++", packages="g++", buildtype="boost", image="cppalliance/droneubuntu2204:multiarch", arch="arm64", environment={'TOOLSET': 'gcc', 'COMPILER': 'g++', 'CXXSTD': cxx, 'TEST_SUITE': suite, }, globalenv=globalenv)) + for cxx in gnu_non_native: + result.append(osx_cxx("M1 Clang " + cxx + " " + suite, "clang++", buildscript="drone", buildtype="boost", xcode_version="14.1", environment={'TOOLSET': 'clang', 'CXXSTD': cxx, 'TEST_SUITE': suite, 'DEFINE': 'BOOST_MATH_NO_REAL_CONCEPT_TESTS,BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS,BOOST_MATH_MULTI_ARCH_CI_RUN', }, globalenv=globalenv)) return result diff --git a/.drone/drone.sh b/.drone/drone.sh new file mode 100644 index 000000000..4ccf92eb7 --- /dev/null +++ b/.drone/drone.sh @@ -0,0 +1,55 @@ +# Use, modification, and distribution are +# subject to the Boost Software License, Version 1.0. (See accompanying +# file LICENSE.txt) +# +# Copyright Rene Rivera 2020. +# Copyright John Maddock 2021. + +#!/bin/bash + +set -ex +export TRAVIS_BUILD_DIR=$(pwd) +export DRONE_BUILD_DIR=$(pwd) +export TRAVIS_BRANCH=$DRONE_BRANCH +export VCS_COMMIT_ID=$DRONE_COMMIT +export GIT_COMMIT=$DRONE_COMMIT +export PATH=~/.local/bin:/usr/local/bin:$PATH + +echo '==================================> BEFORE_INSTALL' + +. .drone/before-install.sh + +echo '==================================> INSTALL' + +cd .. +if [ "$DRONE_BRANCH" == "master" ] || [[ "$DRONE_BRANCH" == */master ]]; then + export BOOST_BRANCH="master" +else + export BOOST_BRANCH="develop" +fi +git clone -b $BOOST_BRANCH --depth 1 https://github.com/boostorg/boost.git boost-root +cd boost-root +git submodule update --init tools/build +git submodule update --init libs/config +git submodule update --init libs/polygon +git submodule update --init tools/boost_install +git submodule update --init libs/headers +git submodule update --init tools/boostdep +cp -r $TRAVIS_BUILD_DIR/* libs/math +python tools/boostdep/depinst/depinst.py math +./bootstrap.sh +./b2 headers + +echo '==================================> BEFORE_SCRIPT' + +. $DRONE_BUILD_DIR/.drone/before-script.sh + +echo '==================================> SCRIPT' + +echo "using $TOOLSET : : $COMPILER : -std=$CXXSTD $OPTIONS ;" > ~/user-config.jam +(cd libs/config/test && ../../../b2 config_info_travis_install toolset=$TOOLSET && ./config_info_travis) +(cd libs/math/test && ../../../b2 toolset=$TOOLSET $TEST_SUITE define=$DEFINE) + +echo '==================================> AFTER_SUCCESS' + +. $DRONE_BUILD_DIR/.drone/after-success.sh diff --git a/include/boost/math/tools/promotion.hpp b/include/boost/math/tools/promotion.hpp index 72a0755a1..55ba064c7 100644 --- a/include/boost/math/tools/promotion.hpp +++ b/include/boost/math/tools/promotion.hpp @@ -133,7 +133,7 @@ namespace boost >::type >::type; -#ifdef BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS +#if defined(BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS) // // Guard against use of long double if it's not supported: //