0

I feel so frustrated by the fact that actually none of the answers to 'mpi.h: No such file or directory' actually targets the problem of OpenMPI v2 from APT not providing a proper environment to use its libraries.

I'm not talking about the use of wrappers: one may just want to use a type defined in mpi.h to build a library to use in an actual source code to compile with a wrapper.

A naïve solution would be to build OpenMPI v4 from source code and it works perfectly and flawlessly in the aforementioned case; what about systems where memory is scarce though (e.g. less than 1 GB of RAM and no swap memory) that cannot build v4 for memory saturation? They can only rely on APT-provided implementation.

I wonder why APT package is so outdated and incomplete.

Edit: I'm talking about APT on Ubuntu.

bissim
  • 13
  • 5
  • I also tried the `alien` approach to install the RPM package with no avail in my particular case, so I'm back to square 1. – bissim Apr 03 '20 at 15:19
  • Please provide context. Your question is more of a rant right now. What exactly do you mean that packages from apt are incomplete? Which distribution is that? apt is a package manager used by many Linux distributions, not a package repository. – Hristo Iliev Apr 03 '20 at 16:39
  • I provided a sufficient context: I want to compile a code that uses `mpi.h` but still is not an executable for `mpirun` because it's part of a library. OpenMPI v2 installed from APT doesn't provide a reference to `mpi.h` that compiled and installed OpenMPI v4 does. As stated among question tags, I'm talking about APT on Ubuntu; maybe I should state this clear in my question. – bissim Apr 03 '20 at 16:44
  • MPI development libraries and header files are in the `libopenmpi-dev` package. Debian and Ubuntu split most libraries into run-time and development packages. – Hristo Iliev Apr 03 '20 at 18:37
  • `libopenmpi-dev` doesn't make `mpi.h` available for compilation. – bissim Apr 03 '20 at 18:41
  • It does. The file is located in `/usr/lib/x86_64-linux-gnu/openmpi/include/`, which is not in the usual include path. When compiling with `mpicc`, the wrapper adds the directory to the include path as one can easily see by running `mpicc --show`. – Hristo Iliev Apr 03 '20 at 18:47
  • I already read the topic I linked. I don't need `mpi.h` within a code to directly compile but in a library. As I said, I can do that flawlessly with compiled OpenMPI v4. OpenMPI installed from APT in Ubuntu doesn't let one do that. – bissim Apr 03 '20 at 18:53
  • One doesn't use the MPI wrappers to compile executables only. The MPI wrappers add additional arguments to the compiler invocation to, e.g., make the header files available. Many libraries that use MPI, e.g., ScaLAPACK, mpy4pi, etc., build using the MPI wrappers. You don't have to use the wrappers. Use `mpicc --showme:compile` and `mpicc --showme:link` to get the additional arguments and stick them into your own compiler invocations. – Hristo Iliev Apr 03 '20 at 18:59
  • Can you explain why I don't have to go through all of this with OpenMPI v4? – bissim Apr 03 '20 at 19:01
  • Because when you build it yourself, it installs into different directories. The package is simply configured so that it is possible to install more than one MPI implementation on the same system. That's why the wrappers exist, so that your code builds no matter where the actual files are. – Hristo Iliev Apr 03 '20 at 19:03

0 Answers0