diff --git a/.github/workflows/apple.yml b/.github/workflows/apple.yml index 9bd337780..824f1d729 100644 --- a/.github/workflows/apple.yml +++ b/.github/workflows/apple.yml @@ -5,68 +5,68 @@ name: "Apple MacOS" -on: +on: push: - paths-ignore: + paths-ignore: - '**.md' - 'doc/**' pull_request: - paths-ignore: + paths-ignore: - '**.md' - 'doc/**' jobs: build: - name: "MacOS 11 clang -std=c++${{matrix.cxxstd}}" - runs-on: macos-11 + name: "MacOS clang -std=c++${{matrix.cxxstd}}" + runs-on: macos-latest strategy: fail-fast: true matrix: - cxxstd: [2a] + cxxstd: [20,23] steps: - uses: actions/checkout@v2 - + - name: Git Clone Boost.uBlas run: | cd ${GITHUB_WORKSPACE} cd .. - + git clone -b master --depth 1 https://github.com/boostorg/boost.git boost-root cd boost-root echo "BOOST_ROOT=${PWD}" >> ${GITHUB_ENV} echo $BOOST_ROOT - + git submodule update --init --depth=1 --jobs 8 tools/build git submodule update --init --depth=1 --jobs 8 libs/config git submodule update --init --depth=1 --jobs 8 tools/boostdep - + mkdir -p libs/numeric/ cp -rp ${GITHUB_WORKSPACE}/. libs/numeric/ublas python tools/boostdep/depinst/depinst.py -g " --depth=1" -I benchmarks numeric/ublas - + - name: Bootstrap and Compile Boost.uBlas run: | cd $BOOST_ROOT ./bootstrap.sh ./b2 -j8 headers - echo "using clang : : $(brew --prefix llvm)/bin/clang++ ;" >> ~/user-config.jam; + echo "using clang ;" >> ~/user-config.jam; + - - name: Test Benchmarks run: | cd $BOOST_ROOT cd libs/numeric/ublas $BOOST_ROOT/b2 -j8 benchmarks cxxstd=${{matrix.cxxstd}} - + - name: Test Tensor Examples run: | cd $BOOST_ROOT cd libs/numeric/ublas $BOOST_ROOT/b2 -j8 examples/tensor cxxstd=${{matrix.cxxstd}} - + - name: Test Tensor run: | cd $BOOST_ROOT cd libs/numeric/ublas $BOOST_ROOT/b2 -j8 test/tensor cxxstd=${{matrix.cxxstd}} - + diff --git a/.github/workflows/clangtidy.yml b/.github/workflows/clangtidy.yml index 11b1aea41..701d0252d 100644 --- a/.github/workflows/clangtidy.yml +++ b/.github/workflows/clangtidy.yml @@ -5,13 +5,13 @@ name: "Static Analysis" -on: +on: push: - paths-ignore: + paths-ignore: - '**.md' - 'doc/**' pull_request: - paths-ignore: + paths-ignore: - '**.md' - 'doc/**' jobs: @@ -20,33 +20,33 @@ jobs: runs-on: ubuntu-20.04 steps: - uses: actions/checkout@v2 - + - name: Install Clang 11 run: sudo apt-get update && sudo apt-get install -y clang-11 clang-tidy-11 - + - name: "Install Boost from Source" run: | cd .. git clone --depth 1 https://github.com/boostorg/boost.git --recursive --shallow-submodules cd boost - ./bootstrap.sh + ./bootstrap.sh ./b2 headers sudo cp -r -L boost /usr/include rm -rf boost - + - name: "Run Clang-Tidy" run: clang-tidy-11 examples/tensor/*.cpp test/tensor/*.cpp -- -Iinclude -std=c++20 > reports.txt - name: "Print Clang-Tidy Report" run: cat reports.txt - + - uses: actions/setup-python@v2 - + - name: "Post review comments" if: github.event.pull_request.head.repo.full_name == github.repository run: | pip3 install 'unidiff~=0.6.0' --force-reinstall pip3 install 'PyGithub~=1.51' --force-reinstall pip3 install 'requests~=2.23' --force-reinstall - python ./.ci/post_review.py --repository ${{ github.repository }} --token ${{ github.token}} --pr ${{ github.event.pull_request.number }} --path reports.txt - + python ./.ci/post_review.py --repository ${{ github.repository }} --token ${{ github.token}} --pr ${{ github.event.pull_request.number }} --path reports.txt + diff --git a/benchmarks/Jamfile b/benchmarks/Jamfile index ab2f77e82..0ff838f85 100644 --- a/benchmarks/Jamfile +++ b/benchmarks/Jamfile @@ -4,8 +4,10 @@ # Boost Software License, Version 1.0. (See accompanying file # LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -project boost/ublas/benchmarks - : requirements /boost/program_options//boost_program_options +project + : requirements + /boost/ublas//boost_ublas + /boost/program_options//boost_program_options ; exe add : add.cpp ; diff --git a/benchmarks/opencl/Jamfile b/benchmarks/opencl/Jamfile index 282d00711..045c9cefb 100644 --- a/benchmarks/opencl/Jamfile +++ b/benchmarks/opencl/Jamfile @@ -13,7 +13,7 @@ import ../../clblas ; using opencl ; using clblas ; -project boost/ublas/benchmarks/opencl +project : requirements /boost/program_options//boost_program_options gcc:-Wno-ignored-attributes diff --git a/build.jam b/build.jam new file mode 100644 index 000000000..e2e3be8f7 --- /dev/null +++ b/build.jam @@ -0,0 +1,34 @@ +# Copyright René Ferdinand Rivera Morell 2023-2024 +# Distributed under the Boost Software License, Version 1.0. +# (See accompanying file LICENSE_1_0.txt or copy at +# http://www.boost.org/LICENSE_1_0.txt) + +require-b2 5.2 ; + +constant boost_dependencies : + /boost/compute//boost_compute + /boost/concept_check//boost_concept_check + /boost/config//boost_config + /boost/core//boost_core + /boost/interval//boost_interval + /boost/iterator//boost_iterator + /boost/mpl//boost_mpl + /boost/range//boost_range + /boost/serialization//boost_serialization + /boost/smart_ptr//boost_smart_ptr + /boost/static_assert//boost_static_assert + /boost/type_traits//boost_type_traits + /boost/typeof//boost_typeof ; + +project /boost/ublas + ; + +explicit + [ alias boost_ublas : : : + : include $(boost_dependencies) ] + [ alias all : boost_ublas benchmarks examples/tensor test ] + ; + +call-if : boost-library ublas + ; + diff --git a/examples/tensor/Jamfile b/examples/tensor/Jamfile index 101a8a4c9..0211d5416 100644 --- a/examples/tensor/Jamfile +++ b/examples/tensor/Jamfile @@ -6,20 +6,23 @@ # Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at # http://www.boost.org/LICENSE_1_0.txt) -import ../../../../config/checks/config : requires ; - +import-search /boost/config/checks ; +import config : requires ; + # Project settings -project boost-ublas-tensor-example +project : requirements + /boost/ublas//boost_ublas BOOST_UBLAS_NO_EXCEPTIONS vacpp:"BOOST_UBLAS_NO_ELEMENT_PROXIES" gcc:"-Wall -pedantic -Wextra -Wno-unknown-pragmas" clang:"-Wall -pedantic -Wextra -Wno-unknown-pragmas" msvc:"/W4" # == all [ requires cxx17_if_constexpr ] + 20 ; -exe access_tensor : access_tensor.cpp ; +exe access_tensor : access_tensor.cpp /boost/multiprecision//boost_multiprecision ; exe simple_expressions : simple_expressions.cpp ; exe multiply_tensors_product_function : multiply_tensors_product_function.cpp ; exe multiply_tensors_einstein_notation : multiply_tensors_einstein_notation.cpp ; diff --git a/test/Jamfile b/test/Jamfile index f6716e2c6..78a6bc132 100644 --- a/test/Jamfile +++ b/test/Jamfile @@ -26,29 +26,30 @@ UBLAS_TESTSET ?= # Sparse matrices: USE_MAPPED_MATRIX USE_COMPRESSED_MATRIX USE_COORDINATE_MATRIX USE_MAPPED_VECTOR_OF_MAPPED_VECTOR USE_GENERALIZED_VECTOR_OF_VECTOR UBLAS_TESTSET_SPARSE = [ modules.peek : UBLAS_TESTSET_SPARSE ] ; -UBLAS_TESTSET_SPARSE ?= +UBLAS_TESTSET_SPARSE ?= USE_DOUBLE USE_STD_COMPLEX # USE_RANGE USE_SLICE # Too complex for regression testing USE_UNBOUNDED_ARRAY USE_MAP_ARRAY USE_STD_MAP - USE_MAPPED_VECTOR USE_COMPRESSED_VECTOR - USE_MAPPED_MATRIX USE_COMPRESSED_MATRIX + USE_MAPPED_VECTOR USE_COMPRESSED_VECTOR + USE_MAPPED_MATRIX USE_COMPRESSED_MATRIX ; # Generalize VofV still failing # USE_GENERALIZED_VECTOR_OF_VECTOR UBLAS_TESTSET_SPARSE_COO = [ modules.peek : UBLAS_TESTSET_SPARSE_COO ] ; -UBLAS_TESTSET_SPARSE_COO ?= +UBLAS_TESTSET_SPARSE_COO ?= USE_DOUBLE USE_STD_COMPLEX USE_UNBOUNDED_ARRAY USE_COORDINATE_VECTOR - USE_COORDINATE_MATRIX + USE_COORDINATE_MATRIX ; # Project settings -project boost-ublas-test +project : requirements + /boost/ublas//boost_ublas BOOST_UBLAS_NO_EXCEPTIONS vacpp:"BOOST_UBLAS_NO_ELEMENT_PROXIES" gcc:"-Wall -Wno-unknown-pragmas" @@ -111,16 +112,17 @@ test-suite numeric/uBLAS test33.cpp : : : USE_FLOAT - USE_DOUBLE - USE_STD_COMPLEX + USE_DOUBLE + USE_STD_COMPLEX USE_STD_MAP - USE_MAPPED_VECTOR_OF_MAPPED_VECTOR - : test3_mvov + USE_MAPPED_VECTOR_OF_MAPPED_VECTOR + : test3_mvov : ] [ run test4.cpp test42.cpp test43.cpp + /boost/math//boost_math_tr1 : : : $(UBLAS_TESTSET) ] @@ -165,92 +167,93 @@ test-suite numeric/uBLAS ] [ run triangular_layout.cpp ] - [ run comp_mat_erase.cpp + [ run comp_mat_erase.cpp /boost/test//included : : : msvc:on ] - [ run sparse_view_test.cpp + [ run sparse_view_test.cpp /boost/test//included : : : msvc:on ] - [ run begin_end.cpp + [ run begin_end.cpp /boost/math//boost_math_tr1 ] - [ run num_columns.cpp + [ run num_columns.cpp /boost/math//boost_math_tr1 ] - [ run num_rows.cpp + [ run num_rows.cpp /boost/math//boost_math_tr1 ] - [ run size.cpp + [ run size.cpp /boost/math//boost_math_tr1 ] - [ run test_coordinate_matrix_sort.cpp + [ run test_coordinate_matrix_sort.cpp /boost/math//boost_math_tr1 ] - [ run test_coordinate_matrix_sort.cpp + [ run test_coordinate_matrix_sort.cpp /boost/math//boost_math_tr1 : : : BOOST_UBLAS_COO_ALWAYS_DO_FULL_SORT : test_coordinate_matrix_always_do_full_sort : ] - [ run test_complex_norms.cpp + [ run test_complex_norms.cpp /boost/math//boost_math_tr1 ] - [ run test_scaled_norm.cpp + [ run test_scaled_norm.cpp /boost/math//boost_math_tr1 : : : BOOST_UBLAS_SCALED_NORM ] - [ run test_assignment.cpp + [ run test_assignment.cpp /boost/timer//boost_timer /boost/math//boost_math_tr1 : : : BOOST_UBLAS_COO_ALWAYS_DO_FULL_SORT + BOOST_TIMER_ENABLE_DEPRECATED ] [ run test_triangular.cpp : : : /boost/timer//boost_timer ] - [ run test_ticket7296.cpp + [ run test_ticket7296.cpp /boost/math//boost_math_tr1 : : : msvc:/wd4127 # The program checks that test facilities work fine. The warning appears many times. : : ] - [ run test_inplace_solve.cpp - : - : + [ run test_inplace_solve.cpp /boost/math//boost_math_tr1 + : + : : $(UBLAS_TESTSET) : test_inplace_solve_basic : ] - [ run test_inplace_solve.cpp - : - : + [ run test_inplace_solve.cpp /boost/math//boost_math_tr1 + : + : : $(UBLAS_TESTSET_SPARSE) $(UBLAS_TESTSET_SPARSE_COO) : test_inplace_solve_sparse : ] - [ run test_inplace_solve.cpp - : - : + [ run test_inplace_solve.cpp /boost/math//boost_math_tr1 + : + : : USE_MAPPED_VECTOR_OF_MAPPED_VECTOR : test_inplace_solve_mvov : ] - [ run test_coordinate_vector_inplace_merge.cpp + [ run test_coordinate_vector_inplace_merge.cpp /boost/math//boost_math_tr1 ] - [ run test_coordinate_matrix_inplace_merge.cpp + [ run test_coordinate_matrix_inplace_merge.cpp /boost/math//boost_math_tr1 ] - [ run test_banded_storage_layout.cpp + [ run test_banded_storage_layout.cpp /boost/math//boost_math_tr1 : : : : : ] - [ run test_fixed_containers.cpp + [ run test_fixed_containers.cpp /boost/math//boost_math_tr1 : : : ] - [ run test_matrix_vector.cpp + [ run test_matrix_vector.cpp /boost/math//boost_math_tr1 ] [ compile minimal_allocator_test.cpp ] ; diff --git a/test/opencl/Jamfile b/test/opencl/Jamfile index cc8679223..9da1870ed 100644 --- a/test/opencl/Jamfile +++ b/test/opencl/Jamfile @@ -13,7 +13,7 @@ import ../../clblas ; using opencl ; using clblas ; -project boost/ublas/test/opencl +project : requirements gcc:-Wno-ignored-attributes clang:-Wno-ignored-attributes diff --git a/test/tensor/Jamfile b/test/tensor/Jamfile index 908e359ea..a76251163 100644 --- a/test/tensor/Jamfile +++ b/test/tensor/Jamfile @@ -11,7 +11,8 @@ # Google and Fraunhofer IOSB, Ettlingen, Germany # -import ../../../../config/checks/config : requires ; +import-search /boost/config/checks ; +import config : requires ; project boost/ublas/test/tensor : requirements @@ -22,7 +23,7 @@ project boost/ublas/test/tensor alias unit_test_framework : # sources - /boost//unit_test_framework + /boost/test//boost_unit_test_framework ; # make aliases explicit so the libraries will only be built when requested @@ -93,6 +94,6 @@ test-suite boost-ublas-tensor-test : : test_tensor : - # + # ] ;