Question on compiling a meteorological model

I am trying to compiling a numerical meteorological model name RAMS, the platform is SuSE 10. The pgf90 seems to be working well, but when linking the software, I was prompted with these messages:


qhzx@yyqh:~/rams/rams6.0/build/60> make
(cd ./utils ; /usr/bin/make -f Make.utils.opt )
make[1]: Entering directory `/home/qhzx/rams/rams6.0/build/60/utils’

Finished building === ./libutils-2.2-opt.a

make[1]: Leaving directory `/home/qhzx/rams/rams6.0/build/60/utils’

pgf90 -c -Mvect=cachesize:524288 -Munroll -Mnoframe -O2 -pc 64 -I/home/qhzx/rams/rams6.0/src/utils/2.2/include -I./utils /home/qhzx/rams/rams6.0/src/rams/6.0/src/core/rammain.f90

pgf90 -o rams-6.0-opt rammain.o -v -Wl,-static rams-6.0-opt.a
./utils/libutils-2.2-opt.a -L/usr/local/ncarg/lib -lncarg -lncarg_gks -lncarg_c -L/usr/X11R6/lib -lX11 -lpthread -L/home/qhzx/rams/rams6.0/hdf5-1.6.4/hdf5/lib -lhdf5 -lz -lm

/usr/bin/ld /usr/lib/crt1.o /usr/lib/crti.o /usr/lib/gcc/i586-suse-linux/4.1.0//crtbegin.o /usr/pgi/linux86/6.1/lib/f90main.o -m elf_i386 -dynamic-linker /lib/ld-linux.so.2 /usr/pgi/linux86/6.1/lib/pgi.ld rammain.o -static rams-6.0-opt.a ./utils/libutils-2.2-opt.a -L/usr/local/ncarg/lib -lncarg -lncarg_gks -lncarg_c -L/usr/X11R6/lib -lX11 -lpthread -L/home/qhzx/rams/rams6.0/hdf5-1.6.4/hdf5/lib -lhdf5 -lz -lm -o rams-6.0-opt -L/usr/pgi/linux86/6.1/lib -L/usr/lib -L/usr/lib/gcc/i586-suse-linux/4.1.0/ -rpath /usr/pgi/linux86/6.1/lib -lpgf90 -lpgf90_rpm1 -lpgf902 -lpgf90rtl -lpgftnrtl -lpgsse1 -lpgsse2 -lc -lnspgc -lpgc -lm -lgcc -lc -lgcc /usr/lib/gcc/i586-suse-linux/4.1.0//crtend.o /usr/lib/crtn.o
/usr/local/ncarg/lib/libncarg_c.a(ncarg_path.o): In function _NGResolvePath': ncarg_path.c:(.text+0x257): warning: Using 'getpwnam' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking ncarg_path.c:(.text+0x26c): warning: Using 'getpwuid' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking ncarg_path.c:(.text+0x278): warning: Using 'endpwent' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking /usr/X11R6/lib/libX11.a(GetDflt.o): In function GetHomeDir’:
(.text+0x99): warning: Using ‘getpwnam_r’ in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
/usr/X11R6/lib/libX11.a(GetDflt.o): In function GetHomeDir': (.text+0xd2): warning: Using 'getpwuid_r' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking /usr/X11R6/lib/libX11.a(x11trans.o): In function _X11TransSocketOpen’:
(.text+0x50c): warning: Using ‘getaddrinfo’ in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
/usr/X11R6/lib/libX11.a(x11trans.o): In function _X11TransSocketUNIXConnect': (.text+0xf1c): warning: Using 'gethostbyname' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking /usr/X11R6/lib/libX11.a(x11trans.o): In function _X11TransSocketINETConnect’:
(.text+0x1e1b): warning: Using ‘getservbyname’ in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
/usr/lib/libpthread.a(unwind.o): In function __pthread_unwind': (.text+0x3d): undefined reference to _Unwind_ForcedUnwind’
/usr/lib/libpthread.a(unwind.o): In function unwind_stop': (.text+0xe9): undefined reference to _Unwind_GetCFA’
/usr/lib/libc.a(iofclose.o):(.eh_frame+0x11): undefined reference to __gcc_personality_v0' /usr/lib/libc.a(iofflush.o): In function fflush’:
(.text+0xee): undefined reference to _Unwind_Resume' /usr/lib/libc.a(iofflush.o):(.eh_frame+0x12): undefined reference to __gcc_personality_v0’
/usr/lib/libc.a(iofgets.o): In function fgets': (.text+0x174): undefined reference to _Unwind_Resume’
/usr/lib/libc.a(iofgets.o):(.eh_frame+0x12): undefined reference to __gcc_personality_v0' /usr/lib/libc.a(iofputs.o): In function fputs’:
(.text+0x114): undefined reference to _Unwind_Resume' /usr/lib/libc.a(iofputs.o):(.eh_frame+0x12): undefined reference to __gcc_personality_v0’
/usr/lib/libc.a(iofwrite.o): In function fwrite': (.text+0x12e): undefined reference to _Unwind_Resume’
/usr/lib/libc.a(iofwrite.o):(.eh_frame+0x12): undefined reference to __gcc_personality_v0' /usr/lib/libc.a(ioputs.o): In function puts’:
(.text+0x15b): undefined reference to _Unwind_Resume' /usr/lib/libc.a(ioputs.o):(.eh_frame+0x12): undefined reference to __gcc_personality_v0’
/usr/lib/libc.a(iosetvbuf.o): In function setvbuf': (.text+0x178): undefined reference to _Unwind_Resume’
/usr/lib/libc.a(iosetvbuf.o):(.eh_frame+0x12): undefined reference to __gcc_personality_v0' /usr/lib/libc.a(wfileops.o): In function _IO_wfile_underflow’:
(.text+0x12cc): undefined reference to _Unwind_Resume' /usr/lib/libc.a(wfileops.o):(.eh_frame+0x12): undefined reference to __gcc_personality_v0’
/usr/lib/libc.a(fileops.o): In function _IO_file_fopen': (.text+0x1ea5): undefined reference to _Unwind_Resume’
/usr/lib/libc.a(fileops.o): In function _IO_file_underflow': (.text+0x20a8): undefined reference to _Unwind_Resume’
/usr/lib/libc.a(fileops.o):(.eh_frame+0x12): undefined reference to __gcc_personality_v0' /usr/lib/libc.a(syslog.o): In function __vsyslog_chk’:
(.text+0x6c4): undefined reference to _Unwind_Resume' /usr/lib/libc.a(syslog.o): In function __vsyslog_chk’:
(.text+0x6d9): undefined reference to _Unwind_Resume' /usr/lib/libc.a(syslog.o): In function openlog’:
(.text+0x7e3): undefined reference to _Unwind_Resume' /usr/lib/libc.a(syslog.o): In function closelog’:
(.text+0x854): undefined reference to _Unwind_Resume' /usr/lib/libc.a(syslog.o):(.eh_frame+0x12): undefined reference to __gcc_personality_v0’
/usr/lib/libc.a(backtrace.o): In function backtrace': (.text+0x65): undefined reference to _Unwind_Backtrace’
/usr/lib/libc.a(backtrace.o): In function backtrace_helper': (.text+0x11a): undefined reference to _Unwind_GetIP’
/usr/lib/libc.a(backtrace.o): In function backtrace_helper': (.text+0x13f): undefined reference to _Unwind_GetGR’
/usr/lib/libc.a(backtrace.o): In function backtrace_helper': (.text+0x14a): undefined reference to _Unwind_GetCFA’
pgf90-Fatal-linker completed with exit code 1

make: *** [rams-6.0-opt] Error 2


Somebody has any advices on solving this problem?
Thanks in advance.

Hi chonp,

Another user had the same issue (See HERE) and solved it by adding “-lgcc_eh -lpthread” to the link line and remove the “-Wl,-static” option.

Hope this helps,
Mat

Dear mkcolg, Thanks a lot!