pbdNCDF4 with parallel I/O : installation fails on compilation of pncdf4.c

110 views
Skip to first unread message

Dave Biagioni

unread,
Aug 14, 2014, 6:34:41 PM8/14/14
to rbigdatap...@googlegroups.com, Ryan Elmore
Hello--

I am trying to install pbdNCDF4 with parallel support, and am encountering the following error.  I tried to trace back where the undeclared variables should be coming from, but without much success.  As far as I can tell, the serial installation was successful, differing only in the absence of --enable-parallel in --configure-args.  Both hdf5-1.3.11 and netcdf-4.3.3 built successfully and passed make check, including parallel i/o tests.  I am happy to provide additional details, and any feedback would be much appreciated!

===============================================

[dbiagion@login4 src]$ R_LIBS=/nopt/nrel/apps/R/3.1.0-gcc/lib64/R/library/:/home/dbiagion/usr/local/R/ R --no-site-file CMD INSTALL --configure-args="--with-nc-config=/home/dbiagion/usr/local/netcdf-c/bin/nc-config --enable-parallel" --library=/home/dbiagion/usr/local/R/tmp pbdNCDF4_0.1-4.tar.gz
* installing *source* package ‘pbdNCDF4’ ...
** package ‘pbdNCDF4’ successfully unpacked and MD5 sums checked
user specified nc-config is /home/dbiagion/usr/local/netcdf-c/bin/nc-config
checking for nc-config... yes
Netcdf library version: netCDF 4.3.3-rc1
Netcdf library has version 4 interface present: yes
Netcdf library was compiled with C compiler: /nopt/nrel/apps/openmpi/1.7.3-serial-gcc-4.8.2/bin/mpicc
configure: creating ./config.status
config.status: creating src/Makevars
configure: creating ./config.status
config.status: creating src/Makevars
config.status: creating R/zzz.R

****************** Results of ncdf4 package configure *******************

SPMD_CPPFLAGS   = -I/nopt/nrel/apps/openmpi/1.7.3-serial-gcc-4.8.2/include  -DMPI2 -DOPENMPI
SPMD_LDFLAGS    =  -L/nopt/nrel/apps/openmpi/1.7.3-serial-gcc-4.8.2/lib -lmpi  -lutil -lpthread
NETCDF_HEADER   = /home/dbiagion/usr/local/netcdf-c/include/netcdf_par.h
NETCDF_INCLUDE  = 1
NETCDF_PAR      = TRUE
NETCDF_PAR_OBJS = pncdf4.o
netCDF v4 CPP flags = -I/home/dbiagion/usr/local/netcdf-c/include
netCDF v4 LD flags   =  -L/home/dbiagion/usr/local/netcdf-c/lib -lnetcdf -lhdf5 -lhdf5_hl -ldl -lm -lz -lcurl
netCDF v4 runtime path =

*************************************************************************

** libs
echo "SPMD_CPPFLAGS = -I/nopt/nrel/apps/openmpi/1.7.3-serial-gcc-4.8.2/include  -DMPI2 -DOPENMPI" > Makeconf
echo "SPMD_LDFLAGS = -L/nopt/nrel/apps/openmpi/1.7.3-serial-gcc-4.8.2/lib -lmpi  -lutil -lpthread" >> Makeconf
echo "NETCDF_HEADER = /home/dbiagion/usr/local/netcdf-c/include/netcdf_par.h" >> Makeconf
echo "NETCDF_INCLUDE = 1" >> Makeconf
echo "NETCDF_PAR = TRUE" >> Makeconf
echo "NETCDF_PAR_OBJS = pncdf4.o" >> Makeconf
echo "NETCDF_CPPFLAGS = -I/home/dbiagion/usr/local/netcdf-c/include -DNETCDF_INCLUDE=1" >> Makeconf
echo "NETCDF_LDFLAGS = -L/home/dbiagion/usr/local/netcdf-c/lib -lnetcdf -lhdf5 -lhdf5_hl -ldl -lm -lz -lcurl" >> Makeconf
echo "NETCDF_RPATH = " >> Makeconf
echo "HAVE_NETCDF = TRUE" >> Makeconf
echo "PKG_CPPFLAGS = -I/home/dbiagion/usr/local/netcdf-c/include -DNETCDF_INCLUDE=1 -I/nopt/nrel/apps/openmpi/1.7.3-serial-gcc-4.8.2/include  -DMPI2 -DOPENMPI" >> Makeconf
echo "PKG_LIBS = -L/home/dbiagion/usr/local/netcdf-c/lib -lnetcdf -lhdf5 -lhdf5_hl -ldl -lm -lz -lcurl -L/nopt/nrel/apps/openmpi/1.7.3-serial-gcc-4.8.2/lib -lmpi  -lutil -lpthread" >> Makeconf
gcc -std=gnu99 -I/nopt/nrel/apps/R/3.1.0-gcc/lib64/R/include -DNDEBUG -I/home/dbiagion/usr/local/netcdf-c/include -DNETCDF_INCLUDE=1 -I/nopt/nrel/apps/openmpi/1.7.3-serial-gcc-4.8.2/include  -DMPI2 -DOPENMPI -I/usr/local/include    -fpic  -g -O2  -c ncdf2.c -o ncdf2.o
gcc -std=gnu99 -I/nopt/nrel/apps/R/3.1.0-gcc/lib64/R/include -DNDEBUG -I/home/dbiagion/usr/local/netcdf-c/include -DNETCDF_INCLUDE=1 -I/nopt/nrel/apps/openmpi/1.7.3-serial-gcc-4.8.2/include  -DMPI2 -DOPENMPI -I/usr/local/include    -fpic  -g -O2  -c ncdf3.c -o ncdf3.o
gcc -std=gnu99 -I/nopt/nrel/apps/R/3.1.0-gcc/lib64/R/include -DNDEBUG -I/home/dbiagion/usr/local/netcdf-c/include -DNETCDF_INCLUDE=1 -I/nopt/nrel/apps/openmpi/1.7.3-serial-gcc-4.8.2/include  -DMPI2 -DOPENMPI -I/usr/local/include    -fpic  -g -O2  -c ncdf.c -o ncdf.o
gcc -std=gnu99 -I/nopt/nrel/apps/R/3.1.0-gcc/lib64/R/include -DNDEBUG -I/home/dbiagion/usr/local/netcdf-c/include -DNETCDF_INCLUDE=1 -I/nopt/nrel/apps/openmpi/1.7.3-serial-gcc-4.8.2/include  -DMPI2 -DOPENMPI -I/usr/local/include    -fpic  -g -O2  -c src_ncdf4.c -o src_ncdf4.o
gcc -std=gnu99 -I/nopt/nrel/apps/R/3.1.0-gcc/lib64/R/include -DNDEBUG -I/home/dbiagion/usr/local/netcdf-c/include -DNETCDF_INCLUDE=1 -I/nopt/nrel/apps/openmpi/1.7.3-serial-gcc-4.8.2/include  -DMPI2 -DOPENMPI -I/usr/local/include    -fpic  -g -O2  -c pncdf4.c -o pncdf4.o
pncdf4.c: In function ‘R_nc4_open_par’:
pncdf4.c:30:13: error: ‘NC_NOWRITE’ undeclared (first use in this function)
   nc_mode = NC_NOWRITE;
             ^
