Skip to content

Commit

Permalink
remove mac intel support
Browse files Browse the repository at this point in the history
  • Loading branch information
peter-urban committed Sep 30, 2024
1 parent 2f50857 commit e04b483
Show file tree
Hide file tree
Showing 23 changed files with 306 additions and 115 deletions.
71 changes: 0 additions & 71 deletions .github/workflows/ci-mac.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,76 +54,6 @@ concurrency:
#BUILD_TYPE: Release

jobs:
macos:
name: CI ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
cxx_compiler: ["$(brew --prefix llvm@18)/bin/clang++"]
llvm: ["$(brew --prefix llvm@18)"]
boost: ["$(brew --prefix boost)"]
libomp: ["$(brew --prefix libomp)"]
os: ["macos-12"]

# env does not work here because is resolved as string and not command
# env:
# CXX: ${{ matrix.cxx_compiler }}

steps:

- uses: actions/setup-python@v3
with:
python-version: '3.12'

- name: checkout main repository
uses: actions/checkout@v4
with:
submodules: recursive
lfs: false

- name: ccache
uses: hendrikmuhs/[email protected]
with:
key: super-ci-mac-2 # name for the cache

# uninstall clang 15
- run: brew uninstall llvm@15

- run: brew install coreutils llvm@18

- run: brew install libomp boost

- run: pip install meson meson-python ninja pytest numpy

# LDFLAGS="-L/opt/homebrew/opt/libomp/lib" CPPFLAGS="-I/opt/homebrew/opt/libomp/include"
- name: configure meson
run: |
BOOST_ROOT=${{ matrix.boost }} CXX=${{ matrix.llvm }}/bin/clang++ LDFLAGS="-L${{ matrix.llvm }}/lib/c++ -L${{ matrix.llvm }}/lib -L${{ matrix.boost }}/lib" CPPFLAGS="-I${{ matrix.llvm }}/include -I${{ matrix.boost }}/include" meson setup builddir/; meson configure builddir -Dpython.install_env=auto
- name: compile project
run: meson compile -C builddir/

- name: test (cpp)
run: meson test -C builddir/ --print-errorlogs

- name: install project
run: sudo meson install -C builddir/

- name: install pip requirements
run: pip install -r requirements.txt

- name: test (pytest)
run: pytest -v

- name: 'Upload error log'
uses: actions/upload-artifact@v4
if: failure()
with:
name: ${{matrix.container}}_testlog
path: builddir/meson-logs/meson-log.txt
retention-days: 5

macos_arm:
name: CI ${{ matrix.os }}
runs-on: ${{ matrix.os }}
Expand Down Expand Up @@ -162,7 +92,6 @@ jobs:

- run: pip install meson meson-python ninja pytest numpy

# LDFLAGS="-L/opt/homebrew/opt/libomp/lib" CPPFLAGS="-I/opt/homebrew/opt/libomp/include"
- name: configure meson
run: |
meson setup builddir -Dpython.install_env=auto
Expand Down
68 changes: 63 additions & 5 deletions src/pymodule/amplitudecorrection/functions/module.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ void init_m_functions(pybind11::module& m)

// range correction
submodule.def("get_sample_numbers_plus_half",
&get_sample_numbers_plus_half<xt::pytensor<float, 1>, int64_t>,
&get_sample_numbers_plus_half<xt::pytensor<float, 1>, int32_t>,
DOC_functions(get_sample_numbers_plus_half),
py::arg("first_sample_nr"),
py::arg("last_sample_nr"),
Expand All @@ -63,28 +63,86 @@ void init_m_functions(pybind11::module& m)
py::arg("sound_velocity_m_s"));

submodule.def("approximate_ranges",
&approximate_ranges<xt::pytensor<float, 1>, int64_t>,
py::overload_cast<float, float, int32_t, int32_t, int32_t>(
&approximate_ranges<xt::pytensor<float, 1>, int32_t>),
DOC_functions(approximate_ranges),
py::arg("sample_interval_s"),
py::arg("sound_velocity_m_s"),
py::arg("first_sample_nr"),
py::arg("last_sample_nr"),
py::arg("step") = 1);

