diff --git a/.gitignore b/.gitignore index 8b3a45a..5091d79 100644 --- a/.gitignore +++ b/.gitignore @@ -13,3 +13,5 @@ result_images/ .coverage dist/ + +galpynostatic/lib/*.so diff --git a/setup.py b/setup.py new file mode 100644 index 0000000..d60814d --- /dev/null +++ b/setup.py @@ -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) diff --git a/tests/test_lib.py b/tests/test_lib.py new file mode 100644 index 0000000..9ef67d5 --- /dev/null +++ b/tests/test_lib.py @@ -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)