Back to the main page.

Bug 3282 - which fails as system command on windows for openmeeg

Status NEW
Reported 2017-04-13 15:01:00 +0200
Modified 2017-04-13 15:02:22 +0200
Product: FieldTrip
Component: external
Version: unspecified
Hardware: PC
Operating System: Windows
Importance: P5 normal
Assigned to: Robert Oostenveld
URL:
Tags:
Depends on:
Blocks:
See also: http://bugzilla.fieldtriptoolbox.org/show_bug.cgi?id=2368

Marios Antonakakis - 2017-04-13 15:01:15 +0200

This is solved with the following change function prefix = om_checkombin % Check if OpenMEEG binaries are installed and work. % % Copyright (C) 2010-2017, OpenMEEG developers % $LastChangedBy: alegra $ % $LastChangedDate: 2010-09-30 11:15:51 +0200 (Thu, 30 Sep 2010) $ % $Revision$ % start with an empty return value prefix = ''; % check whether the binary is on the path if ismac || isunix [status, result] = system('which om_assemble'); if status>0 % which has failed show_error(result); end % figure out where it is installed openmeeg_bin = fileparts(result); openmeeg_lib = fullfile(fileparts(openmeeg_bin), 'lib'); end % check whether the binary can be executed [status, result] = system('om_assemble'); % the failure might be due to the libraries not being found if status>0 if ismac prefix = ['export DYLD_LIBRARY_PATH=' openmeeg_lib ' && ']; [status, result] = system([prefix 'om_assemble']); elseif isunix prefix = ['export LD_LIBRARY_PATH=' openmeeg_lib ' && ']; [status, result] = system([prefix 'om_assemble']); elseif ispc % don't know how to determine this on Windows show_error(result); end end if status>0 show_error(result); end if nargout==0 clear prefix end function show_error(result) disp('=============================================================================='); disp('OpenMEEG binaries are not correctly installed') disp(' ') disp('Visit the OpenMEEG website for instructions') disp('http://openmeeg.github.io/') disp(' ') disp('See also the installation instructions on') disp('http://www.fieldtriptoolbox.org/faq/how_do_i_install_the_openmeeg_binaries') disp('=============================================================================='); disp(result); error('OpenMEEG not found')