PURE DATA forum~

...that deal with pure data

You are not logged in.

  • Index
  • extra~
  • compiling aubio externals on mac os x 10.7

#1 2012-03-06 14:58:55

dio_333
Member

compiling aubio externals on mac os x 10.7

hello!

I am trying to compile aubio pd externals, written by paul brossier from here: http://aubio.sourcearchive.com/document … ource.html
with Xcode 4.2 on mac os 10.7.

I previously managed to compile several files which only had dependencies on m_pd.h.

Now I am including aubio.h and linking Header Search Paths, User Header Search Paths to the src directory where the aubio.h is located.

The project compiles ok and then when I try to use the object aubiotempo~ in pd I get this error:

Symbol not found: _aubio_tempo_do
  Referenced from: /Applications/Pd-extended.app/Contents/Resources/extra/aubiotempo~.pd_darwin
  Expected in: dynamic lookup

I am not able to install aubio on this version of mac os when using macports because some libraries would not install. But, do I need aubio installed on my machine?

Thanks everyone!

Offline

 

#2 2012-03-06 15:10:47

katjav
Member

Re: compiling aubio externals on mac os x 10.7

Hello dio_333,

Did you add the lib to the startup preferences?

Katja

Offline

 

#3 2012-03-06 15:12:32

moog1
Member

Re: compiling aubio externals on mac os x 10.7

dio_333 wrote:

..Now I am including aubio.h and linking Header Search Paths, User Header Search Paths to the src directory where the aubio.h is located
. . .
I am not able to install aubio on this version of mac os when using macports because some libraries would not install. But, do I need aubio installed on my machine?

Yes .. if you're compiling agianst aubio.h, you need the aubio libs installed .
You can always try and compile the libs youself .. you can comment out  (in the Makefile), the 'offending' code which is dependent on those libs that won't install .. it should work, unless the 'bits of code' you want, happen to be dependent on them..

Edit: Did you use static or dynamic linking? Didn't you need to use -laubio ?

I believe that -lsndfile, -lsamplerate are also involved

Last edited by moog1 (2012-03-06 15:23:23)

Offline

 

#4 2012-03-07 18:41:33

dio_333
Member

Re: compiling aubio externals on mac os x 10.7

moog1 wrote:

dio_333 wrote:

..Now I am including aubio.h and linking Header Search Paths, User Header Search Paths to the src directory where the aubio.h is located
. . .
I am not able to install aubio on this version of mac os when using macports because some libraries would not install. But, do I need aubio installed on my machine?

Yes .. if you're compiling agianst aubio.h, you need the aubio libs installed .
You can always try and compile the libs youself .. you can comment out  (in the Makefile), the 'offending' code which is dependent on those libs that won't install .. it should work, unless the 'bits of code' you want, happen to be dependent on them..

Edit: Did you use static or dynamic linking? Didn't you need to use -laubio ?

I believe that -lsndfile, -lsamplerate are also involved

I used dynamic linking so maybe that's why the compiler wasn't complaining about anything.

I also tried the same thing on a snow leopard but trying to install aubio with macports. And again, the same error.

I will try to install it with config/make/make install as you said. I see here that I already have installed

Summary:
Fftw3:                   yes (not using fftw3f)
Libsndfile:              yes
Libsamplerate:           yes
JACK:                    no
ALSA midi:               no
Lash:                    no
PureData:                no

it is funny because I thought it is only depending on the first 3. On the macports it is a lot worse, it installs a lot of dependencies. I have installed pd as an app so probably it doesn't find the libraries? I don't really know... I am a bit lost

PS: never mind this...I managed to install aubio by removing a flag in the configure script "-Wno-long-double" then everything worked as a charm. I will post more tomorrow once I compile my external with aubio. I think I am setting some wrong flags in Xcode or not setting them at all

Last edited by dio_333 (2012-03-07 20:13:07)

Offline

 

#5 2012-03-08 11:23:14

dio_333
Member

Re: compiling aubio externals on mac os x 10.7

so I manage to install aubio, include the paths to the /usr/local/lib and also add the flag -laubio (other c flags) and I still have the same error.

any suggestion? maybe I shouldn't create a dynamic library?

Offline

 

#6 2012-03-08 11:39:39

dio_333
Member

Re: compiling aubio externals on mac os x 10.7

katjav wrote:

Hello dio_333,

