xref: /libCEED/setup.py (revision 2bc797ab000477348efa69c987743393cf84ac4a)
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
17import os
18from setuptools import setup
19from setuptools.command.build_ext import build_ext
20
21# ------------------------------------------------------------------------------
22# Setup
23# ------------------------------------------------------------------------------
24
25
26def version():
27    with open(os.path.abspath("ceed.pc.template")) as template:
28        ceed_version = [line.split("Version:", 1)[1].strip() for line in template if
29                        line.startswith("Version: ")]
30    return ceed_version[0]
31
32
33def requirements():
34    with open('requirements.txt') as f:
35        return f.readlines()
36
37
38class libceed_build_ext(build_ext):
39    def run(self):
40        self.make_libceed_so()
41        build_ext.run(self)
42
43    def make_libceed_so(self):
44        import subprocess
45        subprocess.check_call(['make', '-j', '-B'])
46        subprocess.check_call(
47            ['make', 'install', 'prefix=' + os.path.join(self.build_lib, 'libceed')])
48
49
50description = """
51libCEED: Code for Efficient Extensible Discretization
52=====================================================
53
54libCEED is a lightweight library for expressing and manipulating operators that
55arise in high-order element-based discretization of partial differential
56equations.  libCEED's representations are much for efficient than assembled
57sparse matrices, and can achieve very high performance on modern CPU and GPU
58hardware.  This approach is applicable to a broad range of linear and nonlinear
59problems, and includes facilities for preconditioning.  libCEED is meant to be
60easy to incorporate into existing libraries and applications, and to build new
61tools on top of.
62
63libCEED has been developed as part of the DOE Exascale Computing Project
64co-design Center for Efficient Exascale Discretizations (CEED).
65"""
66
67classifiers = """
68Development Status :: 4 - Beta
69Intended Audience :: Developers
70Intended Audience :: Science/Research
71License :: OSI Approved :: BSD License
72Operating System :: POSIX
73Programming Language :: C
74Programming Language :: C++
75Programming Language :: Fortran
76Programming Language :: Python
77Programming Language :: Python :: 3.5
78Programming Language :: Python :: 3.6
79Programming Language :: Python :: 3.7
80Programming Language :: Python :: 3.8
81Programming Language :: Python :: 3 :: Only
82Topic :: Scientific/Engineering
83Topic :: Software Development :: Libraries
84"""
85
86setup(name="libceed",
87      version=version(),
88      description="libCEED: Code for Efficient Extensible Discretization",
89      long_description=description,
90      long_description_content_type='text/x-rst',
91      classifiers=classifiers.split("\n")[1:-1],
92      keywords=["libCEED"],
93      platforms=["POSIX"],
94      license="BSD 2",
95      license_file='LICENSE',
96      url="https://libceed.readthedocs.io",
97      download_url="https://github.com/CEED/libCEED/releases",
98      project_urls={
99          "Bug Tracker": "https://github.com/CEED/libCEED/issues",
100          "Documentation": "https://libceed.readthedocs.io",
101          "Source Code": "https://github.com/CEED/libCEED",
102      },
103      author="libCEED Team",
104      author_email="ceed-users@llnl.gov",
105
106      install_requires=requirements(),
107      packages=["libceed"],
108      package_dir={"libceed": "python"},
109      include_package_data=True,
110
111      setup_requires=["cffi"],
112      cffi_modules=["python/build_ceed_cffi.py:ffibuilder"],
113      cmdclass={'build_ext': libceed_build_ext},
114      )
115
116# ------------------------------------------------------------------------------
117