Request for help compiling mex files: Linux a64 matlab R2008a

56 views
Skip to first unread message

Brian Miller

unread,
Jun 25, 2008, 6:56:02 PM6/25/08
to xbat-devel
Hi all,

Just wondering if anyone has managed to get xbat to compile for 64-bit
linux. I've had a quick attempt by running "build_all.m" in PRE_5, -
devel, and -heart branches, but it seems that there is a problem
linking all of the mex files. The general error goes something like:
----
/usr/bin/ld: sound_read_.o: relocation R_X86_64_32 against `a local
symbol' can not be used when making a shared object; recompile with -
fPIC
sound_read_.o: could not read symbols: Bad value
collect2: ld returned 1 exit status

mex: link of ' "sound_read_.mexa64"' failed.

Warning: one or more files failed to build
----

I'm afraid the error message doesn't mean anything to me. Any
suggestions?

Cheers,
Brian

Mike Pitzrick

unread,
Jun 25, 2008, 9:20:33 PM6/25/08
to xbat-...@googlegroups.com
Howdy,

I'm also interested in getting XBAT to run on 64-bit MATLAB in Windows XP Professional x64 Edition.

We've been experimenting and found that XBAT runs about twice as fast in 32-bit MATLAB in XP Pro x64 (64-bit operating system) compared to 32-bit MATLAB in XP Pro (32-bit operating system). Our current thinking is that the increased speed in the 64-bit OS is due to x64's ability to access more RAM, even when running 32-bit applications (our x64 system has 8 GB RAM installed). At any rate, we are planning to start switching our 10 computers that are enabled for 64-bit to 64-bit OS in a week or two.

I can only imagine that XBAT would run even faster if it could run in 64-bit MATLAB.

-Mike
--
Truth never comes into the world but like a bastard, to the ignominy of him that brought her birth. --John Milton (1608-1674)

Matt Robbins

unread,
Jun 25, 2008, 11:11:59 PM6/25/08
to xbat-...@googlegroups.com
Hi Brian,

I'm afraid we haven't gotten around to trying out the build process
on 64-bit systems yet. I don't have the code in front of me right now
for both versions, but in the heart branch, Core/Build/build_mex.m
lets you specify additional CFLAGS arguments to the compiler, which
would allow you to pass the '-fPIC' argument that gcc is looking for.
I don't really know if this will resolve the problem, but you might
try editing the source for that file, and changing the default
options:

if nargin < 3

opt.prefix = libs_root(); opt.cflags = ''; opt.ldflags = '';
opt.outname = ''; opt.verbose = 0;

end

to this

if nargin < 3

opt.prefix = libs_root(); opt.cflags = '-fPIC'; opt.ldflags = '';
opt.outname = ''; opt.verbose = 0;

end

Since I'm not running a 64-bit kernel, I can't really verify this, but
it's worth a try. Please let us know either way.

-Matt

On Wed, Jun 25, 2008 at 6:56 PM, Brian Miller <bria...@gmail.com> wrote:
>

Brian Miller

unread,
Jul 2, 2008, 5:30:30 AM7/2/08
to xbat-devel
Hi Matt,

Thanks for your response.

On Jun 26, 3:11 pm, "Matt Robbins" <matthew.robb...@gmail.com> wrote:
> Hi Brian,
>
>   I'm afraid we haven't gotten around to trying out the build process
> on 64-bit systems yet.  I don't have the code in front of me right now
> for both versions, but in the heart branch, Core/Build/build_mex.m
> lets you specify additional CFLAGS arguments to the compiler, which
> would allow you to pass the '-fPIC' argument that gcc is looking for.
> I don't really know if this will resolve the problem, but you might
> try editing the source for that file, and changing the default
> options:
>
> if nargin < 3
>
>    opt.prefix = libs_root(); opt.cflags = ''; opt.ldflags = '';
> opt.outname = ''; opt.verbose = 0;
>
> end
>
> to this
>
> if nargin < 3
>
>    opt.prefix = libs_root(); opt.cflags = '-fPIC'; opt.ldflags = '';
> opt.outname = ''; opt.verbose = 0;
>
> end
>

That seemed to help and some of the modules compiled, but not all of
them.

Also the ones that did compile that I tested (libsndfile) just seemed
to cause Matlab to hang. I'm away for a few weeks, but I'll take
another look at it and post details when I get back.

> Since I'm not running a 64-bit kernel, I can't really verify this, but
> it's worth a try. Please let us know either way.
>
> -Matt
>

Brian Miller

unread,
Aug 26, 2008, 4:25:28 PM8/26/08
to xbat-devel
Just an update to let you know I've given up for the moment. While I
believe most of the vital modules did compile and xbat would startup
(splash screen, main library window) with no serious errors, but
matlab would crash when I attempted to load an audio file (I tried
both wav and flac).

My uninformed suggestion would be explicit modularization of xbat.
Perhaps the MEX routines, especially libsndfile, sqlite, spectrogram,
etc. could be split into independent subprojects. The benefits of this
would include: lower barrier of entry for hacking, possibility of
using other routines (builtin matlab routines, matlab toolboxes) when
mex fail to compile or are not desired. As you can tell for me the
benefits of xbat are the mex libraries, rather than the GUI.

Since most of my application is independent of xbat code I've decided
to revert to generic builtin replacements. I'm happy to help in the
future if you need someone to test xbat for 64bit linux.

Cheers,
Brian
Reply all
Reply to author
Forward
0 new messages