-
Notifications
You must be signed in to change notification settings - Fork 29
static build of netcdf #56
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
Merged
Merged
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
3dde97c
static build of netcdf
magnusuMET 123433a
add DAP support, and use patch section in toml
magnusuMET fba9151
patch section in toplevel
magnusuMET c92fb7c
update hdf5-sys version
magnusuMET 384ca01
update netcdf-c
magnusuMET 9578956
require libz
magnusuMET deb7e85
limit the files included in archive
magnusuMET ada7a57
temporary downgrade of hdf5 version
magnusuMET 0326385
move netcdf-c to netcdf-src
magnusuMET 2735a60
update src + can't compress no-dim vars
magnusuMET e96cad5
ignore souce files
magnusuMET e2a332e
add fallback to lib64
magnusuMET 68cf93a
Use upstream hdf5-sys
magnusuMET 6e0ffc9
Clippy lint
magnusuMET 0c10ba6
add conda and static to CI
magnusuMET File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| name: codecov | ||
| on: [push] | ||
| env: | ||
| CARGO_TERM_COLOR: always | ||
|
|
||
| jobs: | ||
| tarpaulin: | ||
| name: tarpaulin | ||
| runs-on: ubuntu-18.04 | ||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v2 | ||
| - name: Install netcdf | ||
| run: sudo apt-get install libnetcdf-dev | ||
| - name: Install rust | ||
| uses: actions-rs/toolchain@v1 | ||
| with: | ||
| toolchain: stable | ||
| profile: minimal | ||
| override: true | ||
| - name: Install tarpaulin | ||
| uses: actions-rs/install@v0.1 | ||
| with: | ||
| crate: cargo-tarpaulin | ||
| version: latest | ||
| use-tool-cache: true | ||
|
|
||
| - name: Tarpaulin | ||
| run: cargo tarpaulin --verbose --out Xml --ignore-tests | ||
|
|
||
| - name: Upload to codecov | ||
| uses: codecov/codecov-action@v1.0.2 | ||
| with: | ||
| token: ${{ secrets.CODECOV_TOKEN }} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| [submodule "netcdf-sys/source"] | ||
| path = netcdf-src/source | ||
| url = https://github.com/Unidata/netcdf-c.git |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| [package] | ||
| name = "netcdf-src" | ||
| version = "0.1.0" | ||
| authors = ["Magnus Ulimoen <magnusu@met.no>"] | ||
| edition = "2018" | ||
| description = "Build scripts for building `netCDF` from source" | ||
| build = "build.rs" | ||
| repository = "https://github.com/georust/netcdf" | ||
| license-file = "source/COPYRIGHT" | ||
| links = "netcdfsrc" | ||
| exclude = [ | ||
| "source/unit_test/**", | ||
| "source/NUG/**", | ||
| "source/dap4_test/**", | ||
| "source/examples/**", | ||
| "source/nc_test/**", | ||
| "source/h5_test/**", | ||
| "source/nc_perf/**", | ||
| "source/ncdump/**", | ||
| "source/hdf4_test/**", | ||
| "source/ncgen/**", | ||
| "source/ncgen3/**", | ||
| "source/nctest/**", | ||
| ] | ||
|
|
||
| [features] | ||
| dap = [] | ||
|
|
||
| [dependencies] | ||
| hdf5-sys = { version = "0.7.0", features = ["hl", "deprecated", "zlib"] } | ||
|
|
||
| [build-dependencies] | ||
| cmake = "0.1.44" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,49 @@ | ||
| macro_rules! feature { | ||
| ($feature:expr) => { | ||
| std::env::var(concat!("CARGO_FEATURE_", $feature)) | ||
| }; | ||
| } | ||
|
|
||
| fn main() { | ||
| println!("cargo:rerun-if-changed=build.rs"); | ||
|
|
||
| let hdf5_incdir = std::env::var("DEP_HDF5_INCLUDE").unwrap(); | ||
| let hdf5_lib = std::env::var("DEP_HDF5_LIBRARY").unwrap(); | ||
| let hdf5_hl_lib = std::env::var("DEP_HDF5_HL_LIBRARY").unwrap(); | ||
|
|
||
| let mut netcdf_config = cmake::Config::new("source"); | ||
| netcdf_config | ||
| .define("BUILD_SHARED_LIBS", "OFF") | ||
| .define("NC_FIND_SHARED_LIBS", "OFF") | ||
| .define("BUILD_UTILITIES", "OFF") | ||
| .define("ENABLE_EXAMPLES", "OFF") | ||
| .define("ENABLE_DAP_REMOTE_TESTS", "OFF") | ||
| .define("ENABLE_TESTS", "OFF") | ||
| .define("ENABLE_EXTREME_NUMBERS", "OFF") | ||
| .define("ENABLE_PARALLEL_TESTS", "OFF") | ||
| .define("ENABLE_FILTER_TESTING", "OFF") | ||
| .define("ENABLE_BASH_SCRIPT_TESTING", "OFF") | ||
| // | ||
| .define("HDF5_C_LIBRARY", &hdf5_lib) | ||
| .define("HDF5_HL_LIBRARY", &hdf5_hl_lib) | ||
| .define("HDF5_INCLUDE_DIR", hdf5_incdir) | ||
| // | ||
| .define("ENABLE_DAP", "OFF") // TODO: feature flag, requires curl | ||
| // | ||
| .profile("RelWithDebInfo"); // TODO: detect opt-level | ||
|
|
||
| if feature!("DAP").is_ok() { | ||
| netcdf_config.define("ENABLE_DAP", "ON"); | ||
| } | ||
|
|
||
| let netcdf = netcdf_config.build(); | ||
|
|
||
| println!("cargo:lib={}", "netcdf"); | ||
| let search_path = format!("{}/lib", netcdf.display()); | ||
| if std::path::Path::new(&search_path).exists() { | ||
| println!("cargo:search={}", search_path); | ||
| } else { | ||
| let search_path = format!("{}/lib64", netcdf.display()); | ||
| println!("cargo:search={}", search_path); | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| //! Dummy crate for building `netCDF` from source | ||
| //! | ||
| //! The current pinned version is 4.7.4 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| # netcdf-sys | ||
|
|
||
| Rust bindings to `netcdf-c` to locate and link the system libraries neccessary to use `netcdf`. | ||
| This library can also build `hdf5` and `netcdf` from source, to allow a fully static linking experience. This is enabled with the `static` feature. |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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-srcfromdefault-membersin Cargo.toml and then all cargo commands will ignore it without you having to type--excludeeverywhere :)