1 Star 0 Fork 4

Venland/coin-or-cbc

forked from src-openEuler/coin-or-cbc 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
coin-or-Cbc.spec 4.25 KB
一键复制 编辑 原始数据 按行查看 历史
Venland 提交于 2022-01-29 16:48 . init package
%global module Cbc
%global blaslib openblas
Name: coin-or-%{module}
Summary: Coin-or branch and cut
Version: 2.10.5
Release: 1
License: EPL-1.0
URL: https://github.com/coin-or/%{module}
Source0: %{url}/archive/releases/%{version}/%{module}-%{version}.tar.gz
BuildRequires: coin-or-Cgl-doc
BuildRequires: coin-or-Clp-doc
BuildRequires: coin-or-DyLP-doc
BuildRequires: coin-or-Vol-doc
BuildRequires: doxygen
BuildRequires: gcc-c++
BuildRequires: make
BuildRequires: mp-devel
BuildRequires: MUMPS-devel
BuildRequires: %{blaslib}-devel
BuildRequires: pkgconfig(cgl)
BuildRequires: pkgconfig(clp)
BuildRequires: pkgconfig(coindatamiplib3)
BuildRequires: pkgconfig(coindatanetlib)
BuildRequires: pkgconfig(dylp)
BuildRequires: pkgconfig(nauty)
BuildRequires: pkgconfig(vol)
# Install documentation in standard rpm directory
Patch0: %{name}-docdir.patch
# Avoid empty #define if svnversion is available at configure time
Patch1: %{name}-svnversion.patch
# Do not catch polymorphic exceptions by value
Patch2: %{name}-exception.patch
# Fix a possible buffer overflow
Patch3: %{name}-overflow.patch
# Fix a mixed signed/unsigned operation
Patch4: %{name}-signed.patch
%description
Cbc (Coin-or branch and cut) is an open-source mixed integer programming
solver written in C++. It can be used as a callable library or using a
stand-alone executable. It can be called through AMPL (natively), GAMS
(using the links provided by the "Optimization Services" and "GAMSlinks"
projects), MPL (through the "CoinMP" project), AIMMS (through the "AIMMSlinks"
project), or "PuLP".
Cbc links to a number of other COIN projects for additional functionality,
including:
* Clp (the default solver for LP relaxations)
* Cgl (for cut generation)
* CoinUtils (for reading input files and various utilities)
%package devel
Summary: Development files for %{name}
Requires: coin-or-Cgl-devel
Requires: coin-or-Clp-devel
Requires: %{name} = %{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: coin-or-Cgl-doc
Requires: coin-or-Clp-doc
Requires: coin-or-DyLP-doc
Requires: coin-or-Vol-doc
Requires: %{name} = %{version}-%{release}
BuildArch: noarch
%description doc
This package contains the documentation for %{name}.
%prep
%autosetup -p1 -n %{module}-releases-%{version}
# The pkgconfig file lists transitive dependencies. Those are necessary when
# using static libraries, but not with shared libraries.
sed -i 's/ @CBCLIB_PCLIBS@/\nLibs.private:&/' Cbc/cbc.pc.in
%build
%configure \
--with-asl-incdir=%{_includedir}/asl \
--with-asl-lib=-lasl \
--with-blas-incdir=%{_includedir}/%{blaslib} \
--with-blas-lib=-l%{blaslib} \
--with-glpk-incdir=%{_includedir} \
--with-glpk-lib=-lglpk \
--with-lapack-incdir=%{_includedir}/%{blaslib} \
--with-lapack-lib=-l%{blaslib} \
--with-mumps-incdir=%{_includedir}/MUMPS \
--with-mumps-lib=-ldmumps \
--with-nauty-incdir=%{_includedir}/nauty \
--with-nauty-lib=-lnauty
# Get rid of undesirable hardcoded rpaths; workaround libtool reordering
# -Wl,--as-needed after all the libraries.
sed -e 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' \
-e 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' \
-e 's|CC="\(g..\)"|CC="\1 -Wl,--as-needed"|' \
-i libtool
%make_build all doxydoc
%install
%make_install
rm -f %{buildroot}%{_libdir}/*.la
rm -f %{buildroot}%{_docdir}/%{name}/{LICENSE,cbc_addlibs.txt}
cp -a doxydoc/{html,*.tag} %{buildroot}%{_docdir}/%{name}
%check
LD_LIBRARY_PATH=%{buildroot}%{_libdir} make test
%ldconfig_scriptlets
%files
%license LICENSE
%dir %{_docdir}/%{name}
%{_docdir}/%{name}/AUTHORS
%{_docdir}/%{name}/README
%{_bindir}/cbc
%{_libdir}/libCbc.so.3
%{_libdir}/libCbc.so.3.*
%{_libdir}/libCbcSolver.so.3
%{_libdir}/libCbcSolver.so.3.*
%{_libdir}/libOsiCbc.so.3
%{_libdir}/libOsiCbc.so.3.*
%files devel
%{_includedir}/coin/*
%{_libdir}/libCbc.so
%{_libdir}/libCbcSolver.so
%{_libdir}/libOsiCbc.so
%{_libdir}/pkgconfig/cbc.pc
%{_libdir}/pkgconfig/osi-cbc.pc
%files doc
%{_docdir}/%{name}/html
%{_docdir}/%{name}/cbc_doxy.tag
%changelog
* Sat Jan 29 2022 liweigang <liweiganga@uniontech.com> - 2.10.5-1
- init package
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/Venland/coin-or-cbc.git
git@gitee.com:Venland/coin-or-cbc.git
Venland
coin-or-cbc
coin-or-cbc
master

搜索帮助