libcircle icon indicating copy to clipboard operation
libcircle copied to clipboard

issue with finding MPI when building with spack

Open gonsie opened this issue 5 years ago • 7 comments

I'm getting a very strange issue when building with spack. It appears that configure finds MPI correctly, but then fails.

     77    checking for stdlib.h... (cached) yes
     78    checking for GNU libc compatible malloc... yes
     79    checking for /usr/local/bin/mpicc... /usr/local/bin/mpicc
     80    Checking whether /usr/local/bin/mpicc responds to '-showme:compile'.
           .. no
     81    Checking whether /usr/local/bin/mpicc responds to '-showme'... no
     82    Checking whether /usr/local/bin/mpicc responds to '-compile-info'...
            yes
  >> 83    configure: error: You should check to see if MPI is setup properly.

This does not happen when manually building libcircle. Does the build system properly detect the MPI that spack passes, or does it rely on hard coded paths?

gonsie avatar Oct 30 '19 18:10 gonsie

@gonsie , mind chasing this one down? I wanted to cut a new v0.2.2 release of libcircle within the next few weeks. It'd be nice to have spack working for that release.

adammoody avatar Dec 31 '19 22:12 adammoody

@gonsie , this was the other issue. Does this error message ring any bells?

adammoody avatar Jan 07 '20 04:01 adammoody

This one still happens on the BGQ, but I can build libcircle by hand myself

gonsie avatar Jan 07 '20 04:01 gonsie

Does spack build libcircle for you on TOSS and/or CORAL?

adammoody avatar Jan 07 '20 05:01 adammoody

BGQ uses MPICH, so this may be related to https://github.com/JulianKunkel/libcircle/commit/612ae5537d0c284af7a5d349f3a2428a3f11a99b

adammoody avatar Jan 07 '20 05:01 adammoody

Issue still exists for Spack.

Checking whether /usr/local/bin/mpicc responds to '-showme:compile'... no
Checking whether /usr/local/bin/mpicc responds to '-showme'... no
Checking whether /usr/local/bin/mpicc responds to '-compile-info'... yes
configure: error: You should check to see if MPI is setup properly.

But I can build it by hand.

gonsie avatar Jan 08 '20 00:01 gonsie

Debugging shows the Spack environment is mixing flags for the XL and gcc compilers, which causes the above problem. I also found this page:

https://spack.readthedocs.io/en/latest/packaging_guide.html#mpi-support-in-spack

That actually links to the m4 logic we're using to detect MPI as a recommended method, so I think our autotools code is likely alright. That same page suggests we might be able to improve our Spack package file by setting compiler variables using the spec.

Spack provides an idiomatic way to use MPI compilers
in your package. To use MPI wrappers to compile your
whole build, do this in your install() method:

env['CC'] = spec['mpi'].mpicc
env['CXX'] = spec['mpi'].mpicxx
env['F77'] = spec['mpi'].mpif77
env['FC'] = spec['mpi'].mpifc

So this is probably something to fix on our Spack side of things and not something we need to change in our distribution.

adammoody avatar Jan 22 '20 06:01 adammoody