[petsc-users] configure error with netcdf

Satish Balay balay at mcs.anl.gov
Sun Sep 9 00:31:00 CDT 2012


> ncgentab.c:(.text+0x1e2): undefined reference to `yyunput'

I don't know whats going on here. I don't see lex/flex invoked.

Perhaps you can try the attached patch and see if it works. Its
attempting to use the latest netcdf tarball.

cd config/BuidSystem
patch -Np1 < netcdf.patch

Matt - If the changes look ok - I can push to petsc-dev

- update to 4.2.1.1 tarball
- remove configEnv. all configure options should be passed via command-line.
- also remove make.inc. Its never used.
- Add in --disable-hdf4 --disable-netcdf-4 to get rid of hdf5 errors
- libnetcdf_c++.a not created by the new version? remove it from liblist

exodusii.py also has some issues. Its makefiles are relying on
PETSC_DIR/PETSC_ARCH env variable to be set by user - for obtaining
ntcdf location, install-dir for 'make install' etc..

Satish

On Sat, 8 Sep 2012, Barry Smith wrote:

> 
>    This is likely the same flex problem you say with ptscotch:
> 
>   ncgen.l:142: warning: passing argument 1 of ‘ncgerror’ discards qualifiers from pointer target type
> ncgentab.o: In function `ignore':
> ncgentab.c:(.text+0x1e2): undefined reference to `yyunput'
> collect2: ld returned 1 exit status
> make[2]: *** [ncgen3] Error 1
> make[1]: *** [all-recursive] Error 1
> make: *** [all] Error 2
> 
> 
>   netcdf.py would have to be modified in the same way as ptscotch.py was modified to do the right thing with flex
> 
>    Satish, do you know how to do it? Cause I sure don't.
> 
>    Barry
> 
> 
> 
> On Sep 8, 2012, at 10:35 AM, fdkong <fd.kong at siat.ac.cn> wrote:
> 
> > Thank you Matt. I added MPI shared libraries to my LD_LIBRARY_PATH. The error disappeared. But other errors happened. Please find the attached files!
> >  
> > 
> > 
> > ------------------ Original ------------------
> > From:  "knepley"<knepley at gmail.com>;
> > Date:  Sat, Sep 8, 2012 12:30 PM
> > To:  "fdkong"<fd.kong at siat.ac.cn>;
> > Cc:  "petsc-users"<petsc-users at mcs.anl.gov>;
> > Subject:  Re: configure error with netcdf
> > 
> > On Fri, Sep 7, 2012 at 11:28 PM, fdkong <fd.kong at siat.ac.cn> wrote:
> > >> Hi all,
> > >>
> > >> There are anyone who know how to install netcdf with cross compile? I
> > >> configured petsc with netcdf, but got error below:
> > >>
> > 
> > >Send externalpackages./netcdf*/config.log
> > 
> > > Thanks,
> > 
> > > Matt
> > 
> > I attached the file config.log.
> > 
> > Your MPI shared libraries are not in your LD_LIBRARY_PATH
> > 
> > configure:5252: checking whether we are cross compiling
> > configure:5260: /curc/tools/free/redhat_5_x86_64/openmpi-1.4.3_ib/bin/mpicc -o conftest -fPIC -Wwrite-strings -Wno-strict-aliasing -Wno-unknown-pragmas -O -I/curc/tools/free/redhat_5_x86_64/openmpi-1.4.3_ib/include -I/curc/tools/free/redhat_5_x86_64/openmpi-1.4.3_ib/include -I. conftest.c >&5
> > configure:5264: $? = 0
> > configure:5271: ./conftest
> > ./conftest: error while loading shared libraries: libmpi.so.0: cannot open shared object file: No such file or directory
> > configure:5275: $? = 127
> > 
> > Matt
> > >>
> > >> >===========================================================================>====
> > >> Configuring PETSc to compile on your system
> > >>
> > >>
> > >> >===========================================================================>====
> > > >===========================================================================>====
> > >>
> > >> ***** WARNING: MPI_DIR
> > >> found in enviornment variables - ignoring ******
> > >>>
> > >>
> > >> >===========================================================================>====
> > >>
> > >>
> > >> ===============================================================================
> > >>
> > >> WARNING!
> > >> Compiling PETSc with no debugging, this should
> > >>
> > >> only be done for timing and
> > >> production runs. All development should
> > >>
> > >> be done when configured using --with-debugging=1
> > >
> > >
> > > ===============================================================================
> > >>
> > >>
> > >> ===============================================================================
> > >>
> > >> Configuring NetCDF; this
> > >> may take several minutes
> > >>
> > >>
> > >> ===============================================================================
> > >>
> > >>
> > >>
> > >>
> > >>
> > >> *******************************************************************************
> > >> UNABLE to CONFIGURE with GIVEN OPTIONS (see configure.log for
> > >> details):
> > >>
> > >> -------------------------------------------------------------------------------
> > >> Error running make on NetCDF: Could not execute "cd
> > >> /projects/fako9399/petsc-3.3-p3/externalpackages/netcdf-4.1.1 &&
> > >> AR="/usr/bin/ar" ARFLAGS="cr"
> > >> CC="/curc/tools/free/redhat_5_x86_64/openmpi-1.4.3_ib/bin/mpicc" CFLAGS="
> > >> -fPIC -Wwrite-strings -Wno-strict-aliasing -Wno-unknown-pragmas -O
> > >> -I/curc/tools/free/redhat_5_x86_64/openmpi-1.4.3_ib/include
> > >> -I/curc/tools/free/redhat_5_x86_64/openmpi-1.4.3_ib/include -I."
> > >> CXX="/curc/tools/free/redhat_5_x86_64/openmpi-1.4.3_ib/bin/mpicxx"
> > >> CXXFLAGS=" -Wwrite-strings -Wno-strict-aliasing -Wno-unknown-pragmas -O
> > >> -fPIC -I/curc/tools/free/redhat_5_x86_64/openmpi-1.4.3_ib/include
> > >> -I/curc/tools/free/redhat_5_x86_64/openmpi-1.4.3_ib/include -I."
> > >> FC="/curc/tools/free/redhat_5_x86_64/openmpi-1.4.3_ib/bin/mpif90" FCFLAGS="
> > >> -fPIC -Wno-unused-variable -O
> > >> -I/curc/tools/free/redhat_5_x86_64/openmpi-1.4.3_ib/include
> > >> -I/curc/tools/free/redhat_5_x86_64/openmpi-1.4.3_ib/include -I."
> > >> F90="/curc/tools/free/redhat_5_x86_64/openmpi-1.4.3_ib/bin/mpif90"
> > >> ./configure --prefix=/projects/fako9399/petsc-3.3-p3/arch-linux264-cxx-opt
> > >> --libdir=/projects/fako9399/petsc-3.3-p3/arch-linux264-cxx-opt/lib
> > >> --disable-dap --enable-shared":
> > >> configure: netCDF 4.1.1
> > >> checking build system type... x86_64-unknown-linux-gnu
> > >> checking host system type... x86_64-unknown-linux-gnu
> > >> checking for a BSD-compatible install... /usr/bin/install -c
> > >> checking whether build environment is sane... yes
> > >> checking for a thread-safe mkdir -p... /bin/mkdir -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 a NCIO_MINBLOCKSIZE was specified... 256
> > >> checking whether udunits is to be built... no
> > > >checking if fsync support is enabled... yes
> > >> checking whether extra valgrind tests should be run... no
> > >> checking whether libcf is to be built... no
> > >> checking whether reading of HDF4 SD files is to be enabled... no
> > >> checking whether to fetch some sample HDF4 files from Unidata ftp site to
> > > >test HDF4 reading (requires wget)... no
> > >> checking whether parallel I/O for classic and 64-bit offset files using
> > >> parallel-netcdf is to be enabled... no
> > > >checking whether a location for the parallel-netcdf library was
> > >> specified... no
> > >> checking whether new netCDF-4 C++ API is to be built... no
> > > >checking whether extra example tests should be run... no
> > > >checking whether parallel IO tests should be run... no
> > > >checking whether a location for the HDF5 library was specified...
> > >> checking whether a location for the ZLIB library was specified...
> > >> checking whether a location for the SZLIB library was specified...
> > >> checking whether a location for the HDF4 library was specified...
> > >> checking whether a default chunk size in bytes was specified... 4194304
> > > >checking whether a maximum per-variable cache size for HDF5 was
> > > >specified... 67108864
> > > >checking whether a number of chunks for the default per-variable cache was
> > >> specified... 10
> > >> checking whether a default file cache size for HDF5 was specified...
> > > >4194304
> > > >checking whether a default file cache maximum number of elements for HDF5
> > > >was specified... 1009
> > > >checking whether a default cache preemption for HDF5 was specified... 0.75
> > > >checking whether netCDF-4 logging is enabled... no
> > > >checking whether a path for curl-config was specified... no
> > > >checking whether a location for curl installation was specified... no
> > > >configure: checking whether a location for curl-config is in PATH... yes
> > > >checking whether DAP client is to be built... no
> > > >checking whether dap remote testing should be enabled (default on)... no
> > > >checking whether the time-consuming dap tests should be enabled (default
> > > >off)... no
> > > >checking whether a location for liboc was specified... no
> > >> checking whether netCDF extra tests should be run (developers only)... no
> > > >checking whether Fortran compiler(s) should be tested during configure...
> > > >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 any Fortran 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 whether the C compiler works... yes
> > >> checking for C compiler default output file name... a.out
> > > >checking for suffix of executables...
> > > >checking whether we are cross compiling... configure: error: in
> > >> `/projects/fako9399/petsc-3.3-p3/externalpackages/netcdf-4.1.1':
> > > >configure: error: cannot run C compiled programs.
> > > >If you meant to cross compile, use `--host'.
> > > >See `config.log' for more details.
> > >>
> > >> *******************************************************************************
> > >>
> > > >The configure script is:
> > >>
> > > > ./configure --with-clanguage=cxx --with-shared-libraries=1
> > >> --with-dynamic-loading=1 --download-f-blas-lapack=1 --with-mpi-dir=$MPI_DIR
> > >> --known-mpi-shared-libraries=0 --with-batch=1 --download-parmetis=1
> > > >--download-metis=1 --with-64-bit-indices=1 --download-netcdf=1
> > > >--download-exodusii=1 --with-debugging=no --download-ptscotch=1
> > >>
> > >> I also attached the file configure.log
> > >>
> > > >------------------
> > > >Fande Kong
> > >> ShenZhen Institutes of Advanced Technology
> > > >Chinese Academy of Sciences
> > >>
> > >>
> > 
> > 
> > 
> > 
> > -- 
> > What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.
> > -- Norbert Wiener
> > <config.zip><configure.zip>
> 
> 
-------------- next part --------------
diff --git a/config/packages/netcdf.py b/config/packages/netcdf.py
--- a/config/packages/netcdf.py
+++ b/config/packages/netcdf.py
@@ -8,10 +8,10 @@
     config.package.GNUPackage.__init__(self, framework)
     self.downloadpath    = 'http://www.unidata.ucar.edu/downloads/netcdf/ftp/'
     self.downloadext     = 'tar.gz'
