Opened 11 years ago

Closed 11 years ago

#19966 closed enhancement (fixed)

ATLAS variant for py25-numpy 1.3.0

Reported by: max@… Owned by: jameskyle@…
Priority: Normal Milestone:
Component: ports Version: 1.7.1
Keywords: numpy ATLAS Cc: MarcusCalhoun-Lopez (Marcus Calhoun-Lopez), skymoo (Adam Mercer)
Port: py25-numpy py26-numpy

Description

Since the latest ATLAS port fixes the 64bit compilation issue, numpy can be compiled with ATLAS support.

A simple patch for py25-numpy is attached. It should also work for py26-numpy, didn't test it tho...

Attachments (1)

py25-numpy-atlas.diff (812 bytes) - added by max@… 11 years ago.

Download all attachments as: .zip

Change History (11)

Changed 11 years ago by max@…

Attachment: py25-numpy-atlas.diff added

comment:1 Changed 11 years ago by mf2k (Frank Schima)

Cc: mcalhoun@… added
Owner: changed from macports-tickets@… to ram@…
Port: py26-numpy added

comment:2 Changed 11 years ago by skymoo (Adam Mercer)

Currently SciPy, which has NumPy as a dependency, has multiple variants to support different Fortran compilers. As ATLAS has a hard dependency on gcc43 these multiple variants will have to be removed.

comment:3 Changed 11 years ago by skymoo (Adam Mercer)

What exactly does linking against atlas do, as the installed contents with and without the atlas variant enabled are identical?

comment:4 in reply to:  3 ; Changed 11 years ago by max@…

Replying to ram@…:

What exactly does linking against atlas do, as the installed contents with and without the atlas variant enabled are identical?

At least for my use-case linking against ATLAS instead of vecLib speeds up the computation. It's hard to find any recent data on how vecLib's performance is compared ATLAS, but i guess having the option to use ATLAS doesnt hurt.

Replying to ram@…:

Currently SciPy, which has NumPy as a dependency, has multiple variants to support different Fortran compilers. As ATLAS has a hard dependency on gcc43 these multiple variants will have to be removed.

I created an enhancement for ATLAS to use gcc variants like SciPy does (see ticket #20106). If/When it get's accepted i guess this patch could be applied too?

comment:5 in reply to:  4 Changed 11 years ago by skymoo (Adam Mercer)

Replying to max@…:

At least for my use-case linking against ATLAS instead of vecLib speeds up the computation. It's hard to find any recent data on how vecLib's performance is compared ATLAS, but i guess having the option to use ATLAS doesnt hurt.

I notice you don't specify the fortran compiler in the build process, doesn't atlas need to know which fortran compiler to use? I'll look at what happens if a fortran compiler is specified...

I created an enhancement for ATLAS to use gcc variants like SciPy does (see ticket #20106). If/When it get's accepted i guess this patch could be applied too?

There's currently a proposal, see #20103, to use the same gcc version for all scientific ports to make things a lot easier...

comment:6 Changed 11 years ago by jameskyle@…

Cc: jameskyle@… added

Cc Me!

comment:7 Changed 11 years ago by skymoo (Adam Mercer)

OK I've looked at this in more detail and it appears that no fortran compiler needs to specified, and I can confirm that numpy is using atlas. However when I try to build scipy it fails with the following error:

DEBUG: Executing org.macports.build (py25-scipy)
DEBUG: Environment: MACOSX_DEPLOYMENT_TARGET='10.5' CCFLAGS='-I/opt/local/include -L/opt/local/lib'
DEBUG: Assembled command: 'cd "/opt/local/var/macports/build/_Users_ram_opt_macports_python_py25-scipy/work/scipy-0.7.1" && /opt/local/bin/python2.5 setup.py --no-user-cfg config_fc --fcompiler gnu95 --f77exec /opt/local/bin/gfortran-mp-4.3 --f90exec /opt/local/bin/gfortran-mp-4.3 build'
Traceback (most recent call last):
  File "setup.py", line 160, in <module>
    setup_package()
  File "setup.py", line 127, in setup_package
    from numpy.distutils.core import setup
  File "/opt/local/lib/python2.5/site-packages/numpy/__init__.py", line 130, in <module>
    import add_newdocs
  File "/opt/local/lib/python2.5/site-packages/numpy/add_newdocs.py", line 9, in <module>
    from lib import add_newdoc
  File "/opt/local/lib/python2.5/site-packages/numpy/lib/__init__.py", line 13, in <module>
    from polynomial import *
  File "/opt/local/lib/python2.5/site-packages/numpy/lib/polynomial.py", line 18, in <module>
    from numpy.linalg import eigvals, lstsq
  File "/opt/local/lib/python2.5/site-packages/numpy/linalg/__init__.py", line 47, in <module>
    from linalg import *
  File "/opt/local/lib/python2.5/site-packages/numpy/linalg/linalg.py", line 22, in <module>
    from numpy.linalg import lapack_lite
ImportError: dlopen(/opt/local/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/numpy/linalg/lapack_lite.so, 2): Library not loaded: libptf77blas.dylib
  Referenced from: /opt/local/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/numpy/linalg/lapack_lite.so
  Reason: image not found

libptff77blas.dylib is provided by atlas and seems fine:

$ port provides /opt/local/lib/libptf77blas.dylib
/opt/local/lib/libptf77blas.dylib is provided by: atlas
$ file /opt/local/lib/libptf77blas.dylib
/opt/local/lib/libptf77blas.dylib: Mach-O dynamically linked shared library i386
$ ls -l /opt/local/lib/libptf77blas.dylib
-rw-r--r-- 2 ram admin 107272 2009-06-18 19:47 /opt/local/lib/libptf77blas.dylib
$

Do you not get this error?

comment:8 Changed 11 years ago by skymoo (Adam Mercer)

Owner: changed from ram@… to jameskyle@…

James has patches

comment:9 Changed 11 years ago by skymoo (Adam Mercer)

Cc: ram@… added; jameskyle@… removed

comment:10 Changed 11 years ago by skymoo (Adam Mercer)

Resolution: fixed
Status: newclosed

py25-numpy in r60072, py25-scipy in r60073, py26-numpy in r59608, py26-scipy in r59609

Note: See TracTickets for help on using tickets.