setup.py (71c263ca3a3ce57731d1f7a04e93e4c31116f80b) setup.py (ee05e7903eee0d52eb5884b49005c2a7f1eebf85)
1#!/usr/bin/env python
2from setuptools import setup, find_packages
1# Copyright (c) 2017, Lawrence Livermore National Security, LLC. Produced at
2# the Lawrence Livermore National Laboratory. LLNL-CODE-734707. All Rights
3# reserved. See files LICENSE and NOTICE for details.
4#
5# This file is part of CEED, a collection of benchmarks, miniapps, software
6# libraries and APIs for efficient high-order finite element and spectral
7# element discretizations for exascale applications. For more information and
8# source code availability see http://github.com/ceed.
9#
10# The CEED research is supported by the Exascale Computing Project 17-SC-20-SC,
11# a collaborative effort of two U.S. Department of Energy organizations (Office
12# of Science and the National Nuclear Security Administration) responsible for
13# the planning and preparation of a capable exascale ecosystem, including
14# software, applications, hardware, advanced system engineering and early
15# testbed platforms, in support of the nation"s exascale computing imperative.
16# pylint: disable=no-name-in-module,import-error,unused-variable
3import os
17import os
18import sys
19import subprocess
20from setuptools import setup
4
21
22# ------------------------------------------------------------------------------
23# Setup
24# ------------------------------------------------------------------------------
25def version():
26 with open(os.path.abspath("ceed.pc.template")) as template:
27 ceed_version = [line.split("Version:", 1)[1].strip() for line in template if
28 line.startswith("Version: ")]
29 return ceed_version[0]
5
30
6def read(fname):
7 return open(os.path.join(os.path.dirname(__file__), fname)).read()
31description = """
32libCEED: the Code for Efficient Extensible Discretization API Library
33=====================================================================
8
34
9setup(
10 name='junit-xml',
11 author='Brian Beyer',
12 author_email='brian@kyr.us',
13 url='https://github.com/kyrus/python-junit-xml',
14 license='MIT',
15 packages=find_packages(),
16 test_suite='test_junit_xml',
17 description='Creates JUnit XML test result documents that can be read by '
18 'tools such as Jenkins',
19 long_description=read('README.rst'),
20 version='1.8',
21 classifiers=[
22 'Development Status :: 5 - Production/Stable',
23 'Intended Audience :: Developers',
24 'License :: Freely Distributable',
25 'License :: OSI Approved :: MIT License',
26 'Operating System :: OS Independent',
27 'Programming Language :: Python',
28 'Programming Language :: Python :: 3',
29 'Topic :: Software Development :: Build Tools',
30 'Topic :: Software Development :: Testing',
31 ],
32 install_requires=[
33 'six'
34 ]
35 )
35This low-level API library provides the efficient high-order discretization
36methods developed by the ECP co-design Center for Efficient Exascale
37Discretizations (CEED). While our focus is on high-order finite elements, the
38approach is mostly algebraic and thus applicable to other discretizations in
39factored form, as explained in the API documentation.
40
41One of the challenges with high-order methods is that a global sparse matrix is
42no longer a good representation of a high-order linear operator, both with
43respect to the FLOPs needed for its evaluation, as well as the memory transfer
44needed for a matvec. Thus, high-order methods require a new "format" that still
45represents a linear (or more generally non-linear) operator, but not through a
46sparse matrix.
47
48libCEED is to provides such a format, as well as supporting implementations and
49data structures, that enable efficient operator evaluation on a variety of
50computational device types (CPUs, GPUs, etc.). This new operator description is
51algebraic and easy to incorporate in a wide variety of applications, without
52significant refactoring of their own discretization infrastructure.
53"""
54
55classifiers = """
56Intended Audience :: Developers
57Intended Audience :: Science/Research
58License :: OSI Approved :: BSD License
59Operating System :: POSIX
60Programming Language :: C
61Programming Language :: C++
62Programming Language :: CUDA
63Programming Language :: Fortran
64Programming Language :: Python
65Topic :: Scientific/Engineering
66Topic :: Software Development :: Libraries
67"""
68
69from distutils.errors import LibError
70from distutils.command.build import build as _build
71
72if sys.platform == "darwin":
73 library_file = "libceed.dylib"
74else:
75 library_file = "libceed.so"
76
77def _build_libceed():
78 try:
79 import cffi
80 import numpy
81 except ImportError:
82 raise LibError("You must install cffi and numpy before building libceed")
83
84 env = os.environ.copy()
85 if subprocess.call(["make", "lib"], env=env) != 0:
86 raise LibError("Unable to build libceed")
87
88class build(_build):
89 def run(self, *args):
90 self.execute(_build_libceed, (), msg="Building libceed")
91 _build.run(self, *args)
92
93cmdclass = {
94 "build": build,
95}
96
97try:
98 from setuptools.command.develop import develop as _develop
99 class develop(_develop):
100 def run(self, *args):
101 self.execute(_build_libceed, (), msg="Building libceed")
102 _develop.run(self, *args)
103
104 cmdclass["develop"] = develop
105except ImportError:
106 pass
107
108if "bdist_wheel" in sys.argv:
109 sys.stderr.write("libceed cannot be built as a wheel\n")
110 sys.exit(1)
111
112setup(name="libceed",
113 version=version(),
114 description="libceed python bindings",
115 long_description="\n".join(description),
116 classifiers= classifiers.split("\n")[1:-1],
117 keywords=["libCEED"],
118 platforms=["POSIX"],
119 license="BSD 2",
120
121 url="https://github.com/CEED/libCEED",
122
123 author="libCEED Team",
124 author_email="ceed-users@llnl.gov",
125
126 requires=["numpy"],
127 packages=["libceed"],
128 package_dir={"libceed": "python"},
129
130 setup_requires=["cffi"],
131 cffi_modules=["python/build_ceed_cffi.py:ffibuilder"],
132
133 cmdclass=cmdclass,
134)
135
136# ------------------------------------------------------------------------------