-    self.downloadversion = '4.1.1'
+    self.downloadversion = '4.2.1.1'
     self.functions       = ['nccreate']
     self.includes        = ['netcdf.h']
-    self.liblist         = [['libnetcdf_c++.a','libnetcdf.a']]
+    self.liblist         = [['libnetcdf.a']]
     self.cxx             = 1
     return
 
@@ -20,45 +20,36 @@
     self.mpi   = framework.require('config.packages.MPI', self)
     self.hdf5  = framework.require('config.packages.hdf5', self)
     self.odeps = [self.mpi, self.hdf5]
+    self.deps  = [self.mpi]
     return
 
   def Install(self):
     import os, sys
 
-    makeinc        = os.path.join(self.packageDir, 'make.inc')
-    installmakeinc = os.path.join(self.confDir, 'NetCDF')
-    configEnv      = []
     configOpts     = []
     # Unused flags: F90, CPPFLAGS, LIBS, FLIBS
-    g = open(makeinc, 'w')
-    g.write('AR             = '+self.setCompilers.AR+'\n')
-    g.write('ARFLAGS        = '+self.setCompilers.AR_FLAGS+'\n')
-    configEnv.append('AR="'+self.setCompilers.AR+'"')
-    configEnv.append('ARFLAGS="'+self.setCompilers.AR_FLAGS+'"')
+    configOpts.append('AR="'+self.setCompilers.AR+'"')
+    configOpts.append('ARFLAGS="'+self.setCompilers.AR_FLAGS+'"')
 
