Skip to content

Installation issue: netcdf-c build_system=cmake libtirpc issue #5738

Description

@payerle

Steps to reproduce the issue

I am running into errors when linking shared libs during the build of netcdf-d:

I am trying to build

$ spack --env tptest find -lvfdcI netcdf-c
...
-- linux-rhel8-zen2 / %c,cxx=gcc@13.4.0 -------------------------
 -   i2n3vrs netcdf-c@4.10.0+blosc+byterange+dap~fsync+hdf4+ipo~jna~logging~mpi+nczarr_zip+optimize~parallel-netcdf+pic+shared+szip+zstd build_system=cmake build_type=RelWithDebInfo generator=make patches:=9a22f9f
[+]  clcmbca     bzip2@1.0.8~debug+pic+shared build_system=generic
[+]  aveg6xi         diffutils@3.12 build_system=autotools
[+]  g5qgddj     c-blosc@1.21.6+avx2+ipo build_system=cmake build_type=RelWithDebInfo generator=make
[+]  rv4gmuf         lz4@1.10.0+pic build_system=makefile libs:=shared,static
[+]  utuggfs         snappy@1.2.2+ipo+pic+shared build_system=cmake build_type=RelWithDebInfo generator=make
[+]  komdk4j     cmake@3.31.9~doc+ncurses+ownlibs~qtgui build_system=generic build_type=RelWithDebInfo
[+]  4fr2zga         ncurses@6.5-20250705+symlinks+termlib abi=5 build_system=autotools patches:=7a351bc
[+]  c4lvqa5     compiler-wrapper@1.0 build_system=generic
[+]  5iwsjnc     curl@8.15.0+gssapi~ldap+libidn2~librtmp~libssh+libssh2+nghttp2 build_system=autotools libs:=shared,static tls:=mbedtls,openssl
[+]  vjvgdcm         krb5@1.21.3+shared build_system=autotools
[+]  rcuuwdi             findutils@4.10.0 build_system=autotools patches:=440b954
[+]  un24op4             gettext@0.23.1+bzip2+curses+git+libunistring+libxml2+pic+shared+tar+xz build_system=autotools
[+]  ac3qlxk                 tar@1.35 build_system=autotools zip=pigz
[+]  xdqbnzg                     pigz@2.8 build_system=makefile
[+]  p2qbo6v             libedit@3.1-20240808 build_system=autotools
[+]  cwtascr         libidn2@2.3.7 build_system=autotools
[+]  2xh2w6v             libunistring@1.2 build_system=autotools
[+]  34m2usx         libssh2@1.11.1+shared build_system=autotools crypto=mbedtls
[+]  yjg7uxr         mbedtls@2.28.9+pic build_system=makefile build_type=RelWithDebInfo libs:=shared,static
[+]  wgsyfrl         nghttp2@1.67.1 build_system=autotools
[+]  yfj7zom         openssl@3.6.0~docs+shared build_system=generic certs=system
[+]  zgiqg7h         perl@5.42.0+cpanm+opcode+open+shared+threads build_system=generic
[+]  kddwxvy             berkeley-db@18.1.40+cxx+docs+stl build_system=autotools patches:=26090f4
[+]  x7mvisw             gdbm@1.25 build_system=autotools               
[+]  xnkg5zv                 readline@8.3 build_system=autotools patches:=21f0a03
[+]  hn2krca         pkgconf@2.5.1 build_system=autotools               
[e]  lxilqo6     gcc@13.4.0+binutils~bootstrap+graphite~mold+nvptx~piclibs~strip build_system=autotools build_type=RelWithDebInfo languages:='c,c++,fortran,lto'
[+]  6veby57     gcc-runtime@13.4.0 build_system=generic                
[e]  wklw66w     glibc@2.28 build_system=autotools                      
[+]  qphn4tr     gmake@4.4.1~guile build_system=generic         
[+]  6ksw2wj     hdf@4.2.15+external-xdr+fortran~java~netcdf+pic~shared+szip build_system=autotools patches:=49733dd,5434f29,ce75518,d54592d,f7d67e8
[+]  l22ndgk         bison@3.8.2~color build_system=autotools           
[+]  xenirt3         flex@2.6.3+lex+nls build_system=autotools          
[+]  fot2yxz         libjpeg-turbo@3.0.4+ipo~jpeg8+partial_decoder+pic build_system=cmake build_type=RelWithDebInfo generator=make libs:=shared,static
[+]  5nwi3ut             nasm@2.16.03 build_system=autotools            
[+]  fhp65oj         libtirpc@1.3.7 build_system=autotools              
[+]  hskdshe     hdf5@1.14.6+cxx+fortran+hl+ipo~java+map~mpi+shared+szip+threadsafe+tools api=default build_system=cmake build_type=RelWithDebInfo cxxstd=20 generator=make
[+]  sbum7al     libszip@2.1.1 build_system=autotools                   
[+]  ji2noye     libxml2@2.13.5+http+pic~python+shared build_system=autotools
[+]  xfwlwc5         libiconv@1.18 build_system=autotools libs:=shared,static
[+]  dozx2ei         xz@5.6.3+pic build_system=autotools libs:=shared,static
[+]  hyk75n4     libzip@1.11.1+bzip2+gnutls+ipo+lzma+mbedtls+openssl+zstd build_system=cmake build_type=RelWithDebInfo generator=make
[+]  bfb6qp6         gnutls@3.8.10+brotli+zlib+zstd build_system=autotools
[+]  dlxzxvs             brotli@1.1.0+ipo build_system=cmake build_type=RelWithDebInfo generator=make
[+]  v2bnibg             libtool@2.4.7 build_system=autotools
[+]  ijuhboi             nettle@3.9.1 build_system=autotools            
[+]  zfpfw4w                 gmp@6.3.0+cxx build_system=autotools libs:=shared,static
[+]  gbt55l4                     autoconf@2.72 build_system=autotools   
[+]  spxl244                     automake@1.16.5 build_system=autotools
[+]  mnsmyjc         lzma@4.32.7 build_system=autotools                 
[+]  dp2hpm5     m4@1.4.20+sigsegv build_system=autotools
[+]  okijcpw         libsigsegv@2.14 build_system=autotools             
[+]  yyfhywn     zlib@1.3.1+optimize+pic+shared build_system=makefile   
[+]  pi6zcmw     zstd@1.5.7+programs build_system=makefile compression:=lz4,lzma,zlib libs:=shared,static

The error occurs during "spack --env tptest install netcdf-c"

Error message

Error message
...
[ 28%] Linking C shared module lib__nch5misc.so
cd /tmp/swinst26/spackswinst26/spack-stage/spack-stage-netcdf-c-4.10.0-i2n3vrsaeh3bffbftc7frsotlmuapifk/spack-build-i2n3vrs/plugins && /cvmfs/hpcsw.umd.edu/spack-software/2025.11.0/linux-zen2/cmake-3.31.9-komdk4j32w3idkgb7kfgeygrkageyxtl/bin/cmake -E cmake_link_script CMakeFiles/h5misc.dir/link.txt --verbose=1
/cvmfs/hpcsw.umd.edu/binutils/2.44/rhel8-x86_64/bin/ld: ../libnetcdf.so.22: undefined reference to `xdr_float'
/cvmfs/hpcsw.umd.edu/binutils/2.44/rhel8-x86_64/bin/ld: ../libnetcdf.so.22: undefined reference to `xdr_double'
/cvmfs/hpcsw.umd.edu/binutils/2.44/rhel8-x86_64/bin/ld: ../libnetcdf.so.22: undefined reference to `xdr_enum'
/cvmfs/hpcsw.umd.edu/binutils/2.44/rhel8-x86_64/bin/ld: ../libnetcdf.so.22: undefined reference to `xdr_opaque'
/cvmfs/hpcsw.umd.edu/binutils/2.44/rhel8-x86_64/bin/ld: ../libnetcdf.so.22: undefined reference to `xdr_u_long'
/cvmfs/hpcsw.umd.edu/binutils/2.44/rhel8-x86_64/bin/ld: ../libnetcdf.so.22: undefined reference to `xdr_long'
/cvmfs/hpcsw.umd.edu/binutils/2.44/rhel8-x86_64/bin/ld: ../libnetcdf.so.22: undefined reference to `xdr_bytes'
/cvmfs/hpcsw.umd.edu/binutils/2.44/rhel8-x86_64/bin/ld: ../libnetcdf.so.22: undefined reference to `xdr_int'
collect2: error: ld returned 1 exit status
/cvmfs/hpcsw.umd.edu/spack-software/2025.11.0/linux-zen2/compiler-wrapper-1.0-c4lvqa5ekdyxfibdcfh6hfepzpfknhp5/libexec/spack/gcc/gcc  -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -O2 -g -DNDEBUG -flto=auto -fno-fat-lto-objects -Wl,--dependency-file=CMakeFiles/ncrandom.dir/link.d CMakeFiles/ncrandom.dir/ncrandom.c.o -o ncrandom  -Wl,-rpath,/tmp/swinst26/spackswinst26/spack-stage/spack-stage-netcdf-c-4.10.0-i2n3vrsaeh3bffbftc7frsotlmuapifk/spack-build-i2n3vrs ../libnetcdf.so.22make[2]: *** [libdispatch/CMakeFiles/ncrandom.dir/build.make:105: libdispatch/ncrandom] Error 1
make[2]: Leaving directory '/tmp/swinst26/spackswinst26/spack-stage/spack-stage-netcdf-c-4.10.0-i2n3vrsaeh3bffbftc7frsotlmuapifk/spack-build-i2n3vrs'
make[1]: *** [CMakeFiles/Makefile2:2799: libdispatch/CMakeFiles/ncrandom.dir/all] Error 2
...

Information on your system

 spack debug report
* **Spack:** 1.2.0.dev0
* **Builtin repo:** https://github.com/spack/spack-packages/commit/119680aeee8ea802c6111b7167583bddef97e82f
* **Python:** 3.6.8
* **Platform:** linux-rhel8-zen2

Additional information

Files:

Maintainers:

The error appears to be related to the move of various XDR related frunctions from glib to libtirpc. There looks to be an existing hack in the netcdf-c recipe for this in AutotoolsBuilder, but no such hacks in CMakeBuilder. I see a FindXDR.cmake file in the netcdf-c sources, but I do not see it referenced in dependencies.cmake.

General information

  • I have run spack debug report and reported the version of Spack/Python/Platform
  • I have run spack maintainers <name-of-the-package> and @mentioned any maintainers
  • I have uploaded the build log and environment files
  • I have searched the issues of this repo and believe this is not a duplicate

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions