Building on i386 Ubuntu Linux

Hi,

I just wanted to share my experience with building CellProfiler on Ubuntu 10.04. Firstly I followed the instructions at cellprofiler.org/wiki/index.php/CP2.0_on_Linux and that probably solved most problems, but there was a few more I had to deal with, including one I couldn’t solve.

I first got errors

That was fixed by setting in my .bashrc

Then I got an error like this:

gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions build/temp.linux-i686-2.6/javabridge.o -L/usr/lib/jvm/java-6-openjdk/jre/lib/amd64/server -ljvm -o /media/endless/bioinfo/CellProfiler/cellprofiler/utilities/javabridge.so
/usr/bin/ld: cannot find -ljvm

I was not able fix this by changing LD_LIBRARY_PATH. Instead, I was able to fix this problem by manually changing cellprofiler/utilities/setup.py

-                library_dirs = [os.path.join(java_home,'jre','lib','amd64','server')]
+                library_dirs = [os.path.join(java_home,'jre','lib','i386','server')]

That’s not a fix for everyone of course, because it ruins it for the amd64 people. I tried using the platform.machine() method from the platform python library, but that gave me i686, not i386 as required. There is no i686 directory in the folder. So perhaps someone with more python experience can step in and fix it for everyone?

My final problem was with vigra. While python CellProfiler.py --build-and-exit now works, running it without --build-and-exit throws this error

vigra import: failed to import the vigra library. Please follow the instructions on "http://hci.iwr.uni-heidelberg.de/vigra/" to install vigra Traceback (most recent call last): File "/media/endless/bioinfo/CellProfiler/cellprofiler/modules/classifypixels.py", line 14, in <module> import vigra ImportError: No module named vigra <error chopped for brevity>
I installed the libvigraimpex2ldbl and libvigraimpex-dev packages from the official Ubuntu repos to no avail. Building from source didn’t work either. I compiled it fine, but I still don’t seem to be able to “import vigra” from python scripts. make check throws no errors, only warnings. This is only tangentially related to CellProfiler, but can anyone help?

I seem to be able to run the example pipeline downloaded from the URL, perhaps it is only the ClassifyPixels module that will cause problems? Not sure if that will affect me or not…

Thanks,
ben

[quote=“bwoodcroft”]
My final problem was with vigra. While python CellProfiler.py --build-and-exit now works, running it without --build-and-exit throws this error
[snip]
I seem to be able to run the example pipeline downloaded from the URL, perhaps it is only the ClassifyPixels module that will cause problems? [/quote]

You are correct: Vigra will only be a problem if you are using ClassifyPixels which is not fully implemented yet (we’re supressed this message for the compiled release). Looks like you are in good shape otherwise!

Regards,
-Mark

Ok, thanks Mark.

I was thinking of adding a link to this website from the wiki page cellprofiler.org/wiki/index.php/CP2.0_on_Linux but I cannot login, which I seem to need to do to make changes. What to do?

The developer’s wiki is open for editing only to CellProfiler team members. But rest assured, your comments for compilation will be incorporated into our tech notes. :smile:
-Mark

Thanks Mark.

On another machine, I had to install the “libwxgtk2.8-dev” package using aptitude, after getting the following error:

Traceback (most recent call last): File "./CellProfiler.py", line 191, in <module> from cellprofiler.cellprofilerapp import CellProfilerApp File "/home/ben/bioinfo/CellProfiler/cellprofiler/cellprofilerapp.py", line 4, in <module> import wx File "/usr/lib/python2.6/dist-packages/wx-2.8-gtk2-unicode/wx/__init__.py", line 45, in <module> from wx._core import * File "/usr/lib/python2.6/dist-packages/wx-2.8-gtk2-unicode/wx/_core.py", line 4, in <module> import _core_ ImportError: /usr/lib/python2.6/dist-packages/wx-2.8-gtk2-unicode/wx/_core_.so: symbol _ZNK12wxWindowBase18WindowToClientSizeERK6wxSize, version WXU_2.8 not defined in file libwx_gtk2u_core-2.8.so.0 with link time reference
There appears to be some dependency problems in the current Ubuntu repositories associated with this package, so I had to install it using aptitude, not apt-get.

[code]$ sudo aptitude install libwxgtk2.8-dev
Reading package lists… Done
Building dependency tree
Reading state information… Done
Reading extended state information
Initializing package states… Done
The following packages are BROKEN:
libwxbase2.8-dev libwxgtk2.8-dev
The following NEW packages will be installed:
wx2.8-headers{a}
0 packages upgraded, 3 newly installed, 0 to remove and 1 not upgraded.
Need to get 1,306kB of archives. After unpacking 6,836kB will be used.
The following packages have unmet dependencies:
libwxbase2.8-dev: Depends: libwxbase2.8-0 (= 2.8.10.1-0ubuntu1) but 2.8.10.1-0ubuntu1.2 is installed.
libwxgtk2.8-dev: Depends: libwxgtk2.8-0 (= 2.8.10.1-0ubuntu1) but 2.8.10.1-0ubuntu1.2 is installed.
The following actions will resolve these dependencies:

Downgrade the following packages:
libwxbase2.8-0 [2.8.10.1-0ubuntu1.2 (now) -> 2.8.10.1-0ubuntu1 (lucid)]
libwxgtk2.8-0 [2.8.10.1-0ubuntu1.2 (now) -> 2.8.10.1-0ubuntu1 (lucid)]

Score is 110

Accept this solution? [Y/n/q/?] (Answered Y here)[/code]
And now it works on that computer as well. $LD_LIBRARY_PATH didn’t have to be modified at all to get CellProfiler to work.

Hi Ben,

I have incorporated your findings into the precheck for the CellProfiler 2 Makefile, which now detects missing JAVA_HOME or incomplete LD_LIBRARY_PATH. For checking LD_LIBRARY_PATH, it will search the path for ‘libjvm.so’ and throw an error if the library is not found. I have tested the Makefile on Ubuntu Linux 10.04 with unmodified CP2 from current trunk HEAD, and without libwxgtk2.8-dev installed. If you find some time, it would be great to see if it works for you? You can test only the prechecks using:

make -f Makefile.CP2 precheck

or you can compile all sources and dependencies from scratch by invoking make with:

make -f Makefile.CP2 TGTDIR="<your preferred target prefix>"

Find the Makefile and a discussion about CP2 on Linux in the following thread: How to install cellprofiller2.0 in a Linux Cluster or download the Makefile directly from: data.marssoft.de/cp/Makefile.CP2

All the best, Mario

Mario’s makefile (or at least the last version that we’ve tested and has succeeded on our Red Hat 5 cluster) is available in the SVN repository at svn.broadinstitute.org/CellProf … kefile.CP2