diff --git a/3rd_party/CalcMD5/CalcMD5.m b/3rd_party/CalcMD5/CalcMD5.m index 687f113..5cea15f 100644 --- a/3rd_party/CalcMD5/CalcMD5.m +++ b/3rd_party/CalcMD5/CalcMD5.m @@ -67,5 +67,21 @@ % If the current Matlab path is the parent folder of this script, the % MEX function is not found - change the current directory! -error(['JSim:', mfilename, ':NoMex'], 'Cannot find MEX script.'); +if ~exist(['CalcMD5' mexext], 'file') + warning('CalcMD5 does not seem compiled. Compiling...'); + old_cd = pwd; + cd(fileparts(mfilename('fullpath'))); + if strcmpi(mex.getCompilerConfigurations('C').Name(1:3), 'gcc') + mex CFLAGS="\$CFLAGS -std=c99" CalcMD5.c + else + mex CalcMD5.c + end + cd(old_cd); + if (nargin < 2), MD5 = CalcMD5(Data); + elseif (nargin < 3), MD5 = CalcMD5(Data, InClass); + else MD5 = CalcMD5(Data, InClass); + end +else + error(['JSim:', mfilename, ':NoMex'], 'Cannot find MEX script.'); +end \ No newline at end of file diff --git a/3rd_party/CalcMD5/CalcMD5.mexa64 b/3rd_party/CalcMD5/CalcMD5.mexa64 new file mode 100644 index 0000000..002fad8 Binary files /dev/null and b/3rd_party/CalcMD5/CalcMD5.mexa64 differ diff --git a/README.md b/README.md index f9b06c6..fb3b723 100644 --- a/README.md +++ b/README.md @@ -7,16 +7,13 @@ throughout my other projects. Make sure you download and keep updated! Installation ------------ +Update: the CalcMD5 code should now auto-compile upon its first exectuion. + Compile the weighted histogram code: cd mycode/histogram mex whistc.c -Compile the MD5 code: - - cd 3rd_party/CalcMD5 - mex CalcMD5.c - Compile the KDE code: cd 3rd_party/@kde/mex @@ -24,4 +21,4 @@ Compile the KDE code: Get export_fig from: - https://github.com/altmany/export_fig \ No newline at end of file + https://github.com/altmany/export_fig diff --git a/mycode/parallel/runFunctionOnDatabase.m b/mycode/parallel/runFunctionOnDatabase.m index 527c297..5a23469 100644 --- a/mycode/parallel/runFunctionOnDatabase.m +++ b/mycode/parallel/runFunctionOnDatabase.m @@ -75,6 +75,9 @@ pBar.pop_bar(); if parallel + if exist(getPathName(local, 'slaves'), 'dir') == 0 + mkdir(getPathName(local, 'slaves')); + end % start the processing! settings = struct('multicoreDir', getPathName(local, 'slaves'), ... 'nrOfEvalsAtOnce', nrOfEvalsAtOnce, 'useWaitbar', useWaitbar, ...