apache / mxnet

Lightweight, Portable, Flexible Distributed/Mobile Deep Learning with Dynamic, Mutation-aware Dataflow Dep Scheduler; for Python, R, Julia, Scala, Go, Javascript and more
https://mxnet.apache.org
Apache License 2.0
20.78k stars 6.79k forks source link

Install error when building with oneDNN #20836

Closed matteosal closed 2 years ago

matteosal commented 2 years ago

Building with oneDNN tries to install oneDNN headers in the root directory:

CMake Error at 3rdparty/onednn/src/cmake_install.cmake:68 (file):
  file INSTALL cannot copy file
  "/home/matteo/Git/mxnet-build/Build/Linux-x86-64/MKL/mxnet/3rdparty/onednn/src/../include/dnnl.h"
  to "/onednn/dnnl.h": Permission denied.
Call Stack (most recent call first):
  3rdparty/onednn/cmake_install.cmake:47 (include)
  cmake_install.cmake:86 (include)

I see this on Linux, Mac and Windows. It might be due to the fact that CMAKE_INSTALL_INCLUDEDIR is an empty string in this command, although I don't have proof of this.

Moreover, are these headers even needed for anything? I could link to the library just fine even without those headers

anko-intel commented 2 years ago

Could you describe how you run cmake ?

matteosal commented 2 years ago

@anko-intel here is my invocation with all the flags:

cmake \
 `# GENERAL FLAGS` \
 -DCMAKE_INSTALL_PREFIX=$output_dir \
 -DCMAKE_BUILD_TYPE=Release \
 -DCMAKE_SKIP_BUILD_RPATH=On \
 -DUSE_OPENCV=OFF \
 -DUSE_JEMALLOC=OFF \
 -DUSE_F16C=Off `# float16 support`\
 -DUSE_INT64_TENSOR_SIZE=ON `# this + MKL_MULTI_THREADED=ON + MKL_USE_SINGLE_DYNAMIC_LIBRARY=OFF select MKL ILP64`\
 -DCMAKE_C_FLAGS_RELEASE="-DNDEBUG" \
 -DCMAKE_CXX_FLAGS_RELEASE="-DNDEBUG" \
 -DCMAKE_SHARED_LINKER_FLAGS="-Wl,--as-needed" `# prevent libgomp from linking` \
 `# MATH BACKENDS` \
 -DBLAS=MKL \
 -DUSE_LAPACK=ON \
 -DUSE_LAPACKE_INTERFACE=ON \
 -DUSE_ONEDNN=ON \
 -DBLA_STATIC=OFF \
 -DMKL_MULTI_THREADED=ON \
 -DMKL_USE_SINGLE_DYNAMIC_LIBRARY=OFF \
 -DMKL_INCLUDE_DIR=$mkl_dir \
 -DBLAS_LIBRARIES="$mkl_dir/libmkl_def.so;$mkl_dir/libmkl_intel_ilp64.so;$mkl_dir/libmkl_core.so;$mkl_dir/libmkl_intel_thread.so;$mkl_dir/libiomp5.so" \
 `# OPENMP` \
 -DUSE_OPENMP=ON \
 -DOpenMP_C_FLAGS="-I$mkl_dir -fopenmp" \
 -DOpenMP_C_LIB_NAMES="libiomp5" \
 -DOpenMP_CXX_FLAGS="-I$mkl_dir -fopenmp" \
 -DOpenMP_CXX_LIB_NAMES="libiomp5" \
 -DOpenMP_libiomp5_LIBRARY="$mkl_dir/libiomp5.so" \
 `# CUDA` \
 -DUSE_CUDA=OFF \
 $mxnet_dir