I’m trying to build cwiid with python 3.2 bindings to make use of the Wiimote in Blender 2.63. My OS is ubuntu 12.04.
I set up virtualenv to provide the correct python version for the build.
Here is what I did so far (bash-shell record):
# Set up virtualenv with python3.2
sudo apt-get install python-setuptools
sudo easy_install virtualenv
virtualenv -p python3.2 --no-site-packages ~/env/cwiid_for_blender
# to activate, type this:
source ~/env/cwiid_for_blender/bin/activate
python --version # returns "Python 3.2.3"
# Build cwiid
# prerequisites
sudo apt-get install bison bluez libbluetooth3 libbluetooth-dev libgtk2.0-0 libgtk2.0-dev
# download and compile sources of cwiid
mkdir -p ~/Downloads/cwiid
cd ~/Downloads/cwiid
git clone https://github.com/abstrakraft/cwiid.git
cd cwiid
source ~/env/cwiid_for_blender/bin/activate
aclocal
autoconf
./configure
make
This fails because cwiid is normally built against python 2.7. In the configure script there is this line:
PYTHON_VERSION=`$PYTHON -c 'import sys; print sys.version[:3]'`
After changing it to the 3.2 syntax like this:
PYTHON_VERSION=`$PYTHON -c 'import sys; print( sys.version[:3] )'`
The make script starts to compile but fails when hitting the following line:
gcc -L../libcwiid -rdynamic -o wminput main.o conf.o c_plugin.o uinput.o action_enum.o util.o py_plugin.o parser.o lexer.o -lcwiid -lbluetooth -ldl -lpthread -lpython3.2
/usr/bin/ld: cannot find -lpython3.2
Interestingly the script is able to continue to the next error if I append mu to the line:
gcc -L../libcwiid -rdynamic -o wminput main.o conf.o c_plugin.o uinput.o action_enum.o util.o py_plugin.o parser.o lexer.o -lcwiid -lbluetooth -ldl -lpthread -lpython3.2mu
I don’t understand where gcc searches for the 3.2 libraries and how I can specify that. Specifically I don’t understand if the configure script has to be fixed or if I have to change my enviroment to fix this issue.
Suggestions by others so far:
- Make a symbolic link from
python3.2->python3.2mu. (But where? Tried several locations, none worked) - Add file with directories to look up in
/etd/ld.so.conf.d/
So, how does gcc find the python3.2 libraries it needs to build libcwiid?
After a while it became clear that the
configurescript was not correctly interpreting the python version. This was showed up in the Makefiles as they contained direct links to version 2.7. After correcting the make files the compilation went on to the real problems. So now, I’m trying to port the real code.