markandrus / Sonify

Sonify is a JACK plugin that encodes images into audio and vice-versa, in realtime.
mrkrbrts.com/blog
GNU General Public License v2.0
29 stars 3 forks source link

gcc error on Linux #1

Open qubodup opened 8 years ago

qubodup commented 8 years ago

Hi, I found this via http://jackaudio.org/applications/ and want to build this on Linux.

$ make
gcc -g -lpthread -lm -lfftw3f -ljack -laubio -lgd -I/usr/local/include -I/usr/local/include/aubio -D_GNU_SOURCE=1 -D_THREAD_SAFE -I/usr/local/include/SDL -lpthread -lm -lfftw3f -ljack -laubio -lgd -framework CoreAudio -framework CoreServices -framework AudioUnit -L/usr/local/lib -ljack -laubio -ljpeg -lfontconfig -lfreetype -lpng12 -lz /usr/local/lib/libiconv.dylib -Wl,-framework,Cocoa -L/usr/local/lib -lSDLmain -lSDL -lSDL_image  main.c resize.c -o sonify 
gcc: error: CoreAudio: No such file or directory
gcc: error: CoreServices: No such file or directory
gcc: error: AudioUnit: No such file or directory
gcc: error: /usr/local/lib/libiconv.dylib: No such file or directory
gcc: error: unrecognized command line option ‘-framework’
gcc: error: unrecognized command line option ‘-framework’
gcc: error: unrecognized command line option ‘-framework’
Makefile:9: recipe for target 'all' failed
make: *** [all] Error 1

I guess this is known though:

TODO: Rewrite Makefile so that it is not OS X-specific.

If this happens to be trivial, I'd gladly test advice on how to modify this for Linux usability and then perhaps we can produce a Makefile-Linux in the end.

robinpaulson commented 8 years ago

Those are all OSX technologies; I've had a go at making a linux make file, I started by removing the references containing "-framework" and CoreAudio, also poinitng libiconv to the right location (it's in /usr/include). I got further errors, so I stopped there: gcc -g -lpthread -lm -lfftw3f -ljack -laubio -lgd -I/usr/local/include -I/usr/local/aubio -D_GNU_SOURCE=1 -D_THREAD_SAFE -I/usr/include/SDL -lpthread -lm -lfftw3f -ljack -laubio -lgd -L/usr/local/lib -ljack -laubio -ljpeg -lfontconfig -lfreetype -lpng12 -lz -liconv -Wl, -L/usr/local/lib -lSDLmain -lSDL -lSDL_image main.c resize.c -o sonify main.c:48:1: error: unknown type name ‘aubio_pitchdetection_t’ aubio_pitchdetection_t * aubio; ^ main.c: In function ‘init_aubio’: main.c:75:60: error: ‘aubio_pitch_fcomb’ undeclared (first use in this function) aubio = new_aubio_pitchdetection(bufsize, hopsize, 1, sr, aubio_pitch_fcomb, aubio_pitchm_freq); ^ main.c:75:60: note: each undeclared identifier is reported only once for each function it appears in main.c:75:79: error: ‘aubio_pitchm_freq’ undeclared (first use in this function) aubio = new_aubio_pitchdetection(bufsize, hopsize, 1, sr, aubio_pitch_fcomb, aubio_pitchm_freq); ^ main.c:76:2: error: too many arguments to function ‘new_fvec’ aubio_fvec = new_fvec(hopsize, 1); ^ In file included from /usr/include/aubio/aubio.h:164:0, from main.c:27: /usr/include/aubio/fvec.h:77:10: note: declared here fvec_t * new_fvec(uint_t length); ^ main.c: In function ‘process’: main.c:188:22: error: subscripted value is neither array nor pointer nor vector aubio_fvec->data[0][framecount] = (smpl_t) in[i]; ^ make: *\ [all] Error 1

These look like C problems, not make. I may be wrong though.

robinpaulson commented 8 years ago

this is where I'm at with the Makefile for Linux, which produces the errors above

Makefile for audimg (for Linux)

CC=gcc CFLAGS=-g -lpthread -lm -lfftw3f -ljack -laubio -lgd -I/usr/local/include -I/usr/local/include/aubio -D_GNU_SOURCE=1 -D_THREAD_SAFE -I/usr/include/SDL LDFLAGS=-lpthread -lm -lfftw3f -ljack -laubio -lgd -L/usr/local/lib -ljack -laubio -ljpeg -lfontconfig -lfreetype -lpng12 -lz -liconv -Wl,-framework,Cocoa -L/usr/local/lib -lSDLmain -lSDL -lSDL_image SOURCES=main.c OBJECTS=$(SOURCES:.c=.o)

all: $(CC) $(CFLAGS) $(LDFLAGS) main.c resize.c -o sonify

clean: rm -rf *o main rm -rf sonify

robinpaulson commented 8 years ago

now:

Makefile for audimg

CC=gcc CFLAGS=-g -lpthread -lm -lfftw3f -ljack -laubio -lgd -I/usr/include -I/usr/local/include/aubio -D_GNU_SOURCE=1 -D_THREAD_SAFE -I/usr/include/SDL LDFLAGS=-lpthread -lm -lfftw3f -ljack -laubio -lgd -L/usr/lib -ljack -laubio -ljpeg -lfontconfig -lfreetype -lpng12 -lz -liconv -Wl,-framework,Cocoa -L/usr/lib -lSDLmain -lSDL -lSDL_image SOURCES=main.c OBJECTS=$(SOURCES:.c=.o)

all: $(CC) $(CFLAGS) $(LDFLAGS) main.c resize.c -o sonify

clean: rm -rf *o main rm -rf sonify

robinpaulson commented 8 years ago

I think the problems I am getting are because sonify was written against aubio-dev v 0.3.2 and the version on my system is 0.4.0. Perhaps we need to manually define local versions of the (old) aubio header files or rewrite the code for version 0.4.0

qubodup commented 8 years ago

Thanks for looking into this, indeed it seems to fail because of the new version.

Unfortunately 3.2 from https://projects.archlinux.org/svntogit/packages.git/commit/trunk?h=packages/aubio&id=77445c817c8073d33d356416fe04b0d2527d5d64 fails to compile for me.

replacing aubio_pitchdetection_t * aubio; with aubio_pitch_t * aubio; seems to work for gcc at least but I can't find a replacement for aubio_pitch_fcomb - I'm just grep'ing - I'm no C coder.

robinpaulson commented 8 years ago

aubio dev 3.2 probably has similar errors I.e. built against old versions of other libraries. Our best bet is probably to rewrite for new versions of aubio etc. The functions are all well documented, I reckon we can do it with minimal C knowledge

robinpaulson commented 8 years ago

Or, it will probably work fine on say Ubuntu 12.04. Precise, which is still supported

markandrus commented 8 years ago

Hi @qubodup and @robinpaulson! Thanks for the interest. I haven't worked on this project in a while, and I don't have much time to continue developing it. However, I'd be happy to test out and merge any fixes in the build process.