Skip to content

Define HWLOC_VERSION* in hwloc/autogen/config.h public header #324

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Aug 15, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# major, minor, and release are generally combined in the form
# <major>.<minor>.<release>. If release is zero, then it is omitted.

# Please update HWLOC_VERSION in contrib/windows/private_config.h too.
# Please update HWLOC_VERSION* in contrib/windows/hwloc_config.h too.

major=2
minor=1
Expand Down
14 changes: 12 additions & 2 deletions config/hwloc.m4
Original file line number Diff line number Diff line change
Expand Up @@ -85,12 +85,22 @@ EOF])
if test "$?" != "0"; then
AC_MSG_ERROR([Cannot continue])
fi
HWLOC_RELEASE_DATE="`$HWLOC_top_srcdir/config/hwloc_get_version.sh $HWLOC_top_srcdir/VERSION --release-date`"
AC_MSG_RESULT([$HWLOC_VERSION])
AC_SUBST(HWLOC_VERSION)
AC_DEFINE_UNQUOTED([HWLOC_VERSION], ["$HWLOC_VERSION"],
[The library version, always available, even in embedded mode, contrary to VERSION])

HWLOC_VERSION_MAJOR="`$HWLOC_top_srcdir/config/hwloc_get_version.sh $HWLOC_top_srcdir/VERSION --major`"
AC_DEFINE_UNQUOTED([HWLOC_VERSION_MAJOR], [$HWLOC_VERSION_MAJOR], [The library version major number])
HWLOC_VERSION_MINOR="`$HWLOC_top_srcdir/config/hwloc_get_version.sh $HWLOC_top_srcdir/VERSION --minor`"
AC_DEFINE_UNQUOTED([HWLOC_VERSION_MINOR], [$HWLOC_VERSION_MINOR], [The library version minor number])
HWLOC_VERSION_RELEASE="`$HWLOC_top_srcdir/config/hwloc_get_version.sh $HWLOC_top_srcdir/VERSION --release`"
AC_DEFINE_UNQUOTED([HWLOC_VERSION_RELEASE], [$HWLOC_VERSION_RELEASE], [The library version release number])
HWLOC_VERSION_GREEK="`$HWLOC_top_srcdir/config/hwloc_get_version.sh $HWLOC_top_srcdir/VERSION --greek`"
AC_DEFINE_UNQUOTED([HWLOC_VERSION_GREEK], ["$HWLOC_VERSION_GREEK"], [The library version optional greek suffix string])

HWLOC_RELEASE_DATE="`$HWLOC_top_srcdir/config/hwloc_get_version.sh $HWLOC_top_srcdir/VERSION --release-date`"
AC_SUBST(HWLOC_RELEASE_DATE)
AC_MSG_RESULT([$HWLOC_VERSION])

# Debug mode?
AC_MSG_CHECKING([if want hwloc maintainer support])
Expand Down
20 changes: 18 additions & 2 deletions config/hwloc_get_version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
# Copyright © 2004-2005 The Regents of the University of California.
# All rights reserved.
# Copyright © 2008-2014 Cisco Systems, Inc. All rights reserved.
# Copyright © 2014 Inria. All rights reserved.
# Copyright © 2014-2018 Inria. All rights reserved.
# $COPYRIGHT$
#
# Additional copyrights may follow
Expand Down Expand Up @@ -70,6 +70,18 @@ case "$option" in
--version)
echo $HWLOC_VERSION
;;
--major)
echo $HWLOC_MAJOR_VERSION
;;
--minor)
echo $HWLOC_MINOR_VERSION
;;
--release)
echo $HWLOC_RELEASE_VERSION
;;
--greek)
echo $HWLOC_GREEK_VERSION
;;
--release-date)
echo $HWLOC_RELEASE_DATE
;;
Expand All @@ -82,7 +94,11 @@ $0 <srcfile> <option>

<srcfile> - Text version file
<option> - One of:
--version - Show version number
--version - Show full version number
--major - Major version number
--minor - Minor version number
--release - Release version number
--greek - Greek (alpha, beta, etc) version suffix
--release-date - Show the release date
--snapshot - Show whether this is a snapshot release or not
--help - This message
Expand Down
8 changes: 7 additions & 1 deletion contrib/windows/hwloc_config.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* Copyright © 2009 CNRS
* Copyright © 2009-2017 Inria. All rights reserved.
* Copyright © 2009-2018 Inria. All rights reserved.
* Copyright © 2009-2012 Université Bordeaux
* Copyright © 2009-2011 Cisco Systems, Inc. All rights reserved.
* See COPYING in top-level directory.
Expand All @@ -11,6 +11,12 @@
#ifndef HWLOC_CONFIG_H
#define HWLOC_CONFIG_H

#define HWLOC_VERSION "2.1.0"
#define HWLOC_VERSION_MAJOR 2
#define HWLOC_VERSION_MINOR 1
#define HWLOC_VERSION_RELEASE 0
#define HWLOC_VERSION_GREEK ""

#define __hwloc_restrict
#define __hwloc_inline __inline

