IdentifyPrimObject not working


I have updated my CP 1.0 to the 9717 version recently. Initially everything worked just fine and I was very happy. Since then things have gone pear shaped. My computer was updated automatically at the institute (don’t know what gets updated, I’ll check though) and since then the identify primary objects does not work with any pipeline on any computer (all Macs with 10.5 or 10.6)! Here is the error message:
There was a problem running the image analysis. Sorry, it is unclear what the problem is. It would be wise to close the entire CellProfiler program in case something strange has happened to the settings. The output file may be unreliable as well. Matlab says the error is: Invalid MEX-file ‘/Applications/CompiledCellProfiler_9717/CellProfiler_mcr/toolbox/images/images/private/imreconstructmex.mexmaci’: dlopen(/Applications/CompiledCellProfiler_9717/CellProfiler_mcr/toolbox/images/images/private/imreconstructmex.mexmaci, 1): Library not loaded: @loader_path/libmwippl.dylib
Referenced from: /Applications/CompiledCellProfiler_9717/CellProfiler_mcr/toolbox/images/images/private/imreconstructmex.mexmaci
Reason: no suitable image found. Did find:
/System/Library/Frameworks/JavaVM.framework/JavaVM/libmwippl.dylib: stat() failed with errno=20. in the IdentifyPrimAutomatic module, which is module #06 in the pipeline.

imreconstruct in /Applications/CompiledCellProfiler_9717/CellProfiler_mcr/toolbox/images/images/imreconstruct.m (75)
imfill in /Applications/CompiledCellProfiler_9717/CellProfiler_mcr/toolbox/images/images/imfill.m (143)
IdentifyPrimAutomatic in /Applications/CompiledCellProfiler_9717/CellProfiler_mcr/Modules/IdentifyPrimAutomatic.m (687)
AnalyzeImagesButton_Callback in /Applications/CompiledCellProfiler_9717/CellProfiler_mcr/CellProfiler/CellProfiler.m (11160)
gui_mainfcn in /Applications/CompiledCellProfiler_9717/CellProfiler_mcr/CellProfiler/CellProfiler.m (12916)
CellProfiler in /Applications/CompiledCellProfiler_9717/CellProfiler_mcr/CellProfiler/CellProfiler.m (57)

We are stuck at the moment and only the developer version works (although it cannot handle analysing subfolders). I would appreciate some help as the queue for the developer version is growing real fast.
Thank you,


We had a similar problem we when upgraded, it a problem with some of the script in the .command file. If you replace text within your CellProfilerFor MacI.command with the following text it should work fine.

I have also included a copy of my .command file. We have run into errors with permissions, so I can’t guarantee that it will work.



script for execution of deployed applications

Sets up the MCR environment for the current $ARCH and executes

the specified command.


** Assuming default location of MCR – Change if you have a non-standard MCR install **


Added for OS X version checking.

DISPLAY variable needs to be set for OS < 10.5

sysver=sw_vers -productVersion | cut -c 1-4

if $sysver = 10.5 -o $sysver = 10.6 ]
#echo “The DISPLAY variable is not being set manually, because you are running OS $sysver. This "
echo “”
elif $sysver = 10.4 -o $sysver = 10.3 ]
export DISPLAY=”:0.0"
echo “This system is too old, before OS 10.3”

exe_dir=dirname $0
echo “------------------------------------------”
echo Setting up environment variables
echo —
MWE_ARCH=“maci” ;
if "MWE_ARCH" = "sol64" ] ; then LD_LIBRARY_PATH=.:/usr/lib/lwp:{MCRROOT}/runtime/maci ;
DYLD_LIBRARY_PATH=.:{MCRROOT}/runtime/maci ; fi DYLD_LIBRARY_PATH={DYLD_LIBRARY_PATH}:{MCRROOT}/bin/maci:/Applications/CellProfiler/CellProfiler_mcr/bin/maci; DYLD_LIBRARY_PATH={DYLD_LIBRARY_PATH}:${MCRROOT}/sys/os/maci:/Applications/CellProfiler/CellProfiler_mcr/sys/os/maci;
if “$MWE_ARCH” = “maci” -o "MWE_ARCH" = "maci64" ]; then DYLD_LIBRARY_PATH={DYLD_LIBRARY_PATH}:/System/Library/Frameworks/JavaVM.framework/JavaVM:/System/Library/Frameworks/JavaVM.framework/Libraries;
echo DYLD_LIBRARY_PATH is {DYLD_LIBRARY_PATH}; shift 1 {exe_dir}/CellProfiler $*
exit (1.38 KB)


Thanks for sending that Heather. I see the changes in your .command file, but unless you installed the MCR in a non-standard directory, I’m surprised to hear that the changes were necessary. But we will keep that in mind.

In any case, “Library not loaded” errors typically result from an incorrect MCR version. Can you confirm that you have a v711 folder in /Applications/MATLAB/MATLAB_Compiler_Runtime/ ?

  • If not, then download the new MCR here: … MCR711.dmg (also linked on the CP download page). It will replace any older MCR versions on a Mac (Windows can have multiple MCRs installed, but not Macs). Then try CP again.
  • If you do have this version, it is possible we need to compile some C++ subroutines and repackage, but I’m hoping for the former :wink:



We thought originally that the problem was the with the MCR installer (we do have version v711), since any problems we have had with installation of CP has been related to not properly installing the MCR, so we downloaded and re-installed multiple times with no luck.

Let me know if you need any more information.


Hi David and Heather,

thank you for the fix, I’ll try it. Concerning the MCR, the computers I was talking about all had the right version. The one with the developer version has v713. Now the fun bit about this is that Matlab will not let you run several compilers with MacOS and will remember the history of versions and will not allow you to install older versions. This means that installing a v713 is a point of no return on a Mac: fun huh?
Thanks for the help,


sorry no luck, I applied the patch, but I get the same error. I have v711 and it is in /Application/MATLAB etc. As I said, it used to work just fine, so I suspect it has to do with the recent software update on my Mac.

OK, I’m seeing this behavior in Compiled 9717 on my Mac also. It works in the Developer’s version here, too, thus it escaped our testing. But we’re working on it now…

I think I have a fix. Try these commands:

cd CompiledCellProfiler_9717/CellProfiler_mcr/toolbox/images/images/private
ln -s …/…/…/…/bin/maci/libmw* .

I’m not sure why the Matlab compiler put these libraries in the wrong place, but please let us know if this fixes the issue.


I am sorry, but I cannot test your fix, as I have in the mean time installed an in-house compiled version running v713 and I cannot reinstall v711. I have another computer somewhere, which I’ll try to reproduce the error and I’ll apply your fix. Thank you anyhow.

If your in-house version is working, don’t worry too much about trying to test the fix. We tested it here on a couple of machines that were showing the crash, and it resolved it on them. Thank you for the offer, though.