Skip to content
Snippets Groups Projects
  • Thorsten Hater's avatar
    More robust build-catalogue (#1784) · d0dc6bd7
    Thorsten Hater authored
    - build-catalogue
      - now installed by pip
      - enable GPU-backends
      - isolate from being installed in a non-default dir
      - rename to arbor-build-catalogue
      - allow hand-written C++ mechanisms to be linked in the same catalogue.
    - CMake
      - enable PIC on arbor always to allow linking to shared objects
      - use relative paths when configuring a-b-c, to make relocation less of a problem
    - Python
        - ensure a-b-c is installed by pip, along with headers and libarbor.a
        - throw errors if tools (cmake scripts, arbor package, modcc) missing
        - transition setup.py setuptools -> skbuild.
    - Wheels
        - Add NML2 support to wheels
        - scripts/build-wheels.sh builds wheels, in principle valid for submission to PyPI, on your own hardware. This should be kept in sync with .github/workflows/ciwheel.yml
        - scripts/patchwheel.py corrects the rpath in the libraries in the wheels, working around a bad interplay between auditwheel and skbuild, see pypa/auditwh...
    Unverified
    d0dc6bd7
setup.py 2.38 KiB
from pathlib import Path
from sys import executable as python
from skbuild import setup
import os,platform

# Hard coded options, because scikit-build does not do build options.
# Override by instructing CMAKE, e.g.:
# pip install . -- -DARB_USE_BUNDLED_LIBS=ON -DARB_WITH_MPI=ON -DARB_GPU=cuda
with_mpi   = False
with_gpu   = 'none'
with_vec   = False
arch       = 'none'
with_nml   = True
use_libs   = True
build_type = 'Release' # this is ok even for debugging, as we always produce info

# Find our dir; *should* be the arbor checkout
here = Path(__file__).resolve().parent
# Read version file
with open(here / 'VERSION') as fd:
    arbor_version = fd.read().strip()
# Get the contents of the readme
with open(here / 'python' / 'readme.md', encoding='utf-8') as fd:
    long_description = fd.read()

setup(name='arbor',
      version=arbor_version,
      python_requires='>=3.6',
      install_requires=['numpy'],
      setup_requires=[],
      zip_safe=False,
      packages=['arbor'],
      cmake_args=['-DARB_WITH_PYTHON=on',
                  f'-DPYTHON_EXECUTABLE={python}',
                  f'-DARB_WITH_MPI={with_mpi}',
                  f'-DARB_VECTORIZE={with_vec}',
                  f'-DARB_ARCH={arch}',
                  f'-DARB_GPU={with_gpu}',
                  f'-DARB_WITH_NEUROML={with_nml}',
                  f'-DARB_USE_BUNDLED_LIBS={use_libs}',
                  f'-DCMAKE_BUILD_TYPE={build_type}',],
      author='The Arbor dev team.',
      url='https://arbor-sim.org',
      description='High performance simulation of networks of multicompartment neurons.',
      long_description=long_description,
      long_description_content_type='text/markdown',
      classifiers=['Development Status :: 5 - Production/Stable',
                   'Intended Audience :: Science/Research',
                   'License :: OSI Approved :: BSD License',
                   'Programming Language :: Python :: 3.6',
                   'Programming Language :: Python :: 3.7',
                   'Programming Language :: Python :: 3.8',
                   'Programming Language :: Python :: 3.9',
                   'Programming Language :: Python :: 3.10',
                   'Programming Language :: C++',],
      project_urls={'Source': 'https://github.com/arbor-sim/arbor',
                    'Documentation': 'https://docs.arbor-sim.org',
                    'Bug Reports': 'https://github.com/arbor-sim/arbor/issues',},)