Skip to content

Commit

Permalink
use ~strcmp and check for Yosemite or greater
Browse files Browse the repository at this point in the history
  • Loading branch information
peteflorence committed Aug 23, 2015
1 parent b6a539f commit 868e541
Showing 1 changed file with 16 additions and 11 deletions.
27 changes: 16 additions & 11 deletions drake/addpath_drake.m
Original file line number Diff line number Diff line change
Expand Up @@ -59,18 +59,23 @@

javaaddpath(fullfile(pods_get_base_path,'share','java','drake.jar'));

% OSX platform-specific: check if reverted to IPv4
% OSX platform-specific
if (strcmp(computer('arch'),'maci64'))
ipv4_preferred = java.lang.System.getProperty('java.net.preferIPv4Stack');
if isempty(ipv4_preferred)
ipv4_preferred = 'false';
end
if (strcmp(ipv4_preferred,'true'))
display('WARNING: Your JVM may crash if you do not set it to prefer IPv4 over IPv6.')
display('This may cause any dependencies that involve the JVM (including LCM) to crash at runtime.')
display('Please see bug report and solution here: https://github.com/RobotLocomotion/drake/issues/558.')
display('(It just involves adding one line to your java.opts file for Matlab.)')
display('Make sure to restart Matlab after editing your java.opts file.')
% Check if on Yosemite or after
[OSXvers,~] = evalc('system(''sw_vers -productVersion'')');
if ~isempty(regexp(OSXvers, '10\.1.', 'match'));
% Check if reverted to IPv4
ipv4_preferred = java.lang.System.getProperty('java.net.preferIPv4Stack');
if isempty(ipv4_preferred)
ipv4_preferred = 'false';
end
if ~(strcmp(ipv4_preferred,'true'))
display('WARNING: Your JVM may crash if you do not set it to prefer IPv4 over IPv6.')
display('This may cause any dependencies that involve the JVM (including LCM) to crash at runtime.')
display('Please see bug report and solution here: https://github.com/RobotLocomotion/drake/issues/558.')
display('(It just involves adding one line to your java.opts file for Matlab.)')
display('Make sure to restart Matlab after editing your java.opts file.')
end
end
end

Expand Down

0 comments on commit 868e541

Please sign in to comment.