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

[netCDF #ASW-719077]: installation of NetCDF



Carles,

> here is the output
> 
> file conftest.o conftestf.o
> 
> conftest.o:  Mach-O object i386
> conftestf.o: Mach-O 64-bit object x86_64
> 
> what do you think?

That shows your C compiler is generating 32-bit objects but your Fortran 
compiler is generating 64-bit objects, and
these are incompatible for linking together to build a program.

You must either

  - provide an argument to your C compiler (and any other compilers used, such 
as the C++ compiler)  to specify the
     use of 64-bit objects, such as setting environment variables

         export CFLAGS="-m64"
         export CXXFLAGS="-m64"

or

  - provide an argument to your Fortran compiler, ifort, to make it generate 
32-bit objects.  I don't know what
      argument ifort uses for this, perhaps "-m32".  If that is the way to 
generate 32-bit objects, then you would
      use

          export FFLAGS="-m32"
          export FCFLAGS="-m32"

There is no real advantage to generating 64-bit objects unless you are trying 
to link with other libraries that
are compiled in 64-bit mode.  For example, if you had an HDF5 library compiled 
in 64-bit mode that you
had to link with, you would have to use the first alternative, but otherwise 
the second alternative is probably
better.

Since this problem indicates that you C compiler, cc, is not compatible with 
your Fortran compiler, ifort, you
may run into other problems after fixing this one ...

--Russ



> 
> On Jul 21, 2009, at 9:45 PM, Unidata netCDF Support wrote:
> 
> > Carles,
> >
> >> thanks a lot for prompt reply. The files conftest.o and conftestf.o
> >> are not found in the installation directory (/Applications/
> >> netcdf-4.0.1), there are only the files:
> >>
> >> COPYRIGHT README aclocal.m4 config.log cxx f90 libsrc man4
> >> nc_test4 ncgen nf_test
> >> INSTALL RELEASE_NOTES compile config.sub cxx4 fortran libsrc4
> >> missing ncdap.m4 ncgen4 win32
> >> Makefile.am VERSION config.guess configure depcomp install-sh
> >> ltmain.sh nc-config.in ncdap_test nctest
> >> Makefile.in acinclude.m4 config.h.in configure.ac examples libncdap3
> >> m4 nc_test ncdump netcdf.pc.in
> >>
> >>
> >> I checked they are not in any of the subdirectories, should I look
> >> for
> >> these files maybe in other places?
> >
> > Oops, sorry, it turns out that the configure script cleans up any
> > left over files it created when it exits, even if there was an error.
> > I've just duplicated that problem here and found a way around it, but
> > it's a little tricky.
> >
> > You will have to edit the "configure" script and comment out one line,
> > to prevent it from deleting the conftest.o and conftestf.o files when
> > it cleans things up on exit.
> >
> > Use a text editor on the "configure" file, which is very long (over
> > 34000 lines), and look for the following line, which should occur
> > around line 2026, if you are using the configure from netCDF version
> > 3.6.3:
> >
> >    rm -f -r conftest* confdefs* conf$$* $ac_clean_files &&
> >
> > Comment out this line by inserting a "#" character at its begiining,
> > so the resuliting line will look like:
> >
> > #    rm -f -r conftest* confdefs* conf$$* $ac_clean_files &&
> >
> > Save the modified file and run it again.  It should still stop with
> > the error message
> >
> >  configure: error: Could not link conftestf.o and conftest.o
> >
> > but now those files will not be removed, so you can run the command
> >
> >  file conftest.o conftestf.o
> >
> > The output from this command should tell us why those two object files
> > created by the C compiler and Fortran compiler are not compatible, so
> > please send that output.
> >
> > --Russ
> >
> > Russ Rew                                         UCAR Unidata Program
> > address@hidden                     http://www.unidata.ucar.edu
> >
> >
> >
> > Ticket Details
> > ===================
> > Ticket ID: ASW-719077
> > Department: Support netCDF
> > Priority: Normal
> > Status: Closed
> >
> 
> 

Russ Rew                                         UCAR Unidata Program
address@hidden                     http://www.unidata.ucar.edu



Ticket Details
===================
Ticket ID: ASW-719077
Department: Support netCDF
Priority: Normal
Status: Closed