Skip to content

Mfem 3.2#1202

Merged
tgamblin merged 4 commits intospack:developfrom
goxberry:mfem-3.2
Oct 11, 2016
Merged

Mfem 3.2#1202
tgamblin merged 4 commits intospack:developfrom
goxberry:mfem-3.2

Conversation

@goxberry
Copy link
Copy Markdown
Contributor

@goxberry goxberry commented Jul 9, 2016

Adds linkage to KLU & BTF in SuiteSparse variant. Adds SuperLU_Dist variant.

@goxberry
Copy link
Copy Markdown
Contributor Author

goxberry commented Jul 9, 2016

Still a work in progress. I tried testing on my local machine, but building CMake 3.5.2 hangs with gcc 6.1 on OS X 10.10.5. I forget if this issue with CMake is known re: OS X. If it is new for Spack, I will add it to the GitHub issue tracker.

@goxberry
Copy link
Copy Markdown
Contributor Author

goxberry commented Jul 9, 2016

Note to self: supposedly CMake 3.6.0 builds fine with gcc 6.1, so if there's been no progress on that when I pick this thread back up, upgrade the CMake package in spack.

@goxberry
Copy link
Copy Markdown
Contributor Author

goxberry commented Aug 10, 2016

@tgamblin I just rebased this PR on the develop branch last night and still got the same object.h error with CMake when building with gcc 6.1 due to incompatible headers shipped with OS X 10.10. How did you fix that again? Just build with clang for now?

@adamjstewart
Copy link
Copy Markdown
Member

I added CMake 3.6.1 in #1412. You could try that. From reading #1203, it sounds like you'll either have to patch that system header file or upgrade to a newer version of macOS.

@goxberry
Copy link
Copy Markdown
Contributor Author

@adamjstewart I'd be happy to add that patch to Spack, if there's a high likelihood it would be accepted. I think I would modify it according to http://stackoverflow.com/a/28014302/1102947 so the code remains practically unchanged for clang. Upgrading macOS at LLNL would be more difficult, but possible.

@tgamblin
Copy link
Copy Markdown
Member

I would accept that patch to gcc and clang. If you want to add it, that would be great. It wouldn't fix your issue if you used an external compiler, but it would if you used spack-built ones.

@goxberry
Copy link
Copy Markdown
Contributor Author

@tgamblin Having fought through most of the errors due to gcc incompatibility with Apple headers during CMake installation, I think the only hangup in this PR right now (aside from any flake8 noncompliance) is the hack to go through the mfem URL tracker. The strategy that worked for mfem 3.1 does not seem to work for mfem 3.2. Replacing the tracker URL with its redirected URL fixes this issue, and also makes the spack fetch/stage/build process much, much less fragile.

@tzanio, how important is it to have spack fetch mfem tarballs through the Google redirect? I realize the redirect is valuable for user metrics, and Homebrew seems to cope with it just fine, but I'm having trouble making it work for spack, and the redirect issue is the major blocker for this pull request.

@tzanio
Copy link
Copy Markdown
Contributor

tzanio commented Aug 12, 2016

@goxberry, thanks for adding these!

The stats have been really useful for us, including in some pretty major proposals, so if possible we'll prefer to keep them. Is it clear what exactly the problem is? Maybe there is an easy way to fix that in spack?

If the fix is not obvious, we can move on with the direct links. I imagine we are not the only project that is interested in tracking spack installations so maybe @tgamblin and team have a different solution?

@tzanio
Copy link
Copy Markdown
Contributor

tzanio commented Aug 20, 2016

@tgamblin, did you get a chance to look at this?

'METIS_LIB=%s' % metis_lib])

