Skip to content

Install hdf5 as external library with fortran and mpi #8386

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

Open
JohnWGrove opened this issue Jun 5, 2018 · 1 comment
Open

Install hdf5 as external library with fortran and mpi #8386

JohnWGrove opened this issue Jun 5, 2018 · 1 comment
Labels
documentation Improvements or additions to documentation good first issue

Comments

@JohnWGrove
Copy link

Due to build issues on macs, I want to install hdf5 as an external library on my mac. I needed to hack the hdf5 source to get this to build, that went successfully and I was able to build and install the library. However when I try to register this in spack it gets the variants wrong. The entry I am using from packages.yaml is

hdf5:
paths:
hdf5@1.10.1 %gcc@7.3.0 arch=darwin-highsierra-x86_64+fortran+mpi: /usr/local/gnu/hdf5
hdf5@1.10.1 %intel@18.0.3 arch=darwin-highsierra-x86_64+fortran+mpi: /usr/local/intel/hdf5
hdf5@1.10.2 %gcc@7.3.0 arch=darwin-highsierra-x86_64+fortran+mpi: /usr/local/gnu/hdf5
hdf5@1.10.2 %intel@18.0.3 arch=darwin-highsierra-x86_64+fortran+mpi: /usr/local/intel/hdf5
buildable: False

note that hdf5@1.10.1 has a bug that prevents it from building in macs. This bug is fixed in hdf5@1.10.2. The hack I made was needed to produce dynamic libraries using the Intel compiler. Anyway I install the package using

spack install hdf5@1.10.1+fortran+mpi %gcc@7.3.0

(and similarly for the other cases). The install gives normal messages and "spack find hdf5" reports

==> 1 installed packages.
-- darwin-highsierra-x86_64 / gcc@7.3.0 -------------------------
hdf5@1.10.1

as it should. However when I run spack -v hdf5 I get

hdf5@1.10.1cxxdebugfortranhl+mpi+pic+sharedszipthreadsafe

the installation has disabled fortran (DRAT!!). This messes up the build system I am using which wants hdf5 to have fortran (I built hdf5 by hand to have fortran).

Expected Result

spack find -v to report

hdf5@1.10.1cxxdebug+fortranhl+mpi+pic+sharedszip~threadsafe

Actual Result

The external library thinks it doesn't have fortran.

Steps to reproduce the issue

compile hdf5 by hand and install it as an external library.

Information on your system

This includes:

macOS 10.13.4
Mac Pro late 2013


We encourage you to try, as much as possible, to reduce your problem to the minimal example that still reproduces the issue. That would help us a lot in fixing it quickly and effectively!

If you want to ask a question about the tool (how to use it, what it can currently do, etc.), try the #general channel on our Slack first. We have a welcoming community and chances are you'll get your reply faster and without opening an issue.

Other than that, thanks for taking the time to contribute to Spack!

@JohnWGrove
Copy link
Author

Okay, I figured out the issue. The documentation suggest that no space is needed before the +, but this is actually needed. When I edit my packages.yaml to read

hdf5:
paths:
hdf5@1.10.1 %gcc@7.3.0 arch=darwin-highsierra-x86_64 +fortran +mpi: /usr/local/gnu/hdf5
hdf5@1.10.1 %intel@18.0.3 arch=darwin-highsierra-x86_64 +fortran +mpi: /usr/local/intel/hdf5
hdf5@1.10.2 %gcc@7.3.0 arch=darwin-highsierra-x86_64 +fortran +mpi: /usr/local/gnu/hdf5
hdf5@1.10.2 %intel@18.0.3 arch=darwin-highsierra-x86_64 +fortran +mpi: /usr/local/intel/hdf5
buildable: False

The install gets done as I intended after I add the spaces. See your documentation for build customization

packages:
openmpi:
paths:
openmpi@1.4.3%gcc@4.4.7 arch=linux-x86_64-debian7: /opt/openmpi-1.4.3
openmpi@1.4.3%gcc@4.4.7 arch=linux-x86_64-debian7+debug: /opt/openmpi-1.4.3-debug
openmpi@1.6.5%intel@10.1 arch=linux-x86_64-debian7: /opt/openmpi-1.6.5-intel
The middle line really should have a space before the +.

@alalazo alalazo added documentation Improvements or additions to documentation good first issue help wanted labels Dec 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation good first issue
Projects
None yet
Development

No branches or pull requests

3 participants