-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
executable file
·56 lines (47 loc) · 1.79 KB
/
setup.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#! /usr/bin/env python
from distutils.core import setup, Extension, Command
import numpy
from sys import argv
if argv[1] == "build":
argv[1] = "build_ext"
if argv[1] == "build_ext":
argv.insert(2, "--swig-opts=-c++")
class clean(Command):
"""Cleans *.pyc and debian trashs, so you should get the same copy as
is in the svn.
"""
description = "Clean everything"
user_options = [("all","a","the same")]
def initialize_options(self):
self.all = None
def finalize_options(self):
pass
def run(self):
import os
os.system("py.cleanup")
os.system("rm -f python-build-stamp-2.4")
os.system("rm -f MANIFEST")
os.system("rm -rf build")
os.system("rm -rf dist")
os.system("rm -f src/femlib/libmeshpy/libmeshpy.py")
os.system("rm -f src/femlib/libmeshpy/libmeshpy_wrap.cpp")
os.system("rm -f src/femlib/libmeshpy/libmeshpy_wrap.h")
extdir="src/femlib/libmeshpy/"
_libmeshpy = Extension("femlib.libmeshpy._libmeshpy",
[extdir+"libmeshpy.i", extdir+"libmeshpy.cxx"],
include_dirs = [numpy.get_include(),"/usr/include/libmesh",
"/usr/include/mpi","/usr/include/petsc","femlib/src"],
extra_compile_args=["-O2"],
libraries = ["mesh","petsc","petscdm","petscksp","petscmat",
"petscsnes","petscts","petscvec"],
)
setup(name = "libmeshpy",
description = "Libmesh bindings for python",
author = "Ondrej Certik",
packages = ["femlib", "geom", "femlib.libmeshpy"],
package_dir = {"": "src"},
ext_modules = [_libmeshpy],
cmdclass = {
'clean' : clean,
},
)