Skip to content

Update llvm version to fix build error if pre-built llvm is used #495

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

Merged
merged 1 commit into from
Oct 9, 2023
Merged
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
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
cmake_minimum_required(VERSION 3.13.4)

if(NOT DEFINED BASE_LLVM_VERSION)
set(BASE_LLVM_VERSION 16.0.0)
set(BASE_LLVM_VERSION 18)
endif(NOT DEFINED BASE_LLVM_VERSION)
set(OPENCL_CLANG_VERSION ${BASE_LLVM_VERSION}.0)

Expand Down Expand Up @@ -46,7 +46,7 @@ if(CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
add_definitions(-DUSE_PREBUILT_LLVM)

if(NOT PREFERRED_LLVM_VERSION)
set(PREFERRED_LLVM_VERSION "16.0.0")
set(PREFERRED_LLVM_VERSION "18")
endif(NOT PREFERRED_LLVM_VERSION)
message(STATUS "[OPENCL-CLANG] Looking for LLVM version ${PREFERRED_LLVM_VERSION}")
find_package(LLVM ${PREFERRED_LLVM_VERSION} REQUIRED)
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,13 +70,13 @@ make all -j`nproc`

##### Preferred LLVM version

By default, opencl-clang's cmake script is searching for LLVM 16.0.0. You can
override target version of LLVM by using the `PREFERRED_LLVM_VERSION` cmake
option:
By default, opencl-clang's cmake script is searching for LLVM which is built
based on the latest verion of current branch. You can override target version of
LLVM by using the `PREFERRED_LLVM_VERSION` cmake option:

Example:
```bash
cmake -DPREFERRED_LLVM_VERSION="10.0.0" ../opencl-clang
cmake -DPREFERRED_LLVM_VERSION="18" ../opencl-clang
```

##### Custom LLVM installation
Expand Down