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

IMEX Build Steps #6

Open
AllanZyne opened this issue Apr 28, 2024 · 1 comment · May be fixed by #7
Open

IMEX Build Steps #6

AllanZyne opened this issue Apr 28, 2024 · 1 comment · May be fixed by #7

Comments

@AllanZyne
Copy link

AllanZyne commented Apr 28, 2024

In README, it says

Install MLIR/LLVM and Intel® Extension for MLIR (IMEX, see https://github.com/intel/mlir-extensions).

but I found we can't just follow its build steps, in cmake arguments, we need to add -DLLVM_ENABLE_RTTI=ON and the build target should be "all" (not "check-imex").

In summary, the build and install steps for IMEX is

export IMEXROOT=<your-IMEX-install-dir>

git clone https://github.com/intel/mlir-extensions.git
git clone https://github.com/llvm/llvm-project.git

cd llvm-project
git checkout `cat ../mlir-extensions/build_tools/llvm_version.txt`
git apply ../mlir-extensions/build_tools/patches/*

cmake -G Ninja -B build -S llvm \
   -DLLVM_ENABLE_PROJECTS=mlir \
   -DLLVM_BUILD_EXAMPLES=ON \
   -DLLVM_TARGETS_TO_BUILD="X86" \
   -DCMAKE_BUILD_TYPE=Release \
   -DLLVM_ENABLE_ASSERTIONS=ON \
   -DLLVM_EXTERNAL_PROJECTS="Imex" \
   -DLLVM_ENABLE_RTTI=ON \
   -DCMAKE_INSTALL_PREFIX=$IMEXROOT \
   -DLLVM_EXTERNAL_IMEX_SOURCE_DIR=../mlir-extensions

# For GPU support pass thes cmake variables to enable the required runtime libraries
#  -DIMEX_ENABLE_L0_RUNTIME=1
#  -DIMEX_ENABLE_SYCL_RUNTIME=1
# Additional if using a non system wide Level Zero Loader built from source
#  -DLEVEL_ZERO_DIR=/PATH_TO/level-zero-install

cmake --build build
cmake --install build
@AllanZyne
Copy link
Author

BTW, the branch "jit" is removed in repo, and is this file imex_version.txt still useful?

@AllanZyne AllanZyne linked a pull request Apr 30, 2024 that will close this issue
@AllanZyne AllanZyne changed the title Build steps IMEX Build Steps Apr 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant