Page 1 of 1
"undefined symbols" during BLACS building

Posted:
Mon May 05, 2008 3:21 pm
by maomaowlw
Dear all,
I'm using gcc & gfortran on Leopard to install BLACS and ScaLAPACK~
When I was trying "make xtc_CsameF77" in the INSTALL directory of BLACS installing package (following the guidance), it generates some linking errors. (When I used g77 instead of gfortran previously, I didn't have such problems). Does anyone have any idea what it is about? The error messages go as follows:
Undefined symbols:
"_s_wsle", referenced from:
_MAIN__ in tc_fCsameF77.o
_MAIN__ in tc_fCsameF77.o
_MAIN__ in tc_fCsameF77.o
_MAIN__ in tc_fCsameF77.o
_MAIN__ in tc_fCsameF77.o
_MAIN__ in tc_fCsameF77.o
_MAIN__ in tc_fCsameF77.o
"_e_wsle", referenced from:
_MAIN__ in tc_fCsameF77.o
_MAIN__ in tc_fCsameF77.o
_MAIN__ in tc_fCsameF77.o
_MAIN__ in tc_fCsameF77.o
_MAIN__ in tc_fCsameF77.o
_MAIN__ in tc_fCsameF77.o
"_do_lio", referenced from:
_MAIN__ in tc_fCsameF77.o
_MAIN__ in tc_fCsameF77.o
_MAIN__ in tc_fCsameF77.o
_MAIN__ in tc_fCsameF77.o
_MAIN__ in tc_fCsameF77.o
_MAIN__ in tc_fCsameF77.o
"_s_stop", referenced from:
_MAIN__ in tc_fCsameF77.o
ld: symbol(s) not found
collect2: ld returned 1 exit status

Posted:
Mon May 05, 2008 3:26 pm
by Julie
maomaowlw
You are missing the f2c library in your link. This comes from the fact that one of your LAPACK or BLAS library is using f2c.
Julie

Posted:
Mon May 05, 2008 3:53 pm
by maomaowlw
So...is this library coming with gfortran or...how can I get it? I'm new to fortran,MPI, etc..
Thanks.

Posted:
Mon May 05, 2008 4:06 pm
by Julie
my advice would be to use gfortran, gcc, openmpi. For the optimized BLAS, you can try Vectib or goto. If you do not need performance, you can also use the Ref BLAS that is shipped with the package.
the best is to use the scalapack installer available at
http://www.netlib.org/scalapack/.
and run the command once you have openmpi installed
./setup.py --downblas --downlapack --downblacs
LAPACK and ScaLAPACK are in FORTRAN77 (ScaLAPACK has also some C inside)
I will advice you to program in Fortran77 so that you do not have to worry about interfacing different codes. (so just do the couple of corrections I did on your code)
Julie

Posted:
Thu May 08, 2008 10:15 am
by maomaowlw
Hi, Julie, thanks for your info, I already tried out the installer and it works~
Now I'm trying to use ATLAS for the optimized BLAS library~ and some errors occurred during the process~
When compiling CLAPACK, I'm trying to use the optimized BLAS
library by ATLAS, so I set the BLASLIB in the make.inc as:
BLASLIB = ../../libcblaswr.a -lcblas -latlas
then build the libraries (also before that, I built the f2clib
following the guideline in netlib
It went well, but when I tried to built the blas testing code, it
generates errors for "undefined symbols"
looks like those should be in the f2clib, but I already built it....
"gcc sblat2.o \
../../F2CLIBS/libf2c.a -lm -o ../xblat2s
Undefined symbols:
"_f2c_ssbmv", referenced from:
_schke_ in sblat2.o
_schke_ in sblat2.o
_schke_ in sblat2.o
_schke_ in sblat2.o
_schke_ in sblat2.o
_schke_ in sblat2.o
_schk2_ in sblat2.o
"_f2c_sgbmv", referenced from:
_schke_ in sblat2.o
_schke_ in sblat2.o
_schke_ in sblat2.o
_schke_ in sblat2.o
_schke_ in sblat2.o
_schke_ in sblat2.o
_schke_ in sblat2.o
_schke_ in sblat2.o
_schk1_ in sblat2.o
......."
On the other side, when compiling ATLAS, "make build" went well.
But when I tried "make check" for testing, it again give errors for
"undefined symbols"...
"d: warning in /Users/maomaowlw/ATLAS/build/lib/liblapack.a, file is
not of required architecture
Undefined symbols:
"_ATL_slauum", referenced from:
_test_inv in sinvtst.o
"_ATL_strtri", referenced from:
_test_inv in sinvtst.o
"_ATL_spotrf", referenced from:
_test_inv in sinvtst.o
"_ATL_sgetrf", referenced from:
_test_inv in sinvtst.o
"_ATL_sgetri", referenced from:
_test_inv in sinvtst.o"
Anyone has any idea what is the reason here? Thanks!

Posted:
Thu May 08, 2008 11:08 am
by maomaowlw
ps. I'm afraid it might be due to the mix of 32- and 64-bit libraries..
coz I tried "lipo -info" on all the built libraries,
all the others are of architecture: x86_64
but for "liblapack", it gives info:
"lipo: archive member liblapack.a(sgesv.o) cputype (16777223) and cpusubtype (3) does not match previous archive members cputype (7) and cpusubtype (3) (all members must match)
"
I dun know why is this and how to solve it.... I tried to get 64-bit libs in CLAPACK by adding flags '-m64' for compiling, but it does not work. All the library files are still like
"input file lapack.a is not a fat file
Non-fat file: lapack.a is architecture: i386
"
Anyone met similar situations before??
Thanks for any suggestion!