LAT Hologramm-Software 2.0
Loading...
Searching...
No Matches
add_heds_path.m
Go to the documentation of this file.
1% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2%
3% Copyright (C) 2020 HOLOEYE Photonics AG. All rights reserved.
4% Contact: https://holoeye.com/contact/
5%
6% This file is part of HOLOEYE SLM Display SDK.
7%
8% You may use this file under the terms and conditions of the
9% "HOLOEYE SLM Display SDK Standard License v1.0" license agreement.
10%
11% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12%
13%
14% This code adds the HOLOEYE SLM Display SDK installation path to MATLAB's (Octave's) search path.
15%
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.
22%
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.
26
27% Read environment variable:
28if (exist ('OCTAVE_VERSION', 'builtin') > 0)
29 env_path = getenv('HEDS_2_OCTAVE');
30else
31 env_path = getenv('HEDS_2_MATLAB');
32end
33
34% Determine the binary to use
35if ispc()
36 arch = computer('arch');
37 if strcmp( arch(end-1:end), '64' )
38 binary_path = '/win64';
39 else
40 binary_path = '/win32';
41 end
42else
43 binary_path = '/linux';
44end
45
46if isempty(env_path)
47 heds_path = '';
48else
49 heds_path = strcat(env_path, binary_path);
50end
51
52% Check the linux install folder
53if ~ispc() && (isempty(heds_path) || exist (heds_path, 'dir') ~= 7)
54 heds_path = '/usr/share/holoeye-slmdisplaysdk/sdk';
55end
56
57% Check if the path exists
58if isempty(heds_path) || exist (heds_path, 'dir') ~= 7
59 currentdir = fileparts(mfilename('fullpath'));
60
61 heds_path = sprintf('%s/bin%s', currentdir, binary_path);
62end
63
64if isempty(heds_path) || exist (heds_path, 'dir') ~= 7
65 heds_path = sprintf('%s/../../bin%s', currentdir, binary_path);
66end
67
68% Figure out if heds_path could be found and if yes, add to MATLAB path:
69if (exist (heds_path, 'dir')) == 7
70 addpath(heds_path);
71else
72 if ispc()
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');
74 else
75 fprintf(2, '\nError: Could not detect HOLOEYE SLM Display SDK installation path. \n\nPlease make sure it is correctly installed.\n');
76 end
77
78 return;
79end
80
81% Make sure we find the library functions
82if ~ispc()
83 addpath('..');
84end
Definition: SLM.m:7
#define bit(n)
Definition: nuts_bolts.h:61