Building Likwid RPMs for CentOS

Installing likwid is easy (using ./configure, make, make install) however I wanted to create an RPM package to allow for repeatable builds and installation across a number of nodes/machines. With the ‘Development Tools’ package installed I started with:

mkdir -p /root/rpmbuild/{BUILD,RPMS,SOURCES,SPECS,SRPMS}
cd /root/rpmbuild/SOURCES

I downloaded the latest likwid release (3.1.3) and copied it to

/root/rpmbuild/SOURCES/likwid-3.1.3.tar.gz

Then moved to the SPECS directory:

cd ../SPECS

In the SPECS directory I created the following spec file:

likwid.spec  (download)

# vim: set sw=4 ts=4 et nu:
%define _libdir /usr/lib64
%define _libno64dir /usr/lib
Name:               likwid
Version:            3.1.3
Release:            1
Summary:            High Performance Multi-Threading Support Tools
# http://ftp.fau.de/pub/likwid/likwid-stable.tar.gz
Source:             likwid-%{version}.tar.gz
URL:                http://code.google.com/p/likwid/
Group:              System/Base
License:            GNU General Public License version 2 or later (GPL v2 or later)
BuildRoot:          %{_tmppath}/build-%{name}-%{version}
BuildRequires:      gcc make glibc-devel
Packager:           Jonny McCullagh <jonny.mccullagh@qub.ac.uk>
Vendor:             Queens University Belfast

%description
Likwid is a set of easy to use command line tools for Linux.

It supports programmers in developing high performance multi-threaded programs.
"Likwid" stands for "Like I knew what I am doing". It contains the following
tools: likwid-topology, which shows thread and cache topology; likwid-perfCtr,
which measures hardware performance counters on Intel and AMD processors;
likwid-features, which shows and toggles hardware prefetch control bits on
Intel Core 2 processors; likwid-pin, which pins a threaded application without
touching its code (it supports pthreads, Intel OpenMP, and gcc OpenMP).

It works with any standard Linux kernel.
Likwid is lightweight and adds no overhead during measurements.

%package -n liblikwid-devel
Summary:            High Performance Multi-Threading Support Tools
Group:              Development/Libraries/C and C++

%description -n liblikwid-devel
Likwid is a set of easy to use command line tools for Linux.

It supports programmers in developing high performance multi-threaded programs.
"Likwid" stands for "Like I knew what I am doing". It contains the following
tools: likwid-topology, which shows thread and cache topology; likwid-perfCtr,
which measures hardware performance counters on Intel and AMD processors;
likwid-features, which shows and toggles hardware prefetch control bits on
Intel Core 2 processors; likwid-pin, which pins a threaded application without
touching its code (it supports pthreads, Intel OpenMP, and gcc OpenMP).

It works with any standard Linux kernel.
Likwid is lightweight and adds no overhead during measurements.

%prep
%setup

%build
%__make \
    PREFIX="%{buildroot}%{_prefix}" \
    MANPREFIX="%{buildroot}%{_mandir}" 

%install
%__make %{?jobs:-j%{jobs}} \
    PREFIX="%{buildroot}%{_prefix}" \
    MANPREFIX="%{buildroot}%{_mandir}" \
    LIB="%{_lib}" \
    install

%__install -d "%{buildroot}%{_libdir}/%{name}"
%__mv "%{buildroot}/usr/lib/liblikwidpin.so" \
    "%{buildroot}%{_libdir}/%{name}/"

# for backwards compatibility with < 2.0:
%__ln_s likwid-perfctr "%{buildroot}%{_bindir}/likwid-perfCtr"


%files
%defattr(-,root,root)
%doc COPYING README
%{_bindir}/likwid-features
%{_bindir}/likwid-mpirun
%{_bindir}/likwid-perfctr
%{_bindir}/likwid-perfCtr
%{_bindir}/likwid-pin
%{_bindir}/likwid-topology
%dir %{_libdir}/%{name}
#%{_prefix}/lib/liblikwidpin.so
%{_libdir}/%{name}/liblikwidpin.so
%{_mandir}/man1/likwid-*.1.gz
%{_bindir}/feedGnuplot
%{_bindir}/likwid-bench
%{_bindir}/likwid-genCfg
%{_bindir}/likwid-memsweeper
%{_bindir}/likwid-perfscope
%{_bindir}/likwid-powermeter
%{_bindir}/likwid-setFrequencies
%{_includedir}/likwid.h
%{_includedir}/likwid/accessClient.h
%{_includedir}/likwid/accessClient_types.h
%{_includedir}/likwid/affinity.h
%{_includedir}/likwid/affinity_types.h
%{_includedir}/likwid/allocator.h
%{_includedir}/likwid/asciiBoxes.h
%{_includedir}/likwid/asciiBoxes_types.h
%{_includedir}/likwid/asciiTable.h
%{_includedir}/likwid/asciiTable_types.h
%{_includedir}/likwid/barrier.h
%{_includedir}/likwid/barrier_types.h
%{_includedir}/likwid/bitUtil.h
%{_includedir}/likwid/bstrlib.h
%{_includedir}/likwid/cpuFeatures.h
%{_includedir}/likwid/cpuFeatures_types.h
%{_includedir}/likwid/cpuid.h
%{_includedir}/likwid/cpuid_types.h
%{_includedir}/likwid/daemon.h
%{_includedir}/likwid/error.h
%{_includedir}/likwid/ghash.h
%{_includedir}/likwid/hashTable.h
%{_includedir}/likwid/libperfctr_types.h
%{_includedir}/likwid/likwid.h
%{_includedir}/likwid/lock.h
%{_includedir}/likwid/memsweep.h
%{_includedir}/likwid/msr.h
%{_includedir}/likwid/multiplex.h
%{_includedir}/likwid/multiplex_types.h
%{_includedir}/likwid/numa.h
%{_includedir}/likwid/numa_types.h
%{_includedir}/likwid/pci.h
%{_includedir}/likwid/pci_types.h
%{_includedir}/likwid/perfmon.h
%{_includedir}/likwid/perfmon_atom.h
%{_includedir}/likwid/perfmon_atom_events.txt
%{_includedir}/likwid/perfmon_core2.h
%{_includedir}/likwid/perfmon_core2_counters.h
%{_includedir}/likwid/perfmon_core2_events.txt
%{_includedir}/likwid/perfmon_group_types.h
%{_includedir}/likwid/perfmon_haswell.h
%{_includedir}/likwid/perfmon_haswell_counters.h
%{_includedir}/likwid/perfmon_haswell_events.txt
%{_includedir}/likwid/perfmon_interlagos.h
%{_includedir}/likwid/perfmon_interlagos_counters.h
%{_includedir}/likwid/perfmon_interlagos_events.txt
%{_includedir}/likwid/perfmon_ivybridge.h
%{_includedir}/likwid/perfmon_ivybridge_counters.h
%{_includedir}/likwid/perfmon_ivybridge_events.txt
%{_includedir}/likwid/perfmon_k10.h
%{_includedir}/likwid/perfmon_k10_counters.h
%{_includedir}/likwid/perfmon_k10_events.txt
%{_includedir}/likwid/perfmon_k8.h
%{_includedir}/likwid/perfmon_k8_events.txt
%{_includedir}/likwid/perfmon_kabini.h
%{_includedir}/likwid/perfmon_kabini_counters.h
%{_includedir}/likwid/perfmon_kabini_events.txt
%{_includedir}/likwid/perfmon_nehalem.h
%{_includedir}/likwid/perfmon_nehalemEX.h
%{_includedir}/likwid/perfmon_nehalemEX_events.txt
%{_includedir}/likwid/perfmon_nehalem_counters.h
%{_includedir}/likwid/perfmon_nehalem_events.txt
%{_includedir}/likwid/perfmon_p6_events.txt
%{_includedir}/likwid/perfmon_phi.h
%{_includedir}/likwid/perfmon_phi_counters.h
%{_includedir}/likwid/perfmon_phi_events.txt
%{_includedir}/likwid/perfmon_pm.h
%{_includedir}/likwid/perfmon_pm_counters.h
%{_includedir}/likwid/perfmon_pm_events.txt
%{_includedir}/likwid/perfmon_sandybridge.h
%{_includedir}/likwid/perfmon_sandybridge_counters.h
%{_includedir}/likwid/perfmon_sandybridge_events.txt
%{_includedir}/likwid/perfmon_silvermont.h
%{_includedir}/likwid/perfmon_silvermont_counters.h
%{_includedir}/likwid/perfmon_silvermont_events.txt
%{_includedir}/likwid/perfmon_types.h
%{_includedir}/likwid/perfmon_westmere.h
%{_includedir}/likwid/perfmon_westmereEX.h
%{_includedir}/likwid/perfmon_westmereEX_counters.h
%{_includedir}/likwid/perfmon_westmereEX_events.txt
%{_includedir}/likwid/perfmon_westmere_events.txt
%{_includedir}/likwid/power.h
%{_includedir}/likwid/power_types.h
%{_includedir}/likwid/registers.h
%{_includedir}/likwid/strUtil.h
%{_includedir}/likwid/strUtil_types.h
%{_includedir}/likwid/test_types.h
%{_includedir}/likwid/textcolor.h
%{_includedir}/likwid/thermal.h
%{_includedir}/likwid/thermal_types.h
%{_includedir}/likwid/threads.h
%{_includedir}/likwid/threads_types.h
%{_includedir}/likwid/timer.h
%{_includedir}/likwid/timer_types.h
%{_includedir}/likwid/tree.h
%{_includedir}/likwid/tree_types.h
%{_includedir}/likwid/types.h
%{_libno64dir}/liblikwid.a
%{_sbindir}/likwid-accessD
%{_sbindir}/likwid-setFreq
%{_datadir}/likwid/csv
%{_datadir}/likwid/template
%{_datadir}/likwid/xml
%{_mandir}/man1/feedGnuplot.1.gz
%changelog

I then built the RPM package with:

rpmbuild -ba /root/rpmbuild/SPECS/likwid.spec

The RPM (download) was then built to:

/root/rpmbuild/RPMS/x86_64/likwid-3.1.3-1.x86_64.rpm

And I added the RPM file to my yum repository.

 

 

 

 

 

 

Leave a Reply

  • (will not be published)

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>