%global module Bonmin
%global with_asl 1
%global with_mpi 0
Name: coin-or-%{module}
Summary: Basic Open-source Nonlinear Mixed INteger programming
Version: 1.8.6
Release: 1%{?dist}
License: CPL
URL: http://projects.coin-or.org/%{module}
Source0: http://www.coin-or.org/download/pkgsource/%{module}/%{module}-%{version}.tgz
BuildRequires: openblas-devel
BuildRequires: openblas-srpm-macros
BuildRequires: bzip2-devel
BuildRequires: coin-or-Cbc-devel
BuildRequires: coin-or-Cgl-devel
BuildRequires: coin-or-Clp-devel
BuildRequires: coin-or-CoinUtils-devel
%if %{with_mpi}
BuildRequires: coin-or-Ipopt-openmpi-devel
%else
BuildRequires: coin-or-Ipopt-devel
%endif
BuildRequires: coin-or-Osi-devel
BuildRequires: doxygen
BuildRequires: glpk-devel
BuildRequires: graphviz
BuildRequires: gcc, gcc-c++
%if %{with_asl}
BuildRequires: mp-devel
%endif
%if %{with_mpi}
BuildRequires: openmpi-devel
BuildRequires: scalapack-openmpi-devel
BuildRequires: openssh-clients
%endif
BuildRequires: pkgconfig
BuildRequires: readline-devel
BuildRequires: texlive
BuildRequires: zlib-devel
# Install documentation in standard rpm directory
Patch0: %{name}-docdir.patch
# Header not installed but required by other projects (Couenne at least)
Patch1: %{name}-include.patch
%description
Bonmin (Basic Open-source Nonlinear Mixed INteger programming) is an
experimental open-source C++ code for solving general MINLP (Mixed Integer
NonLinear Programming) problems of the form:
min f(x)
s.t. g_L <= g(x) <= g_U
x_L <= x <= x_U
x_i in Z for all i in I and,
x_i in R for all i not in I.
where f(x): R^n --> R, g(x): R^n --> R^m are twice continuously differentiable
functions and I is a subset of {1,..,n}.
Bonmin features several algorithms
* B-BB is a NLP-based branch-and-bound algorithm,
* B-OA is an outer-approximation decomposition algorithm,
* B-QG is an implementation of Quesada and Grossmann's branch-and-cut
algorithm,
* B-Hyb is a hybrid outer-approximation based branch-and-cut algorithm.
The algorithms in Bonmin are exact when the functions f and g are convex;
in the case where f or g or both are non-convex they are heuristics.
%package devel
Summary: Development files for %{name}
Requires: coin-or-CoinUtils-devel
Requires: %{name}%{?_isa} = %{version}-%{release}
%description devel
The %{name}-devel package contains libraries and header files for
developing applications that use %{name}.
%package doc
Summary: Documentation files for %{name}
Requires: %{name} = %{version}-%{release}
BuildArch: noarch
%description doc
This package contains the documentation for %{name}.
%prep
%autosetup -p1 -n %{module}-%{version}
%build
%if %{with_mpi}
%_openmpi_load
%endif
%configure \
%if %{with_asl}
--with-asl-lib="-lasl -lmp -lipoptamplinterface" \
--with-asl-incdir="%{_includedir}/asl"
%endif
# Kill rpaths
sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool
sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool
%make_build
make -C doc all
%install
%make_install
mkdir -p %{buildroot}%{_docdir}/%{name}
cp -pa doc/html %{buildroot}%{_docdir}/%{name}
rm -f %{buildroot}%{_libdir}/*.la
%check
%if %{with_mpi}
%_openmpi_load
%endif
LD_LIBRARY_PATH=%{buildroot}%{_libdir}:$LD_LIBRARY_PATH make test
rm %{buildroot}%{_docdir}/%{name}/LICENSE
%ldconfig_scriptlets
%files
%license LICENSE
%{_docdir}/%{name}/
%exclude %{_docdir}/%{name}/html
%{_bindir}/bonmin
%{_libdir}/*.so.*
%files devel
%{_includedir}/coin/*
%{_libdir}/*.so
%{_libdir}/pkgconfig/*
%files doc
%{_docdir}/%{name}/html/
%changelog
* Thu Nov 01 2018 Antonio Trande <sagitter@fedoraproject.org> - 1.8.6-1
- Release 1.8.6
* Thu Jul 12 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.8.4-16
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
* Sun Jun 03 2018 Antonio Trande <sagitter@fedoraproject.org> - 1.8.4-15
- Rebuild for Ipopt-3.12.10
* Fri Feb 23 2018 Antonio Trande <sagitter@fedoraproject.org> - 1.8.4-14
- Rebuild for Ipopt-3.12.9
- Rebuild against openblas
* Wed Feb 21 2018 Antonio Trande <sagitter@fedoraproject.org> - 1.8.4-13
- Add gcc gcc-c++ BR
* Thu Feb 15 2018 Antonio Trande <sagitter@fedoraproject.org> - 1.8.4-12
- Use %%ldconfig_scriptlets
* Wed Feb 07 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.8.4-11
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
* Sun Oct 29 2017 Antonio Trande <sagitterATfedoraproject.org> - 1.8.4-10
- Rebuild for MUMPS-5.1.2
* Wed Aug 02 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.8.4-9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild
* Wed Jul 26 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.8.4-8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
* Thu Jun 29 2017 Antonio Trande <sagitterATfedoraproject.org> - 1.8.4-7
- Rebuild for MUMPS-5.1.1 (after a bug-fix)
* Mon May 15 2017 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.8.4-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_27_Mass_Rebuild
* Wed Apr 5 2017 pcpa <paulo.cesar.pereira.de.andrade@gmail.com> - 1.8.4-5
- Rebuild for newer mumps
* Fri Feb 10 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.8.4-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
* Sun Nov 13 2016 Peter Robinson <pbrobinson@fedoraproject.org> 1.8.4-3
- rebuild (Power64)
* Tue Aug 02 2016 pcpa <paulo.cesar.pereira.de.andrade@gmail.com> - 1.8.4-2
- Rebuild for newer mumps
* Wed Mar 16 2016 pcpa <paulo.cesar.pereira.de.andrade@gmail.com> - 1.8.4-1
- Update to latest upstream release
* Wed Feb 03 2016 Fedora Release Engineering <releng@fedoraproject.org> - 1.8.1-8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
* Fri Jul 03 2015 pcpa <paulo.cesar.pereira.de.andrade@gmail.com> - 1.8.1-7
- Correct docs listed in main package (#1239155).
* Sat Jun 20 2015 pcpa <paulo.cesar.pereira.de.andrade@gmail.com> - 1.8.1-6
- Full rebuild of coin-or stack.
* Wed Jun 17 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.8.1-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
* Sat May 02 2015 Kalev Lember <kalevlember@gmail.com> - 1.8.1-4
- Rebuilt for GCC 5 C++11 ABI change
* Sun Feb 22 2015 pcpa <paulo.cesar.pereira.de.andrade@gmail.com> - 1.8.1-1
- Update to latest upstream release.
- Add asl solver and openmpi build conditionals.
* Sat Aug 16 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.7.4-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild
* Mon Jul 14 2014 pcpa <paulo.cesar.pereira.de.andrade@gmail.com> - 1.7.4-2
- Add texlive as explicit build requires.
* Sat Apr 19 2014 pcpa <paulo.cesar.pereira.de.andrade@gmail.com> - 1.7.4-1
- Update to latest upstream release.
* Mon Jan 14 2013 pcpa <paulo.cesar.pereira.de.andrade@gmail.com> - 1.6.0-4
- Update to run make check (#894610#c4).
* Sat Jan 12 2013 pcpa <paulo.cesar.pereira.de.andrade@gmail.com> - 1.6.0-3
- Rename repackaged tarball.
* Sun Nov 18 2012 pcpa <paulo.cesar.pereira.de.andrade@gmail.com> - 1.6.0-2
- Rename package to coin-or-Bonmin.
- Do not package Thirdy party data or data without clean license.
* Sat Sep 29 2012 pcpa <paulo.cesar.pereira.de.andrade@gmail.com> - 1.6.0-1
- Initial coinor-Bonmin spec.