|
1 | | -# LabStreamingLayer OpenEphys Data Thread Plugin |
| 1 | +# Introduction |
2 | 2 |
|
3 | | -This repository contains a [LabStreamingLayer](http://labstreaminglayer.readthedocs.io/) **Data Thread** plugin for the [Open Ephys GUI](https://github.com/open-ephys/plugin-GUI). |
| 3 | +This is an [Open Ephys GUI](https://github.com/open-ephys/plugin-GUI) data thread plugin for [LSL](https://labstreaminglayer.readthedocs.io/index.html) streams. |
| 4 | +Please read the guide regarding compiling plugins from [open-ephys](https://open-ephys.github.io/gui-docs/Developer-Guide/Compiling-plugins.html) and install cmake. |
4 | 5 |
|
5 | | -## Releases |
| 6 | +## How to build |
6 | 7 |
|
7 | | -TODO: These don't exist yet... |
| 8 | +The plugin repo needs to be cloned inside a directory (e.g. MyPlugins) that is at the same level as [plugin-GUI](https://github.com/open-ephys/plugin-GUI/), for example: |
8 | 9 |
|
9 | | -Check the repository's [releases](https://github.com/labstreaminglayer/OpenEphysLSL-Inlet/releases) page for a downloadable plugin. |
10 | | - |
11 | | -## Building |
12 | | - |
13 | | -### Prerequisite: liblsl |
14 | | - |
15 | | -You will need `liblsl` on your local disk in a location that CMake can find. This is platform-dependent. |
16 | | - |
17 | | -#### MacOS |
18 | | - |
19 | | -The easiest way is to use homebrew: |
20 | | - |
21 | | -`brew install labstreaminglayer/tap/lsl` |
| 10 | +``` |
| 11 | +/Users/foo/plugin-GUI |
| 12 | +/Users/foo/plugin-GUI/MyPlugins/lsl-inlet |
| 13 | +``` |
22 | 14 |
|
23 | | -Otherwise, see the [Miscellaneous Platforms](#miscellaneous-platforms) section. |
| 15 | +### macOS |
24 | 16 |
|
25 | | -#### Windows |
| 17 | +A debug version of the plugin will not work with a release version of `Open Ephys GUI` and a release version of the plugin will not work with a debug version of `Open Ephys GUI`. Keep this in mind when deciding how to generate the makefiles. |
26 | 18 |
|
27 | | -Download `liblsl-x.xx.x-Win_amd64.zip` (where x.xx.x is the latest version number) from the [liblsl Releases page](https://github.com/sccn/liblsl/releases). |
28 | | -Extract that archive somewhere convenient. |
29 | | -Pass the path to the extracted folder as a CMake argument (`-DLSL_INSTALL_ROOT=path/to/extracted/liblsl`). |
| 19 | +Download liblsl: |
30 | 20 |
|
31 | | -#### Ubuntu Linux |
| 21 | +``` |
| 22 | +mkdir liblsl |
| 23 | +cd liblsl |
| 24 | +curl -OL https://github.com/sccn/liblsl/releases/download/v1.16.0/liblsl-1.16.0-OSX_amd64.tar.bz2 |
| 25 | +tar xvf liblsl-1.16.0-OSX_amd64.tar.bz2 |
| 26 | +``` |
32 | 27 |
|
33 | | -Download `liblsl-x.xx.x-yyy_amd64.deb` (where x.xx.x is the latest version number and yyy is the name of your Ubuntu distribution) from the [liblsl Releases page](https://github.com/sccn/liblsl/releases). Use your Ubuntu package manager to install it. |
| 28 | +On macOS either "Xcode" or "Unix Makefiles" can be generated and used to successfully build the plugin. |
| 29 | +If you prefer to work with VSCode then "Unix Makefiles" should be used. |
| 30 | +Generate the Makefile using: |
34 | 31 |
|
35 | | -#### Miscellaneous Platforms |
| 32 | +``` |
| 33 | +cd Build |
| 34 | +cmake -DCMAKE_OSX_ARCHITECTURES="x86_64" -G "Unix Makefiles" .. |
| 35 | +``` |
36 | 36 |
|
37 | | -See the [liblsl README](https://github.com/sccn/liblsl#building-liblsl) for more options. |
| 37 | +For a release build run: |
38 | 38 |
|
39 | | -### Prerequisite: OpenEphys Plugin-GUI |
| 39 | +``` |
| 40 | +cd Build |
| 41 | +cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_OSX_ARCHITECTURES="x86_64" -G "Unix Makefiles" .. |
| 42 | +``` |
40 | 43 |
|
41 | | -You also need the OpenEphys Plugin GUI Source code. |
| 44 | +Build a binary: |
42 | 45 |
|
43 | | -Download or clone from its repo [here](https://github.com/open-ephys/plugin-GUI). |
| 46 | +``` |
| 47 | +cd Build |
| 48 | +make |
| 49 | +``` |
44 | 50 |
|
45 | | -Your folder structure should look like the following |
| 51 | +Install the plugin: |
46 | 52 |
|
47 | 53 | ``` |
48 | | -shared_root/ |
49 | | - - plugin-GUI |
50 | | - - OEPlugins/ |
51 | | - OpenEphysLSL-Inlet (this repo) |
| 54 | +cd Build |
| 55 | +make install |
52 | 56 | ``` |
53 | 57 |
|
54 | | -### Repository structure |
| 58 | +This will copy the plugin (`OpenEphysLSL-Inlet.bundle`) to the `$HOME/Application Support/open-ephys/plugins-api8/` folder |
| 59 | +and will available the next time `Open Ephys GUI` is launched. |
55 | 60 |
|
56 | | -This repository contains 3 top-level directories: |
| 61 | +### Windows |
57 | 62 |
|
58 | | -- `Build` - Plugin build files will be auto-generated here. These files will be ignored in all `git` commits. |
59 | | -- `Source` - All plugin source files (`.h` and `.cpp`) should live here. There can be as many source code sub-directories as needed. |
60 | | -- `Resources` - This is where you should store any non-source-code files, such as library files or scripts. |
| 63 | +The build was tested using Visual Studio 2022 Community Edition. |
| 64 | +First, download liblsl from [GitHub](https://github.com/sccn/liblsl/releases/download/v1.16.0/liblsl-1.16.0-Win_amd64.zip) and extract it inside the plugin directory. |
| 65 | +The folder structure can be: |
61 | 66 |
|
62 | | -### Providing libraries for Windows |
| 67 | +``` |
| 68 | +OpenEphysLSL-Inlet |
| 69 | +| |
| 70 | +|--liblsl |
| 71 | + | |
| 72 | + |-- bin |
| 73 | + |-- include |
| 74 | + |-- lib |
| 75 | +``` |
63 | 76 |
|
64 | | -Since Windows does not have standardized paths for libraries, as Linux and macOS do, it is sometimes useful to pack the appropriate Windows version of the required libraries alongside the plugin. |
65 | | -To do so, a _libs_ directory has to be created **at the top level** of the repository, alongside this README file, and files from all required libraries placed there. The required folder structure is: |
| 77 | +Open `Developer Command Prompt for VS 2022` and generate the Makefile using cmake: |
66 | 78 |
|
67 | 79 | ``` |
68 | | - libs |
69 | | - ├─ include #library headers |
70 | | - ├─ lib |
71 | | - ├─ x64 #64-bit compile-time (.lib) files |
72 | | - └─ x86 #32-bit compile time (.lib) files, if needed |
73 | | - └─ bin |
74 | | - ├─ x64 #64-bit runtime (.dll) files |
75 | | - └─ x86 #32-bit runtime (.dll) files, if needed |
| 80 | +cd Build |
| 81 | +cmake -G "Visual Studio 17 2022" -A x64 .. |
76 | 82 | ``` |
77 | 83 |
|
78 | | -DLLs in the bin directories will be copied to the open-ephys GUI _shared_ folder when installing. |
| 84 | +You can now open the `ALL_BUILD.vcxproj` file from the Build folder with Visual Studio and build a binary. |
| 85 | + |
| 86 | +To install the plugin copy the file `OpenEphysLSL-Inlet.dll` to the `C:\ProgramData\Open Ephys\plugins-api8` folder and copy |
| 87 | +the file `lsl.dll` to the `C:\ProgramData\Open Ephys\shared-api8` folder. |
| 88 | + |
| 89 | +The plugin will load the next time `Open Ephys GUI` is launched. |
0 commit comments