[aubio-user] Can not compile java-aubio wrappers on Mac OSX 10.8.5

Martin Pernollet martin.pernollet at gmail.com
Sat Sep 13 15:31:38 CEST 2014


Solved! I can push the required changes.

the failing command :

/bin/sh ./libtool  --tag=CC   --mode=compile gcc
-DPACKAGE_NAME=\"java-aubio\" -DPACKAGE_TARNAME=\"java-aubio\"
-DPACKAGE_VERSION=\"0.2\" -DPACKAGE_STRING=\"java-aubio\ 0.2\"
-DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DSTDC_HEADERS=1
-DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1
-DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1
-DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_DLFCN_H=1 -DLT_OBJDIR=\".libs/\"
-I.   -I/System/Library/Frameworks/JavaVM.framework/Versions/A/Headers/
-I/usr/local/Cellar/aubio/0.4.1/include  -Wno-strict-aliasing
-I/usr/lib/jvm/java-6-sun-1.6.0.04/include
-I/usr/local/lib/jvm/java-6-sun-1.6.0.04/include
-I/usr/lib/jvm/java-6-sun-1.6.0.04/include/linux
-I/usr/local/lib/jvm/java-6-sun-1.6.0.04/include/linux -I/usr/include
-I/usr/local/include -g -O2 -MT aubio_wrap.lo -MD -MP -MF
.deps/aubio_wrap.Tpo -c -o aubio_wrap.lo aubio_wrap.c

libtool: compile:  gcc -DPACKAGE_NAME=\"java-aubio\"
-DPACKAGE_TARNAME=\"java-aubio\" -DPACKAGE_VERSION=\"0.2\"
"-DPACKAGE_STRING=\"java-aubio 0.2\"" -DPACKAGE_BUGREPORT=\"\"
-DPACKAGE_URL=\"\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1
-DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1
-DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1
-DHAVE_DLFCN_H=1 -DLT_OBJDIR=\".libs/\" -I.
-I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/System/Library/Frameworks/JavaVM.framework/Versions/A/Headers
*-I/usr/local/Cellar/aubio/0.4.1/include* -Wno-strict-aliasing
-I/usr/lib/jvm/java-6-sun-1.6.0.04/include
-I/usr/local/lib/jvm/java-6-sun-1.6.0.04/include
-I/usr/lib/jvm/java-6-sun-1.6.0.04/include/linux
-I/usr/local/lib/jvm/java-6-sun-1.6.0.04/include/linux -I/usr/include
-I/usr/local/include -g -O2 -MT aubio_wrap.lo -MD -MP -MF
.deps/aubio_wrap.Tpo -c aubio_wrap.c  -fno-common -DPIC -o
.libs/aubio_wrap.o

looking at /usr/local/Cellar/aubio/0.4.1/include/aubio/aubio.h
...
fvec_t * new_fvec(uint_t length);
...

While the generated aubio_wrap.c tries to call :

SWIGEXPORT jlong JNICALL Java_aubiowrapperJNI_new_1fvec(JNIEnv *jenv,
jclass jcls, jlong jarg1, jlong jarg2) {
  jlong jresult = 0 ;
  uint_t arg1 ;
  uint_t arg2 ;
  fvec_t *result = 0 ;

  (void)jenv;
  (void)jcls;
  arg1 = (uint_t)jarg1;
  arg2 = (uint_t)jarg2;
*  result = (fvec_t *)new_fvec(arg1,arg2);*
  *(fvec_t **)&jresult = result;
  return jresult;
}

So I fixed the build by removing all uint_t channels arguments in aubio.i
(see below)

Also needed to erase all generated files and run autoreconf --install



%module aubiowrapper

%{
#include <aubio/aubio.h>
%}

/* type aliases */
typedef unsigned int uint_t;
typedef int sint_t;
typedef float smpl_t;

