Skip to content

Upgrade CppInterOp to support llvm 20 #491

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 25 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
391be18
Upgrade to support llvm 20
mcbarton Jan 29, 2025
9df8277
Update emscripten.yml
mcbarton Feb 2, 2025
9c64f35
Merge branch 'main' into Update-to-llvm-20
mcbarton Feb 2, 2025
889f996
Part of upgrade to llvm 20
mcbarton Feb 2, 2025
fce2b83
Merge branch 'main' into Update-to-llvm-20
mcbarton Feb 20, 2025
ba99ace
See if CUDA tests still broken llvm 20
mcbarton Feb 20, 2025
8c6e593
Revert "See if CUDA tests still broken llvm 20"
mcbarton Feb 21, 2025
8a4c0af
Merge branch 'main' into Update-to-llvm-20
mcbarton Feb 28, 2025
a38a66e
Merge branch 'main' into Update-to-llvm-20
mcbarton Mar 11, 2025
641da6a
Revert changes to CudaTests to show error message in ci run
mcbarton Mar 12, 2025
a3111e0
Merge branch 'main' into Update-to-llvm-20
mcbarton Apr 3, 2025
13c69a5
Add llvm 20 Emscripten jobs
mcbarton Apr 3, 2025
6e1a9ff
Remove Windows 19 job
mcbarton Apr 3, 2025
bb13b49
Merge branch 'main' into Update-to-llvm-20
mcbarton Apr 13, 2025
8bccb8d
Merge branch 'main' into Update-to-llvm-20
mcbarton Apr 17, 2025
37f4742
Update documentation
mcbarton Apr 18, 2025
780f02b
Update Windows-arm.yml to use llvm 20
mcbarton Apr 18, 2025
a2fecb9
Merge branch 'main' into Update-to-llvm-20
mcbarton Apr 25, 2025
4bf0c13
Add Windows Emscripten 20 cross compile llvm patch
mcbarton Apr 25, 2025
82744ee
Update Emscripten-build-instructions.rst
mcbarton Apr 25, 2025
2f98909
Update Emscripten-build-instructions.md
mcbarton Apr 25, 2025
271c0aa
Remove patch which is now in main llvm 20 Windows
mcbarton Apr 25, 2025
7e4e4e5
Enable Emscripten tests which pass for llvm 20
mcbarton Apr 25, 2025
cb6b552
Add patch needed to wasm-ld
mcbarton Apr 30, 2025
e8b557b
Fix Emscripten build instructions due to new patch
mcbarton Apr 30, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions .github/workflows/MacOS-arm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,13 @@ jobs:
fail-fast: false
matrix:
include:
- name: osx15-arm-clang-clang-repl-20
os: macos-15
compiler: clang
clang-runtime: '20'
cling: Off
llvm_enable_projects: "clang"
llvm_targets_to_build: "host"
- name: osx15-arm-clang-clang-repl-19
os: macos-15
compiler: clang
Expand Down Expand Up @@ -252,6 +259,12 @@ jobs:
fail-fast: false
matrix:
include:
- name: osx15-arm-clang-clang-repl-20
os: macos-15
compiler: clang
clang-runtime: '20'
cling: Off
cppyy: Off
- name: osx15-arm-clang-clang-repl-19-cppyy
os: macos-15
compiler: clang
Expand Down
13 changes: 13 additions & 0 deletions .github/workflows/MacOS.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,13 @@ jobs:
fail-fast: false
matrix:
include:
- name: osx13-x86-clang-clang-repl-20
os: macos-13
compiler: clang
clang-runtime: '20'
cling: Off
llvm_enable_projects: "clang"
llvm_targets_to_build: "host"
- name: osx13-x86-clang-clang-repl-19
os: macos-13
compiler: clang
Expand Down Expand Up @@ -236,6 +243,12 @@ jobs:
fail-fast: false
matrix:
include:
- name: osx13-x86-clang-clang-repl-20
os: macos-13
compiler: clang
clang-runtime: '20'
cling: Off
cppyy: Off
- name: osx13-x86-clang-clang-repl-19-cppyy
os: macos-13
compiler: clang
Expand Down
13 changes: 13 additions & 0 deletions .github/workflows/Ubuntu-arm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,13 @@ jobs:
fail-fast: false
matrix:
include:
- name: ubu24-arm-gcc12-clang-repl-20
os: ubuntu-24.04-arm
compiler: gcc-12
clang-runtime: '20'
cling: Off
llvm_enable_projects: "clang"
llvm_targets_to_build: "host;NVPTX"
- name: ubu24-arm-gcc12-clang-repl-19
os: ubuntu-24.04-arm
compiler: gcc-12
Expand Down Expand Up @@ -240,6 +247,12 @@ jobs:
fail-fast: false
matrix:
include:
- name: ubu24-arm-gcc12-clang-repl-20
os: ubuntu-24.04-arm
compiler: gcc-12
clang-runtime: '20'
cling: Off
cppyy: Off
- name: ubu24-arm-gcc12-clang-repl-19-cppyy
os: ubuntu-24.04-arm
compiler: gcc-12
Expand Down
13 changes: 13 additions & 0 deletions .github/workflows/Ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,13 @@ jobs:
fail-fast: false
matrix:
include:
- name: ubu24-x86-gcc12-clang-repl-20
os: ubuntu-24.04
compiler: gcc-12
clang-runtime: '20'
cling: Off
llvm_enable_projects: "clang"
llvm_targets_to_build: "host;NVPTX"
- name: ubu24-x86-gcc12-clang-repl-19
os: ubuntu-24.04
compiler: gcc-12
Expand Down Expand Up @@ -240,6 +247,12 @@ jobs:
fail-fast: false
matrix:
include:
- name: ubu24-x86-gcc12-clang-repl-20
os: ubuntu-24.04
compiler: gcc-12
clang-runtime: '20'
cling: Off
cppyy: Off
- name: ubu24-x86-gcc12-clang-repl-19-cppyy
os: ubuntu-24.04
compiler: gcc-12
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/Windows-arm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ jobs:
fail-fast: false
matrix:
include:
- name: win11-msvc-clang-repl-19
- name: win11-msvc-clang-repl-20
os: windows-11-arm
compiler: msvc
clang-runtime: '19'
clang-runtime: '20'
cling: Off
llvm_enable_projects: "clang"
llvm_targets_to_build: "host;NVPTX"
Expand Down Expand Up @@ -225,10 +225,10 @@ jobs:
fail-fast: false
matrix:
include:
- name: win11-msvc-clang-repl-19
- name: win11-msvc-clang-repl-20
os: windows-11-arm
compiler: msvc
clang-runtime: '19'
clang-runtime: '20'
cling: Off
cppyy: Off

Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/Windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ jobs:
fail-fast: false
matrix:
include:
- name: win2025-msvc-clang-repl-19
- name: win2025-msvc-clang-repl-20
os: windows-2025
compiler: msvc
clang-runtime: '19'
clang-runtime: '20'
cling: Off
llvm_enable_projects: "clang"
llvm_targets_to_build: "host;NVPTX"
Expand Down Expand Up @@ -225,10 +225,10 @@ jobs:
fail-fast: false
matrix:
include:
- name: win2025-msvc-clang-repl-19
- name: win2025-msvc-clang-repl-20
os: windows-2025
compiler: msvc
clang-runtime: '19'
clang-runtime: '20'
cling: Off
cppyy: Off

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/deploy-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ jobs:
fail-fast: false
matrix:
include:
- name: osx15-arm-clang-repl-19-emscripten_wasm
- name: osx15-arm-clang-repl-20-emscripten_wasm
os: macos-15
clang-runtime: '19'
clang-runtime: '20'
cling: Off
micromamba_shell_init: bash
emsdk_ver: "3.1.73"
Expand Down
60 changes: 59 additions & 1 deletion .github/workflows/emscripten.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,34 @@ jobs:
llvm_enable_projects: "clang;lld"
llvm_targets_to_build: "WebAssembly"
emsdk_ver: "3.1.73"
- name: ubu24-arm-clang-repl-20-emscripten
os: ubuntu-24.04-arm
clang-runtime: '20'
cling: Off
llvm_enable_projects: "clang;lld"
llvm_targets_to_build: "WebAssembly"
emsdk_ver: "3.1.73"
- name: osx15-arm-clang-repl-20-emscripten
os: macos-15
clang-runtime: '20'
cling: Off
llvm_enable_projects: "clang;lld"
llvm_targets_to_build: "WebAssembly"
emsdk_ver: "3.1.73"
- name: ubu24-x86-clang-repl-20-emscripten
os: ubuntu-24.04
clang-runtime: '20'
cling: Off
llvm_enable_projects: "clang;lld"
llvm_targets_to_build: "WebAssembly"
emsdk_ver: "3.1.73"
- name: win2025-x86-clang-repl-20-emscripten
os: windows-2025
clang-runtime: '20'
cling: Off
llvm_enable_projects: "clang;lld"
llvm_targets_to_build: "WebAssembly"
emsdk_ver: "3.1.73"

steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -220,7 +248,7 @@ jobs:
else
# Apply patches
llvm_vers=$(echo "${{ matrix.clang-runtime }}" | tr '[:lower:]' '[:upper:]')
if [[ "${llvm_vers}" == "19" ]]; then
if [[ "${llvm_vers}" == "19" || "${llvm_vers}" == "20" ]]; then
git apply -v ../patches/llvm/emscripten-clang${{ matrix.clang-runtime }}-*.patch
echo "Apply emscripten-clang${{ matrix.clang-runtime }}-*.patch patches:"
fi
Expand Down Expand Up @@ -329,6 +357,12 @@ jobs:
git apply -v emscripten-clang19-2-shift-temporary-files-to-tmp-dir.patch
git apply -v emscripten-clang19-3-remove-zdefs.patch
}
elseif ( "${{ matrix.clang-runtime }}" -imatch "20" )
{
git apply -v Windows-emscripten-clang20-1-CrossCompile.patch
git apply -v emscripten-clang20-2-shift-temporary-files-to-tmp-dir.patch
git apply -v emscripten-clang20-3-wasm-ld.patch
}
cd build
echo "Apply clang${{ matrix.clang-runtime }}-*.patch patches:"
emcmake cmake -DCMAKE_BUILD_TYPE=Release `
Expand Down Expand Up @@ -414,6 +448,30 @@ jobs:
cling: Off
micromamba_shell_init: powershell
emsdk_ver: "3.1.73"
- name: ubu24-x86-clang-repl-20-emscripten_wasm
os: ubuntu-24.04
clang-runtime: '20'
cling: Off
micromamba_shell_init: bash
emsdk_ver: "3.1.73"
- name: osx15-arm-clang-repl-20-emscripten_wasm
os: macos-15
clang-runtime: '20'
cling: Off
micromamba_shell_init: bash
emsdk_ver: "3.1.73"
- name: ubu24-arm-clang-repl-20-emscripten_wasm
os: ubuntu-24.04-arm
clang-runtime: '20'
cling: Off
micromamba_shell_init: bash
emsdk_ver: "3.1.73"
- name: win2025-x86-clang-repl-20-emscripten
os: windows-2025
clang-runtime: '20'
cling: Off
micromamba_shell_init: powershell
emsdk_ver: "3.1.73"

steps:
- uses: actions/checkout@v4
Expand Down
12 changes: 6 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -68,14 +68,14 @@ include(GNUInstallDirs)
## Define supported version of clang and llvm

set(CLANG_MIN_SUPPORTED 13.0)
set(CLANG_MAX_SUPPORTED "19.1.x")
set(CLANG_VERSION_UPPER_BOUND 20.0.0)
set(CLANG_MAX_SUPPORTED "20.1.x")
set(CLANG_VERSION_UPPER_BOUND 21.0.0)
set(LLD_MIN_SUPPORTED 13.0)
set(LLD_MAX_SUPPORTED "19.1.x")
set(LLD_VERSION_UPPER_BOUND 20.0.0)
set(LLD_MAX_SUPPORTED "20.1.x")
set(LLD_VERSION_UPPER_BOUND 21.0.0)
set(LLVM_MIN_SUPPORTED 13.0)
set(LLVM_MAX_SUPPORTED "19.1.x")
set(LLVM_VERSION_UPPER_BOUND 20.0.0)
set(LLVM_MAX_SUPPORTED "20.1.x")
set(LLVM_VERSION_UPPER_BOUND 21.0.0)

## Set Cmake packages search order

Expand Down
13 changes: 6 additions & 7 deletions Emscripten-build-instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,11 @@ $env:PWD_DIR= $PWD.Path
$env:SYSROOT_PATH="$env:EMSDK/upstream/emscripten/cache/sysroot"
```

