Skip to content

Commit

Permalink
Set INTERFACE_LINK_DIRECTORIES on caffe2::mkl (pytorch#89359)
Browse files Browse the repository at this point in the history
This ensures that subsequent link commands involving mkl libraries
know where to find the libraries if they are in a non-standard
location (which is the case if you installed mkl via conda, which
is what our standard instructions recommend.)

This is kind of a hack, because the MKL libraries are not actually
guaranteed to be in $MKL_ROOT/lib (they are for the conda install
though).  The real fix is to properly use the MKL targets from
FindMKL.cmake but thats its own can of fish.  See
pytorch#73008

This fixes pytorch/audio#2784

Signed-off-by: Edward Z. Yang <ezyang@fb.com>
Pull Request resolved: pytorch#89359
Approved by: https://github.com/soumith
  • Loading branch information
ezyang authored and kulinseth committed Dec 9, 2022
1 parent 53d30fd commit ca92b4f
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions cmake/public/mkl.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,8 @@ set_property(
set_property(
TARGET caffe2::mkl PROPERTY INTERFACE_LINK_LIBRARIES
${MKL_LIBRARIES})
# TODO: This is a hack, it will not pick up architecture dependent
# MKL libraries correctly; see https://github.com/pytorch/pytorch/issues/73008
set_property(
TARGET caffe2::mkl PROPERTY INTERFACE_LINK_DIRECTORIES
${MKL_ROOT}/lib)

0 comments on commit ca92b4f

Please sign in to comment.