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