Now clone the 19.x release of the LLVM project repository and CppInterOp (the building of the emscripten version of llvm can be
Now clone the 20.x release of the LLVM project repository and CppInterOp (the building of the emscripten version of llvm can be
avoided by executing micromamba install llvm -c <https://repo.mamba.pm/emscripten-forge> and setting the LLVM_BUILD_DIR/$env:LLVM_BUILD_DIR appropriately)


```bash
git clone --depth=1 --branch release/19.x https://github.com/llvm/llvm-project.git
git clone --depth=1 --branch release/20.x https://github.com/llvm/llvm-project.git
git clone --depth=1 https://github.com/compiler-research/CppInterOp.git
```

Expand All @@ -56,7 +55,7 @@ executing

```bash
cd ./llvm-project/
git apply -v ../CppInterOp/patches/llvm/emscripten-clang19-*.patch
git apply -v ../CppInterOp/patches/llvm/emscripten-clang20-*.patch
```

On Windows execute the following
Expand All @@ -65,9 +64,9 @@ On Windows execute the following
cd .\llvm-project\
cp -r ..\patches\llvm\emscripten-clang${{ matrix.clang-runtime }}*
cp -r ..\patches\llvm\Windows-emscripten-clang${{ matrix.clang-runtime }}*
git apply -v Windows-emscripten-clang19-1-CrossCompile.patch
git apply -v emscripten-clang19-2-shift-temporary-files-to-tmp-dir.patch
git apply -v emscripten-clang19-3-remove-zdefs.patch
git apply -v Windows-emscripten-clang20-1-CrossCompile.patch
git apply -v emscripten-clang20-2-shift-temporary-files-to-tmp-dir.patch
git apply -v emscripten-clang20-3-wasm-ld.patch
```

We are now in a position to build an emscripten build of llvm by executing the following on Linux
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,10 +115,10 @@ git clone --depth=1 https://github.com/compiler-research/cppyy-backend.git

#### Setup Clang-REPL

Clone the 19.x release of the LLVM project repository.
Clone the 20.x release of the LLVM project repository.

```bash
git clone --depth=1 --branch release/19.x https://github.com/llvm/llvm-project.git
git clone --depth=1 --branch release/20.x https://github.com/llvm/llvm-project.git
cd llvm-project
```

Expand Down
4 changes: 2 additions & 2 deletions docs/DevelopersDocumentation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,11 @@ library
Setup Clang-REPL
******************

Clone the 19.x release of the LLVM project repository.
Clone the 20.x release of the LLVM project repository.

.. code:: bash

git clone --depth=1 --branch release/19.x https://github.com/llvm/llvm-project.git
git clone --depth=1 --branch release/20.x https://github.com/llvm/llvm-project.git
cd llvm-project

For Clang 16 & 17, the following patches required for development work. To apply
Expand Down
12 changes: 6 additions & 6 deletions docs/Emscripten-build-instructions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -53,15 +53,15 @@ and on Windows execute in Powershell
$env:PWD_DIR= $PWD.Path
$env:SYSROOT_PATH="$env:EMSDK/upstream/emscripten/cache/sysroot"

Now clone the 19.x release of the LLVM project repository and CppInterOp
Now clone the 20.x release of the LLVM project repository and CppInterOp
(the building of the emscripten version of llvm can be avoided by
executing micromamba install llvm -c
<https://repo.mamba.pm/emscripten-forge> and setting the LLVM_BUILD_DIR/$env:LLVM_BUILD_DIR
appropriately)

.. code:: bash

git clone --depth=1 --branch release/19.x https://github.com/llvm/llvm-project.git
git clone --depth=1 --branch release/20.x https://github.com/llvm/llvm-project.git
git clone --depth=1 https://github.com/compiler-research/CppInterOp.git

Now move into the cloned llvm-project folder and apply the required patches. On Linux and osx this
Expand All @@ -70,7 +70,7 @@ executing
.. code:: bash

cd ./llvm-project/
git apply -v ../CppInterOp/patches/llvm/emscripten-clang19-*.patch
git apply -v ../CppInterOp/patches/llvm/emscripten-clang20-*.patch

On Windows execute the following

Expand All @@ -79,9 +79,9 @@ On Windows execute the following
cd .\llvm-project\
cp -r ..\patches\llvm\emscripten-clang${{ matrix.clang-runtime }}*
cp -r ..\patches\llvm\Windows-emscripten-clang${{ matrix.clang-runtime }}*
git apply -v Windows-emscripten-clang19-1-CrossCompile.patch
git apply -v emscripten-clang19-2-shift-temporary-files-to-tmp-dir.patch
git apply -v emscripten-clang19-3-remove-zdefs.patch
git apply -v Windows-emscripten-clang20-1-CrossCompile.patch
git apply -v emscripten-clang20-2-shift-temporary-files-to-tmp-dir.patch
git apply -v emscripten-clang20-3-wasm-ld.patch

We are now in a position to build an emscripten build of llvm by executing the following on Linux
and osx
Expand Down
4 changes: 2 additions & 2 deletions docs/InstallationAndUsage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,11 @@ library
Setup Clang-REPL
******************

Clone the 19.x release of the LLVM project repository.
Clone the 20.x release of the LLVM project repository.

.. code:: bash

git clone --depth=1 --branch release/19.x https://github.com/llvm/llvm-project.git
git clone --depth=1 --branch release/20.x https://github.com/llvm/llvm-project.git
cd llvm-project

For Clang 16 & 17, the following patches required for development work. To apply
Expand Down
Loading
Loading