Skip to content
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

Update llvmlite to be compatible with llvm-17 #1042

Closed
wants to merge 17 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
22 changes: 12 additions & 10 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,19 @@ jobs:
py39:
PYTHON: '3.9'
CONDA_ENV: cienv
LLVM: '17'
py310:
PYTHON: '3.10'
CONDA_ENV: cienv
LLVM: '17'
py311:
PYTHON: '3.11'
CONDA_ENV: cienv
LLVM: '17'
py312:
PYTHON: '3.12'
CONDA_ENV: cienv

llvm15:
PYTHON: '3.12'
CONDA_ENV: cienv
LLVM: '15'
LLVM: '17'

- template: buildscripts/azure/azure-linux-macos.yml
parameters:
Expand All @@ -32,20 +31,24 @@ jobs:
PYTHON: '3.9'
CONDA_ENV: cienv
RUN_FLAKE8: yes
LLVM: '17'
py310:
PYTHON: '3.10'
CONDA_ENV: cienv
RUN_FLAKE8: yes
LLVM: '17'
py311:
PYTHON: '3.11'
CONDA_ENV: cienv
RUN_FLAKE8: yes
RUN_CLANG_FORMAT: yes
LLVM: '17'
py312:
PYTHON: '3.12'
CONDA_ENV: cienv
RUN_FLAKE8: yes
RUN_CLANG_FORMAT: yes
LLVM: '17'
# temporarily disabled
# pypy:
# PYTHON: pypy
Expand All @@ -54,29 +57,28 @@ jobs:
PYTHON: '3.9'
CONDA_ENV: cienv
WHEEL: 'yes'
LLVM: '17'
py310_wheel:
PYTHON: '3.10'
CONDA_ENV: cienv
WHEEL: 'yes'
LLVM: '17'
py311_wheel:
PYTHON: '3.11'
CONDA_ENV: cienv
WHEEL: 'yes'
LLVM: '17'
py312_wheel:
PYTHON: '3.12'
CONDA_ENV: cienv
WHEEL: 'yes'
LLVM: '17'

py39_docs:
PYTHON: '3.9'
CONDA_ENV: cienv
BUILD_DOCS: 'yes'

llvm15:
PYTHON: '3.12'
CONDA_ENV: cienv
LLVM: '15'

- template: buildscripts/azure/azure-windows.yml
parameters:
name: Windows
Expand Down
9 changes: 4 additions & 5 deletions buildscripts/azure/azure-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,19 @@ jobs:
py39:
PYTHON: '3.9'
CONDA_ENV: cienv
LLVM: '17'
py310:
PYTHON: '3.10'
CONDA_ENV: cienv
LLVM: '17'
py311:
PYTHON: '3.11'
CONDA_ENV: cienv
LLVM: '17'
py312:
PYTHON: '3.12'
CONDA_ENV: cienv

llvm15:
PYTHON: '3.12'
CONDA_ENV: cienv
LLVM: '15'
LLVM: '17'

steps:

Expand Down
6 changes: 2 additions & 4 deletions buildscripts/incremental/build.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,7 @@ call activate %CONDA_ENV%
@rem - https://github.com/conda-forge/llvmdev-feedstock/issues/175
@rem - https://github.com/conda-forge/llvmdev-feedstock/pull/223
@rem - https://github.com/MicrosoftDocs/visualstudio-docs/issues/7774
if "%LLVM%"=="15" (
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\Tools\VsDevCmd.bat"
if %errorlevel% neq 0 exit /b %errorlevel%
)
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\Tools\VsDevCmd.bat"
if %errorlevel% neq 0 exit /b %errorlevel%

python setup.py build
6 changes: 1 addition & 5 deletions buildscripts/incremental/setup_conda_environment.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,7 @@ call activate %CONDA_ENV%
if %errorlevel% neq 0 exit /b %errorlevel%

@rem Install llvmdev
if "%LLVM%"=="15" (
set LLVMDEV_CHANNEL="conda-forge"
) else (
set LLVMDEV_CHANNEL="numba/label/dev"
)
set LLVMDEV_CHANNEL="conda-forge"

call conda install -y -q -c %LLVMDEV_CHANNEL% llvmdev="%LLVM%" libxml2
if %errorlevel% neq 0 exit /b %errorlevel%
6 changes: 1 addition & 5 deletions buildscripts/incremental/setup_conda_environment.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,7 @@ source activate $CONDA_ENV
set -v

# Install llvmdev (separate channel, for now)
if [ "$LLVM" == "15" ]; then
$CONDA_INSTALL -c conda-forge llvmdev="15"
else
$CONDA_INSTALL -c numba/label/dev llvmdev="14.*"
fi
$CONDA_INSTALL -c conda-forge llvmdev=17

# Install the compiler toolchain, for osx, bootstrapping needed
# which happens in build.sh
Expand Down
2 changes: 1 addition & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -302,5 +302,5 @@
# Example configuration for intersphinx: refer to the Python standard library.
intersphinx_mapping = {
'python': ('https://docs.python.org/3', None),
'llvm': ('http://llvm.org/releases/14.0.0/docs', None),
'llvm': ('http://llvm.org/releases/17.0.1/docs', None),
}
4 changes: 4 additions & 0 deletions ffi/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ project(llvmlite_ffi)

include(CheckIncludeFiles)

# LLVM-17 needs C++17 to compile successfully
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

if(NOT MSVC)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fno-rtti -g")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-rtti -g")
Expand Down
8 changes: 2 additions & 6 deletions ffi/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,13 +167,9 @@ def main_posix(kind, library_ext):
else:
(version, _) = out.split('.', 1)
version = int(version)
if version == 15:
msg = ("Building with LLVM 15; note that LLVM 15 support is "
"presently experimental")
show_warning(msg)
elif version != 14:
if version != 17:

msg = ("Building llvmlite requires LLVM 14, got "
msg = ("Building llvmlite requires LLVM 17, got "
"{!r}. Be sure to set LLVM_CONFIG to the right executable "
"path.\nRead the documentation at "
"http://llvmlite.pydata.org/ for more information about "
Expand Down
6 changes: 0 additions & 6 deletions ffi/core.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,12 @@ LLVMPY_DisposeString(const char *msg) { free(const_cast<char *>(msg)); }
API_EXPORT(LLVMContextRef)
LLVMPY_GetGlobalContext() {
auto context = LLVMGetGlobalContext();
#if LLVM_VERSION_MAJOR > 14
LLVMContextSetOpaquePointers(context, false);
#endif
return context;
}

API_EXPORT(LLVMContextRef)
LLVMPY_ContextCreate() {
LLVMContextRef context = LLVMContextCreate();
#if LLVM_VERSION_MAJOR > 14
LLVMContextSetOpaquePointers(context, false);
#endif
return context;
}

Expand Down
Loading
Loading