Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes #63

Merged
merged 9 commits into from
Nov 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 24 additions & 15 deletions .github/workflows/build_wheels_main_pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
uses: actions/checkout@v4

- name: Install Anaconda
uses: conda-incubator/setup-miniconda@v3
uses: conda-incubator/setup-miniconda@main
with:
activate-environment: cyrk_macos_latest_wheels
auto-update-conda: true
Expand All @@ -51,15 +51,22 @@ jobs:
- name: Conda info
shell: bash -el {0}
run: conda info

- name: install llvm # openMP does not play nice with clang on MacOS; also some versions of macos use older gcc so there is a need to install latest.
shell: bash -el {0}
run: |
brew install llvm libomp

- name: Install package
shell: bash -el {0}
run: |
conda install pytest matplotlib numba numpy scipy cython
python -m pip install --upgrade build
export CC=gcc
export CXX=gcc
export CPPFLAGS="$CPPFLAGS -Xpreprocessor -fopenmp -lgomp"
conda install pytest matplotlib numba numpy scipy cython pytest-xdist
export LDFLAGS="-L/opt/homebrew/opt/llvm/lib"
export CPPFLAGS="-I/opt/homebrew/opt/llvm/include"
export LDFLAGS="-L/opt/homebrew/opt/libomp/lib"
export CPPFLAGS="-I/opt/homebrew/opt/libomp/include"
export CC=/opt/homebrew/opt/llvm/bin/clang
export CXX=/opt/homebrew/opt/llvm/bin/clang++
python -m build --wheel --outdir ./wheelhouse/

- uses: actions/upload-artifact@v4
Expand Down Expand Up @@ -96,20 +103,22 @@ jobs:
shell: bash -el {0}
run: conda info

- name: install gcc-13 # openMP does not play nice with clang on MacOS; also some versions of macos use older gcc so there is a need to install latest.
- name: install llvm # openMP does not play nice with clang on MacOS; also some versions of macos use older gcc so there is a need to install latest.
shell: bash -el {0}
run: |
brew install gcc@13
brew install llvm libomp

- name: Install package
shell: bash -el {0}
run: |
conda install nomkl
conda install pytest matplotlib numba numpy scipy cython
python -m pip install --upgrade build
export CC=gcc
export CXX=gcc
export CPPFLAGS="$CPPFLAGS -Xpreprocessor -fopenmp -lgomp"
conda install pytest matplotlib numba numpy scipy cython pytest-xdist
export LDFLAGS="-L/usr/local/opt/llvm/lib"
export CPPFLAGS="-I/usr/local/opt/llvm/include"
export LDFLAGS="-L/usr/local/opt/libomp/lib"
export CPPFLAGS="-I/usr/local/opt/libomp/include"
export CC=/usr/local/opt/llvm/bin/clang
export CXX=/usr/local/opt/llvm/bin/clang++
python -m build --wheel --outdir ./wheelhouse/

- uses: actions/upload-artifact@v4
Expand All @@ -135,7 +144,7 @@ jobs:
fetch-depth: 0

- name: Build wheels
uses: pypa/cibuildwheel@v2.19.2
uses: pypa/cibuildwheel@main

- uses: actions/upload-artifact@v4
with:
Expand Down Expand Up @@ -164,7 +173,7 @@ jobs:
merge-multiple: true
path: dist

- uses: pypa/gh-action-pypi-publish@v1.9.0
- uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
72 changes: 0 additions & 72 deletions .github/workflows/build_wheels_test_pypi.yml

This file was deleted.

29 changes: 21 additions & 8 deletions .github/workflows/push_tests_mac.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,18 +35,22 @@ jobs:
shell: bash -el {0}
run: conda info

- name: install gcc-13 # openMP does not play nice with clang on MacOS; also some versions of macos use older gcc so there is a need to install latest.
- name: install llvm # openMP does not play nice with clang on MacOS; also some versions of macos use older gcc so there is a need to install latest.
shell: bash -el {0}
run: |
brew install gcc@13
brew install llvm libomp

- name: Install package
shell: bash -el {0}
# export CPPFLAGS="$CPPFLAGS -Xpreprocessor -fopenmp -lgomp"
run: |
conda install pytest matplotlib numba numpy scipy cython pytest-xdist
export CC=gcc
export CXX=gcc
export CPPFLAGS="$CPPFLAGS -Xpreprocessor -fopenmp -lgomp"
export LDFLAGS="-L/opt/homebrew/opt/llvm/lib"
export CPPFLAGS="-I/opt/homebrew/opt/llvm/include"
export LDFLAGS="-L/opt/homebrew/opt/libomp/lib"
export CPPFLAGS="-I/opt/homebrew/opt/libomp/include"
export CC=/opt/homebrew/opt/llvm/bin/clang
export CXX=/opt/homebrew/opt/llvm/bin/clang++
python -m pip install -v .

