#145 -Fa alg -fPIC not propigated into cMakefile

Both
closed-fixed
5
2011-01-21
2010-01-30
Anonymous
No

Hello,

I have noticed what I think are some inconsistencies of the handling
of -Fa alg in configure/xconfig in ATLAS 3.9.21

This may be the same issue reported in artifact ID 2932719

I'm trying to build everything with -fPIC, which numpy-1.4.0 requires to build.
Almost everything builds with -fPIC with configure -Fa alg -fPIC applied but
the created src/blas/gemm/KERNEL/cMakefile gcc lines for the objects
ATL_cNBmm_b0.o, ATL_cNBmm_b1.o, ATL_cNBmm_bX.o do not get the -fPIC
flag as the others do. A patch that forces this flag in
tune/blas/gemm/mmksearch_sse.c appears to remedy the situation.

This patch is just a hack for my situation, I don't know enough about ATLAS to
produce a real fix. I just figured I'd show what I found.

Below is an example of the build, failure, patch, and success . They were
carried out in separate directories on an HP DL140G2, 1G RAM, 2x Xeon 2.8ghz
CPUs, 1M cache. OS is CentOS 5.4 Building with gcc.x86_64 and gcc-gfortran.x86_64
4.1.2-46.el5_4.1

Thanks,
-Pascal

Using atlas 3.9.21:

tar jxvf atlas3.9.21.tar.bz2
mkdir test1 ; cd test1
../configure -Fa alg -fPIC --with-netlib-lapack-tarfile=/tmp/bu/lapack.tgz
make
cd ../..
tar zxvf numpy-1.4.0.tar.gz
cd numpy-1.4.0
export LD_LIBRARY_PATH=/tmp/bu/ATLAS/test1/lib
echo """
[DEFAULT]
library_dirs = /tmp/bu/ATLAS/test1/lib
include_dirs = /tmp/bu/ATLAS/test1/include
""" > site.cfg
python setup.py build
result excert:

gcc -pthread -shared build/temp.linux-x86_64-2.4/numpy/core/blasdot/_dotblas.o -L/tmp/bu/ATLAS/test1/lib -Lbuild/temp.linux-x86_64-2.4 -lptf77blas -lptcblas -latlas -o build/lib.linux-x86_64-2.4/numpy/core/_dotblas.so
/usr/bin/ld: /tmp/bu/ATLAS/test1/lib/libatlas.a(ATL_sNBmm_b0.o): relocation R_X86_64_32 against `a local symbol' can not be used when making a shared object; recompile with -fPIC
/tmp/bu/ATLAS/test1/lib/libatlas.a: could not read symbols: Bad value
collect2: ld returned 1 exit status

With modification:
tar jxvf atlas3.9.21.tar.bz2
patch -p0 < mmksearch.patch
mkdir test1 ; cd test1
../configure -Fa alg -fPIC --with-netlib-lapack-tarfile=/tmp/bu/lapack.tgz
make
cd ../..
tar zxvf numpy-1.4.0.tar.gz
cd numpy-1.4.0
export LD_LIBRARY_PATH=/tmp/bu/ATLAS/test1/lib
echo """
[DEFAULT]
library_dirs = /tmp/bu2/ATLAS/test1/lib
include_dirs = /tmp/bu2/ATLAS/test1/include
""" > site.cfg
python setup.py build
(runs to completion)

Patch:

--- tune/blas/gemm/mmksearch_sse.c.2 2010-01-30 11:01:49.000000000 -0800
+++ tune/blas/gemm/mmksearch_sse.c 2010-01-30 11:05:59.000000000 -0800
@@ -201,10 +201,10 @@
mmp->comp = DupString("gcc");
#ifdef ATL_USE64BITS
mmp->cflags = DupString(
- "-fomit-frame-pointer -mfpmath=sse -msse3 -O2 -m64");
+ "-fomit-frame-pointer -mfpmath=sse -msse3 -O2 -fPIC -m64");
#else
mmp->cflags = DupString(
- "-fomit-frame-pointer -mfpmath=sse -msse3 -O2 -m32");
+ "-fomit-frame-pointer -mfpmath=sse -msse3 -O2 -fPIC -m32");
#endif
}
i = 0;

Discussion

    • milestone: 148063 -->
    • assigned_to: nobody --> rwhaley
    • labels: 360155 -->
    • status: open --> open-accepted
     
    • milestone: --> Both
    • labels: --> Install problem
     
  • Pascal,

    Thank you very much for reporting this bug, and for supplying a patch. I'm in the middle of a bunch of research, and won't have time to fix it for a bit, so I'm glad you have gotten something working for now. I have moved this to the bug tracker, and will fix it as soon as I can.

    Thanks,
    Clint

     
  • Can you check 3.9.28? I think this issue has been fixed.

    Let me know,
    Clint

     
    • status: open-accepted --> open-fixed
     
  • No response, assuming fixed

     
    • status: open-fixed --> closed-fixed