fhchl / ltbl

rpi-rgb-led-matrix for Pd
2 stars 0 forks source link

Possible to compile on Mac? #1

Open ozhewett opened 3 years ago

ozhewett commented 3 years ago

Hey! love that you made this, but i have yet to be able to compile for mac, curious if you have any ideas on this, seems like it doesnt like the gnu commands

folder@hahhahaah-hahahhhahaahah ltbl % make
/Library/Developer/CommandLineTools/usr/bin/make -C rpi-rgb-led-matrix/lib
c++ -I../include -W -Wall -Wextra -Wno-unused-parameter -O3 -g -fPIC  -DDEFAULT_HARDWARE='"regular"' -fno-exceptions -std=c++11 -c -o led-matrix.o led-matrix.cc
led-matrix.cc:436:29: error: use of undeclared identifier 'strchrnul'; did you mean 'strchr'?
    char *const semicolon = strchrnul(s, ';');
                            ^~~~~~~~~
                            strchr
/Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/string.h:77:13: note: 'strchr' declared here
      char* strchr(      char* __s, int __c) {return __libcpp_strchr(__s, __c);}
            ^
led-matrix.cc:586:7: error: use of undeclared identifier 'getresuid'
  if (getresuid(&ruid, &euid, &suid) >= 0) {
      ^
led-matrix.cc:596:7: error: use of undeclared identifier 'setresgid'
  if (setresgid(g->gr_gid, g->gr_gid, g->gr_gid) != 0) {
      ^
led-matrix.cc:605:7: error: use of undeclared identifier 'setresuid'
  if (setresuid(p->pw_uid, p->pw_uid, p->pw_uid) != 0) {
      ^
led-matrix.cc:635:37: warning: 'daemon' is deprecated: first deprecated in macOS 10.5 - Use posix_spawn APIs instead. [-Wdeprecated-declarations]
  if (runtime_options.daemon > 0 && daemon(1, 0) != 0) {
                                    ^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/stdlib.h:292:6: note: 'daemon' has been explicitly marked deprecated here
int      daemon(int, int) __DARWIN_1050(daemon) __OSX_AVAILABLE_BUT_DEPRECATED_MSG(__MAC_10_0, __MAC_10_5, __IPHONE_2_0, __IPHONE_2_0, "Use posix_spawn APIs instead....
         ^
1 warning and 4 errors generated.
make[1]: *** [led-matrix.o] Error 1
make: *** [rgbmatrix] Error 2
fhchl commented 3 years ago

Note that the external is wrapping rpi-rgb-led-matrix, a library that helps to draw on a LED matrix connected to a Raspberry Pi! Your error comes from building that library which probably only builds on the Pi. The external is supposed to run only on that platform.

If you want to prototype your patch before running it on the Pi, you could visualize your graphics via GEM. Let me know if you are interested in that. I might have some patch for that lying around somewhere. :smiley:

ozhewett commented 3 years ago

Oh duh! 😅 Was just trying to simulate it, but GEM is a great idea, and ill try it on a pi tomorrow:)

fhchl commented 3 years ago

Let me know how it works for you on the Pi!

fhchl commented 3 years ago

testing ltbl locally

This is how I tested the graphics on my linux machine before deploying to the Pi (use pix_dump).

ozhewett commented 3 years ago

Oh word, what data did you have going in? just the pixel list or does it require any special formatting?

fhchl commented 3 years ago

its the pixel list as it comes out from pix_dump (RGBA or RGB, can't recollect right now). So no special formatting!

ozhewett commented 3 years ago

in the Pd help patch, it says "if the matrix chain has 64x64 pixels the list must have" but then nothing after it? What must it have?

ozhewett commented 3 years ago

When i write up the mappings, even when i set all the init values to 64, the corner pixels are still 2 from the top and 26 up from the bottom. The pd terminal prints all the right flags, but the linux terminal prints "Size: 64x32. Hardware GPIO Mapping: regular"

fhchl commented 3 years ago

Ø

in the Pd help patch, it says "if the matrix chain has 64x64 pixels the list must have" but then nothing after it? What must it have?

Ups, I'll fix that!

The list must have 64x64x3 elements (x4 work as well but the alpha value is neglected).

fhchl commented 3 years ago

When i write up the mappings, even when i set all the init values to 64, the corner pixels are still 2 from the top and 26 up from the bottom. The pd terminal prints all the right flags, but the linux terminal prints "Size: 64x32. Hardware GPIO Mapping: regular"

I dont understand exactly your problem. What's your setup? What do you want to do? Can you paste your flags here and what kind of matrix you wanna use?

Have you tried running the demos in the rgb-led-matrix lib? I first tried running the demos to get the flags all correct and then copy-pasted the flags into the pd object.

If you have any semicolons in the flags you have to replace them with a bang "!".