Reorganized the directory hierarchy for storing MEX files for MATLAB:

* mex/matlab/ is now the default location
* removed mex/2007a, mex/2007b and mex/2009a-64bit
* on Windows platforms, use version specific subdirs of mex/matlab if present (called win32-6.5.1-7.4, win32-7.4-7.9, win64-7.2-7.4, win64-7.5-7.7, win64-7.8-7.9)


git-svn-id: https://www.dynare.org/svn/dynare/trunk@3123 ac1d8469-bf42-47a9-8791-bf33cf982152
time-shift
sebastien 2009-11-04 10:56:37 +00:00
parent d9ea204fc5
commit 30d2f00cc2
5 changed files with 41 additions and 41 deletions

View File

@ -74,17 +74,46 @@ end
% Add path to MEX files
if exist('OCTAVE_VERSION')
path_to_mex_files = [dynareroot '../mex/octave/'] ;
addpath([dynareroot '../mex/octave/']);
else
if matlab_ver_less_than('7.5')
path_to_mex_files = [dynareroot '../mex/2007a/'] ;
elseif matlab_ver_less_than('7.8') || isempty(regexp(computer, '.*64', 'ONCE'))
path_to_mex_files = [dynareroot '../mex/2007b/'] ;
else
path_to_mex_files = [dynareroot '../mex/2009a-64bit/'] ;
% Add win32 specific paths for Dynare Windows package
if strcmp(computer, 'PCWIN')
if matlab_ver_less_than('7.5')
mexpath = [dynareroot '../mex/matlab/win32-6.5.1-7.4'];
if exist(mexpath, 'dir')
addpath(mexpath)
end
else
mexpath = [dynareroot '../mex/matlab/win32-7.5-7.9'];
if exist(mexpath, 'dir')
addpath(mexpath)
end
end
end
% Add win64 specific paths for Dynare Windows package
if strcmp(computer, 'PCWIN64')
if matlab_ver_less_than('7.5')
mexpath = [dynareroot '../mex/matlab/win64-7.2-7.4'];
if exist(mexpath, 'dir')
addpath(mexpath)
end
elseif matlab_ver_less_than('7.8')
mexpath = [dynareroot '../mex/matlab/win64-7.5-7.7'];
if exist(mexpath, 'dir')
addpath(mexpath)
end
else
mexpath = [dynareroot '../mex/matlab/win64-7.8-7.9'];
if exist(mexpath, 'dir')
addpath(mexpath)
end
end
end
% Add generic MATLAB path (with higher priority than the previous ones)
addpath([dynareroot '../mex/matlab/']);
end
addpath(path_to_mex_files);
%% Set mex routine names
mex_status = cell(1,3);
@ -137,8 +166,6 @@ end
disp(' ')
disp('Configuring Dynare ...')
remove_path_to_mex = 1;
for i=1:number_of_mex_files
test = (exist(mex_status{i,1},'file') == 3);
if ~test
@ -151,14 +178,12 @@ for i=1:number_of_mex_files
else
message = '[mex] ';
end
remove_path_to_mex = 0;
end
disp([ message mex_status{i,3} '.' ])
end
% Test if bytecode DLL is present
if exist('bytecode') == 3
remove_path_to_mex = 0;
if ~multithread_flag
message = '[mex] ';
else
@ -171,15 +196,10 @@ disp([ message 'Bytecode evaluation.' ])
% Test if k-order perturbation DLL is present
if exist('k_order_perturbation') == 3
remove_path_to_mex = 0;
message = '[mex] ';
else
message = '[no] ';
end
disp([ message 'k-order perturbation.' ])
if remove_path_to_mex
rmpath(path_to_mex_files);
end
disp(' ')

View File

@ -31,14 +31,6 @@ if test "x$ax_enable_matlab" = "xyes"; then
if test "x$ax_matlab_version_ok" = "xyes"; then
AX_MEXOPTS
# Determine subdirectory of mex/ to be used for storing MATLAB MEX binaries
AX_COMPARE_VERSION([$MATLAB_VERSION], [le], [7.4], [DYNARE_MEXDIR="2007a"], [
DYNARE_MEXDIR="2007b"
if test ${MATLAB_ARCH%64} != ${MATLAB_ARCH}; then
AX_COMPARE_VERSION([$MATLAB_VERSION], [ge], [7.8], [DYNARE_MEXDIR="2009a-64bit"])
fi])
AC_SUBST([DYNARE_MEXDIR])
fi
CFLAGS="$MATLAB_CFLAGS"

View File

@ -10,10 +10,10 @@ LDFLAGS += $(MATLAB_LDFLAGS)
LIBS += $(MATLAB_LIBS)
all-local:
cd $(top_srcdir)/../../$(DYNARE_MEXDIR) && \
cd $(top_srcdir)/../../matlab && \
for p in $(PROGRAMS); do \
$(LN_S) -f $(abs_srcdir)/$$p $$p; \
done
clean-local:
cd $(top_srcdir)/../../$(DYNARE_MEXDIR) && rm -f $(PROGRAMS)
cd $(top_srcdir)/../../matlab && rm -f $(PROGRAMS)

View File

@ -63,13 +63,7 @@ if (strcmpi('GLNXA64', computer) || strcmpi('PCWIN64', computer)) ...
COMPILE_OPTIONS = [ COMPILE_OPTIONS ' -largeArrayDims' ];
end
if matlab_ver_less_than('7.5')
OUTPUT_DIR = '../2007a';
elseif matlab_ver_less_than('7.8') || isempty(regexp(computer, '.*64','ONCE'))
OUTPUT_DIR = '../2007b';
else
OUTPUT_DIR = '../2009a-64bit';
end
OUTPUT_DIR = '../matlab';
disp(' ')
if exist(OUTPUT_DIR,'dir')

View File

@ -62,13 +62,7 @@ if (strcmpi('GLNXA64', computer) || strcmpi('PCWIN64', computer)) ...
COMPILE_OPTIONS = [ COMPILE_OPTIONS ' -largeArrayDims' ];
end
if matlab_ver_less_than('7.5')
OUTPUT_DIR = '../2007a';
elseif matlab_ver_less_than('7.8') || isempty(regexp(computer, '.*64','ONCE'))
OUTPUT_DIR = '../2007b';
else
OUTPUT_DIR = '../2009a-64bit';
end
OUTPUT_DIR = '../matlab';
disp(' ')
if exist(OUTPUT_DIR,'dir')