Defined OpenMP support

This commit is contained in:
sagitter 2016-01-20 14:46:53 +01:00
parent d4b4d14288
commit f3b22d03f6

View File

@ -8,7 +8,7 @@
Name: metis
Version: 5.1.0
Release: 8%{?dist}
Release: 9%{?dist}
Summary: Serial Graph Partitioning and Fill-reducing Matrix Ordering
License: ASL 2.0 and BSD and LGPLv2+
Group: Development/Libraries
@ -36,9 +36,9 @@ Patch2: %{name}-width-datatype.patch
Patch4: %{name}-GKREGEX-GKRAND-LIBSUFFIX-fix.patch
BuildRequires: cmake
BuildRequires: openmpi-devel
BuildRequires: pcre-devel
BuildRequires: help2man
BuildRequires: chrpath
%description
METIS is a set of serial programs for partitioning graphs,
@ -47,13 +47,14 @@ orderings for sparse matrices.
The algorithms implemented in METIS are based on the multilevel
recursive-bisection, multilevel k-way, and multi-constraint
partitioning schemes developed in our lab.
METIS is distributed with OpenMP support.
%package devel
Summary: The Metis headers and development-related files
Summary: The OpenMP Metis headers and development-related files
Group: Development/Libraries
Requires: %{name}%{?_isa} = %{version}-%{release}
%description devel
Header and library files of Metis.
Header and library files of Metis, OpenMP version.
%prep
%setup -q -n %{name}-%{version}
@ -65,38 +66,33 @@ if [ %{__isa_bits} = "64" ]; then
fi
%patch4 -p0
## Remove default compiler flag
sed -e 's|-O3||g' -i GKlib/GKlibSystem.cmake
%build
# Build metis
cd build
export LDFLAGS="%{__global_ldflags} -Wl,-z,now"
pushd build
%cmake \
-DCMAKE_C_COMPILER=%{_bindir}/gcc \
-DCMAKE_CXX_COMPILER=%{_bindir}/g++ \
-DCMAKE_C_COMPILER:FILEPATH=%{_bindir}/gcc \
-DCMAKE_CXX_COMPILER:FILEPATH=%{_bindir}/g++ \
-DGKLIB_PATH=../GKlib \
-DSHARED=1 \
-DOPENMP=%{_includedir}/openmpi-%{_arch} \
-DPCRE=%{_includedir} \
-DCMAKE_CXX_FLAGS="%{optflags} -Wl,-z,relro -DNDEBUG -Wl,-z,now -fopenmp -pthread" \
-DCMAKE_C_FLAGS="%{optflags} -Wl,-z,relro -DNDEBUG -Wl,-z,now -fopenmp -pthread" \
-DCMAKE_VERBOSE_MAKEFILE=1 \
-DCMAKE_INSTALL_PREFIX=%{_prefix} ..
-DSHARED:BOOL=TRUE \
-DOPENMP:BOOL=ON \
-DPCRE:BOOL=ON \
-DCMAKE_CXX_FLAGS:STRING="%{optflags} -Wl,-z,relro -fPIC -pie -Wl,-z,now -pthread" \
-DCMAKE_C_FLAGS:STRING="%{optflags} -Wl,-z,relro -fPIC -pie -Wl,-z,now -pthread" \
-DCMAKE_SHARED_LINKER_FLAGS_RELEASE:STRING="%{__global_ldflags} -fPIC -pie -Wl,-z,now" \
-DCMAKE_EXE_LINKER_FLAGS_RELEASE:STRING="%{__global_ldflags} -fPIC -pie -Wl,-z,now" \
-DCMAKE_VERBOSE_MAKEFILE:BOOL=TRUE \
-DCMAKE_INSTALL_PREFIX:PATH=%{_prefix} ..
make %{?_smp_mflags}
cd ../
%check
cp -p %{buildroot}%{_bindir}/* graphs
pushd graphs
LD_LIBRARY_PATH=%{buildroot}%{_libdir}:$LD_LIBRARY_PATH ./ndmetis mdual.graph
LD_LIBRARY_PATH=%{buildroot}%{_libdir}:$LD_LIBRARY_PATH ./mpmetis metis.mesh 2
LD_LIBRARY_PATH=%{buildroot}%{_libdir}:$LD_LIBRARY_PATH ./gpmetis test.mgraph 4
LD_LIBRARY_PATH=%{buildroot}%{_libdir}:$LD_LIBRARY_PATH ./gpmetis copter2.graph 4
LD_LIBRARY_PATH=%{buildroot}%{_libdir}:$LD_LIBRARY_PATH ./graphchk 4elt.graph
popd
%install
pushd build
%make_install
%make_install
## Remove rpaths
chrpath -d %{buildroot}%{_bindir}/*
## Generate manpages from binaries
%if 0%{?el6}
@ -136,6 +132,16 @@ mkdir -p %{buildroot}%{_mandir}/man1
mv *.1 %{buildroot}%{_mandir}/man1
popd
%check
cp -p %{buildroot}%{_bindir}/* graphs
pushd graphs
LD_LIBRARY_PATH=%{buildroot}%{_libdir}:$LD_LIBRARY_PATH ./ndmetis mdual.graph
LD_LIBRARY_PATH=%{buildroot}%{_libdir}:$LD_LIBRARY_PATH ./mpmetis metis.mesh 2
LD_LIBRARY_PATH=%{buildroot}%{_libdir}:$LD_LIBRARY_PATH ./gpmetis test.mgraph 4
LD_LIBRARY_PATH=%{buildroot}%{_libdir}:$LD_LIBRARY_PATH ./gpmetis copter2.graph 4
LD_LIBRARY_PATH=%{buildroot}%{_libdir}:$LD_LIBRARY_PATH ./graphchk 4elt.graph
popd
%post -p /sbin/ldconfig
%postun -p /sbin/ldconfig
@ -148,13 +154,16 @@ popd
%{_libdir}/lib%{name}.so.*
%files devel
%doc Changelog
%{_includedir}/%{name}.h
%{_libdir}/lib%{name}.so
%changelog
* Wed Jan 20 2016 Antonio Trande <sagitter@fedoraproject.org> - 5.1.0-9
- Defined OpenMP support
- Some cleanups of the SPEC file
* Wed Dec 23 2015 Antonio Trande <sagitter@fedoraproject.org> - 5.1.0-8
- Used always 'cmake' compiler
- Used always 'cmake' command
* Thu Oct 29 2015 Antonio Trande <sagitter@fedoraproject.org> - 5.1.0-7
- Rebuild for cmake 3.4.0