/* fvec */
fvec_t * new_fvec(uint_t length);//, uint_t channels);
void del_fvec(fvec_t *s);
smpl_t fvec_read_sample(fvec_t *s, uint_t channel, uint_t position);
void fvec_write_sample(fvec_t *s, smpl_t data, uint_t channel, uint_t
position);
smpl_t * fvec_get_channel(fvec_t *s);//, uint_t channel);
void fvec_put_channel(fvec_t *s, smpl_t * data, uint_t channel);
smpl_t ** fvec_get_data(fvec_t *s);

/* cvec */
cvec_t * new_cvec(uint_t length);//, uint_t channels);
void del_cvec(cvec_t *s);
void cvec_write_norm(cvec_t *s, smpl_t data, uint_t channel, uint_t
position);
void cvec_write_phas(cvec_t *s, smpl_t data, uint_t channel, uint_t
position);
smpl_t cvec_read_norm(cvec_t *s, uint_t channel, uint_t position);
smpl_t cvec_read_phas(cvec_t *s, uint_t channel, uint_t position);
void cvec_put_norm_channel(cvec_t *s, smpl_t * data, uint_t channel);
void cvec_put_phas_channel(cvec_t *s, smpl_t * data, uint_t channel);
smpl_t * cvec_get_norm_channel(cvec_t *s, uint_t channel);
smpl_t * cvec_get_phas_channel(cvec_t *s, uint_t channel);
smpl_t ** cvec_get_norm(cvec_t *s);
smpl_t ** cvec_get_phas(cvec_t *s);


/* fft */
aubio_fft_t * new_aubio_fft(uint_t size);//, uint_t channels);
void del_aubio_fft(aubio_fft_t * s);
void aubio_fft_do (aubio_fft_t *s, fvec_t * input, cvec_t * spectrum);
void aubio_fft_rdo (aubio_fft_t *s, cvec_t * spectrum, fvec_t * output);
void aubio_fft_do_complex (aubio_fft_t *s, fvec_t * input, fvec_t *
compspec);
void aubio_fft_rdo_complex (aubio_fft_t *s, fvec_t * compspec, fvec_t *
output);
void aubio_fft_get_spectrum(fvec_t * compspec, cvec_t * spectrum);
void aubio_fft_get_realimag(cvec_t * spectrum, fvec_t * compspec);
void aubio_fft_get_phas(fvec_t * compspec, cvec_t * spectrum);
void aubio_fft_get_imag(cvec_t * spectrum, fvec_t * compspec);
void aubio_fft_get_norm(fvec_t * compspec, cvec_t * spectrum);
void aubio_fft_get_real(cvec_t * spectrum, fvec_t * compspec);

/* filter */
aubio_filter_t * new_aubio_filter(uint_t order);//, uint_t channels);
void aubio_filter_do(aubio_filter_t * b, fvec_t * in);
void aubio_filter_do_outplace(aubio_filter_t * b, fvec_t * in, fvec_t *
out);
void aubio_filter_do_filtfilt(aubio_filter_t * b, fvec_t * in, fvec_t *
tmp);
void del_aubio_filter(aubio_filter_t * b);

/* a_weighting */
aubio_filter_t * new_aubio_filter_a_weighting ( uint_t samplerate);
/*uint_t channels,*/
uint_t aubio_filter_set_a_weighting (aubio_filter_t * b, uint_t samplerate);

/* c_weighting */
aubio_filter_t * new_aubio_filter_c_weighting ( uint_t samplerate);
/*uint_t channels,*/
uint_t aubio_filter_set_c_weighting (aubio_filter_t * b, uint_t samplerate);

/* biquad */
aubio_filter_t * new_aubio_filter_biquad(lsmp_t b1, lsmp_t b2, lsmp_t b3,
lsmp_t a2, lsmp_t a3);//, uint_t channels);
uint_t aubio_filter_set_biquad (aubio_filter_t * b, lsmp_t b1, lsmp_t b2,
lsmp_t b3, lsmp_t a2, lsmp_t a3);

