Skip to content

Compiling on Ubuntu with MKL, CUDA and Tcmalloc #114

@MoonDragon-MD

Description

@MoonDragon-MD

Hi, I had to edit two files in order to get MKL and Tcmalloc recognized. The problem lies in the fact that on Ubuntu when you install intel-mkl it puts the files in a non-standard way compared to what cmake expects. So I modified FindMKL.cmake and CMakeLists.txt to not have any problems.

I am attaching the files for those who will have the same problem

Rename the FindMKL.cmake.txt file to FindMKL.cmake and put it inside the cmake folder

for completeness I also write what I installed (I don't know if it was all needed)

sudo apt install libboost-system-dev libprotobuf-dev protobuf-compiler libssl-dev intel-mkl libsentencepiece-dev doxygen google-perftool gcc-8 libopenblas-dev
sudo ln -s /usr/lib/x86_64-linux-gnu/libtcmalloc.so /usr/lib/libtcmalloc.so
sudo ln -s /usr/lib/x86_64-linux-gnu/libtcmalloc_minimal.so /usr/lib/libtcmalloc_minimal.so
sudo ln -s /usr/lib/x86_64-linux-gnu/libtcmalloc.so.4 /usr/lib/x86_64-linux-gnu/libtcmalloc.so
sudo update-alternatives --config gcc

set to 8

Compile the program with

cmake .. -DCMAKE_BUILD_TYPE=Release -DCOMPILE_CPU=ON -DUSE_MKL=ON -DUSE_SENTENCEPIECE=ON -DUSE_CBLAS=ON -DBUILD_ARCH=native -DUSE_INTGEMM=ON -DCOMPILE_CUDA=ON
make -j4

CMakeLists.txt

FindMKL.cmake.txt

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions