Skip to content

Commit

Permalink
Set INTERFACE_LINK_DIRECTORIES on caffe2::mkl
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
#73008

This fixes pytorch/audio#2784

Signed-off-by: Edward Z. Yang <ezyang@fb.com>

[ghstack-poisoned]
  • Loading branch information
ezyang committed Nov 20, 2022
1 parent caf3d53 commit 0c2d960
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 0c2d960

Please sign in to comment.