Did you add the lib to the startup preferences?

Katja

sorry, I've just seen your post now...should I add aubiotempo~ to start-up?  it's the same thing I guess.

Offline

 

#7 2012-03-08 15:34:01

katjav
Member

Re: compiling aubio externals on mac os x 10.7

should I add aubiotempo~ to start-up?

Aubio for Pd is a single-file-multiple-classes lib, and copying the file into the 'extra' folder is not enough to make the objects load. So the aubio~.pd_darwin must be added to the startup items.

If it still doesn't work then, you can check the exported symbols (functions) in aubio~.pd_darwin with command nm. If a symbol is missing it means something went wrong with static linking. Also note that symbols preceded with uppercase characters are exported, those with lowercase are not exported. It seems to me that fftw3 etc must be statically built into the executable. But the aubio executable itself must definitely be a dynamic library.

Unfortunately I can't build aubio on OSX (10.5) myself as I never managed to get fftw3 installed with Fink.


Katja

Offline

 

#8 2012-03-08 16:27:22

dio_333
Member

Re: compiling aubio externals on mac os x 10.7

thanks for your advice!

in fact, I just tried to build one .c file from all the package, not all the aubio for pd thing.

my goal is to use aubio inside my external. I thought compiling just one c file as a pd_darwin could be a start. this means I have to link everything from Xcode.

now I am looking at how fleet builds objects in the Xcode template they provide.

I installed fftw3 with the configure/make script because fink it doesn't work for me.

I get the same error when trying to build a flext external, using their Xcode template:

Symbol not found: __ZN18flext_obj_single_d8FinalizeEv
  Referenced from: /Users/mmiron/Documents/INESC/maxpd/flext/examples/pd/myext.pd_darwin
  Expected in: dynamic lookup

I didn't modified anything to this, just added GLOBAL paths to the libraries/headers. could this be the problem here?


later edit:
both in flext project and aubio, I get the same warning:
ignoring file /Developer/SDKs/MacOSX10.6.sdk/usr/local/lib/libaubio.dylib, file was built for unsupported file format which is not the architecture being linked (i386)

ld: warning: ignoring file /usr/local/lib/libflext-pd_sd.a, file was built for archive which is not the architecture being linked (i386)

uname -p gives me i386 and uname -p x86_64. and in the Architecture tab I am using 32 bits.

when I look in the system information, it seems that pd-extended was installed for 32 bit. I downloaded the dmg from the website. maybe it is a good idea to compile pd-extended from the src maybe it will compile for 64 bit

Last edited by dio_333 (2012-03-08 18:23:34)

Offline

 

#9 2012-03-08 18:25:35

katjav
Member

Re: compiling aubio externals on mac os x 10.7

I didn't modified anything to this, just added GLOBAL paths to the libraries/headers. could this be the problem here?

Yeah the path settings. Pd externals are compiled with -undefined suppress or -export_dynamic flags, so GCC doesn't complain about any function definitions missing, if only the forward declarations are found. In my limited experience with Xcode, anything you want to link statically must be included (as source or precompiled binary, not only a link to the header) in the project.

Edit: I'm wrong, libaubio should be a dynamic lib indeed, it is like that on Linux. On OSX it may be an idea to put the .dylib in Contents/lib of the Pd-extended app.

I'd like to try and build the aubio stuff on OSX from it's build system, on the command line. dio_333, can you tell me how you installed fftw3 from the configure/make script? Which script, how?


Katja

Last edited by katjav (2012-03-08 18:46:15)

Offline

 

#10 2012-03-08 18:50:39

katjav
Member

Re: compiling aubio externals on mac os x 10.7

dio_333 wrote:

maybe it is a good idea to compile pd-extended from the src maybe it will compile for 64 bit

.


You can also get the latest Pd-extended 0.43 from the nightly builds for 64 bit OSX. Or you can build the aubio for 32 bit. This must be possible with Xcode 4. Only powerpc builds are no longer supported if I remember well.


Katja

Offline

 

#11 2012-03-08 18:56:37

dio_333
Member

Re: compiling aubio externals on mac os x 10.7

I downloaded the source code: http://www.fftw.org/fftw-3.3.1.tar.gz and I did ./configure and make and sudo make install from command line. I think you can use ./bootstrap instead

Offline

 

#12 2012-03-08 21:29:06

katjav
Member

