I ran the following comments in colab cell to add libtensorflow_framework.so to the gcc's searching routine:
! echo '/usr/local/lib/python3.6/dist-packages/tensorflow/' >> /etc/ld.so.conf
! sudo ldconfig
! export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib/python3.6/dist-packages/tensorflow/
! echo 'export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib/python3.6/dist-packages/tensorflow/' >> ~/.bashrc
! source ~/.bashrc
and got (I do not know if it is this question's key point)
/sbin/ldconfig.real: /usr/local/lib/python3.6/dist-packages/ideep4py/lib/libmkldnn.so.0 is not a symbolic link
since in tensorflow 2.2.0-rc3 the " libtensorflow_framework.so " is modified to " libtensorflow_framework.so.2 ", so I created a soft connection between them:
!sudo ln -s libtensorflow_framework.so.2 libtensorflow_framework.so
but when I finally run the comments:
TF_INC=$(python -c 'import tensorflow as tf; print(tf.sysconfig.get_include())')
TF_LIB=$(python -c 'import tensorflow as tf; print(tf.sysconfig.get_lib())')
# TF1.4
g++ -std=c++11 tf_grouping.cpp tf_grouping_g.cu.o -o tf_grouping_so.so -shared -fPIC -I
/usr/local/lib/python3.6/dist-packages/tensorflow/include -I /usr/local/cuda/include -I
/usr/local/lib/python3.6/dist-packages/tensorflow/include/external/nsync/public -lcudart -L
/usr/local/cuda/lib64/ -L/usr/local/lib/python3.6/dist-packages/tensorflow -llibtensorflow_framework -O2 -D_GLIBCXX_USE_CXX11_ABI=0 -I$TF_INC/external/nsync/public -L$TF_LIB -llibtensorflow_framework
I still get the feedback:
/usr/bin/ld: cannot find -llibtensorflow_framework
/usr/bin/ld: cannot find -llibtensorflow_framework
collect2: error: ld returned 1 exit status