1ee05e790Sjeremylt# Copyright (c) 2017, Lawrence Livermore National Security, LLC. Produced at 2ee05e790Sjeremylt# the Lawrence Livermore National Laboratory. LLNL-CODE-734707. All Rights 3ee05e790Sjeremylt# reserved. See files LICENSE and NOTICE for details. 4ee05e790Sjeremylt# 5ee05e790Sjeremylt# This file is part of CEED, a collection of benchmarks, miniapps, software 6ee05e790Sjeremylt# libraries and APIs for efficient high-order finite element and spectral 7ee05e790Sjeremylt# element discretizations for exascale applications. For more information and 8ee05e790Sjeremylt# source code availability see http://github.com/ceed. 9ee05e790Sjeremylt# 10ee05e790Sjeremylt# The CEED research is supported by the Exascale Computing Project 17-SC-20-SC, 11ee05e790Sjeremylt# a collaborative effort of two U.S. Department of Energy organizations (Office 12ee05e790Sjeremylt# of Science and the National Nuclear Security Administration) responsible for 13ee05e790Sjeremylt# the planning and preparation of a capable exascale ecosystem, including 14ee05e790Sjeremylt# software, applications, hardware, advanced system engineering and early 15ee05e790Sjeremylt# testbed platforms, in support of the nation"s exascale computing imperative. 16ee05e790Sjeremylt# pylint: disable=no-name-in-module,import-error,unused-variable 17ee05e790Sjeremyltimport os 18ee05e790Sjeremyltfrom setuptools import setup 1937c134eaSJed Brownfrom setuptools.command.build_ext import build_ext 20ee05e790Sjeremylt 21ee05e790Sjeremylt# ------------------------------------------------------------------------------ 22ee05e790Sjeremylt# Setup 23ee05e790Sjeremylt# ------------------------------------------------------------------------------ 247a7b0fa3SJed Brown 257a7b0fa3SJed Brown 26ee05e790Sjeremyltdef version(): 27ee05e790Sjeremylt with open(os.path.abspath("ceed.pc.template")) as template: 28ee05e790Sjeremylt ceed_version = [line.split("Version:", 1)[1].strip() for line in template if 29ee05e790Sjeremylt line.startswith("Version: ")] 30ee05e790Sjeremylt return ceed_version[0] 31ee05e790Sjeremylt 327a7b0fa3SJed Brown 3337c134eaSJed Browndef requirements(): 3437c134eaSJed Brown with open('requirements.txt') as f: 3537c134eaSJed Brown return f.readlines() 3637c134eaSJed Brown 377a7b0fa3SJed Brown 3837c134eaSJed Brownclass libceed_build_ext(build_ext): 3937c134eaSJed Brown def run(self): 4037c134eaSJed Brown self.make_libceed_so() 4137c134eaSJed Brown build_ext.run(self) 4237c134eaSJed Brown 4337c134eaSJed Brown def make_libceed_so(self): 4437c134eaSJed Brown import subprocess 45dabe13fcSJed Brown subprocess.check_call(['make', '-j', '-B']) 467a7b0fa3SJed Brown subprocess.check_call( 477a7b0fa3SJed Brown ['make', 'install', 'prefix=' + os.path.join(self.build_lib, 'libceed')]) 487a7b0fa3SJed Brown 4937c134eaSJed Brown 50ee05e790Sjeremyltdescription = """ 5137c134eaSJed BrownlibCEED: Code for Efficient Extensible Discretization 5237c134eaSJed Brown===================================================== 53ee05e790Sjeremylt 5437c134eaSJed BrownlibCEED is a lightweight library for expressing and manipulating operators that 5537c134eaSJed Brownarise in high-order element-based discretization of partial differential 5637c134eaSJed Brownequations. libCEED's representations are much for efficient than assembled 5737c134eaSJed Brownsparse matrices, and can achieve very high performance on modern CPU and GPU 5837c134eaSJed Brownhardware. This approach is applicable to a broad range of linear and nonlinear 5937c134eaSJed Brownproblems, and includes facilities for preconditioning. libCEED is meant to be 6037c134eaSJed Browneasy to incorporate into existing libraries and applications, and to build new 6137c134eaSJed Browntools on top of. 62ee05e790Sjeremylt 6337c134eaSJed BrownlibCEED has been developed as part of the DOE Exascale Computing Project 6437c134eaSJed Brownco-design Center for Efficient Exascale Discretizations (CEED). 65ee05e790Sjeremylt""" 66ee05e790Sjeremylt 67ee05e790Sjeremyltclassifiers = """ 6837c134eaSJed BrownDevelopment Status :: 4 - Beta 69ee05e790SjeremyltIntended Audience :: Developers 70ee05e790SjeremyltIntended Audience :: Science/Research 71ee05e790SjeremyltLicense :: OSI Approved :: BSD License 72ee05e790SjeremyltOperating System :: POSIX 73ee05e790SjeremyltProgramming Language :: C 74ee05e790SjeremyltProgramming Language :: C++ 75ee05e790SjeremyltProgramming Language :: Fortran 76ee05e790SjeremyltProgramming Language :: Python 7737c134eaSJed BrownProgramming Language :: Python :: 3.5 7837c134eaSJed BrownProgramming Language :: Python :: 3.6 7937c134eaSJed BrownProgramming Language :: Python :: 3.7 8037c134eaSJed BrownProgramming Language :: Python :: 3.8 8137c134eaSJed BrownProgramming Language :: Python :: 3 :: Only 82ee05e790SjeremyltTopic :: Scientific/Engineering 83ee05e790SjeremyltTopic :: Software Development :: Libraries 84ee05e790Sjeremylt""" 85ee05e790Sjeremylt 86ee05e790Sjeremyltsetup(name="libceed", 87ee05e790Sjeremylt version=version(), 8837c134eaSJed Brown description="libCEED: Code for Efficient Extensible Discretization", 8937c134eaSJed Brown long_description=description, 9037c134eaSJed Brown long_description_content_type='text/x-rst', 91ee05e790Sjeremylt classifiers=classifiers.split("\n")[1:-1], 92ee05e790Sjeremylt keywords=["libCEED"], 93ee05e790Sjeremylt platforms=["POSIX"], 94ee05e790Sjeremylt license="BSD 2", 9537c134eaSJed Brown license_file='LICENSE', 9637c134eaSJed Brown url="https://libceed.readthedocs.io", 9737c134eaSJed Brown download_url="https://github.com/CEED/libCEED/releases", 9837c134eaSJed Brown project_urls={ 9937c134eaSJed Brown "Bug Tracker": "https://github.com/CEED/libCEED/issues", 10037c134eaSJed Brown "Documentation": "https://libceed.readthedocs.io", 10137c134eaSJed Brown "Source Code": "https://github.com/CEED/libCEED", 10237c134eaSJed Brown }, 103ee05e790Sjeremylt author="libCEED Team", 104ee05e790Sjeremylt author_email="ceed-users@llnl.gov", 105ee05e790Sjeremylt 10637c134eaSJed Brown install_requires=requirements(), 107ee05e790Sjeremylt packages=["libceed"], 108ee05e790Sjeremylt package_dir={"libceed": "python"}, 10937c134eaSJed Brown include_package_data=True, 110ee05e790Sjeremylt 111ee05e790Sjeremylt setup_requires=["cffi"], 112ee05e790Sjeremylt cffi_modules=["python/build_ceed_cffi.py:ffibuilder"], 11337c134eaSJed Brown cmdclass={'build_ext': libceed_build_ext}, 114*962dc42dSJeremy L Thompson 115*962dc42dSJeremy L Thompson extras_require={ 116*962dc42dSJeremy L Thompson 'cuda' : ['numba'] 117*962dc42dSJeremy L Thompson }, 118ee05e790Sjeremylt ) 119ee05e790Sjeremylt 120ee05e790Sjeremylt# ------------------------------------------------------------------------------ 121