Opened 16 years ago

Closed 15 years ago

#16262 closed update (fixed)

netcdf update 3.6.2 -> 4.0

Reported by: mamoll (Mark Moll) Owned by: macports-tickets@…
Priority: Normal Milestone:
Component: ports Version: 1.6.0
Keywords: Cc: mamoll (Mark Moll), mf2k (Frank Schima), MarcusCalhoun-Lopez (Marcus Calhoun-Lopez), alakazam@…
Port: netcdf

Description

Patched Portfile for netcdf upgrade

Attachments (2)

patch-Portfile.diff (1005 bytes) - added by mamoll (Mark Moll) 15 years ago.
build.log (105.7 KB) - added by mamoll (Mark Moll) 15 years ago.

Download all attachments as: .zip

Change History (34)

comment:1 Changed 16 years ago by mf2k (Frank Schima)

Owner: changed from fulton@… to macsforever2000@…
Status: newassigned

Maintainer timeout.

comment:2 Changed 16 years ago by mf2k (Frank Schima)

Port: netcdf added
Resolution: fixed
Status: assignedclosed

I tried to run this patch, but i see the following error:

checking for H5DSis_scale in -lhdf5_hl... no
configure: error: Can't find the hdf5 high-level library. The high-level library is required for netCDF-4.

This may be an issue with the hdf5 port.

I also saw this problem:

checking for H5Fflush in -lhdf5... yes
configure: error: Can't find the hdf5 header and/or library, or can't link a program       to it. HDF5 must be built with zlib; the location of zlib must be specified for netCDF-4 with the       --with-zlib option. If HDF5 was also built with szlib, then the location of szlib must also be       specified with the --with-slib option.

For now, i commented out the configure options that you added and just did the version upgrade in r40691. Please submit a modified port if you can get those options to work. Thanks!

comment:3 Changed 16 years ago by mamoll (Mark Moll)

My Portfile patch assumed that hdf5 would also be upgraded to the latest version. I submitted a Portfile patch for hdf5 as well, but the patch has been rejected by the maintainer: http://trac.macports.org/ticket/16263. Athough hdf5 has no dependencies in macports, the api is apparently not compatible between 1.6 (the Macports version) and 1.8 (the latest release).

comment:4 Changed 16 years ago by dweber@…

Resolution: fixed
Status: closedreopened

Can I get a copy of your hdf5 Portfile (not a patch)?

How come you removed the depends_lib from the netcdf Portfile - it still depends on hdf5(-18), right?

