[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[netCDF #AZX-585461]: fortran configure problems



Karen,

> I decided to switch to netcdf-fortran-4.2.  I was able to get it to
> compile as below.  I was being overly cautious on specifying all the
> compilers just to be safe.
> 
> ./configure --enable-parallel-tests FCFLAGS=-fsecond-underscore
> CPPFLAGS=-I/pic/people/d39974/exahdf/include
> LDFLAGS=-L/pic/people/d39974/exahdf/lib LIBS="-lnetcdf -lhdf5_hl -lhdf5
> -lz -lm" --disable-shared --prefix=/pic/people/d39974/exahdf CC=mpicc
> FC=mpif90 CXX=mpiCC F77=mpif77
> 
> This is essentially what I was trying to do with 4.4-beta.  It seems to
> work except that the FCFLAGS do not get passed on to the compilation of
> test programs so I can't build them without hacking the makefile.  At
> least not when using the gnu compilers.

Thanks for contributing this.  The 4.4 approach using he Fortran-2003 C
interoperability features is supposed to eliminate the need for options like
FCFLAGS=-fsecond-underscore, but I'm not sure if the mpi compilers support
that F2003 feature yet ...

> Could you let me know if you get a revised 4.4 for me to try?

Yes, when there's a new beta release, it will be announced on the netcdfgroup
mailing list, and I'll try to include you also, in case you're not on that list.

--Russ

> On 11/7/12 8:07 PM, "Schuchardt, Karen L" <address@hidden>
> wrote:
> 
> >Hi Russ,
> >
> >hopper is kind of slow at the moment so I decided to move everything to a
> >linux cluster.  I haven't built there before.  hdf189 checked out fine
> >including parallel.  So do netcdf-c.  When I try to build fortran netcdf,
> >I'm having trouble with configure again but this time du to
> >ISO_C_BINDING.  I only know a little about this from googling.  I tried
> >the --disable-f03 which didn't help with the configure error.  So I added
> >--disable-f03-compiler-check which got me through configure but then make
> >failed.  no real surprise.
> >
> >The basic underlying error is that iso_c_binding.mod can't be found.
> >here is the configure error
> >...
> >checking whether mpif90 accepts -g... yes
> >checking whether we are using the GNU Fortran 77 compiler... no
> >checking whether mpif77aa accepts -g... no
> >checking whether Fortran compiler is checked for ISO_C_BINDING support...
> >yes
> >checking for Fortran flag to compile .f90 files... none
> >checking fortran 90 modules inclusion flag... -I
> >checking if Fortran compiler supports Fortran 2003 ISO_C_BINDING... no
> >configure: error: in `/pic/people/d39974/netcdf-fortran-4.4-beta1':
> >configure: error: Can't use build F03 interfaces and cannot do compiler
> >recovery
> >See `config.log' for more details
> >
> >The details:
> >configure:5158: checking if Fortran compiler supports Fortran 2003
> >ISO_C_BINDING
> >configure:5166: mpif90 -c -g -O2  conftest.f90
> > In file conftest.f90:2
> >
> >USE ISO_C_BINDING
> >                1
> >Fatal Error: Can't open module file 'iso_c_binding.mod' for reading at
> >(1): No such file or directory
> >configure:5169: $? = 1
> >configure:5175: result: no
> >configure:5184: error: in `/pic/people/d39974/netcdf-fortran-4.4-beta1':
> >configure:5186: error: Can't use build F03 interfaces and cannot do
> >compiler recovery
> >See `config.log' for more details
> >
> >
> >
> >For my first attempt, I thought I'd use gnu.  Perhaps that was my first
> >mistake.  Should this work?
> >GNU Fortran (GCC) 4.1.2 20080704 (Red Hat 4.1.2-51)
> >Copyright (C) 2007 Free Software Foundation, Inc.
> >
> >
> >
> >./configure --disable-f03 --disable-f03-compiler-check
> >--enable-parallel-tests CPPFLAGS=-I/pic/people/d39974/exahdf/include
> >LDFLAGS=-L/pic/people/d39974/exahdf/lib LIBS="-lnetcdf -lhdf5_hl -lhdf5"
> >--disable-shared --prefix=/pic/people/d39974/exahdf CC=mpicc FC=mpif90
> >F77=mpif77
> >
> >For what its worth, I still don't see the symbols in the .mod file.
> >
> >[d39974@olympus ~/netcdf-fortran-4.4-beta1]$ grep _mpiio fortran/*
> >fortran/netcdf4.inc:      integer nf_mpiio
> >fortran/netcdf4.inc:      parameter (nf_mpiio = 8192)
> >
> >Here is the make error if I use the f03 disable flags
> >
> >bin/sh ../libtool --tag=FC   --mode=compile mpif90 -DHAVE_CONFIG_H -I.
> >-I.. -I../libsrc   -I/pic/people/d39974/exahdf/include  -g -O2 -c -o
> >module_netcdf_nc_data.lo module_netcdf_nc_data.F90
> >libtool: compile:  mpif90 -DHAVE_CONFIG_H -I. -I.. -I../libsrc
> >-I/pic/people/d39974/exahdf/include -g -O2 -c module_netcdf_nc_data.F90
> >-o module_netcdf_nc_data.o
> > In file module_netcdf_nc_data.F90:30
> >
> > USE ISO_C_BINDING  ! All subsequent USE associations of netcdf_nc_data
> >                                                                      1
> >Fatal Error: Can't open module file 'iso_c_binding.mod' for reading at
> >(1): No such file or directory
> >make[3]: *** [module_netcdf_nc_data.lo] Error 1
> >make[3]: Leaving directory
> >`/pic/people/d39974/netcdf-fortran-4.4-beta1/fortran'
> >make[2]: *** [all] Error 2
> >make[2]: Leaving directory
> >`/pic/people/d39974/netcdf-fortran-4.4-beta1/fortran'
> >make[1]: *** [all-recursive] Error 1
> >make[1]: Leaving directory `/pic/people/d39974/netcdf-fortran-4.4-beta1'
> >make: *** [all] Error 2
> >
> >
> >I guess I should try 4.2 as well.
> >________________________________________
> >From: Unidata netCDF Support [address@hidden]
> >Sent: Wednesday, November 07, 2012 8:41 AM
> >To: Schuchardt, Karen L
> >Cc: address@hidden
> >Subject: [netCDF #AZX-585461]: fortran configure problems
> >
> >Hi Karen,
> >
> >> Hi I am struggling to get the fortran build for netcdf4 going on hopper.
> >>
> >> I'm referring to the docs here
> >> https://www.unidata.ucar.edu/software/netcdf/docs/netcdf-fortran-inst>
> >> all.html
> >>
> >> The first issue I encountered is that the configure script did not
> >> work correctly unless I separated>  the LDFLAGS and LIBS or the
> >> parallel io test. This is because th> e contest.c was specified
> >> after LDFLAGS. You might want to upd> ate the documentation (which
> >> specifies everything in LDFLAGS) > as it took me a bit of time to
> >> discover this and track it down.
> >
> >I think I've corrected this as you suggest, but please let us know if
> >this is not what you intended (the second step 3 in this document):
> >
> >
> >http://www.unidata.ucar.edu/software/netcdf/docs/netcdf-fortran-install.ht
> >ml
> >
> >> The second problem I'm having is getting the required symbols
> >>nf90_mpiio defined.
> >>
> >> Here is my configure
> >> ./configure --enable-parallel-tests
> >> CPPFLAGS="-I/scratch/scratchdirs/karen/hdf5-pre-notrunc/avoid_tr>
> >> uncate/install/include -I/scratch/>
> >> scratchdirs/karen/netcdf-4.2.1.1/install/include" LDFLAGS="-L/sc>
> >> ratch/scratchdirs/karen/hdf5-pre-n>
> >> otrunc/avoid_truncate/install/lib -L/scratch/scratchdirs/karen/n>
> >> etcdf-4.2.1.1/install/lib" LIBS="-> lnetcdf -lhdf5_hl -lhdf5 -lz"
> >> --disable-shared --prefix=`pwd` CC> =cc CXX=CC FC=ftn
> >>
> >> Configured like this, the nf90_mpiio variable can be found in
> >>netcdf.inc but not in netcdf.mod.
> >>
> >> If I also set F90=ftn, then the symbol doesn't show up in either place .
> >>
> >> If I run ./nf-config ‹all, it says I don't have f90 in either case
> >> but the examples/F90 programs bui> ld.
> >>
> >> Asside from these missing symbols, everything else is in order but
> >> of course parallel IO aborts if I>  don't specify one of the parallel
> >>io flags.
> >>
> >> What am I overlooking?
> >
> >I don't think you're overlooking anything.  This looks like a bug, due
> >to inadequate testing of the --enable-parallel-tests and separate
> >Fortran distribution.  I've entered it into our Jira issue-tracking
> >system, where you can monitor it or add comments on the issue:
> >
> >  https://www.unidata.ucar.edu/jira/browse/NCFORTRAN-21
> >
> >> Also I'm not sure how to get the parallel tests to build. Including
> >> the flag didn't seem to do the trick.
> >
> >Did you build the C library according to these instructions, with
> >--enable-parallel, and also use --enable-parallel when you build the
> >HDF5 library?
> >
> >  http://www.unidata.ucar.edu/software/netcdf/docs/build_parallel.html
> >
> >If you did that, I don't know what's wrong.  We'll defintiely look
> >into this when we get to that Jira issue ...
> >
> >--Russ
> >
> >Russ Rew                                         UCAR Unidata Program
> >address@hidden                      http://www.unidata.ucar.edu
> >
> >
> >
> >Ticket Details
> >===================
> >Ticket ID: AZX-585461
> >Department: Support netCDF
> >Priority: Normal
> >Status: Closed
> 
> 
Russ Rew                                         UCAR Unidata Program
address@hidden                      http://www.unidata.ucar.edu



Ticket Details
===================
Ticket ID: AZX-585461
Department: Support netCDF
Priority: Normal
Status: Closed