Skip to content

Using feature 'static' seems broken #164

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

Closed
zingi opened this issue Jul 13, 2021 · 6 comments
Closed

Using feature 'static' seems broken #164

zingi opened this issue Jul 13, 2021 · 6 comments

Comments

@zingi
Copy link

zingi commented Jul 13, 2021

Problem

I wanted to build a project with:

# Cargo.toml
[dependencies]                                         
netcdf = {  version = "0.6.1", features = ["static"]  }  

which should also build hdf5-sys with the static feature.

But I get following error:

Error Message
❯ cargo build
    Updating crates.io index
  Downloaded cc v1.0.69
  Downloaded netcdf-sys v0.3.5
  Downloaded num-integer v0.1.44
  Downloaded aho-corasick v0.7.18
  Downloaded netcdf v0.6.1
  Downloaded lazy_static v1.4.0
  Downloaded autocfg v1.0.1
  Downloaded num-traits v0.2.14
  Downloaded libloading v0.6.7
  Downloaded matrixmultiply v0.2.4
  Downloaded memchr v2.4.0
  Downloaded hdf5-sys v0.7.1
  Downloaded ndarray v0.14.0
  Downloaded cfg-if v1.0.0
  Downloaded bitflags v1.2.1
  Downloaded regex v1.5.4
  Downloaded pkg-config v0.3.19
  Downloaded libc v0.2.98
  Downloaded regex-syntax v0.6.25
  Downloaded num-complex v0.3.1
  Downloaded libz-sys v1.1.3
  Downloaded rawpointer v0.2.1
  Downloaded cmake v0.1.45
  Downloaded hdf5-src v0.7.1
  Downloaded netcdf-src v0.1.3
  Downloaded 25 crates (11.3 MB) in 2.03s (largest was `netcdf-src` at 4.6 MB)
   Compiling cc v1.0.69
   Compiling pkg-config v0.3.19
   Compiling memchr v2.4.0
   Compiling cfg-if v1.0.0
   Compiling regex-syntax v0.6.25
   Compiling autocfg v1.0.1
   Compiling libc v0.2.98
   Compiling ndarray v0.14.0
   Compiling bitflags v1.2.1
   Compiling rawpointer v0.2.1
   Compiling netcdf-sys v0.3.5
   Compiling lazy_static v1.4.0
   Compiling libloading v0.6.7
   Compiling matrixmultiply v0.2.4
   Compiling num-traits v0.2.14
   Compiling num-integer v0.1.44
   Compiling cmake v0.1.45
   Compiling aho-corasick v0.7.18
   Compiling libz-sys v1.1.3
   Compiling hdf5-src v0.7.1
   Compiling netcdf-src v0.1.3
   Compiling num-complex v0.3.1
   Compiling regex v1.5.4
   Compiling hdf5-sys v0.7.1
error: failed to run custom build command for `hdf5-src v0.7.1`

