Fast Methods for Cosmological Simulations
FastSim serves as a tool for quick N-body simulations in modified gravity.
setup.py
Go to the documentation of this file.
1 #!/usr/bin/env python
2 from setuptools.command.build_py import build_py as _build
3 from setuptools import setup
4 from subprocess import call
5 from io import open
6 import glob
7 import os
8 import sys
9 
10 class build(_build):
11  """Specialized Python source builder."""
12  def run(self):
13  call(["mkdir", "-p", "build"])
14  if call(["cmake", "-H.", "-Bbuild"]) != 0:
15  raise Exception("Could not run CMake configuration. Make sure CMake is installed !")
16  if call(["make", "-Cbuild", "_ccllib"]) != 0:
17  raise Exception("Could not build CCL")
18  # Finds the library under its different possible names
19  if os.path.exists("build/pyccl/_ccllib.so"):
20  call(["cp", "build/pyccl/_ccllib.so", "pyccl/"])
21  else:
22  raise Exception("Could not find wrapper shared library, compilation must have failed.")
23  if call(["cp", "build/pyccl/ccllib.py", "pyccl/"]) != 0:
24  raise Exception("Could not find python module, SWIG must have failed.")
25  call(["cp", "include/ccl_params.ini", "pyccl/"])
26 
27  # Copy files required by CLASS
28  if call(["cp","-r", "build/extern/share/class/bbn", "pyccl/"]) != 0:
29  raise Exception("Could not copy the CLASS BBN fikes, CLASS compilation must have failed.")
30  if call(["cp","-r", "build/extern/share/class/hyrec", "pyccl/"]) != 0:
31  raise Exception("Could not copy the CLASS BBN fikes, CLASS compilation must have failed.")
32 
33  _build.run(self)
34 
35 # read the contents of the README file
36 with open('README.md', encoding="utf-8") as f:
37  long_description = f.read()
38 
39 setup(name="pyccl",
40  description="Library of validated cosmological functions.",
41  long_description=long_description,
42  long_description_content_type='text/markdown',
43  author="LSST DESC",
44  url="https://github.com/LSSTDESC/CCL",
45  packages=['pyccl'],
46  provides=['pyccl'],
47  package_data={'pyccl': ['_ccllib.so', 'ccl_params.ini', 'bbn/*', 'hyrec/*']},
48  include_package_data = True,
49  use_scm_version=True,
50  setup_requires=['setuptools_scm'],
51  install_requires=['numpy', 'pyyaml'],
52  test_suite='nose.collector',
53  tests_require=['nose'],
54  cmdclass={'build_py': build},
55  classifiers=[
56  'Development Status :: 4 - Beta',
57  'Intended Audience :: Science/Research',
58  'License :: OSI Approved',
59  'Operating System :: MacOS :: MacOS X',
60  'Operating System :: POSIX :: Linux',
61  'Programming Language :: C',
62  'Programming Language :: Python :: 2.7',
63  'Programming Language :: Python :: 3.5',
64  'Programming Language :: Python :: 3.6',
65  'Topic :: Scientific/Engineering :: Physics'
66  ]
67  )
Definition: setup.py:1
def run(self)
Definition: setup.py:12