Skip to content
This repository has been archived by the owner on Apr 6, 2022. It is now read-only.

How to build Neo components (system llvm clang 7)

Jacek Danecki edited this page Mar 11, 2019 · 4 revisions

Build instruction for llvm 7.0.1~svn348686-1~exp1~20181221231927.53 from: http://apt.llvm.org/xenial

Build gmmlib

export gmmlib_commit_id=413896e
wget --no-check-certificate https://github.com/intel/gmmlib/archive/${gmmlib_commit_id}/gmmlib.tar.gz

mkdir gmmlib
tar xzf gmmlib.tar.gz -C gmmlib --strip-components=1

mkdir build
cd build
cmake -DCMAKE_INSTALL_PREFIX=/usr -DBUILD_TYPE=Release -DCMAKE_BUILD_TYPE=Release ../gmmlib
make -j `nproc`
sudo make install
cd ..

Build IGC

export igc_commit_id=606f78808a0e88a47a1d3811db55ae44f8d28d9c
export cclang_commit_id=6257ffe
export spirv_id=8ce6443
wget --no-check-certificate https://github.com/intel/opencl-clang/archive/${cclang_commit_id}/opencl-clang.tar.gz
wget --no-check-certificate https://github.com/intel/intel-graphics-compiler/archive/${igc_commit_id}/igc.tar.gz
wget --no-check-certificate https://github.com/KhronosGroup/SPIRV-LLVM-Translator/archive/${spirv_id}/spirv-llvm-translator.tar.gz

mkdir igc common_clang llvm-spirv

tar xzf opencl-clang.tar.gz -C common_clang --strip-components=1
tar xzf igc.tar.gz -C igc --strip-components=1
tar xzf spirv-llvm-translator.tar.gz -C llvm-spirv --strip-components=1

mkdir build_spirv
cd build_spirv
cmake ../llvm-spirv -DCMAKE_INSTALL_PREFIX=install -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DCMAKE_BUILD_TYPE=Release
make llvm-spirv -j`nproc`
make install
cd ..

mkdir build_opencl_clang
cd build_opencl_clang
cmake -DCOMMON_CLANG_LIBRARY_NAME=opencl_clang -DLLVMSPIRV_INCLUDED_IN_LLVM=OFF -DSPIRV_TRANSLATOR_DIR=../build_spirv/install -DLLVM_NO_DEAD_STRIP=ON ../common_clang
make all -j`nproc`
cd ..

mkdir -p igc/Clang/Prebuilt/linux-ubuntu/Release/64
7za a igc/Clang/Prebuilt/linux-ubuntu/Release/64/clang.7z `pwd`/build_opencl_clang/libopencl_clang.so.7 `pwd`/build_opencl_clang/libopencl_clang.so `pwd`/build_opencl_clang/cl_headers/opencl-c.h /usr/lib/llvm-7/bin/clang

mkdir build
cd build
cmake ../igc -DCMAKE_BUILD_TYPE=Release -DIGC_OPTION__OUTPUT_DIR=../igc-install/Release -DVME_TYPES_DEFINED=FALSE
make -j`nproc`

cp ../igc/igc-install/Release/clang/linux-ubuntu64/libopencl_clang.so.7 ../igc/igc-install/Release/clang/linux-ubuntu64/libcommon_clang64.so
sudo make install
sudo ln -s /usr/local/lib/libcommon_clang64.so /usr/local/lib/libopencl_clang.so
sudo ldconfig
cd ..

Build Neo

export neo_commit_id=10083d5
wget --no-check-certificate https://github.com/intel/compute-runtime/archive/${neo_commit_id}/neo.tar.gz

mkdir neo
tar xzf neo.tar.gz -C neo --strip-components=1

mkdir build-neo
cd build-neo
cmake ../neo -DCMAKE_BUILD_TYPE=Release
make -j`nproc`
sudo make install
sudo ldconfig
Clone this wiki locally