MEX-file error with AFQ_example.m

249 views
Skip to first unread message

Sebastian Miguel Toescu

unread,
Aug 9, 2018, 9:02:26 AM8/9/18
to Automated Fiber Quantification (AFQ)
Dear Jason and team,

Many thanks for your pioneering AFQ software. I have installed AFQ v1.2, as well as Vistasoft and the RemoteDataToolbox, and put all three at the top of my Matlab (R2017b) path, above SPM (v12), FSL (v5) and Freesurfer, which I also have installed.

I am unable to run AFQ_example.m due to the following error message:

Invalid MEX-file '/Users/seb/Documents/MATLAB/vistasoft/mrDiffusion/src/dtiSplitTensor.mexmaci64':
dlopen(/Users/seb/Documents/MATLAB/vistasoft/mrDiffusion/src/dtiSplitTensor.mexmaci64, 6): Library not
loaded: @loader_path/libmex.dylib
  Referenced from: /Users/seb/Documents/MATLAB/vistasoft/mrDiffusion/src/dtiSplitTensor.mexmaci64
  Reason: image not found.

In order to try and remedy this, I have attempted to recompile the mex files as per the SPM wiki (https://en.wikibooks.org/wiki/SPM/Installation_on_64bit_Mac_OS_(Intel)#Compilation), but nothing seems to work.

I'd be really grateful for any ideas on where I've gone wrong.

Many thanks,

Seb

aava...@gmail.com

unread,
Oct 24, 2018, 2:44:20 PM10/24/18
to Automated Fiber Quantification (AFQ)
Greetings, AFQ experts,

Thank you for AFQ development and support.

I am having the same issue, and am wondering if any solutions have been floated:

Invalid MEX-file '/Users/andreivakhtin/Documents/MATLAB/vistasoft-master/mrDiffusion/src/dtiSplitTensor.mexmaci64'
 
when trying to plot the core values on top of streamlines using AFQ_RenderFibers(fg(1), 'dt', dt)

Any help is appreciated! 

Thank you

Andrei

Marc Joanisse

unread,
Oct 29, 2018, 10:53:39 AM10/29/18
to Automated Fiber Quantification (AFQ)
This is an issue with Vistasoft, which AFQ uses to do various things. My experience is that the MEX files provided don't work properly on newer MacOS installations due to changes implemented when they rolled out High Sierra (10.13). It's sometimes possible to download XCode and recompile them, but not always. The solution I've come up with at this end is to do all our analyses on older Macs (Mavericks? Yosemite?) and/or in Ubuntu Linux 14.xx. 

I'm hopeful that the upcoming switch to Python instead of Matlab will help with all this.

-Marc-

Sebastian Miguel Toescu

unread,
Jan 9, 2020, 6:27:07 PM1/9/20
to Automated Fiber Quantification (AFQ)
Hi Marc, Jason and colleagues,
Just to follow up on the below -- I wonder if a workaround has been found for this issue? I'm finding it hard to find a Mac with an old enough OS to use AFQ!
Many thanks,
Seb 

Jason Yeatman

unread,
Jan 10, 2020, 5:46:56 PM1/10/20
to automated-fiber-q...@googlegroups.com
Hi Sebastian,

I haven't looked for a workaround because we are mostly linux.

Anyone else?

--
You received this message because you are subscribed to the Google Groups "Automated Fiber Quantification (AFQ)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to automated-fiber-quantif...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/automated-fiber-quantification-afq/0b999b49-9182-47a7-9008-b611bf08c6fd%40googlegroups.com.

Andrei Vakhtin

unread,
Jan 10, 2020, 11:42:40 PM1/10/20
to automated-fiber-q...@googlegroups.com
Greetings Everybody,

Thank you for re-visiting the issue. To expand on my previous post, a similar problem was also present in the CentOS 6.1 environment. I was only able to use the function in CentOS 7.

Could you please let us know the Linux distribution that you use for AFQ development?

Thank you,

Andrei

On Jan 10, 2020, at 15:46, Jason Yeatman <jdye...@gmail.com> wrote:


You received this message because you are subscribed to a topic in the Google Groups "Automated Fiber Quantification (AFQ)" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/automated-fiber-quantification-afq/mZw2TT1PRFs/unsubscribe.
To unsubscribe from this group and all its topics, send an email to automated-fiber-quantif...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/automated-fiber-quantification-afq/CANbxo5e9PXjz%2B7YdH-3Nnoh963%3DVEjnfemFi6WJt6cWisX9Nvw%40mail.gmail.com.

Jason Yeatman

unread,
Jan 11, 2020, 5:30:13 PM1/11/20
to automated-fiber-q...@googlegroups.com

Sebastian Miguel Toescu

unread,
Jan 16, 2020, 7:49:07 AM1/16/20
to Automated Fiber Quantification (AFQ)
Hi,

After a bit of digging and some helpful tips from a colleague, I found a workaround. Basically you need to symlink between where the Matlab .dylib files are and usr/local/lib. This is because of the System Integrity Protection on newer macOS's which prevents user-installed applications from messing with the DYLD_LIBRARY_PATH and contents of important system directories.

The code I used:


On Friday, January 10, 2020 at 10:46:56 PM UTC, Jason wrote:
Hi Sebastian,

I haven't looked for a workaround because we are mostly linux.

Anyone else?

To unsubscribe from this group and stop receiving emails from it, send an email to automated-fiber-quantification-afq+unsub...@googlegroups.com.

Changfu Zou

unread,
Feb 12, 2020, 4:14:53 AM2/12/20
to Automated Fiber Quantification (AFQ)
Hi Sebastian,

Thanks for your effort! I tried to run the code you provided

ln -s /Applications/MATLAB_R2017b.app/bin/maci64/*.dylib /usr/local/lib

in Matlab and also the terminal on a Mac (macOS Mojave). It seems not to work.

Sebastian Miguel Toescu

unread,
Feb 12, 2020, 8:16:58 AM2/12/20
to automated-fiber-q...@googlegroups.com
Hi Changfu,
It will depend on what Matlab version you're running etc.
Open terminal;
Navigate to root folder (type "cd /")
Then use that code, replacing the Matlab bit with whichever Matlab version you have installed, so "ln -s /Applications/<YOUR_MATLAB_VERSION>.app/bin/maci64/*.dylib /usr/local/lib"
I would also back up your machine and screenprint the contents of usr/local/lib prior to doing this.
Hope this helps,
S


To unsubscribe from this group and stop receiving emails from it, send an email to automated-fiber-quantif...@googlegroups.com.

--
You received this message because you are subscribed to a topic in the Google Groups "Automated Fiber Quantification (AFQ)" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/automated-fiber-quantification-afq/mZw2TT1PRFs/unsubscribe.
To unsubscribe from this group and all its topics, send an email to automated-fiber-quantif...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/automated-fiber-quantification-afq/109821d8-39bc-4ad6-a68d-34bab70620d7%40googlegroups.com.


--
Sebastian M Toescu
GOSH Charity / RCS Surgeon Scientist PhD Fellow, UCL Institute of Child Health
Neurosurgery Registrar, North London
Treasurer, British Neurosurgical Trainees Association
Reply all
Reply to author
Forward
0 new messages