So, I try recompiling netcdf with the same environment variable options listed on the above site. Netcdf seems to install ok.
But when attempting to compile SCAM again, we see the same errors:
/usr/local/netcdf/lib/libnetcdf.a(putget.o)(.text+0x79): In function NC_fill_schar': : undefined reference to __c_mset1’
/usr/local/netcdf/lib/libnetcdf.a(putget.o)(.text+0xd2): In function NC_fill_char': : undefined reference to __c_mzero1’
/usr/local/netcdf/lib/libnetcdf.a(putget.o)(.text+0x148): In function NC_fill_short': : undefined reference to __c_mset2’
/usr/local/netcdf/lib/libnetcdf.a(putget.o)(.text+0x1bd): In function NC_fill_int': : undefined reference to __c_mset4’
/usr/local/netcdf/lib/libnetcdf.a(putget.o)(.text+0x22b): In function NC_fill_float': : undefined reference to __c_mset4’
/usr/local/netcdf/lib/libnetcdf.a(putget.o)(.text+0x2a1): In function NC_fill_double': : undefined reference to __c_mset8’
/usr/local/netcdf/lib/libnetcdf.a(putget.o)(.text+0x7e46): In function nc_put_vara_text': : undefined reference to __builtin_alloca’
/usr/local/netcdf/lib/libnetcdf.a(putget.o)(.text+0x7e59): In function nc_put_vara_text': : undefined reference to __builtin_alloca’
/usr/local/netcdf/lib/libnetcdf.a(putget.o)(.text+0x81a6): In function nc_put_vara_uchar': : undefined reference to __builtin_alloca’
/usr/local/netcdf/lib/libnetcdf.a(putget.o)(.text+0x81b9): In function nc_put_vara_uchar': : undefined reference to __builtin_alloca’
/usr/local/netcdf/lib/libnetcdf.a(putget.o)(.text+0x8506): In function nc_put_vara_schar': : undefined reference to __builtin_alloca’
/usr/local/netcdf/lib/libnetcdf.a(putget.o)(.text+0x8519): more undefined references to __builtin_alloca' follow collect2: ld returned 1 exit status gmake[1]: *** [../scamgui] Error 1 gmake[1]: Leaving directory /usr/local/cam1/models/atm/cam/tools/scam/ui’
gmake: *** [all] Error 2
I would appreciate any ideas on how to fix this. It still seems like a Netcdf problem.
Below is environment config from .bashrc for use compiling netcdf, ncarg, and scam:
The missing symbols are found in libpgc library which leads me to believe that you are not linking SCAM with either pgf90 or pgcc or there is an ordering problem. Can you please post the link command for SCAM?
Do you have a complete log of the build? If so, look for a line above the undefined reference errors where all the object files are. Something like “gcc -o scam -O2 obj1.o obj2.o …etc.”. This should be the link command.
Look for something like “LDFLAG” in the makefile and add "-L/usr/pgi/linux86-64/7.2-5/lib -lpgf90 -lpgf90_rpm1 -lpgf902 -lpgf90rtl -lpgftnrtl -lnspgc -lpgc ". This will include all of PGI’s F90 and C runtime libraries. Please change the “-L” to the actual location of you PGI library directory.
Mat,
Thanks for the help. I got it to compile with the path and library information you provided. There are some font problems with the gui but at least I got this far.
For anyone else who may encounter similar problems, this is what I had to do to get to this point.
…but the “gcc -o” command still could not find the PGI libs. I tried editing the “Makefile in /usr/local/cam1/models/atm/cam/tools/scam/obj/Makefile” and adding "-L/usr/pgi/linux86-64/7.2-5/lib -lpgf90 -lpgf90_rpm1 -lpgf902 -lpgf90rtl -lpgftnrtl -lnspgc -lpgc " to the “gcc -o” command but same result.
When running the compiled program “scam”, there are fonts missing from the gui so I think I need to similarly edit other “configure” files in the directory tree to correctly reference the PGI libs, but I am now farther than I’ve been able to get for a while.