forked from WISDEM/WISDEM
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
64 lines (58 loc) · 2.88 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
57
58
59
60
61
62
63
64
#!/usr/bin/env python
import os
import sys
import platform
import glob
from setuptools import setup, find_packages
from numpy.distutils.core import setup, Extension
os.environ['NPY_DISTUTILS_APPEND_FLAGS'] = '1'
# CXXFLAGS for pBEAM
if platform.system() == 'Windows':
pbeamArgs = ['-std=gnu++11','-fPIC']
else:
pbeamArgs = ['-std=c++11','-fPIC']
# CFLAGS for pyMAP
if platform.system() == 'Windows': # For Anaconda
pymapArgs = ['-O1', '-m64', '-fPIC', '-std=c99','-DCMINPACK_NO_DLL']
elif sys.platform == 'cygwin':
pymapArgs = ['-O1', '-m64', '-fPIC', '-std=c99']
elif platform.system() == 'Darwin':
pymapArgs = ['-O1', '-m64', '-fno-omit-frame-pointer', '-fPIC']#, '-std=c99']
else:
#pymapArgs = ['-O1', '-m64', '-fPIC', '-std=c99', '-D WITH_LAPACK']
pymapArgs = ['-O1', '-m64', '-fPIC', '-std=c99']
# All the extensions
bemExt = Extension('wisdem.ccblade._bem',
sources=[os.path.join('wisdem','ccblade','bem.f90')],
extra_compile_args=['-O2','-fPIC'])
pyframeExt = Extension('wisdem.pyframe3dd._pyframe3dd',
sources=glob.glob(os.path.join('wisdem','pyframe3dd','src','*.c')))
precompExt = Extension('wisdem.rotorse._precomp',
sources=[os.path.join('wisdem','rotorse','PreCompPy.f90')],
extra_compile_args=['-O2','-fPIC'])
pbeamExt = Extension('wisdem.pBeam._pBEAM',
sources=glob.glob(os.path.join('wisdem','pBeam','src','*.cpp')),
extra_compile_args=pbeamArgs,
include_dirs=[os.path.join('wisdem','include')])
pymapExt = Extension('wisdem.pymap._libmap', sources=glob.glob(os.path.join('wisdem','pymap','**','*.c'), recursive=True)+
glob.glob(os.path.join('wisdem','pymap','**','*.cc'), recursive=True),
extra_compile_args=pymapArgs,
include_dirs=[os.path.join('wisdem','include','lapack')])
# Top-level setup
setup(
name = 'WISDEM',
version = '2.1.4',
description = 'Wind-Plant Integrated System Design & Engineering Model',
long_description = 'WISDEM is a Python package for conducting multidisciplinary analysis and optimization of wind turbines and plants',
url = 'https://github.com/WISDEM/WISDEM',
author = 'NREL WISDEM Team',
author_email = '[email protected]',
install_requires = ['openmdao>= 2.0','numpy','scipy','pandas','simpy','geopy','pytest','pyyaml','matplotlib','jsonschema', 'marmot-agents'],
package_data = {'wisdem': []},
#package_dir = {'': 'wisdem'},
packages = find_packages(exclude=['docs', 'tests', 'ext']),
license = 'Apache License, Version 2.0',
python_requires = '>= 3.4',
ext_modules = [bemExt, pyframeExt, precompExt, pbeamExt, pymapExt],
zip_safe = False
)