Caused by:
  process didn't exit successfully: `/Users/aaron/repos/work/metgis/wrf-gfs-api/conversion/nc_to_tif/target/debug/build/hdf5-src-a3c2d79992f15fa2/build-script-build` (exit status: 101)
  --- stdout
  cargo:rerun-if-changed=build.rs
  cargo:zlib_header=/Users/aaron/repos/work/metgis/wrf-gfs-api/conversion/nc_to_tif/target/debug/build/libz-sys-94eeb5c964414683/out/include/zlib.h
  cargo:zlib=z
  cargo:hl_library=hdf5_hl_debug
  running: "cmake" "/Users/aaron/.cargo/registry/src/github.com-1ecc6299db9ec823/hdf5-src-0.7.1/ext/hdf5" "-DHDF5_NO_PACKAGES=ON" "-DBUILD_SHARED_LIBS=OFF" "-DBUILD_TESTING=OFF" "-DHDF5_BUILD_TOOLS=OFF" "-DHDF5_BUILD_EXAMPLES=OFF" "-DHDF5_BUILD_JAVA=OFF" "-DHDF5_BUILD_FORTRAN=OFF" "-DHDF5_BUILD_CPP_LIB=OFF" "-DHDF5_ENABLE_PARALLEL=OFF" "-DHDF5_ENABLE_DEPRECATED_SYMBOLS=OFF" "-DHDF5_ENABLE_THREADSAFE=OFF" "-DALLOW_UNSUPPORTED=OFF" "-DHDF5_BUILD_HL_LIB=OFF" "-DHDF5_ENABLE_Z_LIB_SUPPORT=ON" "-DH5_ZLIB_HEADER=/Users/aaron/repos/work/metgis/wrf-gfs-api/conversion/nc_to_tif/target/debug/build/libz-sys-94eeb5c964414683/out/include/zlib.h" "-DZLIB_STATIC_LIBRARY=z" "-DHDF5_ENABLE_DEPRECATED_SYMBOLS=ON" "-DHDF5_BUILD_HL_LIB=ON" "-DCMAKE_INSTALL_PREFIX=/Users/aaron/repos/work/metgis/wrf-gfs-api/conversion/nc_to_tif/target/debug/build/hdf5-src-597bb74f8e4b121a/out" "-DCMAKE_C_FLAGS= -ffunction-sections -fdata-sections -fPIC -m64 -arch x86_64" "-DCMAKE_C_COMPILER=/usr/bin/cc" "-DCMAKE_CXX_FLAGS= -ffunction-sections -fdata-sections -fPIC -m64 -arch x86_64" "-DCMAKE_CXX_COMPILER=/usr/bin/c++" "-DCMAKE_ASM_FLAGS= -ffunction-sections -fdata-sections -fPIC -m64 -arch x86_64" "-DCMAKE_ASM_COMPILER=/usr/bin/cc" "-DCMAKE_BUILD_TYPE=Debug"
  -- The C compiler identification is AppleClang 12.0.5.12050022
  -- Detecting C compiler ABI info
  -- Detecting C compiler ABI info - done
  -- Check for working C compiler: /usr/bin/cc - skipped
  -- Detecting C compile features
  -- Detecting C compile features - done
  -- SOVERSION: 103.2.0
  -- SOVERSION_TOOLS: 100.1.3
  -- SOVERSION_CXX: 103.2.0
  -- SOVERSION_F: 102.0.1
  -- SOVERSION_HL: 100.1.3
  -- SOVERSION_HL_CXX: 100.1.4
  -- SOVERSION_HL_F: 100.0.5
  -- SOVERSION_JAVA: 100.4.1
  -- Looking for include file sys/file.h
  -- Looking for include file sys/file.h - found
  -- Looking for include files sys/file.h, sys/ioctl.h
  -- Looking for include files sys/file.h, sys/ioctl.h - found
  -- Looking for 3 include files sys/file.h, ..., sys/resource.h
  -- Looking for 3 include files sys/file.h, ..., sys/resource.h - found
  -- Looking for 4 include files sys/file.h, ..., sys/socket.h
  -- Looking for 4 include files sys/file.h, ..., sys/socket.h - found
  -- Looking for 5 include files sys/file.h, ..., sys/stat.h
  -- Looking for 5 include files sys/file.h, ..., sys/stat.h - found
  -- Looking for 6 include files sys/file.h, ..., sys/time.h
  -- Looking for 6 include files sys/file.h, ..., sys/time.h - found
  -- Looking for 7 include files sys/file.h, ..., sys/types.h
  -- Looking for 7 include files sys/file.h, ..., sys/types.h - found
  -- Looking for 8 include files sys/file.h, ..., features.h
  -- Looking for 8 include files sys/file.h, ..., features.h - not found
  -- Looking for 8 include files sys/file.h, ..., dirent.h
  -- Looking for 8 include files sys/file.h, ..., dirent.h - found
  -- Looking for 9 include files sys/file.h, ..., setjmp.h
  -- Looking for 9 include files sys/file.h, ..., setjmp.h - found
  -- Looking for 10 include files sys/file.h, ..., stddef.h
  -- Looking for 10 include files sys/file.h, ..., stddef.h - found
  -- Looking for 11 include files sys/file.h, ..., stdint.h
  -- Looking for 11 include files sys/file.h, ..., stdint.h - found
  -- Looking for 12 include files sys/file.h, ..., unistd.h
  -- Looking for 12 include files sys/file.h, ..., unistd.h - found
  -- Looking for 13 include files sys/file.h, ..., mach/mach_time.h
  -- Looking for 13 include files sys/file.h, ..., mach/mach_time.h - found
  -- Looking for 14 include files sys/file.h, ..., io.h
  -- Looking for 14 include files sys/file.h, ..., io.h - not found
  -- Looking for 14 include files sys/file.h, ..., winsock2.h
  -- Looking for 14 include files sys/file.h, ..., winsock2.h - not found
  -- Looking for 14 include files sys/file.h, ..., sys/timeb.h
  -- Looking for 14 include files sys/file.h, ..., sys/timeb.h - found
  -- Looking for 15 include files sys/file.h, ..., globus/common.h
  -- Looking for 15 include files sys/file.h, ..., globus/common.h - not found
  -- Looking for 15 include files sys/file.h, ..., pdb.h
  -- Looking for 15 include files sys/file.h, ..., pdb.h - not found
  -- Looking for 15 include files sys/file.h, ..., pthread.h
  -- Looking for 15 include files sys/file.h, ..., pthread.h - found
  -- Looking for 16 include files sys/file.h, ..., srbclient.h
  -- Looking for 16 include files sys/file.h, ..., srbclient.h - not found
  -- Looking for 16 include files sys/file.h, ..., string.h
  -- Looking for 16 include files sys/file.h, ..., string.h - found
  -- Looking for 17 include files sys/file.h, ..., strings.h
  -- Looking for 17 include files sys/file.h, ..., strings.h - found
  -- Looking for 18 include files sys/file.h, ..., stdlib.h
  -- Looking for 18 include files sys/file.h, ..., stdlib.h - found
  -- Looking for 19 include files sys/file.h, ..., memory.h
  -- Looking for 19 include files sys/file.h, ..., memory.h - found
  -- Looking for 20 include files sys/file.h, ..., dlfcn.h
  -- Looking for 20 include files sys/file.h, ..., dlfcn.h - found
  -- Looking for 21 include files sys/file.h, ..., inttypes.h
  -- Looking for 21 include files sys/file.h, ..., inttypes.h - found
  -- Looking for 22 include files sys/file.h, ..., netinet/in.h
  -- Looking for 22 include files sys/file.h, ..., netinet/in.h - found
  -- Looking for 23 include files sys/file.h, ..., stdbool.h
  -- Looking for 23 include files sys/file.h, ..., stdbool.h - found
  -- Looking for include file quadmath.h
  -- Looking for include file quadmath.h - not found
  -- Looking for ceil in m;
  -- Looking for ceil in m; - found
  -- Looking for dlopen in dl;m
  -- Looking for dlopen in dl;m - found
  -- Looking for WSAStartup in ws2_32;m;dl
  -- Looking for WSAStartup in ws2_32;m;dl - not found
  -- Looking for gethostbyname in wsock32;m;dl
  -- Looking for gethostbyname in wsock32;m;dl - not found
  -- Looking for gethostname in ucb;m;dl
  -- Looking for gethostname in ucb;m;dl - not found
  -- Performing Other Test STDC_HEADERS - Success
  -- Performing Other Test HAVE_OFF64_T - Failed
  -- Looking for fseeko
  -- Looking for fseeko - found
  -- Performing Other Test HAVE_STAT64_STRUCT - Success
  -- Looking for stat64
  -- Looking for stat64 - found
  -- 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 char
  -- Check size of char - done
  -- Check size of short
  -- Check size of short - done
  -- Check size of int
  -- Check size of int - done
  -- Check size of unsigned
  -- Check size of unsigned - done
  -- Check size of long long
  -- Check size of long long - done
  -- Check size of __int64
  -- Check size of __int64 - failed
  -- Check size of float
  -- Check size of float - done
  -- Check size of double
  -- Check size of double - done
  -- Check size of long double
  -- Check size of long double - done
  -- Check size of int8_t
  -- Check size of int8_t - done
  -- Check size of uint8_t
  -- Check size of uint8_t - done
  -- Check size of int_least8_t
  -- Check size of int_least8_t - done
  -- Check size of uint_least8_t
  -- Check size of uint_least8_t - done
  -- Check size of int_fast8_t
  -- Check size of int_fast8_t - done
  -- Check size of uint_fast8_t
  -- Check size of uint_fast8_t - done
  -- Check size of int16_t
  -- Check size of int16_t - done
  -- Check size of uint16_t
  -- Check size of uint16_t - done
  -- Check size of int_least16_t
  -- Check size of int_least16_t - done
  -- Check size of uint_least16_t
  -- Check size of uint_least16_t - done
  -- Check size of int_fast16_t
  -- Check size of int_fast16_t - done
  -- Check size of uint_fast16_t
  -- Check size of uint_fast16_t - done
  -- Check size of int32_t
  -- Check size of int32_t - done
  -- Check size of uint32_t
  -- Check size of uint32_t - done
  -- Check size of int_least32_t
  -- Check size of int_least32_t - done
  -- Check size of uint_least32_t
  -- Check size of uint_least32_t - done
  -- Check size of int_fast32_t
  -- Check size of int_fast32_t - done
  -- Check size of uint_fast32_t
  -- Check size of uint_fast32_t - 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 int_least64_t
  -- Check size of int_least64_t - done
  -- Check size of uint_least64_t
  -- Check size of uint_least64_t - done
  -- Check size of int_fast64_t
  -- Check size of int_fast64_t - done
  -- Check size of uint_fast64_t
  -- Check size of uint_fast64_t - 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 time_t
  -- Check size of time_t - done
  -- Check size of _Bool
  -- Check size of _Bool - done
  -- Performing Other Test DEV_T_IS_SCALAR - Success
  -- Looking for CLOCK_MONOTONIC
  -- Looking for CLOCK_MONOTONIC - not found
  -- Looking for gettimeofday
  -- Looking for gettimeofday - found
  -- Performing Other Test HAVE_TM_GMTOFF - Success
  -- Performing Other Test HAVE___TM_GMTOFF - Failed
  -- Performing Other Test HAVE_STRUCT_TIMEZONE - Success
  -- Performing Other Test GETTIMEOFDAY_GIVES_TZ - Success
  -- Performing Other Test TIME_WITH_SYS_TIME - Success
  -- Performing Other Test HAVE_TM_ZONE - Failed
  -- Performing Other Test HAVE_STRUCT_TM_TM_ZONE - Failed
  -- Performing Other Test HAVE_TIMEZONE - Success
  -- Performing Other Test HAVE_STAT_ST_BLOCKS - Success
  -- Looking for ioctl
  -- Looking for ioctl - found
  -- Performing Other Test HAVE_STRUCT_VIDEOCONFIG - Failed
  -- Performing Other Test HAVE_STRUCT_TEXT_INFO - Failed
  -- Looking for _getvideoconfig
  -- Looking for _getvideoconfig - not found
  -- Looking for gettextinfo
  -- Looking for gettextinfo - not found
  -- Looking for _scrsize
  -- Looking for _scrsize - not found
  -- Looking for GetConsoleScreenBufferInfo
  -- Looking for GetConsoleScreenBufferInfo - not found
  -- Looking for TIOCGWINSZ
  -- Looking for TIOCGWINSZ - found
  -- Looking for TIOCGETD
  -- Looking for TIOCGETD - found
  -- Looking for getpwuid
  -- Looking for getpwuid - found
  -- Looking for alarm
  -- Looking for alarm - found
  -- Looking for fcntl
  -- Looking for fcntl - found
  -- Looking for flock
  -- Looking for flock - found
  -- Looking for fork
  -- Looking for fork - found
  -- Looking for frexpf
  -- Looking for frexpf - found
  -- Looking for frexpl
  -- Looking for frexpl - found
  -- Looking for gethostname
  -- Looking for gethostname - found
  -- Looking for getrusage
  -- Looking for getrusage - found
  -- Looking for llround
  -- Looking for llround - found
  -- Looking for llroundf
  -- Looking for llroundf - found
  -- Looking for lround
  -- Looking for lround - found
  -- Looking for lroundf
  -- Looking for lroundf - found
  -- Looking for lstat
  -- Looking for lstat - found
  -- Looking for pread
  -- Looking for pread - found
  -- Looking for pwrite
  -- Looking for pwrite - found
  -- Looking for rand_r
  -- Looking for rand_r - found
  -- Looking for random
  -- Looking for random - found
  -- Looking for round
  -- Looking for round - found
  -- Looking for roundf
  -- Looking for roundf - found
  -- Looking for setsysinfo
  -- Looking for setsysinfo - not found
  -- Looking for signal
  -- Looking for signal - found
  -- Looking for longjmp
  -- Looking for longjmp - found
  -- Looking for setjmp
  -- Looking for setjmp - found
  -- Looking for siglongjmp
  -- Looking for siglongjmp - found
  -- Looking for sigsetjmp
  -- Looking for sigsetjmp - found
  -- Looking for sigprocmask
  -- Looking for sigprocmask - found
  -- Looking for snprintf
  -- Looking for snprintf - found
  -- Looking for srandom
  -- Looking for srandom - found
  -- Looking for strdup
  -- Looking for strdup - found
  -- Looking for strtoll
  -- Looking for strtoll - found
  -- Looking for strtoull
  -- Looking for strtoull - found
  -- Looking for symlink
  -- Looking for symlink - found
  -- Looking for system
  -- Looking for system - found
  -- Looking for tmpfile
  -- Looking for tmpfile - found
  -- Looking for asprintf
  -- Looking for asprintf - found
  -- Looking for vasprintf
  -- Looking for vasprintf - found
  -- Looking for waitpid
  -- Looking for waitpid - found
  -- Looking for vsnprintf
  -- Looking for vsnprintf - found
  -- Performing Other Test VSNPRINTF_WORKS - Success
  -- Performing Other Test HAVE_ATTRIBUTE - Success
  -- Performing Other Test HAVE_C99_FUNC - Success
  -- Performing Other Test HAVE_FUNCTION - Success
  -- Performing Other Test HAVE_C99_DESIGNATED_INITIALIZER - Success
  -- Performing Other Test SYSTEM_SCOPE_THREADS - Success
  -- Performing Other Test HAVE_SOCKLEN_T - Success
  -- Performing Other Test HAVE_INLINE - Success
  -- Performing Other Test HAVE___INLINE__ - Success
  -- Performing Other Test HAVE___INLINE - Success
  -- Checking for appropriate format for 64 bit long:
  -- Checking for appropriate format for 64 bit long: found "l"
  -- Looking for difftime
  -- Looking for difftime - found
  -- Looking for clock_gettime
  -- Looking for clock_gettime - found
  -- Looking for clock_gettime in rt
  -- Looking for clock_gettime in rt - not found
  -- Looking for clock_gettime in posix4
  -- Looking for clock_gettime in posix4 - not found
  -- Check size of __float128
  -- Check size of __float128 - failed
  -- Check size of _Quad
  -- Check size of _Quad - failed
  -- Checking IF your system converts long double to (unsigned) long values with special algorithm... no
  -- Checking IF your system can convert (unsigned) long to long double values with special algorithm... no
  -- Checking IF correctly converting long double to (unsigned) long long values... yes
  -- Checking IF correctly converting (unsigned) long long to long double values... yes
  -- Checking IF the cpu is power9 and cannot correctly converting long double values... no
  -- Checking IF alignment restrictions are strictly enforced... yes
  -- Warnings Configuration:
  -- Filter ZLIB is ON
  -- Found Perl: /usr/local/bin/perl (found version "5.34.0")
  --
  --
  --
  -- Configuring done
  -- Generating done
  -- Build files have been written to: /Users/aaron/repos/work/metgis/wrf-gfs-api/conversion/nc_to_tif/target/debug/build/hdf5-src-597bb74f8e4b121a/out/build
  running: "cmake" "--build" "." "--target" "install" "--config" "Debug" "--"
  [  0%] Building C object src/CMakeFiles/H5make_libsettings.dir/H5make_libsettings.c.o
  [  0%] Building C object src/CMakeFiles/H5detect.dir/H5detect.c.o
  [  1%] Linking C executable ../bin/H5make_libsettings
  [  1%] Built target H5make_libsettings
  [  1%] Linking C executable ../bin/H5detect
  [  1%] Built target H5detect
  [  1%] Generating ../H5Tinit.c, ../gen_SRCS.stamp1
  [  1%] Generating ../H5lib_settings.c, ../gen_SRCS.stamp2
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       [  1%] Built target gen_hdf5-static
  [  3%] Building C object src/CMakeFiles/hdf5-static.dir/H5.c.o
  [  3%] Building C object src/CMakeFiles/hdf5-static.dir/H5system.c.o
  [  3%] Building C object src/CMakeFiles/hdf5-static.dir/H5dbg.c.o
  [  4%] Building C object src/CMakeFiles/hdf5-static.dir/H5ACproxy_entry.c.o
  [  4%] Building C object src/CMakeFiles/hdf5-static.dir/H5A.c.o
  [  4%] Building C object src/CMakeFiles/hdf5-static.dir/H5Adeprec.c.o
  [  5%] Building C object src/CMakeFiles/hdf5-static.dir/H5Abtree2.c.o
  [  5%] Building C object src/CMakeFiles/hdf5-static.dir/H5AC.c.o
  [  6%] Building C object src/CMakeFiles/hdf5-static.dir/H5Aint.c.o
  [  5%] Building C object src/CMakeFiles/hdf5-static.dir/H5ACdbg.c.o
  [  6%] Building C object src/CMakeFiles/hdf5-static.dir/H5timer.c.o
  [  6%] Building C object src/CMakeFiles/hdf5-static.dir/H5ACmpio.c.o
  [  6%] Building C object src/CMakeFiles/hdf5-static.dir/H5Adense.c.o
  [  6%] Building C object src/CMakeFiles/hdf5-static.dir/H5Atest.c.o
  [  5%] Building C object src/CMakeFiles/hdf5-static.dir/H5trace.c.o
  [  6%] Building C object src/CMakeFiles/hdf5-static.dir/H5checksum.c.o
  [  6%] Building C object src/CMakeFiles/hdf5-static.dir/H5B.c.o
  [  6%] Building C object src/CMakeFiles/hdf5-static.dir/H5Bdbg.c.o
  [  7%] Building C object src/CMakeFiles/hdf5-static.dir/H5Bcache.c.o
  [  7%] Building C object src/CMakeFiles/hdf5-static.dir/H5B2.c.o
  [  7%] Building C object src/CMakeFiles/hdf5-static.dir/H5B2cache.c.o
  [  8%] Building C object src/CMakeFiles/hdf5-static.dir/H5B2dbg.c.o
  [  8%] Building C object src/CMakeFiles/hdf5-static.dir/H5B2hdr.c.o
  [  8%] Building C object src/CMakeFiles/hdf5-static.dir/H5B2int.c.o
  [  9%] Building C object src/CMakeFiles/hdf5-static.dir/H5B2internal.c.o
  [  9%] Building C object src/CMakeFiles/hdf5-static.dir/H5B2leaf.c.o
  [  9%] Building C object src/CMakeFiles/hdf5-static.dir/H5B2stat.c.o
  [ 10%] Building C object src/CMakeFiles/hdf5-static.dir/H5B2test.c.o
  [ 10%] Building C object src/CMakeFiles/hdf5-static.dir/H5C.c.o
  [ 10%] Building C object src/CMakeFiles/hdf5-static.dir/H5Cdbg.c.o
  [ 11%] Building C object src/CMakeFiles/hdf5-static.dir/H5Cepoch.c.o
  [ 11%] Building C object src/CMakeFiles/hdf5-static.dir/H5Cimage.c.o
  [ 11%] Building C object src/CMakeFiles/hdf5-static.dir/H5Clog.c.o
  [ 12%] Building C object src/CMakeFiles/hdf5-static.dir/H5Clog_json.c.o
  [ 12%] Building C object src/CMakeFiles/hdf5-static.dir/H5Clog_trace.c.o
  [ 12%] Building C object src/CMakeFiles/hdf5-static.dir/H5Cmpio.c.o
  [ 12%] Building C object src/CMakeFiles/hdf5-static.dir/H5Cprefetched.c.o
  [ 13%] Building C object src/CMakeFiles/hdf5-static.dir/H5Cquery.c.o
  [ 13%] Building C object src/CMakeFiles/hdf5-static.dir/H5Ctag.c.o
  [ 13%] Building C object src/CMakeFiles/hdf5-static.dir/H5Ctest.c.o
  [ 14%] Building C object src/CMakeFiles/hdf5-static.dir/H5CS.c.o
  [ 14%] Building C object src/CMakeFiles/hdf5-static.dir/H5CX.c.o
  [ 14%] Building C object src/CMakeFiles/hdf5-static.dir/H5D.c.o
  [ 15%] Building C object src/CMakeFiles/hdf5-static.dir/H5Dbtree.c.o
  [ 15%] Building C object src/CMakeFiles/hdf5-static.dir/H5Dbtree2.c.o
  [ 15%] Building C object src/CMakeFiles/hdf5-static.dir/H5Dchunk.c.o
  [ 16%] Building C object src/CMakeFiles/hdf5-static.dir/H5Dcompact.c.o
  [ 16%] Building C object src/CMakeFiles/hdf5-static.dir/H5Dcontig.c.o
  [ 16%] Building C object src/CMakeFiles/hdf5-static.dir/H5Ddbg.c.o
  [ 16%] Building C object src/CMakeFiles/hdf5-static.dir/H5Ddeprec.c.o
  [ 17%] Building C object src/CMakeFiles/hdf5-static.dir/H5Dearray.c.o
  [ 17%] Building C object src/CMakeFiles/hdf5-static.dir/H5Defl.c.o
  [ 17%] Building C object src/CMakeFiles/hdf5-static.dir/H5Dfarray.c.o
  [ 18%] Building C object src/CMakeFiles/hdf5-static.dir/H5Dfill.c.o
  [ 18%] Building C object src/CMakeFiles/hdf5-static.dir/H5Dint.c.o
  [ 18%] Building C object src/CMakeFiles/hdf5-static.dir/H5Dio.c.o
  [ 19%] Building C object src/CMakeFiles/hdf5-static.dir/H5Dlayout.c.o
  [ 19%] Building C object src/CMakeFiles/hdf5-static.dir/H5Dmpio.c.o
  [ 19%] Building C object src/CMakeFiles/hdf5-static.dir/H5Dnone.c.o
  [ 20%] Building C object src/CMakeFiles/hdf5-static.dir/H5Doh.c.o
  [ 20%] Building C object src/CMakeFiles/hdf5-static.dir/H5Dscatgath.c.o
  [ 20%] Building C object src/CMakeFiles/hdf5-static.dir/H5Dselect.c.o
  [ 20%] Building C object src/CMakeFiles/hdf5-static.dir/H5Dsingle.c.o
  [ 21%] Building C object src/CMakeFiles/hdf5-static.dir/H5Dtest.c.o
  [ 21%] Building C object src/CMakeFiles/hdf5-static.dir/H5Dvirtual.c.o
  [ 21%] Building C object src/CMakeFiles/hdf5-static.dir/H5E.c.o
  [ 22%] Building C object src/CMakeFiles/hdf5-static.dir/H5Edeprec.c.o
  [ 22%] Building C object src/CMakeFiles/hdf5-static.dir/H5Eint.c.o
  [ 22%] Building C object src/CMakeFiles/hdf5-static.dir/H5EA.c.o
  [ 23%] Building C object src/CMakeFiles/hdf5-static.dir/H5EAcache.c.o
  [ 23%] Building C object src/CMakeFiles/hdf5-static.dir/H5EAdbg.c.o
  [ 23%] Building C object src/CMakeFiles/hdf5-static.dir/H5EAdblkpage.c.o
  [ 24%] Building C object src/CMakeFiles/hdf5-static.dir/H5EAdblock.c.o
  [ 24%] Building C object src/CMakeFiles/hdf5-static.dir/H5EAhdr.c.o
  [ 24%] Building C object src/CMakeFiles/hdf5-static.dir/H5EAiblock.c.o
  [ 25%] Building C object src/CMakeFiles/hdf5-static.dir/H5EAint.c.o
  [ 25%] Building C object src/CMakeFiles/hdf5-static.dir/H5EAsblock.c.o
  [ 25%] Building C object src/CMakeFiles/hdf5-static.dir/H5EAstat.c.o
  [ 25%] Building C object src/CMakeFiles/hdf5-static.dir/H5EAtest.c.o
  [ 26%] Building C object src/CMakeFiles/hdf5-static.dir/H5F.c.o
  [ 26%] Building C object src/CMakeFiles/hdf5-static.dir/H5Faccum.c.o
  [ 26%] Building C object src/CMakeFiles/hdf5-static.dir/H5Fcwfs.c.o
  [ 27%] Building C object src/CMakeFiles/hdf5-static.dir/H5Fdbg.c.o
  [ 27%] Building C object src/CMakeFiles/hdf5-static.dir/H5Fdeprec.c.o
  [ 27%] Building C object src/CMakeFiles/hdf5-static.dir/H5Fefc.c.o
  [ 28%] Building C object src/CMakeFiles/hdf5-static.dir/H5Ffake.c.o
  [ 28%] Building C object src/CMakeFiles/hdf5-static.dir/H5Fint.c.o
  [ 28%] Building C object src/CMakeFiles/hdf5-static.dir/H5Fio.c.o
  [ 29%] Building C object src/CMakeFiles/hdf5-static.dir/H5Fmount.c.o
  [ 29%] Building C object src/CMakeFiles/hdf5-static.dir/H5Fmpi.c.o
  [ 29%] Building C object src/CMakeFiles/hdf5-static.dir/H5Fquery.c.o
  [ 29%] Building C object src/CMakeFiles/hdf5-static.dir/H5Fsfile.c.o
  [ 30%] Building C object src/CMakeFiles/hdf5-static.dir/H5Fspace.c.o
  [ 30%] Building C object src/CMakeFiles/hdf5-static.dir/H5Fsuper.c.o
  [ 30%] Building C object src/CMakeFiles/hdf5-static.dir/H5Fsuper_cache.c.o
  [ 31%] Building C object src/CMakeFiles/hdf5-static.dir/H5Ftest.c.o
  [ 31%] Building C object src/CMakeFiles/hdf5-static.dir/H5FA.c.o
  [ 31%] Building C object src/CMakeFiles/hdf5-static.dir/H5FAcache.c.o
  [ 32%] Building C object src/CMakeFiles/hdf5-static.dir/H5FAdbg.c.o
  [ 32%] Building C object src/CMakeFiles/hdf5-static.dir/H5FAdblkpage.c.o
  [ 32%] Building C object src/CMakeFiles/hdf5-static.dir/H5FAdblock.c.o
  [ 33%] Building C object src/CMakeFiles/hdf5-static.dir/H5FAhdr.c.o
  [ 33%] Building C object src/CMakeFiles/hdf5-static.dir/H5FAint.c.o
  [ 33%] Building C object src/CMakeFiles/hdf5-static.dir/H5FAstat.c.o
  [ 33%] Building C object src/CMakeFiles/hdf5-static.dir/H5FAtest.c.o
  [ 34%] Building C object src/CMakeFiles/hdf5-static.dir/H5FD.c.o

  --- stderr
  Can't open perl script "/Users/aaron/.cargo/registry/src/github.com-1ecc6299db9ec823/hdf5-src-0.7.1/ext/hdf5/bin/make_err": No such file or directory
  Can't open perl script "/Users/aaron/.cargo/registry/src/github.com-1ecc6299db9ec823/hdf5-src-0.7.1/ext/hdf5/bin/make_vers": No such file or directory
  Can't open perl script "/Users/aaron/.cargo/registry/src/github.com-1ecc6299db9ec823/hdf5-src-0.7.1/ext/hdf5/bin/make_overflow": No such file or directory
  CMake Warning:
    Manually-specified variables were not used by the project:

      CMAKE_ASM_COMPILER
      CMAKE_ASM_FLAGS


  /Users/aaron/.cargo/registry/src/github.com-1ecc6299db9ec823/hdf5-src-0.7.1/ext/hdf5/src/H5Aint.c:200:45: warning: passing 'const H5T_t *' (aka 'const struct H5T_t *') to parameter of type 'H5T_t *' (aka 'struct H5T_t *') discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
      if(NULL == (attr->shared->dt = H5T_copy(type, H5T_COPY_ALL)))
                                              ^~~~
  /Users/aaron/.cargo/registry/src/github.com-1ecc6299db9ec823/hdf5-src-0.7.1/ext/hdf5/src/H5Tprivate.h:108:31: note: passing argument to parameter 'old_dt' here
  H5_DLL H5T_t *H5T_copy(H5T_t *old_dt, H5T_copy_t method);
                                ^
  /Users/aaron/.cargo/registry/src/github.com-1ecc6299db9ec823/hdf5-src-0.7.1/ext/hdf5/src/H5Adense.c:331:16: warning: initializing 'H5A_t *' (aka 'struct H5A_t *') with an expression of type 'const H5A_t *' (aka 'const struct H5A_t *') discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
          H5A_t *old_attr = *user_attr;
                 ^          ~~~~~~~~~~
  /Users/aaron/.cargo/registry/src/github.com-1ecc6299db9ec823/hdf5-src-0.7.1/ext/hdf5/src/H5Aint.c:638:71: warning: passing 'const H5T_t *' (aka 'const struct H5T_t *') to parameter of type 'H5T_t *' (aka 'struct H5T_t *') discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
                          (dst_id = H5I_register(H5I_DATATYPE, H5T_copy(mem_type, H5T_COPY_ALL), FALSE)) < 0)
                                                                        ^~~~~~~~
  /Users/aaron/.cargo/registry/src/github.com-1ecc6299db9ec823/hdf5-src-0.7.1/ext/hdf5/src/H5Tprivate.h:108:31: note: passing argument to parameter 'old_dt' here
  H5_DLL H5T_t *H5T_copy(H5T_t *old_dt, H5T_copy_t method);
                                ^
  /Users/aaron/.cargo/registry/src/github.com-1ecc6299db9ec823/hdf5-src-0.7.1/ext/hdf5/src/H5Aint.c:738:62: warning: passing 'const H5T_t *' (aka 'const struct H5T_t *') to parameter of type 'H5T_t *' (aka 'struct H5T_t *') discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
              if((src_id = H5I_register(H5I_DATATYPE, H5T_copy(mem_type, H5T_COPY_ALL), FALSE)) < 0 ||
                                                               ^~~~~~~~
  /Users/aaron/.cargo/registry/src/github.com-1ecc6299db9ec823/hdf5-src-0.7.1/ext/hdf5/src/H5Tprivate.h:108:31: note: passing argument to parameter 'old_dt' here
  H5_DLL H5T_t *H5T_copy(H5T_t *old_dt, H5T_copy_t method);
                                ^
  1 warning generated.
  3 warnings generated.
  /Users/aaron/.cargo/registry/src/github.com-1ecc6299db9ec823/hdf5-src-0.7.1/ext/hdf5/src/H5Dfill.c:239:62: warning: passing 'const H5T_t *' (aka 'const struct H5T_t *') to parameter of type 'H5T_t *' (aka 'struct H5T_t *') discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
              if((src_id = H5I_register(H5I_DATATYPE, H5T_copy(fill_type, H5T_COPY_ALL), FALSE)) < 0)
                                                               ^~~~~~~~~
  /Users/aaron/.cargo/registry/src/github.com-1ecc6299db9ec823/hdf5-src-0.7.1/ext/hdf5/src/H5Tprivate.h:108:31: note: passing argument to parameter 'old_dt' here
  H5_DLL H5T_t *H5T_copy(H5T_t *old_dt, H5T_copy_t method);
                                ^
  /Users/aaron/.cargo/registry/src/github.com-1ecc6299db9ec823/hdf5-src-0.7.1/ext/hdf5/src/H5Dfill.c:242:62: warning: passing 'const H5T_t *' (aka 'const struct H5T_t *') to parameter of type 'H5T_t *' (aka 'struct H5T_t *') discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
              if((dst_id = H5I_register(H5I_DATATYPE, H5T_copy(buf_type, H5T_COPY_ALL), FALSE)) < 0)
                                                               ^~~~~~~~
  /Users/aaron/.cargo/registry/src/github.com-1ecc6299db9ec823/hdf5-src-0.7.1/ext/hdf5/src/H5Tprivate.h:108:31: note: passing argument to parameter 'old_dt' here
  H5_DLL H5T_t *H5T_copy(H5T_t *old_dt, H5T_copy_t method);
                                ^
  /Users/aaron/.cargo/registry/src/github.com-1ecc6299db9ec823/hdf5-src-0.7.1/ext/hdf5/src/H5Dfill.c:408:54: warning: passing 'const H5T_t *' (aka 'const struct H5T_t *') to parameter of type 'H5T_t *' (aka 'struct H5T_t *') discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
              if(NULL == (fb_info->mem_type = H5T_copy(dset_type, H5T_COPY_TRANSIENT)))
                                                       ^~~~~~~~~
  /Users/aaron/.cargo/registry/src/github.com-1ecc6299db9ec823/hdf5-src-0.7.1/ext/hdf5/src/H5Tprivate.h:108:31: note: passing argument to parameter 'old_dt' here
  H5_DLL H5T_t *H5T_copy(H5T_t *old_dt, H5T_copy_t method);
                                ^
  3 warnings generated.
  /Users/aaron/.cargo/registry/src/github.com-1ecc6299db9ec823/hdf5-src-0.7.1/ext/hdf5/src/H5Dint.c:534:43: warning: passing 'const H5T_t *' (aka 'const struct H5T_t *') to parameter of type 'H5T_t *' (aka 'struct H5T_t *') discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
          if((dset->shared->type = H5T_copy(type, H5T_COPY_ALL)) == NULL)
                                            ^~~~
  /Users/aaron/.cargo/registry/src/github.com-1ecc6299db9ec823/hdf5-src-0.7.1/ext/hdf5/src/H5Tprivate.h:108:31: note: passing argument to parameter 'old_dt' here
  H5_DLL H5T_t *H5T_copy(H5T_t *old_dt, H5T_copy_t method);
                                ^
  /Users/aaron/.cargo/registry/src/github.com-1ecc6299db9ec823/hdf5-src-0.7.1/ext/hdf5/src/H5Dchunk.c:5830:95: warning: passing 'const hsize_t *' (aka 'const unsigned long long *') to parameter of type 'hsize_t *' (aka 'unsigned long long *') discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
      if(H5D__chunk_file_alloc(udata->idx_info_dst, NULL, &udata_dst.chunk_block, &need_insert, udata_dst.common.scaled) < 0)
                                                                                                ^~~~~~~~~~~~~~~~~~~~~~~
  /Users/aaron/.cargo/registry/src/github.com-1ecc6299db9ec823/hdf5-src-0.7.1/ext/hdf5/src/H5Dpkg.h:656:59: note: passing argument to parameter 'scaled' here
      H5F_block_t *new_chunk, hbool_t *need_insert, hsize_t scaled[]);
                                                            ^
  /Users/aaron/.cargo/registry/src/github.com-1ecc6299db9ec823/hdf5-src-0.7.1/ext/hdf5/src/H5Dchunk.c:5967:39: warning: passing 'const H5T_t *' (aka 'const struct H5T_t *') to parameter of type 'H5T_t *' (aka 'struct H5T_t *') discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
          if(NULL == (dt_mem = H5T_copy(dt_src, H5T_COPY_TRANSIENT)))
                                        ^~~~~~
  /Users/aaron/.cargo/registry/src/github.com-1ecc6299db9ec823/hdf5-src-0.7.1/ext/hdf5/src/H5Tprivate.h:108:31: note: passing argument to parameter 'old_dt' here
  H5_DLL H5T_t *H5T_copy(H5T_t *old_dt, H5T_copy_t method);
                                ^
  /Users/aaron/.cargo/registry/src/github.com-1ecc6299db9ec823/hdf5-src-0.7.1/ext/hdf5/src/H5Dchunk.c:5975:39: warning: passing 'const H5T_t *' (aka 'const struct H5T_t *') to parameter of type 'H5T_t *' (aka 'struct H5T_t *') discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
          if(NULL == (dt_dst = H5T_copy(dt_src, H5T_COPY_TRANSIENT)))
                                        ^~~~~~
  /Users/aaron/.cargo/registry/src/github.com-1ecc6299db9ec823/hdf5-src-0.7.1/ext/hdf5/src/H5Tprivate.h:108:31: note: passing argument to parameter 'old_dt' here
  H5_DLL H5T_t *H5T_copy(H5T_t *old_dt, H5T_copy_t method);
                                ^
  1 warning generated.
  3 warnings generated.
  /Users/aaron/.cargo/registry/src/github.com-1ecc6299db9ec823/hdf5-src-0.7.1/ext/hdf5/src/H5Fsuper.c:1397:16: error: implicit declaration of function 'H5O__fsinfo_set_version' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
              if(H5O__fsinfo_set_version(f, &fsinfo) < 0)
                 ^
  1 error generated.
  make[2]: *** [src/CMakeFiles/hdf5-static.dir/H5Fsuper.c.o] Error 1
  make[2]: *** Waiting for unfinished jobs....
  make[1]: *** [src/CMakeFiles/hdf5-static.dir/all] Error 2
  make: *** [all] Error 2
  thread 'main' panicked at '
  command did not execute successfully, got: exit status: 2

  build script failed, must exit now', /Users/aaron/.cargo/registry/src/github.com-1ecc6299db9ec823/cmake-0.1.45/src/lib.rs:894:5
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

