Can 64-bit MATLAB be used with BCI2000?

This forum deals with BCI2000 configuration issues.
Locked
trentb
Posts: 8
Joined: 27 Jan 2009, 10:25

Can 64-bit MATLAB be used with BCI2000?

Post by trentb » 02 Nov 2009, 22:36

When I try to run MatlabSignalProcessing through the BCI2000 Launcher interface, I receive the following errors:

11/2/2009 10:27:43 PM - MatlabFilter::Constructor: Could not load library libeng:
.
11/2/2009 10:27:43 PM - MatlabFilter::Constructor: Could not connect to Matlab engine. Please make sure that Matlab is available on your machine.


Through some debugging, I can confirm that libeng.dll is being found in "C:\Program Files\MATLAB\R2007a\bin\win64". I surmise that the problem is that libeng.dll is a 64-bit DLL instead of a 32-bit DLL. Is there any workaround to this problem without installing a 32-bit version of MATLAB?

-Trent

gschalk
Posts: 615
Joined: 28 Jan 2003, 12:37

64 bit

Post by gschalk » 05 Nov 2009, 08:41

Hi,

I presume you could recompile the MatlabSignalProcessing with the 64 bit libraries. This should work. I do not see any other workaround.

Gerv

trentb
Posts: 8
Joined: 27 Jan 2009, 10:25

Re: 64 bit

Post by trentb » 17 Nov 2009, 17:10

I have been unsuccessful in invoking the 64-bit MATLAB engine, and believe I know the reason. The 64-bit libraries provided by MATLAB are only for Microsoft Visual C++, not Borland C++. Borland is not supported by the 64-bit version of MATLAB. I will revert back to a 32-bit system.

-Trent

gschalk
Posts: 615
Joined: 28 Jan 2003, 12:37

32-bit

Post by gschalk » 19 Nov 2009, 10:29

Trent,

At this point, it's probably wise to stay with XP-32. Just so you know, BCI2000 v3.0, which will be released next month and is already available on SVN, will also support VisualStudio.

Best,
Gerv

trentb
Posts: 8
Joined: 27 Jan 2009, 10:25

v3.0 Operator Build Errors

Post by trentb » 20 Nov 2009, 11:38

Gerv,

Thanks for the advice. Version 3.0 builds without error until it gets to VisDisplayGraph.cpp of Operator. I get the following errors related to the limits class. I have tried to include limits provided by QT, but I still get errors. Any advice on resolving these errors?

1>VisDisplayGraph.cpp
1>C:\BCI2000_v3.0\src\shared\gui\SignalDisplay.h(332) : warning C4099: 'SignalDisplay::PaintInfo' : type name first seen using 'class' now seen using 'struct'
1> C:\BCI2000_v3.0\src\shared\gui\SignalDisplay.h(276) : see declaration of 'SignalDisplay::PaintInfo'
1>..\..\..\..\src\core\Operator\OperatorQt\VisDisplayGraph.cpp(95) : error C2065: 'numeric_limits' : undeclared identifier
1>..\..\..\..\src\core\Operator\OperatorQt\VisDisplayGraph.cpp(95) : error C2275: 'size_t' : illegal use of this type as an expression
1> predefined C++ types (compiler internal)(19) : see declaration of 'size_t'
1>..\..\..\..\src\core\Operator\OperatorQt\VisDisplayGraph.cpp(95) : warning C4003: not enough actual parameters for macro 'max'
1>..\..\..\..\src\core\Operator\OperatorQt\VisDisplayGraph.cpp(95) : error C2589: '(' : illegal token on right side of '::'
1>..\..\..\..\src\core\Operator\OperatorQt\VisDisplayGraph.cpp(95) : error C2059: syntax error : '::'

Thanks,
-Trent

mellinger
Posts: 1097
Joined: 12 Feb 2003, 11:06

Post by mellinger » 20 Nov 2009, 12:29

Trent,

I committed a change that should fix the compilation error.

Regards,
Juergen

trentb
Posts: 8
Joined: 27 Jan 2009, 10:25

Re: v3.0 Operator Build Errors

Post by trentb » 20 Nov 2009, 12:49

Juergen,

Thanks for the change; however, I now get the following errors:

1>VisDisplayGraph.cpp
1>C:\BCI2000_v3.0\src\shared\gui\SignalDisplay.h(332) : warning C4099: 'SignalDisplay::PaintInfo' : type name first seen using 'class' now seen using 'struct'
1> C:\BCI2000_v3.0\src\shared\gui\SignalDisplay.h(276) : see declaration of 'SignalDisplay::PaintInfo'
1>..\..\..\..\src\core\Operator\OperatorQt\VisDisplayGraph.cpp(97) : warning C4003: not enough actual parameters for macro 'max'
1>..\..\..\..\src\core\Operator\OperatorQt\VisDisplayGraph.cpp(97) : error C2589: '(' : illegal token on right side of '::'
1>..\..\..\..\src\core\Operator\OperatorQt\VisDisplayGraph.cpp(97) : error C2059: syntax error : '::'

I don't know if this will make any difference, but I am using Visual C++ 2008.

-Trent

trentb
Posts: 8
Joined: 27 Jan 2009, 10:25

Fixed max error

Post by trentb » 20 Nov 2009, 15:31

Fixed it. The problem was that the compiler was getting "confused" between the macro max and the class member max defined in limits. I added the line

#define NOMINMAX

before every

#include <Windows.h>

and

#include "windows.h"

statement to disable the macro max. Surprisingly calls to the macros max and min do not return an error. I guess its able to find a definition of max and min somewhere without getting confused with the class member max in limits.

Trent

trentb
Posts: 8
Joined: 27 Jan 2009, 10:25

Post by trentb » 20 Nov 2009, 22:21

Unfortunately I still cannot invoke the 64-bit Matlab engine from a Visual C++ build. I do not think this is a BCI200 problem. I think it is a 64-bit Matlab problem.

-Trent

trentb
Posts: 8
Joined: 27 Jan 2009, 10:25

Resolution

Post by trentb » 25 Nov 2009, 22:07

I installed 32-bit MATLAB on my Windows XP 64 system. I then ran BCI2000 (the version from 'trunk', not the soon-to-be-released 3.0) with the MATLAB filter without any problem.

-Trent

Locked

Who is online

Users browsing this forum: No registered users and 1 guest