- name: Run pytest
Expand Down Expand Up @@ -80,15 +84,24 @@ jobs:
- name: Conda info
shell: bash -el {0}
run: conda info

- name: install llvm # openMP does not play nice with clang on MacOS; also some versions of macos use older gcc so there is a need to install latest.
shell: bash -el {0}
run: |
brew install llvm libomp

- name: Install package
shell: bash -el {0}
# export CPPFLAGS="$CPPFLAGS -Xpreprocessor -fopenmp -lgomp"
run: |
conda install nomkl
conda install pytest matplotlib numba numpy scipy cython pytest-xdist
export CC=gcc
export CXX=gcc
export CPPFLAGS="$CPPFLAGS -Xpreprocessor -fopenmp -lgomp"
export LDFLAGS="-L/usr/local/opt/llvm/lib"
export CPPFLAGS="-I/usr/local/opt/llvm/include"
export LDFLAGS="-L/usr/local/opt/libomp/lib"
export CPPFLAGS="-I/usr/local/opt/libomp/include"
export CC=/usr/local/opt/llvm/bin/clang
export CXX=/usr/local/opt/llvm/bin/clang++
python -m pip install -v .

- name: Run pytest
Expand Down
9 changes: 9 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,15 @@

## 2024

#### v0.10.2 (2024-11-05)

Bugs:
* Fixed issue where `CyRK.test_cysolver()` used incorrect kind and order of arguments.
* Fixed MacOS compile issues when using OpenMP (for both x86-64 and arm64 macos).

Tests:
* Added tests to check all built in testers.

#### v0.10.1 (2024-07-25)

C++ Backend:
Expand Down
11 changes: 10 additions & 1 deletion CyRK/_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,16 @@ def test_cysolver():

from CyRK.cy.cysolverNew_test import cytester

result = cytester(0, time_span, initial_conds, None, 1, 0, 0, 2000, rtol, atol)
result = cytester(0,
time_span,
initial_conds_float,
args=None,
method=1,
expected_size=0,
max_num_steps=0,
max_ram_MB=2000,
rtol=rtol,
atol=atol)

assert result.success
assert type(result.t) == np.ndarray
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

---

<a href="https://github.com/jrenaud90/CyRK/releases"><img src="https://img.shields.io/badge/CyRK-0.10.1 Alpha-orange" alt="CyRK Version 0.10.1 Alpha" /></a>
<a href="https://github.com/jrenaud90/CyRK/releases"><img src="https://img.shields.io/badge/CyRK-0.10.2 Alpha-orange" alt="CyRK Version 0.10.2 Alpha" /></a>


**Runge-Kutta ODE Integrator Implemented in Cython and Numba**
Expand Down
24 changes: 24 additions & 0 deletions Tests/A_Package_Tests/test_package.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,27 @@ def test_package():

assert type(version) == str
assert version == __version__

def test_testers_nbrk():

from CyRK import test_nbrk

test_nbrk()

assert True

def test_testers_cysolver():

from CyRK import test_cysolver

test_cysolver()

assert True

def test_testers_pysolver():

from CyRK import test_pysolver

test_pysolver()

assert True
5 changes: 2 additions & 3 deletions _build_cyrk.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,8 @@
extra_link_args = []
elif install_platform.lower() == 'darwin':
# OpenMP is installed via llvm. See https://stackoverflow.com/questions/60005176/how-to-deal-with-clang-error-unsupported-option-fopenmp-on-travis
#os.environ["CXX"] = "g++"
extra_compile_args = ['-O3', '-Wno-error=incompatible-function-pointer-types']
extra_link_args = []
extra_compile_args = ['-O3', '-Wno-error=incompatible-function-pointer-types', '-fopenmp']
extra_link_args = ['-lomp']
else:
extra_compile_args = ['-fopenmp', '-O3']
extra_link_args = ['-fopenmp', '-O3']
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name='CyRK'
version = '0.10.1'
version = '0.10.2a3.dev5'
description='Runge-Kutta ODE Integrator Implemented in Cython and Numba.'
authors= [
{name = 'Joe P. Renaud', email = 'joe.p.renaud@gmail.com'}
Expand Down
Loading