-    g.write('NETCDF_ROOT    = '+self.packageDir+'\n')
-    g.write('PREFIX         = '+self.installDir+'\n')
     configOpts.append('--prefix='+self.installDir)
     configOpts.append('--libdir='+os.path.join(self.installDir,self.libdir))
     configOpts.append('--disable-dap')
+    configOpts.append('--disable-hdf4')
+    configOpts.append('--disable-netcdf-4')
 
     self.setCompilers.pushLanguage('C')
     cflags = self.setCompilers.getCompilerFlags().replace('-Wall','').replace('-Wshadow','')
     cflags += ' ' + self.headers.toString(self.mpi.include)+' '+self.headers.toString('.')
-    g.write('CC             = '+self.setCompilers.getCompiler()+'\n')
-    g.write('CFLAGS         = '+cflags+'\n')
-    configEnv.append('CC="'+self.setCompilers.getCompiler()+'"')
-    configEnv.append('CFLAGS="'+cflags+'"')
+    configOpts.append('CC="'+self.setCompilers.getCompiler()+'"')
+    configOpts.append('CFLAGS="'+cflags+'"')
     self.setCompilers.popLanguage()
 
     if hasattr(self.setCompilers, 'CXX'):
       self.setCompilers.pushLanguage('Cxx')
       cxxflags = self.setCompilers.getCompilerFlags().replace('-Wall','').replace('-Wshadow','')
       cxxflags += ' ' + self.headers.toString(self.mpi.include)+' '+self.headers.toString('.')
