1% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3% Copyright (C) 2020 HOLOEYE Photonics AG. All rights reserved.
6% This file is part of HOLOEYE
SLM Display SDK.
8% You may use
this file under the terms and conditions of the
9%
"HOLOEYE SLM Display SDK Standard License v1.0" license agreement.
11% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
14% This code adds the HOLOEYE
SLM Display SDK installation path to MATLAB
's (Octave's) search path.
16% Please make sure that the mex files inside the added folder are properly compiled.
17% Under MATLAB, the mexw64 files are shipped with the installer, so there is no need to recompile anything on the win64 platform.
18% When
using MATLAB in the 32-
bit version, you will need to compile these mex files. To
do this, you need to install an appropriate
19% compiler. See MATLAB documentation about supported compilers.
20% For Octave, the mex files are generated
for the selected Octave installation during the SDK installation process.
21% If you want to use the SDK from another Octave version on your computer, you need to recompile these mex files.
23% MEX file compilation can be done by running the script
24% heds_build_sdk_mex_files
25% which is installed into the win64 and win32 folders.
27% Read environment variable:
28if (exist (
'OCTAVE_VERSION',
'builtin') > 0)
29 env_path = getenv(
'HEDS_2_OCTAVE');
31 env_path = getenv(
'HEDS_2_MATLAB');
34% Determine the binary to use
36 arch = computer('arch');
37 if strcmp( arch(end-1:end), '64' )
38 binary_path = '/win64';
40 binary_path = '/win32';
43 binary_path = '/linux';
49 heds_path = strcat(env_path, binary_path);
52% Check the linux install folder
53if ~ispc() && (isempty(heds_path) || exist (heds_path, 'dir') ~= 7)
54 heds_path = '/usr/share/holoeye-slmdisplaysdk/sdk';
57% Check if the path exists
58if isempty(heds_path) || exist (heds_path, 'dir') ~= 7
59 currentdir = fileparts(mfilename('fullpath'));
61 heds_path = sprintf('%s/bin%s', currentdir, binary_path);
64if isempty(heds_path) || exist (heds_path, 'dir') ~= 7
65 heds_path = sprintf('%s/../../bin%s', currentdir, binary_path);
68% Figure out if heds_path could be found and if yes, add to MATLAB path:
69if (exist (heds_path, 'dir')) == 7
73 fprintf(2, '\nError: Could not find HOLOEYE
SLM Display SDK installation path from environment variable. \n\nPlease relogin your Windows user account and try again. \nIf that does not help, please reinstall the SDK and then relogin your user account and try again. \nA simple restart of the computer might fix the problem, too.\n');
75 fprintf(2, '\nError: Could not detect HOLOEYE
SLM Display SDK installation path. \n\nPlease make sure it is correctly installed.\n');
81% Make sure we find the library functions