labstreaminglayer / App-BioSemi

3 stars 4 forks source link

CMake build not working #1

Open cboulay opened 5 years ago

cboulay commented 5 years ago

Hi @mgrivich ,

On Slack, Kana Okano is trying to get a LSL system up and running including Unity, python events, and BioSemi. I tried building the BioSemi app because we don't have one on the release page, but I can't get the cmake build to work (VS2017, using in-app cmake settings).

The first error I'm encountering is that it "cannot open include file ioctls.h". A very quick google suggests this is used in mingw builds. Is that what's going on here?

cboulay commented 5 years ago

Also just discovered that Kana's biosemi acquisition PC is running 32-bit Windows, so my build system won't work anyway. Does anyone know if BioSemi requires a 32-bit Windows box?

mgrivich commented 5 years ago

I used the original version of the BioSemi LSL app on windows, but I wasn't involved with the app development. My memory is that it was compiled with VS 2008, so references to mingw are probably incorrect (though it was possible that it was ported at some point without my knowledge).

The tests I describe at https://sccn.ucsd.edu/~mgrivich/Synchronization.html used the original BioSemi app and were run on windows 7 64 bit.

cboulay commented 5 years ago

@mgrivich OK thanks for the info. I advised Kana to use the app from the ftp. Even if I were able to quickly fix the probably-arch-independent build problems, I don't have the time to setup a 32-bit build system right now (need to get Qt and boost) so there's no point.

dmedine commented 5 years ago

The binary on the ftp comes with a zipfile with the biosemi drivers for both 32 and 64 bit architectures. These are also available on the BioSemi website. The ioctls.h comes from the subfolder called DLL and the source code for the BioSemi/labview interface. I don't see any reference to this in the app's project settings in VisualStudio2008, so I think if you can get CMake to ignore this (maybe just delete it) you can cmake it with the setup you already have.

Unfortunately, I'm qt-less these days or I could build the project and double check that this is definitely going un-referenced, but I'm pretty sure this is the case. If Kana needs the labview bit (to check impedences and signal quality) they should be able to get this directly from BioSemi.

kirpi-1 commented 3 years ago

I'm trying to build this from source for Windows 10, I've got the open source version of Qt5 installed as well as boost. I've used cmake-gui and Visual Studio 2017 and got it to generate a solution file, but I also encountered the "cannot open source file 'ioctls.h'" problem in labview_dll.cpp. It looks like it is needed for building labview.dll? I got some hints from https://www.biosemi.nl/forum/viewtopic.php?t=823 but got stuck. It now complains that I'm missing a ';' before '__cdecl' in labview_dll.h for each of the lines starting with LABVIEW_DLL_API, such as:

LABVIEW_DLL_API HANDLE LINKAGE OPEN_DRIVER_ASYNC(void);

as well as returning:

Error C4430 missing type specifier - int assumed. Note: C++ does not support default-int

for each of those lines as well. I suspect the true error is elsewhere. For context, LABVIEW_DLL_API is #defined as declspec(dllexport), LINKAGE is #defined as cdecl, HANDLE #defined as void* and BOOL #defined as int.

I've learned that all versions of ActiveView are supposed to come with labview_dll, although for Windows 10 there's no driver needed. I did, however, download a copy of the Windows 7 drivers which does include labview_dll.dll, but it is for firmware version <4.0. I don't know if that helps me or not though. I'm not well-versed with cmake or Visual Studio, is there a way to make it link to this precompiled DLL instead of trying to build it?

dmedine commented 3 years ago

I don't think the CMakeLists file in this project is configured correctly for Windows. If memory serves, ioctls.h is a linux header and shouldn't be part of a Windows build at all. I also don't think that the labview_DLL files should be compiled as part of this process. This is biosemi's code (https://github.com/labstreaminglayer/App-BioSemi/blob/ba24af190b24631a5e239eaff19b8ddae948a252/DLL/labview_dll.cpp#L17) and rightfully shouldn't even be in this repository at all (neither should the dlls that are in there). You do need to link to this library in order to build and run the app, but you shouldn't have to compile it. It should come from biosemi.

If you don't want to muck about with CMake, you could try to create your own visual studio project in VS2019 (there is a free version). It is not a huge project, so it isn't that much work to configure it by hand.

Also, I just grabbed the old version off the ftp (ftp://sccn.ucsd.edu/pub/software/LSL/Apps) and it worked fine on my Windows 10 machine. You may not need to build it at all.

kirpi-1 commented 3 years ago

Thanks for the quick reply! I tried making my own VS project but got stuck with the QT dependencies, I ended up just grabbing the old version from the ftp as well. I hadn't known about the ftp server, thanks for letting me know it exists. For my own knowledge I'll look at the build files there to see how it's supposed to be set up.

In any case, the old version appeared to link up correctly to the amp and it made a network stream visible via labrecorder, so I think it works.