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

dealii: init at 9.4.0 #181948

Closed
wants to merge 1 commit into from
Closed

dealii: init at 9.4.0 #181948

wants to merge 1 commit into from

Conversation

yl3dy
Copy link
Contributor

@yl3dy yl3dy commented Jul 18, 2022

Description of changes

deal.II is a comprehensive C++ library for solving partial differential equations focused on finite element methods.

Things done
  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandbox = true set in nix.conf? (See Nix manual)
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 22.11 Release Notes (or backporting 22.05 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
    • (Release notes changes) Ran nixos/doc/manual/md-to-db.sh to update generated release notes
  • Fits CONTRIBUTING.md.

@yl3dy
Copy link
Contributor Author

yl3dy commented Jul 18, 2022

Result of nixpkgs-review pr 181948 run on x86_64-linux 1

1 package built:
  • dealii

@nixos-discourse
Copy link

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/prs-ready-for-review/3032/1045

inherit version;

src = fetchzip {
url = "https://github.com/dealii/dealii/releases/download/v${version}/dealii-${version}.tar.gz";
Copy link
Member

Choose a reason for hiding this comment

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

Why are we not fetching from git?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've read that fetchzip is now recommended instead of fetchFrom* for caching reasons. I'll change it then.

let
version = "9.4.0";

joinPkg = pkg: symlinkJoin {
Copy link
Member

Choose a reason for hiding this comment

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

What is this about? Why are we not using the packages ad normal?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Could you elaborate a bit? My intention was to include both normal and dev outputs of some packages.

Copy link
Member

Choose a reason for hiding this comment

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

Is this required? Normally this is only required in special exceptions. What is the problem you encountered?

Also if this is really required please just add both packages next to each other.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You were correct, I needed to specify dev output only for a single dependency.

];

postPatch = ''
for s in /build/source/doc/doxygen/scripts/*; do
Copy link
Member

Choose a reason for hiding this comment

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

postPatch goes right after src. Also you can point patchshebangs to a directory.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks, will change.

, symlinkJoin
, withDebug ? false
, commonCxxFlags ? ""
, debugCxxFlags ? ""
Copy link
Member

Choose a reason for hiding this comment

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

Why do we need this? This can be easily done with overlays, can't it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This was for convenience. Adding CMake flags with spaces in their values isn't obvious (my question at discourse), so I wanted to add that to the derivation.

Copy link
Member

Choose a reason for hiding this comment

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

but is that something that a regular user needs all the time or something rarely used?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This library usually powers quite CPU-intensive software, so I may reasonably expect users to override flags with something like -march=znver3. A generic build wouldn't e.g. enable AVX, which can be used by the library and gives a noticeable performance boost.

Copy link
Member

Choose a reason for hiding this comment

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

We should turn that on by default if stdenv.hostPlatform.avxSupport is true.

Also I think using overlays would be nicer and make the code less complex. Then we can also save that option entirely.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We should turn that on by default if stdenv.hostPlatform.avxSupport is true.

Isn't this option always false? On all machines I have access to with Nix it evaluates to false (as well as all SSE options), but all of them have sufficiently modern CPU.

Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Contributor Author

@yl3dy yl3dy Aug 2, 2022

Choose a reason for hiding this comment

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

Thanks a lot, I'll look into that. Surprisingly, though, system-features cannot be overriden via --option on a NixOS system, but can be on a non-NixOS one. And do I understand correctly that these flags can only be set to both a package and its dependencies?

EDIT: by dependencies I mean both buildInputs and nativeBuildInputs.

Copy link
Member

Choose a reason for hiding this comment

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

I am not super familiar with that. Best to ask on matrix or discourse.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

After some thinking, it's best to leave all custom build flag stuff out of the derivation and document overriding elsewhere, like on the wiki.

postBuild = ''
make documentation
cp -r ${offlineDocs}/doc/doxygen/deal.II/images /build/source/build/doc/doxygen/deal.II
'';
Copy link
Member

Choose a reason for hiding this comment

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

Using the absolute path in the sandbox is not allowed.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks, will fix.

doCheck = true;
preCheck = ''
export LD_LIBRARY_PATH=$(pwd)/lib:$LD_LIBRARY_PATH
export PATH=${mpi}/bin:$PATH
Copy link
Member

Choose a reason for hiding this comment

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

Usw $PWD

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks, will fix.

'';

passthru = {
mpi = if withMPI then mpi else null;
Copy link
Member

Choose a reason for hiding this comment

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

This shouldn't be used to detect if it is build with MPI. It should never be null. A better way would be to passthru the boolean.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not really sure what do you mean. Is it something like this?

passthru = {
  inherit withMPI mpi;
};

Copy link
Member

Choose a reason for hiding this comment

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

yeah, thats nicer than having packages which are null.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Okay, will change it then!

the complex data structures and algorithms required.
'';
homepage = "https://www.dealii.org/";
downloadPage = "https://dealii.org/download.html";
Copy link
Member

Choose a reason for hiding this comment

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

Please point this to GitHub releases where we do wliaf the files from.

@nixos-discourse
Copy link

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/writing-a-derivation-to-support-optimized-builds/20980/3

@yl3dy yl3dy closed this by deleting the head repository Mar 3, 2023
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.

None yet

3 participants