Opened 5 years ago

Closed 5 years ago

#58270 closed defect (fixed)

netcdf @4.7.0 +dap +mpich +netcdf4 +universal: nc-config differs and cannot be merged

Reported by: ryandesign (Ryan Carsten Schmidt) Owned by: tenomoto (Takeshi Enomoto)
Priority: Normal Milestone:
Component: ports Version:
Keywords: Cc: Dave-Allured (Dave Allured)
Port: netcdf

Description

netcdf doesn't build with the universal variant:

--->  Computing dependencies for netcdf
--->  Fetching archive for netcdf
--->  Attempting to fetch netcdf-4.6.3_0+dap+mpich+netcdf4+universal.darwin_17.i386-x86_64.tbz2 from https://packages.macports.org/netcdf
--->  Attempting to fetch netcdf-4.6.3_0+dap+mpich+netcdf4+universal.darwin_17.i386-x86_64.tbz2 from http://packages.internal.macports.net/:tbz2     http://packages-private.internal.macports.net/netcdf
--->  Attempting to fetch netcdf-4.6.3_0+dap+mpich+netcdf4+universal.darwin_17.i386-x86_64.tbz2 from http://packages.internal.macports.net/netcdf
--->  Fetching distfiles for netcdf
--->  Attempting to fetch netcdf-c-4.6.3.tar.gz from https://distfiles.macports.org/netcdf
--->  Verifying checksums for netcdf
--->  Extracting netcdf
--->  Applying patches to netcdf
--->  Configuring netcdf
--->  Building netcdf
--->  Staging netcdf into destroot
Error: Failed to destroot netcdf: nc-config differs in /opt/local/var/macports/build/_Users_rschmidt_macports_macports-ports-ryandesign-fork_science_netcdf/netcdf/work/destroot-i386//opt/local/bin and /opt/local/var/macports/build/_Users_rschmidt_macports_macports-ports-ryandesign-fork_science_netcdf/netcdf/work/destroot-x86_64//opt/local/bin and cannot be merged
Error: See /opt/local/var/macports/logs/_Users_rschmidt_macports_macports-ports-ryandesign-fork_science_netcdf/netcdf/main.log for details.

The difference between the two nc-config files is:

$ diff -u build-i386/tmp/nc-config build-x86_64/tmp/nc-config
--- build-i386/tmp/nc-config	2019-03-29 13:43:48.000000000 -0500
+++ build-x86_64/tmp/nc-config	2019-03-29 13:43:00.000000000 -0500
@@ -78,7 +78,7 @@
     has_szlib="yes"
 fi

-has_cdf5="OFF"
+has_cdf5="AUTO"
 if [ -z "$has_cdf5" -o "$has_cdf5" = "OFF" -o "$has_cdf5" = "FALSE" ]; then
     has_cdf5="no"
 else

Attachments (1)

main.log.bz2 (49.3 KB) - added by ryandesign (Ryan Carsten Schmidt) 5 years ago.

Download all attachments as: .zip

Change History (7)

Changed 5 years ago by ryandesign (Ryan Carsten Schmidt)

Attachment: main.log.bz2 added

comment:1 Changed 5 years ago by Dave-Allured (Dave Allured)

Cc: Dave-Allured added

comment:2 Changed 5 years ago by ryandesign (Ryan Carsten Schmidt)

This problem still happens.

Configure output from the x86_64 part says:

:info:configure CDF5 Support:		yes

Configure output from the i386 part says:

:info:configure CDF5 Support:		no

I happen to have the cdf @3.6.4_0 port installed, but not with the universal variant. (It doesn't have one.) And the default value of netcdf's cmake flag -DENABLE_CDF5 is AUTO, so the x86_64 build of netcdf is opportunistically detecting cdf and using it, while the i386 build of netcdf doesn't find cdf but continues on without it.

In fact, netcdf's cmake files will only let you use cdf on 64-bit. If you try to use it on 32-bit, you get the error:

CMake Error at CMakeLists.txt:1341 (MESSAGE):
  Unable to support CDF5 feature because size_t is less than 8 bytes

So you have a decision:

  1. If you want netcdf to use cdf, you should add a dependency on cdf and use -DENABLE_CDF5=ON and increase the revision. Since this will only work on 64-bit, you would need to also set supported_archs x86_64 ppc64 to exclude 32-bit architectures. Since there's more than one architecture MacPorts would still allow a universal variant, but it would be useless since that's not a set of architectures for which anybody is trying to build universal (people either build for i386 ppc on older systems or for i386 x86_64 on newer systems) so you'll probably want to delete the universal variant too, by setting universal_variant no and removing the inclusion of the muniversal portgroup and everything relaterd to it. And every port that depends on netcdf, and every port that depends on those ports, and so on, would need to remove its universal variant too.
  2. Or, if you want netcdf not to use cdf, you should use -DENABLE_CDF5=OFF and increase the revision, and then it can keep its universal variant and 32-bit support.

comment:3 Changed 5 years ago by ryandesign (Ryan Carsten Schmidt)

  1. Or you could compromise: If cdf support is useful but you don't want to lose the universal variant or 32-bit support, you could enable cdf support only for 64-bit non-universal builds and disable it for other builds.
Last edited 5 years ago by ryandesign (Ryan Carsten Schmidt) (previous) (diff)

comment:4 Changed 5 years ago by ryandesign (Ryan Carsten Schmidt)

I was wrong about some of the specifics. The cdf port appears not to be involved after all: I deactivated the cdf port but I was still unable to build netcdf universal. Even using trace mode did not change the error. But using -DENABLE_CDF5=OFF did work.

comment:5 Changed 5 years ago by ryandesign (Ryan Carsten Schmidt)

Summary: netcdf @4.6.3 +dap +mpich +netcdf4 +universal: nc-config differs and cannot be mergednetcdf @4.7.0 +dap +mpich +netcdf4 +universal: nc-config differs and cannot be merged

Problem remains with 4.7.0.

comment:6 Changed 5 years ago by tenomoto (Takeshi Enomoto)

Resolution: fixed
Status: assignedclosed

In 5df8eab66798724b90b5f3a469db62a37730ce3a/macports-ports (master):

ncarg: fix build +universal

Closes: #58270

Note: See TracTickets for help on using tickets.