unable to make rgbmatrix.so file for my matrix

EL Wire/Tape/Panels, LEDs, pixels and strips, LCDs and TFTs, etc products from Adafruit

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
jbkallday
 
Posts: 1
Joined: Thu May 21, 2015 11:29 pm

unable to make rgbmatrix.so file for my matrix

Post by jbkallday »

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.

User avatar
adafruit2
 
Posts: 22200
Joined: Fri Mar 11, 2005 7:36 pm

Re: unable to make rgbmatrix.so file for my matrix

Post by adafruit2 »

can you try raspbian? just because we dont have Ubuntu here and nothing is tested on Ubuntu - there could be some differences

User avatar
pburgess
 
Posts: 4161
Joined: Sun Oct 26, 2008 2:29 am

Re: unable to make rgbmatrix.so file for my matrix

Post by pburgess »

Code: Select all

make clean
Add ' -fPIC' to first line in Makefile:

Code: Select all

CXXFLAGS=-Wall -O3 -g -fno-strict-aliasing -fPIC
Add ' -fPIC' to DEFINES line in lib/Makefile:

Code: Select all

DEFINES+=-DADAFRUIT_RGBMATRIX_HAT -fPIC
Rebuild:

Code: Select all

make
Try it out:

Code: Select all

sudo python matrixtest.py

User avatar
woody37
 
Posts: 4
Joined: Wed Nov 25, 2015 4:19 pm

Re: unable to make rgbmatrix.so file for my matrix

Post by woody37 »

I made the -fPIC changes to both Makefile and lib/Makefile but I get a python2.7/Python.h: No such file error.

User avatar
pburgess
 
Posts: 4161
Joined: Sun Oct 26, 2008 2:29 am

Re: unable to make rgbmatrix.so file for my matrix

Post by pburgess »

Hmm. Try:

Code: Select all

sudo apt-get install python-dev
See if that helps.

User avatar
woody37
 
Posts: 4
Joined: Wed Nov 25, 2015 4:19 pm

Re: unable to make rgbmatrix.so file for my matrix

Post by woody37 »

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?

User avatar
pburgess
 
Posts: 4161
Joined: Sun Oct 26, 2008 2:29 am

Re: unable to make rgbmatrix.so file for my matrix

Post by pburgess »

Ah! One more, I think. Try:

Code: Select all

sudo apt-get install python-imaging
It'll probably want to install a bunch of dependencies. This is normal.

User avatar
woody37
 
Posts: 4
Joined: Wed Nov 25, 2015 4:19 pm

Re: unable to make rgbmatrix.so file for my matrix

Post by woody37 »

Thanks, that did the trick!
I also wanted to know how the .ppm files are made?

User avatar
pburgess
 
Posts: 4161
Joined: Sun Oct 26, 2008 2:29 am

Re: unable to make rgbmatrix.so file for my matrix

Post by pburgess »

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

User avatar
woody37
 
Posts: 4
Joined: Wed Nov 25, 2015 4:19 pm

Re: unable to make rgbmatrix.so file for my matrix

Post by woody37 »

Thanks pburgres.

Locked
Please be positive and constructive with your questions and comments.

Return to “Glowy things (LCD, LED, TFT, EL) purchased at Adafruit”