External Email - Use Caution
On line 106:
if($FS_MKCON_USE_BIN == 0 && UseOctave == 0) then
there should be a "$" before the "UseOctave" to make the line read:
if($FS_MKCON_USE_BIN == 0 && $UseOctave == 0) then
Apologies if this has been already corrected, I didn't come across this in an archive search.
It looks like this bug originated in July 2018, and is the reason for a few 2019 and one or two 2020 posts complaining of "MATLAB: variable undefined" errors.
Below here is just some more background info about what sort of errors might result, and why setting the MATLAB variable to the matlab executable works around the problem, but causes a new problem with the mex command.
The conditional is always false before the fix-- so the MATLAB variable is never set to whatever fsfast's "getmatlab" function assigns to it, in the body of the conditional. So this could be the source of several "MATLAB: Undefined variable" errors reported on this list.
If one sets the MATLAB environment variable to the "R20xx/bin/matlab" executable , one can work around this problem. But-- the Matlab "mex" command uses the MATLAB variable, and expects it to be set to the Matlab root directory in order to determine the machine architecture for your host (type "mex" at the shell prompt when MATLAB is set to the matlab executable, to see the error message.) Setting the MATLAB variable the way the "mex" command expects would then result in "/path/to/R20xx: permission denied" errors when running mkcontrast-related scripts. Sorry for the wordiness. Bottom line is dollar sign.
Thanks, I just fixed it and pushed the change. Should be in the next version.
On 4/12/2021 3:05 PM, Ben Singer wrote:
External Email - Use CautionOn line 106:
if($FS_MKCON_USE_BIN == 0 && UseOctave == 0) then
there should be a "$" before the "UseOctave" to make the line read:
if($FS_MKCON_USE_BIN == 0 && $UseOctave == 0) then
Apologies if this has been already corrected, I didn't come across this in an archive search.
It looks like this bug originated in July 2018, and is the reason for a few 2019 and one or two 2020 posts complaining of "MATLAB: variable undefined" errors.
Below here is just some more background info about what sort of errors might result, and why setting the MATLAB variable to the matlab executable works around the problem, but causes a new problem with the mex command.
The conditional is always false before the fix-- so the MATLAB variable is never set to whatever fsfast's "getmatlab" function assigns to it, in the body of the conditional. So this could be the source of several "MATLAB: Undefined variable" errors reported on this list.
If one sets the MATLAB environment variable to the "R20xx/bin/matlab" executable , one can work around this problem. But-- the Matlab "mex" command uses the MATLAB variable, and expects it to be set to the Matlab root directory in order to determine the machine architecture for your host (type "mex" at the shell prompt when MATLAB is set to the matlab executable, to see the error message.) Setting the MATLAB variable the way the "mex" command expects would then result in "/path/to/R20xx: permission denied" errors when running mkcontrast-related scripts. Sorry for the wordiness. Bottom line is dollar sign.
Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
freesurfer@nmr.mgh.harvard.edu