submodule.def("approximate_ranges",
py::overload_cast<float, float, const xt::pytensor<int32_t, 1>&>(
&approximate_ranges<xt::pytensor<float, 1>, xt::pytensor<int32_t, 1>>),
DOC_functions(approximate_ranges_2),
py::arg("sample_interval_s"),
py::arg("sound_velocity_m_s"),
py::arg("sample_numbers"));

submodule.def("compute_cw_range_correction",
&compute_cw_range_correction<xt::pytensor<float, 1>>,
DOC_functions(compute_cw_range_correction),
py::arg("ranges_m"),
py::arg("absorption_db_m"),
py::arg("tvg_factor"));

submodule.def("apply_wci_correction",
&apply_wci_correction<xt::pytensor<float, 2>, xt::pytensor<float, 1>>,
DOC_functions(apply_wci_correction),
submodule.def("apply_beam_sample_correction",
&apply_beam_sample_correction<xt::pytensor<float, 2>, xt::pytensor<float, 1>>,
DOC_functions(apply_beam_sample_correction),
py::arg("wci"),
py::arg("per_beam_offset"),
py::arg("per_sample_offset"),
py::arg("mp_cores") = 1);

submodule.def("apply_beam_correction",
&apply_beam_correction<xt::pytensor<float, 2>, xt::pytensor<float, 1>>,
DOC_functions(apply_beam_correction),
py::arg("wci"),
py::arg("per_beam_offset"),
py::arg("mp_cores") = 1);

submodule.def("apply_sample_correction",
&apply_sample_correction<xt::pytensor<float, 2>, xt::pytensor<float, 1>>,
DOC_functions(apply_sample_correction),
py::arg("wci"),
py::arg("per_sample_offset"),
py::arg("mp_cores") = 1);

submodule.def(
"apply_beam_sample_correction_loop",
&apply_beam_sample_correction_loop<xt::pytensor<float, 2>, xt::pytensor<float, 1>>,
DOC_functions(apply_beam_sample_correction_loop),
py::arg("wci"),
py::arg("per_beam_offset"),
py::arg("per_sample_offset"),
py::arg("mp_cores") = 1);

submodule.def(
"apply_beam_sample_correction_xtensor2",
&apply_beam_sample_correction_xtensor2<xt::pytensor<float, 2>, xt::pytensor<float, 1>>,
DOC_functions(apply_beam_sample_correction_xtensor2),
py::arg("wci"),
py::arg("per_beam_offset"),
py::arg("per_sample_offset"),
py::arg("mp_cores") = 1);
submodule.def(
"apply_beam_sample_correction_xtensor3",
&apply_beam_sample_correction_xtensor3<xt::pytensor<float, 2>, xt::pytensor<float, 1>>,
DOC_functions(apply_beam_sample_correction_xtensor3),
py::arg("wci"),
py::arg("per_beam_offset"),
py::arg("per_sample_offset"),
py::arg("mp_cores") = 1);

submodule.def(
"apply_beam_sample_correction_xsimd",
&apply_beam_sample_correction_xsimd<xt::pytensor<float, 2>, xt::pytensor<float, 1>>,
DOC_functions(apply_beam_sample_correction_xsimd),
py::arg("wci"),
py::arg("per_beam_offset"),
py::arg("per_sample_offset"),
py::arg("mp_cores") = 1);
}

} // namespace py_functions
Expand Down
2 changes: 1 addition & 1 deletion src/pymodule/geoprocessing/backtracers/c_backtracedwci.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

// -- include pybind11 headers
#include <pybind11/stl.h>
#include <xtensor-python/pyarray.hpp> // Numpy bindings
#include <xtensor-python/pytensor.hpp> // Numpy bindings

