Mentions légales du service

Skip to content
Snippets Groups Projects
Commit 6779f65b authored by hhakim's avatar hhakim
Browse files

Add directories in matlab path with a finer granularity to avoid conflicts...

Add directories in matlab path with a finer granularity to avoid conflicts with matlab built-ins eye, rand functions.

Package post-install scripts are updated and also setup_FAUST.m.
parent 09015814
No related branches found
No related tags found
No related merge requests found
......@@ -20,7 +20,10 @@ else
#USR_STARTUP_FILE=$($MATLAB_BIN -nojvm -nodisplay -r "which startup;exit" | tail -n 2 | head -n 1) # useless in root
if [[ -d "${FAUST_MATLAB_WRAPPER_PATH}" ]]
then
echo "addpath(genpath('"$FAUST_MATLAB_WRAPPER_PATH"'))" >> "$STARTUP_FILE"
#echo "addpath(genpath('"$FAUST_MATLAB_WRAPPER_PATH"'))" >> "$STARTUP_FILE"
echo "addpath('"$FAUST_MATLAB_WRAPPER_PATH"')" >> $STARTUP_FILE
echo "addpath(['"$FAUST_MATLAB_WRAPPER_PATH"' '/mex'])" >> $STARTUP_FILE
echo "addpath(['"$FAUST_MATLAB_WRAPPER_PATH"' '/tools'])" >> $STARTUP_FILE
echo "matfaust.enable_gpu_mod()" >> "$STARTUP_FILE"
RET1=$?
RET2=0
......@@ -34,7 +37,10 @@ else
if [[ -r "$USR_STARTUP_FILE" ]]
then
grep -i -v faust "$USR_STARTUP_FILE" > "${USR_STARTUP_FILE}.tmp" 2>/dev/null && mv "${USR_STARTUP_FILE}.tmp" "$USR_STARTUP_FILE"
echo "addpath(genpath('"$FAUST_MATLAB_WRAPPER_PATH"'))" >> "$USR_STARTUP_FILE"
#echo "addpath(genpath('"$FAUST_MATLAB_WRAPPER_PATH"'))" >> "$USR_STARTUP_FILE"
echo "addpath('"$FAUST_MATLAB_WRAPPER_PATH"')" >> $USR_STARTUP_FILE
echo "addpath(['"$FAUST_MATLAB_WRAPPER_PATH"' '/mex'])" >> $USR_STARTUP_FILE
echo "addpath(['"$FAUST_MATLAB_WRAPPER_PATH"' '/tools'])" >> $USR_STARTUP_FILE
echo "matfaust.enable_gpu_mod('silent', true)" >> "$USR_STARTUP_FILE"
chown $USER $USR_STARTUP_FILE
RET2=$(($?+$RET2))
......
......@@ -12,7 +12,10 @@ else
STARTUP_FILE=${STARTUP_DIR}/startup.m
[[ -r "$STARTUP_FILE" ]] && grep -i -v faust "$STARTUP_FILE" > "${STARTUP_FILE}.tmp" && mv "${STARTUP_FILE}.tmp" "$STARTUP_FILE"
FAUST_MATLAB_WRAPPER_PATH="@CMAKE_INSTALL_MATLAB_PREFIX@"
echo "addpath(genpath('"$FAUST_MATLAB_WRAPPER_PATH"'))" >> $STARTUP_FILE
#echo "addpath(genpath('"$FAUST_MATLAB_WRAPPER_PATH"'))" >> "$STARTUP_FILE"
echo "addpath('"$FAUST_MATLAB_WRAPPER_PATH"')" >> $STARTUP_FILE
echo "addpath(['"$FAUST_MATLAB_WRAPPER_PATH"' '/mex'])" >> $STARTUP_FILE
echo "addpath(['"$FAUST_MATLAB_WRAPPER_PATH"' '/tools'])" >> $STARTUP_FILE
# set path in user startup script
#USR_STARTUP_FILE="$($MATLAB_BIN -nojvm -nodisplay -r "which startup;exit" | tail -n 2 | head -n 1)" # doesn't work into install script
# even if it works in a normal script #TODO: debug
......@@ -24,7 +27,10 @@ else
if [[ -r "$USR_STARTUP_FILE" ]]
then
grep -i -v faust "$USR_STARTUP_FILE" > "${USR_STARTUP_FILE}.tmp" && mv "${USR_STARTUP_FILE}.tmp" "$USR_STARTUP_FILE"
echo "addpath(genpath('"$FAUST_MATLAB_WRAPPER_PATH"'))" >> "$USR_STARTUP_FILE"
#echo "addpath(genpath('"$FAUST_MATLAB_WRAPPER_PATH"'))" >> "$USR_STARTUP_FILE"
echo "addpath('"$FAUST_MATLAB_WRAPPER_PATH"')" >> $USR_STARTUP_FILE
echo "addpath(['"$FAUST_MATLAB_WRAPPER_PATH"' '/mex'])" >> $USR_STARTUP_FILE
echo "addpath(['"$FAUST_MATLAB_WRAPPER_PATH"' '/tools'])" >> $USR_STARTUP_FILE
chown $USER "$USR_STARTUP_FILE"
fi
#fi
......
......@@ -243,13 +243,15 @@ Function matlabFoundCb
FileOpen $1 "$R4\toolbox\local\startup.m" a
FileSeek $1 0 END ; do not erase start of file (but risk to add Faust path multiple times)
FileWrite $1 "$\r$\naddpath(genpath('$INSTDIR\matlab'));$\r$\nmatfaust.enable_gpu_mod('silent', true)"
;FileWrite $1 "$\r$\naddpath(genpath('$INSTDIR\matlab'));$\r$\nmatfaust.enable_gpu_mod('silent', true)"
FileWrite $1 "$\r$\naddpath('$INSTDIR\matlab');$\r$\naddpath('$INSTDIR\matlab\mex');$\r$\naddpath('$INSTDIR\matlab\tools');$\r$\nmatfaust.enable_gpu_mod('silent', true)"
FileClose $1
FileOpen $1 "$DOCUMENTS\MATLAB\startup.m" w
IfErrors done
FileSeek $1 0 END
FileWrite $1 "$\r$\naddpath(genpath('$INSTDIR\matlab'));$\r$\nmatfaust.enable_gpu_mod('silent', true)"
;FileWrite $1 "$\r$\naddpath(genpath('$INSTDIR\matlab'));$\r$\nmatfaust.enable_gpu_mod('silent', true)"
FileWrite $1 "$\r$\naddpath('$INSTDIR\matlab');$\r$\naddpath('$INSTDIR\matlab\mex');$\r$\naddpath('$INSTDIR\matlab\tools');$\r$\nmatfaust.enable_gpu_mod('silent', true)"
FileClose $1
done:
......
......@@ -43,8 +43,12 @@ ROOT_DIR=[fileparts(mfilename('fullpath')),filesep];
fprintf('Welcome to the Matlab wrapper of the FAuST C++ toolbox.');
fprintf('FAuST root directory is %s\n',ROOT_DIR);
fprintf('Adding path %s\n and all its subdirectories ',ROOT_DIR);
addpath(genpath(ROOT_DIR));
fprintf('Adding path %s and subdirectories to matlab path\n',ROOT_DIR);
%addpath(genpath(ROOT_DIR));
addpath(ROOT_DIR);%% avoiding to use genpath because if +matfaust is added to path eye.m, rand.m, version.m etc. will conflict with matlab eye, etc.
addpath([ROOT_DIR '/mex']);
addpath([ROOT_DIR '/data']);
addpath([ROOT_DIR '/tools']);
matfaust.enable_gpu_mod()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment