Skip to content

Commit

Permalink
add setupy.py for C++ extensions installation, but not for configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
fernandezfran committed Apr 10, 2024
1 parent 30990d2 commit 3afac4d
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,5 @@ result_images/
.coverage

dist/

galpynostatic/lib/*.so
29 changes: 29 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-

# This file is part of galpynostatic
# https://github.com/fernandezfran/galpynostatic/
# Copyright (c) 2022-2023, Francisco Fernandez
# Copyright (c) 2024, Francisco Fernandez, Maximilano Gavilán, Andres Ruderman
# License: MIT
# https://github.com/fernandezfran/galpynostatic/blob/master/LICENSE

from setuptools import setup, Extension

_flags = ["-fPIC", "-O3", "-ftree-vectorize", "-march=native"]

setup_args = dict(
ext_modules=[
Extension(
name="galpynostatic.lib.profile",
sources=["galpynostatic/lib/profile.cpp"],
extra_compile_args=_flags,
),
Extension(
name="galpynostatic.lib.map",
sources=["galpynostatic/lib/map.cpp"],
extra_compile_args=_flags + ["-fopenmp"],
),
]
)
setup(**setup_args)
24 changes: 24 additions & 0 deletions tests/test_lib.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-

# This file is part of galpynostatic
# https://github.com/fernandezfran/galpynostatic/
# Copyright (c) 2022-2023, Francisco Fernandez
# Copyright (c) 2024, Francisco Fernandez, Maximilano Gavilán, Andres Ruderman
# License: MIT
# https://github.com/fernandezfran/galpynostatic/blob/master/LICENSE

# =============================================================================
# IMPORTS
# =============================================================================

import galpynostatic.lib

# =============================================================================
# TESTS
# =============================================================================


def test_docs():
"""Test the docs."""
assert isinstance(galpynostatic.lib.__doc__, str)

0 comments on commit 3afac4d

Please sign in to comment.