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

static build of netcdf #56

Merged
merged 15 commits into from
Aug 10, 2020
Merged

static build of netcdf #56

merged 15 commits into from
Aug 10, 2020

Conversation

magnusuMET
Copy link
Member

@magnusuMET magnusuMET commented Jan 18, 2020

Introduces feature static which builds both hdf5 and netcdf from source. Adds CI for conda and static builds on the three major platforms.

Closes #29
Closes #46

@magnusuMET
Copy link
Member Author

Ref #29 #46

@codecov-io
Copy link

codecov-io commented Feb 17, 2020

Codecov Report

Merging #56 into master will increase coverage by 1.14%.
The diff coverage is n/a.

Impacted file tree graph

@@            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     
Impacted Files Coverage Δ
src/attribute.rs 94.80% <0.00%> (+0.82%) ⬆️
src/group.rs 78.72% <0.00%> (+1.30%) ⬆️
src/file.rs 78.07% <0.00%> (+1.34%) ⬆️
src/variable.rs 87.58% <0.00%> (+1.44%) ⬆️
src/dimension.rs 98.41% <0.00%> (+1.56%) ⬆️
src/types.rs 82.69% <0.00%> (+1.81%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8b7417d...02bb0ce. Read the comment docs.

@apexys
Copy link

apexys commented May 26, 2020

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

git submodule update --recursive
cargo build --features "netcdf-src/static"

and it complained about a missing file "putget.c" when compiling netcdf-src:

Compiler output
$ cargo build --features "netcdf-sys/static"
    Updating git repository `https://github.com/magnusuMET/hdf5-rust`
    Updating crates.io index
   Compiling cc v1.0.54
   Compiling proc-macro2 v1.0.17
   Compiling pkg-config v0.3.17
   Compiling vcpkg v0.2.8
   Compiling memchr v2.3.3
   Compiling winapi v0.3.8
   Compiling unicode-xid v0.2.0
   Compiling autocfg v1.0.0
   Compiling syn v1.0.25
   Compiling serde v1.0.110
   Compiling libloading v0.6.2
   Compiling lazy_static v1.4.0
   Compiling regex-syntax v0.6.17
   Compiling libc v0.2.70
   Compiling ndarray v0.13.1
   Compiling rawpointer v0.2.1
   Compiling netcdf-sys v0.2.1 (C:\Users\Valentin Buck\Desktop\test\2nd try\rust-netcdf\netcdf-sys)
   Compiling thread_local v1.0.1
   Compiling num-traits v0.2.11
   Compiling num-integer v0.1.42
   Compiling num-complex v0.2.4
   Compiling cmake v0.1.44
   Compiling matrixmultiply v0.2.3
   Compiling aho-corasick v0.7.10
   Compiling quote v1.0.6
   Compiling libz-sys v1.0.25
   Compiling hdf5-src v0.1.0 (https://github.com/magnusuMET/hdf5-rust?branch=feature/static_build#3dd1eeba)
   Compiling netcdf-src v0.1.0 (C:\Users\Valentin Buck\Desktop\test\2nd try\rust-netcdf\netcdf-src)
   Compiling regex v1.3.7
   Compiling winreg v0.7.0
   Compiling serde_derive v1.0.110
   Compiling hdf5-sys v0.6.1 (https://github.com/magnusuMET/hdf5-rust?branch=feature/static_build#3dd1eeba)
error: failed to run custom build command for `netcdf-src v0.1.0 (C:\Users\Valentin Buck\Desktop\test\2nd try\rust-netcdf\netcdf-src)`

Caused by:
  process didn't exit successfully: `C:\Users\Valentin Buck\Desktop\test\2nd try\rust-netcdf\target\debug\build\netcdf-src-ddd058de4af45098\build-script-build` (exit code: 101)
--- stdout
cargo:rerun-if-changed=build.rs
running: "cmake" "C:\\Users\\Valentin Buck\\Desktop\\test\\2nd try\\rust-netcdf\\netcdf-src\\source" "-G" "Visual Studio 16 2019" "-Thost=x64" "-Ax64" "-DBUILD_SHARED_LIBS=OFF" "-DNC_FIND_SHARED_LIBS=OFF" "-DBUILD_UTILITIES=OFF" "-DENABLE_EXAMPLES=OFF" "-DENABLE_DAP_REMOTE_TESTS=OFF" "-DENABLE_TESTS=OFF" "-DENABLE_EXTREME_NUMBERS=OFF" "-DENABLE_PARALLEL_TESTS=OFF" "-DENABLE_FILTER_TESTING=OFF" "-DENABLE_BASH_SCRIPT_TESTING=OFF" "-DHDF5_C_LIBRARY=libhdf5" "-DHDF5_HL_LIBRARY=libhdf5_hl" "-DHDF5_INCLUDE_DIR=C:\\Users\\Valentin Buck\\Desktop\\test\\2nd try\\rust-netcdf\\target\\debug\\build\\hdf5-src-9a7acb8a3f766d4e\\out/include" "-DENABLE_DAP=OFF" "-DCMAKE_INSTALL_PREFIX=C:\\Users\\Valentin Buck\\Desktop\\test\\2nd try\\rust-netcdf\\target\\debug\\build\\netcdf-src-0fcb851e7c852c8b\\out" "-DCMAKE_C_FLAGS= -nologo -MD -Brepro" "-DCMAKE_C_FLAGS_RELWITHDEBINFO= -nologo -MD -Brepro" "-DCMAKE_CXX_FLAGS= -nologo -MD -Brepro" "-DCMAKE_CXX_FLAGS_RELWITHDEBINFO= -nologo -MD -Brepro" "-DCMAKE_ASM_FLAGS= -nologo -MD -Brepro" "-DCMAKE_ASM_FLAGS_RELWITHDEBINFO= -nologo -MD -Brepro" "-DCMAKE_BUILD_TYPE=RelWithDebInfo"
-- Selecting Windows SDK version 10.0.18362.0 to target Windows 10.0.17763.
-- The C compiler identification is MSVC 19.23.28107.0
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.23.28105/bin/Hostx64/x64/cl.exe
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.23.28105/bin/Hostx64/x64/cl.exe - works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check if the system is big endian
-- Searching 16 bit integer
-- Looking for sys/types.h
-- Looking for sys/types.h - found
-- Looking for stdint.h
-- Looking for stdint.h - found
-- Looking for stddef.h
-- Looking for stddef.h - found
-- Check size of unsigned short
-- Check size of unsigned short - done
-- Searching 16 bit integer - Using unsigned short
-- Check if the system is big endian - little endian
-- Using HDF5 C Library: libhdf5
-- Using HDF5 HL LIbrary: libhdf5_hl
-- Looking for pthread.h
-- Looking for pthread.h - not found
-- Found Threads: TRUE
-- Looking for H5Pget_fapl_mpio in libhdf5
-- Looking for H5Pget_fapl_mpio in libhdf5 - not found
-- Looking for H5Pset_all_coll_metadata_ops in libhdf5
-- Looking for H5Pset_all_coll_metadata_ops in libhdf5 - not found
-- Looking for H5Z_SZIP in libhdf5
-- Looking for H5Z_SZIP in libhdf5 - not found
-- Looking for H5Pset_libver_bounds in libhdf5
-- Looking for H5Pset_libver_bounds in libhdf5 - not found
-- Looking for H5free_memory in libhdf5
-- Looking for H5free_memory in libhdf5 - not found
-- Looking for H5allocate_memory in libhdf5
-- Looking for H5allocate_memory in libhdf5 - not found
-- Looking for H5resize_memory in libhdf5
-- Looking for H5resize_memory in libhdf5 - not found
-- Looking for H5Dread_chunk in libhdf5
-- Looking for H5Dread_chunk in libhdf5 - not found
-- Performing Test HAVE_HDF5_ZLIB
-- Performing Test HAVE_HDF5_ZLIB - Success
-- Found CURL: C:/Program Files/netCDF 4.7.3/lib/libcurl_imp.lib (found version "7.65.3")
-- Performing Test HAVE_CURLOPT_USERNAME
-- Performing Test HAVE_CURLOPT_USERNAME - Failed
-- Performing Test HAVE_CURLOPT_PASSWORD
-- Performing Test HAVE_CURLOPT_PASSWORD - Failed
-- Performing Test HAVE_CURLOPT_KEYPASSWD
-- Performing Test HAVE_CURLOPT_KEYPASSWD - Failed
-- Performing Test HAVE_CURLINFO_RESPONSE_CODE
-- Performing Test HAVE_CURLINFO_RESPONSE_CODE - Failed
-- Performing Test HAVE_CURLINFO_HTTP_CONNECTCODE
-- Performing Test HAVE_CURLINFO_HTTP_CONNECTCODE - Failed
-- Performing Test HAVE_CURLOPT_BUFFERSIZE
-- Performing Test HAVE_CURLOPT_BUFFERSIZE - Failed
-- Performing Test HAVE_CURLOPT_KEEPALIVE
-- Performing Test HAVE_CURLOPT_KEEPALIVE - Failed
-- Enabling use of fill value when NC_ERANGE
-- Enabling a more relaxed check for NC_EINVALCOORDS
-- Looking for math.h
-- Looking for math.h - found
-- Looking for unistd.h
-- Looking for unistd.h - not found
-- Looking for alloca.h
-- Looking for alloca.h - not found
-- Looking for malloc.h
-- Looking for malloc.h - found
-- Looking for fcntl.h
-- Looking for fcntl.h - found
-- Looking for getopt.h
-- Looking for getopt.h - not found
-- Looking for locale.h
-- Looking for locale.h - found
-- Looking for stdio.h
-- Looking for stdio.h - found
-- Looking for io.h
-- Looking for io.h - found
-- Looking for stdlib.h
-- Looking for stdlib.h - found
-- Looking for stdarg.h
-- Looking for stdarg.h - found
-- Looking for strings.h
-- Looking for strings.h - not found
-- Looking for signal.h
-- Looking for signal.h - found
-- Looking for sys/param.h
-- Looking for sys/param.h - not found
-- Looking for sys/stat.h
-- Looking for sys/stat.h - found
-- Looking for sys/time.h
-- Looking for sys/time.h - not found
-- Looking for sys/mman.h
-- Looking for sys/mman.h - not found
-- Looking for sys/resource.h
-- Looking for sys/resource.h - not found
-- Looking for inttypes.h
-- Looking for inttypes.h - found
-- Looking for pstdint.h
-- Looking for pstdint.h - not found
-- Looking for endian.h
-- Looking for endian.h - not found
-- Looking for BaseTsd.h
-- Looking for BaseTsd.h - found
-- Looking for string.h
-- Looking for string.h - found
-- Looking for winsock2.h
-- Looking for winsock2.h - found
-- Looking for ftw.h
-- Looking for ftw.h - not found
-- Looking for libgen.h
-- Looking for libgen.h - not found
-- Looking for isfinite
-- Looking for isfinite - found
-- Looking for isnan
-- Looking for isnan - found
-- Looking for isinf
-- Looking for isinf - found
-- Looking for st_blksize
-- Looking for st_blksize - not found
-- Looking for alloca
-- Looking for alloca - not found
-- Looking for snprintf
-- Looking for snprintf - found
-- Check size of char
-- Check size of char - done
-- Check size of double
-- Check size of double - done
-- Check size of float
-- Check size of float - done
-- Check size of int
-- Check size of int - done
-- Check size of uint
-- Check size of uint - failed
-- Check size of schar
-- Check size of schar - failed
-- Check size of long
-- Check size of long - done
-- Check size of long long
-- Check size of long long - done
-- Check size of unsigned long long
-- Check size of unsigned long long - done
-- Check size of off_t
-- Check size of off_t - done
-- Check size of off64_t
-- Check size of off64_t - failed
-- Check size of short
-- Check size of short - done
-- Check size of ushort
-- Check size of ushort - failed
-- Check size of _Bool
-- Check size of _Bool - done
-- Check size of size_t
-- Check size of size_t - done
-- Check size of ssize_t
-- Check size of ssize_t - failed
-- Check size of ptrdiff_t
-- Check size of ptrdiff_t - done
-- Check size of uintptr_t
-- Check size of uintptr_t - done
-- Check size of __int64
-- Check size of __int64 - done
-- Check size of int64_t
-- Check size of int64_t - done
-- Check size of uint64_t
-- Check size of uint64_t - done
-- Check size of unsigned char
-- Check size of unsigned char - done
-- Check size of unsigned short int
-- Check size of unsigned short int - done
-- Check size of unsigned int
-- Check size of unsigned int - done
-- Check size of long long
-- Check size of long long - done
-- Check size of unsigned long long
-- Check size of unsigned long long - done
-- Looking for fsync
-- Looking for fsync - not found
-- Looking for strlcat
-- Looking for strlcat - not found
-- Looking for strdup
-- Looking for strdup - found
-- Looking for strndup
-- Looking for strndup - not found
-- Looking for strtoll
-- Looking for strtoll - found
-- Looking for strtoull
-- Looking for strtoull - found
-- Looking for mkstemp
-- Looking for mkstemp - not found
-- Looking for mktemp
-- Looking for mktemp - found
-- Looking for random
-- Looking for random - not found
-- Looking for gettimeofday
-- Looking for gettimeofday - not found
-- Looking for MPI_Comm_f2c
-- Looking for MPI_Comm_f2c - not found
-- Looking for MPI_Info_f2c
-- Looking for MPI_Info_f2c - not found
-- Looking for memmove
-- Looking for memmove - found
-- Looking for getpagesize
-- Looking for getpagesize - not found
-- Looking for sysconf
-- Looking for sysconf - not found
-- Looking for getrlimit
-- Looking for getrlimit - not found
-- Looking for _filelengthi64
-- Looking for _filelengthi64 - found
-- Looking for mmap
-- Looking for mmap - not found
-- Looking for mremap
-- Looking for mremap - not found
-- Looking for fileno
-- Looking for fileno - found
-- m4 not found.
-- Building Shared Libraries:     OFF
-- Building netCDF-4:             ON
-- Building DAP2 Support:         OFF
-- Building DAP4 Support:         OFF
-- Building Byte-range Support:   OFF
-- Building Utilities:            OFF
-- Build Type:           RELWITHDEBINFO
-- CMAKE_C_COMPILER:     C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.23.28105/bin/Hostx64/x64/cl.exe
-- CMAKE_C_FLAGS:         -nologo -MD -Brepro
-- Linking against:      libhdf5;libhdf5_hl
-- Configuring done

--- stderr
CMake Warning at CMakeLists.txt:1173 (MESSAGE):
  ENABLE_FILTER_TESTING requires shared libraries.  Disabling.


CMake Warning at CMakeLists.txt:1428 (MESSAGE):
  mmap not supported under visual studio: disabling MMAP support.




Configuration Summary:


Tests Enabled:              OFF

Compiler:


# NetCDF C Configuration Summary
==============================

# General
-------
NetCDF Version:         4.7.4-development
Dispatch Version:       1
Configured On:          Di, 26. Mai 2020 10:13:13
Host System:            x86_64-MINGW64_NT-10.0-17763-3.0.7-338.x86_64
Build Directory:        C:/Users/Valentin Buck/Desktop/test/2nd try/rust-netcdf/target/debug/build/netcdf-src-0fcb851e7c852c8b/out/build
Install Prefix:         C:/Users/Valentin Buck/Desktop/test/2nd try/rust-netcdf/target/debug/build/netcdf-src-0fcb851e7c852c8b/out

# Compiling Options
-----------------
C Compiler:             C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.23.28105/bin/Hostx64/x64/cl.exe
CFLAGS:                  -nologo -MD -Brepro  -nologo -MD -Brepro
CPPFLAGS:
LDFLAGS:                /machine:x64 /LARGEADDRESSAWARE /STACK:40000000 /debug /INCREMENTAL
AM_CFLAGS:
AM_CPPFLAGS:
AM_LDFLAGS:
Shared Library:         no
Static Library:         yes
Extra libraries:        -lhdf5 -lhdf5_hl

# Features
--------
NetCDF-2 API:           yes
HDF4 Support:           no
HDF5 Support:           yes
NetCDF-4 API:           yes
NC-4 Parallel Support:  no
PnetCDF Support:        no
DAP2 Support:           no
DAP4 Support:           no
Byte-Range Support:     no
Diskless Support:       yes
MMap Support:           no
JNA Support:            no
CDF5 Support:           yes
ERANGE Fill Support:    yes
Relaxed Boundary Check: yes
SZIP Support:           no
SZIP Write Support:     no
Parallel Filters:       no

CMake Error at libsrc/CMakeLists.txt:35 (add_library):
  Cannot find source file:

    putget.c

  Tried extensions .c .C .c++ .cc .cpp .cxx .cu .m .M .mm .h .hh .h++ .hm
  .hpp .hxx .in .txx


CMake Error at libsrc/CMakeLists.txt:35 (add_library):
  No SOURCES given to target: netcdf3


CMake Generate step failed.  Build files cannot be regenerated correctly.
thread 'main' panicked at '
command did not execute successfully, got: exit code: 1

build script failed, must exit now', C:\Users\Valentin Buck\.cargo\registry\src\github.com-1ecc6299db9ec823\cmake-0.1.44\src\lib.rs:885:5
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Is it maybe an outdated version of the source netcdf-src?
I couldn't find putget.c in the official repository (https://github.com/Unidata/netcdf-c), only putget.m4.

Thanks for your work!

@magnusuMET
Copy link
Member Author

magnusuMET commented May 26, 2020

That file should be generated by m4, but I see you have -- m4 not found in the log. Could you try installing this program? The build should really error out on this failure, I'll open an issue in netcdf-c for this.

@apexys
Copy link

apexys commented May 26, 2020

I installed m4 from MinGW and the build now works! Thank you!

@apexys
Copy link

apexys commented May 26, 2020

Okay, now if I want to use the static build experimentally in a cargo project, I include it by adding

netcdf = {git = "https://github.com/magnusuMET/rust-netcdf", branch="vendor", features=["static"]}

to my Cargo.toml, right?

The version I cloned from your fork on github builds no problem with cargo build --features "static", but if I run "cargo build" in that new project, I tells me I have a version conflict:

> cargo build --release
    Updating git repository `https://github.com/magnusuMET/rust-netcdf`
    Updating crates.io index
error: failed to select a version for `hdf5-sys`.
    ... required by package `netcdf-sys v0.2.1 (https://github.com/magnusuMET/rust-netcdf?branch=vendor#02bb0cef)`
    ... which is depended on by `netcdf v0.4.1 (https://github.com/magnusuMET/rust-netcdf?branch=vendor#02bb0cef)`
    ... which is depended on by `netcdf_source v0.1.0 (C:\Users\Valentin Buck\Desktop\dg2\digital-globe\tileserver\sources\netcdf_source)`
versions that meet the requirements `^0.6.0` are: 0.6.1, 0.6.0

the package `netcdf-sys` depends on `hdf5-sys`, with features: `deprecated, zlib, static, hl` but `hdf5-sys` does not have these features.


failed to select a version for `hdf5-sys` which could resolve this conflict

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.

@magnusuMET
Copy link
Member Author

Yes, the upstream pull request has not been merged yet, so you will require the [patch]. You could use

[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 hdf5-src is eventually uploaded (will instead pull only latest source from crates.io).

@apexys
Copy link

apexys commented May 26, 2020

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:

> cargo build --release
    Updating git repository `https://github.com/magnusuMET/hdf5-rust.git`
    Updating git repository `https://github.com/magnusuMET/rust-netcdf`
    Updating crates.io index
error: failed to select a version for `hdf5-sys`.
    ... required by package `netcdf-sys v0.2.1 (https://github.com/magnusuMET/rust-netcdf?branch=vendor#02bb0cef)`
    ... which is depended on by `netcdf v0.4.1 (https://github.com/magnusuMET/rust-netcdf?branch=vendor#02bb0cef)`
    ... which is depended on by `netcdf_source v0.1.0 (C:\Users\Valentin Buck\Desktop\dg2\digital-globe\tileserver\sources\netcdf_source)`
versions that meet the requirements `^0.6.0` are: 0.6.1, 0.6.0

the package `netcdf-sys` depends on `hdf5-sys`, with features: `hl, static, deprecated, zlib` but `hdf5-sys` does not have these features.


failed to select a version for `hdf5-sys` which could resolve this conflict

@magnusuMET
Copy link
Member Author

My bad, the patch section should be overriding hdf5-sys, not hdf5. Try

hdf5-src = { git = "https://github.com/magnusuMET/hdf5-rust.git", branch = "feature/static_build" }

@apexys
Copy link

apexys commented May 26, 2020

If I do

hdf5-sys = { git = "https://github.com/magnusuMET/hdf5-rust.git", branch = "feature/static_build" }

it builds!

Thank you so much!

@apexys
Copy link

apexys commented May 28, 2020

New day, new problem!
So yesterday I was building this project on windows 10, today I'm on a CentOS machine and with the same Cargo.toml from yesterday, I get the error

Compiling netcdf v0.4.1 (https://github.com/magnusuMET/rust-netcdf?branch=vendor#02bb0cef)
error: could not find native static library `netcdf`, perhaps an -L flag is missing?

error: aborting due to previous error

error: could not compile `netcdf-sys`.

For reference, this is my Cargo.toml:

Cargo.toml
[package]
name = "netcdf_source"
version = "0.1.0"
authors = ["Valentin Buck <vbuck@geomar.de>"]
edition = "2018"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
tileserver-model = {path="../../tileserver-model"}
netcdf = {git = "https://github.com/magnusuMET/rust-netcdf", branch="vendor", features=["static"]} # #Replace this with the official repo (georust/netcdf) once https://github.com/georust/netcdf/pull/56 gets merged!
regex = "1"
lazy_static = "1.4.0"

[patch.crates-io]
hdf5-sys = { git = "https://github.com/magnusuMET/hdf5-rust.git", branch = "feature/static_build" }

Do you know what could cause this?

Edit:

This error occurs independently of whether I've installed libnetcdf via rpm or not.

@lwandrebeck
Copy link
Contributor

If I must believe the error message, you need to yum install netcdf-static which provides /usr/lib64/libnetcdf.a

@magnusuMET
Copy link
Member Author

magnusuMET commented May 28, 2020

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 cargo b -vv?

EDIT: I suspect there is some problem with netcdf-src not pulling the data too. I could push this crate prematurely which might help.

@apexys
Copy link

apexys commented May 28, 2020

Thank you both for your answers!

I have run the command and attached the log
Buildlog.txt

@magnusuMET
Copy link
Member Author

It seems cmake installs to lib64 on your platform, I'll see if I can find a way to set the cmake prefix.

@magnusuMET
Copy link
Member Author

@apexys Is this fix working for you? You might have to do a cargo update to pull in the newest commi

@apexys
Copy link

apexys commented May 28, 2020

Yes, that works now!

Thank you again for your great support!

@magnusuMET
Copy link
Member Author

@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-commenter
Copy link

Codecov Report

Merging #56 into master will increase coverage by 0.57%.
The diff coverage is n/a.

Impacted file tree graph

@@            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     
Impacted Files Coverage Δ
src/group.rs 77.41% <0.00%> (ø)
src/variable.rs 86.42% <0.00%> (+0.28%) ⬆️
src/file.rs 77.19% <0.00%> (+0.46%) ⬆️
src/attribute.rs 94.80% <0.00%> (+0.82%) ⬆️
src/types.rs 82.24% <0.00%> (+1.36%) ⬆️
src/dimension.rs 98.41% <0.00%> (+1.56%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8b7417d...16a6b46. Read the comment docs.

@apexys
Copy link

apexys commented Aug 10, 2020

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?

@magnusuMET
Copy link
Member Author

@apexys I'll have a look this afternoon!

TODO:

  • CI for mac + windows
  • Fixup flags for hdf5-sys
  • Decide on a netcdf-c version to vendor

@magnusuMET magnusuMET force-pushed the vendor branch 3 times, most recently from 7d4bb96 to ea9fb63 Compare August 10, 2020 14:45
@magnusuMET magnusuMET force-pushed the vendor branch 5 times, most recently from 8e84acc to 4f37384 Compare August 10, 2020 15:24
@magnusuMET magnusuMET force-pushed the vendor branch 5 times, most recently from 561717d to dd8b6ed Compare August 10, 2020 16:02
@magnusuMET
Copy link
Member Author

@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
Copy link

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 :)

@fstaebler
Copy link

Not sure if this is directly related:

Build with features=["static"] on Windows and Linux fails because the netcdf-c repository is not completely downloaded? i know little to nothing about git submodules, so all i can tell is that in
$HOME/.cargo/registry/src/github.com-1ecc6299db9ec823/netcdf-src-0.1.0/source/ the entire ncdap_test folder is missing, causing cmake to fail.

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?

@magnusuMET
Copy link
Member Author

@fstaebler That is a misconfiguration on my part, it seems configure_file in CMakeLists.txt always needs to create a set of files, and the ncdap_test directory is not created. It is partly due to #69, but I'll see if I can create a fix this afternoon!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Build netcdf-c from source Static build
7 participants