[gradsusr] Enable netcdf 4.1.1 option in grads configure file

Huddleston, John Huddleston at cira.colostate.edu
Tue Jun 15 10:39:29 EDT 2010


Huber

That is a good question. I remember building on HP/UX ten years ago and it was always difficult.

Let's try another approach. I assume you've built the hdf library. Look under the hdf-4.2.5/mfhdf/xdr directory.

Type 'make' and it will build the shared library; then, use the objects to make the static library.

ar cruv libxdr.a *.o

Copy the libxdr.a to your ${SUPPLIBS}/lib and link it into the GrADS link line using the option

-lxdr

John Huddleston, PhD
Cooperative Institute for Research in the Atmosphere

From: gradsusr-bounces at gradsusr.org [mailto:gradsusr-bounces at gradsusr.org] On Behalf Of Huber Paúl Gilt López
Sent: Monday, June 14, 2010 3:40 PM
To: 'GrADS Users Forum'
Subject: Re: [gradsusr] Enable netcdf 4.1.1 option in grads configure file

Hello John,

I build in hp-ux, and I have the following libraries, which of them I will choose?. I'm building a applications of 32 bits.

Thanks a lot,
Huber

# find / -name librpc*
/usr/lib/hpux32/librpcsvc.so.1
/usr/lib/hpux32/librpcsec_gss.sl
/usr/lib/hpux32/librpcsec_gss.so.1
/usr/lib/hpux32/librpcsoc.so
/usr/lib/hpux32/librpcsoc.so.1
/usr/lib/hpux32/librpcsvc.so
/usr/lib/hpux64/librpcsec_gss.sl
/usr/lib/hpux64/librpcsec_gss.so.1
/usr/lib/hpux64/librpcsvc.so
/usr/lib/hpux64/librpcsvc.so.1
/usr/lib/pa20_64/librpcsec_gss.1
/usr/lib/pa20_64/librpcsec_gss.sl
/usr/lib/pa20_64/librpcsvc.1
/usr/lib/pa20_64/librpcsvc.sl
/usr/lib/librpcsec_gss.1
/usr/lib/librpcsec_gss.sl
/usr/lib/librpcsoc.1
/usr/lib/librpcsoc.sl
/usr/lib/librpcsvc.1
/usr/lib/librpcsvc.sl
/usr/ccs/pa/usr/lib/pa20_64/librpcsec_gss.1
/usr/ccs/pa/usr/lib/pa20_64/librpcsec_gss.sl
/usr/ccs/pa/usr/lib/pa20_64/librpcsvc.1
/usr/ccs/pa/usr/lib/pa20_64/librpcsvc.sl
/usr/ccs/pa/usr/lib/librpcsec_gss.1
/usr/ccs/pa/usr/lib/librpcsec_gss.sl
/usr/ccs/pa/usr/lib/librpcsoc.1
/usr/ccs/pa/usr/lib/librpcsoc.sl
/usr/ccs/pa/usr/lib/librpcsvc.1
/usr/ccs/pa/usr/lib/librpcsvc.sl
________________________________
De: gradsusr-bounces at gradsusr.org [mailto:gradsusr-bounces at gradsusr.org] En nombre de Huddleston, John
Enviado el: lunes, 14 de junio de 2010 16:00
Para: GrADS Users Forum
Asunto: Re: [gradsusr] Enable netcdf 4.1.1 option in grads configure file

Huber

The XDR functions are in the RPC library. These are originally from the SUN environment.

If you have a librpc.a or a *rpc*.so somewhere under the /usr/lib or /usr/local/lib areas then add it to the link line, e.g.
-lrpc

What platform are you using to build GrADS?

John Huddleston, PhD
Cooperative Institute for Research in the Atmosphere

From: gradsusr-bounces at gradsusr.org [mailto:gradsusr-bounces at gradsusr.org] On Behalf Of Huber Paúl Gilt López
Sent: Monday, June 14, 2010 1:53 PM
To: 'GrADS Users Forum'
Subject: Re: [gradsusr] Enable netcdf 4.1.1 option in grads configure file

Hello Jennifer,

I want to compile de grads, but I don't know what library or file include these missing symbols, please if you kwon tell, how can I fix these problem? (Error is in the end)

