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

openems: init at unstable-2020-02-15 #95196

Merged
merged 1 commit into from Sep 27, 2020
Merged

Conversation

matthuszagh
Copy link
Contributor

@matthuszagh matthuszagh commented Aug 11, 2020

Motivation for this change

Next in this pr. @jonringer thanks!

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • 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 nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

@jonringer
Copy link
Contributor

@GrahamcOfBorg eval

@jonringer
Copy link
Contributor

going to make sure arm build doesn't try to build

@lukego
Copy link
Contributor

lukego commented Sep 27, 2020

I'm merging this into my own nixpkgs tree for get openems. Curious how come it didn't land upstream though?

@lukego
Copy link
Contributor

lukego commented Sep 27, 2020

I tried installing openEMS via nixpkgs master and then accessing via Octave. I have errors though.

octave> addpath("/home/luke/.nix-profile/share/openEMS/matlab")
octave> setup
setting up openEMS matlab/octave interface
error: 'isOctave' undefined near line 17 column 4
error: called from
    setup at line 17 column 1

Then working around that with this definition:

function retval = isOctave
  persistent cacheval;  % speeds up repeated calls

  if isempty (cacheval)
    cacheval = (exist ("OCTAVE_VERSION", "builtin") > 0);
  end

  retval = cacheval;
end

I still had this error:

octave> setup
setting up openEMS matlab/octave interface
compiling oct files
find: ‘/nix/store/1ciffw1l2vmaj45p362y5j6gfgzfs7ba-hdf5-1.10.6/include’: No such file or directory
h5readatt_octave.cc:3:10: fatal error: hdf5.h: No such file or directory
    3 | #include "hdf5.h"
      |          ^~~~~~~~
compilation terminated.
warning: mkoctfile: building exited with failure status

and indeed the nixpkgs derivation for hdf5 doesn't seem to install any include files.

Any tips to get up and running with openEMS on NixOS? (I'm a beginner trying OpenEMS and Octave for the first time.)

@jonringer
Copy link
Contributor

and indeed the nixpkgs derivation for hdf5 doesn't seem to install any include files.

the source will probably need to be patched so that it cant find it.

Or the include dir could just be symlinked in postInstall

Copy link
Contributor

@jonringer jonringer left a comment

Choose a reason for hiding this comment

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

since this builds and prints usage, and likely works for some scenarios, I'm going to say it's in a semi-working state. Further development of other use cases can be done in another PR

https://github.com/NixOS/nixpkgs/pull/95196
1 package built:
openems

@jonringer jonringer merged commit 6b94816 into NixOS:master Sep 27, 2020
@matthuszagh
Copy link
Contributor Author

@jonringer thanks!

@lukego thanks for identifying the hdf5 include dir issue. It's been a while since I've used the octave interface so this escaped my notice. As jonringer mentions, the fix should be straightforward. I can take a look at it, but no promises on time as I'm fairly busy at the moment. Feel free to take a look at it too.

@lukego
Copy link
Contributor

lukego commented Sep 27, 2020

Thanks all! I'm currently taking a step back and reading about "what the heck is an FDTD solver anyway?" but assuming that I got forward with openEMS I can make that fix to hdf5.

@matthuszagh
Copy link
Contributor Author

Cool. Yeah there's a bit of a learning curve but it definitely pays off in my opinion. Also worth mentioning that since you're new to octave if you'd prefer to use python I'll have the PRs for the python interface in soon (they're all written and that's what I use, but was just waiting on this PR to submit them).

@matthuszagh matthuszagh deleted the openems_prog branch October 6, 2020 05:31
@lukego
Copy link
Contributor

lukego commented Oct 13, 2020

@matthuszagh Hey I'm interested in those openEMS python bindings for nixpkgs if you happen to have a preview handy!

@matthuszagh
Copy link
Contributor Author

The csxcad part was merged here. I'm still waiting on a merge of the openems part. But that should give you all the code you need.

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