diff --git a/CMakeLists.txt b/CMakeLists.txt index 523784f6b..430e1cc61 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -16,7 +16,7 @@ IF( POLICY CMP0054 ) ENDIF( POLICY CMP0054 ) # # cppad_version is used by version.sh to get the version number. -SET(cppad_version "20240324") +SET(cppad_version "20240328") SET(cppad_url "https://coin-or.github.io/CppAD" ) SET(cppad_description "Differentiation of C++ Algorithms" ) IF( NOT DEFINED CMAKE_BUILD_TYPE) @@ -227,10 +227,19 @@ IF( NOT minimal_cplusplus ) SET(CMAKE_CXX_STANDARD_REQUIRED ON) ENDIF( NOT minimal_cplusplus ) # +# use_cplusplus_2014_ok +SET(source " +int main(void) +{ static_assert( __cplusplus >= 201302L , \"c++17 is supported\" ); + return 0; +}" +) +compile_source_test(${cmake_defined_ok} "${source}" use_cplusplus_2014_ok ) +# # use_cplusplus_2017_ok SET(source " int main(void) -{ static_assert( __cplusplus >= 201703 , \"c++17 is supported\" ); +{ static_assert( __cplusplus >= 201703L , \"c++17 is supported\" ); return 0; }" ) @@ -314,6 +323,9 @@ SET(system_include TRUE) # # eigen IF( ${include_eigen} ) + IF( NOT ${use_cplusplus_2014_ok} ) + MESSAGE(FATAL_ERROR "include eigen is true but c++14 not supported") + ENDIF( ) pkgconfig_info(eigen ${system_include}) IF( DEFINED eigen_prefix ) MESSAGE(FATAL_ERROR "include_eigen is true and eigen_prefix is defined") diff --git a/appendix/whats_new/2024.xrst b/appendix/whats_new/2024.xrst index b4294ee63..f14a7cc70 100644 --- a/appendix/whats_new/2024.xrst +++ b/appendix/whats_new/2024.xrst @@ -30,6 +30,13 @@ Release Notes for 2024 mm-dd ***** +03-28 +===== +Change the get_eigen.sh +:ref:`get_eigen.sh@Version` from 3.3.7 to the master branch on 2024-03-24; see +`issue 200 `_ . +Note that the new verison of eigen requires c++14 or higher. + 03-23 ===== #. Change the upper case one letter variable names in the diff --git a/bin/check_all.sh b/bin/check_all.sh index e36a2b135..841e83944 100755 --- a/bin/check_all.sh +++ b/bin/check_all.sh @@ -151,7 +151,12 @@ else then package_vector='--boost_vector' else - package_vector='--eigen_vector' + if [ "$standard" == '--c++17' ] + then + package_vector='--eigen_vector' + else + package_vector='--std_vector' + fi fi fi cat << EOF @@ -177,10 +182,13 @@ then compiler='' fi # -# standard +# standard, exclude_package if [ "$standard" == '--c++17' ] then standard='' # default for run_cmake.sh and configure + exclude_package='' +else + exclude_package='--no_eigen --no_sacado' fi # --------------------------------------------------------------------------- # absoute prefix where optional packages are installed @@ -263,6 +271,7 @@ else $compiler \ $standard \ $debug_which \ + $exclude_package \ $package_vector fi echo_log_eval cd build diff --git a/bin/get_eigen.sh b/bin/get_eigen.sh index ab3cfa1f9..bcd8bb3f1 100755 --- a/bin/get_eigen.sh +++ b/bin/get_eigen.sh @@ -1,6 +1,6 @@ # SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later # SPDX-FileCopyrightText: Bradley M. Bell -# SPDX-FileContributor: 2003-22 Bradley M. Bell +# SPDX-FileContributor: 2003-24 Bradley M. Bell # ---------------------------------------------------------------------------- # {xrst_begin get_eigen.sh} # {xrst_comment_ch #} @@ -38,7 +38,9 @@ # This will install the following version of Eigen # {xrst_spell_off} # {xrst_code sh} -version='3.3.7' +# This was the mater version on 2024-03-24 +# 'a39ade4ccf99df845ec85c580fbbb324f71952fa' +version='a39ade4' # {xrst_code} # {xrst_spell_on} # diff --git a/bin/run_cmake.sh b/bin/run_cmake.sh index 4c5bfd777..ad30eb8eb 100755 --- a/bin/run_cmake.sh +++ b/bin/run_cmake.sh @@ -1,7 +1,7 @@ #! /usr/bin/env bash # SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later # SPDX-FileCopyrightText: Bradley M. Bell -# SPDX-FileContributor: 2003-23 Bradley M. Bell +# SPDX-FileContributor: 2003-24 Bradley M. Bell # ---------------------------------------------------------------------------- set -e -u if [ ! -e "bin/run_cmake.sh" ] @@ -74,7 +74,7 @@ usage: bin/run_cmake.sh: \\ [--_vector] \\ [--debug_] The --help option just prints this message and exits. -The value above must be one of: cppad, boost, or eigen. +The value above must be one of: cppad, boost, eigen, or std. The value must be one of: odd, even, all, none. The value must be one of: size_t, int, unsigned_int @@ -210,8 +210,17 @@ EOF done if [ "$standard" == 'c++11' ] then - # Scacdo will not build with c++11 - yes_sacado='no' + # Scacdo and eigen cannot be used with c++11 + if [ "$yes_eigen" == 'yes' ] + then + echo 'Cannot use eigen with c++11' + exit 1 + fi + if [ "$yes_sacado" == 'yes' ] + then + echo 'Cannot use sacado with c++11' + exit 1 + fi fi # --------------------------------------------------------------------------- if [ ! -e build ] @@ -353,8 +362,8 @@ then cppad_cxx_flags="$cppad_cxx_flags -O0" elif [ "$callgrind" == 'yes' ] then - # This is a quote from the Callgrind manual: - # 'As with Cachegrind, you probably want to compile with debugging info + # This is a quote from the Callgrind manual: + # 'As with Cachegrind, you probably want to compile with debugging info # (the -g option) and with optimization turned on.' cmake_args="$cmake_args -g" fi diff --git a/example/multi_thread/get_started.xrst b/example/multi_thread/get_started.xrst index e2b4b918c..d52006343 100644 --- a/example/multi_thread/get_started.xrst +++ b/example/multi_thread/get_started.xrst @@ -1,9 +1,14 @@ -{xrst_comment: This template file has the following parameters: +{xrst_comment +# SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later +# SPDX-FileCopyrightText: Bradley M. Bell +# SPDX-FileContributor: 2024 Bradley M. Bell + +This template file has the following parameters: @Name@ : is the name of this threading system @####@ : is the underlining for the name of the threading system -@DEFAULT@ : is macro a macro name. If it is 1 (0), +@DEFAULT@ : is macro a macro name. If it is 1 (0), the ADFun default ctor is used (is not used) -@Dir@ : is the subdirectory of multi_thread that contins the source code +@Dir@ : is the subdirectory of multi_thread that contins the source code for this get_started.cpp } diff --git a/user_guide.xrst b/user_guide.xrst index 6700bf752..c7b137712 100644 --- a/user_guide.xrst +++ b/user_guide.xrst @@ -13,7 +13,7 @@ {xrst_comment BEGIN: Before changing see new_release.sh and check_version.sh} -cppad-20240324: CppAD User's Manual +cppad-20240328: CppAD User's Manual ################################### .. image:: {xrst_dir coin.png}