C++ libtorch library not found for -lmkl_intel_ilp64

I followed the documentation here to use pytorch in C++. I was able to compile everything until the building stage where I bumped into an issue of ld: library not found for -lmkl_intel_ilp64. I’m wondering what’s the solution to it, thanks!

I’m using Mac (OS is Catalina) and installed 1.11.0 libtorch

You might want to add the folder containing libmkl_core.so etc. to LIBRARY_PATH so that the build stage find these libraries.