Expand Down
3 changes: 1 addition & 2 deletions contrib/windows/private_config.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* Copyright © 2009, 2011, 2012 CNRS. All rights reserved.
* Copyright © 2009-2016 Inria. All rights reserved.
* Copyright © 2009-2018 Inria. All rights reserved.
* Copyright © 2009, 2011, 2012, 2015 Université Bordeaux. All rights reserved.
* Copyright © 2009 Cisco Systems, Inc. All rights reserved.
* $COPYRIGHT$
Expand Down Expand Up @@ -640,7 +640,6 @@


/* Version number of package */
#define HWLOC_VERSION "2.1.0"
#define VERSION HWLOC_VERSION

/* Define to 1 if the X Window System is missing or not being used. */
Expand Down
5 changes: 5 additions & 0 deletions doc/hwloc.doxy
Original file line number Diff line number Diff line change
Expand Up @@ -3436,6 +3436,11 @@ and <tt>hwloc_get_api_version()</tt> came only in 1.1.1.
Also do not use the old cpuset API since it was deprecated and superseded
by the bitmap API in 1.1, and later removed in 1.5.

If you ever need to look at the library version instead of the API version,
you may want to use HWLOC_VERSION instead.
Two stable releases of the same series usually have the same ::HWLOC_API_VERSION
even if their HWLOC_VERSION are different.



\htmlonly
Expand Down
4 changes: 4 additions & 0 deletions include/hwloc.h
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,10 @@ extern "C" {
*
* Users may check for available features at build time using this number
* (see \ref faq_upgrade).
*
* \note This should not be confused with HWLOC_VERSION, the library version.
* Two stable releases of the same series usually have the same ::HWLOC_API_VERSION
* even if their HWLOC_VERSION are different.
*/
#define HWLOC_API_VERSION 0x00020100

Expand Down
8 changes: 7 additions & 1 deletion include/hwloc/autogen/config.h.in
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* -*- c -*-
* Copyright © 2009 CNRS
* Copyright © 2009-2017 Inria. All rights reserved.
* Copyright © 2009-2018 Inria. All rights reserved.
* Copyright © 2009-2012 Université Bordeaux
* Copyright © 2009-2011 Cisco Systems, Inc. All rights reserved.
* See COPYING in top-level directory.
Expand All @@ -11,6 +11,12 @@
#ifndef HWLOC_CONFIG_H
#define HWLOC_CONFIG_H

#undef HWLOC_VERSION
#undef HWLOC_VERSION_MAJOR
#undef HWLOC_VERSION_MINOR
#undef HWLOC_VERSION_RELEASE
#undef HWLOC_VERSION_GREEK

#if (__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95))
# define __hwloc_restrict __restrict
#else
Expand Down
1 change: 0 additions & 1 deletion tests/hwloc/linux/allowed/test-topology.sh.in
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
# Check the conformance of `lstopo' for all the Linux sysfs
# hierarchies available here. Return true on success.

HWLOC_VERSION="@HWLOC_VERSION@"
HWLOC_top_srcdir="@HWLOC_top_srcdir@"
HWLOC_top_builddir="@HWLOC_top_builddir@"
lstopo="$HWLOC_top_builddir/utils/lstopo/lstopo-no-graphics"
Expand Down
1 change: 0 additions & 1 deletion tests/hwloc/linux/test-topology.sh.in
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
# Check the conformance of `lstopo' for all the Linux sysfs
# hierarchies available here. Return true on success.

HWLOC_VERSION="@HWLOC_VERSION@"
HWLOC_top_srcdir="@HWLOC_top_srcdir@"
HWLOC_top_builddir="@HWLOC_top_builddir@"
lstopo="$HWLOC_top_builddir/utils/lstopo/lstopo-no-graphics"
Expand Down
1 change: 0 additions & 1 deletion tests/hwloc/x86/test-topology.sh.in
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
# See COPYING in top-level directory.
#

HWLOC_VERSION="@HWLOC_VERSION@"
HWLOC_top_srcdir="@HWLOC_top_srcdir@"
HWLOC_top_builddir="@HWLOC_top_builddir@"
lstopo="$HWLOC_top_builddir/utils/lstopo/lstopo-no-graphics"
Expand Down
1 change: 0 additions & 1 deletion utils/hwloc/test-hwloc-info.sh.in
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
# See COPYING in top-level directory.
#

HWLOC_VERSION="@HWLOC_VERSION@"
HWLOC_top_srcdir="@HWLOC_top_srcdir@"
HWLOC_top_builddir="@HWLOC_top_builddir@"
srcdir="$HWLOC_top_srcdir/utils/hwloc"
Expand Down
1 change: 0 additions & 1 deletion utils/lstopo/test-lstopo.sh.in
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
# See COPYING in top-level directory.
#

HWLOC_VERSION="@HWLOC_VERSION@"
HWLOC_top_srcdir="@HWLOC_top_srcdir@"
HWLOC_top_builddir="@HWLOC_top_builddir@"
srcdir="$HWLOC_top_srcdir/utils/lstopo"
Expand Down