ld: library not found - but the library is there and the flags are correct
I have a linker problems:
I don't understand why but I can't get clang++ to find the library, despite giving all the correct flags.
I tried doing the same things on a linux machine with the same project and it worked perfectly, so this is really a problem with the mac environment.
$ clang++ -std=c++11 -shared ppu_pluggable_device.cc -fPIC \
-I/opt/homebrew/Caskroom/miniconda/base/envs/tf/lib/python3.10/site-packages/tensorflow/include \
-L/opt/homebrew/Caskroom/miniconda/base/envs/tf/lib/python3.10/site-packages/tensorflow/python \
-l:_pywrap_tensorflow_internal.so \
-O2 -o plugin.so
(...)
ld: library not found for -l:_pywrap_tensorflow_internal.so
clang: error: linker command failed with exit code 1 (use -v to see invocation)
$ ls /opt/homebrew/Caskroom/miniforge/base/envs/tf/lib/python3.10/site-packages/tensorflow/python
(...)
_pywrap_tensorflow_internal.so estimator pywrap_mlir.py user_ops
(...)