studio icon indicating copy to clipboard operation
studio copied to clipboard

[WIP] Update Brainflow

Open Andrey1994 opened this issue 3 years ago • 7 comments

Changes:

  • updated brainflow manually and updated vs solution(tested, works). It adds support for more devices
  • blacklisted some of devices which are currently in dev state
  • tried to update makefiles(had to replace it to tabs, make had some problems with spaces, sorry it makes it harder to review, but its in its own commit, so its more or less isolated)

@dioptre @cyberjunk could you take a look at makefiles? It does smth weird and I am still trying to understand whats wrong

P.S. Update process is extremely complicated, all files should be copypasted manually and one after another, update in build systems also should be done manually and it takes a lot of time, especially in old makefiles.

Andrey1994 avatar Mar 05 '22 20:03 Andrey1994

fixed, some folders for build files should be created manually

Tested it only on windows and not for all new boards

Andrey1994 avatar Mar 08 '22 13:03 Andrey1994

@cyberjunk should be fixed now, I removed some files

Andrey1994 avatar Mar 20 '22 17:03 Andrey1994

(1) README done, added

(2) LICENSE its mit

(3) PREBUILT SimpleBLE has its own build system(cmake) and CMakeLists there is pretty complex, also its in early stage of development and is updated often. Droping its own build system and trying to replicate it will lead to errors and each update will take a lot of time and efforts. I think we should keep it as prebuilt library.

Also, linking simpleble statically or trying to compile it will limit OSes supported, because it requires newer windows\macos. Adding special flag to enable\disable it will make update process even more complex.

(4) QT/OTHER BLUETOOTH SimpleBLE is used only by brainflow and there is no QT Bluetooth. This code is loaded manually in runtime wo linking and only for selected boards. So, there should not be any conflicts here

Andrey1994 avatar Mar 27 '22 14:03 Andrey1994

and I still think that it would be better to add brainflow as a precompiled libs or at least compile it by invoking cmake command It should not take so much time to update dependency

Andrey1994 avatar Mar 27 '22 14:03 Andrey1994

@Andrey1994 I'm getting an error when building on Mac. Any idea what the issue could be? I've run make clean and make -j 4 in the deps/build/make folder and then in the build/make folder.

Here's the output:

/board_controller -I../../deps/include/brainflow/utils  -c ../../src/Engine/Devices/Emotiv/EmotivEPOCDevice.cpp -o obj/x64/Engine/Devices/Emotiv/EmotivEPOCDevice.o
clang++ -m64 -target x86_64-apple-darwin19.2.0 -mtune=intel -msse -msse2 -msse3 -mssse3 -Xclang -flto-visibility-public-std -std=c++17 -O3 -fpic -mmacosx-version-min=10.12 -D_SILENCE_CXX17_OLD_ALLOCATOR_MEMBERS_DEPRECATION_WARNING -Wno-deprecated-declarations -DUNICODE -DNDEBUG -Wno-unknown-warning-option -DNEUROMORE_PLATFORM_OSX -I../../include/Engine -I../../src/Engine -I../../deps/include -I../../deps/include/brainflow/board_controller -I../../deps/include/brainflow/utils  -c ../../src/Engine/Devices/Emotiv/EmotivInsightDevice.cpp -o obj/x64/Engine/Devices/Emotiv/EmotivInsightDevice.o
In file included from ../../src/Engine/Devices/BrainFlow/BrainFlowDevices.cpp:25:
In file included from ../../src/Engine/Devices/BrainFlow/BrainFlowDevices.h:33:
../../deps/include/brainflow/cpp-package/board_shim.h:15:10: fatal error: 'json.hpp' file not found
#include "json.hpp"
         ^~~~~~~~~~
clang++ -m64 -target x86_64-apple-darwin19.2.0 -mtune=intel -msse -msse2 -msse3 -mssse3 -Xclang -flto-visibility-public-std -std=c++17 -O3 -fpic -mmacosx-version-min=10.12 -D_SILENCE_CXX17_OLD_ALLOCATOR_MEMBERS_DEPRECATION_WARNING -Wno-deprecated-declarations -DUNICODE -DNDEBUG -Wno-unknown-warning-option -DNEUROMORE_PLATFORM_OSX -I../../include/Engine -I../../src/Engine -I../../deps/include -I../../deps/include/brainflow/board_controller -I../../deps/include/brainflow/utils  -c ../../src/Engine/Devices/eSense/eSenseSkinResponseDevice.cpp -o obj/x64/Engine/Devices/eSense/eSenseSkinResponseDevice.o
In file included from ../../src/Engine/Devices/BrainFlow/BrainFlowNodes.cpp:1:
In file included from ../../src/Engine/Devices/BrainFlow/BrainFlowNodes.h:31:
In file included from ../../src/Engine/Devices/BrainFlow/BrainFlowDevices.h:33:
../../deps/include/brainflow/cpp-package/board_shim.h:15:10: fatal error: 'json.hpp' file not found
#include "json.hpp"
         ^~~~~~~~~~
clang++ -m64 -target x86_64-apple-darwin19.2.0 -mtune=intel -msse -msse2 -msse3 -mssse3 -Xclang -flto-visibility-public-std -std=c++17 -O3 -fpic -mmacosx-version-min=10.12 -D_SILENCE_CXX17_OLD_ALLOCATOR_MEMBERS_DEPRECATION_WARNING -Wno-deprecated-declarations -DUNICODE -DNDEBUG -Wno-unknown-warning-option -DNEUROMORE_PLATFORM_OSX -I../../include/Engine -I../../src/Engine -I../../deps/include -I../../deps/include/brainflow/board_controller -I../../deps/include/brainflow/utils  -c ../../src/Engine/Devices/eemagine/eemagineDevices.cpp -o obj/x64/Engine/Devices/eemagine/eemagineDevices.o
1 error generated.
make[1]: *** [obj/x64/Engine/Devices/BrainFlow/BrainFlowDevices.o] Error 1
make[1]: *** Waiting for unfinished jobs....
1 error generated.
make[1]: *** [obj/x64/Engine/Devices/BrainFlow/BrainFlowNodes.o] Error 1
make: *** [all] Error 2

JuliusCosmoRomeo avatar Mar 30 '22 16:03 JuliusCosmoRomeo

should be fixed now

Andrey1994 avatar Mar 31 '22 00:03 Andrey1994

Hey @Andrey1994, before you wonder why the Brainflow update is not merged yet: Clint and I talked about it yesterday and found that it would make more sense to first merge the VS code makefile integration before merging Brainflow. Afterwards he would adjust the Brainflow update slightly to fit the new build system right away.

JuliusCosmoRomeo avatar Apr 06 '22 12:04 JuliusCosmoRomeo