libmp installed in a private lib directory on epel6
This commit is contained in:
parent
10970618e3
commit
da28855eb8
File diff suppressed because it is too large
Load Diff
115
mp.spec
115
mp.spec
|
@ -1,6 +1,3 @@
|
|||
#%%global commit 9fdb5147068f3b719999210e56b493327f1ca5e7
|
||||
#%%global shortcommit %%(c=%%{commit}; echo ${c:0:7})
|
||||
|
||||
%if 0%{?fedora}
|
||||
%global with_jacop 1
|
||||
%global with_gecode 1
|
||||
|
@ -10,12 +7,16 @@
|
|||
%endif
|
||||
|
||||
%if 0%{?rhel}
|
||||
%global cmake_ver 34
|
||||
%global cmake_ver 3
|
||||
%endif
|
||||
|
||||
%if 0%{?rhel} && 0%{?rhel} < 7
|
||||
%{!?__global_ldflags: %global __global_ldflags -Wl,-z,relro}
|
||||
%endif
|
||||
|
||||
Name: mp
|
||||
Version: 3.1.0
|
||||
Release: 2%{?dist}
|
||||
Release: 3%{?dist}
|
||||
License: MIT and BSD
|
||||
Summary: An open-source library for mathematical programming
|
||||
URL: https://github.com/ampl/mp
|
||||
|
@ -25,6 +26,10 @@ Patch0: mp-strtod.patch
|
|||
# https://bugzilla.redhat.com/show_bug.cgi?id=1333344
|
||||
Patch1: mp-3.1.0-secarch.patch
|
||||
Patch2: mp-3.1.0-jni.patch
|
||||
|
||||
# https://github.com/ampl/mp/issues/100
|
||||
Patch3: mp-no_gtest.patch
|
||||
|
||||
Requires: environment(modules)
|
||||
BuildRequires: atlas-devel
|
||||
%if 0%{?rhel}
|
||||
|
@ -40,7 +45,7 @@ BuildRequires: jacop
|
|||
BuildRequires: java-devel
|
||||
%endif
|
||||
# Need git to satisfy a cmake test if building modules (gsl)
|
||||
BuildRequires: git
|
||||
BuildRequires: git, gdb
|
||||
BuildRequires: chrpath
|
||||
BuildRequires: gsl-devel
|
||||
BuildRequires: doxygen
|
||||
|
@ -91,6 +96,9 @@ for %{name}.
|
|||
%patch0 -p1
|
||||
%patch1 -p1 -b .secarch
|
||||
%patch2 -p1 -b .jni
|
||||
%ifarch ppc64 ppc64le
|
||||
%patch3 -p1 -b .no-gtest
|
||||
%endif
|
||||
%if %{with_jacop}
|
||||
ln -s %{_javadir}/jacop/jacop.jar thirdparty/jacop/jacop-`rpm -q --qf "%%{VERSION}" jacop`.jar
|
||||
%endif
|
||||
|
@ -102,8 +110,7 @@ export LIBS="-lgsl -L%{_libdir}/atlas -lsatlas"
|
|||
export LIBS="-lgsl -L%{_libdir}/atlas -lcblas -latlas"
|
||||
%endif
|
||||
|
||||
mkdir build
|
||||
pushd build
|
||||
mkdir build && pushd build
|
||||
%if %{with_gecode}
|
||||
BUILD="gecode"
|
||||
%endif
|
||||
|
@ -112,15 +119,23 @@ BUILD="$BUILD,jacop"
|
|||
%endif
|
||||
BUILD="$BUILD,gsl,smpswriter"
|
||||
%if 0%{?rhel}
|
||||
export CXXFLAGS="%{optflags} -Wl,-z,relro -fPIC -pie -Wl,-z,now"
|
||||
%ifarch ppc64
|
||||
SETOPT_FLAGS=$(echo "%{optflags}" | sed -e 's/-O2/-O0/g')
|
||||
export CFLAGS="$SETOPT_FLAGS -Wl,-z,relro -fPIC -pie -Wl,-z,now -DNDEBUG"
|
||||
export CXXFLAGS="$SETOPT_FLAGS -Wl,-z,relro -fPIC -pie -Wl,-z,now -DNDEBUG"
|
||||
%else
|
||||
export CFLAGS="%{optflags} -Wl,-z,relro -fPIC -pie -Wl,-z,now -DNDEBUG"
|
||||
export CXXFLAGS="%{optflags} -Wl,-z,relro -fPIC -pie -Wl,-z,now -DNDEBUG"
|
||||
%endif
|
||||
export LDFLAGS="%{__global_ldflags} -fPIC -pie -Wl,-z,now"
|
||||
%cmake34 -DCMAKE_INSTALL_PREFIX:PATH=%{_libdir}/%{name} \
|
||||
cmake%{cmake_ver} -DCMAKE_INSTALL_PREFIX:PATH=%{_libdir}/%{name} \
|
||||
-DCMAKE_SHARED_LINKER_FLAGS="%{__global_ldflags} -Wl,-z,now -fPIC -pie -Wl,--as-needed" \
|
||||
-DCMAKE_SKIP_INSTALL_RPATH:BOOL=YES \
|
||||
-DCMAKE_CXX_FLAGS_RELEASE:STRING="%{optflags} -Wl,-z,relro -fPIC -pie -Wl,-z,now -DNDEBUG" \
|
||||
-DCMAKE_C_FLAGS_RELEASE:STRING="" \
|
||||
-DCMAKE_SKIP_INSTALL_RPATH:BOOL=YES -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON \
|
||||
-DCMAKE_SKIP_RPATH:BOOL=NO \
|
||||
-DBUILD_SHARED_LIBS=ON -DBUILD=$BUILD ..
|
||||
%else
|
||||
#export CXXFLAGS="$(echo "%%{optflags}" | sed -e 's/-O2//')"
|
||||
%cmake -DCMAKE_INSTALL_PREFIX:PATH=%{_libdir}/%{name} \
|
||||
-DCMAKE_SHARED_LINKER_FLAGS="%{__global_ldflags} -Wl,--as-needed" \
|
||||
-DCMAKE_SKIP_INSTALL_RPATH:BOOL=YES \
|
||||
|
@ -150,8 +165,6 @@ install -pm 644 src/asl/solvers/*.h build/src/asl/*.h %{buildroot}%{_includedir}
|
|||
# Required by coin-or-Couenne
|
||||
install -pm 644 src/asl/solvers/{opcode,r_opn}.hd %{buildroot}%{_includedir}/asl
|
||||
|
||||
install -pm 755 build/bin/libasl.so* %{buildroot}%{_libdir}
|
||||
install -pm 755 build/bin/libmp.so* %{buildroot}%{_libdir}
|
||||
install -pm 755 build/bin/amplgsl.dll %{buildroot}%{_libdir}/%{name}/bin
|
||||
install -pm 755 build/bin/ampltabl.dll %{buildroot}%{_libdir}/%{name}/bin
|
||||
install -pm 755 build/bin/arithchk %{buildroot}%{_libdir}/%{name}/bin
|
||||
|
@ -167,10 +180,41 @@ install -pm 755 build/bin/simpbit.dll %{buildroot}%{_libdir}/%{name}/bin
|
|||
install -pm 755 build/bin/tableproxy%{__isa_bits} %{buildroot}%{_libdir}/%{name}/bin
|
||||
|
||||
## Fix symbolic links
|
||||
ln -srf %{_libdir}/libasl.so.%{version} %{buildroot}%{_libdir}/libasl.so.3
|
||||
ln -srf %{_libdir}/libasl.so.3 %{buildroot}%{_libdir}/libasl.so
|
||||
ln -srf %{_libdir}/libmp.so.%{version} %{buildroot}%{_libdir}/libmp.so.3
|
||||
ln -srf %{_libdir}/libmp.so.3 %{buildroot}%{_libdir}/libmp.so
|
||||
## On epel6 'mp' conflicts with 'gmp'
|
||||
## We need to install libraries in a private lib directory
|
||||
|
||||
%if 0%{?rhel} && 0%{?rhel} < 7
|
||||
install -pm 755 build/bin/libasl.so* %{buildroot}%{_libdir}/%{name}
|
||||
ln -sf %{_libdir}/%{name}/libasl.so.%{version} %{buildroot}%{_libdir}/%{name}/libasl.so.3
|
||||
ln -sf %{_libdir}/%{name}/libasl.so.%{version} %{buildroot}%{_libdir}/%{name}/libasl.so
|
||||
|
||||
install -pm 755 build/bin/libmp.so* %{buildroot}%{_libdir}/%{name}
|
||||
ln -sf %{_libdir}/%{name}/libmp.so.%{version} %{buildroot}%{_libdir}/%{name}/libmp.so.3
|
||||
ln -sf %{_libdir}/%{name}/libmp.so.%{version} %{buildroot}%{_libdir}/%{name}/libmp.so
|
||||
|
||||
chrpath --replace %{_libdir}/%{name} %{buildroot}%{_libdir}/%{name}/libasl.so.%{version}
|
||||
chrpath --replace %{_libdir}/%{name} %{buildroot}%{_libdir}/%{name}/bin/amplgsl.dll
|
||||
chrpath --replace %{_libdir}/%{name} %{buildroot}%{_libdir}/%{name}/bin/ampltabl.dll
|
||||
chrpath --replace %{_libdir}/%{name} %{buildroot}%{_libdir}/%{name}/bin/cp.dll
|
||||
chrpath --replace %{_libdir}/%{name} %{buildroot}%{_libdir}/%{name}/bin/fullbit.dll
|
||||
chrpath --replace %{_libdir}/%{name} %{buildroot}%{_libdir}/%{name}/bin/gecode
|
||||
chrpath --replace %{_libdir}/%{name} %{buildroot}%{_libdir}/%{name}/bin/gjh
|
||||
%if %{with_jacop}
|
||||
chrpath --replace %{_libdir}/%{name} %{buildroot}%{_libdir}/%{name}/bin/jacop
|
||||
%endif
|
||||
chrpath --replace %{_libdir}/%{name} %{buildroot}%{_libdir}/%{name}/bin/smpswriter
|
||||
chrpath --replace %{_libdir}/%{name} %{buildroot}%{_libdir}/%{name}/bin/simpbit.dll
|
||||
chrpath --replace %{_libdir}/%{name} %{buildroot}%{_libdir}/%{name}/bin/tableproxy%{__isa_bits}
|
||||
%endif
|
||||
|
||||
%if 0%{?fedora} || 0%{?rhel} >= 7
|
||||
install -pm 755 build/bin/libasl.so* %{buildroot}%{_libdir}
|
||||
ln -sf libasl.so.%{version} %{buildroot}%{_libdir}/libasl.so.3
|
||||
ln -sf libasl.so.%{version} %{buildroot}%{_libdir}/libasl.so
|
||||
|
||||
install -pm 755 build/bin/libmp.so* %{buildroot}%{_libdir}
|
||||
ln -sf libmp.so.%{version} %{buildroot}%{_libdir}/libmp.so.3
|
||||
ln -sf libmp.so.%{version} %{buildroot}%{_libdir}/libmp.so
|
||||
|
||||
chrpath --delete %{buildroot}%{_libdir}/libasl.so.%{version}
|
||||
chrpath --delete %{buildroot}%{_libdir}/%{name}/bin/amplgsl.dll
|
||||
|
@ -186,13 +230,21 @@ chrpath --delete %{buildroot}%{_libdir}/%{name}/bin/jacop
|
|||
chrpath --delete %{buildroot}%{_libdir}/%{name}/bin/smpswriter
|
||||
chrpath --delete %{buildroot}%{_libdir}/%{name}/bin/simpbit.dll
|
||||
chrpath --delete %{buildroot}%{_libdir}/%{name}/bin/tableproxy%{__isa_bits}
|
||||
%endif
|
||||
##
|
||||
|
||||
## Some tests fail on EPEL6 ppc64
|
||||
# https://github.com/ampl/mp/issues/101
|
||||
%check
|
||||
pushd build
|
||||
%if 0%{?rhel}
|
||||
ctest%{cmake_ver} --force-new-ctest-process
|
||||
%else
|
||||
ctest --force-new-ctest-process
|
||||
%if 0%{?rhel} && 0%{?rhel} > 6
|
||||
ctest%{cmake_ver} --force-new-ctest-process --parallel %{?_smp_mflags}
|
||||
%endif
|
||||
%if 0%{?rhel} && 0%{?rhel} < 7
|
||||
ctest%{cmake_ver} --force-new-ctest-process --parallel %{?_smp_mflags} -I 4,15,,1,17,28
|
||||
%endif
|
||||
%if 0%{?fedora}
|
||||
ctest --force-new-ctest-process --parallel %{?_smp_mflags}
|
||||
%endif
|
||||
|
||||
%post -p /sbin/ldconfig
|
||||
|
@ -201,16 +253,33 @@ ctest --force-new-ctest-process
|
|||
%files
|
||||
%doc README.rst
|
||||
%license LICENSE.rst
|
||||
%{_libdir}/%{name}/
|
||||
%dir %{_libdir}/%{name}
|
||||
%{_libdir}/%{name}/bin/
|
||||
%if 0%{?rhel} && 0%{?rhel} < 7
|
||||
%{_libdir}/%{name}/*.so.*
|
||||
%endif
|
||||
%if 0%{?fedora} || 0%{?rhel} >= 7
|
||||
%{_libdir}/*.so.*
|
||||
%endif
|
||||
%{_datadir}/Modules/modulefiles/%{name}-%{_arch}
|
||||
|
||||
%files devel
|
||||
%if 0%{?rhel} && 0%{?rhel} < 7
|
||||
%{_libdir}/%{name}/*.so
|
||||
%endif
|
||||
%if 0%{?fedora} || 0%{?rhel} >= 7
|
||||
%{_libdir}/*.so
|
||||
%endif
|
||||
%{_includedir}/asl
|
||||
%{_includedir}/mp
|
||||
|
||||
%changelog
|
||||
* Thu Jun 30 2016 Antonio Trande <sagitter@fedoraproject.org.com> - 3.1.0-3
|
||||
- Fix cmake version for EPEL
|
||||
- libmp installed in a private lib directory on epel6
|
||||
- Pached to remove gtest
|
||||
- Set to disable tests on EPEL6
|
||||
|
||||
* Thu May 05 2016 Dan Horák <dan[at]danny.cz> - 3.1.0-2
|
||||
- fix build on secondary arches (thirdparty/benchmark) (#1333344)
|
||||
- fix JNI detection (#1333344)
|
||||
|
|
Loading…
Reference in New Issue