Open MPI logo

Hardware Locality Development Mailing List Archives

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

Subject: Re: [hwloc-devel] embedding next step
From: Brice Goglin (Brice.Goglin_at_[hidden])
Date: 2009-12-15 01:41:42

Jeff Squyres wrote:
> Instead of using PLPA-style macros to rename the symbols throughout the source code, I introduced <hwloc/rename.h> that, if renaming is enabled, will #define hwloc_foo to <NEW_PREFIX>_foo.
> I only did a handful of names so far just to prove that it was working:
> #define hwloc_cpuset_alloc HWLOC_SYM_PREFIX ## cpuset_alloc
> #define hwloc_cpuset_free HWLOC_SYM_PREFIX ## cpuset_free
> #define hwloc_topology_init HWLOC_SYM_PREFIX ## topology_init
> #define hwloc_topology_load HWLOC_SYM_PREFIX ## topology_load
> #define hwloc_topology_get_depth HWLOC_SYM_PREFIX ## topology_get_depth
> #define hwloc_topology_destroy HWLOC_SYM_PREFIX ## topology_destroy
> Other changes I made were generally to cleanse the namespace: ensure that every AC_SUBST, AC_DEFINE, AC_DEFUN, and AM_CONDITIONAL all had "HWLOC_" (or, in a small number of cases, "hwloc_") as a prefix. I also consolidated all of hwloc's m4 into config/hwloc.m4 (no other .m4 files -- so that this *1* file can be acincluded in other packages).
> I made a test in tests/embedded/ that has its own that includes the hwloc.m4, configures it, builds it with a new prefix ("mytest_" instead of "hwloc_") and then links against it in a trivial dummy executable. It all seems to work.

You probably want to use your renaming stuff in tests/embedded/ , right ?

> Before I finish the grunt work of the #define's for all the other symbols and macros, can you guys review it and see if there's anything you hate in there?

I am not fully comfortable with having our own copy of PKG_CHECK_MODULES
or any other standard macro, but I am going to assume they are stable
enough and they won't change a lot anymore in the future.

Apart from that, I am ok.