if '+mpi' in spec:
if 'mpi' in spec:
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be +mpi. Otherwise it will always run this block because +mpi and ~mpi both match mpi. Same for +parmetis and +metis above.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This actually does work because it checks the presence of a dependency, not the value of the variant. if 'mpi' in spec will be True if any mpi provider is a dependency of this package. Since mfem``depends_on('mpi', when='+mpi'), it will depend on an MPI implementation when it's+mpi, and it won't when it is~mpi`. Same for the other two, as well.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps an easier way to remember this is that foo in spec is the same as spec.satisifies('foo').

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Huh, never knew that. I wonder if we should do something to reduce the number of ways of specifying the same thing.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@adamjstewart @tgamblin Given the discussion above, should I change this line back to if '+mpi' in spec:? I agree that starting to standardize style in packages would be helpful; frequently, I pattern-match idioms from other Spack packages when I write or modify a Spack package.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@goxberry: I think this one's up to you.

RE: @adamjstewart: I don't really think these are two ways to do exactly the same thing. You could have a package with a variant for some build option that doesn't imply a dependency, and then you would need to test +option. You could have a package with two variants, each of which needed MPI, and then its easier to check for 'mpi' in spec instead of checking both variants, and you don't need to modify that code every time there's a variant that needs MPI. If you remove either of those capabilities from the spec, you're losing functionality, so I don't really see a need to reduce anything -- they're both fundamental parts of specs.

@tgamblin tgamblin added the ready label Oct 4, 2016
@goxberry
Copy link
Copy Markdown
Contributor Author

goxberry commented Oct 6, 2016

@tzanio I think part of the issue is that Spack will download archives and store them in a location that uses the base name of the URL; this base name is Y9T75B for mfem 3.2 and xrScXn for mfem 3.1. The URL lacks both the software package name ("mfem") and an extension for decompressing it (here, it would be ".tar.gz"). I worked around the latter issue by explicitly decompressing the archive in lines 181 to 186 of the pull request version of mfem/package.py, but I think the former is what causes issues with Spack's otherwise extremely helpful autodetection heuristics.

I'm speculating, but I wonder if there were an option to manually specify the download file (so I could call the 3.2 tarball, mfem-3.2.tar.gz, and the 3.1 tarball, mfem-3.1.tar.gz), would that solve some of these issues?

I fixed a gcc bug that was blocking builds of cmake from source, so now I think the main thing blocking updates of the mfem spack package is this PR, and solving the downloading issue.

cc: @tgamblin

@tgamblin
Copy link
Copy Markdown
Member

tgamblin commented Oct 6, 2016

@goxberry: I was about to write an explanation for this the other day, but I got more email. Sorry. 😢

We can actually get the name of the remote tarball when we download from the internet -- newer versions of curl have a -J option that grabs the Location header from the redirect response and saves the file as the basename of the Location URL. RHEL6 (and therefore lots of HPC clusters) have a curl that is too old for that, but would actually be pretty easy to implement manually in Spack -- we already grab MIME headers to try to warn users about things like a web proxy sending HTML instead of a tarball.

However, that won't work because we not only need to be able to fetch from the internet, but also from mirrors, and Spack needs to be able to come up with the mirror name without talking to the redirect server, since it won't be there when we're not connected to the internet. Right now, we change mirror archive names to <package>-<version>.<extension>. The package and version are available statically (we know what we're fetching), but the extension isn't. We preserve the extension and compression method so that the checksums stay the same on the internet and in the mirror. With the google URLs, we don't know the extension, so you end up in this situation where you need to use expand=False because Spack doesn't otherwise know what to do with the file to get it into the mirror.

It turns out @scheibelp already thought of all this in #1758 w.r.t. #1757, and I didn't actually make the connection. I think I'll just merge that, and then we can make MFEM work more naturally.

@goxberry
Copy link
Copy Markdown
Contributor Author

goxberry commented Oct 6, 2016

@tgamblin No worries! With all the activity on the Spack repo, I'm amazed you keep up with everything, and I continue to be impressed by Spack. There's a whole bunch of CMake stuff I need to do on my end to eventually be able to use the MFEM package, but my hope is that it'll go into a couple LLNL projects, and then when that happens, I'll forward you the details via e-mail for any reporting you need to do for Spack funding. I've put a reminder in my calendar for September 6th, 2017 to remind me before end of FY17, because it might take that long to do all the CMake stuff so I can use Spack's CMake interfacing capabilities. (Er, build toolchains can be hard, especially when converting someone else's to CMake...) If you have an earlier deadline after, say January/February 2017, let me know, I'll move the reminder to that date.

@tgamblin
Copy link
Copy Markdown
Member

tgamblin commented Oct 6, 2016

@goxberry: can you see if you can get this working now that #1758 is merged?

@tgamblin
Copy link
Copy Markdown
Member

tgamblin commented Oct 6, 2016

@goxberry: I think @citibeth might be interested in the CMake stuff as well -- she wrote most of it, but it would be awesome to get some MFEM support in. See also #1926 if that is something you're thinking of... would like to replace some of the nextgen guys' env scripts with something like bundler.

@citibeth
Copy link
Copy Markdown
Member

citibeth commented Oct 6, 2016

@goxberry If you're looking to conveniently develop a project with Spack+CMake, see the documentation section:

https://spack.readthedocs.io/en/latest/workflows.html#developing-software-with-spack

Good luck, and don't hesitate to ping me if you run into something.

Add tarball extension as a result of a feature added in PR#1926, which
fixes earlier issues in this PR (PR#1202). Prior to adding this feature,
Spack would not autodetect the extension of the tarball downloaded from
the redirected, shorted Google URL, requiring a messy hack. This hack
worked for mfem version 3.1, but led to errors when adding mfem version
3.2 because the files downloaded from Google did not contain the package
name, version number, or extension. Adding the extension enables Spack
to rename the tarball downloaded from Google to a sensible name that is
compatible with its filename parsing algorithms so that Spack "does the
right thing" (detects that the file is a GZipped tarball, decompresses
it, runs GNU Make) in fetching and staging the package.
Add linkage to the KLU & BTF solvers, which are now enabled in MFEM for
versions 3.2 and later.
Add linkage to SuperLU_DIST, which is a new linear solver interface for
MFEM versions 3.2 and later.
Add NetCDF variant for MFEM versions 3.2 and later; installing the
NetCDF interfaces enables CUBIT mesh support.
@goxberry
Copy link
Copy Markdown
Contributor Author

goxberry commented Oct 8, 2016

@tgamblin Yes, it works. I've done some commit cleanups so that every commit is executable (no syntax errors).

@goxberry
Copy link
Copy Markdown
Contributor Author

goxberry commented Oct 8, 2016

cc: @tzanio I think this PR is close to mergeable, so mfem 3.2 will hopefully be in Spack soon.

@goxberry
Copy link
Copy Markdown
Contributor Author

goxberry commented Oct 8, 2016

@citibeth I saw that, and I'm really impressed by the Spack + CMake support, so I am planning on trying it out on some LLNL projects I work on that have many developers. I'm hoping that a more automated install process will help new developers on these projects get up to speed faster, with less hassle, and also make the build toolchain more portable and maintainable.

@citibeth
Copy link
Copy Markdown
Member

citibeth commented Oct 8, 2016

@goxberry Wow that's nice to hear; definitely shout out if you need help. Just one caveat... it will work best if each developer has their on Spack instance that they own. I'm just beginning to broach the issues of how this stuff works on a shared multi-user environment.

@goxberry
Copy link
Copy Markdown
Contributor Author

goxberry commented Oct 8, 2016

@citibeth Yes, my goal is to make sure that everyone has their own Spack instance, and develops their own copy of the software we're working on. I will keep that advice in mind if someone pushes for multi-user environments.

@goxberry
Copy link
Copy Markdown
Contributor Author

@tgamblin Should I squash these commits?

@tgamblin tgamblin merged commit 9a05ffe into spack:develop Oct 11, 2016
@tgamblin
Copy link
Copy Markdown
Member

@goxberry: no need. GitHub lets you choose to squash, merge, or rebase merge when you click the merge button.

@goxberry goxberry deleted the mfem-3.2 branch July 31, 2018 05:34
olupton pushed a commit to olupton/spack that referenced this pull request Feb 7, 2022
mkandes added a commit to sdsc/spack that referenced this pull request Feb 21, 2025
Note, however, nccl fails to build successfully with intel [1].

[1]

==> Installing nccl-2.23.4-1-tnr7mz4uqdsmnnbx7wwu6ihkghnr4d2e [8/8]
==> No binary for nccl-2.23.4-1-tnr7mz4uqdsmnnbx7wwu6ihkghnr4d2e found: installing from source
==> Fetching https://mirror.spack.io/_source-cache/archive/6b/6b946b70a9d2d01871842cbd15ec56488d358abe9a0f3767e372fddc3e241ba7.tar.gz
==> No patches needed for nccl
==> nccl: Executing phase: 'edit'
==> nccl: Executing phase: 'build'
==> Error: ProcessError: Command exited with status 2:
    'make' '-j10' 'CUDA_HOME=/home/mkandes/software/spack/repos/sdsc/gpu/opt/spack/linux-rocky8-cascadelake/intel-2021.10.0/cuda-12.6.3-frf6lej72dpsgmgxm3nsmuouzepayze2' 'NVCC_GENCODE=--generate-code arch=compute_70,code=sm_70 --generate-code arch=compute_70,code=compute_70 --generate-code arch=compute_80,code=sm_80 --generate-code arch=compute_80,code=compute_80 --generate-code arch=compute_90,code=sm_90 --generate-code arch=compute_90,code=compute_90'

5 errors found in build log:
     189    icpc: command line warning spack#10121: overriding '-march=cascadelake'
            with '-march=native'
     190    Compiling  transport/net_socket.cc             > /scratch/mkandes/j
            ob_37145979/spack-stage/spack-stage/spack-stage-nccl-2.23.4-1-tnr7m
            z4uqdsmnnbx7wwu6ihkghnr4d2e/spack-src/build/obj/transport/net_socke
            t.o
     191    icpc: remark spack#10441: The Intel(R) C++ Compiler Classic (ICC) is dep
            recated and will be removed from product release in the second half
             of 2023. The Intel(R) oneAPI DPC++/C++ Compiler (ICX) is the recom
            mended compiler moving forward. Please transition to use this compi
            ler. Use '-diag-disable=10441' to disable this message.
     192    icpc: command line warning spack#10121: overriding '-march=cascadelake'
            with '-march=native'
     193    transport/coll_net.cc"(926): warning spack#1202: illegal character l in
            asm operand constraint
     194
  >> 195    transport/coll_net.cc(926): catastrophic error: Cannot match asm op
            erand constraint
     196    compilation aborted for transport/coll_net.cc (code 1)
  >> 197    make[1]: *** [Makefile:115: /scratch/mkandes/job_37145979/spack-sta
            ge/spack-stage/spack-stage-nccl-2.23.4-1-tnr7mz4uqdsmnnbx7wwu6ihkgh
            nr4d2e/spack-src/build/obj/transport/coll_net.o] Error 1
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants