Building from source code with windows problem

Known Issues and Problems with BCI2000
Post Reply
lsegura003
Posts: 19
Joined: 07 Sep 2016, 20:03

Building from source code with windows problem

Post by lsegura003 » 07 Sep 2016, 20:20

Hello,

I followed this tutorial in order to compile a custom module:
http://www.bci2000.org/wiki/index.php/P ... ild_System

I wanted to build p3speller module from source code (without any changes)).

I downloaded VS 2012, executed build/Make VS2012 Project Files and followed the instructions in the CMD. (As i have visual studio 2012 installed)
After this i opened the BCI2000.sln with visual studio, selected the module i wanted (in this case application/P3speller), right clicked and built.

Then i went to prog directory, got the generated "p3speller.exe" and placed it with other core modules (i replaced original p3speller.exe). I then executed a .batch which used that module (P3Speller_signalgenerator.bat).

It all seemed to work, but when i clicked on set config i got an error related to ports:
2016-09-07T18:52:16 - SignalProcessing: ApplicationIP/Port parameters not available. 2016-09-07T18:52:16 - DataIOFilter::Preflight: Parameter "ApplicationIP" does not exist. 2016-09-07T18:52:36 - P3Speller: Connection to previous module timed out after 20s.

Afterwards i tried a similar thing but building 3 modules the same time. I built the 3 modules included in the P3Speller_signalgenerator.bat ( SignalGenerator, P3SignalProcessing and P3Speller ).
I got this error when i tried to set config after running the same .bat:
2016-09-07T19:10:32 - SignalGenerator: Next module's IP/Port parameters not available.
2016-09-07T19:10:32 - Operator set configuration
2016-09-07T19:10:32 - P3SignalProcessing: Next module's IP/Port parameters not available.
2016-09-07T19:10:32 - P3Speller: Next module's IP/Port parameters not available.
2016-09-07T19:10:32 - SignalSource confirmed new parameters ...
2016-09-07T19:10:32 - SignalGenerator: Lost connection to SignalProcessing: Unknown error state.
So, ¿What am i doing wrong? ¿Why do port parameters fail when i try to use a built module? The file i built was not modified from the original one (i just wanted to test if building process was correct).

pbrunner
Posts: 344
Joined: 17 Sep 2010, 12:43

Re: Building from source code with windows problem

Post by pbrunner » 08 Sep 2016, 10:21

lsegura003,

three ways to debug your issue:

1) Install the latest beta test binaries and run the same batch file to rule out that this is a firewall issue on your machine:
http://www.bci2000.org/phpbb/viewtopic.php?f=1&t=2955

2) Use the BCI2000Launcher to rule out that it is an error in the batch file.

3) If the first two avenues don't resolve your issue, send me a private email. I will then debug the issue on your machine using TeamViewer Quicksupport.

Regards, Peter

lsegura003
Posts: 19
Joined: 07 Sep 2016, 20:03

Re: Building from source code with windows problem

Post by lsegura003 » 13 Sep 2016, 13:42

Seems that this new binaries solve the thing for me (in a 64 bit windows 7), i will try it in other computers and OS. I tried to execute it with anti-virus and firewall deactivated before and still got the same problem with the previous version (3.0.5). I am making "inter version" stuff tough (putting a module compiled from 3.0.5 source into the beta version binaries) so i do not know if i will be able to make all the work i have planed this way.

Any idea what can be the root of the problem?

Anyway, thanks Peter. I guess i will stick to the beta version then.

pbrunner
Posts: 344
Joined: 17 Sep 2010, 12:43

Re: Building from source code with windows problem

Post by pbrunner » 13 Sep 2016, 16:46

lsegura003,

as the beta binaries work fine on your machine, can you please try to build BCI2000 as detailed under the section "BCI2000 v3.6 - source code - compile and debug instructions - December 10th, 2015" in the BCI2000 beta thread:
http://www.bci2000.org/phpbb/viewtopic.php?f=1&t=2955

Specifically, please make sure that you are using the most SVN trunk and that you have SP4 installed for VS2012.

Let me know if this resolves the issues.

Regards, Peter

lsegura003
Posts: 19
Joined: 07 Sep 2016, 20:03

Re: Building from source code with windows problem

Post by lsegura003 » 15 Sep 2016, 07:40

Have built the stuff with the beta version source and it seemed it all was OK (downloaded all necessary software for it). Problem comes when i try to execute a built module (unchanged, so code is not problem) with precompiled ones.


I built p3speller, which i run among precompiled signalgenerator and P3signal processing modules (using the P3Speller_SignalGenerator.batch).

I get this error in the system log each time:

2016-09-15T13:25:40 - SignalSource: SignalGenerator running.
2016-09-15T13:25:40 - SignalSource error, DataIOFilter::Process:
State "StimulusFrame" is inaccessible.
2016-09-15T13:25:40 - SignalSource error, DataIOFilter::Process:
Unhandled Win32 exception of type ACCESS_VIOLATION (0xc0000005)
Terminating SignalGenerator module.
2016-09-15T13:25:40 - SignalSource error:
Lost connection to SignalSource.

Funny thing is i did not touch signal source. This problem comes whenever i try to execute any built module with 3.6 version binaries (it does not matter if it comes from 3.0.5 version source code or 3.6 beta version source code).

So, if i try to execute a 3.0.5 built module in 3.0.5 version binaries i get this errors (just when i launch the .batch)

2016-09-07T18:52:16 - SignalProcessing: ApplicationIP/Port parameters not available.
2016-09-07T18:52:16 - DataIOFilter::Preflight: Parameter "ApplicationIP" does not exist.
2016-09-07T18:52:36 - P3Speller: Connection to previous module timed out after 20s.

If i try to execute a compiled module in 3.6 version i get this error (after setting configuration and clicking on "Start" button, so it goes a bit further).

Unhandled Win32 exception of type ACCESS_VIOLATION (0xc0000005)
Terminating SignalGenerator module.
2016-09-15T13:25:40 - SignalSource error:
Lost connection to SignalSource.

I am up to help with the beta version to see if we manage to go a bit further and solve building errors, but meanwhile, is there any BCI2000 version which i can use to check if the code i want to execute inside modules is correct? I am following tutorials step by step but the result i obtain seems to be problematic each time.


Additional information: To compile the 3.6 source code, what i did was :

1- Download tortoiseSVN
2-Uninstall cmake and install 3.3.2 version
3-Install visual studio 2012 update 4.
4- In cmd, i put "svn checkout (trunkDirectory) (Midirectory)
5- Execute MakeVS2012 Project Files.cmd and answer the questions (all Y except the framework one)
6- Open the resulting BCI2000.sln with VS2012, select "release" and build application/p3speller

7-Go to build\CMakeFiles\core\Application\P3Speller\Release ( the directory which VS2012 says) and get the p3speller.exe

8-Copy it in prog folder of x32, x64 BCI2000 3.6 binary folders. Replaces original p3speller.exe. I then execute the .batch in mencioned (independently, one after the other when the first one finishes) and get same errors with both.

pbrunner
Posts: 344
Joined: 17 Sep 2010, 12:43

Re: Building from source code with windows problem

Post by pbrunner » 15 Sep 2016, 18:01

lsegura003,

I think I now understand the issue that you are experiencing. To facilitate the new functionality of BCI2000 v3.6 we had to improve the binary communication protocol that facilitates the communication between the different BCI2000 modules. This however means, that you cannot mix and match 3.0.5 and 3.6 modules. I would suggest, that you re-compile any code you have only with the latest trunk. Let me know if this resolves the issue.

Regards, Peter

lsegura003
Posts: 19
Joined: 07 Sep 2016, 20:03

Re: Building from source code with windows problem

Post by lsegura003 » 15 Sep 2016, 18:44

I did, indeed.

Result was this:

Unhandled Win32 exception of type ACCESS_VIOLATION (0xc0000005)
Terminating SignalGenerator module.
2016-09-15T13:25:40 - SignalSource error:
Lost connection to SignalSource.


When i pushed "start" button.

pbrunner
Posts: 344
Joined: 17 Sep 2010, 12:43

Re: Building from source code with windows problem

Post by pbrunner » 16 Sep 2016, 10:06

lsegura003,

to summarize:

1) Compiling 3.0.5 source code fails as the download of the pre-compiled static QT4 libraries fails.
2) Compiling 3.0.5 source with external QT4 fails due to a cmake issue.
3) Compiling 3.6 source (svn trunk) works, but fails on execution.
4) Running the 3.6 source binaries from the beta works.

I assume that using 3.6 would be fine for you, so lets focus on getting this to work on your machine. To isolate the issue, please send me a dropbox or google drive link to your compiled binaries. I will see if I can run them on my machine. After that I can offer you to take a look at your machine through a remote session. For this you need to download and run TeamViewer Quick Support. We can arrange a time that is convenient for both of us and I can take a look once you send me the ID and PW for the TeamViewer session.

Regards, Peter

pbrunner
Posts: 344
Joined: 17 Sep 2010, 12:43

Re: Building from source code with windows problem

Post by pbrunner » 16 Sep 2016, 10:42

lsegura003,

one more thing. For the installed pre-compiled binaries from the v3.6 beta, can you please check whether both, 32 and 64 bit as well as bundled and non-bundled binaries work. This could help to isolate the issue.

Regards, Peter

lsegura003
Posts: 19
Joined: 07 Sep 2016, 20:03

Re: Building from source code with windows problem

Post by lsegura003 » 19 Sep 2016, 11:02

Ok, i have tried something different.


I built all the modules needed to run a test using the trunk source code, and seems now it is working.

I guess, that for the 3.6 my confusion came from here:

http://www.bci2000.org/wiki/index.php/P ... tart_Guide:
You probably do not need to build all of BCI2000 at once. To use BCI2000, the minimum you will need consists of the Operator, plus at least one SignalSource module, at least one SignalProcessing module, and at least one Application module. To build a single module in Visual C++ Express, right-click on the module's name in the list on the left, and select "Build". The initial build will typically take a few minutes per module. If you do not intend to modify a given module, you can always skip building it by copying the corresponding ready-built binary (for example, Operator.exe) from the prog subdirectory of a BCI2000 v.2 or v.3 binary distribution, and paste it into the corresponding directory of the distribution in which you are working, i.e. C:\BCI2000\3.x\prog . (To download the latest binary distribution, you will need to supply the same username and password that you used for SVN download.) Let's assume you have built, or copied, the following modules: SignalGenerator, SpectralSignalProcessing, CursorTask and Operator, as well as the necessary OperatorLib shared library. Test the modules, i.e. run C:\BCI2000\3.x\batch\CursorTask_SignalGenerator.bat .
You can not use a module built from trunk source among the 3.6 precompiled modules (for example, my problems came when i tried to use application/p3speller module which i built from trunk source code with 3.6 version precompiled binaries).

If i build p3signalprocessing, p3signalsource, p3speller, operator and operatorLib and execute them manually it seems to work.

Do you still want me to send my built binaries to check if you can make them work with 3.6 binaries?

pbrunner
Posts: 344
Joined: 17 Sep 2010, 12:43

Re: Building from source code with windows problem

Post by pbrunner » 19 Sep 2016, 11:06

lsegura003,

I am glad that this has resolve the issues. I would suggest that you re-compile your old modules with the trunk source code. Let me know if you run into issues with that.

Regards, Peter

Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests