When I compile gotoblas1.05 to a 64bit static library (on a AMD64 system) using pgi7.04 as the fortran compiler, no problem occurs. However, when I built the shared library, error occurs:
./gensymbol linux _ > linux.def
gcc -O2 -DALLOC_HUGETLB -D__64BIT__ -D_GNU_SOURCE -Wall -fPIC -m64 -DF_INTERFACE_F2C -DMAX_CPU_NUMBER=2 -DASMNAME= -DASMFNAME=_ -DNAME=_ -DCNAME= -DBUNDERSCORE=_ -DNEEDBUNDERSCORE -I… -DARCH_X86_64 -DOPTERON -DL1_CODE_SIZE=65536 -DL1_CODE_ASSOCIATIVE=2 -DL1_CODE_LINESIZE=64 -DL1_DATA_SIZE=65536 -DL1_DATA_ASSOCIATIVE=2 -DL1_DATA_LINESIZE=64 -DL2_SIZE=1048576 -DL2_ASSOCIATIVE=8 -DL2_LINESIZE=64 -DITB_SIZE=4096 -DITB_ASSOCIATIVE=0 -DITB_ENTRIES=32 -DDTB_SIZE=4096 -DDTB_ASSOCIATIVE=0 -DDTB_ENTRIES=32 -DHAVE_CMOV -DHAVE_MMX -DHAVE_SSE -DHAVE_SSE2 -DHAVE_3DNOWEX -DHAVE_3DNOW -DHAVE_CFLUSH -DNUM_SHAREDCACHE=1 -DNUM_CORES=1 -DCORE_OPTERON -shared -o …/libgoto_opteron-r1.05.so
-Wl,–whole-archive …/libgoto_opteron-r1.05.a -Wl,–no-whole-archive
-Wl,–retain-symbols-file linux.def
/usr/bin/ld: …/libgoto_opteron-r1.05.a(srot.o): relocation R_X86_64_PC32 against `__pgio_ini’ can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: final link failed: Bad value
collect2: ld returned 1 exit status
make: *** […/libgoto_opteron-r1.05.so] Error 1
My best guess is that either you didn’t compile with “-fpic” or when the libgoto_opteron-r1.05.a was created, you also archived the pgi static runtime libraries from the PGI “lib” directory. If the later is the case, then be sure to use the static libraries found in the “libso” directory. The static libraries in “libso” were all compiled with “-fpic”, while those in “lib” were not.
I have tried PGI 6.1.6 too, and no problem is found when I create the shared library.
When I compiled gotoblas, I only modified the “Makefile.rule” file: using F_COMPILER = PGI and BINARY64 = 1, and did not change anything else. Both PGI7.07 and PGI 6.1.6 work well when compiling the static library. However, when I create the shared library using PGI 7.04, the above mentioned errors occur.
Try changing the PGI section of “Makefile.rules” to “libso” instead of “lib”. This should bring in the PGI runtime libraries that were compiled with “-fpic”. I was able to compile and link both the static and dynamic library with thsi change.
Can you please post the exact steps you did so I can try an reproduce the error here. While I did use 7.0-4 without problems, perhaps I’m missing something. Besure to include the gotoblas version number and include all steps such as untaring the package, your configuration, make commands, etc.
While these were the exact step I did previously, I tried again. The good/bad news is that it still worked fine for me. The only difference is that I’m using SLES9 instead of CentOS.
What is the output of ‘uname -r’ and ‘gcc --version’ on your system?
The ourput of “uname -r” is “2.6.9-42.ELsmp”, and the output of “'gcc --version” is
“gcc (GCC) 3.4.6 20060404 (Red Hat 3.4.6-3)
Copyright (C) 2006 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.”
The closest matching system I have access to is SuSE 9.3 but again it just worked. Is it possible for me to access your system so I can try and determine the error? If so, please write to trs@pgroup.com with instructions and ask customer service to forward your message to me. Otherwise, I’m out of ideas.