Skip to content

Commit

Permalink
Tweaked setup a bit
Browse files Browse the repository at this point in the history
  • Loading branch information
markcwill committed May 14, 2014
1 parent a9a08f2 commit 09de2f4
Showing 1 changed file with 20 additions and 21 deletions.
41 changes: 20 additions & 21 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,24 +1,21 @@
#
# setup.py file for compiling HASH and installing hashpy
#
from numpy.distutils.core import setup, Extension
import sys
import os
from numpy.distutils.core import setup, Extension


#--- libhashpy SETUP ---------------------------------------------------------
#--- libhashpy Fortran extension --------------------------------------------#
#
# Build extension from FORTRAN source
# Build extension from FORTRAN source of HASH subroutines
# (based on the fucntion numpy.f2py.f2py2e.run_compile)
srcdir = 'hashpy/src'

srcdir = os.path.join('hashpy', 'src')
srcf = ['fmech_subs.f', 'uncert_subs.f', 'util_subs.f',
'pol_subs.f', 'vel_subs.f', 'station_subs.f', 'vel_subs2.f']

src_list = [os.path.join(srcdir, src) for src in srcf]

ext_args = {'sources': src_list}


#
# Use as a template for non-standard (non-distro) python installls...
#
Expand All @@ -33,29 +30,31 @@ def get_linker_args_for_virtualenv(virtualenv=None):
}

# Have to link against antelope libs if installing to Antelope python
#
# TODO: get python version/path automagically.
if 'antelope' in sys.executable:
python_folder = '/opt/antelope/python2.7.2-64'
ANT_EXT_ARGS = get_linker_args_for_virtualenv(python_folder)
ext_args.update(ANT_EXT_ARGS)

ext = Extension('hashpy.libhashpy', **ext_args)
#------------------------------------------------------------------------------
#----------------------------------------------------------------------------#


### Regular setup stuff #######################################################

### SETUP ####################################################################
s_args = {'name' : 'HASHpy',
'version' : '0.5.5',
'version' : '0.5.6',
'description' : 'Routines for running HASH algorithms',
'author' : 'Mark Williams',
'url' : 'https//github.com/markcwill',
'url' : 'https//github.com/markcwill/hashpy',
'packages' : ['hashpy', 'hashpy.io', 'hashpy.plotting'],
'package_data' : {'hashpy': ['src/*.inc','src/Makefile','data/*','scripts/*', 'src/*.f']},
'ext_modules' : [ext],
'package_data' : {'hashpy': ['src/*.inc','src/Makefile','data/*',
'scripts/*', 'src/*.f']},
'ext_modules' : [Extension('hashpy.libhashpy', **ext_args)],
}
##############################################################################


# hashpy.db ------------------------------------------------------------------
# TO BE OBSELETED - break out to separate module/package so hashpy can
# hashpy.db -----------------------------------------------------------------#
# TODO: OBSELETED - break out to separate module/package so hashpy can
# stand alone.
#
# copy pf and bins from hashpy.db to antelope if available
Expand All @@ -64,7 +63,7 @@ def get_linker_args_for_virtualenv(virtualenv=None):
ant_pf = os.path.join(os.environ['ANTELOPE'], 'data', 'pf')
s_args['data_files'] = [(ant_bin, ['hashpy/scripts/dbhash']),
(ant_pf, ['hashpy/data/dbhash.pf'])]
#-----------------------------------------------------------------------------
#----------------------------------------------------------------------------#


# Go
setup(**s_args)

0 comments on commit 09de2f4

Please sign in to comment.