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

petsc: init at 3.7.6 #28368

Merged
merged 3 commits into from
Sep 3, 2017
Merged

petsc: init at 3.7.6 #28368

merged 3 commits into from
Sep 3, 2017

Conversation

jamtrott
Copy link
Contributor

Motivation for this change

Add the PETSc library, so that it may later be used by, e.g., the FEniCS computing platform (https://fenicsproject.org) for solving partial differential equations.

Things done
  • Tested using sandboxing
    (nix.useSandbox on NixOS,
    or option build-use-sandbox in nix.conf
    on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • Linux
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Fits CONTRIBUTING.md.

@Mic92
Copy link
Member

Mic92 commented Aug 26, 2017

Can you take a look at $out/bin. There are scripts with broken shebangs like ' /bin/csh' and windows binaries inside and unrelated files like ./bin/uncrustify.cfg

@jamtrott
Copy link
Contributor Author

jamtrott commented Sep 3, 2017

@Mic92, thanks for the help and feedback. For now, I opted to just remove the offending files you mentioned. I hope this is a satisfying solution for now. I will probably need to return to this later in order to add support for MPI.

@Mic92 Mic92 merged commit c8c0cd4 into NixOS:master Sep 3, 2017
@knedlsepp
Copy link
Member

For the next iteration on this package it also might be interesting to make use of openblas as a replacement for both blas and lapack, which should probably give a good speedup compared to the reference implementation.

@bzizou
Copy link
Contributor

bzizou commented Sep 7, 2017

@jamtrott : thanks for this package; I'm currently looking at adding MPI support and have a few questions:

  • is it ok for you if we add openmpi support by default or do you want it to be optional?
  • any reason why using configureFlagsArray inside the preconfigure script and not using the configureFlags attribute?
  • I can also try to make use of openblas as suggested by @knedlsepp if you agree

@jamtrott
Copy link
Contributor Author

jamtrott commented Sep 7, 2017

@bzizou, my pleasure.

  • It is probably simpler to enable MPI by default, so I'm fine with that.
  • I don't have a good answer to your second question. I seem to recall having some problems with using the configureFlags attribute, although I can't remember the specifics.
  • If you can switch to openblas, then that's great.

I look forward to seeing your pull request!

@knedlsepp
Copy link
Member

knedlsepp commented Sep 7, 2017

@bzizou: I've learned that the conda-forge is always a good place to look for some ideas on how to best build various stuff: https://github.com/conda-forge/petsc-feedstock/blob/master/recipe/build.sh#L7
It seems they build it with:

  • openblas
  • suitesparse
  • mpi

@knedlsepp
Copy link
Member

knedlsepp commented Sep 7, 2017

Feel free to have a look at: https://github.com/knedlsepp/nixpkgs/tree/extend-petsc
It compiles, but the python stuff installed in bin still needs correct shebangs.

@bzizou
Copy link
Contributor

bzizou commented Sep 8, 2017

My WIP is here: https://github.com/Gricad/nix-ciment-channel/tree/master/ciment/petsc
It compiles but tests are failing... :-(
I fixed the petscmpiexec script (shebang + incorrect sed separator)

Update: now working (with openblasCompat), updated link above

@knedlsepp
Copy link
Member

@bzizou: Got petsc compiling and passing the checkPhase. This was probably due to using openblas instead of openblasCompat.
This now should support openblas, openmpi, suitesparse, hwloc, scotch, fftw, netcdf, hdf5, superlu and metis.
Compared to homebrew, there is still room for improvement:

  • parmetis
  • scalapack
  • hypre
  • sundials
  • homebrew builds both with-scalar-type=real and with-scalar-type=complex
  • It seems most of the programs installed to bin are not really useful. Should they even be installed?

@bzizou
Copy link
Contributor

bzizou commented Sep 11, 2017

Yes, tests are passing with openblasCompat!! Ok, continuing :-)

@bzizou
Copy link
Contributor

bzizou commented Sep 11, 2017

For fftw, I think that we first need to add openmpi support into it...

@knedlsepp
Copy link
Member

@bzizou: I actually already did that: https://github.com/knedlsepp/nixpkgs/commits/extend-petsc

@bzizou
Copy link
Contributor

bzizou commented Sep 11, 2017

@knedlsepp : should'nt you push it upstream by making a PR?

@knedlsepp
Copy link
Member

Definitely! I was thinking we should do that in one chunk with a "petsc: Add missing features"-PR once we are satisfied with it.

@bzizou
Copy link
Contributor

bzizou commented Sep 11, 2017

Well, yes. Do you want to make this PR? My WIP is now very similar to your's and my time is over for this two days on this topic.
Here's what I currently have working: Gricad@ee78e6d

I think that you can simply add the fftw stuff and add my petscmpiexec patch (and no more remove it in postinstall)

This was referenced Sep 13, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants