diff --git a/.github/workflows/build-upload-conda-test.yml b/.github/workflows/build-upload-conda-test.yml new file mode 100644 index 000000000000..75fb427dff88 --- /dev/null +++ b/.github/workflows/build-upload-conda-test.yml @@ -0,0 +1,137 @@ +name: Deploy conda pkgs (test) + +on: + pull_request: + workflow_dispatch: + +jobs: + # Job to deploy llvm-openmp-dev, runs once as it is independent of the python + # version. + conda-deploy-llvm-openmp-dev: + name: llvm-openmp-dev ${{ matrix.os }} + runs-on: ${{ matrix.os }} + strategy: + matrix: + #os: [ubuntu-latest, macOS-latest, windows-latest] + os: [ubuntu-latest, macOS-latest] + steps: + - uses: actions/checkout@v4 + - name: Set env for HEAD SHA + run: + echo "GITHUB_HEAD_SHA=${{ github.event.pull_request.head.sha }}" >> $GITHUB_ENV + - name: Create and activate conda env + uses: conda-incubator/setup-miniconda@v3 + with: + python-version: "3.10" + environment-file: .github/workflows/envs/env-test.yml + auto-update-conda: false + auto-activate-base: false + show-channel-urls: true + - name: Build and upload llvm-openmp-dev + uses: uibcdf/action-build-and-upload-conda-packages@v1.3.0 + with: + meta_yaml_dir: buildscripts/conda-recipes/llvm-openmp-dev + python-version: "3.10" + user: python-for-hpc + label: test + overwrite: true + token: ${{ secrets.ANACONDA_TOKEN }} + + # Job to deploy llvmlite and numba, matrixed on os and python version. + conda-deploy-llvmlite: + needs: conda-deploy-llvm-openmp-dev + name: llvmlite ${{ matrix.os }} ${{ matrix.python-version }} + runs-on: ${{ matrix.os }} + strategy: + matrix: + #os: [ubuntu-latest, macOS-latest, windows-latest] + os: [ubuntu-latest, macOS-latest] + python-version: ["3.8", "3.9", "3.10"] + steps: + - uses: actions/checkout@v4 + - name: Set env for HEAD SHA + run: + echo "GITHUB_HEAD_SHA=${{ github.event.pull_request.head.sha }}" >> $GITHUB_ENV + - name: Create and activate conda env + uses: conda-incubator/setup-miniconda@v3 + with: + python-version: ${{ matrix.python-version }} + environment-file: .github/workflows/envs/env-test.yml + auto-update-conda: false + auto-activate-base: false + show-channel-urls: true + - name: Build and upload llvmlite + uses: uibcdf/action-build-and-upload-conda-packages@v1.3.0 + with: + meta_yaml_dir: buildscripts/conda-recipes/llvmlite + python-version: ${{ matrix.python-version }} + user: python-for-hpc + label: test + overwrite: true + token: ${{ secrets.ANACONDA_TOKEN }} + + # Job to deploy numba, matrixed on os and python version. + conda-deploy-numba: + needs: conda-deploy-llvmlite + name: numba ${{ matrix.os }} ${{ matrix.python-version }} + runs-on: ${{ matrix.os }} + strategy: + matrix: + #os: [ubuntu-latest, macOS-latest, windows-latest] + os: [ubuntu-latest, macOS-latest] + python-version: ["3.8", "3.9", "3.10"] + steps: + - uses: actions/checkout@v4 + - name: Set env for HEAD SHA + run: + echo "GITHUB_HEAD_SHA=${{ github.event.pull_request.head.sha }}" >> $GITHUB_ENV + - name: Create and activate conda env + uses: conda-incubator/setup-miniconda@v3 + with: + python-version: ${{ matrix.python-version }} + environment-file: .github/workflows/envs/env-test.yml + auto-update-conda: false + auto-activate-base: false + show-channel-urls: true + - name: Build and upload numba + uses: uibcdf/action-build-and-upload-conda-packages@v1.3.0 + with: + meta_yaml_dir: buildscripts/conda-recipes/numba + python-version: ${{ matrix.python-version }} + user: python-for-hpc + label: test + overwrite: true + token: ${{ secrets.ANACONDA_TOKEN }} + + # Job to deploy the pyomp metapackage, runs once as it is independent of the + # python version. + conda-deploy-pyomp: + needs: conda-deploy-numba + name: pyomp ${{ matrix.os }} + runs-on: ${{ matrix.os }} + strategy: + matrix: + #os: [ubuntu-latest, macOS-latest, windows-latest] + os: [ubuntu-latest, macOS-latest] + steps: + - uses: actions/checkout@v4 + - name: Set env for HEAD SHA + run: + echo "GITHUB_HEAD_SHA=${{ github.event.pull_request.head.sha }}" >> $GITHUB_ENV + - name: Create and activate conda env + uses: conda-incubator/setup-miniconda@v3 + with: + python-version: ${{ matrix.python-version }} + environment-file: .github/workflows/envs/env-test.yml + auto-update-conda: false + auto-activate-base: false + show-channel-urls: true + - name: Build and upload pyomp + uses: uibcdf/action-build-and-upload-conda-packages@v1.3.0 + with: + meta_yaml_dir: buildscripts/conda-recipes/pyomp + python-version: "3.10" + user: python-for-hpc + label: test + overwrite: true + token: ${{ secrets.ANACONDA_TOKEN }} diff --git a/.github/workflows/build-upload-conda.yaml b/.github/workflows/build-upload-conda.yaml deleted file mode 100644 index e70b0091bd1e..000000000000 --- a/.github/workflows/build-upload-conda.yaml +++ /dev/null @@ -1,96 +0,0 @@ - -name: Build and upload conda packages - -on: - #push: - # paths: - # - 'buildscripts/conda-recipes/**' - # - 'llvm-project' - # - 'llvmliteWithOpenmp' - # - 'NumbaWithOpenmp' - #pull_request: - # paths: - # - 'buildscripts/conda-recipes/**' - # - 'llvm-project' - # - 'llvmliteWithOpenmp' - # - 'NumbaWithOpenmp' - workflow_dispatch: # Un comment line if you also want to trigger action manually - -jobs: - # Job to create llvmdev, runs once, it is independent of the python version - # fixed at 3.10 for building. - conda_build_llvmdev: - name: Conda build llvmdev for platform ${{ matrix.os }} - runs-on: ${{ matrix.os }} - strategy: - matrix: - #os: [macOS-latest, ubuntu-latest, windows-latest] - os: [ubuntu-latest, macOS-latest] - steps: - - uses: actions/checkout@v4 - - name: Create and activate conda environment - uses: conda-incubator/setup-miniconda@v3 - with: - python-version: "3.10" - environment-file: .github/env.yaml - auto-update-conda: false - auto-activate-base: false - show-channel-urls: true - - name: Build and upload the llvmdev conda package - uses: uibcdf/action-build-and-upload-conda-packages@v1.3.0 - with: - meta_yaml_dir: buildscripts/conda-recipes/llvmdev - python-version: "3.10" - user: python-for-hpc - label: main - overwrite: true - token: ${{ secrets.ANACONDA_TOKEN }} - - # Job to create llvmlite, numba, pyomp packages. - conda_deployment_with_new_tag: - needs: conda_build_llvmdev - name: Conda deployment of package for platform ${{ matrix.os }} with Python ${{ matrix.python-version }} - runs-on: ${{ matrix.os }} - strategy: - matrix: - #os: [macOS-latest, ubuntu-latest, windows-latest] - os: [ubuntu-latest, macOS-latest] - python-version: ["3.8", "3.9", "3.10"] - steps: - - uses: actions/checkout@v4 - - name: Conda environment creation and activation - uses: conda-incubator/setup-miniconda@v3 - with: - python-version: ${{ matrix.python-version }} - environment-file: .github/env.yaml - auto-update-conda: false - auto-activate-base: false - show-channel-urls: true - - - name: Build and upload the llvmlite conda package - uses: uibcdf/action-build-and-upload-conda-packages@v1.3.0 - with: - meta_yaml_dir: buildscripts/conda-recipes/llvmlite - python-version: ${{ matrix.python-version }} - user: python-for-hpc - label: main - overwrite: true - token: ${{ secrets.ANACONDA_TOKEN }} - - name: Build and upload the numba conda package - uses: uibcdf/action-build-and-upload-conda-packages@v1.3.0 - with: - meta_yaml_dir: buildscripts/conda-recipes/numba - python-version: ${{ matrix.python-version }} - user: python-for-hpc - label: main - overwrite: true - token: ${{ secrets.ANACONDA_TOKEN }} - - name: Build and upload the pyomp conda metapackage - uses: uibcdf/action-build-and-upload-conda-packages@v1.3.0 - with: - meta_yaml_dir: buildscripts/conda-recipes/pyomp - python-version: ${{ matrix.python-version }} - user: python-for-hpc - label: main - overwrite: true - token: ${{ secrets.ANACONDA_TOKEN }} diff --git a/.github/workflows/build-upload-conda.yml b/.github/workflows/build-upload-conda.yml new file mode 100644 index 000000000000..c2b2912b9806 --- /dev/null +++ b/.github/workflows/build-upload-conda.yml @@ -0,0 +1,138 @@ +name: Deploy conda pkgs (main) + +on: + release: + types: [published] + workflow_dispatch: + +jobs: + # Job to deploy llvm-openmp-dev, runs once as it is independent of the python + # version. + conda-deploy-llvm-openmp-dev: + name: llvm-openmp-dev ${{ matrix.os }} + runs-on: ${{ matrix.os }} + strategy: + matrix: + #os: [ubuntu-latest, macOS-latest, windows-latest] + os: [ubuntu-latest, macOS-latest] + steps: + - uses: actions/checkout@v4 + - name: Set env for HEAD SHA + run: + echo "GITHUB_HEAD_SHA=${GITHUB_SHA}" >> $GITHUB_ENV + - name: Create and activate conda env + uses: conda-incubator/setup-miniconda@v3 + with: + python-version: "3.10" + environment-file: .github/workflows/envs/env.yml + auto-update-conda: false + auto-activate-base: false + show-channel-urls: true + - name: Build and upload llvm-openmp-dev + uses: uibcdf/action-build-and-upload-conda-packages@v1.3.0 + with: + meta_yaml_dir: buildscripts/conda-recipes/llvm-openmp-dev + python-version: "3.10" + user: python-for-hpc + label: main + overwrite: true + token: ${{ secrets.ANACONDA_TOKEN }} + + # Job to deploy llvmlite and numba, matrixed on os and python version. + conda-deploy-llvmlite: + needs: conda-deploy-llvm-openmp-dev + name: llvmlite ${{ matrix.os }} ${{ matrix.python-version }} + runs-on: ${{ matrix.os }} + strategy: + matrix: + #os: [ubuntu-latest, macOS-latest, windows-latest] + os: [ubuntu-latest, macOS-latest] + python-version: ["3.8", "3.9", "3.10"] + steps: + - uses: actions/checkout@v4 + - name: Set env for HEAD SHA + run: + echo "GITHUB_HEAD_SHA=${GITHUB_SHA}" >> $GITHUB_ENV + - name: Create and activate conda env + uses: conda-incubator/setup-miniconda@v3 + with: + python-version: ${{ matrix.python-version }} + environment-file: .github/workflows/envs/env.yml + auto-update-conda: false + auto-activate-base: false + show-channel-urls: true + - name: Build and upload llvmlite + uses: uibcdf/action-build-and-upload-conda-packages@v1.3.0 + with: + meta_yaml_dir: buildscripts/conda-recipes/llvmlite + python-version: ${{ matrix.python-version }} + user: python-for-hpc + label: main + overwrite: true + token: ${{ secrets.ANACONDA_TOKEN }} + + # Job to deploy numba, matrixed on os and python version. + conda-deploy-numba: + needs: conda-deploy-llvmlite + name: numba ${{ matrix.os }} ${{ matrix.python-version }} + runs-on: ${{ matrix.os }} + strategy: + matrix: + #os: [ubuntu-latest, macOS-latest, windows-latest] + os: [ubuntu-latest, macOS-latest] + python-version: ["3.8", "3.9", "3.10"] + steps: + - uses: actions/checkout@v4 + - name: Set env for HEAD SHA + run: + echo "GITHUB_HEAD_SHA=${GITHUB_SHA}" >> $GITHUB_ENV + - name: Create and activate conda env + uses: conda-incubator/setup-miniconda@v3 + with: + python-version: ${{ matrix.python-version }} + environment-file: .github/workflows/envs/env.yml + auto-update-conda: false + auto-activate-base: false + show-channel-urls: true + - name: Build and upload numba + uses: uibcdf/action-build-and-upload-conda-packages@v1.3.0 + with: + meta_yaml_dir: buildscripts/conda-recipes/numba + python-version: ${{ matrix.python-version }} + user: python-for-hpc + label: main + overwrite: true + token: ${{ secrets.ANACONDA_TOKEN }} + + # Job to deploy the pyomp metapackage, runs once as it is independent of the + # python version. + conda-deploy-pyomp: + needs: conda-deploy-numba + name: pyomp ${{ matrix.os }} + runs-on: ${{ matrix.os }} + strategy: + matrix: + #os: [ubuntu-latest, macOS-latest, windows-latest] + os: [ubuntu-latest, macOS-latest] + steps: + - uses: actions/checkout@v4 + - name: Set env for HEAD SHA + run: + echo "GITHUB_HEAD_SHA=${GITHUB_SHA}" >> $GITHUB_ENV + - name: Create and activate conda env + uses: conda-incubator/setup-miniconda@v3 + with: + python-version: ${{ matrix.python-version }} + environment-file: .github/workflows/envs/env.yml + auto-update-conda: false + auto-activate-base: false + show-channel-urls: true + - name: Build and upload pyomp + uses: uibcdf/action-build-and-upload-conda-packages@v1.3.0 + with: + meta_yaml_dir: buildscripts/conda-recipes/pyomp + python-version: "3.10" + user: python-for-hpc + label: main + overwrite: true + token: ${{ secrets.ANACONDA_TOKEN }} diff --git a/.github/workflows/envs/env-test.yml b/.github/workflows/envs/env-test.yml new file mode 100644 index 000000000000..3e774d7c9b53 --- /dev/null +++ b/.github/workflows/envs/env-test.yml @@ -0,0 +1,8 @@ +channels: + - python-for-hpc/label/test + - conda-forge + +dependencies: + - anaconda-client + - conda-build + - conda-verify diff --git a/.github/env.yaml b/.github/workflows/envs/env.yml similarity index 100% rename from .github/env.yaml rename to .github/workflows/envs/env.yml diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 000000000000..21ad3cd40779 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,98 @@ +############################################################################### +# Copyright (c) 2022-23, Lawrence Livermore National Security, LLC and RADIUSS +# project contributors. See the COPYRIGHT file for details. +# +# SPDX-License-Identifier: (MIT) +############################################################################### + +# DESCRIPTION: +############################################################################### +# General GitLab pipelines configurations for supercomputers and Linux clusters +# at Lawrence Livermore National Laboratory (LLNL). +# This entire pipeline is LLNL-specific +# +# Important note: This file is a template provided by llnl/radiuss-shared-ci. +# Remains to set variable values, change the reference to the radiuss-shared-ci +# repo, opt-in and out optional features. The project can then extend it with +# additional stages. +# +# In addition, each project should copy over and complete: +# - .gitlab/custom-jobs-and-variables.yml +# - .gitlab/subscribed-pipelines.yml +# +# The jobs should be specified in a file local to the project, +# - .gitlab/jobs/${CI_MACHINE}.yml +# or generated (see LLNL/Umpire for an example). +############################################################################### + +# We define the following GitLab pipeline variables: +variables: +##### LC GITLAB CONFIGURATION +# Use an LLNL service user to run CI. This prevents from running pipelines as +# an actual user. + LLNL_SERVICE_USER: "" +# Use the service user workspace. Solves permission issues, stores everything +# at the same location whoever triggers a pipeline. + CUSTOM_CI_BUILDS_DIR: "/usr/workspace/ggeorgak/projects/pyomp/gitlab-runner" +# Tells Gitlab to recursively update the submodules when cloning the project. +# GIT_SUBMODULE_STRATEGY: recursive + +##### PROJECT VARIABLES +# We build the projects in the CI clone directory. +# Used in script/gitlab/build_and_test.sh script. +# TODO: add a clean-up mechanism. + BUILD_ROOT: ${CI_PROJECT_DIR} + +##### SHARED_CI CONFIGURATION +# Required information about GitHub repository + GITHUB_PROJECT_NAME: "PyOMP" + GITHUB_PROJECT_ORG: "Python-for-HPC" +# Set the build-and-test command. +# Nested variables are allowed and useful to customize the job command. We +# prevent variable expansion so that you can define them at job level. + JOB_CMD: + value: "buildscripts/gitlab/create-conda-pkgs.sh" + expand: false +# Override the pattern describing branches that will skip the "draft PR filter +# test". Add protected branches here. See default value in +# preliminary-ignore-draft-pr.yml. +# ALWAYS_RUN_PATTERN: "" + +# We organize the build-and-test stage with sub-pipelines. Each sub-pipeline +# corresponds to a test batch on a given machine. + +# High level stages +stages: + - prerequisites + - build-and-test + +# Template for jobs triggering a build-and-test sub-pipeline: +.build-and-test: + stage: build-and-test + trigger: + include: + - local: '.gitlab/custom-jobs-and-variables.yml' + - project: 'radiuss/radiuss-shared-ci' + ref: 'v2024.07.0' + file: 'pipelines/${CI_MACHINE}.yml' + # Add your jobs + # you can use a local file + - local: '.gitlab/jobs/${CI_MACHINE}.yml' + # or a file generated in the previous steps + # - artifact: '${CI_MACHINE}-jobs.yml' + # job: 'generate-job-file' + # (See Umpire CI setup for an example). + strategy: depend + forward: + pipeline_variables: true + +include: + # Sets ID tokens for every job using `default:` + - project: 'lc-templates/id_tokens' + file: 'id_tokens.yml' + # [Optional] checks preliminary to running the actual CI test + - project: 'radiuss/radiuss-shared-ci' + ref: 'v2024.07.0' + file: 'utilities/preliminary-ignore-draft-pr.yml' + # pipelines subscribed by the project + - local: '.gitlab/subscribed-pipelines.yml' diff --git a/.gitlab/custom-jobs-and-variables.yml b/.gitlab/custom-jobs-and-variables.yml new file mode 100644 index 000000000000..5af33aee0484 --- /dev/null +++ b/.gitlab/custom-jobs-and-variables.yml @@ -0,0 +1,62 @@ +############################################################################### +# Copyright (c) 2022-23, Lawrence Livermore National Security, LLC and RADIUSS +# project contributors. See the COPYRIGHT file for details. +# +# SPDX-License-Identifier: (MIT) +############################################################################### + +# We define the following GitLab pipeline variables: +variables: +# In some pipelines we create only one allocation shared among jobs in +# order to save time and resources. This allocation has to be uniquely +# named so that we are sure to retrieve it and avoid collisions. + ALLOC_NAME: ${CI_PROJECT_NAME}_ci_${CI_PIPELINE_ID} + +# Ruby +# Arguments for top level allocation + RUBY_SHARED_ALLOC: "--mpi=none --exclusive --reservation=ci --time=20 --nodes=1" +# Arguments for job level allocation + RUBY_JOB_ALLOC: "--mpi=none --reservation=ci --nodes=1" +# Add variables that should apply to all the jobs on a machine: +# RUBY_MY_VAR: "..." + +# Poodle +# Arguments for top level allocation + POODLE_SHARED_ALLOC: "--exclusive --partition=pdebug --time=10 --nodes=1" +# Arguments for job level allocation + POODLE_JOB_ALLOC: "--nodes=1" +# Add variables that should apply to all the jobs on a machine: +# POODLE_MY_VAR: "..." + +# Corona +# Arguments for top level allocation +# OPTIONAL: "-o per-resource.count=2" allows to get 2 jobs running on each node. + CORONA_SHARED_ALLOC: "--exclusive --time-limit=15m --nodes=1" +# Arguments for job level allocation + CORONA_JOB_ALLOC: "--nodes=1 --begin-time=+5s" +# Add variables that should apply to all the jobs on a machine: +# CORONA_MY_VAR: "..." + +# Tioga +# Arguments for top level allocation +# OPTIONAL: "-o per-resource.count=2" allows to get 2 jobs running on each node. + TIOGA_SHARED_ALLOC: "--queue=pci --exclusive --time-limit=15m --nodes=1" +# Arguments for job level allocation + TIOGA_JOB_ALLOC: "--nodes=1 --begin-time=+5s" +# Add variables that should apply to all the jobs on a machine: +# TIOGA_MY_VAR: "..." + +# Lassen uses a different job scheduler (spectrum lsf) that does not allow +# pre-allocation the same way slurm does. Arguments for job level allocation + LASSEN_JOB_ALLOC: "1 -W 30 -q pci" +# Add variables that should apply to all the jobs on a machine: +# LASSEN_MY_VAR: "..." + + +# Configuration shared by build and test jobs specific to this project. +# Not all configuration can be shared. Here projects can fine tune the +# CI behavior. +# See Umpire for an example (export junit test reports). +.custom_job: + variables: + JOB_TEMPLATE_CANNOT_BE_EMPTY: "True" diff --git a/.gitlab/jobs/lassen.yml b/.gitlab/jobs/lassen.yml new file mode 100644 index 000000000000..b394c9a55898 --- /dev/null +++ b/.gitlab/jobs/lassen.yml @@ -0,0 +1,86 @@ +############################################################################### +# Copyright (c) 2022-23, Lawrence Livermore National Security, LLC and RADIUSS +# project contributors. See the COPYRIGHT file for details. +# +# SPDX-License-Identifier: (MIT) +############################################################################### + +# We require project to define their job command using a variable (JOB_CMD). +# In customization/gitlab-ci.yml, we encourage to define this variable as +# non-expandable, so that project can use nested variables to configure the job +# command. The caveat is that the reproducer here cannot capture the +# definition of these variables in a generic fashion. By overriding the +# following section, projects can specify the variables to define in the +# reproducer to exactly reproduce the CI build. +.lassen_reproducer_vars: + script: + - echo -e "Running on Lassen\n" + +# With GitLab CI, included files cannot be empty. +# TODO: remove when you have at least on job defined. +variables: + INCLUDED_FILE_CANNOT_BE_EMPTY: "True" + +############### +# Explanations: +############### +# RADIUSS Shared CI provides a pipeline for each machine, where a template job +# is provided. Each of your jobs must extend this template to be added to the +# list of jobs running on the associated machine. +# +# The job template then expects you to define the "JOB_CMD" variable with the +# one line command used to trigger the build and test of your project. +# +# We suggest that you set your command in such a way that you can then +# customize it per job with variables. E.g.: +# "./path/to/my_ci_script ${A_VARIABLE}" + +## Adding jobs defined by the project. +## Note: placing the extends section first allows you to override part of the +## shared implementation if needed (and if you know what you are doing). +#: +# extends: .job_on_lassen +# variables: +# : "" + +.base-job: + extends: .job_on_lassen + before_script: + - source /usr/workspace/ggeorgak/lassen/miniconda3-env.sh + - conda config --set anaconda_upload yes + after_script: + - source /usr/workspace/ggeorgak/lassen/miniconda3-env.sh + - conda config --set anaconda_upload no + - rm -rf ${CI_BUILDS_DIR} ${CI_PROJECT_DIR} + +.python-variants: + parallel: + matrix: + - PYOMP_CI_PYTHON_VERSION: + - "3.8" + - "3.9" + - "3.10" + +build-llvm-openmp-dev-lassen: + extends: .base-job + variables: + PYOMP_CI_BUILD_PKG: "llvm-openmp-dev" + +build-llvmlite-lassen: + extends: [.base-job, .python-variants] + needs: ["build-llvm-openmp-dev-lassen"] + variables: + PYOMP_CI_BUILD_PKG: "llvmlite" + +build-numba-lassen: + extends: [.base-job, .python-variants] + needs: ["build-llvmlite-lassen"] + variables: + PYOMP_CI_BUILD_PKG: "numba" + +build-pyomp-lassen: + extends: .base-job + needs: ["build-numba-lassen"] + variables: + PYOMP_CI_BUILD_PKG: "pyomp" + diff --git a/.gitlab/jobs/ruby.yml b/.gitlab/jobs/ruby.yml new file mode 100644 index 000000000000..7fa254b8c9b9 --- /dev/null +++ b/.gitlab/jobs/ruby.yml @@ -0,0 +1,52 @@ +############################################################################### +# Copyright (c) 2022-23, Lawrence Livermore National Security, LLC and RADIUSS +# project contributors. See the COPYRIGHT file for details. +# +# SPDX-License-Identifier: (MIT) +############################################################################### + +# We require project to define their job command using a variable (JOB_CMD). +# In customization/gitlab-ci.yml, we encourage to define this variable as +# non-expandable, so that project can use nested variables to configure the job +# command. The caveat is that the reproducer here cannot capture the +# definition of these variables in a generic fashion. By overriding the +# following section, projects can specify the variables to define in the +# reproducer to exactly reproduce the CI build. +.ruby_reproducer_vars: + script: + - export WITH_CUDA="Off" + +# With GitLab CI, included files cannot be empty. +# TODO: remove when you have at least on job defined. +variables: + INCLUDED_FILE_CANNOT_BE_EMPTY: "True" + +############### +# Explanations: +############### +# RADIUSS Shared CI provides a pipeline for each machine, where a template job +# is provided. Each of your jobs must extend this template to be added to the +# list of jobs running on the associated machine. +# +# The job template then expects you to define the "JOB_CMD" variable with the +# one line command used to trigger the build and test of your project. +# +# We suggest that you set your command in such a way that you can then +# customize it per job with variables. E.g.: +# "./path/to/my_ci_script ${A_VARIABLE}" + +## Adding jobs defined by the project. +## Note: placing the extends section first allows you to override part of the +## shared implementation if needed (and if you know what you are doing). +#: +# extends: .job_on_ruby +# variables: +# : "" + +build-run-ruby: + extends: .job_on_ruby + after_script: + - rm -rf ${CI_BUILDS_DIR} + - rm -rf ${CI_PROJET_DIR} + variables: + diff --git a/.gitlab/subscribed-pipelines.yml b/.gitlab/subscribed-pipelines.yml new file mode 100644 index 000000000000..265a344ba850 --- /dev/null +++ b/.gitlab/subscribed-pipelines.yml @@ -0,0 +1,91 @@ +############################################################################### +# Copyright (c) 2022-23, Lawrence Livermore National Security, LLC and RADIUSS +# project contributors. See the COPYRIGHT file for details. +# +# SPDX-License-Identifier: (MIT) +############################################################################### + +# The template job to test whether a machine is up. +# Expects CI_MACHINE defined to machine name. +.machine-check: + stage: prerequisites + tags: [shell, oslic] + variables: + GIT_STRATEGY: none + script: + - | + if [[ $(jq '.[env.CI_MACHINE].total_nodes_up' /usr/global/tools/lorenz/data/loginnodeStatus) == 0 ]] + then + echo -e "\e[31mNo node available on ${CI_MACHINE}\e[0m" + curl --url "https://api.github.com/repos/${GITHUB_PROJECT_ORG}/${GITHUB_PROJECT_NAME}/statuses/${CI_COMMIT_SHA}" \ + --header 'Content-Type: application/json' \ + --header "authorization: Bearer ${GITHUB_TOKEN}" \ + --data "{ \"state\": \"failure\", \"target_url\": \"${CI_PIPELINE_URL}\", \"description\": \"GitLab ${CI_MACHINE} down\", \"context\": \"ci/gitlab/${CI_MACHINE}\" }" + exit 1 + fi + +### +# Trigger a build-and-test pipeline for a machine. +# Comment the jobs for machines you don’t need. +### + +# RUBY +#ruby-up-check: +# variables: +# CI_MACHINE: "ruby" +# extends: [.machine-check] +# +#ruby-build-and-test: +# variables: +# CI_MACHINE: "ruby" +# needs: [ruby-up-check] +# extends: [.build-and-test] + +## POODLE +#poodle-up-check: +# variables: +# CI_MACHINE: "poodle" +# extends: [.machine-check] +# +#poodle-build-and-test: +# variables: +# CI_MACHINE: "poodle" +# needs: [poodle-up-check] +# extends: [.build-and-test] +# +## CORONA +#corona-up-check: +# variables: +# CI_MACHINE: "corona" +# extends: [.machine-check] +# +#corona-build-and-test: +# variables: +# CI_MACHINE: "corona" +# needs: [corona-up-check] +# extends: [.build-and-test] +# +## TIOGA +#tioga-up-check: +# variables: +# CI_MACHINE: "tioga" +# extends: [.machine-check] +# +#tioga-build-and-test: +# variables: +# CI_MACHINE: "tioga" +# needs: [tioga-up-check] +# extends: [.build-and-test] + +# LASSEN +lassen-up-check: + variables: + CI_MACHINE: "lassen" + extends: [.machine-check] + +lassen-build-and-test: + variables: + CI_MACHINE: "lassen" + needs: [lassen-up-check] + extends: [.build-and-test] + diff --git a/.gitmodules b/.gitmodules index 305179a79584..e69de29bb2d1 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,9 +0,0 @@ -[submodule "llvm-project"] - path = llvm-project - url = https://github.com/Python-for-HPC/llvm-project.git -[submodule "llvmliteWithOpenmp"] - path = llvmliteWithOpenmp - url = https://github.com/Python-for-HPC/llvmliteWithOpenmp.git -[submodule "NumbaWithOpenmp"] - path = NumbaWithOpenmp - url = https://github.com/Python-for-HPC/NumbaWithOpenmp.git diff --git a/NumbaWithOpenmp b/NumbaWithOpenmp deleted file mode 160000 index 1051f779bb21..000000000000 --- a/NumbaWithOpenmp +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 1051f779bb21695cf5ed1f3b538d55443b40577f diff --git a/README.md b/README.md index 2b7ba45ad877..5c468b470c71 100644 --- a/README.md +++ b/README.md @@ -10,27 +10,13 @@ In the future, we plan on converting PyOMP to a Numba extension which should eli ## Installation ### Conda -The easiest and recommended way to install PyOMP is through conda, currently -supporting linux-ppc6le, linux-64 (x86_64), and osx-arm64 (mac) architectures +PyOMP is distributed as a package through Conda, currently supporting linux-64 +(x86_64), osx-arm64 (mac), and linux-ppc64learchitectures. ``` conda install -c python-for-hpc -c conda-forge --override-channels pyomp ``` -### Building from source - -Building from source is possible but not recommended -``` -git clone --recursive https://github.com/Python-for-HPC/PyOMP.git -cd PyOMP/buildscripts/local/ -./build-all.sh -``` - -After building, it is necessary to source the built environment before using PyOMP -``` -. setup-env.sh -``` - ## Trying it out ### Binder diff --git a/buildscripts/conda-recipes/llvm-openmp-dev/bld.bat b/buildscripts/conda-recipes/llvm-openmp-dev/bld.bat new file mode 100644 index 000000000000..464090415c47 --- /dev/null +++ b/buildscripts/conda-recipes/llvm-openmp-dev/bld.bat @@ -0,0 +1 @@ +# TODO diff --git a/buildscripts/conda-recipes/llvm-openmp-dev/build.sh b/buildscripts/conda-recipes/llvm-openmp-dev/build.sh new file mode 100644 index 000000000000..b1744315fd35 --- /dev/null +++ b/buildscripts/conda-recipes/llvm-openmp-dev/build.sh @@ -0,0 +1,30 @@ +#!/bin/bash + +rm -rf build + +PACKAGE_VERSION=$(${CONDA_PREFIX}/bin/llvm-config --version) +if [[ "${target_platform}" == osx-* ]]; then + # See https://github.com/AnacondaRecipes/aggregate/issues/107 + export CPPFLAGS="-mmacosx-version-min=${MACOSX_DEPLOYMENT_TARGET} -isystem ${CONDA_PREFIX}/include -D_FORTIFY_SOURCE=2" +elif [[ "${target_platform}" == linux-* ]]; then + DIR1=${CONDA_PREFIX}/lib/gcc/${CONDA_TOOLCHAIN_HOST}/*/include/c++ + DIR2=${CONDA_PREFIX}/lib/gcc/${CONDA_TOOLCHAIN_HOST}/*/include/c++/${CONDA_TOOLCHAIN_HOST} + CONDA_TOOLCHAIN_CXX_INCLUDES="-cxx-isystem ${DIR1} -cxx-isystem ${DIR2}" +fi + +cmake -G'Unix Makefiles' \ + -B build \ + -S openmp-14.0.6.src \ + -DCMAKE_C_COMPILER=${CONDA_PREFIX}/bin/clang \ + -DCMAKE_CXX_COMPILER=${CONDA_PREFIX}/bin/clang++ \ + -DCMAKE_CXX_FLAGS="${CONDA_TOOLCHAIN_CXX_INCLUDES}" \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_INSTALL_PREFIX=${PREFIX} \ + -DPACKAGE_VERSION="${PACKAGE_VERSION}" \ + -DENABLE_CHECK_TARGETS=OFF + +pushd build +make -j${CPU_COUNT} VERBOSE=1 +make -j${CPU_COUNT} install || exit $? +popd + diff --git a/buildscripts/conda-recipes/llvmdev/conda_build_config.yaml b/buildscripts/conda-recipes/llvm-openmp-dev/conda_build_config.yaml similarity index 100% rename from buildscripts/conda-recipes/llvmdev/conda_build_config.yaml rename to buildscripts/conda-recipes/llvm-openmp-dev/conda_build_config.yaml diff --git a/buildscripts/conda-recipes/llvm-openmp-dev/meta.yaml b/buildscripts/conda-recipes/llvm-openmp-dev/meta.yaml new file mode 100644 index 000000000000..1226942f1374 --- /dev/null +++ b/buildscripts/conda-recipes/llvm-openmp-dev/meta.yaml @@ -0,0 +1,80 @@ +package: + name: llvm-openmp-dev + version: 14.0.6 + +source: + url: https://github.com/llvm/llvm-project/releases/download/llvmorg-14.0.6/openmp-14.0.6.src.tar.xz + sha256: 4f731ff202add030d9d68d4c6daabd91d3aeed9812e6a5b4968815cfdff0eb1f + +build: + merge_build_host: False + string: h{{ PKG_HASH }}_{{ (GITHUB_HEAD_SHA | default(''))[:7] ~ (CI_COMMIT_SHA | default(''))[:7] }} + script_env: + - PY_VCRUNTIME_REDIST + - GITHUB_HEAD_SHA + - CI_COMMIT_SHA + +requirements: + build: + - {{ compiler('c') }} + - {{ compiler('cxx') }} + - cmake + - make + - clangdev 14.0.6 + - elfutils # [linux] + - libffi + host: + - elfutils # [linux] + - libffi + - zlib + run: + - llvmdev 14.0.6.* + +test: + commands: + - test -f $PREFIX/lib/libomp.dylib # [osx] + - test -f $PREFIX/lib/libomp.so # [linux] + - test -f $PREFIX/lib/libompd.so # [linux] + - test -f $PREFIX/lib/libomptarget-new-amdgpu-gfx1010.bc # [linux] + - test -f $PREFIX/lib/libomptarget-new-amdgpu-gfx1030.bc # [linux] + - test -f $PREFIX/lib/libomptarget-new-amdgpu-gfx1031.bc # [linux] + - test -f $PREFIX/lib/libomptarget-new-amdgpu-gfx700.bc # [linux] + - test -f $PREFIX/lib/libomptarget-new-amdgpu-gfx701.bc # [linux] + - test -f $PREFIX/lib/libomptarget-new-amdgpu-gfx801.bc # [linux] + - test -f $PREFIX/lib/libomptarget-new-amdgpu-gfx803.bc # [linux] + - test -f $PREFIX/lib/libomptarget-new-amdgpu-gfx900.bc # [linux] + - test -f $PREFIX/lib/libomptarget-new-amdgpu-gfx902.bc # [linux] + - test -f $PREFIX/lib/libomptarget-new-amdgpu-gfx906.bc # [linux] + - test -f $PREFIX/lib/libomptarget-new-amdgpu-gfx908.bc # [linux] + - test -f $PREFIX/lib/libomptarget-new-amdgpu-gfx90a.bc # [linux] + - test -f $PREFIX/lib/libomptarget-new-nvptx-sm_35.bc # [linux] + - test -f $PREFIX/lib/libomptarget-new-nvptx-sm_37.bc # [linux] + - test -f $PREFIX/lib/libomptarget-new-nvptx-sm_50.bc # [linux] + - test -f $PREFIX/lib/libomptarget-new-nvptx-sm_52.bc # [linux] + - test -f $PREFIX/lib/libomptarget-new-nvptx-sm_53.bc # [linux] + - test -f $PREFIX/lib/libomptarget-new-nvptx-sm_60.bc # [linux] + - test -f $PREFIX/lib/libomptarget-new-nvptx-sm_61.bc # [linux] + - test -f $PREFIX/lib/libomptarget-new-nvptx-sm_62.bc # [linux] + - test -f $PREFIX/lib/libomptarget-new-nvptx-sm_70.bc # [linux] + - test -f $PREFIX/lib/libomptarget-new-nvptx-sm_72.bc # [linux] + - test -f $PREFIX/lib/libomptarget-new-nvptx-sm_75.bc # [linux] + - test -f $PREFIX/lib/libomptarget-new-nvptx-sm_80.bc # [linux] + - test -f $PREFIX/lib/libomptarget-new-nvptx-sm_86.bc # [linux] + - test -f $PREFIX/lib/libomptarget.rtl.amdgpu.so # [linux] + - test -f $PREFIX/lib/libomptarget.rtl.cuda.so # [linux] + - test -f $PREFIX/lib/libomptarget.rtl.ppc64.so # [linux and ppc64le] + - test -f $PREFIX/lib/libomptarget.rtl.x86_64.so # [linux and x86_64] + - test -f $PREFIX/lib/libomptarget.so # [linux] + + +about: + home: http://llvm.org/ + dev_url: https://github.com/llvm/llvm-project + license: Apache-2.0 WITH LLVM-exception + license_file: openmp-14.0.6.src/LICENSE.TXT + license_family: Apache + summary: Development headers and libraries for LLVM OpenMP + +extra: + recipe-maintainers: + - Giorgis Georgakoudis (@ggeorgakoudis) diff --git a/buildscripts/conda-recipes/llvmdev/bld.bat b/buildscripts/conda-recipes/llvmdev/bld.bat deleted file mode 100644 index 8153267b2068..000000000000 --- a/buildscripts/conda-recipes/llvmdev/bld.bat +++ /dev/null @@ -1,100 +0,0 @@ -setlocal EnableDelayedExpansion - -cd llvm - -REM FOR /D %%d IN (llvm-*.src) DO (MKLINK /J llvm %%d -REM if !errorlevel! neq 0 exit /b %errorlevel%) -REM FOR /D %%d IN (lld-*.src) DO (MKLINK /J lld %%d -REM if !errorlevel! neq 0 exit /b %errorlevel%) -REM FOR /D %%d IN (unwind\libunwind-*.src) DO (MKLINK /J libunwind %%d -REM if !errorlevel! neq 0 exit /b %errorlevel%) - -DIR - -mkdir build -cd build - -set BUILD_CONFIG=Release - -REM === Configure step === - -REM allow setting the targets to build as an environment variable -REM default is LLVM 11 default architectures + RISCV. Can remove this entire option in LLVM 13 -if "%LLVM_TARGETS_TO_BUILD%"=="" ( - set "LLVM_TARGETS_TO_BUILD=host;AMDGPU;NVPTX" -REM set "LLVM_TARGETS_TO_BUILD=host;AArch64;AMDGPU;ARM;BPF;Hexagon;Mips;MSP430;NVPTX;PowerPC;Sparc;SystemZ;X86;XCore;RISCV" -) -if "%ARCH%"=="32" ( - set "ARCH_POSTFIX=" - set "GEN_ARCH=Win32" -) else ( - set "ARCH_POSTFIX= Win64" - set "GEN_ARCH=x64" -) - -REM The platform toolset host arch is set to x64 so as to use the 64bit linker, -REM the 32bit linker heap is too small for llvm8 so it tries and falls over to -REM the 64bit linker anyway. This must be passed in to certain generators as -REM '-Thost x64'. -set PreferredToolArchitecture=x64 - -set MAX_INDEX_CMAKE_GENERATOR=0 - -set "CMAKE_GENERATOR[0]=Visual Studio 16 2019" - -set "CMAKE_GENERATOR_ARCHITECTURE[0]=%GEN_ARCH%" - -set "CMAKE_GENERATOR_TOOLSET[0]=v142" - -REM Reduce build times and package size by removing unused stuff -REM BENCHMARKS (new for llvm8) don't build under Visual Studio 14 2015 -set CMAKE_CUSTOM=-DLLVM_TARGETS_TO_BUILD="%LLVM_TARGETS_TO_BUILD%" ^ - -DLLVM_ENABLE_PROJECTS:STRING=clang;lld;libunwind ^ - -DLLVM_ENABLE_ZLIB=OFF ^ - -DLLVM_INCLUDE_UTILS=ON ^ - -DLLVM_INCLUDE_DOCS=OFF ^ - -DLLVM_INCLUDE_EXAMPLES=OFF ^ - -DLLVM_ENABLE_ASSERTIONS=ON ^ - -DLLVM_USE_INTEL_JITEVENTS=ON ^ - -DLLVM_INCLUDE_BENCHMARKS=OFF ^ - -DLLVM_ENABLE_DIA_SDK=OFF ^ - -DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD=WebAssembly ^ - -DOPENMP_ENABLE_LIBOMPTARGET_PROFILING=OFF - -REM try all compatible visual studio toolsets to find one that is installed -setlocal enabledelayedexpansion -for /l %%n in (0,1,%MAX_INDEX_CMAKE_GENERATOR%) do ( - cmake -G "!CMAKE_GENERATOR[%%n]!" ^ - -A "!CMAKE_GENERATOR_ARCHITECTURE[%%n]!" ^ - -T "!CMAKE_GENERATOR_TOOLSET[%%n]!" ^ - -DCMAKE_BUILD_TYPE="%BUILD_CONFIG%" ^ - -DCMAKE_PREFIX_PATH="%LIBRARY_PREFIX%" ^ - -DCMAKE_INSTALL_PREFIX:PATH="%LIBRARY_PREFIX%" ^ - %CMAKE_CUSTOM% "%SRC_DIR%\llvm" - if not errorlevel 1 goto configuration_successful - del CMakeCache.txt -) - -REM no compatible visual studio toolset was found -if errorlevel 1 exit 1 - -:configuration_successful -endlocal - -REM === Build step === -cmake --build . --config "%BUILD_CONFIG%" -if errorlevel 1 exit 1 - -REM === Install step === -cmake --build . --config "%BUILD_CONFIG%" --target install -if errorlevel 1 exit 1 - -REM From: https://github.com/conda-forge/llvmdev-feedstock/pull/53 -"%BUILD_CONFIG%\bin\opt" -S -vector-library=SVML -mcpu=haswell -O3 "%RECIPE_DIR%\numba-3016.ll" | "%BUILD_CONFIG%\bin\FileCheck" "%RECIPE_DIR%\numba-3016.ll" -if errorlevel 1 exit 1 - -REM This is technically how to run the suite, but it will only run in an -REM enhanced unix-like shell which has functions like `grep` available. -REM cd ..\test -REM "%PYTHON%" "..\build\%BUILD_CONFIG%\bin\llvm-lit.py" -vv Transforms ExecutionEngine Analysis CodeGen/X86 -REM if errorlevel 1 exit 1 diff --git a/buildscripts/conda-recipes/llvmdev/build.sh b/buildscripts/conda-recipes/llvmdev/build.sh deleted file mode 100644 index 23d9ca528dc3..000000000000 --- a/buildscripts/conda-recipes/llvmdev/build.sh +++ /dev/null @@ -1,128 +0,0 @@ -#!/bin/bash - -# based on https://github.com/AnacondaRecipes/llvmdev-feedstock/blob/master/recipe/build.sh - -set -x - -# allow setting the targets to build as an environment variable -# default is LLVM 11 default architectures + RISCV. Can remove this entire option in LLVM 13 -LLVM_TARGETS_TO_BUILD=${LLVM_TARGETS_TO_BUILD:-"host;AMDGPU;NVPTX"} - -declare -a _cmake_config -_cmake_config+=(-DCMAKE_INSTALL_PREFIX:PATH=${PREFIX}) -_cmake_config+=(-DCMAKE_BUILD_TYPE:STRING=Release) -_cmake_config+=(-DLLVM_ENABLE_PROJECTS:STRING="clang") -#_cmake_config+=(-DLLVM_ENABLE_RUNTIMES:STRING="openmp") -# The bootstrap clang I use was built with a static libLLVMObject.a and I trying to get the same here -# _cmake_config+=(-DBUILD_SHARED_LIBS:BOOL=ON) -_cmake_config+=(-DLLVM_ENABLE_ASSERTIONS:BOOL=ON) -#_cmake_config+=(-DLINK_POLLY_INTO_TOOLS:BOOL=ON) -# Don't really require libxml2. Turn it off explicitly to avoid accidentally linking to system libs -_cmake_config+=(-DLLVM_ENABLE_LIBXML2:BOOL=OFF) -# Urgh, llvm *really* wants to link to ncurses / terminfo and we *really* do not want it to. -_cmake_config+=(-DHAVE_TERMINFO_CURSES=OFF) -_cmake_config+=(-DLLVM_ENABLE_TERMINFO=OFF) -# Sometimes these are reported as unused. Whatever. -_cmake_config+=(-DHAVE_TERMINFO_NCURSES=OFF) -_cmake_config+=(-DHAVE_TERMINFO_NCURSESW=OFF) -_cmake_config+=(-DHAVE_TERMINFO_TERMINFO=OFF) -_cmake_config+=(-DHAVE_TERMINFO_TINFO=OFF) -_cmake_config+=(-DHAVE_TERMIOS_H=OFF) -_cmake_config+=(-DCLANG_ENABLE_LIBXML=OFF) -_cmake_config+=(-DLIBOMP_INSTALL_ALIASES=OFF) -_cmake_config+=(-DLLVM_ENABLE_RTTI=OFF) -_cmake_config+=(-DLLVM_TARGETS_TO_BUILD=${LLVM_TARGETS_TO_BUILD}) -#_cmake_config+=(-DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD=WebAssembly) -_cmake_config+=(-DLLVM_INCLUDE_UTILS=ON) # for llvm-lit -_cmake_config+=(-DLLVM_INCLUDE_TESTS=OFF) -_cmake_config+=(-DLLVM_INCLUDE_BENCHMARKS:BOOL=OFF) # doesn't build without the rest of LLVM project -#_cmake_config+=(-DLLVM_HOST_TRIPLE:STRING=${HOST}) -#_cmake_config+=(-DLLVM_DEFAULT_TARGET_TRIPLE:STRING=${HOST}) -_cmake_config+=(-DCLANG_INCLUDE_TESTS=OFF) -_cmake_config+=(-DCLANG_INCLUDE_DOCS=OFF) -_cmake_config+=(-DLLVM_INCLUDE_EXAMPLES=OFF) -# do not build/install unused tools to save time and store. -_cmake_config+=(-DLLVM_TOOL_LLVM_LTO_BUILD=OFF) -_cmake_config+=(-DLLVM_TOOL_LLVM_LTO2_BUILD=OFF) -_cmake_config+=(-DLLVM_TOOL_BUGPOINT_BUILD=OFF) -_cmake_config+=(-DLLVM_TOOL_BUGPOINT_PASSES_BUILD=OFF) -_cmake_config+=(-DLLVM_TOOL_SANCOV_BUILD=OFF) -_cmake_config+=(-DLLVM_TOOL_LLVM_EXEGESIS_BUILD=OFF) -_cmake_config+=(-DLLVM_TOOL_LLVM_REDUCE_BUILD=OFF) -_cmake_config+=(-DLLVM_TOOL_LLVM_DWP_BUILD=OFF) -_cmake_config+=(-DCLANG_TOOL_CLANG_REPL_BUILD=OFF) -_cmake_config+=(-DCLANG_TOOL_CLANG_SCAN_DEPS_BUILD=OFF) -_cmake_config+=(-DCLANG_TOOL_CLANG_CHECK_BUILD=OFF) -_cmake_config+=(-DCLANG_TOOL_CLANG_RENAME_BUILD=OFF) -_cmake_config+=(-DCLANG_TOOL_CLANG_REFACTOR_BUILD=OFF) -_cmake_config+=(-DCLANG_TOOL_CLANG_EXTDEF_MAPPING_BUILD=OFF) - -if [[ $(uname) == Linux ]]; then - #_cmake_config+=(-DLLVM_USE_INTEL_JITEVENTS=ON) - _cmake_config+=(-DLLVM_USE_LINKER=gold) -fi - -if [[ "$target_platform" == "linux-ppc64le" ]]; then - # avoid problematic flags when compiling OpenMP with built clang - CFLAGS="$(echo ${CFLAGS} | sed 's/-mpower8-fusion//g')" - CXXFLAGS="$(echo ${CXXFLAGS} | sed 's/-mpower8-fusion//g')" -fi - -# For when the going gets tough: -#_cmake_config+=(-Wdev) -#_cmake_config+=(--debug-output) -#_cmake_config+=(--trace-expand) -#CPU_COUNT=1 - -mkdir -p build -cd build - -cmake -G'Unix Makefiles' \ - "${_cmake_config[@]}" \ - ../llvm - -ARCH=`uname -m` -if [ $ARCH == 'armv7l' ]; then # RPi need thread count throttling - make -j2 VERBOSE=1 -else - make -j${CPU_COUNT} VERBOSE=1 -fi - -#make check-llvm-unit || exit $? - -# From: https://github.com/conda-forge/llvmdev-feedstock/pull/53 -make install || exit $? - -# SVML tests on x86_64 arch only -#if [[ $ARCH == 'x86_64' ]]; then -# bin/opt -S -vector-library=SVML -mcpu=haswell -O3 $RECIPE_DIR/numba-3016.ll | bin/FileCheck $RECIPE_DIR/numba-3016.ll || exit $? -#fi - -cd .. -mkdir -p build-openmp -cd build-openmp - -PACKAGE_VERSION=$(${PREFIX}/bin/llvm-config --version) -if [[ "${target_platform}" == osx-* ]]; then - # See https://github.com/AnacondaRecipes/aggregate/issues/107 - export CPPFLAGS="-mmacosx-version-min=${MACOSX_DEPLOYMENT_TARGET} -isystem ${PREFIX}/include -D_FORTIFY_SOURCE=2" - if [[ $ARCH == "arm64" ]]; then - # Link with libclang_rt.builtins - export LDFLAGS="${BUILD_PREFIX}/lib/clang/${PACKAGE_VERSION}/lib/libclang_rt.builtins_arm64_osx.a" - fi -fi - -cmake -G'Unix Makefiles' \ - -DCMAKE_BUILD_TYPE=Release \ - -DCMAKE_C_COMPILER=${PREFIX}/bin/clang \ - -DCMAKE_CXX_COMPILER=${PREFIX}/bin/clang++ \ - -DCMAKE_INSTALL_PREFIX=${PREFIX} \ - -DPACKAGE_VERSION="${PACKAGE_VERSION}" \ - -DLLVM_DIR=${PREFIX}/lib/cmake/llvm \ - -DLLVM_ENABLE_RUNTIMES=openmp \ - -DLLVM_INCLUDE_TESTS=OFF \ - ../runtimes - -make -j${CPU_COUNT} VERBOSE=1 - -make install || exit $? diff --git a/buildscripts/conda-recipes/llvmdev/meta.yaml b/buildscripts/conda-recipes/llvmdev/meta.yaml deleted file mode 100644 index 69920f42e522..000000000000 --- a/buildscripts/conda-recipes/llvmdev/meta.yaml +++ /dev/null @@ -1,76 +0,0 @@ -{% set shortversion = "14.0.6_pyomp" %} -{% set version = "14.0.6_pyomp" %} -{% set build_number = "3" %} - -package: - name: llvmdev - version: {{ version }} - -source: - url: https://github.com/Python-for-HPC/llvm-project/archive/refs/tags/llvm-pyomp-c0c4ca6.tar.gz - sha256: 67351c785f5e7ac1e50c828174d1cfa9d78fc2c34dba6a6582ac422ac7224e33 - patches: - - patches/llvm14-clear-gotoffsetmap.patch - - patches/llvm14-remove-use-of-clonefile.patch - - patches/llvm14-svml.patch - - patches/0000-Find-conda-gcc-installation.patch - - patches/0001-Fix-sysroot-detection-for-linux.patch - - patches/0002-clang-add-conda-specific-env-var-CONDA_BUILD_SYSROOT.patch - - patches/0003-Fix-normalizeProgramName-s-handling-of-dots-outside-.patch - - patches/0004-Set-VERSION-in-osx-as-well.patch - - patches/0005-Fix-crosscompiling-LLVM-tools.patch - - patches/0006-Only-error-on-undefined-TARGET_OS_OSX.patch # [osx and x86_64] - -build: - number: {{ build_number }} - script_env: - - PY_VCRUNTIME_REDIST - ignore_run_exports: - # Is static-linked - - xar - -requirements: - build: - # We cannot do this on macOS or windows - # OSX already has llvm so has to be handled - # at build.sh time - # Windows needs to build using vs2015_runtime - # irrespective of python version - - {{ compiler('c') }} # [linux and not (armv6l or armv7l)] - - {{ compiler('cxx') }} # [linux and not (armv6l or armv7l)] - - {{ compiler('cxx') }} {{ version | replace('_pyomp', '') }} # [osx] - - cmake - - make # [unix and not (armv6l or armv7l or aarch64)] - # Needed to unpack the source tarball - - m2w64-xz # [win] - # Needed to build LLVM - - python >=3 - host: - # needed for llc at runtime - - zlib # [not win] - - elfutils # [linux] - - {{ compiler('cxx') }} # [linux and not (armv6l or armv7l)] - - xar # [osx and x86_64] - -test: - files: - - numba-3016.ll - commands: - - $PREFIX/bin/llvm-config --libs # [not win] - - $PREFIX/bin/llc -version # [not win] - - - if not exist %LIBRARY_INC%\\llvm\\Pass.h exit 1 # [win] - - if not exist %LIBRARY_LIB%\\LLVMSupport.lib exit 1 # [win] - - - test -f $PREFIX/include/llvm/Pass.h # [unix] - - test -f $PREFIX/lib/libLLVMSupport.a # [unix] - - - test -f $PREFIX/lib/libLLVMCore.a # [not win] - - -about: - home: http://llvm.org/ - dev_url: https://github.com/llvm-mirror/llvm - license: NCSA - license_file: llvm/LICENSE.TXT - summary: Development headers and libraries for LLVM diff --git a/buildscripts/conda-recipes/llvmdev/numba-3016.ll b/buildscripts/conda-recipes/llvmdev/numba-3016.ll deleted file mode 100644 index 1a9b3ecf8eec..000000000000 --- a/buildscripts/conda-recipes/llvmdev/numba-3016.ll +++ /dev/null @@ -1,80 +0,0 @@ -; Regression test for llvmdev-feedstock#52 and numba#3016 - -; Generated from C code: int a[1<<10],b[1<<10]; void foo() { int i=0; for(i=0; i<1<<10; i++) { b[i]=sin(a[i]); }} -; compiled: -fvectorize -fveclib=SVML -O -S -mavx -mllvm -disable-llvm-optzns -emit-llvm - -; RUN: opt -vector-library=SVML -mcpu=haswell -O3 -S < %s | FileCheck %s -; CHECK: call {{.*}}__svml_sin4_ha( -; CHECK-NOT: call {{.*}}__svml_sin4( -; CHECK-NOT: call {{.*}}__svml_sin8 - -source_filename = "svml-3016.c" -target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" -target triple = "x86_64-pc-linux-gnu" - -@a = common dso_local global [1024 x i32] zeroinitializer, align 16 -@b = common dso_local global [1024 x i32] zeroinitializer, align 16 - -; Function Attrs: nounwind uwtable -define dso_local void @foo() #0 { - %1 = alloca i32, align 4 - %2 = bitcast i32* %1 to i8* - call void @llvm.lifetime.start.p0i8(i64 4, i8* %2) #3 - store i32 0, i32* %1, align 4, !tbaa !2 - store i32 0, i32* %1, align 4, !tbaa !2 - br label %3 - -;