/* mathutils */
fvec_t * new_aubio_window(char * wintype, uint_t size);
smpl_t aubio_unwrap2pi (smpl_t phase);
smpl_t aubio_bintomidi(smpl_t bin, smpl_t samplerate, smpl_t fftsize);
smpl_t aubio_miditobin(smpl_t midi, smpl_t samplerate, smpl_t fftsize);
smpl_t aubio_bintofreq(smpl_t bin, smpl_t samplerate, smpl_t fftsize);
smpl_t aubio_freqtobin(smpl_t freq, smpl_t samplerate, smpl_t fftsize);
smpl_t aubio_freqtomidi(smpl_t freq);
smpl_t aubio_miditofreq(smpl_t midi);
uint_t aubio_silence_detection(fvec_t * ibuf, smpl_t threshold);
smpl_t aubio_level_detection(fvec_t * ibuf, smpl_t threshold);
smpl_t aubio_zero_crossing_rate(fvec_t * input);

/* mfcc */
aubio_mfcc_t * new_aubio_mfcc (uint_t win_s, uint_t samplerate, uint_t
n_filters, uint_t n_coefs);
void del_aubio_mfcc(aubio_mfcc_t *mf);
void aubio_mfcc_do(aubio_mfcc_t *mf, cvec_t *in, fvec_t *out);

/* pvoc */
aubio_pvoc_t * new_aubio_pvoc (uint_t win_s, uint_t hop_s);//, uint_t
channels);
void del_aubio_pvoc(aubio_pvoc_t *pv);
void aubio_pvoc_do(aubio_pvoc_t *pv, fvec_t *in, cvec_t * fftgrain);
void aubio_pvoc_rdo(aubio_pvoc_t *pv, cvec_t * fftgrain, fvec_t *out);

/* pitch detection */
aubio_pitch_t *new_aubio_pitch (char *pitch_mode,
    uint_t bufsize, uint_t hopsize,  uint_t samplerate); /*uint_t
channels,*/
void aubio_pitch_do (aubio_pitch_t * p, fvec_t * ibuf, fvec_t * obuf);
uint_t aubio_pitch_set_tolerance(aubio_pitch_t *p, smpl_t thres);
uint_t aubio_pitch_set_unit(aubio_pitch_t *p, char * pitch_unit);
void del_aubio_pitch(aubio_pitch_t * p);

/* tempo */
aubio_tempo_t * new_aubio_tempo (char_t * mode,
    uint_t buf_size, uint_t hop_size, uint_t samplerate); // uint_t
channels,
void aubio_tempo_do (aubio_tempo_t *o, fvec_t * input, fvec_t * tempo);
uint_t aubio_tempo_set_silence(aubio_tempo_t * o, smpl_t silence);
uint_t aubio_tempo_set_threshold(aubio_tempo_t * o, smpl_t threshold);
smpl_t aubio_tempo_get_bpm(aubio_tempo_t * bt);
smpl_t aubio_tempo_get_confidence(aubio_tempo_t * bt);
void del_aubio_tempo(aubio_tempo_t * o);




2014-09-13 14:15 GMT+02:00 Martin Pernollet <martin.pernollet at gmail.com>:

