paths settings: assume an installed openEMS on unix systems

Signed-off-by: Thorsten Liebig <Thorsten.Liebig@gmx.de>
pull/10/head
Thorsten Liebig 2013-09-04 11:18:17 +02:00
parent 0b4d957201
commit 8f4a1bd943
2 changed files with 15 additions and 3 deletions

View File

@ -85,7 +85,15 @@ struct_2_xml(nf2ff.xml,nf2ff_xml,'nf2ff');
m_filename = mfilename('fullpath');
dir_name = fileparts( m_filename );
if isunix
% <openEMS-path> could be /usr or ~/opt/openEMS etc.
% assume this file to be in '<openEMS-path>/share/openEMS/matlab/'
% assume openEMS binary to be in '<openEMS-path>/bin'
openEMS_Path = [dir_name filesep '../../../bin' filesep];
else
openEMS_Path = [dir_name filesep '..' filesep];
end
if ((exist(nf2ff.hdf5,'file') && (mode==0)) || (mode==2))
disp('CalcNF2FF: Reading nf2ff data only...')
@ -104,7 +112,7 @@ cd(Sim_Path);
try
if isunix
% remove LD_LIBRARY_PATH set by matlab
system(['export LD_LIBRARY_PATH=; ' openEMS_Path 'nf2ff/nf2ff ' filename '.xml']);
system(['export LD_LIBRARY_PATH=; ' openEMS_Path 'nf2ff ' filename '.xml']);
else
system([openEMS_Path 'nf2ff.exe ' filename '.xml']);
end

View File

@ -31,11 +31,15 @@ end
filename = mfilename('fullpath');
dir = fileparts( filename );
openEMS_Path = [dir filesep '../..' filesep];
if isunix
% <openEMS-path> could be /usr or ~/opt/openEMS etc.
% assume this file to be in '<openEMS-path>/share/openEMS/matlab/private/'
% assume openEMS binary to be in '<openEMS-path>/bin'
openEMS_Path = [dir filesep '../../../../bin' filesep];
openEMS_Path = [openEMS_Path 'openEMS.sh'];
else
openEMS_Path = [dir filesep '../..' filesep];
openEMS_Path = [openEMS_Path 'openEMS'];
end