# Unicorn hat with Arch Linux?

**URL:** <https://forums.pimoroni.com/t/unicorn-hat-with-arch-linux/639>\
**Category:** Raspberry Pi\
**Created:** [April 18, 2015, 5:00am UTC](https://forums.pimoroni.com/t/unicorn-hat-with-arch-linux/639 "2015-04-18T05:00:58Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ThePettyTyrant](https://avatars.discourse-cdn.com/v4/letter/t/b9bd4f/32.png) [@ThePettyTyrant](https://forums.pimoroni.com/u/ThePettyTyrant)\
**Post date:** [April 18, 2015, 5:00am UTC](https://forums.pimoroni.com/t/unicorn-hat-with-arch-linux/639/1 "2015-04-18T05:00:58Z")

</div>

Can someone help me figure out how to get the unicorn hat software compiled and running on a RPi2 with Arch Linux?

I believe that I have all needed prerequisites installed. When I try to build, I get this error:

`root@alarmpi ..n/unicorn-hat-master/python/rpi-ws281x # make
sudo rm -rf build
sudo ./setup.py build
running build
running build_py
Compiling ws281x library...
creating build
creating build/lib.linux-armv7l-3.4
copying neopixel.py -> build/lib.linux-armv7l-3.4
running build_ext
building '_rpi_ws281x' extension
creating build/temp.linux-armv7l-3.4
gcc -pthread -Wno-unused-result -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -march=armv7-a -mfloat-abi=hard -mfpu=vfpv3-d16 -O2 -pipe -fstack-protector --param=ssp-buffer-size=4 -fPIC -Ilib/ -I/usr/include/python3.4m -c rpi_ws281x_wrap.c -o build/temp.linux-armv7l-3.4/rpi_ws281x_wrap.o
rpi_ws281x_wrap.c: In function 'PyInit__rpi_ws281x':
rpi_ws281x_wrap.c:4638:21: warning: variable 'md' set but not used [-Wunused-but-set-variable]
   PyObject *m, *d, *md;
                     ^
gcc -pthread -shared -Wl,-O1,--sort-common,--as-needed,-z,relro build/temp.linux-armv7l-3.4/rpi_ws281x_wrap.o -Llib/ -L/usr/lib -lws2811 -lpython3.4m -o build/lib.linux-armv7l-3.4/_rpi_ws281x.cpython-34m.so
/usr/bin/ld: lib//libws2811.a(ws2811.o): relocation R_ARM_MOVW_ABS_NC against `a local symbol' can not be used when making a shared object; recompile with -fPIC
lib//libws2811.a: error adding symbols: Bad value
collect2: error: ld returned 1 exit status
error: command 'gcc' failed with exit status 1
Makefile:5: recipe for target 'build' failed`

---

<div class="post-metadata">

**Author:** ![gadgetoid](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.pimoroni.com/gadgetoid/32/13_2.png) [@gadgetoid](https://forums.pimoroni.com/u/gadgetoid)\
**Post date:** [April 18, 2015, 2:30pm UTC](https://forums.pimoroni.com/t/unicorn-hat-with-arch-linux/639/2 "2015-04-18T14:30:44Z")

</div>

It might be worth doing exactly what it’s suggesting- although it could be problematic to get the build process to actually _do_ that.

While I know precious little about what practical differences there might be between Arch and Debian I know that ‘-fPIC’ is the option for “Position Independent Code”.

At a finger-in-the-air guess I’d try editing the library Makefile ( [https://github.com/pimoroni/unicorn-hat/blob/master/python/rpi-ws281x/lib/Makefile](https://github.com/pimoroni/unicorn-hat/blob/master/python/rpi-ws281x/lib/Makefile) ) and maybe changing line 4 from `gcc -o ws2811.o -c -g -O2 -Wall -Werror ws2811.c` to `gcc -o ws2811.o -c -g -O2 -fPIC -Wall -Werror ws2811.c`

Worth a punt!
