Our cluster sets env vars for Freesurfer (and a number of other environments) globally by executing program-specific settings in /etc/profile.d/*.csh every time tcsh is invoked. This hasn't been a problem with AFNI in the past, but I updated the AFNI binaries in mid-November (the 16th) and now the env variables are being written into the afni_subj_study.tcsh by afni_proc.py. It looks like this:
# ========================== auto block: outcount ==========================
# data check: compute outlier fraction for each volume
touch out.pre_ss_warn.txt
foreach run ( $runs )
3dToutcount -automask -fraction -polort 3 -legendre \
pb00.$subj.r$run.tcatMNE software location set to: \
/opt/mne/current
MATLAB software location set to: /usr/local/matlab_R2009a
/opt/mne/current/bin added to PATH
/opt/mne/current/lib added to LD_LIBRARY_PATH
/opt/mne/current/share/app-defaults/%N added to XUSERFILESEARCHPATH
%---------------------- MNE --------------------------%
mnehome = getenv('MNE_ROOT');
mnematlab = sprintf('%s/share/matlab',mnehome);
if (exist(mnematlab) == 7)
path(path,mnematlab);
end
clear mnehome mnematlab;
%-----------------------------------------------------%
Note: Remember to set SUBJECTS_DIR and SUBJECT environment variables \
correctly.
Note: FreeSurfer environment is needed to access tkmedit from mne_analyze.
+orig > outcount.r$run.1D
The script (understandably) then won't run because it can't find the file "pb00.$subj.r$run.tcatMNE". If I run afni_proc.py on a different system (without env variables set globally by the system) there are no problems creating the afni_subj_study.tcsh files. Again, this problem only emerged when I updated the binaries around Nov 16th.