diff --git a/.gitignore b/.gitignore index e178b08..3888089 100644 --- a/.gitignore +++ b/.gitignore @@ -13,7 +13,8 @@ /new/ /new.*/ # --------------------------------------------------------------------------- -# source code tarball creates CppAD-20190200.4 -/20190200.4.tar.gz -# documentation tarball creates CppAD-20190200.doc -/20190200.doc.tar.gz +# source code tarball creates CppAD-20200000.0 +/20200000.0.tar.gz +# +# documentation tarball creates CppAD-20200000.doc +/20200000.doc.tar.gz diff --git a/cppad.spec b/cppad.spec index 2cd01b6..e5012c7 100644 --- a/cppad.spec +++ b/cppad.spec @@ -1,33 +1,30 @@ # vim: set expandtab: # ---------------------------------------------------------------------------- -# Lint -# ---------------------------------------------------------------------------- -# The comamnd 'fedpkg lint' generates the following warnings: -# -# cppad.src:103: W: rpm-buildroot-usage -# %%prep includedir=%%{buildroot}%%{_includedir} -# See https://lists.fedoraproject.org/pipermail/devel/2011-January/147969.html -# ---------------------------------------------------------------------------- # Preamble # ---------------------------------------------------------------------------- # yyyy is year, mm is month, dd is day, corresponding to this version # The $${version} includes a bug fix number at end that starts at zero. -%define yyyymmdd 20190200 +%define yyyymmdd 20200000 +# +# fedora uses its own soversion number for cppad_lib +%define soversion 1.0 # Fedora Release starts with 1; see # https://fedoraproject.org/wiki/Packaging:Versioning Name: cppad -Version: %{yyyymmdd}.4 -Release: 2%{?dist} +Version: %{yyyymmdd}.0 +Release: 1%{?dist} Summary: C++ Algorithmic Differentiation (AD), %{name}-devel and %{name}-doc # As of yet, there are no object libraries or executables included in this # package. However, the results of the cmake command depend on the architecture # so we do not include 'BuildArch: noarch' in this spec file. -# The user can compile with or without debugging so there is nothing useful in -# *debuginfo. If status of cppad_lib changes (and it gets installed), this may -# change (see mention of cppad_lib below). +# As of yet there is no debug version installed for cppad_lib. +# The user can compile with or without debugging using this library, +# because CPPAD_DEBUG_AND_RELEASE is defined. +# The library is currently very small and not tracing the debugger into it +# should not be a problem. This may change in the future. %global debug_package %{nil} License: EPL-2.0 or GPLv2+ @@ -89,30 +86,59 @@ tar -xzf %{_topdir}/SOURCES/%{yyyymmdd}.doc.tar.gz mv CppAD-%{yyyymmdd}.doc/doc CppAD-%{version}/doc mv CppAD-%{version}/COPYING COPYING mv CppAD-%{version}/uw_copy_040507.html uw_copy_040507.html - # -# Patch corresponding to upstream source 20190200.5 -# (will not be needed once we advance the upstream source) -sed -i.bak CppAD-%{version}/include/cppad/local/play/player.hpp \ - -e '/^ *case LtppOp:/d' \ - -e 's/^\( *\)case LeppOp:/&\n\1case LtppOp:/' - +# cppad_lib: replace soversion number and ensure build type is release +sed -i.bak CppAD-%{version}/cppad_lib/CMakeLists.txt \ + -e "s|\${soversion}|%{soversion}|" \ + -e "s|\${cppad_debug_which}|debug_none|" # -# Replace cppad_SOURCE_DIR by the system include directory so that -# installed files, instead of local files, are used for testing. -includedir=%{buildroot}%{_includedir} -sed -e "s|\${cppad_SOURCE_DIR}/include|SYSTEM $includedir|" \ - -i.bak CppAD-%{version}/CMakeLists.txt +# configure.hpp.in: Make sure CPPAD_DEBUG_AND_RELEASE is defined +# so we can use cppad_lib with both debug and release builds. +sed -i.bak CppAD-%{version}/include/cppad/configure.hpp.in \ + -e 's|# define CPPAD_CONFIGURE_HPP|&\n# define CPPAD_DEBUG_AND_RELEASE|' +# +# set_compile_flags.cmake: remove conditional def of CPPAD_DEBUG_AND_RELEASE +sed -i.bak CppAD-%{version}/cmake/set_compile_flags.cmake \ + -e 's|-DCPPAD_DEBUG_AND_RELEASE||' +# +# test_more/debug_rel/CMakeLists.txt: remove def of CPPAD_DEBUG_AND_RELEASE +sed -i.bak CppAD-%{version}/test_more/debug_rel/CMakeLists.txt \ + -e 's|-DCPPAD_DEBUG_AND_RELEASE||' +# +# Remove assertion because there seems to be a bug in following g++ warning +# (note OpCode was converted to size_t before the comparision): +# the result of the conversion is unspecified because +# 'std::numeric_limits::max()' is outside the range of type +# 'CppAD::local::OpCode' [-Wconversion]. +sed -i.bak CppAD-%{version}/include/cppad/local/op_code_var.hpp \ + -e '/std::numeric_limits::max()/s|^\( *\).*|\1true|' +# +# Patch will not be necessary when upsstream sourse is >= 20200000.0 +cat << EOF > junk.sed +/write(fd, char_ptr, char_size);/! b skip +s|^ *|&ssize_t flag = | +s|\$|&\\ + if( flag < 0 )\\ + { std::cerr << "put_check_nan: write error\\\\n";\\ + std::exit(1);\\ + }| +: skip +EOF +sed -i.bak CppAD-%{version}/include/cppad/core/check_for_nan.hpp -f junk.sed # ----------------------------------------------------------------------------- # build # ----------------------------------------------------------------------------- %build # -# Cannot use %%{_includedir}, $${_libdir}, %%{_datadir}, %%{_docdir} +# 1. Cannot use %%{_includedir}, $${_libdir}, %%{_datadir}, %%{_docdir} # because they are absolute paths. Relative values would be more flexible # because they can be combined with %%{_prefix} to get absolute values. -# The last argument to the cmake command is the directory created using +# +# 2. The last argument to the cmake command is the directory created using # the souce code tarball. +# +# 3. The debug_all is overridden by for cppad_lib by the edit of +# cppad_lib/CMakeLists.txt above cppad_cxx_flags='-Wall -pedantic-errors -std=c++11 -Wshadow -Wconversion' %cmake --version %cmake \ @@ -121,6 +147,7 @@ cppad_cxx_flags='-Wall -pedantic-errors -std=c++11 -Wshadow -Wconversion' \ -D cppad_prefix=%{_prefix} \ -D cppad_postfix='' \ + \ -D cmake_install_includedirs=include \ -D cmake_install_libdirs=%{_lib} \ -D cmake_install_datadir=share \ @@ -135,12 +162,11 @@ cppad_cxx_flags='-Wall -pedantic-errors -std=c++11 -Wshadow -Wconversion' \ -D cppad_cxx_flags="$cppad_cxx_flags" \ -D cppad_profile_flag='' \ - \ -D cppad_test_vector=cppad \ -D cppad_max_num_theads=64 \ -D cppad_tape_id_type=size_t \ -D cppad_tape_addr_type=size_t \ - -D cppad_deprecated=NO \ + -D cppad_debug_which='debug_all' \ CppAD-%{version} # make %{?_smp_mflags} @@ -156,6 +182,9 @@ make install DESTDIR=%{buildroot} %{_includedir}/%{name} %{_datadir}/pkgconfig/%{name}.pc %{_libdir}/pkgconfig/%{name}.pc +%{_libdir}/libcppad_lib.so +%{_libdir}/libcppad_lib.so.%{soversion} + # These documentation files come from the source code tarball %doc COPYING uw_copy_040507.html @@ -172,6 +201,15 @@ make check # ---------------------------------------------------------------------------- %changelog +* Thu Jan 02 2020 Brad Bell - 20200000.0-1 +- Advance to version 2020 of cppad +- This is a major change because it we need to install the binary cppad_lib. +- No longer have lint error because must build library before installing. +- Remove patch for upstream source < 20190200.5. +- No debug_package, so need to ensure CPPAD_DEBUG_AND_RELEASE always defined. +- cppad_deprecatred is no longer in cmake command line. +- cppad_debug_which is set to debug_all and overridden for cppad_lib directory. + * Wed Sep 18 2019 Brad Bell - 20190200.4-2 - fedpkg lint now reconizes EPL-2.0 license so remove comment about its error - Use sed edit of 20190200.4 to obtain bug fix that is in 20190200.5 diff --git a/sources b/sources index 14c6456..99d95ae 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (20190200.4.tar.gz) = cb1021a3f805ca5fe54934893f3e9add689d7a1ec359d8ead18993693e98508bb1598bcb7ff7a1091996bbb77e33adba2ff2c0e61360c89b95f8b20f4535c474 -SHA512 (20190200.doc.tar.gz) = 3099aa190b19f50e5a33d49aac62ce9218527f4810c85dad132068658922149af4e90b8c0658174711795d349769c664ca57c4bf15c603e8cfadfb160a8c1dd5 +SHA512 (20200000.0.tar.gz) = 04e5b885947b2450282854825a6baaa5c480fcb251c040a6d419c00b8015a80c633f6f3e46d44b79aebc68a082b8860ed0f6f6b5e4ea1601a5ba38a7d921e07f +SHA512 (20200000.doc.tar.gz) = 4f7c5a6b4405e3eca0589a08b2cdc42209de0670b6fe02fe39887bfacea95bff6e4fa889183def09d405dc4ff79b8d611f94c5528eb6f71c61dfae56e2de2561