Files
opm-common/python/setup.py

64 lines
1.7 KiB
Python
Raw Normal View History

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(
'libopmcommon_python',
2019-06-27 14:08:22 +02:00
[
'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/common_state.cpp',
2019-06-27 14:08:22 +02:00
'cxx/table_manager.cpp',
'cxx/well.cpp',
'cxx/common.cpp'
2019-06-27 14:08:22 +02:00
],
libraries=['opmcommon', 'boost_filesystem', 'boost_regex', 'ecl'],
language='c++',
undef_macros=["NDEBUG"],
include_dirs=["pybind11/include"]
),
]
setup(
name='Opm',
2019-06-27 14:08:22 +02:00
package_dir = {'': 'python'},
packages=[
'opm',
'opm.tools',
'opm.deck',
2019-06-27 14:08:22 +02:00
],
ext_modules=ext_modules,
license='Open Source',
zip_safe=False,
tests_suite='tests',
2019-06-27 14:08:22 +02:00
setup_requires=["pytest-runner", 'setuptools_scm'],
)