Skip to content
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

Allow to substitute p4est library with system-installed library with MPI support #10

Closed
ranocha opened this issue Oct 11, 2020 · 4 comments · Fixed by #11
Closed

Allow to substitute p4est library with system-installed library with MPI support #10

ranocha opened this issue Oct 11, 2020 · 4 comments · Fixed by #11
Labels
enhancement New feature or request

Comments

@ranocha
Copy link
Member

ranocha commented Oct 11, 2020

Once #4 and #5 are resolved, we should also allow build P4est.jl with a custom MPI-build of libp4est.

@ranocha ranocha added the enhancement New feature or request label Oct 11, 2020
@sloede
Copy link
Member

sloede commented Oct 11, 2020

Actually, I am wondering if we should start with this issue before moving on to #4. I did succeed in finding a solution for #4 a few days ago, however, it does not make much sense before it is not possible to substitute the underlying library with a system-installed library first (i.e., the present issue). Otherwise, we effectively prevent anyone using P4est.jl from switching the underlying MPI implementation in MPI.jl from the default MPICH_jll.jl, as P4est_jll.jl links against that library.

However, trying to use JULIA_P4EST_PATH to switch to a library compiled with MPI support causes errors at package build time for P4est.jl, as the C binding generator cannot find mpi.h. Since mpi.h can include implementation-defined values/types, we must use the mpi.h that corresponds to the MPI implementation that is selected by MPI.jl, as the MPI version that p4est was built against must match the one that is used in MPI.jl.

But where do we get this include directory from? It would make most sense to somehow get it from MPI.jl, which seems to be impossible though (no include paths stored). Alternatively, one could just use env vars such as JULIA_P4EST_MPI_INCLUDE, but what to set this value to if the default MPICH_jll.jl is to be used? Or, worse, another BinaryBuilder-provided MPI version such as OpenMPI_jll.jl?

I don't know if my ramblings make much sense to you, but the gist is that I think we need to figure out this issue first before we should think about #4.

@ranocha
Copy link
Member Author

ranocha commented Oct 12, 2020

That sounds like a reasonable suggestion. Can we get the include paths etc. from mpicxx etc. and that one from MPI.jl?

@sloede
Copy link
Member

sloede commented Oct 12, 2020

Unfortunately not. The only portable "export" of the underlying library in MPI.jl so far is the mpiexec path (and if that one's on the PATH, it is not even an absolute path). mpicxx is Linux- and compiler-specific and might not be available for all jll packages, it certainly is not available for MicrosoftMPI_jll.

Right now, I don't really have a solution for this issue, but I created an issue at MPI.jl (JuliaParallel/MPI.jl#425) and I hope that they might have an idea about this...

@ranocha
Copy link
Member Author

ranocha commented Oct 12, 2020

Hmm, you're right (of course!). It would be really great if we could get everything from MPI.jl. I hope they have an idea.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants