pnorbert / adiosvm

Packages and howtos for creating a linux system for ADIOS tutorials
17 stars 25 forks source link

Gray-Scott: Spack tips #21

Closed j-woz closed 5 years ago

j-woz commented 5 years ago

I am trying to build the Gray-Scott example using a Spack-based MPI and mpi4py. I was able to build ADIOS2 with these. It does not find the desired MPI, or even the mpicc/mpicxx in PATH. Do you know how to do this? Thanks

$ MPI=$HOME/proj/spack/clean/opt/spack/linux-ubuntu18.04-x86_64/gcc-7.3.0/openmpi-3.1.4-uwu4odepmdk5p7ajh26eti5q6y3iry56

$ MPI_C_LIBRARIES=$MPI/lib/libmpi.so
$ MPI_CXX_INCLUDE=$MPI/include

$ cmake -DADIOS2_DIR=$ADIOS -DMPI_C_LIBRARIES=$MPI_C_LIBRARIES -DMPI_C_INCLUDE=$MPI_C_INCLUDE .. -- The C compiler identification is GNU 7.4.0 ...

-- Found MPI_C: /usb1/wozniak/sfw/mpich-3.2.1/lib/libmpi.so (found version "3.1") -- Could NOT find MPI_CXX (missing: MPI_CXX_WORKS) CMake Error at /usr/share/cmake-3.10/Modules/FindPackageHandleStandardArgs.cmake:137 (message): Could NOT find MPI (missing: MPI_CXX_FOUND) (found version "3.1") Call Stack (most recent call first): /usr/share/cmake-3.10/Modules/FindPackageHandleStandardArgs.cmake:378 (_FPHSA_FAILURE_MESSAGE) /usr/share/cmake-3.10/Modules/FindMPI.cmake:1444 (find_package_handle_standard_args) CMakeLists.txt:7 (find_package)

williamfgc commented 5 years ago

@jmjwozniak a few suggestions:

  1. A recent cmake version is preferred (use the latest 3.14 if possible).
  2. Try settting the cmake flags -DMPI_C_COMPILER=/path/to/mpicc -DMPI_CXX_COMPILER=/path/to/mpicxx only
  3. From your log it seems cmake is finding mpich instead of the desired openmpi. Let's make sure we don't mix them.

Using a recent cmake version and only point at the mpicc and mpicxx locations, cmake FindMPI module should do the rest of the work https://cmake.org/cmake/help/v3.14/module/FindMPI.html Hope this helps.

suchyta1 commented 5 years ago

Are you using CMake to configure the Gray-Scott build? I have a Spack file I use for building Gray-Scott that I attached. I think it should work if you get rid of the lines with kittie. Note: I'm not actually using a Spack mpi4py, but you should be able to add a dependency for that, and it shouldn't even matter at a build level. I don't think anything in the Gray-Scott installation tries to actually make sure mpi4py exists, though if you don't have it, then running the python stuff would fail.

On Thu, May 16, 2019 at 1:19 PM Justin M Wozniak notifications@github.com wrote:

I am trying to build the Gray-Scott example using a Spack-based MPI and mpi4py. I was able to build ADIOS2 with these. It does not find the desired MPI, or even the mpicc/mpicxx in PATH. Do you know how to do this? Thanks

$ MPI=$HOME/proj/spack/clean/opt/spack/linux-ubuntu18.04-x86_64/gcc-7.3.0/openmpi-3.1.4-uwu4odepmdk5p7ajh26eti5q6y3iry56

$ MPI_C_LIBRARIES=$MPI/lib/libmpi.so $ MPI_CXX_INCLUDE=$MPI/include

$ cmake -DADIOS2_DIR=$ADIOS -DMPI_C_LIBRARIES=$MPI_C_LIBRARIES -DMPI_C_INCLUDE=$MPI_C_INCLUDE .. -- The C compiler identification is GNU 7.4.0 ...

-- Found MPI_C: /usb1/wozniak/sfw/mpich-3.2.1/lib/libmpi.so (found version "3.1") -- Could NOT find MPI_CXX (missing: MPI_CXX_WORKS) CMake Error at /usr/share/cmake-3.10/Modules/FindPackageHandleStandardArgs.cmake:137 (message): Could NOT find MPI (missing: MPI_CXX_FOUND) (found version "3.1") Call Stack (most recent call first): /usr/share/cmake-3.10/Modules/FindPackageHandleStandardArgs.cmake:378 (_FPHSA_FAILURE_MESSAGE) /usr/share/cmake-3.10/Modules/FindMPI.cmake:1444 (find_package_handle_standard_args) CMakeLists.txt:7 (find_package)

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/pnorbert/adiosvm/issues/21?email_source=notifications&email_token=AA2C3IFW74BGMJYAVRCDVXDPVWJSVA5CNFSM4HNOTHKKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4GUHH6TA, or mute the thread https://github.com/notifications/unsubscribe-auth/AA2C3IG7LBJJOAFWLFSUONDPVWJSVANCNFSM4HNOTHKA .

-- Eric Suchyta Oak Ridge National Laboratory Scientific Data Group Building 4100, C234 (865) 576-6340 https://suchyta1.github.io/

keichi commented 5 years ago

I recommend using Spack to set up the environment variables and not specifying MPI_C_INCLUDE, MPI_C_LIBRARIES, etc. manually. This works on macOS and Linux (Fedora) for me.

$ spack install environment-modules
$ spack load mpi # assuming you already have openmpi installed
$ cmake -DADIOS2_DIR=/path/to/adios2 .. # don't set MPI_C* manually
j-woz commented 5 years ago

I tried the last one and I think it worked, thanks.