Thanks you very much,
Huber
gcc  -g -O2   -o grads grads.o gxsubs.o gxmeta.o gxchpl.o gxcntr.o gxstrm.o gxwmap.o gxshad.o gaexpr.o gafunc.o gautil.o gagx.o gscrpt.o gamach.o bufrstn.o gabufr.o gabufrtbl.o gxX.o gxdxwd.o galloc.o   gaddes.o gaio.o gacfg.o gauser.o gasdf.o -L../../supplibs/lib    -lX11    ../../supplibs/lib/libmfhdf.a ../../supplibs/lib/libdf.a ../../supplibs/lib/libudunits.a ../../supplibs/lib/libsz.a ../../supplibs/lib/libjpeg.a ../../supplibs/lib/libz.a ../../supplibs/lib/libhdf5.a ../../supplibs/lib/libsz.a ../../supplibs/lib/libjpeg.a ../../supplibs/lib/libz.a ../../supplibs/lib/libudunits.a ../../supplibs/lib/libnetcdf.a ../../supplibs/lib/libhdf5_hl.a ../../supplibs/lib/libhdf5.a ../../supplibs/lib/libz.a ../../supplibs/lib/libsz.a ../../supplibs/lib/libcurl.a     -lm
ld: Unsatisfied symbol "xdr_string" in file ../../supplibs/lib/libnetcdf.a[liboc_la-occompile.o]
ld: Unsatisfied symbol "xdr_int" in file ../../supplibs/lib/libmfhdf.a[putget.o]
ld: Unsatisfied symbol "xdr_double" in file ../../supplibs/lib/libmfhdf.a[putget.o]
ld: Unsatisfied symbol "xdr_opaque" in file ../../supplibs/lib/libmfhdf.a[putget.o]
ld: Unsatisfied symbol "xdr_float" in file ../../supplibs/lib/libmfhdf.a[putget.o]
ld: Unsatisfied symbol "xdrmem_create" in file ../../supplibs/lib/libnetcdf.a[liboc_la-ocinternal.o]
ld: Unsatisfied symbol "xdr_enum" in file ../../supplibs/lib/libmfhdf.a[var.o]
ld: Unsatisfied symbol "xdr_long" in file ../../supplibs/lib/libmfhdf.a[dim.o]
ld: Unsatisfied symbol "xdr_u_int" in file ../../supplibs/lib/libnetcdf.a[liboc_la-occompile.o]
ld: Unsatisfied symbol "xdr_u_long" in file ../../supplibs/lib/libmfhdf.a[string.o]
10 errors.
collect2: ld returned 1 exit status
make[2]: *** [grads] Error 1
make[2]: Leaving directory `/home/huber/grads/grads-2.0.a8/src'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/home/huber/grads/grads-2.0.a8/src'
make: *** [all-recursive] Error 1


________________________________
De: gradsusr-bounces at gradsusr.org [mailto:gradsusr-bounces at gradsusr.org] En nombre de Jennifer Adams
Enviado el: lunes, 14 de junio de 2010 9:52
Para: GrADS Users Forum
Asunto: Re: [gradsusr] Enable netcdf 4.1.1 option in grads configure file

Huber --
hdiff is a utility compiled by the hdf4 library, but not needed for GrADS. Did you already get libdf.a and libmfhdf.a? If so, then put them in $SUPPLIBS/lib and all the include files in $SUPPLIBS/include/hdf/ and run ./configure (for GrADS) again.
--Jennifer

On Jun 14, 2010, at 10:43 AM, Huber Paúl Gilt López wrote:

Jennifer,

Thank you for your help, I haven't compiled the hdf4 library yet, because I have found the message 'Unsatisfied symbol "sqrt" in file hdiff_array.o', I had thought that the math library was not specify '-lm'. Could you tell me how can I solve this problem? (The error message is in the end)

Please help me,
Best regards,
Huber

gcc  -O2   -L/home/huber/grads/supplibs/src/zlib-1.2.3/lib -L/home/huber/grads/supplibs/src/jpeg-6b/lib -o hdiff hdiff.o hdiff_array.o hdiff_gr.o hdiff_list.o hdiff_main.o hdiff_mattbl.o hdiff_gattr.o hdiff_misc.o hdiff_sds.o hdiff_table.o hdiff_vs.o hdiff_dim.o ../libsrc/libmfhdf.a ../../hdf/src/libdf.a -ljpeg -lz  -lnsl -ljpeg -lz  -lnsl
ld: Unsatisfied symbol "sqrt" in file hdiff_array.o
1 errors.
collect2: ld returned 1 exit status
make[2]: *** [hdiff] Error 1
make[2]: Leaving directory `/home/huber/grads/supplibs/src/HDF4.2r3/mfhdf/hdiff'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/huber/grads/supplibs/src/HDF4.2r3/mfhdf'
make: *** [all-recursive] Error 1