Re: compiling aubio externals on mac os x 10.7

That was easy, thanks. But now another package missing, samplerate. Fink won't compile this one either. 'no working compiler found'. Fink is dead, as far as my too old Mac is concerned. There can be no doubt that there is a working compiler on my computer.

When doing configure for libsamplerate on the command line, I get: 'checking for FFTW3... no'. I just installed fftw3 and certainly it's there in /usr/local/bin, and the header in /usr/local/include. Aubio's configure does find fft3.h. But it can't find package samplerate. While samplerate.h is next to fft3.h in /usr/local/include. No luck today.




Katja

Offline

 

#13 2012-03-09 11:24:26

dio_333
Member

Re: compiling aubio externals on mac os x 10.7

maybe you could try using this compiler?

https://github.com/kennethreitz/osx-gcc-installer/

Offline

 

#14 2012-03-09 15:55:00

moog1
Member

Re: compiling aubio externals on mac os x 10.7

katjav wrote:

When doing configure for libsamplerate on the command line, I get: 'checking for FFTW3... no'. I just installed fftw3 and certainly it's there in /usr/local/bin, and the header in /usr/local/include. Aubio's configure does find fft3.h. But it can't find package samplerate. While samplerate.h is next to fft3.h in /usr/local/include. No luck today.

Hmm .. /usr/local/bin? It would be looking for libfftw3*.* on some 'lib path', wouldn't it?

I don't know if the following might help:-
http://root.cern.ch/phpBB3/viewtopic.ph … mp;t=13417

Offline

 

#15 2012-03-10 12:49:03

katjav
Member

Re: compiling aubio externals on mac os x 10.7

I'm on OSX 10.5 and everything is built for 32 bit address space by default. Checked libsamplerate.a and libfftw3.a with otool (thanks for the link, moog1).

When running aubio's ./configure, it searches fftw3.h (found) and packages SNDLIB (found) and SAMPLERATE (not found).

Tried './configure --without-SAMPLERATE'. But it still exits with the same error about package SAMPLERATE not being found. It is probably essential.

Did I install the wrong libsamplerate? Got it from here (Secret Rabbit Hole):

http://www.mega-nerd.com/SRC/download.html




Katja

Offline

 

#16 2012-03-10 13:05:36

katjav
Member

Re: compiling aubio externals on mac os x 10.7

dio_333 wrote:

maybe you could try using this compiler?

https://github.com/kennethreitz/osx-gcc-installer/

I have Xcode 3.1.3 installed on OSX 10.5. It has gcc 4.0 and gcc 4.2. Fink wants to use gcc 4.2 and seems unable to locate it. It's a pity, everything can be compiled but a package manager would be handy.


Katja

Offline

 

#17 2012-03-10 16:39:52

moog1
Member

Re: compiling aubio externals on mac os x 10.7

katjav wrote:

Did I install the wrong libsamplerate? Got it from here (Secret Rabbit Hole):

http://www.mega-nerd.com/SRC/download.html
Katja

No, I don't think so .. have you looked in 'config.log'? Might be more info on the error there..

It could be something to do with pkg-config

How about setting the following environment variables:-

SAMPLERATE_CFLAGS and SAMPLERATE_LIBS that the pkg-config executable spews out :)

Offline

 

#18 2012-03-13 01:42:01

moog1
Member

Re: compiling aubio externals on mac os x 10.7

Are you there Katja? How are you getting on?

I hope you haven't given up .. have you got pkg-config installed?
[ http://www.freedesktop.org/wiki/Software/pkg-config ]

If you've got it installed, check whether you have a 'samplerate.pc'

When I run

Code:

pkg-config --libs --cflags samplerate

I get an output of -lsamplerate

Hope it helps..

Offline

 

#19 2012-03-13 11:53:20

katjav
Member

Re: compiling aubio externals on mac os x 10.7

Hi moog1, thanks for your support.

There's /sw/bin/pkg-config from Fink. The point is, I installed packages without Fink because Fink wouldn't compile stuff anymore. But with all files scattered around in different places it's a mess. Now installed a newer Xcode and trying to get Fink up and running again. Otherwise I'll upgrade to 10.6 one day.

Moog1, did you already check various pitch tracker methods in Aubio? In the Pd object the yin method is called but there are a few others.


Katja

Offline

 

#20 2012-03-13 18:48:57

moog1
Member

Re: compiling aubio externals on mac os x 10.7

katjav wrote:

..did you already check various pitch tracker methods in Aubio? In the Pd object the yin method is called but there are a few others.

Yes, I did .. not in great detail, but enough to inspire me to consider writing basspitch~
I also managed to get ALL of the methods working in PD by modifying the code. I have the aubio libs installed, and they're very good.
However, when I was writing basspitch~, I decided not to be dependent on any extra libraries outside of PD .. a few reasons .. duplicated code .. simplicity .. ease of compilation .. and so on

I was thinking of improving the interface, but am waiting to see if the author is going to do it ;)

Offline

 

#21 2012-03-13 21:02:17

katjav
Member

Re: compiling aubio externals on mac os x 10.7

moog1 wrote:

I was thinking of improving the interface, but am waiting to see if the author is going to do it ;)

You mean Aubio's API, or the Pd wrappers?

If you look at the aubio git, it seems that several people have contributed improvements lately. The Pd wrappers are rudimentary implementations, they could use improvement indeed.


Finally got fftw3 and libsamplerate built and installed with Fink. Aubio lib and aubio.pd_darwin build OK with aubio's build system.

Moog1, you're right it's better to have no dependencies for a Pd object. It seems that aubio has support for ooura fft now, I guess it can be linked statically and this could be an opportunity to build aubio for Pd without dependencies.


By the way, I do get plenty false pitch reports from [aubiopitch~]. It is a very rough implementation. Hmm. Moog1, could you share your rewrite?


Katja

Offline

 

#22 2012-03-14 01:29:47

moog1
Member

Re: compiling aubio externals on mac os x 10.7

katjav wrote:

By the way, I do get plenty false pitch reports from [aubiopitch~]. It is a very rough implementation. Hmm. Moog1, could you share your rewrite?

Mmm :)
If I remember rightly, the threshold wasn't working, amongst other things..

I found my modified aubiopitch~.c .. it compiles .. it still needs a bit more attention, but I found it useful for comparing the different algorithms/methods .. I've attached it below for you to browse / 'play with'


Attachments:
Attachment Icon aubiopitch~.c, Size: 4,966 bytes, Downloads: 143

Offline

 

#23 2012-03-14 09:48:07

katjav
Member

Re: compiling aubio externals on mac os x 10.7

Hi moog1,

Thanks for sharing your rewrite. With the threshold inlet it is now indeed possible to set an appropriate level for the yinfft method. It is not super responsive though. The fcomb and mcomb methods are extremely precise, even for high frequencies. But they do not react to the threshold. Smitt makes Pd crash.

Moog1, did you use elements or aspects of aubio for [basspitch~, or did you instead design your own solution because aubio did not work for your purpose?

Katja

Offline

 

#24 2012-03-14 11:37:51

moog1
Member

Re: compiling aubio externals on mac os x 10.7

katjav wrote:

did you use elements or aspects of aubio for [basspitch~, or did you instead design your own solution because aubio did not work for your purpose?

Katja

I started of by using schmitt ( wasn't crashing for me, but I might have changed something ), due to efficiency/speed, but ended up using fft/freq domain due to its excellent filtering properties .. and as PD already had 'mayerfft' , I got distracted from aubio ;)

Although you are experiencing difficulties, I still think that the aubio libs are good .. could always 'borrow' any code that seems useful/efficient.

I was using libsamplerate to downsample, but decided that a simple interpolation was sufficent/efficient .. I like simplicity, but normally end up compromising to some extent .. simple things are generally more stable, although C++ is reasonably foolproof, there are significant overheads!

Last edited by moog1 (2012-03-14 11:38:32)

Offline

 

#25 2012-03-14 12:05:56

katjav
Member

Re: compiling aubio externals on mac os x 10.7

moog1 wrote:

I still think that the aubio libs are good .. could always 'borrow' any code that seems useful/efficient.

The structure of aubiolib is decent and it's build system as well, it is the work of a professional. It is a pity that the Pd wrappers do not exploit the full power of the routines, but indeed aubiolib is a good source to test various detection methods. It is my wish to make a robust note-detector, and aubio's onset detection may put me on a track.

Katja

Offline

 
  • Index
  •  » extra~
  •  » compiling aubio externals on mac os x 10.7

Board footer

Powered by PunBB
Copyright 20022005 Rickard Andersson


pd.webring info