Changeset 5838


Ignore:
Timestamp:
Oct 15, 2008, 1:44:54 PM (16 years ago)
Author:
steve
Message:

Updated setup.py

Location:
anuga_core/source/pypar-numeric
Files:
1 added
2 edited

Legend:

Unmodified
Added
Removed
  • anuga_core/source/pypar-numeric/pypar.py

    r5779 r5838  
    4747
    4848# Meta data
    49 __version__ = '1.9.3'
    50 __date__ = '24 April 2007'
    51 __author__ = 'Ole M. Nielsen'
     49from __metadata__ import __version__, __date__, __author__
    5250
    5351
  • anuga_core/source/pypar-numeric/setup.py

    r5779 r5838  
    99# Some times you'll have to add a file called pypar.pth
    1010# containing the word pypar to site-packages
     11#
     12# See http://docs.python.org/dist/pure-pkg.html for more on distutils
    1113
    12 
     14# FIXME: Now mpiext.c and pypar.py are assumed to be in this directory.
     15# Maybe, we should put them in the default package directory, pypar.
     16# The repository structure would then be
     17#
     18# pypar
     19#     demos
     20#     documentation
     21#     source
     22#          pypar
    1323
    1424from distutils.core import setup, Extension
     25
     26# FIXME (Ole): This works, but I don't know how to use it
     27# Generate Python EGG if possible.
     28#try:
     29#   from setuptools import setup, Extension
     30#except ImportError:
     31#   pass
     32
    1533import distutils.sysconfig
    1634import distutils.debug
     
    1937import string
    2038import tempfile
     39import numpy
     40from __metadata__ import __version__, __date__, __author__
     41
    2142
    2243def setup_compiler():
    2344    distutils.sysconfig.get_config_vars()
    2445    config_vars = distutils.sysconfig._config_vars
    25 
     46   
    2647    if sys.platform == 'sunos5':
    2748        config_vars['LDSHARED'] = "gcc -G"
    2849        config_vars['CCSHARED'] = ""
    29 
     50       
    3051
    3152def uniq_arr(arr):
     
    91112    if not output:
    92113        if sys.platform=='win32': #From Simon Frost
    93             #output = "gcc -L$MPICH_DIR\SDK.gcc\lib -lmpich -I$MPICH_DIR\SDK.gcc\include"
    94             output = "gcc -LC:\MPICH2\lib -lmpi -IC:\MPICH2\include"
    95 
     114            output = "gcc -L$MPICH_DIR\SDK.gcc\lib -lmpich -I$MPICH_DIR\SDK.gcc\include"
    96115        else:
    97116            output = "cc -L/usr/opt/mpi -lmpi -lelan"
     
    127146if __name__ == "__main__":
    128147    setup_compiler()
    129 
     148   
    130149    mpi_flags = get_mpi_flags()
     150    mpi_flags['inc_dirs'].append(numpy.get_include())
    131151
    132152
    133     # FIXME: It would be good to set specific compiler flags, e.g.
    134     # for our AMD opteron cluster which is using the portland group
    135     # compiler pgcc, but I can't get this to work let alone get distutils
    136     # to give some diagnostics on what flags it is actually using.
     153    # setting some extra compile flags for AMD64, utilizing
     154    # distutils.sysconfig to check which compiler to use
    137155    if os.name == 'posix' and os.uname()[4] == 'x86_64':
    138156        #Extra flags for 64 bit architectures
    139         #extra_compile_args = ' -fPIC -m64' #Valid for gcc       
    140         extra_compile_args = ' -fPIC -tp amd64' #Valid for pgcc
     157        if 'pgcc' in distutils.sysconfig.get_config_var('CC'):
     158            extra_compile_args = [' -fPIC -tp amd64'] #Valid for pgcc
     159        elif 'gcc' in distutils.sysconfig.get_config_var('CC'):
     160            extra_compile_args = [' -fPIC -m64'] #Valid for gcc
     161        elif 'icc' in distutils.sysconfig.get_config_var('CC'):
     162            extra_compile_args = [' -fPIC'] #Valid for icc
     163        else:
     164            extra_compile_args = None
    141165    else:
    142166        extra_compile_args = None
    143167
    144168
    145    
    146169
    147     setup(name="Pypar",
    148           version="1.9.2",
    149           description="Pypar - Parallel Python",
    150           long_description="Pypar - Parallel Python, no-frills MPI interface",
    151           author="Ole Nielsen",
    152           author_email="Ole.Nielsen@anu.edu.au",
    153           url="http://datamining.anu.edu.au/pypar",
    154           package_dir = {'': 'lib'},
     170    setup(name='Pypar',
     171          version=__version__,
     172          description='Pypar - Parallel Python',
     173          long_description='Pypar - Parallel Python, no-frills MPI interface',
     174          author=__author__,
     175          author_email='ole.moller.nielsen@gmail.com',
     176          url='http://sourceforge.net/projects/pypar',
     177          package_dir = {'pypar': ''}, # Use files in this dirctory
    155178          packages  = ['pypar'],
    156179          ext_modules = [Extension('pypar.mpiext',
    157                                    ['mpiext.c'],
     180                                   ['mpiext.c'], 
    158181                                   include_dirs=mpi_flags['inc_dirs'],
    159182                                   library_dirs=mpi_flags['lib_dirs'],
     
    162185                                   undef_macros=mpi_flags['undef_macros'],
    163186                                   extra_compile_args=extra_compile_args)]
    164           )
     187         )
Note: See TracChangeset for help on using the changeset viewer.