It seems like, that there is something missing from the git submodule located here: https://github.com/aldanor/hdf5-rust/tree/master/hdf5-src/ext

Excerpt from error logs:

  Can't open perl script "/Users/aaron/.cargo/registry/src/github.com-1ecc6299db9ec823/hdf5-src-0.7.1/ext/hdf5/bin/make_err": No such file or directory
  Can't open perl script "/Users/aaron/.cargo/registry/src/github.com-1ecc6299db9ec823/hdf5-src-0.7.1/ext/hdf5/bin/make_vers": No such file or directory
  Can't open perl script "/Users/aaron/.cargo/registry/src/github.com-1ecc6299db9ec823/hdf5-src-0.7.1/ext/hdf5/bin/make_overflow": No such file or directory

Temporary Fix

When I download the content of the referenced hdf5 version ( hdf5 db30c2d ) manually and replace all content in ~/.cargo/registry/src/github.com-1ecc6299db9ec823/hdf5-src-0.7.1/ext/hdf5 it builds successfully.


System Information

I am using: rustc 1.53.0 (53cb7b09b 2021-06-17),
but I also tried with: 1.52-x86_64-apple-darwin toolchain and 1.50-x86_64-apple-darwin toolchain.

@zingi zingi changed the title Using feature 'static' is broken Using feature 'static' seems broken Jul 13, 2021
@zingi
Copy link
Author

