forked from saullocastro/compmech
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py
39 lines (32 loc) · 1.17 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
from glob import glob
import sys
import os
from subprocess import Popen
import numpy
#params = 'build_ext -inplace -IC:\clones\cubature\cubature ' + ' '.join(sys.argv[1:])
params = 'build_ext --inplace -I%s' % numpy.get_include() + ' '.join(sys.argv[1:]) + ' clean'
cwd = os.getcwd()
if os.name == 'nt':
use_sdk = 'DISTUTILS_USE_SDK'
if not use_sdk in os.environ.keys():
os.environ[use_sdk] = '1'
print('####################')
print('Compiling modules...')
print('####################')
print('')
basedirs = [
os.path.join('compmech', 'conecyl', 'clpt'),
os.path.join('compmech', 'conecyl', 'fsdt'),
os.path.join('compmech', 'integrate'),
os.path.join('compmech', 'conecyl', 'imperfections'),
os.path.join('compmech', 'aero', 'pistonplate', 'clpt'),
os.path.join('compmech', 'aero', 'pistonstiffpanel', 'clpt'),
]
for basedir in basedirs:
print('Compiling setup.py in %s' % basedir)
basedir = os.path.sep.join([cwd, basedir])
os.chdir(basedir)
for fname in glob('setup*.py'):
p = Popen(('python {} '.format(fname) + params), shell=True)
p.wait()
os.chdir(cwd)