-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #17 from hz-b/dev/feature/update-to-madng-1.0
Update to mad-ng v 1.0.0
- Loading branch information
Showing
37 changed files
with
479 additions
and
166 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
39 changes: 39 additions & 0 deletions
39
.github/workflows/composite-action/python-build/action.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
name: python-package | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- name: checkout gtpsa code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Downloads artefact | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: gtpsa-release-deb | ||
- name: setup environment | ||
shell: bash | ||
run: | | ||
sudo apt update | ||
sudo apt install python3-dev python3-venv libarmadillo-dev ./gtpsa*.deb | ||
- name: setup python, numpy v1.0 | ||
shell: bash | ||
run: | | ||
python3 -m venv venv-numpy-v1.0 | ||
. venv-numpy-v1.0/bin/activate | ||
python3 -m pip install --upgrade pip wheel build pytest 'numpy<2.0' pandas | ||
gtpsa_PREFIX=/usr/local python3 -m pip install -v ./python/ | ||
python3 -c "import gtpsa" | ||
python3 -m pytest -v -v -v --log-cli-level=DEBUG ./python/tests | ||
deactivate | ||
- name: setup python, numpy v2.0 | ||
shell: bash | ||
run: | | ||
python3 -m venv venv-numpy-v2.0 | ||
. venv-numpy-v2.0/bin/activate | ||
python3 -m pip install --upgrade pip wheel build pytest 'numpy>=2.0' pandas | ||
gtpsa_PREFIX=/usr/local python3 -m pip install -v ./python/ | ||
python3 -c "import gtpsa" | ||
python3 -m pytest -v --log-cli-level=DEBUG ./python/tests/ | ||
deactivate |
49 changes: 49 additions & 0 deletions
49
.github/workflows/composite-action/ubuntu-deb-package/action.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
name: ubuntu-deb-package | ||
description : "builds gtpsa c++ package" | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- name: checkout gtpsa-cpp code | ||
uses: actions/checkout@v4 | ||
with: | ||
submodules: True | ||
|
||
- name: install apt dependencies | ||
shell: bash | ||
run: | | ||
sudo apt update | ||
# gfortran ... currently for mad-ng gtpsa library | ||
sudo apt install g++ gfortran cmake make libarmadillo-dev | ||
# deliberatly only installing a subset of boost | ||
sudo apt install libboost-chrono-dev libboost-filesystem-dev libboost-program-options-dev libboost-test-dev | ||
- name: Configure CMake | ||
shell: bash | ||
# Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make. | ||
# See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type | ||
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} | ||
|
||
- name: Build | ||
shell: bash | ||
# Build your program with the given configuration | ||
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} | ||
|
||
- name: Test | ||
shell: bash | ||
working-directory: ${{github.workspace}}/build | ||
# Execute tests defined by the CMake configuration. | ||
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail | ||
run: ctest -C ${{env.BUILD_TYPE}} | ||
|
||
- name: make tar package | ||
shell: bash | ||
# need to be root to install ? | ||
run: | | ||
(cd ${{github.workspace}}/build && make package) | ||
- name: Upload artifact for python build | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: gtpsa-release-deb | ||
path: ${{github.workspace}}/build/*.deb |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
name: build orchestration | ||
|
||
env: | ||
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.) | ||
BUILD_TYPE: Release | ||
# cmake is used to install file ... defaults to /usr/local | ||
LD_LIBRARY_PATH: /usr/local/lib | ||
|
||
on: | ||
push: | ||
branches: [ "main" ] | ||
pull_request: | ||
branches: [ "main" ] | ||
|
||
jobs: | ||
ubuntu-deb-package: | ||
# The CMake configure and build commands are platform agnostic and should work equally well on Windows or Mac. | ||
# You can convert this to a matrix build if you need cross-platform coverage. | ||
# See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: checkout gtpsa-cpp code | ||
uses: actions/checkout@v4 | ||
with: | ||
submodules: True | ||
|
||
- name: ubuntu-deb-package | ||
uses: ./.github/workflows/composite-action/ubuntu-deb-package | ||
|
||
python-package: | ||
needs : ubuntu-deb-package | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: checkout gtpsa-cpp code | ||
uses: actions/checkout@v4 | ||
with: | ||
submodules: False | ||
|
||
- name: python-build | ||
uses: ./.github/workflows/composite-action/python-build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -79,3 +79,27 @@ IF(USE_pybind11) | |
endif() | ||
add_subdirectory(examples) | ||
add_subdirectory(tests) | ||
|
||
# generate postinst file in ${CMAKE_BINARY_DIR} from template # | ||
CONFIGURE_FILE("${CMAKE_SOURCE_DIR}/contrib/postinst.in" "postinst" @ONLY IMMEDIATE) | ||
|
||
# generate a DEB when cpack is run | ||
SET(CPACK_GENERATOR "DEB") | ||
SET(CPACK_PACKAGE_NAME ${CMAKE_PROJECT_NAME}) | ||
SET(CPACK_SET_DESTDIR TRUE) | ||
SET(CPACK_DEBIAN_PACKAGE_MAINTAINER "[email protected]") | ||
SET(CPACK_PACKAGE_VERSION_MAJOR "0") | ||
SET(CPACK_PACKAGE_VERSION_MINOR "1") | ||
SET(CPACK_PACKAGE_VERSION_PATCH "0") | ||
include(GNUInstallDirs) | ||
# SET(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_SOURCE_DIR}/docs/CPack.Description.txt") | ||
SET(CPACK_RESOURCE_FILE_README "${CMAKE_SOURCE_DIR}/README.rst") | ||
SET(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_SOURCE_DIR}/LICENSE") | ||
# SET(CPACK_DEBIAN_PACKAGE_DEPENDS "libarmadillo-dev") | ||
set (CPACK_DEBIAN_PACKAGE_SHLIBDEPS ON) | ||
SET(CPACK_PACKAGE_VENDOR "HZB") | ||
# make postinst run after install # | ||
SET(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA "${CMAKE_BINARY_DIR}/postinst;") | ||
|
||
|
||
include(CPack) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
14. December 2024 <[email protected]> | ||
* updated upstream to mad-ng 1.0.0 | ||
* some methods removed: no direct upstream correspondance | ||
* method setVariable changed: index needs to be at least 1, | ||
order of tpsa object needs to be at least 1 | ||
**NB** default now to one | ||
python checks before calling if user does not set flag to not check, | ||
c++ side deliberatyl not checking it: avoid code duplication |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
* set_variable: find out index of iv, consistency between C++ and python interface | ||
* make mad_tpsa library ensure raise c++ exception |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
#!/usr/bin/env sh | ||
/usr/sbin/ldconfig |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
add_subdirectory(c) | ||
#: add it back again as soon as the examples are fixed upstream | ||
# add_subdirectory(c) | ||
add_subdirectory(c++) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule mad-ng
updated
from 1284ac to 455e35
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
[build-system] | ||
requires = ["setuptools", "setuptools-scm", "pybind11>=2.9"] | ||
build-backend = "setuptools.build_meta" | ||
|
||
[project] | ||
name = "gtpsa" | ||
version = "0.1.0" | ||
authors = [ | ||
{name = "Pierre Schnizer", email = "[email protected]"}, | ||
] | ||
description = "wraps gtpsa as provided by madng" | ||
# readme = "../README.rst" | ||
requires-python = ">=3.8" | ||
license = {text = "GPL"} | ||
classifiers = [ | ||
"Framework :: Django", | ||
"Programming Language :: Python :: 3", | ||
"Development Status :: 2 - Pre-Alpha", | ||
"Intended Audience :: Science/Research", | ||
"License :: OSI Approved :: GNU General Public License (GPL)", | ||
"Programming Language :: Python :: 3", | ||
"Topic :: Scientific/Engineering :: Physics" | ||
] | ||
|
||
dependencies = [ | ||
"numpy", | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.