zingi commented Jul 13, 2021

CleanShot 2021-07-13 at 15 55 17

left: content of ~/.cargo/registry/src/github.com-1ecc6299db9ec823/hdf5-src-0.7.1/ext/hdf5
right: content of manually downloaded hdf5 db30c2d

@mulimoen
Copy link
Collaborator

Seems my exclude directives where a bit too much. I will make a PR to include these files. Thanks for the detailed explanation!

@zingi
Copy link
Author

zingi commented Jul 14, 2021

@mulimoen It seems like that the missing files are only required on macOS for successful building.
On linux the problem does not occur.

@mulimoen
Copy link
Collaborator

@zingi It is a bit strange that this fails for you, the CI on georust/netcdf is trying to test a static build. Do you have a unique setup we should integrate into our CI?

@zingi
Copy link
Author

zingi commented Jul 14, 2021

I don't have any special setup. I was just starting a project:

# Cargo.toml

[dependencies]
netcdf = {  version = "0.6.1", features = ["static"] }
// main.rs

use std::path::Path;

fn main() {
    let nc = netcdf::open(Path::new("/path/to/a/file.nc")).unwrap();
    println!("{:?}", nc);
}
  • On macOS this code does not compile without the manual fix.
  • On linux/PopOS/Ubuntu it does compile without problems.

@mulimoen mulimoen mentioned this issue Jul 15, 2021
@aldanor aldanor mentioned this issue Oct 23, 2021
@aldanor
Copy link
Owner

aldanor commented Oct 23, 2021

Closed in #179

@aldanor aldanor closed this as completed Oct 23, 2021
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 a pull request may close this issue.

3 participants