namespace themachinethatgoesping {
namespace algorithms {
Expand Down
2 changes: 1 addition & 1 deletion src/pymodule/geoprocessing/backtracers/c_btconstantsvp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

// -- include pybind11 headers
#include <pybind11/stl.h>
#include <xtensor-python/pyarray.hpp> // Numpy bindings
#include <xtensor-python/pytensor.hpp> // Numpy bindings
#include <xtensor-python/pytensor.hpp> // Numpy bindings

#include <xtensor/xadapt.hpp> // Numpy bindings
Expand Down
2 changes: 1 addition & 1 deletion src/pymodule/geoprocessing/backtracers/c_i_backtracer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

// -- include pybind11 headers
#include <pybind11/stl.h>
#include <xtensor-python/pyarray.hpp> // Numpy bindings
#include <xtensor-python/pytensor.hpp> // Numpy bindings

namespace themachinethatgoesping {
namespace algorithms {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

// -- include pybind11 headers
#include <pybind11/stl.h>
#include <xtensor-python/pyarray.hpp> // Numpy bindings
#include <xtensor-python/pytensor.hpp> // Numpy bindings

namespace themachinethatgoesping {
namespace algorithms {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

// -- include pybind11 headers
#include <pybind11/stl.h>
#include <xtensor-python/pyarray.hpp> // Numpy bindings
#include <xtensor-python/pytensor.hpp> // Numpy bindings

namespace themachinethatgoesping {
namespace algorithms {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

// -- include pybind11 headers
#include <pybind11/stl.h>
#include <xtensor-python/pyarray.hpp> // Numpy bindings
#include <xtensor-python/pytensor.hpp> // Numpy bindings

namespace themachinethatgoesping {
namespace algorithms {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

// -- include pybind11 headers
#include <pybind11/stl.h>
#include <xtensor-python/pyarray.hpp> // Numpy bindings
#include <xtensor-python/pytensor.hpp> // Numpy bindings

namespace themachinethatgoesping {
namespace algorithms {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

// -- include pybind11 headers
#include <pybind11/stl.h>
#include <xtensor-python/pyarray.hpp> // Numpy bindings
#include <xtensor-python/pytensor.hpp> // Numpy bindings

namespace themachinethatgoesping {
namespace algorithms {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

// -- include pybind11 headers
#include <pybind11/stl.h>
#include <xtensor-python/pyarray.hpp> // Numpy bindings
#include <xtensor-python/pytensor.hpp> // Numpy bindings

namespace themachinethatgoesping {
namespace algorithms {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

// -- include pybind11 headers
#include <pybind11/stl.h>
#include <xtensor-python/pyarray.hpp> // Numpy bindings
#include <xtensor-python/pytensor.hpp> // Numpy bindings

namespace themachinethatgoesping {
namespace algorithms {
Expand Down
2 changes: 1 addition & 1 deletion src/pymodule/geoprocessing/datastructures/c_xyz.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// -- include pybind11 headers
#include <pybind11/eigen.h>
#include <pybind11/stl.h>
#include <xtensor-python/pyarray.hpp> // Numpy bindings
#include <xtensor-python/pytensor.hpp> // Numpy bindings

namespace themachinethatgoesping {
namespace algorithms {
Expand Down
2 changes: 1 addition & 1 deletion src/pymodule/geoprocessing/raytracers/c_i_raytracer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

// -- include pybind11 headers
#include <pybind11/stl.h>
#include <xtensor-python/pyarray.hpp> // Numpy bindings
#include <xtensor-python/pytensor.hpp> // Numpy bindings

namespace themachinethatgoesping {
namespace algorithms {
Expand Down
2 changes: 1 addition & 1 deletion src/pymodule/geoprocessing/raytracers/c_rtconstantsvp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

// -- include pybind11 headers
#include <pybind11/stl.h>
#include <xtensor-python/pyarray.hpp> // Numpy bindings
#include <xtensor-python/pytensor.hpp> // Numpy bindings
#include <xtensor-python/pytensor.hpp> // Numpy bindings

#include <xtensor/xadapt.hpp> // Numpy bindings
Expand Down
2 changes: 1 addition & 1 deletion src/pymodule/module.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// SPDX-License-Identifier: MPL-2.0

#define FORCE_IMPORT_ARRAY // this is needed for xtensor-python but must only be included once
#include <xtensor-python/pyarray.hpp> // Numpy bindings
#include <xtensor-python/pytensor.hpp> // Numpy bindings

#include <pybind11/iostream.h>
#include <pybind11/pybind11.h>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// -- include pybind11 headers
#include <pybind11/eigen.h>
#include <pybind11/stl.h>
#include <xtensor-python/pyarray.hpp> // Numpy bindings
#include <xtensor-python/pytensor.hpp> // Numpy bindings

namespace themachinethatgoesping {
namespace algorithms {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// -- include pybind11 headers
#include <pybind11/eigen.h>
#include <pybind11/stl.h>
#include <xtensor-python/pyarray.hpp> // Numpy bindings
#include <xtensor-python/pytensor.hpp> // Numpy bindings

namespace themachinethatgoesping {
namespace algorithms {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// -- include pybind11 headers
#include <pybind11/eigen.h>
#include <pybind11/stl.h>
#include <xtensor-python/pyarray.hpp> // Numpy bindings
#include <xtensor-python/pytensor.hpp> // Numpy bindings

namespace themachinethatgoesping {
namespace algorithms {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//sourcehash: 449e2ac24adaedde10a18e765cfb777059a926172151583846f99e67ba681c04
//sourcehash: dc65b20c5b98bd8cd1ccdc2c90c6d9cb5381f4277602d31839d11b1132321279

/*
This file contains docstrings for use in the Python bindings.
Expand Down Expand Up @@ -42,6 +42,8 @@ static const char *__doc_themachinethatgoesping_algorithms_amplitudecorrection_f

static const char *__doc_themachinethatgoesping_algorithms_amplitudecorrection_functions_approximate_ranges = R"doc()doc";

static const char *__doc_themachinethatgoesping_algorithms_amplitudecorrection_functions_approximate_ranges_2 = R"doc()doc";

static const char *__doc_themachinethatgoesping_algorithms_amplitudecorrection_functions_compute_cw_range_correction = R"doc()doc";

static const char *__doc_themachinethatgoesping_algorithms_amplitudecorrection_functions_get_sample_numbers_plus_half = R"doc()doc";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//sourcehash: 9f9b40bf69cc0bc6ec707420219e7f552a786bcfa4cc47a6f78c86291bd384ae
//sourcehash: a302a9f48e1b20efdf9ab01a6bae5c8fea7eea95c0e2aafc2ed22d54e3dbd97a

/*
This file contains docstrings for use in the Python bindings.
Expand Down Expand Up @@ -38,7 +38,23 @@
#endif


static const char *__doc_themachinethatgoesping_algorithms_amplitudecorrection_functions_apply_wci_correction = R"doc()doc";
static const char *__doc_themachinethatgoesping_algorithms_amplitudecorrection_functions_apply_beam_correction = R"doc()doc";

static const char *__doc_themachinethatgoesping_algorithms_amplitudecorrection_functions_apply_beam_sample_correction = R"doc()doc";

static const char *__doc_themachinethatgoesping_algorithms_amplitudecorrection_functions_apply_beam_sample_correction_loop = R"doc()doc";

static const char *__doc_themachinethatgoesping_algorithms_amplitudecorrection_functions_apply_beam_sample_correction_xsimd = R"doc()doc";

static const char *__doc_themachinethatgoesping_algorithms_amplitudecorrection_functions_apply_beam_sample_correction_xtensor2 = R"doc()doc";

static const char *__doc_themachinethatgoesping_algorithms_amplitudecorrection_functions_apply_beam_sample_correction_xtensor3 = R"doc()doc";

static const char *__doc_themachinethatgoesping_algorithms_amplitudecorrection_functions_apply_sample_correction = R"doc()doc";

static const char *__doc_themachinethatgoesping_algorithms_amplitudecorrection_functions_assert_wci_axis_shape = R"doc()doc";

static const char *__doc_themachinethatgoesping_algorithms_amplitudecorrection_functions_assert_wci_beam_sample_shape = R"doc()doc";

#if defined(__GNUG__)
#pragma GCC diagnostic pop
Expand Down
Loading

0 comments on commit e04b483

Please sign in to comment.