Closed LuletterSoul closed 3 years ago
This means it can't find python libraries:
/usr/bin/ld: cannot find -lpython3.8
Let's see..
Are you using the "easybuild.bash" command or not?
Anyway, if you take a look at here
https://github.com/elsampsa/valkka-core/blob/master/CMakeLists.txt#L147
When you run cmake in your (custom?) build directory, it uses the command "python3-config" to find the correct switches for compilation and linkin. So please tell us what is is the output of
python3-config --includes
python3-config --libs --embed
Since you are in ubuntu 18.04, whose default python version is 3.6, I assume you have compiled python yourself..?
Then, depending where your compiled python librares are siting, linuxes' shared library system may or may not find it.
So, please, locate where your custom-compiled python libraries are & make sure that your ubuntu can find them. Ubuntu searches for all shared libraries in a certain set of directories, you can find using this command:
ldconfig -v 2>/dev/null | grep -v ^$'\t'
To make it find more directories, you may play around with environmental variables (google is your friend), or add the directory to the global search list with:
sudo -i
echo "/PATH/TO/YOUR/DIRECTORY" > /etc/ld.so.conf.d/my_python.conf
ldconfig
exit
Hope this helps.
P. S. Ubuntu's standard python shared library is here:
./usr/lib/x86_64-linux-gnu/libpython3.6m.so
@elsampsa Thanks for your instant response and kind reply.
Yes, I really run easybuild.bash
to complete build process.
I don't compiled python myself, but I create a virtual python environment with Conda. So, while the CMake executes python3-config
, it will get corresponding configurations under this env. As you suggest, when I run:
python3-config --includes
python3-config --libs --embed
It shows:
-I/home/ndww/anaconda3/envs/dol2/include/python3.8 -I/home/ndww/anaconda3/envs/dol2/include/python3.8
and:
-lpython3.8 -lcrypt -lpthread -ldl -lutil -lrt -lm -lm
When I run ldconfig -v 2>/dev/null | grep -v ^$'\t'
, it prints:
/usr/local/cuda-10.1/targets/x86_64-linux/lib:
/usr/lib/x86_64-linux-gnu/libfakeroot:
/lib/i386-linux-gnu:
/usr/lib/i386-linux-gnu:
/usr/local/lib:
/lib/x86_64-linux-gnu:
/usr/lib/x86_64-linux-gnu:
/lib:
/usr/lib:
What do you mean /PATH/TO/YOUR/DIRECTORY
? Is it represents the python virtual env path ?
PATH/TO/YOUR/DIRECTORY
would be the directory where you have the file python 3.8 shared object file: libpython3.8m.so
Could you please locate the whereabouts of the file libpython3.8m.so
? .. it must be somewhere there, under /home/ndww/anaconda3/envs/
maybe?
.. after that we can proceed.
I'm not an anaconda user myself..
@elsampsa Hi, thanks for you warm heart.
I have solved this problem by install python3.8-dev
successfully. The corresponding libpython3.8m.so
file is install in /usr/lib/x86_64-linux-gnu
, so Cmake could find this file finally.
But, I encountered the other problem, I will open the other issue for bug report.
First of all, thank you for your amazing contribution for video streaming and analysis ! I am building on Ubuntu 18.04 with Python 3.8.3 in a virtual environment. Everything seems to be ok before it throws an error
/usr/bin/ld: cannot find -lpython3.8
.Do I make a mistake? It will be very helpful if you can provide some guidelines.