After setting FREESURFER_HOME on the commandline, you must source the freesurfer setup script like so:
source $FREESURFER_HOME/SetUpFreeSurfer.csh This will set some other parameters, like DYLD_LIBRARY_PATH, on mac. You should try doing that and then running matlab from the current shell. If that doesn't work, you could try setting DYLD_LIBRARY_PATH directly from matlab, like so: setenv('DYLD_LIBRARY_PATH', ['/Applications/freesurfer/lib/gcc/lib:' getenv('DYLD_LIBRARY_PATH')]); As a last resort, you could avoid all of the DYLD_LIBRARY_PATH stuff by downloading the dev distribution from the wiki (which is built with clang instead of gcc) or you could try a patched 6.0 version available at https://drive.google.com/file/d/1w0vZyWTY0HrbcDiP1jWsmGl_GMUSh7tR/view?usp=sharing (unzip the file and follow the instructions in the README.patch) best Andrew ________________________________________ From: freesurfer-boun...@nmr.mgh.harvard.edu <freesurfer-boun...@nmr.mgh.harvard.edu> on behalf of Miguel Ángel Rivas Fernández <miguelrivasf...@gmail.com> Sent: Wednesday, February 12, 2020 3:34 AM To: Freesurfer support list Subject: Re: [Freesurfer] freesurfer error in matlab External Email - Use Caution Hi Andrew, Yes, we are using FS 6.0 and I think that is correctly sourced in MATLAB environment. I used the same commands that we are using in other Mac workstation where all works fine. The commands used to source freesurfer in Matlab were these: bash_path=getenv ('PATH'); setenv( 'PATH',[bash_path,':/Applications/freesurfer',':/Applications/freesurfer/bin']); setenv FREESURFER_HOME /Applications/freesurfer setenv SUBJECTS_DIR /Applications/freesurfer/subjects How can I set the DYLD_LIBRARY_PATH? Thanks in advance. Best, El mié., 12 feb. 2020 a las 1:15, Hoopes, Andrew (<ahoo...@mgh.harvard.edu<mailto:ahoo...@mgh.harvard.edu>>) escribió: If I understand correctly, you're having trouble running freesurfer binaries from within matlab, right? Is freesurfer fully sourced in your MATLAB environment? I’m guessing this is an issue with your DYLD_LIBRARY_PATH not being set, but it's possible there are other issues going on. You should check to see if the DYLD_LIBRARY_PATH environment variable in your MATLAB shell matches what you see in the terminal after sourcing freesurfer. Also, are you using 6.0? Best, Andrew ________________________________________ From: freesurfer-boun...@nmr.mgh.harvard.edu<mailto:freesurfer-boun...@nmr.mgh.harvard.edu> <freesurfer-boun...@nmr.mgh.harvard.edu<mailto:freesurfer-boun...@nmr.mgh.harvard.edu>> on behalf of Miguel Ángel Rivas Fernández <miguelrivasf...@gmail.com<mailto:miguelrivasf...@gmail.com>> Sent: Friday, February 7, 2020 6:17 AM To: Freesurfer support list Subject: [Freesurfer] freesurfer error in matlab External Email - Use Caution Dear Freesurfer devs, I am trying to run FreeSurfer in Matlab and I received the following error message dyld: lazy symbol binding failed: Symbol not found: ___emutls_get_address Referenced from: /Applications/freesurfer/bin/../lib/gcc/lib/libgomp.1.dylib Expected in: /usr/lib/libSystem.B.dylib I tried to fix this error disabling the SIP but this did not work. Maybe could be due to the gcc compiler? Any help would be appreciated Thanks in advance Best regards, -- Miguel Ángel Rivas Fernández _______________________________________________ Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu<mailto:Freesurfer@nmr.mgh.harvard.edu> https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer -- Miguel Ángel Rivas Fernández _______________________________________________ Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer