diff --git a/.github/workflows/ci-cmake_tests.yml b/.github/workflows/ci-cmake_tests.yml deleted file mode 100644 index 3e3956471..000000000 --- a/.github/workflows/ci-cmake_tests.yml +++ /dev/null @@ -1,100 +0,0 @@ -name: Tests and Codecov -on: - pull_request: - branches: - - master - workflow_dispatch: -jobs: - BuildAndTest: - runs-on: ubuntu-latest - defaults: - run: - shell: bash -l {0} - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - # When re-running a PR job, GitHub Actions uses the merge commit created at - # the time of the original run, not a fresh merge with the latest target branch. - # This step ensures we always test against the most recent target branch. - - name: Merge with latest target branch (pull_request only) - if: github.event_name == 'pull_request' - run: | - git fetch origin ${{ github.event.pull_request.base.ref }} - git merge --no-edit origin/${{ github.event.pull_request.base.ref }} - - - uses: conda-incubator/setup-miniconda@v3 - with: - # Specify python version your environment will have. Remember to quote this, or - # YAML will think you want python 3.1 not 3.10 - python-version: "3.11" - # This uses *miniforge*, rather than *minicond*. The primary difference is that - # the defaults channel is not enabled at all - miniforge-version: latest - # These properties enable the use of mamba, which is much faster and far less error - # prone than conda while being completely compatible with the conda CLI - use-mamba: true - mamba-version: "*" - - name: Install dependencies - shell: bash -l {0} - run: | - mamba install _openmp_mutex=*=*_llvm cmake make boost git compilers numpy mkl mkl-include mkl-service pybind11 libblas=*=*mkl arpack beartype - python -m pip install gcovr - mamba install gtest - mamba install pytest pytest-cov - - name: CPU info - shell: bash -l {0} - run: lscpu - - name: Configure CMake - shell: bash -l {0} - run: cmake -S ${{github.workspace}} -B ${{github.workspace}}/build -DCMAKE_INSTALL_PREFIX=/home/runner/work/Cytnx_lib -DUSE_MKL=on -DUSE_HPTT=on -DHPTT_ENABLE_FINE_TUNE=on -DHPTT_ENABLE_AVX=off -DBUILD_PYTHON=on -DCMAKE_EXPORT_COMPILE_COMMANDS=1 -DRUN_TESTS=on - - name: Build - shell: bash -l {0} - working-directory: ${{github.workspace}}/build - run: | - cmake --version - cmake --build . -j `nproc` - - name: Run CTest - shell: bash -l {0} - working-directory: ${{github.workspace}}/build - run: GTEST_COLOR=1 ctest --output-on-failure --output-junit junit.xml - - name: Run gcovr - shell: bash -l {0} - working-directory: ${{github.workspace}}/build - run: | - gcovr -r .. . --xml gcovr.xml -e ".*_deps.*$" - - name: Upload coverage to Codecov - uses: codecov/codecov-action@v4 - with: - token: ${{ secrets.CODECOV_TOKEN }} # not required for public repos - #directory: ${{runner.workspace}}/build - files: ${{github.workspace}}/build/gcovr.xml # optional - #working-directory: ${{runner.workspace}}/build - #root_dir: ${{runner.workspace}} - fail_ci_if_error: true # optional (default = false) - verbose: true # optional (default = false) - #version: "v0.1.15" - - name: Install for python tests - shell: bash -l {0} - working-directory: ${{github.workspace}}/build - run: | - make install - - name: Set python path - shell: bash -l {0} - run: | - echo "PYTHONPATH=/home/runner/work/Cytnx_lib" >> $GITHUB_ENV - - name: Test with pytest - shell: bash -l {0} - run: | - pytest pytests/ --doctest-modules --junitxml=junit/test-results.xml --cov=com --cov-report=xml --cov-report=html - #- name: Upload gcovr files - # uses: actions/upload-artifact@v3 - # with: - # name: CMakeError.log - # path: /home/runner/work/Cytnx/Cytnx/build/CMakeFiles/CMakeError.log - #- name: Upload junit files - # uses: actions/upload-artifact@v3 - # with: - # name: junit_xml - # path: ${{github.workspace}}/build/junit.xml diff --git a/.github/workflows/clang-format-check.yml b/.github/workflows/clang-format-check.yml deleted file mode 100644 index d37eaaa5f..000000000 --- a/.github/workflows/clang-format-check.yml +++ /dev/null @@ -1,28 +0,0 @@ -name: clang-format Check -on: - pull_request: - workflow_dispatch: -jobs: - formatting-check: - name: Formatting Check - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - # When re-running a PR job, GitHub Actions uses the merge commit created at - # the time of the original run, not a fresh merge with the latest target branch. - # This step ensures we always test against the most recent target branch. - - name: Merge with latest target branch (pull_request only) - if: github.event_name == 'pull_request' - run: | - git fetch origin ${{ github.event.pull_request.base.ref }} - git merge --no-edit origin/${{ github.event.pull_request.base.ref }} - - - name: Run clang-format style check for C/C++/Protobuf programs. - uses: jidicula/clang-format-action@v4.16.0 - with: - clang-format-version: '14' - check-path: '.' - fallback-style: 'Google' # optional diff --git a/.github/workflows/conda_build.yml b/.github/workflows/conda_build.yml index 2cb131d7b..457ddabd3 100644 --- a/.github/workflows/conda_build.yml +++ b/.github/workflows/conda_build.yml @@ -1,12 +1,6 @@ name: Conda Build (Test build) on: - push: - branches: - - master - pull_request: - branches: - - master workflow_dispatch: jobs: diff --git a/.github/workflows/conda_build_release.yml b/.github/workflows/conda_build_release.yml deleted file mode 100644 index b28f083ff..000000000 --- a/.github/workflows/conda_build_release.yml +++ /dev/null @@ -1,74 +0,0 @@ -name: Conda Build (Release) - -on: - push: - tags: - - 'v[0-9]+.[0-9]+.[0-9]+' - - workflow_dispatch: - -jobs: - BuildAndTest: - name: BuildAndTest-${{ matrix.os }} - runs-on: ${{ matrix.os }} - strategy: - matrix: - os: [ubuntu-latest, macos-13, macos-latest] - - steps: - - uses: actions/checkout@v4 - - - uses: conda-incubator/setup-miniconda@v3 - with: - # Remember to quote this, or YAML will think you want python 3.1 not 3.10 - python-version: "3.10" - # Using miniforge to the enable conda-forge channel only. - miniforge-version: latest - - - name: Config Conda - run: | - echo "Config Conda---------------------------------" - conda info - conda config --set anaconda_upload no - conda install conda-build - - - name: Cache Ccache Directory - uses: actions/cache@v4 - with: - path: | - ~/.ccache - key: ccache-${{ runner.os }}-${{ github.ref_name }}-${{ github.sha }} - restore-keys: | - ccache-${{ runner.os }}-${{ github.ref_name }}- - - - name: start building - # TODO: Consider to replace conda-build with rattler-build to speed up - # the build process. - # Conda build creates different working folder each time, which make - # ccache fails to hit the cache. Set `--build-id-pat` to make the build - # folder consistent across builds, so that ccache can hit the cache. - # See: https://github.com/ccache/ccache/discussions/821#discussioncomment-521209 - run: | - echo "Building begin---------------------------------" - export CCACHE_DIR="${HOME}/.ccache" - - echo "Get Output filename_________________" - OUTPUT_FN=$(conda build conda_build/ --build-id-pat "cytnx" --output) - echo $OUTPUT_FN - - echo "Start building---------------------------------" - conda build conda_build/ --build-id-pat "cytnx" - - echo "Upload build---------------------------------" - anaconda -t $TOKEN upload -u kaihsinwu "$OUTPUT_FN" --force - - env: - CMAKE_C_COMPILER_LAUNCHER: ccache - CMAKE_CXX_COMPILER_LAUNCHER: ccache - CMAKE_CUDA_COMPILER_LAUNCHER: ccache - # DO NOT enable this line because the script for conda build is not - # executed in a interactive shell, and "~" will not be expanded to the - # home directory. Export CCACHE_DIR in the run command instead. - # CCACHE_DIR: ~/.ccache - CCACHE_MAXSIZE: 1G # The limit of actions/cache is 10GB - TOKEN: ${{ secrets.CONDA_UPLOAD_TOKEN }} diff --git a/.github/workflows/coverity-scan.yml b/.github/workflows/coverity-scan.yml deleted file mode 100644 index 6210532d1..000000000 --- a/.github/workflows/coverity-scan.yml +++ /dev/null @@ -1,71 +0,0 @@ -name: Coverity Scan - -on: - schedule: - - cron: '0 18 * * *' # Daily at 18:00 UTC - workflow_dispatch: - -jobs: - latest: - if: (github.event_name == 'schedule' && github.repository == 'Cytnx-dev/Cytnx') || (github.event_name != 'schedule') - runs-on: ubuntu-latest - - defaults: - run: - shell: bash - - steps: - - uses: actions/checkout@v4 - - - uses: conda-incubator/setup-miniconda@v3 - with: - # Specify python version your environment will have. Remember to quote this, or - # YAML will think you want python 3.1 not 3.10 - python-version: "3.11" - # This uses *miniforge*, rather than *minicond*. The primary difference is that - # the defaults channel is not enabled at all - miniforge-version: latest - # These properties enable the use of mamba, which is much faster and far less error - # prone than conda while being completely compatible with the conda CLI - use-mamba: true - mamba-version: "*" - - - name: Install dependencies - shell: bash -l {0} - run: | - mamba install cmake make boost compilers blas=*=mkl pybind11 arpack - - cmake -S ${{github.workspace}} -B ${{github.workspace}}/build -DCMAKE_INSTALL_PREFIX=/home/runner/works/Cytnx_lib --preset=mkl-cpu - - - name: Download Coverity Build Tool - shell: bash -l {0} - working-directory: ${{github.workspace}}/build - run: | - wget -q https://scan.coverity.com/download/cxx/linux64 --post-data "token=$TOKEN&project=Cytnx-dev%2FCytnx" -O cov-analysis-linux64.tar.gz - mkdir cov-analysis-linux64 - tar xzf cov-analysis-linux64.tar.gz --strip 1 -C cov-analysis-linux64 - env: - TOKEN: ${{ secrets.COVERITY_SCAN_TOKEN }} - - - name: Build with cov-build - shell: bash -l {0} - working-directory: ${{github.workspace}}/build - run: | - export PATH=`pwd`/cov-analysis-linux64/bin:$PATH - cmake --version - cov-build --dir cov-int cmake --build . -j `nproc` - - - name: Submit the result to Coverity Scan - shell: bash -l {0} - working-directory: ${{github.workspace}}/build - run: | - tar czvf cytnx.tgz cov-int - curl \ - --form token=$TOKEN \ - --form email=kaihsinwu@gmail.com \ - --form file=@cytnx.tgz \ - --form version="v0.9.x" \ - --form description="Cytnx" \ - https://scan.coverity.com/builds?project=Cytnx-dev%2FCytnx - env: - TOKEN: ${{ secrets.COVERITY_SCAN_TOKEN }} diff --git a/.github/workflows/find_lapacke.yml b/.github/workflows/find_lapacke.yml new file mode 100644 index 000000000..fadd31735 --- /dev/null +++ b/.github/workflows/find_lapacke.yml @@ -0,0 +1,63 @@ +name: Find LAPACKE + +on: + pull_request: + +jobs: + FindLAPACKE: + name: FindLAPACKE-${{ matrix.package }} + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + include: + # - {package: liblapack-dev, include: lapack} + # - {package: liblapack64-dev, include: lapack} + - {package: liblapacke-dev, include: lapacke} #lapacke.h + - {package: liblapacke64-dev, include: lapacke} # libblas64-3 libblas64-dev liblapack64-3 liblapack64-dev liblapacke64 liblapacke64-dev + # - {package: liblapack3, include: lapack} #? + # - {package: liblapack64-3, include: lapack} #? + # - {package: liblapacke, include: lapacke} + # - {package: liblapacke64, include: lapacke} + # - {package: libopenblas-dev, include: openblas} + # - {package: libopenblas64-dev, include: openblas} # libopenblas64-pthread-dev + - {package: libopenblas-openmp-dev, include: openblas} + - {package: libopenblas64-openmp-dev, include: openblas} + - {package: libopenblas-pthread-dev, include: openblas} + - {package: libopenblas64-pthread-dev, include: openblas} + # - {package: libopenblas0, include: openblas} + # - {package: libopenblas64-0, include: openblas} + # - {package: libopenblas0-openmp, include: openblas} + # - {package: libopenblas64-0-openmp, include: openblas} + defaults: + run: + shell: bash -l {0} + + steps: + # - name: probe LAPACK + # run: | + # sudo apt update + # apt list --all-versions "*lapack*" + # apt list --all-versions "*openblas*" + + # liblapack64-dev + # liblapacke64-dev + # liblapack64 + # liblapacke64 + # libopenblas64-dev + # libopenblas64-openmp-dev + # libopenblas64-0 + # libopenblas64-0-openmp + - name: install lapack + run: | + export BASH_XTRACEFD=1 # send xtrace to stdout + set -x + ls /usr/include + ls /usr/include/x86_64-linux-gnu + sudo apt update + sudo apt install ${{ matrix.package }} + dpkg -L ${{ matrix.package }} + # ls /usr/include + ls -l /usr/include/x86_64-linux-gnu + ls -l /etc/alternatives + # ls /usr/include/x86_64-linux-gnu/${{ matrix.include }}