2019-06-27 14:08:22 +02:00
|
|
|
from setuptools import setup, find_packages
|
|
|
|
|
|
|
|
|
|
from setuptools import Extension
|
|
|
|
|
from setuptools.command.build_ext import build_ext
|
|
|
|
|
import sys
|
|
|
|
|
import setuptools
|
|
|
|
|
|
|
|
|
|
import glob
|
|
|
|
|
import os
|
2019-08-09 13:02:04 +02:00
|
|
|
import subprocess
|
|
|
|
|
|
|
|
|
|
try:
|
2019-08-09 14:57:49 +02:00
|
|
|
subprocess.call(["c++", "--version"])
|
2019-08-09 13:02:04 +02:00
|
|
|
subprocess.call(['ccache', '--version'])
|
2019-08-09 14:57:49 +02:00
|
|
|
os.environ['CC'] = 'ccache c++'
|
2019-08-09 13:02:04 +02:00
|
|
|
except OSError as e:
|
|
|
|
|
print('\nNOTE: please install ccache for faster compilation of python bindings.\n')
|
2019-06-27 14:08:22 +02:00
|
|
|
|
|
|
|
|
if 'build' in sys.argv:
|
|
|
|
|
if not 'build_ext' in sys.argv:
|
|
|
|
|
raise TypeError("Missing option 'build_ext'.")
|
|
|
|
|
|
|
|
|
|
ext_modules = [
|
|
|
|
|
Extension(
|
|
|
|
|
'libsunbeam',
|
|
|
|
|
[
|
|
|
|
|
'cxx/connection.cpp',
|
|
|
|
|
'cxx/deck.cpp',
|
|
|
|
|
'cxx/deck_keyword.cpp',
|
|
|
|
|
'cxx/eclipse_3d_properties.cpp',
|
|
|
|
|
'cxx/eclipse_config.cpp',
|
|
|
|
|
'cxx/eclipse_grid.cpp',
|
|
|
|
|
'cxx/eclipse_state.cpp',
|
|
|
|
|
'cxx/group.cpp',
|
|
|
|
|
'cxx/group_tree.cpp',
|
|
|
|
|
'cxx/parser.cpp',
|
|
|
|
|
'cxx/schedule.cpp',
|
|
|
|
|
'cxx/sunbeam_state.cpp',
|
|
|
|
|
'cxx/table_manager.cpp',
|
|
|
|
|
'cxx/well.cpp',
|
|
|
|
|
'cxx/sunbeam.cpp'
|
|
|
|
|
],
|
|
|
|
|
libraries=['opmcommon', 'boost_filesystem', 'boost_regex', 'ecl'],
|
|
|
|
|
language='c++',
|
|
|
|
|
undef_macros=["NDEBUG"],
|
|
|
|
|
include_dirs=["pybind11/include"]
|
|
|
|
|
),
|
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
setup(
|
|
|
|
|
name='Sunbeam',
|
|
|
|
|
package_dir = {'': 'python'},
|
|
|
|
|
packages=[
|
|
|
|
|
'sunbeam',
|
|
|
|
|
'sunbeam.tools',
|
|
|
|
|
'sunbeam.deck',
|
|
|
|
|
],
|
|
|
|
|
ext_modules=ext_modules,
|
|
|
|
|
license='Open Source',
|
|
|
|
|
zip_safe=False,
|
|
|
|
|
test_suite='tests',
|
|
|
|
|
setup_requires=["pytest-runner", 'setuptools_scm'],
|
|
|
|
|
)
|