Problem compiling numpy against ATLAS on amd64 (Mandriva 2006)
Hi list, I searched the archives and found various threads regarding this issue and I have not found a solution there. software versions: gfortran 4.0.1 atlas 3.6.0 lapack 3.0 Basically numpy spits out this message when I try to compile it: gcc: numpy/linalg/lapack_litemodule.c /usr/bin/gfortran -shared build/temp.linux-x86_64-2.4/numpy/linalg/lapack_litemodule.o -L/usr/local/lib/atlas -llapack -lptf77blas -lptcblas -latlas -lgfortran -o build/lib.linux-x86_64-2.4/numpy/linalg/lapack_lite.so /usr/bin/ld: /usr/local/lib/atlas/liblapack.a(dlamch.o): relocation R_X86_64_32S against `a local symbol' can not be used when making a shared object; recompile with -fPIC /usr/local/lib/atlas/liblapack.a: could not read symbols: Bad value collect2: ld returned 1 exit status /usr/bin/ld: /usr/local/lib/atlas/liblapack.a(dlamch.o): relocation R_X86_64_32S against `a local symbol' can not be used when making a shared object; recompile with -fPIC /usr/local/lib/atlas/liblapack.a: could not read symbols: Bad value collect2: ld returned 1 exit status error: Command "/usr/bin/gfortran -shared build/temp.linux-x86_64-2.4/numpy/linalg/lapack_litemodule.o -L/usr/local/lib/atlas -llapack -lptf77blas -lptcblas -latlas -lgfortran -o build/lib.linux-x86_64-2.4/numpy/linalg/lapack_lite.so" failed with exit status 1 However I have compiled all the software explicitly with the -fPIC flag on. Attached is my make.inc for LAPACK and my Makefile for ATLAS. I followed these instructions to create a hybrid LAPACK/ATLAS archive: http://math-atlas.sourceforge.net/errata.html#completelp Interestingly enough, if I just use the bare version of ATLAS, numpy compiles fine. If I use the bare version of LAPACK, numpy compiles fine . Any help would be greatly appreciated. -Yi
Yi Qiang wrote:
Interestingly enough, if I just use the bare version of ATLAS, numpy compiles fine. If I use the bare version of LAPACK, numpy compiles fine . Actually, I take that back. I get the same error when trying to link against the standalone version of LAPACK, so that suggests something went wrong there. And here are the files I forgot to attach!
Any help would be greatly appreciated.
-Yi
------------------------------------------------------- All the advantages of Linux Managed Hosting--Without the Cost and Risk! Fully trained technicians. The highest number of Red Hat certifications in the hosting industry. Fanatical Support. Click to learn more http://sel.as-us.falkag.net/sel?cmd=lnk&kid=107521&bid=248729&dat=121642 _______________________________________________ Numpy-discussion mailing list Numpy-discussion@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/numpy-discussion
#################################################################### # LAPACK make include file. # # LAPACK, Version 3.0 # # June 30, 1999 # #################################################################### # SHELL = /bin/sh # # The machine (platform) identifier to append to the library names # PLAT = _LINUX # # Modify the FORTRAN and OPTS definitions to refer to the # compiler and desired compiler options for your machine. NOOPT # refers to the compiler options desired when NO OPTIMIZATION is # selected. Define LOADER and LOADOPTS to refer to the loader and # desired load options for your machine. # FORTRAN = gfortran OPTS = -fPIC -funroll-all-loops -fno-f2c -O2 DRVOPTS = $(OPTS) NOOPT = LOADER = gfortran LOADOPTS = -fPIC # # The archiver and the flag(s) to use when building archive (library) # If you system has no ranlib, set RANLIB = echo. # ARCH = ar ARCHFLAGS= cr RANLIB = ranlib # # The location of the libraries to which you will link. (The # machine-specific, optimized BLAS library should be used whenever # possible.) # BLASLIB = ../../blas$(PLAT).a LAPACKLIB = lapack$(PLAT).a TMGLIB = tmglib$(PLAT).a EIGSRCLIB = eigsrc$(PLAT).a LINSRCLIB = linsrc$(PLAT).a # ----------------------------- # Make.ARCH for ATLAS3.6.0 # ----------------------------- # ---------------------------------- # Make sure we get the correct shell # ---------------------------------- SHELL = /bin/sh # ------------------------------------------------- # Name indicating the platform to configure BLAS to # ------------------------------------------------- ARCH = Linux_HAMMER64SSE2_2 # ------------------- # Various directories # ------------------- TOPdir = /home/yi/build/ATLAS INCdir = $(TOPdir)/include/$(ARCH) SYSdir = $(TOPdir)/tune/sysinfo/$(ARCH) GMMdir = $(TOPdir)/src/blas/gemm/$(ARCH) UMMdir = $(GMMdir) GMVdir = $(TOPdir)/src/blas/gemv/$(ARCH) GR1dir = $(TOPdir)/src/blas/ger/$(ARCH) L1Bdir = $(TOPdir)/src/blas/level1/$(ARCH) L2Bdir = $(TOPdir)/src/blas/level2/$(ARCH) L3Bdir = $(TOPdir)/src/blas/level3/$(ARCH) TSTdir = $(TOPdir)/src/testing/$(ARCH) AUXdir = $(TOPdir)/src/auxil/$(ARCH) CBLdir = $(TOPdir)/interfaces/blas/C/src/$(ARCH) FBLdir = $(TOPdir)/interfaces/blas/F77/src/$(ARCH) BINdir = $(TOPdir)/bin/$(ARCH) LIBdir = $(TOPdir)/lib/$(ARCH) PTSdir = $(TOPdir)/src/pthreads MMTdir = $(TOPdir)/tune/blas/gemm/$(ARCH) MVTdir = $(TOPdir)/tune/blas/gemv/$(ARCH) R1Tdir = $(TOPdir)/tune/blas/ger/$(ARCH) L1Tdir = $(TOPdir)/tune/blas/level1/$(ARCH) L3Tdir = $(TOPdir)/tune/blas/level3/$(ARCH) # --------------------------------------------------------------------- # Name and location of scripts for running executables during tuning # --------------------------------------------------------------------- ATLRUN = $(BINdir)/ATLrun.sh ATLFWAIT = $(BINdir)/xatlas_waitfile # --------------------- # Libraries to be built # --------------------- ATLASlib = $(LIBdir)/libatlas.a CBLASlib = $(LIBdir)/libcblas.a F77BLASlib = $(LIBdir)/libf77blas.a PTCBLASlib = $(LIBdir)/libptcblas.a PTF77BLASlib = $(LIBdir)/libptf77blas.a LAPACKlib = $(LIBdir)/liblapack.a TESTlib = $(LIBdir)/libtstatlas.a # ------------------------------------------- # Upper bound on largest cache size, in bytes # ------------------------------------------- L2SIZE = -DL2SIZE=2097152 # --------------------------------------- # Command setting up correct include path # --------------------------------------- INCLUDES = -I$(TOPdir)/include -I$(TOPdir)/include/$(ARCH) \ -I$(TOPdir)/include/contrib # ------------------------------------------- # Defines for setting up F77/C interoperation # ------------------------------------------- F2CDEFS = -DAdd_ -DStringSunStyle # -------------------------------------- # Special defines for user-supplied GEMM # -------------------------------------- UMMDEFS = # ------------------------------ # Architecture identifying flags # ------------------------------ ARCHDEFS = -DATL_OS_Linux -DATL_ARCH_HAMMER64 -DATL_SSE2 -DATL_SSE1 -DATL_GAS_x8664 -m64 # ------------------------------------------------------------------- # NM is the flag required to name a compiled object/executable # OJ is the flag required to compile to object rather than executable # These flags are used by all compilers. # ------------------------------------------------------------------- NM = -o OJ = -c # --------------------------------------------------------------------------- # Fortran 77 compiler and the flags to use. Presently, ATLAS does not itself # use any Fortran 77, but vendor BLAS are typically written for Fortran, so # any links that include non-ATLAS BLAS will use FLINKER instead of CLINKER # --------------------------------------------------------------------------- F77 = gfortran F77FLAGS = -fPIC -fomit-frame-pointer -O -m64 FLINKER = $(F77) FLINKFLAGS = $(F77FLAGS) FCLINKFLAGS = $(FLINKFLAGS) # --------------------------------------------------------------------------- # Various C compilers, and the linker to be used when we are not linking in # non-ATLAS BLAS (which usually necessitate using the Fortran linker). # The C compilers recognized by ATLAS are: # CC : Compiler to use to compile regular, non-generated code # MCC : Compiler to use to compile generated, highly-optimized code # XCC : Compiler to be used on the compile engine of a cross-compiler # These will typically all be the same. An example of where this is not # the case would be DEC ALPHA 21164, where you want to use gcc for MCC, # because DEC's cc does not allow the programmer access to all 32 floating # point registers. However, on normal C code, DEC's cc produces much faster # code than gcc, so you CC set to cc. Of course, any system where you are # cross-compiling, you will need to set XCC differently than CC & MCC. # --------------------------------------------------------------------------- CDEFS = $(L2SIZE) $(INCLUDES) $(F2CDEFS) $(ARCHDEFS) -DATL_NCPU=2 GOODGCC = gcc CC = /usr/bin/gcc CCFLAG0 = -fPIC -fomit-frame-pointer -O -mfpmath=387 -m64 CCFLAGS = $(CDEFS) $(CCFLAG0) MCC = /usr/bin/gcc MMFLAGS = -fPIC -fomit-frame-pointer -O -mfpmath=387 -m64 XCC = /usr/bin/gcc XCCFLAGS = $(CDEFS) -fPIC -fomit-frame-pointer -O -mfpmath=387 -m64 CLINKER = $(CC) CLINKFLAGS = $(CCFLAGS) BC = $(CC) BCFLAGS = $(CCFLAGS) ARCHIVER = ar ARFLAGS = r RANLIB = echo # ------------------------------------- # tar, gzip, gunzip, and parallel make # ------------------------------------- TAR = /bin/tar GZIP = /bin/gzip GUNZIP = /bin/gunzip PMAKE = $(MAKE) -j 2 # ------------------------------------ # Reference and system libraries # ------------------------------------ BLASlib = FBLASlib = FLAPACKlib = LIBS = -lpthread -lm # ---------------------------------------------------------- # ATLAS install resources (include arch default directories) # ---------------------------------------------------------- ARCHDEF = MMDEF = INSTFLAGS = # --------------------------------------- # Generic targets needed by all makefiles # --------------------------------------- waitfile:
Yi Qiang <yi@yiqiang.net> writes:
Yi Qiang wrote:
https://lists.sourceforge.net/lists/listinfo/numpy-discussion #################################################################### # LAPACK make include file. # # LAPACK, Version 3.0 # # June 30, 1999 # #################################################################### # SHELL = /bin/sh # # The machine (platform) identifier to append to the library names # PLAT = _LINUX # # Modify the FORTRAN and OPTS definitions to refer to the # compiler and desired compiler options for your machine. NOOPT # refers to the compiler options desired when NO OPTIMIZATION is # selected. Define LOADER and LOADOPTS to refer to the loader and # desired load options for your machine. # FORTRAN = gfortran OPTS = -fPIC -funroll-all-loops -fno-f2c -O2 DRVOPTS = $(OPTS) NOOPT =
Maybe NOOPT needs -fPIC? That's the only one I see where it could be missing. -- |>|\/|< /--------------------------------------------------------------------------\ |David M. Cooke http://arbutus.physics.mcmaster.ca/dmc/ |cookedm@physics.mcmaster.ca
David M. Cooke wrote:
Yi Qiang <yi@yiqiang.net> writes:
FORTRAN = gfortran OPTS = -fPIC -funroll-all-loops -fno-f2c -O2 DRVOPTS = $(OPTS) NOOPT =
Maybe NOOPT needs -fPIC? That's the only one I see where it could be missing.
That sounds right. dlamch is not supposed to be compiled with optimization, IIRC. -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth." -- Umberto Eco
participants (3)
-
cookedm@physics.mcmaster.ca
-
Robert Kern
-
Yi Qiang