Freeesurefer- recon-all : present in directory but still shows error: Command not found when run

Hello,

I am running freesurfer in a cloud-based linux system and installed it in a directory.
In this system, I have to manually load tcsh by:

module load gcc/11.3.0
module load tcsh/6.24.00
tcsh

After this, I am able to use csh commands
Now after installing freesurfer, I run the commands:

setenv FREESURFER_HOME <freesurfer_installation_directory>/freesurfer
source $FREESURFER_HOME/SetUpFreeSurfer.csh

In the FREESURFER_HOME directory which I setup, in the bin folder, I have manually check that recon-all is present,
but still when I run any recon-all function, like

recon-all --version

I get the error: recon-all: Command not found.

I have checked that freesurfer is properly installed and working as I have tried loading multiple nifti images through freeview and they all seem to work.

Any solutions I can try?

Thanks!

Hi @praj, and welcome to neurostars!

What is the result of running source $FREESURFER_HOME/SetUpFreeSurfer.csh?

Best,
Steven

Hey Steven,
Thanks for getting back to me, I am getting this output:

-------- freesurfer-linux-centos7_x86_64-7.4.1-20230613-7eb8460 --------
Setting up environment for FreeSurfer/FS-FAST (and FSL)
FREESURFER_HOME      /project/millstei_783/prajwalg/freesurfer
FSFAST_HOME              /project/millstei_783/prajwalg/freesurfer/fsfast
FSF_OUTPUT_FORMAT nii.gz
SUBJECTS_DIR            /project/millstei_783/prajwalg/freesurfer/subjects
MNI_DIR                      /project/millstei_783/prajwalg/freesurfer/mni

Hi @praj,

What if you explicitly add the FreeSurfer bin to your path, e.g., export PATH=/path/to/your/FreeSurfer/bin:$PATH?

Best,
Steven

Hey @Steven
I tried this but am still getting the same error :confused:
Any other suggestions?

Regards,
Prajwal

Are you running recon-all in the same terminal you ran those commands in? Does recon-all exist in the bin folder?

Yes I am running recon-all in the same terminal as the other commands, and it does exist in the freesurfer/bin folder

Huh, sorry but I’m at a loss. What if you cd to the bin and run from there?

yes, i tried that, but i noticed that when I ran another command, like aparcstats2table --help, I got an output about aparcstats2table. Is it possible that recon-all might be corrupted or something else?

I guess it’s possible but I would need to look at your computing environment more hands-on one way or another. You get the same command not found error when running in the bin directory, after confirming recon-all exists in the bin directory? That just seems strange to me.

yes I got the same command not found error when running recon-all from the bin folder

I’m sorry but I’m not sure what the problem could be then, can you try reinstalling?

yes i’ll try that, thank you so much for your help!