________________________________
De: gradsusr-bounces at gradsusr.org<mailto:gradsusr-bounces at gradsusr.org> [mailto:gradsusr-bounces at gradsusr.org] En nombre de Jennifer Adams
Enviado el: viernes, 11 de junio de 2010 19:34
Para: GrADS Users Forum
Asunto: Re: [gradsusr] Enable netcdf 4.1.1 option in grads configure file


On Jun 11, 2010, at 6:06 PM, Huber Paúl Gilt López wrote:

Jennifer,

Sorry, I can't understand the patch for gasdf.c,

Change this code block:


gaint read_metadata (struct gafile *pfi) {
struct gavar *pvar;
gaint rc,i,ii,j,len,ngatts,natts,ndims,nvars,status,oflg,dummy;
size_t sz,size=0;
#if USEHDF ==1
int32 ndsets,dimsize,sds_id,dim_id,dtype,ndatts;
int32 dim_sizes[H4_MAX_VAR_DIMS],rank;
char sdsname[H4_MAX_NC_NAME+1];
char name[H4_MAX_NC_NAME+1],dimname[H4_MAX_NC_NAME+1];
#endif


To this code block instead:

gaint read_metadata (struct gafile *pfi) {
struct gavar *pvar;
gaint rc,i,ii,j,len,ngatts,natts,ndims,nvars,status,oflg,dummy;
size_t sz,size=0;
char name[300];
#if USEHDF ==1
int32 ndsets,dimsize,sds_id,dim_id,dtype,ndatts;
int32 dim_sizes[H4_MAX_VAR_DIMS],rank;
char sdsname[H4_MAX_NC_NAME+1];
char dimname[H4_MAX_NC_NAME+1];
#endif




but according with to suggest I going to compile hdf4.
Yes, you can also build wtih hdf4 -- but you must use the --disable-netcdf option when compiling that library.

--Jennifer

Thank you
Best regards
Huber

________________________________
De: gradsusr-bounces at gradsusr.org<mailto:gradsusr-bounces at gradsusr.org> [mailto:gradsusr-bounces at gradsusr.org] En nombre de Jennifer Adams
Enviado el: viernes, 11 de junio de 2010 16:48
Para: GrADS Users Forum
Asunto: Re: [gradsusr] Enable netcdf 4.1.1 option in grads configure file

That is a bug that occurs when you build with netcdf but without hdf4.  Here is the patch for gasdf.c :

# diff dev/src/gasdf.c grads-2.0.a8/src/gasdf.c
2169d2168
< char name[300];
2174c2173
< char dimname[H4_MAX_NC_NAME+1];
---
> char name[H4_MAX_NC_NAME+1],dimname[H4_MAX_NC_NAME+1];



On Jun 11, 2010, at 5:24 PM, Huber Paúl Gilt López wrote:

Hello Jennifer,

Thanks you for your help, I just enabled the netcdf option but now after make command, akin the error message:


gcc -DHAVE_CONFIG_H -I.    -I../../supplibs/include/udunits -I../../supplibs/include/netcdf  -I../../supplibs/include/hdf5       -I/usr/include/hdf    -g -O2 -c gasdf.c
gasdf.c: In function 'read_metadata':
gasdf.c:2278: error: 'name' undeclared (first use in this function)
gasdf.c:2278: error: (Each undeclared identifier is reported only once
gasdf.c:2278: error: for each function it appears in.)
make[2]: *** [gasdf.o] Error 1
make[2]: Leaving directory `/home/huber/grads/grads-2.0.a8/src'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/home/huber/grads/grads-2.0.a8/src'
make: *** [all-recursive] Error 1


How can I fix this undeclared 'name'?

Please help me,

Best regards,
Huber


________________________________
De: gradsusr-bounces at gradsusr.org<mailto:gradsusr-bounces at gradsusr.org> [mailto:gradsusr-bounces at gradsusr.org] En nombre de Jennifer Adams
Enviado el: viernes, 11 de junio de 2010 13:37
Para: GrADS Users Forum
Asunto: Re: [gradsusr] Enable netcdf 4.1.1 option in grads configure file


On Jun 11, 2010, at 2:11 PM, Huber Paúl Gilt López wrote:


Hello,

I'm trying to build grads with netcdf option enable, after I configured the grads with this command:

./configure --prefix=/opt/grads-2.0.a8 --with-sdf --with-netcdf-include=/home/huber/grads/supplibs/include/netcdf > config.out

You should not need to specify any configure options (other than --prefix) to get netcdf support. I did not write any code to support the "--with-netcdf-include" option...



I had the following message that ludunits library is not found:

Checking in supplibs for libraries to support netcdf-4 ...
checking for udunits.h... (cached) yes
checking for utInit in -ludunits... (cached) no
- netcdf-4 disabled

Then, I tried to build the source ldudunits library with the make command, and also I had this error:

cc -o udunits -O udunits.o -R/data/hoop/udunits-1.11.7/src/lib -L/data/hoop/udunits-1.11.7/src/lib -ludunits -R/data/hoop/udunits-1.11.7/src/port/misc -L/data/hoop/udunits-1.11.7/src/port/misc -ludport -ly -lm
(Bundled) cc: warning 922: "-O" is unsupported in the bundled compiler, ignored.
(Bundled) cc: warning 901: unknown option: `-R/data/hoop/udunits-1.11.7/src/lib': use +help for online documentation.
(Bundled) cc: warning 901: unknown option: `-R/data/hoop/udunits-1.11.7/src/port/misc': use +help for online documentation.
ld: Can't find library for -ludunits
Fatal error.

Why the compilation needs the ludunits library, I was thought this library will be the output?

What you're trying to build here is a utility called 'udunits' -- that is something that is built along with the library, but it is not necessary for GrADS.

Look for a file called libudunits.a  -- that is what GrADS needs -- and put it in your $SUPPLIBS/lib location.

--Jennifer




Please help me
Best regards,

Huber Paul Gilt Lopez
IGP-Peru








_______________________________________________
gradsusr mailing list
gradsusr at gradsusr.org<mailto:gradsusr at gradsusr.org>
http://gradsusr.org/mailman/listinfo/gradsusr

--
Jennifer M. Adams
IGES/COLA
4041 Powder Mill Road, Suite 302
Calverton, MD 20705
jma at cola.iges.org<mailto:jma at cola.iges.org>




_______________________________________________
gradsusr mailing list
gradsusr at gradsusr.org<mailto:gradsusr at gradsusr.org>
http://gradsusr.org/mailman/listinfo/gradsusr

--
Jennifer M. Adams
IGES/COLA
4041 Powder Mill Road, Suite 302
Calverton, MD 20705
jma at cola.iges.org<mailto:jma at cola.iges.org>



_______________________________________________
gradsusr mailing list
gradsusr at gradsusr.org<mailto:gradsusr at gradsusr.org>
http://gradsusr.org/mailman/listinfo/gradsusr

--
Jennifer M. Adams
IGES/COLA
4041 Powder Mill Road, Suite 302
Calverton, MD 20705
jma at cola.iges.org<mailto:jma at cola.iges.org>




_______________________________________________
gradsusr mailing list
gradsusr at gradsusr.org<mailto:gradsusr at gradsusr.org>
http://gradsusr.org/mailman/listinfo/gradsusr

--
Jennifer M. Adams
IGES/COLA
4041 Powder Mill Road, Suite 302
Calverton, MD 20705
jma at cola.iges.org<mailto:jma at cola.iges.org>



-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://gradsusr.org/pipermail/gradsusr/attachments/20100615/439b9089/attachment-0003.html 


More information about the gradsusr mailing list