Skip to content

Conversation

@wd15
Copy link

@wd15 wd15 commented Nov 21, 2025

Adapts a Nix build for OpenFOAM 12 to OpenFOAM 10 and subsequent build of AdditiveFOAM to work with the existing build of ExaCA.

  • Tested on some of the tutorials.
  • The Nix files could be moved to envs/nix in a similar manner to the ExaCA Nix build. Let me know your preference.
  • For reference the ExaCA PR might be helpful to answer some questions
  • Using the AMB2018-02-B from the tutorials as the check for Nix. Is there a better choice as a quick check?

Edit:

  • To install from the current branch use nix develop github:wd15/AdditiveFOAM/nix. Installation instructions will only work after the merge.

Edit again:

  • Moved to envs/nix so use nix develop github:wd15/AdditiveFOAM/nix?dir=envs/nix to build

Adapts a Nix build for OpenFOAM 12 to OpenFOAM 10 and subsequent build
of AdditiveFOAM to work with the existing build of ExaCA.
@wd15 wd15 mentioned this pull request Nov 21, 2025
@colemanjs colemanjs added the enhancement New feature or request label Nov 24, 2025
Copy link
Collaborator

@gknapp1 gknapp1 left a comment

Choose a reason for hiding this comment

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

  • I think that having the nix-related files in a separate directory, similar to the ExaCA repo, is preferred.
  • The AMB2018-02-B tutorial is good for a quick test

I wasn't able to build this following the build instructions in NIX.md (see error message in review comment). @wd15 can you provide guidance on how to troubleshoot?

@wd15
Copy link
Author

wd15 commented Nov 25, 2025

This only currently works with x86_64-linux. Are there other platforms that AdditiveFOAM is typically build it? Can also enable aarch66, aarch64-darwin and x86-64-darwin if you think ExaCA + dependencies would build on those platforms.

@wd15
Copy link
Author

wd15 commented Nov 25, 2025

Furthermore, I can cache the binaries for x86-64 once we have resolved any issues. It's free for open source projects. That should make the build very fast.

@gknapp1
Copy link
Collaborator

gknapp1 commented Nov 25, 2025

Furthermore, I can cache the binaries for x86-64 once we have resolved any issues. It's free for open source projects. That should make the build very fast.

That's good news, the OpenFOAM nix build is quite slow. I'm building it now, so once that finishes and I can test, I'll re-review.

This only currently works with x86_64-linux. Are there other platforms that AdditiveFOAM is typically build it? Can also enable aarch66, aarch64-darwin and x86-64-darwin if you think ExaCA + dependencies would build on those platforms.

I don't know of any users typically using anything besides x86_64-linux architectures, so that seems fine for now and we can add support if we get user requests.

@gknapp1 gknapp1 self-requested a review November 25, 2025 22:08

See the [installation instructions](https://ornl.github.io/AdditiveFOAM/docs/installation/#installation) in the [documentation](https://ornl.github.io/AdditiveFOAM/) for other options for building `AdditiveFOAM`.

An alternative installation mechanism is using Nix. See
Copy link
Collaborator

Choose a reason for hiding this comment

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

@colemanjs would you prefer this be in the docs instead?

@wd15
Copy link
Author

wd15 commented Dec 3, 2025

@gknapp1: just a note that I added cached the AdditiveFOAM binary dependencies to Cachix so the nix build should go much faster. To test it you would need to remove all the dependencies from your current Nix installation or use a different Nix store. Just using a Nix installation on a different machine is probably easier.

@wd15 wd15 requested review from gknapp1 and streeve December 10, 2025 16:29
@wd15
Copy link
Author

wd15 commented Dec 10, 2025

@gknapp1 @streeve This should be good now. No more changes.

Copy link
Collaborator

@gknapp1 gknapp1 left a comment

Choose a reason for hiding this comment

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

@wd15 thanks for the added documentation and caching implementation. This works for me and the install only took a little over a minute for the cache download (~1.6 GB).

For testing this development:

nix develop github:wd15/AdditiveFOAM/nix?dir=envs/nix --accept-flake-config

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 this pull request may close these issues.

4 participants