-
Notifications
You must be signed in to change notification settings - Fork 28
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
static build of netcdf #56
Conversation
Codecov Report
@@ Coverage Diff @@
## master #56 +/- ##
==========================================
+ Coverage 85.64% 86.78% +1.14%
==========================================
Files 8 8
Lines 1804 1847 +43
==========================================
+ Hits 1545 1603 +58
+ Misses 259 244 -15
Continue to review full report at Codecov.
|
Hi, I tried building this branch on Windows with rust nightly 1.42 and MSVC by checking out the vendor branch on your fork and running
and it complained about a missing file "putget.c" when compiling netcdf-src: Compiler output
Is it maybe an outdated version of the source netcdf-src? Thanks for your work! |
That file should be generated by |
I installed m4 from MinGW and the build now works! Thank you! |
Okay, now if I want to use the static build experimentally in a cargo project, I include it by adding
to my Cargo.toml, right? The version I cloned from your fork on github builds no problem with
Do I need to add a [patch]-section? I remember this problem being there before on this fork, but it seemed to have resolved with the git clone version building correctly now. |
Yes, the upstream pull request has not been merged yet, so you will require the [patch.crates-io]
hdf5 = { git = "https://github.com/magnusuMET/hdf5-rust.git", branch = "feature/static_build" } Do note that the initial git clone is dead slow. This should not be a problem when |
Do I somehow need to invoke this patch? I added the snippet from above to the bottom of the Cargo.toml and it gave me a similar result:
|
My bad, the patch section should be overriding hdf5-src = { git = "https://github.com/magnusuMET/hdf5-rust.git", branch = "feature/static_build" } |
If I do
it builds! Thank you so much! |
New day, new problem!
For reference, this is my Cargo.toml: Cargo.toml
Do you know what could cause this? Edit: This error occurs independently of whether I've installed libnetcdf via rpm or not. |
If I must believe the error message, you need to yum install netcdf-static which provides /usr/lib64/libnetcdf.a |
That is a bit of a mysterious issue! It could either be due to [patch] not being present, or the build not being built correctly. I haven't really tried building outside of the examples in this crate, as I have been waiting on an upstream merge. Could you provide a full build log from EDIT: I suspect there is some problem with |
Thank you both for your answers! I have run the command and attached the log |
It seems cmake installs to |
@apexys Is this fix working for you? You might have to do a |
Yes, that works now! Thank you again for your great support! |
@apexys No problem. Please let me know if you experience more problems, or if you have some ideas for how to make this crate more ergonomic. |
Codecov Report
@@ Coverage Diff @@
## master #56 +/- ##
==========================================
+ Coverage 85.64% 86.21% +0.57%
==========================================
Files 8 8
Lines 1804 1850 +46
==========================================
+ Hits 1545 1595 +50
+ Misses 259 255 -4
Continue to review full report at Codecov.
|
Hey, since the hdf-5 feature finally got merged and published to crates.io as version 0.7.0, could we merge this branch into the repo? |
@apexys I'll have a look this afternoon! TODO:
|
7d4bb96
to
ea9fb63
Compare
8e84acc
to
4f37384
Compare
561717d
to
dd8b6ed
Compare
@apexys This is now merged, and a new version is released (v0.5.0). Please open an issue if there are problems with this release! |
- name: Clippy | ||
run: cargo clippy --workspace -- -D warnings | ||
run: cargo clippy --workspace --exclude netcdf-src -- -D warnings |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@magnusuMET You can exclude netcdf-src
from default-members
in Cargo.toml and then all cargo commands will ignore it without you having to type --exclude
everywhere :)
Not sure if this is directly related: Build with if i manually download the netcdf-c repository, and use it to replace the automatically downloaded version (the entire folder netcdf-src-0.1.0/source), the build works fine. Any clue if that's related to the recent changes or if it's just misconfiguration on my end? |
@fstaebler That is a misconfiguration on my part, it seems |
Introduces feature
static
which builds bothhdf5
andnetcdf
from source. Adds CI for conda and static builds on the three major platforms.Closes #29
Closes #46