Hi!
So I am trying to build libtorch on my linux machine using cmake and the instructions here:
For this, first I create a conda environment, and install the packages highlighted here:
I am trying to configure my build using the following command:
cmake -DBUILD_SHARED_LIBS:BOOL=ON -DCMAKE_BUILD_TYPE:STRING=Release -DPYTHON_EXECUTABLE:PATH=`which python3` -DCMAKE_INSTALL_PREFIX:PATH=/raid/projects/pytorch-install -DGLIBCXX_USE_CXX11_ABI=0 -DBUILD_PYTHON:BOOL=OFF ../pytorch
During the configuration step I see strange warnings ending that they are meant for developers only. I am not sure if that is normal or not, but the configure finishes without other issues. Then I move on an call:
cmake --build . -j 16 --target install
It compiles seemingly without an issue but I see warnings like:
[ 13%] Building CXX object third_party/ideep/mkl-dnn/src/cpu/CMakeFiles/dnnl_cpu.dir/nspc_batch_normalization.cpp.o
Skipping full_like because it is a factory method
Skipping from_file because it is a factory method
Skipping hann_window because it is a factory method
Skipping hamming_window because it is a factory method
Skipping kaiser_window because it is a factory method
Skipping index_copy Because of Arg: Dimname (Dimname)
Skipping kthvalue Because of Arg: Dimname (Dimname)
Skipping kthvalue Because of Arg: Dimname (Dimname)
Skipping fbgemm_linear_quantize_weight Because of Ret: double (double)
Skipping linspace because it is a factory method
Skipping logspace because it is a factory method
... more lines like that ...
... more lines like that ...
It seems it only affects the mkl-ddn part. I tried it on an HPC and my laptop, with PT 1.10 and 1.7 and I get the same issues. Following this, when I try to link libtorch with another code I get errors like this:
/data/miniconda3/envs/pytorch-conda39-build/bin/../lib/gcc/x86_64-conda-linux-gnu/9.3.0/../../../../x86_64-conda-linux-gnu/bin/ld: /raid/projects/pytorch-install/lib/libtorch_cpu.so: undefined reference to `MKL_Somatadd'
/data/miniconda3/envs/pytorch-conda39-build/bin/../lib/gcc/x86_64-conda-linux-gnu/9.3.0/../../../../x86_64-conda-linux-gnu/bin/ld: /raid/projects/pytorch-install/lib/libtorch_cpu.so: undefined reference to `MKL_Get_Version_String'
/data/miniconda3/envs/pytorch-conda39-build/bin/../lib/gcc/x86_64-conda-linux-gnu/9.3.0/../../../../x86_64-conda-linux-gnu/bin/ld: /raid/projects/pytorch-install/lib/libtorch_cpu.so: undefined reference to `vsSqrt'
... more errors like that ...
... more errors like that ...
which is rather strange. I wonder if the two issues are related. Has anybody seen this behavior before?