> Hi,
>
> Thanks for sharing this great framework!
>
> I am trying to build java-aubio on MacOSX (10.8.5).
>
> While running make, there are build error such as :
> aubio_wrap.c: In function 'Java_aubiowrapperJNI_new_1fvec':
> aubio_wrap.c:207: error: too many arguments to function 'new_fvec'
> *(see full error stack at end of mail)*
>
> Here were my steps to prepare the build :
>
> *Get latest binaries*
> $ brew install aubio
> ==> Downloading
> https://downloads.sf.net/project/machomebrew/Bottles/aubio-0.4.1.mountain_lion.bottle.tar.gz
> ########################################################################
> 100,0%
> ==> Pouring aubio-0.4.1.mountain_lion.bottle.tar.gz
>   /usr/local/Cellar/aubio/0.4.1: 61 files, 808K
>
>
> *Make jni.h be visible to gcc*
> $ export
> CPPFLAGS=-I/System/Library/Frameworks/JavaVM.framework/Versions/A/Headers/
>
> NOTE : this step should be mentioned in the read me. I can commit an
> update if you want.
>
> *I also tried other jni.h folders listed with*
> $ locate jni.h
>
> /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/System/Library/Frameworks/JavaVM.framework/Versions/A/Headers/jni.h
>
> /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/System/Library/Frameworks/JavaVM.framework/Versions/A/Headers/jni.h
> /System/Library/Frameworks/JavaVM.framework/Versions/A/Headers/jni.h
>
> *Build*
> $ ./configure && make
>
> And got this build error. Do you have any suggestions?
>
> Thanks in advance for your help!
>
> Martin
>
> aubio_wrap.c: In function 'Java_aubiowrapperJNI_new_1fvec':
> aubio_wrap.c:207: error: too many arguments to function 'new_fvec'
> aubio_wrap.c: In function 'Java_aubiowrapperJNI_fvec_1get_1channel':
> aubio_wrap.c:267: warning: cast to pointer from integer of different size
> aubio_wrap.c: In function 'Java_aubiowrapperJNI_new_1cvec':
> aubio_wrap.c:311: error: too many arguments to function 'new_cvec'
> aubio_wrap.c: In function 'Java_aubiowrapperJNI_cvec_1get_1norm_1channel':
> aubio_wrap.c:433: warning: cast to pointer from integer of different size
> aubio_wrap.c: In function 'Java_aubiowrapperJNI_cvec_1get_1phas_1channel':
> aubio_wrap.c:449: warning: cast to pointer from integer of different size
> aubio_wrap.c: In function 'Java_aubiowrapperJNI_cvec_1get_1norm':
> aubio_wrap.c:463: warning: cast to pointer from integer of different size
> aubio_wrap.c: In function 'Java_aubiowrapperJNI_cvec_1get_1phas':
> aubio_wrap.c:477: warning: cast to pointer from integer of different size
> aubio_wrap.c: In function 'Java_aubiowrapperJNI_new_1aubio_1fft':
> aubio_wrap.c:493: error: too many arguments to function 'new_aubio_fft'
> aubio_wrap.c: In function 'Java_aubiowrapperJNI_new_1aubio_1filter':
> aubio_wrap.c:647: error: too many arguments to function 'new_aubio_filter'
> aubio_wrap.c: In function
> 'Java_aubiowrapperJNI_new_1aubio_1filter_1a_1weighting':
> aubio_wrap.c:713: error: too many arguments to function
> 'new_aubio_filter_a_weighting'
> aubio_wrap.c: In function
> 'Java_aubiowrapperJNI_new_1aubio_1filter_1c_1weighting':
> aubio_wrap.c:745: error: too many arguments to function
> 'new_aubio_filter_c_weighting'
> aubio_wrap.c: In function
> 'Java_aubiowrapperJNI_new_1aubio_1filter_1biquad':
> aubio_wrap.c:815: error: too many arguments to function
> 'new_aubio_filter_biquad'
> aubio_wrap.c: In function 'Java_aubiowrapperJNI_new_1aubio_1pvoc':
> aubio_wrap.c:1112: error: too many arguments to function 'new_aubio_pvoc'
> aubio_wrap.c: In function 'Java_aubiowrapperJNI_new_1aubio_1pitch':
> aubio_wrap.c:1176: error: too many arguments to function 'new_aubio_pitch'
> aubio_wrap.c: In function 'Java_aubiowrapperJNI_new_1aubio_1tempo':
> aubio_wrap.c:1260: error: too many arguments to function 'new_aubio_tempo'
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.aubio.org/pipermail/aubio-user/attachments/20140913/d3a48bfb/attachment-0001.html>


More information about the aubio-user mailing list