From f257016a934e6858492dec9df5ab9ce3efa1b0f6 Mon Sep 17 00:00:00 2001 From: Josh Allen Date: Wed, 29 Dec 2010 12:07:31 -0500 Subject: [PATCH] Some changes to the Linux build scripts. The PyDAS.dassl extension module now links with the DASSL object files rather than the static library. This should help make installation on Windows easier. Fixed the header comment in the setup.py script; it inadvertently referred to RMG instead of PyDAS. --- Makefile | 15 +++++++++---- make.inc.example | 3 +++ setup.py | 56 +++++++++++++++++++++++++++--------------------- 3 files changed, 45 insertions(+), 29 deletions(-) create mode 100644 make.inc.example diff --git a/Makefile b/Makefile index c478950..ae5cf0a 100644 --- a/Makefile +++ b/Makefile @@ -4,13 +4,16 @@ # ################################################################################ -include make.inc +-include make.inc all: DASSL DASPK DASKR cython cython: python setup.py build_ext $(CYTHON_FLAGS) +install: + python setup.py install + DASSL: $(MAKE) -C dassl F77=$(F77) @@ -20,12 +23,16 @@ DASPK: DASKR: $(MAKE) -C daskr F77=$(F77) -clean: - python setup.py clean $(CLEAN_FLAGS) +clean: clean-DASSL clean-DASPK clean-DASKR clean-cython + +clean-DASSL: $(MAKE) -C dassl clean + +clean-DASPK: $(MAKE) -C daspk clean + +clean-DASKR: $(MAKE) -C daskr clean - rm -f PyDAS/*.so PyDAS/*.pyc clean-cython: python setup.py clean $(CLEAN_FLAGS) diff --git a/make.inc.example b/make.inc.example new file mode 100644 index 0000000..20f773b --- /dev/null +++ b/make.inc.example @@ -0,0 +1,3 @@ +F77=gfortran + +CYTHON_FLAGS=--inplace diff --git a/setup.py b/setup.py index 7d8e0a4..ace3866 100644 --- a/setup.py +++ b/setup.py @@ -3,7 +3,7 @@ ################################################################################ # -# RMG - Reaction Mechanism Generator +# PyDAS - A Python wrapper to several differential algebraic system solvers # # Copyright (c) 2010 by Joshua W. Allen (jwallen@mit.edu) # @@ -30,28 +30,34 @@ import numpy if __name__ == '__main__': - - from distutils.core import setup - from distutils.extension import Extension - from Cython.Distutils import build_ext - - # Turn on HTML annotation file generation (useful for - import Cython.Compiler.Options - Cython.Compiler.Options.annotate = True - - # The Cython modules to setup - ext_modules = [ - Extension('PyDAS.dassl', ['PyDAS/dassl.pyx'], include_dirs=['PyDAS', numpy.get_include()], library_dirs=['dassl'], libraries=['gfortran', 'ddassl']), - ] + + from distutils.core import setup + from distutils.extension import Extension + from Cython.Distutils import build_ext + + # Turn on HTML annotation file generation + import Cython.Compiler.Options + Cython.Compiler.Options.annotate = True + + # The Cython extension modules to compile + ext_modules = [ + Extension( + 'PyDAS.dassl', + ['PyDAS/dassl.pyx'], + include_dirs=['PyDAS', numpy.get_include()], + libraries=['gfortran'], + extra_objects=['dassl/daux.o','dassl/ddassl.o','dassl/dlinpk.o'], + ), + ] - # Run the setup command - setup(name='PyDAS', - version='0.1.0', - description='A Python wrapper to several differential algebraic system solvers', - author='Joshua W. Allen', - author_email='jwallen@mit.edu', - url='', - packages=['PyDAS'], - cmdclass = {'build_ext': build_ext}, - ext_modules = ext_modules - ) + # Run the setup command + setup(name='PyDAS', + version='0.1.0', + description='A Python wrapper to several differential algebraic system solvers', + author='Joshua W. Allen', + author_email='jwallen@mit.edu', + url='http://github.com/jwallen/PyDAS', + packages=['PyDAS'], + cmdclass = {'build_ext': build_ext}, + ext_modules = ext_modules + )