Skip to content

Compiling with external hwloc results in many warnings #5524

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

Closed
jsquyres opened this issue Aug 7, 2018 · 4 comments
Closed

Compiling with external hwloc results in many warnings #5524

jsquyres opened this issue Aug 7, 2018 · 4 comments

Comments

@jsquyres
Copy link
Member

jsquyres commented Aug 7, 2018

After #5395 and #5466, if you compile with an external hwloc, there are many warnings:

/home/jsquyres/bogus/include/hwloc/autogen/config.h:214:1: warning: "HWLOC_SYM_TRANSFORM" redefined
In file included from error.c:26:
../../opal/include/opal_config.h:1394:1: warning: this is the location of the previous definition
In file included from /home/jsquyres/bogus/include/hwloc.h:56,
                 from ../../opal/mca/hwloc/external/external.h:24,
                 from ../../opal/mca/hwloc/hwloc-internal.h:131,
                 from ../../opal/util/proc.h:22,
                 from error.c:36:
/home/jsquyres/bogus/include/hwloc/autogen/config.h:217:1: warning: "HWLOC_SYM_PREFIX" redefined
In file included from error.c:26:
../../opal/include/opal_config.h:1388:1: warning: this is the location of the previous definition
In file included from /home/jsquyres/bogus/include/hwloc.h:56,
                 from ../../opal/mca/hwloc/external/external.h:24,
                 from ../../opal/mca/hwloc/hwloc-internal.h:131,
                 from ../../opal/util/proc.h:22,
                 from error.c:36:
/home/jsquyres/bogus/include/hwloc/autogen/config.h:220:1: warning: "HWLOC_SYM_PREFIX_CAPS" redefined
In file included from error.c:26:
../../opal/include/opal_config.h:1391:1: warning: this is the location of the previous definition
  CC       info.lo
In file included from /home/jsquyres/bogus/include/hwloc.h:56,
                 from ../../opal/mca/hwloc/external/external.h:24,
                 from ../../opal/mca/hwloc/hwloc-internal.h:131,
                 from proc.h:22,
                 from proc.c:19:
@rhc54
Copy link
Contributor

rhc54 commented Aug 7, 2018

Hmmm...I'm not seeing these warnings and I always build with external HWLOC. What version of hwloc are you using? I'm using 2.0 here.

@jsquyres
Copy link
Member Author

jsquyres commented Aug 7, 2018

I just build from the hwloc master head:

$ cd path/to/hwloc/repo
$ git show | head -n 5
commit 34f67eac480d9ae13a98b45da6a116f17f7c59ce
Author: Brice Goglin <[email protected]>
Date:   Mon Aug 6 21:43:16 2018 +0200

    doxy: cleanup/fix the object that may contain some hwloc-provided info attributes
$ ./autogen.sh |& tee auto.out && ./configure --prefix=$bogus|& tee config.out && make clean > /dev/null && rm -rf $bogus && j32 |& tee make.out && make install > /dev/null
...

$ cd path/to/ompi/repo
$ git show | head -n 6
commit e9f378e8518fa7a0a17586f93ae616b50f2d3713
Merge: c294bbc352 f3f2a826b4
Author: Todd Kordenbrock <[email protected]>
Date:   Tue Aug 7 11:21:00 2018 -0500

    Merge pull request #5500 from tkordenbrock/topic/master/fix.PtlMEUnlink.in.use
$ ./autogen.pl|& tee auto.out && ./configure --prefix=$bogus CPPFLAGS=-I$bogus/include LDFLAGS=-L$bogus/lib |& tee config.out && make clean > /dev/null && j32 |& tee make.out
...
/home/jsquyres/bogus/include/hwloc/autogen/config.h:214:1: warning: "HWLOC_SYM_TRANSFORM" redefined
In file included from error.c:26:
../../opal/include/opal_config.h:1394:1: warning: this is the location of the previous definition
In file included from /home/jsquyres/bogus/include/hwloc.h:56,
                 from ../../opal/mca/hwloc/external/external.h:24,
                 from ../../opal/mca/hwloc/hwloc-internal.h:131,
                 from ../../opal/util/proc.h:22,
                 from error.c:36:
...etc.

Perhaps it's because I'm using an old compiler -- gcc 4.4.7...?

...time passes...

Nope -- same thing happens if I test with gcc 7.3.0, too.

@jsquyres
Copy link
Member Author

jsquyres commented Aug 7, 2018

@rhc54 and I talked about this on the phone and figured it out.

Ralph is configuring with --with-hwloc=/path/to/hwloc/install -- I'm not.

The problem is here:

AS_IF([test "$with_hwloc" = "internal" || test -z "$with_hwloc" || test "$with_hwloc" = "yes"],
[opal_hwloc_external="no"],
[opal_hwloc_external="yes"])

The hwloc201 (internal) component is checking to see if external was selected by checking $with_hwloc -- which, now that we are biased towards external components, is no longer sufficient.

However, we know that the external component will always be configured first. So it's possible -- nay, desirable -- for the internal component to check some global variable to know if the external component will be used and if so, politely refuse to configure itself (i.e., leaving only the external component as selectable). Something like this (in hwloc201/configure.m4):

AC_DEFUN([MCA_opal_hwloc_hwloc201_CONFIG],[
    AS_IF([test $external_hwloc_was_not selected],
        [OPAL_HWLOC201_DO_REAL_CONFIG],
        [$2])
])

That's a bare-bones example -- need to make it a bit more verbose to explain why it's doing what it's doing, yadda yadda yadda.

@jsquyres
Copy link
Member Author

jsquyres commented Aug 7, 2018

BTW, we'll likely need to do something similar with libevent.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants