Skip to content

Commit 52c6400

Browse files
committed
use lsl library in /usr/lib if available
1 parent 76aeff0 commit 52c6400

3 files changed

Lines changed: 15 additions & 4 deletions

File tree

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
/bin/
22
.idea
3+
.venv
4+
*.m~

build_mex.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616

1717
if isempty(dir(['bin/liblsl64.', dllext]))
18-
error(['liblsl64.' dllext ' not found in bin/']);
18+
%error(['liblsl64.' dllext ' not found in bin/']);
1919
end
2020

2121
ext = ['.' mexext];

lsl_loadlib.m

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,20 @@
5555
else
5656
debug = '';
5757
end
58+
59+
dll_fname = sprintf('liblsl%s%s%s', bitness, debug, ext);
60+
dllpath = fullfile(binarypath, dll_fname);
5861

59-
dllpath = [binarypath filesep 'liblsl' bitness debug ext];
60-
62+
if ~exist(dllpath, 'file') && ~ispc
63+
new_dllpath = fullfile('/usr/lib/', dll_fname);
64+
if exist(new_dllpath, 'file')
65+
dllpath = new_dllpath;
66+
end %if
67+
end %if
68+
6169
if ~exist(dllpath,'file')
62-
error(['Apparently the file "' dllpath '" is missing on your computer. Cannot load the lab streaming layer.']); end
70+
error(['Apparently the file "' dllpath '" is missing on your computer. Cannot load the lab streaming layer.']);
71+
end
6372

6473
% open the library and make sure that it gets auto-deleted when the handle is erased
6574
try

0 commit comments

Comments
 (0)