-      g.write('CXX            = '+self.setCompilers.getCompiler()+'\n')
-      g.write('CXXFLAGS       = '+cflags+'\n')
-      configEnv.append('CXX="'+self.setCompilers.getCompiler()+'"')
-      configEnv.append('CXXFLAGS="'+cxxflags+'"')
+      configOpts.append('CXX="'+self.setCompilers.getCompiler()+'"')
+      configOpts.append('CXXFLAGS="'+cxxflags+'"')
       self.setCompilers.popLanguage()
     else:
       configOpts.append('--disable-cxx')
@@ -67,12 +58,10 @@
       self.setCompilers.pushLanguage('FC')
       fcflags = self.setCompilers.getCompilerFlags().replace('-Wall','').replace('-Wshadow','')
       fcflags += ' ' + self.headers.toString(self.mpi.include)+' '+self.headers.toString('.')
-      g.write('FC             = '+self.setCompilers.getCompiler()+'\n')
-      g.write('FCFLAGS        = '+fcflags+'\n')
-      configEnv.append('FC="'+self.setCompilers.getCompiler()+'"')
-      configEnv.append('FCFLAGS="'+fcflags+'"')
+      configOpts.append('FC="'+self.setCompilers.getCompiler()+'"')
+      configOpts.append('FCFLAGS="'+fcflags+'"')
       if self.compilers.fortranIsF90:
-        configEnv.append('F90="'+self.setCompilers.getCompiler()+'"')
+        configOpts.append('F90="'+self.setCompilers.getCompiler()+'"')
       else:
         configOpts.append('--disable-f90')
       self.setCompilers.popLanguage()
@@ -81,15 +70,19 @@
 
     if self.setCompilers.sharedLibraries:
       configOpts.append('--enable-shared')
-    g.close()
 
-    if self.installNeeded('make.inc'):    # Now compile & install
+    args = ' '.join(configOpts)
+    fd = file(os.path.join(self.packageDir,'netcdf'), 'w')
+    fd.write(args)
+    fd.close()
+
+    if self.installNeeded('netcdf'):
       try:
         self.logPrintBox('Configuring NetCDF; this may take several minutes')
-        output,err,ret  = self.executeShellCommand('cd '+self.packageDir+' && '+' '.join(configEnv)+' ./configure '+' '.join(configOpts), timeout=2500, log = self.framework.log)
+        output,err,ret  = self.executeShellCommand('cd '+self.packageDir+' && ./configure '+args, timeout=2500, log = self.framework.log)
         self.logPrintBox('Compiling & installing NetCDF; this may take several minutes')
         output,err,ret  = self.executeShellCommand('cd '+self.packageDir+' && make clean && make && make install && make clean', timeout=2500, log = self.framework.log)
       except RuntimeError, e:
         raise RuntimeError('Error running make on NetCDF: '+str(e))
-      self.postInstall(output+err,'make.inc')
+      self.postInstall(output+err,'netcdf')
     return self.installDir


More information about the petsc-users mailing list