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

libk2context.so compile error #1031

Open
zeynepgulhanuslu opened this issue Aug 10, 2022 · 1 comment
Open

libk2context.so compile error #1031

zeynepgulhanuslu opened this issue Aug 10, 2022 · 1 comment

Comments

@zeynepgulhanuslu
Copy link

Hi,

I tried to build k2 from the source on centos with cuda environment. I encounter the below error:

[ 23%] Linking CUDA shared library ../../lib/libk2context.so
/usr/bin/ld: cannot find -lmkl_intel_ilp64
/usr/bin/ld: cannot find -lmkl_core
/usr/bin/ld: cannot find -lmkl_intel_thread
/usr/bin/ld: cannot find -lCUDA_cublas_LIBRARY-NOTFOUND
collect2: error: ld returned 1 exit status
make[2]: *** [lib/libk2context.so] Error 1
make[1]: *** [k2/csrc/CMakeFiles/context.dir/all] Error 2
make: *** [all] Error 2

What could be the problem here?

torch installation:

pip install torch==1.7.1+cu101 torchvision==0.8.2+cu101 torchaudio==0.7.2 -f https://download.pytorch.org/whl/torch_stable.html
k2 installation:

git clone https://github.com/k2-fsa/k2.git
cd k2
pip3 install -r ./requirements.txt
mkdir build_release
cd build_release
cmake -DCMAKE_BUILD_TYPE=Release ..
make -j

cuda version: 10.1

Thanks in advance

@pkufool
Copy link
Collaborator

pkufool commented Aug 10, 2022

It is because the pytorch distribution on CentOS does not include MKL library. You can try:

  1. Add path of libmkl by LD_LIBRARY_PATH
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:your/path/to/libmkl
  1. Try this fix [Not for merge]Link python lib to fix mkl not found #1032

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

No branches or pull requests

2 participants