Open MPI logo

Hardware Locality Development Mailing List Archives

  |   Home   |   Support   |   FAQ   |   all Hardware Locality Development mailing list

Subject: Re: [hwloc-devel] hwloc in Debian, anybody working on RPMs?
From: Jeff Squyres (jsquyres_at_[hidden])
Date: 2009-11-30 19:32:44


Looks great to me -- you appear to be a specfile wizard. :-)

Minor comments:

- Do you want to use a wildcard here instead of the specific .so
version number? That .so version number may change over time:

%{_libdir}/libhwloc.so.0
%{_libdir}/libhwloc.so.0.0.0

- In OMPI, I have a "buildrpm.sh" script that substitutes in the
version number and then builds the RPM/SRPM. I personally found that
slightly easier than getting the .bz2, expanding it, configuring it,
and then using the generated specfile to make the RPM/SRPM. FWIW, if
you care:

https://svn.open-mpi.org/trac/ompi/browser/trunk/contrib/dist/linux/buildrpm.sh

That script is a little more complicated than it needs to be these
days -- it originally had to deal with multiple different versions of
the "rpmbuild" command, etc. But you get the idea.

Is that approach appealing at all?

On Nov 26, 2009, at 12:14 AM, Tony Breeds wrote:

> On Tue, Nov 24, 2009 at 07:01:30AM -0500, Jeff Squyres wrote:
>
> > True. We googled around to try to find a fairly unique name before
> > we re-branded from libtopology (because there *was* a name collision
> > with that project). Hopefully it'll stay unique and/or we'll gain
> > enough of a following that it'll be unambiguously "claimed" for this
> > project. :-)
>
> Sorry I was thinking more in tersm of package dependacies that the
> name of
> hwloc itself. It's easy enough to work around if we hit it.
>
> > Awesome -- thanks!
> >
> > Do you want to commit that? If we keep the analog to the OMPI
> > project, we'd put it under contrib/dist/linux/hwloc.spec.
>
> Sure. I was thinking of the following patch:
>
> Essentailly rather than hardcoding the hwloc version track it from
> the VERSION
> file and generate the .spec file at ./configure time.
>
> Does that look okay?
>
> Index: contrib/dist/linux/hwloc.spec.in
> ===================================================================
> --- contrib/dist/linux/hwloc.spec.in (revision 0)
> +++ contrib/dist/linux/hwloc.spec.in (revision 0)
> @@ -0,0 +1,93 @@
> +%define ver_major @HWLOC_MAJOR_VERSION@
> +%define ver_minor @HWLOC_MINOR_VERSION@
> +%define ver_release @HWLOC_RELEASE_VERSION@
> +%define ver_majmin %{ver_major}.%{ver_minor}
> +
> +Name: hwloc
> +Version: %{ver_majmin}.%{ver_release}
> +Release: 1%{?dist}
> +Summary: Hardware Locality Library
> +
> +Group: System Environment/Libraries
> +License: BSD
> +URL: http://www.open-mpi.org/projects/hwloc/
> +Source0: %{url}/software/%{name}/v%{ver_majmin}/downloads/%
> {name}-%{version}.tar.bz2
> +BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%
> {release}-XXXXXX)
> +
> +BuildRequires: libxml2-devel, ncurses-devel
> +
> +%description
> +The Portable Hardware Locality (hwloc) software package provides a
> portable
> +abstraction (across OS, versions, architectures, ...) of the
> hierarchical
> +topology of modern architectures, including NUMA memory nodes,
> sockets, shared
> +caches, cores and simultaneous multithreading. It also gathers
> various system
> +attributes such as cache and memory information. It primarily aims
> at helping
> +applications with gathering information about modern computing
> hardware so as
> +to exploit it accordingly and efficiently.
> +
> +%package devel
> +Summary: Hardware Locality development package
> +Group: Development/Libraries
> +Requires: %{name} = %{version}-%{release}
> +
> +%description devel
> +Development package for hwloc.
> +
> +%prep
> +%setup -q
> +
> +%build
> +%configure --disable-static
> +make %{?_smp_mflags}
> +
> +%install
> +rm -rf %{buildroot}
> +make install DESTDIR=%{buildroot}
> +rm %{buildroot}/%{_libdir}/libhwloc.la
> +
> +
> +%clean
> +rm -rf %{buildroot}
> +
> +%post -p /sbin/ldconfig
> +
> +%postun -p /sbin/ldconfig
> +
> +%files
> +%defattr(-,root,root,-)
> +%doc README AUTHORS COPYING NEWS
> +%{_bindir}/hwloc-bind
> +%{_bindir}/hwloc-distrib
> +%{_bindir}/hwloc-info
> +%{_bindir}/hwloc-ls
> +%{_bindir}/hwloc-mask
> +%{_bindir}/lstopo
> +%{_libdir}/libhwloc.so.0
> +%{_libdir}/libhwloc.so.0.0.0
> +%dir %{_datarootdir}/%{name}
> +%{_datarootdir}/%{name}/hwloc.dtd
> +%{_mandir}/man1/hwloc-bind.1.gz
> +%{_mandir}/man1/hwloc-distrib.1.gz
> +%{_mandir}/man1/hwloc-info.1.gz
> +%{_mandir}/man1/hwloc-ls.1.gz
> +%{_mandir}/man1/hwloc-mask.1.gz
> +%{_mandir}/man1/lstopo.1.gz
> +
> +%files devel
> +%defattr(-,root,root,-)
> +%doc VERSION
> +%{_includedir}/hwloc.h
> +%dir %{_includedir}/hwloc
> +%{_includedir}/hwloc/config.h
> +%{_includedir}/hwloc/cpuset.h
> +%{_includedir}/hwloc/glibc-sched.h
> +%{_includedir}/hwloc/helper.h
> +%{_includedir}/hwloc/linux-libnuma.h
> +%{_includedir}/hwloc/linux.h
> +%{_includedir}/hwloc/openfabrics-verbs.h
> +%{_libdir}/pkgconfig/hwloc.pc
> +%{_libdir}/libhwloc.so
> +
> +%changelog
> +* Thu Nov 19 2009 tony_at_[hidden] - 0.9.2-1
> + - Initial packaging
> Index: configure.ac
> ===================================================================
> --- configure.ac (revision 1405)
> +++ configure.ac (working copy)
> @@ -35,6 +35,9 @@
> HWLOC_RELEASE_VERSION="`$srcdir/config/hwloc_get_version.sh $srcdir/
> VERSION --release`"
> HWLOC_SVN_R="`$srcdir/config/hwloc_get_version.sh $srcdir/VERSION --
> svn`"
> HWLOC_RELEASE_DATE="`$srcdir/config/hwloc_get_version.sh $srcdir/
> VERSION --release-date`"
> +AC_SUBST(HWLOC_MAJOR_VERSION)
> +AC_SUBST(HWLOC_MINOR_VERSION)
> +AC_SUBST(HWLOC_RELEASE_VERSION)
> AC_SUBST(HWLOC_VERSION)
> AC_SUBST(HWLOC_SVN_R)
> AC_SUBST(HWLOC_RELEASE_DATE)
> @@ -524,6 +527,7 @@
>
> AC_CONFIG_FILES([hwloc.pc
> doc/doxygen-config.cfg
> + contrib/dist/linux/hwloc.spec
>
> Makefile
> doc/Makefile
>
> Yours Tony
> _______________________________________________
> hwloc-devel mailing list
> hwloc-devel_at_[hidden]
> http://www.open-mpi.org/mailman/listinfo.cgi/hwloc-devel
>

-- 
Jeff Squyres
jsquyres_at_[hidden]