Compile CP_Developer in Matlab


#1

Dear Team,

I had a hard time to compile CP_Developer in Matlab. My OS is windows vista ultimate and I tried Matlab 7.4.0 (R2007a) or 7.8 (R2008b).

The process I did was basiccally running ‘CompileWizard’. In Matalab R2007a, I could see a file named ‘CompileWizard_CellProfiler.m’ was created, but CellProfiler.exe did not come out. Then I tried to run ComoileWizard_CellProfiler, as a result, the CP was launched. In the launched CP window, I could load and run a pipeline, but I could not create a new pipeline, essentially because the modules such as for ‘File processing’ or ‘Image processing’ did not show up in the box where we could select. in Matlab R2008b, the CP could not be compiled at all, I guess the current code was developed in R2007a.

So what is the correct procedure of compiling CP_Developer?

Thank you

With best regards,

Paradse


#2

Use BuildCellProfiler.m instead. When given the desired ‘single’ or ‘cluster’ argument, this function will call CompileWizard.m and produce your compiled version. I see that the Help for CompileWizard should be updated to reflect this. Apologies for the confusion.

Let us know how it goes.
Best,
David


#3

[quote=“David Logan”]Use BuildCellProfiler.m instead. When given the desired ‘single’ or ‘cluster’ argument, this function will call CompileWizard.m and produce your compiled version. I see that the Help for CompileWizard should be updated to reflect this. Apologies for the confusion.

Let us know how it goes.
Best,
David[/quote]

Hi, David,
Thank you so much for your reply.
I am using Matlab R2008b and changed the code for CPWaitbar as suggested by Mark. It seems the compiling is still going on after 12hr. I saw that several files with extention .c, . prj, .ctf were created at the beginning of compiling, but after that I kept waiting and nothing came out. I can see, however, a process called ‘Perl.exe’ is comsuming most of the CPU all the time, also, the status of Matlab shown is busy.

Does the compiling process take so long? or I need to type any other command?

Regards,

Paradise


#4

The build process should take on the order of a few minutes, not hours. There are no perl scripts involved in our builds, so I suspect your Perl.exe process must be separate from CellProfiler. Quit this process (or better, reboot), and try again. And be sure to follow the rest of the directions in BuildCellProfiler.m’s Help file for ‘single’ machine usage:

% BuildCellProfiler Build a self-contained executable of CellProfiler for
% use on a single machine or for cluster computing.
%
% The argument ‘Usage’ is a string and can either be:
% ‘single’: Create a CellProfiler executable appropriate for the host
% machine it’s compiled on (e.g., PC, Macs, Unix)
% ‘cluster’: Create a CellProfiler executable appropriate for use on a
% cluster (assumed to be Unix-based)
%
% The output will be an executable called CellProfiler (Usage: ‘single’)
% or CPCluster (Usage: ‘cluster’), along with any associated files
% neccesary to set up environment variables.
%
% Before running this function, set the current directory to
% your root (or trunk) CellProfiler directory, which includes
% CellProfiler.m and the Modules, CPsubfunctions, etc folders.
%
% NOTES ON “SINGLE” USAGE
% A new folder called CompiledCellProfiler will be created at the
% same level as the CP root folder. This placement is to avoid duplicate
% function names if you run CP from the root directory after building.
%
% Read the readme.txt file created, and set your path variables either
% manually, try the CellProfiler*.command scripts, or use the
% run_CellProfiler.sh script at a terminal prompt.
% See readme.txt file for more details.

You might also be sure to Run Matlab as Administrator, which can often help on Vista, though I’m not certain it’s necessary.

Best,
David


#5

Hi, David,
Thanks again for your reply.

I think I followed the instructions, but problem still exists.
When I start the building process by executing BuildCellProfiler(‘single’) in Matlab, I can see a process call ‘mcc.exe’ was launched and several files with extension .c were created. But after that, the mcc.exe was gone and instead, a process named ‘perl.exe’ started, which comsumes most of the CPU. After terminating the ‘perl’ process, an error pompted up in Matlab:

??? Error using ==> mcc
Error executing mcc, return status = 1.

Error in ==> BuildCellProfiler at 79
mcc -m -C CellProfiler -I ./Modules -I ./DataTools -I ./ImageTools …

Again, I used Matlab R2008b (7.7), do you think the version makes the problem?

Thank you,

Paradise


#6

Ah, that is possible that 2008b is the culprit. We have not yet compiled with 2008b on Windows, and are not officially supporting it yet, so mcc may indeed be hanging. We don’t call perl, but it looks like mcc does. We will test this in the near future, try:
(1) building/compiling with R2007a (if you have access to it)
(2) checking Mathworks.com for bug reports on R2008b Compiler
(3) compiling a simple m-file with command-line mcc to see if it works for you at all.

Let us know how it goes.
David


#7

Hi, David,

It seems there is a problem existing in the source code. I tried Matlab R2008a and R2008b. Both did not work. On my computer, the mcc went to call perl.exe and never end; on other computers, the error message came out directly:

??? Error using ==> mcc
Error executing mcc, return status = 1.

Error in ==> BuildCellProfiler at 79
mcc -m -C CellProfiler -I ./Modules -I ./DataTools -I ./ImageTools …

So far I have not figure out the reason. Is the compiling process on your computer all right?

Regards,

Paradise


#8

Hi,

BuildCellProfiler works for us here on R2008a, so I’m not sure what your problem is. I just ran it successfully on our newest version, as well as on 5811Bugfix.

A few questions for you:
(1) Are you running CP version 5811Bugfix, the newest from the website?

(2) Is there other error message text above the “??? Error using ==> mcc” line that might help us debug this?

(3) Try compiling a simple file to test mcc functionality. Create a simple fil with these two lines:
function test_mcc
disp(‘Hello world’)

Save it as test_mcc.m in your current directory, and at the Matlab prompt run “mcc -m test_mcc.m”. Does this compile without errors?

(4) What version of the Matlab Compiler are you using? You can paste in the the results from the “ver” command. We are using 4.8.

David


#9

Hi,

There’s a mention on the Mathworks about the calls to Perl.exe when using MCC here. You may want to give it a try and see if it gets things working.
-Mark


#10

Hi, David and Mark,

Thanks so much for your guys help. The problem solved.

To successfully compile CP_Developer, the system needs to have either a C compiler or the patch to the matlab compiler as stated in the link given by Mark.

I tried to compile an example, hello.m, included in the \extern\examples\compiler directory, and got a warning as following:

Warning: Name is nonexistent or not a directory: E:\Program
Files\MATLAB\R2008b\toolbox\compiler\patch,

Also, Matlab reminds me to select a compiler:

[1]. Lcc-win32 C 2.4.1 in E:\PROGRA~1\MATLAB\R2008b\sys\lcc
[2]. no compiler

I selected [1] and the compiling worked. But when compiling CP_Developer, there was no reminder at all. I am not sure why LCC is not the default compiler and the user has to select here.

Thank you guys again,

Paradise