libcircle
libcircle copied to clipboard
issue with finding MPI when building with spack
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 , 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.
@gonsie , this was the other issue. Does this error message ring any bells?
This one still happens on the BGQ, but I can build libcircle by hand myself
Does spack build libcircle for you on TOSS and/or CORAL?
BGQ uses MPICH, so this may be related to https://github.com/JulianKunkel/libcircle/commit/612ae5537d0c284af7a5d349f3a2428a3f11a99b
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.
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.