pncdf4.c:30:13: note: each undeclared identifier is reported only once for each function it appears in
pncdf4.c:32:27: error: ‘NC_WRITE’ undeclared (first use in this function)
                 nc_mode = NC_WRITE;
                           ^
pncdf4.c:46:55: error: ‘NC_MPIIO’ undeclared (first use in this function)
  *retval = nc_open_par(R_ExpandFileName(filename[0]), NC_MPIIO, nc_comm,
                                                       ^
pncdf4.c:48:16: error: ‘NC_NOERR’ undeclared (first use in this function)
  if(*retval != NC_NOERR){
                ^
pncdf4.c:49:3: warning: implicit declaration of function ‘nc_strerror’ [-Wimplicit-function-declaration]
   Rprintf("Error in R_nc4_open_par: %s\n", nc_strerror(*retval));
   ^
pncdf4.c: In function ‘R_nc4_create_par’:
pncdf4.c:71:15: error: ‘NC_NOCLOBBER’ undeclared (first use in this function)
   nc_cmode += NC_NOCLOBBER;
               ^
pncdf4.c:74:15: error: ‘NC_SHARE’ undeclared (first use in this function)
   nc_cmode += NC_SHARE;
               ^
pncdf4.c:77:15: error: ‘NC_64BIT_OFFSET’ undeclared (first use in this function)
   nc_cmode += NC_64BIT_OFFSET;
               ^
pncdf4.c:80:15: error: ‘NC_NETCDF4’ undeclared (first use in this function)
   nc_cmode += NC_NETCDF4;
               ^
pncdf4.c:83:15: error: ‘NC_MPIIO’ undeclared (first use in this function)
   nc_cmode += NC_MPIIO;
               ^
pncdf4.c:86:15: error: ‘NC_MPIPOSIX’ undeclared (first use in this function)
   nc_cmode += NC_MPIPOSIX;
               ^
pncdf4.c:99:16: error: ‘NC_NOERR’ undeclared (first use in this function)
  if(*retval != NC_NOERR){
                ^
pncdf4.c: In function ‘R_nc4_var_par_access’:
pncdf4.c:120:12: error: ‘NC_NOERR’ undeclared (first use in this function)
  if(err != NC_NOERR){
            ^
make: *** [pncdf4.o] Error 1
ERROR: compilation failed for package ‘pbdNCDF4’
* removing ‘/home/dbiagion/usr/local/R/tmp/pbdNCDF4’
* restoring previous ‘/home/dbiagion/usr/local/R/tmp/pbdNCDF4’

Romain C

unread,
Aug 18, 2015, 11:51:49 AM8/18/15
to RBigDataProgramming, rtel...@gmail.com
Hi Dave --

Any chance you solved this (old) issue ? I am facing it right now with no clue on how to fix it ! 
It seems that --configure-args='--enable-parallel' points to netcdf_par.h  but "NC_WRITE - like" declarations are only set in netcdf.h...

Am I mistaken ? 

Cheers
R.

Romain C

unread,
Aug 18, 2015, 1:17:21 PM8/18/15
to RBigDataProgramming, rtel...@gmail.com
Hi all --

I guess I found my issues. The dependencies were not correctly compiled. I started from scratch with pbdPROF, pbdMPI and finally pbdNCDF4 and this time it worked perfectly. 

Hope it will help other folks. 

R. 
Reply all
Reply to author
Forward
0 new messages