Every time I run the 'make' command to make the rgbmatrix.so file so i can use my python code for my rgb matrix I get the following failure message:
/usr/bin/ld: rgbmatrix.o: relocation R_ARM_THM_MOVW_ABS_NC against `_Py_NoneStruct' can not be used when making a shared object; recompile with -fPIC
rgbmatrix.o: error adding symbols: Bad value
collect2: error: ld returned 1 exit status
Makefile:28: recipe for target 'rgbmatrix.so' failed
make: *** [rgbmatrix.so] Error 1
I've tried doing make clean and re-doing the make command but I get the same message every time. I'm using Ubuntu Mate as my operating system on a raspberry pi 2 and the adafruit rgb matrix hat. Any help would be excellent.
unable to make rgbmatrix.so file for my matrix
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
- jbkallday
- Posts: 1
- Joined: Thu May 21, 2015 11:29 pm
- adafruit2
- Posts: 22200
- Joined: Fri Mar 11, 2005 7:36 pm
Re: unable to make rgbmatrix.so file for my matrix
can you try raspbian? just because we dont have Ubuntu here and nothing is tested on Ubuntu - there could be some differences
- pburgess
- Posts: 4161
- Joined: Sun Oct 26, 2008 2:29 am
Re: unable to make rgbmatrix.so file for my matrix
Code: Select all
make clean
Code: Select all
CXXFLAGS=-Wall -O3 -g -fno-strict-aliasing -fPIC
Code: Select all
DEFINES+=-DADAFRUIT_RGBMATRIX_HAT -fPIC
Code: Select all
make
Code: Select all
sudo python matrixtest.py
- woody37
- Posts: 4
- Joined: Wed Nov 25, 2015 4:19 pm
Re: unable to make rgbmatrix.so file for my matrix
I made the -fPIC changes to both Makefile and lib/Makefile but I get a python2.7/Python.h: No such file error.
- pburgess
- Posts: 4161
- Joined: Sun Oct 26, 2008 2:29 am
Re: unable to make rgbmatrix.so file for my matrix
Hmm. Try:
See if that helps.
Code: Select all
sudo apt-get install python-dev
- woody37
- Posts: 4
- Joined: Wed Nov 25, 2015 4:19 pm
Re: unable to make rgbmatrix.so file for my matrix
Now get "python2.7/Imaging.h no such file". Have done apt-get udate, apt-get upgrade and apt-get install python-dev all as root(sudo). Using Raspian for Pi 2.
Should I remove the fPIC additions to both make files?
Should I remove the fPIC additions to both make files?
- pburgess
- Posts: 4161
- Joined: Sun Oct 26, 2008 2:29 am
Re: unable to make rgbmatrix.so file for my matrix
Ah! One more, I think. Try:
It'll probably want to install a bunch of dependencies. This is normal.
Code: Select all
sudo apt-get install python-imaging
- woody37
- Posts: 4
- Joined: Wed Nov 25, 2015 4:19 pm
Re: unable to make rgbmatrix.so file for my matrix
Thanks, that did the trick!
I also wanted to know how the .ppm files are made?
I also wanted to know how the .ppm files are made?
- pburgess
- Posts: 4161
- Joined: Sun Oct 26, 2008 2:29 am
Re: unable to make rgbmatrix.so file for my matrix
PPM is a dinosaur image format, that software presumably uses it because it's simple to decode.
Here's a Photoshop plugin that appears to export PPM (haven't tested this myself):
http://telegraphics.com.au/sw/product/NetpbmFormats
And a web-based converter tool (same disclaimer):
http://www.sciweavers.org/free-online-image-converter
Here's a Photoshop plugin that appears to export PPM (haven't tested this myself):
http://telegraphics.com.au/sw/product/NetpbmFormats
And a web-based converter tool (same disclaimer):
http://www.sciweavers.org/free-online-image-converter
- woody37
- Posts: 4
- Joined: Wed Nov 25, 2015 4:19 pm
Re: unable to make rgbmatrix.so file for my matrix
Thanks pburgres.
Please be positive and constructive with your questions and comments.