Skip to content
1 change: 1 addition & 0 deletions ir_mex_build.m
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,6 @@

ir_mex_build_mri
ir_mex_build_table
irt_mex_make

% todo: ir_mex_build_penal
12 changes: 6 additions & 6 deletions mex/src/irt_mex_make.m
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
% irt_mex_make.m

if ispc
cd penalty
mex penalty_mex.c mexarg.c 'penalty,diff.c' -DIs_pc -DMmex -outdir ../v7
cd ..
cd mex/src/penalty
mex penalty_mex.c mexarg.c 'penalty,diff.c' -DIs_pc -DMmex -outdir ../../local
cd ../../..
else
cd penalty
mex -v penalty_mex.c mexarg.c 'penalty,diff.c' -DMmex -outdir ../v7
cd ..
cd mex/src/penalty
mex -v penalty_mex.c '../def/mexarg.c' 'penalty,diff.c' -I'../def/' -DMmex -outdir ../../local
cd ../../..
end
9 changes: 9 additions & 0 deletions setup.m
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@
irtdir = [irtdir filesep];
end

if ~exist([irtdir 'mex/local'], 'dir')
disp(sprintf('The directory "%s" does not exist. Creating it now.', [irtdir 'mex/local']))
mkdir([irtdir 'mex/local']);
end
Comment thread
kristinazvolanek marked this conversation as resolved.
Outdated

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Automatically create the mex/local directory if it doesn't exist

list = {...
'align', ... % image registration
'align/mex', ... % image registration mex files
Expand All @@ -41,6 +46,8 @@
'fbp', ... % FBP (filtered backprojection) code
'general', ... % generic image reconstruction
'graph', ... % graphics routines
'mex/local', ... % MEX files compiled for local OS/CPU
'mex/src', ... % MEX source code for irt_mex_make.m
'mri', ... % MRI reconstruction
'mri/fieldmap', ... % MRI B0 field map estimation
'mri-rf/yip-spsp', ... % MRI RF pulse design
Expand Down Expand Up @@ -70,8 +77,10 @@
% e.g., 7.3 and running on earlier 7.0 won't work.
% If you have mex problems, comment out the following line.
% Much of the toolbox will work without mex, just slower.
addpath([irtdir 'mex/local']) % must precede "mex/v7"
addpath([irtdir 'mex/v7']);

disp('NOTE: Previous irt versions expected MEX files in "mex/v7".')

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added a comment about the mex/v7 directory. Let me know if you prefer a different message!

Comment thread
kristinazvolanek marked this conversation as resolved.
Outdated

% do not add the paths below if you are using Matlab!
if ir_is_octave
Expand Down