[Met_help] known problem but not solution for pb2nc on a 64-bit machine (UNCLASSIFIED)

John Halley Gotway johnhg at rap.ucar.edu
Fri Dec 19 15:03:01 MST 2008


Barb,

Looking back at the emails from Robert, I see that you're running on a
64-bit RedHat machine using the GNU g++/gfortran compilers.

I only have access to a 64-bit Debian machine using the GNU g++/gfortran
compilers.  So it's possible that there are some differences between how
this works on RedHat and Debian.  But I'll list out the commands I used to
compile each of the required libraries on the Debian 64-bit machine in the
hopes that it might shed some light on the issue.

Robert has probably already done all of the steps, but here's what I'd try...

- First, I had to have the sys admins install a 32-bit version of the
standard GNU libraries so that I'd be able to build 32-bit executables.
- Second, I set the LD_LIBRARY_PATH in my .cshrc to /usr/lib32 to point to
those 32-bit versions of the libraries.

- Compile 32-bit NetCDF:
tar -xvzf netcdf-3.6.2.tar.gz
cd netcdf-3.6.2
setenv CC /usr/bin/gcc
setenv CXX /usr/bin/g++
setenv CFLAGS -m32
setenv CPPFLAGS -m32
./configure --prefix=`pwd`
make
make install

- Compile 32-bit GSL:
tar -xvzf gsl-1.9.tar.gz
cd gsl-1.9
setenv CC /usr/bin/gcc
setenv CFLAGS -m32
./configure --prefix=`pwd`
make
make install

- Compile 32-bit BUFRLIB;
tar -xvf BURLIB.tar
gcc -m32 -c -DUNDERSCORE *.c
gfortran -m32 -c -DUNDERSCORE -fno-second-underscore *.f
ar crv libbufr.a *.o

- Compile 32-bit cwordsh:
tar -xvf cwordsh.tar
gfortran -m32 -o cwordsh.x cwordsh.f ../bufrlib/libbufr.a
And then edit the cwordsh script file and set CWRD="the current directory"

- Configure and compile 32-bit MET:
cd METv1.1
cp Makefile_gnu Makefile
Edit Makefile as follows...
- set CXX_FLAGS = -Wall -Wshadow -static -m32
- set FC_FLAGS  = -Wall -Wshadow -static -m32
- set FC_LIBS   = -lgfortran
- set NETCDF_BASE, BUFR_BASE, GSL_BASE to the appropriate paths
And then build MET with "make >& make_met.log"

- Re-block the PREPBUFR files
cd METv1.1/data/sample_obs/prepbufr
foreach file (`ls *.blk`)
   /path/to/cwordsh unblk $file tmp
   /path/to/cwordsh block tmp $file
end

And then try running the script: METv1.1/scripts/test_pb2nc.sh

Please let me know how it goes.

John

> Barb,
>
> I was finally able to compile in 32-bit mode on our machine here.  I had
> to get the sys admins install a package to our Linux machine that enabled
> me to compile in 32-bit mode.  And after building
> BUFRLIB, NetCDF, GSL, and the cwordsh utility using the -m32 flag, I was
> able to build MET and run the PB2NC tool on the sample PREPBUFR data
> without encountering the error you're seeing.  So I think
> there's hope!
>
> When I get a chance, I'll send along the steps I took to compile each of
> the libraries in 32-bit mode.  I'm headed out the door right now, but I
> wanted to let you know where we are.
>
> Thanks,
> John
>
> Sauter, Barbara (Civ, ARL/CISD) wrote:
>> Classification:  UNCLASSIFIED
>> Caveats: NONE
>>
>> Thanks for the message.
>>
>> I have been using cwordsh all along, but I did go ahead and unblock then
>> block a sample prepbufr file as specified.  After trying to run pb2nc on
>> the resulting file I still get the same error message.
>>
>> Barb
>> Classification:  UNCLASSIFIED
>> Caveats: NONE
>>
>
>




More information about the Met_help mailing list