1. Advance to cppad-20180000.0.
2. Distinguish between CppAD and Fedora release. 3. Remove patches that were part of 2017 bug fixes. 4. No longer necessary to remove cppad_lib from CMakeLists.txt files. 5. Add -Wconversion and remove --ansi from cppad_cxx_flags. 6. Remove ChangeLog and AUTHORS files.
This commit is contained in:
parent
1e26fe3046
commit
58f570f486
1 changed files with 20 additions and 45 deletions
65
cppad.spec
65
cppad.spec
|
|
@ -15,15 +15,17 @@
|
|||
# These refer to the corresponding subpackage and are not spelling errors.
|
||||
# ----------------------------------------------------------------------------
|
||||
|
||||
# Release starts with 1; https://fedoraproject.org/wiki/Packaging:Versioning
|
||||
# CppAD release number starts with zero and last part of version number.
|
||||
# Fedora Release starts with 1; see
|
||||
# https://fedoraproject.org/wiki/Packaging:Versioning
|
||||
Name: cppad
|
||||
Version: 20170000.4
|
||||
Release: 4%{?dist}
|
||||
Version: 20180000.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 no longer include 'BuildArch: noarch' in this spec file.
|
||||
# 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
|
||||
|
|
@ -76,33 +78,16 @@ In addition, printable versions of the documentation,
|
|||
as a single web page, in both HTML and XML, can be found at that web site.
|
||||
|
||||
# ----------------------------------------------------------------------------
|
||||
|
||||
%clean
|
||||
# Cleanup build root at the beginning in case mock has
|
||||
# cleanup_on_failure set to zero.
|
||||
rm -rf %{buildroot}
|
||||
|
||||
# -----------------------------------------------------------------------------
|
||||
%prep
|
||||
|
||||
%setup -q
|
||||
|
||||
# Change some comparisions to properly scale to machine epsilon
|
||||
# (should not be necessary for 2018).
|
||||
cat << EOF > junk.sed
|
||||
s|NearEqual(jfac\\*\\([^,]*\\), *value *, *eps99 *, *eps99)|NearEqual(\\1, value/jfac, eps99, eps99)|
|
||||
EOF
|
||||
sed -i test_more/div.cpp -f junk.sed
|
||||
|
||||
# Fix a bug in the optimizer (should not be necessary for 2018)
|
||||
cat << EOF > junk.sed
|
||||
214,214s|^| else\\
|
||||
{ match &= arg_match[j] == op_info[candidate].arg[j];\\
|
||||
}\\
|
||||
|
|
||||
EOF
|
||||
sed -i cppad/local/optimize/match_op.hpp -f junk.sed
|
||||
#
|
||||
# -----------------------------------------------------------------------------
|
||||
# Replace cppad_SOURCE_DIR by the system include directory so that
|
||||
# installed files, instead of local files, are used for testing.
|
||||
#
|
||||
|
|
@ -111,34 +96,18 @@ sed \
|
|||
-e "s|\(INCLUDE_DIRECTORIES(\).*{cppad_SOURCE_DIR}|\1 SYSTEM $includedir|" \
|
||||
-i.bak CMakeLists.txt
|
||||
|
||||
# The include directory set above is loaded by the install procedure,
|
||||
# but cppad_lib is needed for the install procedure. Currently cppad_lib
|
||||
# only contains the cppad_colpack object which is not needed by the Fedora
|
||||
# distribution. This may or may not be true for next year 2018.
|
||||
list=`find . -name 'CMakeLists.txt' | \
|
||||
sed -e '/^\.\/CMakeLists.txt/d' -e '/^\.\/cppad_lib\/CMakeLists.txt/d'`
|
||||
for file in $list
|
||||
do
|
||||
if grep 'cppad_lib' "$file" > /dev/null
|
||||
then
|
||||
# cppad_lib is set in ./CMakeLists.txt and used in other files
|
||||
cp "$file" "$file.bak"
|
||||
sed -i "$file" -e '/^\t*${cppad_lib}$/d'
|
||||
if grep 'cppad_lib' "$file" > /dev/null
|
||||
then
|
||||
echo "Edit of $file failed."
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
done
|
||||
# It seems that it is no longer necessary to remove ${cppad_lib} from
|
||||
# CMakeLists.txt files. If this works out, remove this comment next year 2019.
|
||||
|
||||
# -----------------------------------------------------------------------------
|
||||
%build
|
||||
# See https://fedoraproject.org/wiki/Packaging:Cmake?rd=Packaging/cmake
|
||||
# and http://www.coin-or.org/CppAD/Doc/cmake.htm
|
||||
%build
|
||||
#
|
||||
# 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.
|
||||
cppad_cxx_flags='-Wall -pedantic-errors -std=c++11 -Wshadow -Wconversion'
|
||||
%cmake --version
|
||||
%cmake \
|
||||
-D CMAKE_VERBOSE_MAKEFILE=0 \
|
||||
|
|
@ -158,7 +127,7 @@ done
|
|||
-D ipopt_prefix='' \
|
||||
-D sacado_prefix='' \
|
||||
\
|
||||
-D cppad_cxx_flags='-Wall -ansi -pedantic-errors -std=c++11 -Wshadow' \
|
||||
-D cppad_cxx_flags="$cppad_cxx_flags" \
|
||||
-D cppad_profile_flag='' \
|
||||
\
|
||||
-D cppad_test_vector=cppad \
|
||||
|
|
@ -169,17 +138,20 @@ done
|
|||
.
|
||||
make %{?_smp_mflags}
|
||||
|
||||
# -----------------------------------------------------------------------------
|
||||
%install
|
||||
rm -rf %{buildroot}
|
||||
make install DESTDIR=%{buildroot}
|
||||
|
||||
# -----------------------------------------------------------------------------
|
||||
# use the installed include files to compile and run the tests
|
||||
%check
|
||||
make check
|
||||
|
||||
# -----------------------------------------------------------------------------
|
||||
%files devel
|
||||
%defattr(-,root,root,-)
|
||||
%doc COPYING ChangeLog AUTHORS uw_copy_040507.html
|
||||
%doc COPYING uw_copy_040507.html
|
||||
%{_includedir}/%{name}
|
||||
%{_datadir}/pkgconfig/%{name}.pc
|
||||
|
||||
|
|
@ -189,6 +161,9 @@ make check
|
|||
|
||||
# ----------------------------------------------------------------------------
|
||||
%changelog
|
||||
* Mon Jan 01 2018 Brad Bell <bradbell at seanet dot com> - 20180000.0-1
|
||||
- Advance to version 2018 of cppad.
|
||||
|
||||
* Fri Nov 24 2017 Brad Bell <bradbell at seanet dot com> - 20170000.4-3
|
||||
- Use sed to add bug fix corresponding to cppad-20170000.8.
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue