A two-year old Sage ticket added 64-bit OS X support for Numpy.

http://trac.sagemath.org/sage_trac/ticket/3186

But the method used was a bit brain-dead. A script with a hard-coded path to gcc was used, which had the -m64 flag. That was then copied and used as compiler.

I've removed that file gcc_fake, but created a similar one dynamically, so the path of gcc does not have to be /usr/bin/gcc. The package is here

http://boxen.math.washington.edu/home/kirkby/patches/numpy-1.3.0.p4.spkg
awaiting review
http://trac.sagemath.org/sage_trac/ticket/8086

But this is really a hack, so the issue has now been reported upstream to the Numpy developers via their bug-tracking system. Hopefully they can fix it so CFLAGS gets inherited properly.

http://projects.scipy.org/numpy/ticket/1525

Dave



-------- Original Message --------
Subject: [NumPy] #1525: Numpy is ignoring CFLAGS, which makes a 64-bit build difficult
Date: Mon, 28 Jun 2010 07:46:32 -0000
From: NumPy Trac" <numpy-tick...@scipy.org>
Reply-To: numpy-tick...@scipy.org
CC: numpy-tick...@scipy.org

#1525: Numpy is ignoring CFLAGS, which makes a 64-bit build difficult
------------------------+---------------------------------------------------
 Reporter:  drkirkby    |       Owner:  somebody
     Type:  defect      |      Status:  new
 Priority:  normal      |   Milestone:  2.0.0
Component:  numpy.core  |     Version:  1.3.0
 Keywords:              |
------------------------+---------------------------------------------------
 I am trying to get Numpy to build as a 64-bit executable, as part of a
 64-bit port of Sage to !OpenSolaris. But despite adding the compiler
 option -m64 (which generates 64-bit objects) to CFLAGS, Numpy ignores this
 so GCC generates an error.

 The same issue has been known in Sage for a long time affecting OS X
 systems where building 32-bit objects is the default, so one needed the
 -m64 compiler flag to generate the 64-bit code.

 {{{
  wrong ELF class: ELFCLASS64
 }}}

 which is typical of when a program is expecting to find a 32-bit object,
 but finds a 64-bit one.

 {{{
 numpy-1.3.0.p2/src/setup.py
 numpy-1.3.0.p2/src/MANIFEST.in
 numpy-1.3.0.p2/.hgtags
 Finished extraction
 ****************************************************
 Host system
 uname -a:
 SunOS hawk 5.11 snv_111b i86pc i386 i86pc
 ****************************************************
 ****************************************************
 CC Version
 gcc -v
 Using built-in specs.
 Target: i386-pc-solaris2.11
 Configured with: ../gcc-4.3.4/configure --prefix=/usr/local/gcc-4.3.4-GNU-
 assembler-Sun-linker --with-as=/usr/local/binutils-2.20/bin/as --with-
 ld=/usr/ccs/bin/ld --with-gmp=/usr/local --with-mpfr=/usr/local
 Thread model: posix
 gcc version 4.3.4 (GCC)
 ****************************************************
 Running from numpy source directory.
 F2PY Version 2
 blas_opt_info:
 blas_mkl_info:
   libraries mkl,vml,guide not found in
 /export/home/drkirkby/sage-4.3.1/local/lib
   NOT AVAILABLE

 atlas_blas_threads_info:
 Setting PTATLAS=ATLAS
   libraries ptf77blas,ptcblas,atlas not found in
 /export/home/drkirkby/sage-4.3.1/local/lib
   NOT AVAILABLE

 atlas_blas_info:
   FOUND:
     libraries = ['f77blas', 'cblas', 'atlas']
     library_dirs = ['/export/home/drkirkby/sage-4.3.1/local/lib']
     language = c
     include_dirs = ['/export/home/drkirkby/sage-4.3.1/local/include']


/export/home/drkirkby/sage-4.3.1/spkg/build/numpy-1.3.0.p2/src/numpy/distutils/command/config.py:361:
 DeprecationWarning:
 +++++++++++++++++++++++++++++++++++++++++++++++++
 Usage of get_output is deprecated: please do not
 use it anymore, and avoid configuration checks
 involving running executable on the target machine.
 +++++++++++++++++++++++++++++++++++++++++++++++++

   DeprecationWarning)
 customize Sage_FCompiler_1
 customize Sage_FCompiler_1
 customize Sage_FCompiler_1 using config
 compiling '_configtest.c':

 /* This file is generated from numpy/distutils/system_info.py */
 void ATL_buildinfo(void);
 int main(void) {
   ATL_buildinfo();
   return 0;
 }
 C compiler: gcc -fno-strict-aliasing -DNDEBUG -g -O3 -Wall -Wstrict-
 prototypes -fPIC

 compile options: '-c'
 gcc: _configtest.c
 gcc _configtest.o -L/export/home/drkirkby/sage-4.3.1/local/lib -lf77blas
 -lcblas -latlas -o _configtest
 ld: fatal: file /export/home/drkirkby/sage-4.3.1/local/lib/libf77blas.so:
 wrong ELF class: ELFCLASS64
 ld: fatal: file /export/home/drkirkby/sage-4.3.1/local/lib/libcblas.so:
 wrong ELF class: ELFCLASS64
 ld: fatal: file /export/home/drkirkby/sage-4.3.1/local/lib/libatlas.so:
 wrong ELF class: ELFCLASS64
 ld: fatal: file processing errors. No output written to _configtest
 collect2: ld returned 1 exit status
 ld: fatal: file /export/home/drkirkby/sage-4.3.1/local/lib/libf77blas.so:
 wrong ELF class: ELFCLASS64
 ld: fatal: file /export/home/drkirkby/sage-4.3.1/local/lib/libcblas.so:
 wrong ELF class: ELFCLASS64
 ld: fatal: file /export/home/drkirkby/sage-4.3.1/local/lib/libatlas.so:
 wrong ELF class: ELFCLASS64
 ld: fatal: file processing errors. No output written to _configtest
 collect2: ld returned 1 exit status
 failure.
 removing: _configtest.c _configtest.o
 Status: 255
 Output:
   FOUND:
     libraries = ['f77blas', 'cblas', 'atlas']
     library_dirs = ['/export/home/drkirkby/sage-4.3.1/local/lib']
     language = c
     define_macros = [('NO_ATLAS_INFO', 2)]
     include_dirs = ['/export/home/drkirkby/sage-4.3.1/local/include']

 lapack_opt_info:
 lapack_mkl_info:
 }}}

--
Ticket URL: <http://projects.scipy.org/numpy/ticket/1525>
NumPy <http://projects.scipy.org/numpy>
My example project

--
To post to this group, send an email to sage-devel@googlegroups.com
To unsubscribe from this group, send an email to 
sage-devel+unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-devel
URL: http://www.sagemath.org

Reply via email to