MKLDNN changes global linker flags with shared library.
Created by: reyoung
When WITH_MKLDNN
is true, configure.cmake
changes linker flags to link -liomp
for all executors and shared libraries. But some of Paddle executors and libraries (especially executors and shared libraries when refactoring) do not need MKLDNN
and do not depend on it.
So we should change the configure.cmake
to make targets who use iomp
to link it.
How to reproduce this issue.
In Linux system, add cmake flag WITH_MKLDNN=ON
, and make any binary or shared library which does not depends on MKLDNN
will trigger this error.
Like
cmake .. -DWITH_MKLDNN=ON
make paddle_pybind