diff --git a/.github/workflows/installation.yml b/.github/workflows/installation.yml index 1cd4e6d4..a949193e 100644 --- a/.github/workflows/installation.yml +++ b/.github/workflows/installation.yml @@ -33,15 +33,9 @@ jobs: docker build -t serial . echo "Testing installation from PyPi" - docker run -t serial bash -c \ - "pip install CLUEstering; python3 -c 'import CLUEstering' || exit 1" - - echo "Testing installation from git repository" - docker run -t serial bash -c \ - "git clone --recursive https://github.com/cms-patatrack/CLUEstering; - cd CLUEstering; - pip install . ; - python3 -c 'import CLUEstering' || exit 1" + docker run -t -v "$(pwd)"/../../:/app serial bash -c \ + "cd /app && pip install .; + python3 -c 'import CLUEstering' || exit 0" - name: Test installation inside docker containers (serial without boost) working-directory: ${{github.workspace}}/docker/no_boost @@ -49,15 +43,9 @@ jobs: docker build -t noboost . echo "Testing installation from PyPi" - docker run -t noboost bash -c \ - "pip install CLUEstering; python3 -c 'import CLUEstering' || exit 1" - - echo "Testing installation from git repository" - docker run -t noboost bash -c \ - "git clone --recursive https://github.com/cms-patatrack/CLUEstering; - cd CLUEstering; - pip install . ; - python3 -c 'import CLUEstering' || exit 1" + docker run -t -v "$(pwd)"/../../:/app noboost bash -c \ + "cd /app && pip install .; + python3 -c 'import CLUEstering' || exit 0" - name: Test installation inside docker containers (tbb) working-directory: ${{github.workspace}}/docker/tbb @@ -65,15 +53,9 @@ jobs: docker build -t tbb . echo "Testing installation from PyPi" - docker run -t tbb bash -c \ - "pip install CLUEstering; python3 -c 'import CLUEstering' || exit 1" - - echo "Testing installation from git repository" - docker run -t tbb bash -c \ - "git clone --recursive https://github.com/cms-patatrack/CLUEstering; - cd CLUEstering; - pip install . ; - python3 -c 'import CLUEstering' || exit 1" + docker run -t -v "$(pwd)"/../../:/app tbb bash -c \ + "cd /app && pip install .; + python3 -c 'import CLUEstering' || exit 0" - name: Test installation inside docker containers (without gcc) working-directory: ${{github.workspace}}/docker/no_gcc @@ -81,14 +63,8 @@ jobs: docker build -t nogcc . echo "Testing installation from PyPi" - docker run -t nogcc bash -c \ - "pip install CLUEstering; python3 -c 'import CLUEstering' || exit 0" - - echo "Testing installation from git repository" - docker run -t nogcc bash -c \ - "git clone --recursive https://github.com/cms-patatrack/CLUEstering; - cd CLUEstering; - pip install . ; + docker run -t -v "$(pwd)"/../../:/app nogcc bash -c \ + "cd /app && pip install .; python3 -c 'import CLUEstering' || exit 0" - name: Test installation inside docker containers (without cmake) @@ -97,12 +73,6 @@ jobs: docker build -t nocmake . echo "Testing installation from PyPi" - docker run -t nocmake bash -c \ - "pip install CLUEstering; python3 -c 'import CLUEstering' || exit 0" - - echo "Testing installation from git repository" - docker run -t nocmake bash -c \ - "git clone --recursive https://github.com/cms-patatrack/CLUEstering; - cd CLUEstering; - pip install . ; + docker run -t -v "$(pwd)"/../../:/app nocmake bash -c \ + "cd app && pip install .; python3 -c 'import CLUEstering' || exit 0" diff --git a/CLUEstering/alpaka/AlpakaCore/CachedBufAlloc.h b/CLUEstering/alpaka/AlpakaCore/CachedBufAlloc.h index 53f9952d..b1c6849f 100644 --- a/CLUEstering/alpaka/AlpakaCore/CachedBufAlloc.h +++ b/CLUEstering/alpaka/AlpakaCore/CachedBufAlloc.h @@ -26,7 +26,7 @@ namespace cms::alpakatools { template struct CachedBufAlloc { template - ALPAKA_FN_HOST static auto allocCachedBuf(alpaka::DevCpu const& dev, + ALPAKA_FN_HOST static auto allocCachedBuf(alpaka::DevCpu const&, TQueue queue, TExtent const& extent) -> alpaka::BufCpu { diff --git a/CLUEstering/alpaka/AlpakaCore/getDeviceIndex.h b/CLUEstering/alpaka/AlpakaCore/getDeviceIndex.h index b26efcf9..c9192e9c 100644 --- a/CLUEstering/alpaka/AlpakaCore/getDeviceIndex.h +++ b/CLUEstering/alpaka/AlpakaCore/getDeviceIndex.h @@ -7,12 +7,12 @@ namespace cms::alpakatools { // generic interface, for DevOacc and DevOmp5 template - inline int getDeviceIndex(Device const& device) { + inline int getDeviceIndex(const Device& device) { return device.iDevice(); } // overload for DevCpu - inline int getDeviceIndex(alpaka::DevCpu const& device) { return 0; } + inline int getDeviceIndex(const alpaka::DevCpu&) { return 0; } #ifdef ALPAKA_ACC_GPU_CUDA_ENABLED // overload for DevCudaRt diff --git a/CLUEstering/alpaka/CLUE/ConvolutionalKernel.h b/CLUEstering/alpaka/CLUE/ConvolutionalKernel.h index 2f7cdf4b..df799a4b 100644 --- a/CLUEstering/alpaka/CLUE/ConvolutionalKernel.h +++ b/CLUEstering/alpaka/CLUE/ConvolutionalKernel.h @@ -15,8 +15,8 @@ class FlatKernel { // Overload call operator template - ALPAKA_FN_HOST_ACC float operator()(const TAcc& acc, - float dist_ij, + ALPAKA_FN_HOST_ACC float operator()(const TAcc&, + float /*dist_ij*/, int point_id, int j) const { if (point_id == j) { diff --git a/CLUEstering/alpaka/DataFormats/alpaka/TilesAlpaka.h b/CLUEstering/alpaka/DataFormats/alpaka/TilesAlpaka.h index 41ff9110..a1c0dfd7 100644 --- a/CLUEstering/alpaka/DataFormats/alpaka/TilesAlpaka.h +++ b/CLUEstering/alpaka/DataFormats/alpaka/TilesAlpaka.h @@ -83,7 +83,7 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE { template ALPAKA_FN_HOST_ACC inline constexpr int getGlobalBinByBin( - const TAcc& acc, const VecArray& Bins) const { + const TAcc&, const VecArray& Bins) const { uint32_t globalBin{Bins[0]}; for (int i{1}; i != Ndim; ++i) { globalBin += n_tiles_per_dim * Bins[i]; diff --git a/setup.py b/setup.py index 8f9bc6f5..5b07fe1c 100644 --- a/setup.py +++ b/setup.py @@ -1,16 +1,26 @@ -import os import sys from pathlib import Path from setuptools import setup +import subprocess -__version__ = "2.2.5" +__version__ = "2.2.6" this_directory = Path(__file__).parent long_description = (this_directory/'README.md').read_text() -if sys.argv[1] != 'sdist': - os.system("cmake -B build && make -C build") +cmake_command = ['cmake', '-B', 'build'] +make_command = ['make', '-C', 'build'] + +try: + # Execute the cmake command and print its output + subprocess.check_call(cmake_command, stderr=subprocess.STDOUT) + # Execute the make command and print its output + subprocess.check_call(make_command, stderr=subprocess.STDOUT) +except subprocess.CalledProcessError as e: + print(e.output) + sys.exit(e.returncode) + setup( name="CLUEstering", @@ -18,19 +28,19 @@ author="Simone Balducci", author_email="simone.balducci00@gmail.com", description='''A library that generalizes the original 2-dimensional CLUE - algorithm made at CERN.''', + algorithm made at CERN.''', long_description=long_description, long_description_content_type='text/markdown', packages=['CLUEstering'], - install_requires=['scikit-learn','numpy','matplotlib','pandas'], + install_requires=['scikit-learn', 'numpy', 'matplotlib', 'pandas'], package_data={'': []}, - keywords=['Python','Clustering','Binding'], + keywords=['Python', 'Clustering', 'Binding'], python_requires='>=3.7', classifiers=[ - 'Intended Audience :: Developers', - 'Programming Language :: Python :: 3', - 'Operating System :: Unix', - 'Operating System :: MacOS :: MacOS X', - 'Operating System :: Microsoft :: Windows', + 'Intended Audience :: Developers', + 'Programming Language :: Python :: 3', + 'Operating System :: Unix', + 'Operating System :: MacOS :: MacOS X', + 'Operating System :: Microsoft :: Windows', ] )