I get the following issue with netcdf (maybe it's related to this ticket?):

[ dweber@weber-mbp ~/ports ]$ sudo port upgrade outdated
--->  Activating mysql5 5.0.67_0+server
Error: Activating mysql5 5.0.67_0 failed: Image error: mysql5 @5.0.67_0+server is already active.
--->  Building netcdf with target all
Error: Target org.macports.build returned: shell command " cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_science_netcdf/work/netcdf-4.0" && make all " returned error 2
Command output:       ___netcdf__nf90_put_var_3d_eightbyteint in netcdf.o
      ___netcdf__nf90_put_var_4d_eightbyteint in netcdf.o
      ___netcdf__nf90_put_var_5d_eightbyteint in netcdf.o
      ___netcdf__nf90_put_var_6d_eightbyteint in netcdf.o
      ___netcdf__nf90_put_var_7d_eightbyteint in netcdf.o
  "_nc_get_att_schar", referenced from:
      _nf_get_att_int1__ in fort-attio.o
      _ncagt_ in fort-v2compat.o
  "_nc_inq_att", referenced from:
      _nf_inq_att__ in fort-genatt.o
  "_nc_inq_dim", referenced from:
      _nf_inq_dim__ in fort-dim.o
  "_nc_put_vars_double", referenced from:
      _nf_put_vars_double__ in fort-varsio.o
  "_nf_open_", referenced from:
      ___netcdf__nf90_open in netcdf.o
  "_nc_close", referenced from:
      _nf_close__ in fort-control.o
  "_nc_inq_atttype", referenced from:
      _nf_inq_atttype__ in fort-genatt.o
      _ncagt_ in fort-v2compat.o
      _ncagtc_ in fort-v2compat.o
  "_nf_inq_attname_", referenced from:
      ___netcdf__nf90_inq_attname in netcdf.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
make[3]: *** [libnetcdff.la] Error 1
make[2]: *** [all] Error 2
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2

Error: Unable to upgrade port: 1

comment:5 Changed 16 years ago by mamoll (Mark Moll)

The hdf5 Portfile has been attached to http://trac.macports.org/ticket/16263. With that Portfile the original patch to netcdf I have attached here should work. Since the hdf5 maintainer doesn't want to switch to hdf5 1.8, macsforever2000@… had to disable some configure flags to get things to compile.

comment:6 Changed 15 years ago by mf2k (Frank Schima)

hdf5-18 added in r42213. I'll try to fix this soon.

comment:7 Changed 15 years ago by mamoll (Mark Moll)

Since I enabled mpi support by default for hdf5-18, you'll need to use openmpicc as your C compiler (likewise for C++ and Fortran).

comment:8 Changed 15 years ago by mf2k (Frank Schima)

Owner: changed from macsforever2000@… to macports-tickets@…
Status: reopenednew

I just realized I have py25-tables installed with requires "hdf5". Since I really need that running now I cannot install hdf5-18 for now. I may not be able to fix this anytime soon.

comment:9 Changed 15 years ago by mf2k (Frank Schima)

Cc: macsforever2000@… added

Cc Me!

comment:10 Changed 15 years ago by mamoll (Mark Moll)

It seems that py25-tables compiles just fine if I change the hdf5 dependency to hdf5-18 and remove the py25-scientific dependency. I don't know how to test if it actually works correctly.

comment:11 Changed 15 years ago by mf2k (Frank Schima)

It's open maintainer, so go ahead and commit it. I'll be able to test it.

comment:12 Changed 15 years ago by mf2k (Frank Schima)

Well I just tested py25-tables with hdf5-18 and it is not working for me. Let's please keep py25-tables using the "hdf5" port for now.

comment:13 Changed 15 years ago by MarcusCalhoun-Lopez (Marcus Calhoun-Lopez)

Cc: mcalhoun@… added

Cc Me!

comment:14 Changed 15 years ago by mf2k (Frank Schima)

Update: py25-tables now uses hdf5-18 but I'm still unable to configure netcdf 4 with the --with-hdf5 flag.

checking for H5Fflush in -lhdf5... no
configure: error: Can't find the hdf5 header and/or library, or can't link a program       to it. HDF5 must be built with zlib; the location of zlib must be specified for netCDF-4 with the       --with-zlib option. If HDF5 was also built with szlib, then the location of szlib must also be       specified with the --with-slib option.

Warning: the following items did not execute (for netcdf): org.macports.activate org.macports.configure org.macports.build org.macports.destroot org.macports.install
Error: Status 1 encountered during processing.

Changed 15 years ago by mamoll (Mark Moll)

Attachment: patch-Portfile.diff added

comment:15 Changed 15 years ago by mamoll (Mark Moll)

I've updated the patch to be an svn diff of the Portfile. I uninstalled netcdf and reinstalled with my patch applied. It builds and installs fine. I'll attach the build log in a second.

Changed 15 years ago by mamoll (Mark Moll)

Attachment: build.log added

comment:16 Changed 15 years ago by mf2k (Frank Schima)

I spoke too soon. I'm still not able to get py25-tables version 2.1 running properly with hdf5-18 version 1.8.2. They both build fine for me though. I think the main problem is that hdf5-18 does not build a dylib like the hdf5 port does. Specifically /opt/local/lib/libhdf5.0.dylib . Any ideas on how to get hdf5-18 to build the dylibs? This may be better moved into a new ticket.

comment:17 Changed 15 years ago by mamoll (Mark Moll)

I just committed a new Portfile for hdf5-18. I had to disable some check that disables shared libs when building with Fortran support. Everything seems to work, but please check. File a new bug report if this change to hdf5-18 is not working either.

comment:18 Changed 15 years ago by mf2k (Frank Schima)

Excellent! Now py25-tables works with hdf5-18! However, I still can't get netcdf to configure:

configure: setting up Fortran 90
checking for Fortran flag to compile .f90 files... unknown
configure: error: Fortran could not compile .f90 files

Error: Status 1 encountered during processing.

comment:19 Changed 15 years ago by mamoll (Mark Moll)

Can you attach the output of "port -dv configure netcdf"? Are you sure you're using my new netcdf patch?

comment:20 Changed 15 years ago by mf2k (Frank Schima)

Yes, I am using the latest patch and I re-applied it to be sure.

For some reason, i cannot add an attachment so here's the more complete output:

--->  Configuring netcdf
DEBUG: Using compiler 'Mac OS X gcc 4.0'
DEBUG: Executing org.macports.configure (netcdf)
DEBUG: Environment: CFLAGS='-O2 -fno-common' CPPFLAGS='-DNDEBUG -Df2cFortran' CXXFLAGS='-O2 -fno-common' MACOSX_DEPLOYMENT_TARGET='10.5' CPP='/usr/bin/cpp-4.0' CXX='openmpicxx' F90FLAGS='-O2' LDFLAGS='-L/opt/local/lib' FCFLAGS='-O2' OBJC='/usr/bin/gcc-4.0' INSTALL='/usr/bin/install -c' FC='openmpif77' OBJCFLAGS='-O2' FFLAGS='-O2' CC='openmpicc'
DEBUG: Assembled command: 'cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_svn.macports.org_trunk_dports_science_netcdf/work/netcdf-4.0" && ./configure --prefix=/opt/local --enable-shared --enable-netcdf-4 --with-hdf5=/opt/local --with-szlib=/opt/local'
configure: netCDF 4.0
checking build system type... i386-apple-darwin9.6.0
checking host system type... i386-apple-darwin9.6.0
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /opt/local/bin/gmkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
configure: checking user options
checking whether CXX is set to ''... no
checking whether FC is set to ''... no
checking whether F90 is set to ''... no
checking whether this is a netCDF-4.x build... yes
configure: Processing NetCDF-4 options.
checking whether netCDF-4 is to be built... yes
checking whether DAP client is to be built... 
checking whether new netCDF-4 C++ API is to be built... no
checking whether HDF5 should do data conversions... 
checking whether extra example tests should be run... 
checking whether parallel IO tests should be run... no
checking whether a location for the HDF5 library was specified... /opt/local
checking whether a location for the ZLIB library was specified... 
checking whether a location for the SZLIB library was specified... /opt/local
checking whether netCDF-4 logging is enabled... 
checking whether netCDF extra tests should be run (developers only)... no
checking whether documentation is to be installed... no
checking whether Fortran compiler(s) should be tested during configure... yes
checking whether configure should try to set compiler flags... yes
checking whether FFIO will be used... no
checking whether to skip C++, F77, or F90 APIs if compiler is broken... yes
checking whether only the C library is desired... no
checking whether examples should be built... yes
checking whether F77 API is desired... yes
checking whether F90 API is desired... yes
checking whether fortran type sizes should be checked... yes
checking whether C API is desired... yes
checking where to get netCDF C-only library for separate fortran libraries... 
checking whether CXX API is desired... yes
checking whether v2 netCDF API should be built... yes
checking whether the ncgen/ncdump should be built... yes
checking whether large file (> 2GB) tests should be run... no
checking whether benchmaks should be run (experimental)... no
checking whether extreme numbers should be used in tests... yes
checking where to put large temp files if large file tests are run... .
checking whether a win32 DLL is desired... no
checking whether separate fortran libs are desired... yes
configure: finding C compiler
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables... 
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether openmpicc accepts -g... yes
checking for openmpicc option to accept ISO C89... none needed
checking for style of include used by make... GNU
checking dependency style of openmpicc... gcc3
checking whether openmpicc and cc understand -c and -o together... yes
checking for an ANSI C-conforming const... yes
configure: finding Fortran compiler (will not be used if Fortran API is not desired)
checking whether we are using the GNU Fortran compiler... no
checking whether openmpif77 accepts -g... no
checking whether we are using the GNU Fortran 77 compiler... no
checking whether openmpif77 accepts -g... no
configure: setting up Fortran 90
checking for Fortran flag to compile .f90 files... unknown
configure: error: Fortran could not compile .f90 files
Error: Target org.macports.configure returned: configure failure: shell command " cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_svn.macports.org_trunk_dports_science_netcdf/work/netcdf-4.0" && ./configure --prefix=/opt/local --enable-shared --enable-netcdf-4 --with-hdf5=/opt/local --with-szlib=/opt/local " returned error 1
Command output: checking whether CXX API is desired... yes
checking whether v2 netCDF API should be built... yes
checking whether the ncgen/ncdump should be built... yes
checking whether large file (> 2GB) tests should be run... no
checking whether benchmaks should be run (experimental)... no
checking whether extreme numbers should be used in tests... yes
checking where to put large temp files if large file tests are run... .
checking whether a win32 DLL is desired... no
checking whether separate fortran libs are desired... yes
configure: finding C compiler
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables... 
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether openmpicc accepts -g... yes
checking for openmpicc option to accept ISO C89... none needed
checking for style of include used by make... GNU
checking dependency style of openmpicc... gcc3
checking whether openmpicc and cc understand -c and -o together... yes
checking for an ANSI C-conforming const... yes
configure: finding Fortran compiler (will not be used if Fortran API is not desired)
checking whether we are using the GNU Fortran compiler... no
checking whether openmpif77 accepts -g... no
checking whether we are using the GNU Fortran 77 compiler... no
checking whether openmpif77 accepts -g... no
configure: setting up Fortran 90
checking for Fortran flag to compile .f90 files... unknown
configure: error: Fortran could not compile .f90 files

Warning: the following items did not execute (for netcdf): org.macports.activate org.macports.configure org.macports.build org.macports.destroot org.macports.install
Error: Status 1 encountered during processing.

comment:21 Changed 15 years ago by mamoll (Mark Moll)

There are two failure modes I can think of: (a) You didn't install openmpi with Fortran support. (b) You installed openmpi with Fortran support, but afterwards used gcc_select to pick a different set of compilers that didn't include a fortran compiler.

What does mpif77 -showme output? Does the compiler name it prints exist?

comment:22 Changed 15 years ago by mamoll (Mark Moll)

I disabled both parallel support and Fortran support in the latest revision of the hdf5-18 port, since both are unsupported on OS X. In fact, "make check" shows several failures (even if everything compiles just fine). Hopefully, this change will allow the other ports that depend on hdf5-18 to build as well.

comment:23 in reply to:  21 Changed 15 years ago by mf2k (Frank Schima)

Replying to mmoll@…:

There are two failure modes I can think of: (a) You didn't install openmpi with Fortran support. (b) You installed openmpi with Fortran support, but afterwards used gcc_select to pick a different set of compilers that didn't include a fortran compiler.

Sorry for the delay. I'm not able to compile openmpi since the update to version 1.3.0. See #18246.

What does mpif77 -showme output? Does the compiler name it prints exist?

$ mpif77 -showme
--------------------------------------------------------------------------
Unfortunately, this installation of Open MPI was not compiled with
Fortran 77 support.  As such, the mpif77 compiler is non-functional.

--------------------------------------------------------------------------

comment:24 Changed 15 years ago by mf2k (Frank Schima)

netcdf now compiles with all your changes! My only issue with committing the changes is that it requires openmpi +g95 and we cannot currently require a variant as a dependency - see #126. Any comments on whether or not to commit?

comment:25 Changed 15 years ago by alakazam@…

Can +g95 be included by default for the openmpi port ?

comment:26 Changed 15 years ago by alakazam@…

Cc: alakazam@… added

Cc Me!

comment:27 Changed 15 years ago by mf2k (Frank Schima)

Actually, to be more precise, I am not able to build straight openmpi - see #18959 - but it builds for me with the +g95 variant. So maybe it would work, I'm just not able to test it.

comment:28 in reply to:  24 Changed 15 years ago by MarcusCalhoun-Lopez (Marcus Calhoun-Lopez)

Replying to macsforever2000@…:

netcdf now compiles with all your changes! My only issue with committing the changes is that it requires openmpi +g95 and we cannot currently require a variant as a dependency - see #126. Any comments on whether or not to commit?

I know I am late to this conversation, but is there any way to turn off the Fortran requirement of netcdf and have it as a variant (just as openmpi does)?

comment:29 Changed 15 years ago by alakazam@…

I fear that octave-netcdf which depends on netcdf will require the fortran support (I can check that if fortran support for netcdf is added as a variant).

comment:30 Changed 15 years ago by jmroot (Joshua Root)

Type: enhancementupdate

comment:31 Changed 15 years ago by (none)

Milestone: Port Updates

Milestone Port Updates deleted

comment:32 Changed 15 years ago by mf2k (Frank Schima)

Resolution: fixed
Status: newclosed

I committed mmoll's latest patch in r51304.

Note: See TracTickets for help on using tickets.