[FieldTrip] [multivariate] MEX compiling for 32-bit MATLAB under 64-bit Linux: who helps?

Sander Maijers S.N.Maijers at student.ru.nl
Wed May 25 11:50:16 CEST 2011

Dear readers,

I am running MATLAB R2011a 32-bit under Ubuntu Linux 10.10 64-bit (Linux thuisrekenaar 2.6.35-28-generic #50-Ubuntu SMP Fri Mar 18 18:42:20 UTC 2011 x86_64 GNU/Linux).

When I call "ft_timelockstatistics()" with "cfg.mva ={ft_mv_standardizer() ft_mv_svm()};"

It fails:

"selected 60 channels
selected 351 time bins
selected 1 frequency bins
using "statistics_crossvalidate" for the statistical testing
initializing random number generator with seed 1
validating 1 dataset(s)
input 1 consists of 439 examples and 21060 features
output 1 consists of 439 examples and 1 features
validating using 5-fold cross-validation
using 5 folds for 1 datasets
dataset 1: validating fold 1 of 5 using 351 training samples and 88 test samples Compiling tprod for first use
/usr/bin/ld: skipping
incompatible /usr/lib/gcc/x86_64-linux-gnu/4.3.5/libstdc++.so when searching for -lstdc++ /usr/bin/ld: skipping
incompatible /usr/lib/gcc/x86_64-linux-gnu/4.3.5/libstdc++.a when searching for -lstdc++ /usr/bin/ld: skipping
incompatible /usr/lib/gcc/x86_64-linux-gnu/4.3.5/libstdc++.so when searching for -lstdc++ /usr/bin/ld: skipping
incompatible /usr/lib/gcc/x86_64-linux-gnu/4.3.5/libstdc++.a when searching for -lstdc++ /usr/bin/ld:
	cannot find -lstdc++ collect2: ld returned 1 exit status

mex: link of ' "tprod.mexglx"' failed.

??? Error using ==> tprod at 132 unable to compile MEX version of '/mnt/data1/0/9/data/software/UNIX/scientific/FieldTrip/bin/fieldtrip-read-only/multivariate/external/farquhar/tprod/tprod', please make sure your MEX compiler is set up correctly (try 'mex -setup')."

I have followed the instructions on
https://help.ubuntu.com/community/MATLAB#MEX functions to enable MEX compiling but it was not successful.

-> Before I singlehandedly bring my operating system configuration into disarray, I would like to learn from you the following. Do you know of ways to use a gcc to compile code written for a 32-bit architecture ona 64-bit machine? Or if necessary another compiler that works under Linux?
-> If such a thing is certainly impossible, are there ways to avoid MEX compiling? Or could someone provide precompiled MEX files that would suit my configuration?

[*] I have installed the Ubuntu package "ia32-libs" (version 20090808ubuntu9.1)
[*] It seems that the only thing I need is 32-bit binaries for libstdc++. Perhaps I can introduce these in some creative way, but I would like to check with you all first.

I hope you are willing to help me. As a novice to FieldTrip and even MATLAB, I have encountered many obstacles but I am determined to surmount them.

Kind regards,
Sander Maijers (BA Linguistics student)

More information about the fieldtrip mailing list