Showing posts with label compiling. Show all posts
Showing posts with label compiling. Show all posts

23 February 2012

71. Building Thunderbird 10.0.2 on debian testing

I use evolution for email, contacts and calendar because it integrates well with gnome and because it looks a whole lot prettier than the version of Thunderbird (i.e. Icedove) in the debian repos (3.1.16-1).

Well, sometimes you've got to check out the alternatives. Here's how to build thunderbird 10.0.2 from source.

-- START HERE --

sudo apt-get install libdbus-glib-1-dev gir1.2-notify-0.7 libnotify-dev  yasm checkinstall libzip-dev zip

cd ~/tmp
wget ftp://ftp.mozilla.org/pub/mozilla.org/thunderbird/releases/10.0.2/source/thunderbird-10.0.2.source.tar.bz2

tar -xvf thunderbird-10.0.2.source.tar.bz2 

cd comm-release/

./configure --disable-necko-wifi
..
updating cache ../../.././config.cache
creating ./config.status
creating Makefile
creating config/Makefile
creating config/autoconf.mk
creating ldap/Makefile
creating ldap/clients/tools/Makefile
creating ldap/include/Makefile
creating ldap/libraries/Makefile
creating ldap/libraries/libldap/Makefile
creating ldap/libraries/libprldap/Makefile
creating ldap/libraries/libldif/Makefile
creating ldap/libraries/liblber/Makefile
creating ldap/libraries/libiutil/Makefile
creating ldap/libraries/libssldap/Makefile
creating ldap/libraries/libutil/Makefile

make -jN

...
make[4]: Leaving directory `/home/me/tmp/comm-release/mail/test/mozmill'
make[3]: Leaving directory `/home/me/tmp/comm-release/mail'
make[2]: Leaving directory `/home/me/tmp/comm-release'
make[1]: Leaving directory `/home/me/tmp/comm-release'
if test -d ./mozilla/dist/bin ; then touch ./mozilla/dist/bin/.purgecaches ; fi


where N is the number of cores +1 -- in my case it's 7 since I have a six-core CPU. Be aware that building does take a while.

sudo make install

(sudo checkinstall ended with segfault for some reason)

You are now done.

Make sure that /usr/local/bin is in your PATH

me@beryllium:~/tmp/comm-release$ which thunderbird
/usr/local/bin/thunderbird


Interesting observation:
while thunderbird starts thunderbird the home-built version seems to be referred to as earlybird:



What's ugly or not is subjective, but you may want to use this add-on:
https://addons.mozilla.org/en-US/thunderbird/addon/gnome-linux-integration/?src=search



Troubleshooting:
Error:
checking MOZ_PANGO_CFLAGS... -pthread -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/freetype2
checking MOZ_PANGO_LIBS... -pthread -lpangoft2-1.0 -lpango-1.0 -lfreetype -lfontconfig -lgobject-2.0 -lgmodule-2.0 -lgthread-2.0 -lrt -lglib-2.0
checking for gnome-vfs-2.0 >= 2.0 gnome-vfs-module-2.0 >= 2.0... checking for gconf-2.0 >= 1.2.1 gobject-2.0 ... checking for dbus-glib-1 >= 0.60... Package dbus-glib-1 was not found in the pkg-config search path. Perhaps you should add the directory containing `dbus-glib-1.pc' to the PKG_CONFIG_PATH environment variable No package 'dbus-glib-1' found
configure: error: Library requirements (dbus-glib-1 >= 0.60) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them.

Solution:
sudo apt-get install libdbus-glib-1-dev

Error:

checking MOZ_PANGO_LIBS... -pthread -lpangoft2-1.0 -lfreetype -lfontconfig -lpangocairo-1.0 -lpango-1.0 -lcairo -lgobject-2.0 -lgmodule-2.0 -lgthread-2.0 -lrt -lglib-2.0
checking for gnome-vfs-2.0 >= 2.0 gnome-vfs-module-2.0 >= 2.0... checking for gconf-2.0 >= 1.2.1 gobject-2.0 ... checking for libnotify >= 0.4... Package libnotify was not found in the pkg-config search path. Perhaps you should add the directory containing `libnotify.pc' to the PKG_CONFIG_PATH environment variable No package 'libnotify' found
configure: error: Library requirements (libnotify >= 0.4) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them

Solution:
sudo apt-get install gir1.2-notify-0.7 libnotify-dev

Error:

checking MOZ_DBUS_GLIB_LIBS... -pthread -ldbus-glib-1 -ldbus-1 -lpthread -lgobject-2.0 -lgthread-2.0 -lrt -lglib-2.0
checking __attribute__ ((aligned ())) support... trying 64
64
configure: error: yasm is a required build tool for this architecture when webm is enabled. You may either install yasm or --disable-webm (which disables the WebM video format). See https://developer.mozilla.org/en/YASM for more details.
configure: error: ./configure failed for mozilla

Solution:
sudo apt-get install yasm

20 January 2012

55. Building/compiling OpenMM4.0 from source on debian testing

Pre-requisites:
sudo apt-get install swig doxygen openjdk-7-jdk

Also, patience...the build can be temperamental. However, go through the steps enough times and it will work. Why, I don't know.

Also:
1. download (see error 4 below) py-dom-xpath-0.1 from here:
https://code.google.com/p/py-dom-xpath/downloads/list

sudo apt-get install python-setuptools
wget https://py-dom-xpath.googlecode.com/files/py-dom-xpath-0.1.tar.gz


2. Unzip it
3. Change to the directory py-dom-xpath-0.1/ and run
sudo python setup.py install

And
add this to your ~/.bashrc or /etc/profile

export LD_LIBRARY_PATH=/lib/openmm:/usr/lib/nvidia-cuda-toolkit:/usr/lib/nvidia:$LD_LIBRARY_PATH
export OPENMM_PLUGIN_DIR=/usr/local/openmm/lib/plugins
export OPENMM_ROOT_DIR=/usr/local/openmm
Finally (and this is truly ridiculous):

mkdir ~/tmp/OpenMM4.0-Source/docs/UsersGuide
cp OpenMM4.0-Source/docs/OpenMMUsersGuide.pdf OpenMM4.0-Source/docs/UsersGuide/


Start here:

As usual we'll do our work in ~/tmp
so
mkdir ~/tmp 
if that directory doesn't exist

To download the OpenMM4.0-Source.zip file you need to register at simtk.org

Put the file in ~/tmp

Run:
cd ~/tmp
unzip OpenMM4.0-Source.zip
cd OpenMM4.0-Source/
cmake CMakeList.txt
make OpenMM
sudo make install

If all goes well (it took me three hours to iron out the details...) you'll see
[..]
-- Installing: /usr/local/openmm/include/openmm/internal/AmoebaUreyBradleyForceImpl.h
-- Installing: /usr/local/openmm/include/openmm/internal/AmoebaTorsionTorsionForceImpl.h
-- Installing: /usr/local/openmm/include/openmm/internal/AmoebaStretchBendForceImpl.h
-- Installing: /usr/local/openmm/lib/libOpenMMAmoeba.so
-- Removed runtime path from "/usr/local/openmm/lib/libOpenMMAmoeba.so"
-- Installing: /usr/local/openmm/lib/plugins/libOpenMMAmoebaCuda.so
-- Removed runtime path from "/usr/local/openmm/lib/plugins/libOpenMMAmoebaCuda.so"
-- Installing: /usr/local/openmm/lib/plugins/libOpenMMAmoebaSerialization.so
-- Removed runtime path from "/usr/local/openmm/lib/plugins/libOpenMMAmoebaSerialization.so"
-- Installing: /usr/local/openmm/include/openmm/RPMDIntegrator.h
-- Installing: /usr/local/openmm/include/openmm/RpmdKernels.h
-- Installing: /usr/local/openmm/lib/libOpenMMRPMD.so
-- Removed runtime path from "/usr/local/openmm/lib/libOpenMMRPMD.so"
-- Installing: /usr/local/openmm/lib/plugins/libOpenMMRPMDOpenCL.so
-- Removed runtime path from "/usr/local/openmm/lib/plugins/libOpenMMRPMDOpenCL.so"
-- Installing: /usr/local/openmm/include/openmm/serialization/SerializationNode.h
-- Installing: /usr/local/openmm/include/openmm/serialization/SerializationProxy.h
-- Installing: /usr/local/openmm/include/openmm/serialization/XmlSerializer.h
-- Installing: /usr/local/openmm/lib/libOpenMMSerialization.so
-- Removed runtime path from "/usr/local/openmm/lib/libOpenMMSerialization.so"


And you're are done! SUCCESS!



Errors and solutions:
I hate cmake, possibly because I don't really understand it.
Anyway, every time you hit one of the errors below you need to do the following after fixing it:
make clean
cmake CMakeList.txt
make OpenMM
or you'll get error # 6

1. Doxygen missing:

Symptom:
Swig version must be 1.3.39 or greater! (You have 0.0.0)
CMake Error at /usr/share/cmake-2.8/Modules/FindPackageHandleStandardArgs.cmake:91 (MESSAGE):
  Could NOT find Doxygen (missing: DOXYGEN_EXECUTABLE)
Call Stack (most recent call first):
  /usr/share/cmake-2.8/Modules/FindPackageHandleStandardArgs.cmake:252 (_FPHSA_FAILURE_MESSAGE)
  /usr/share/cmake-2.8/Modules/FindDoxygen.cmake:80 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
  wrappers/python/CMakeLists.txt:82 (find_package)
Solution:
sudo apt-get install doxygen

2. Swig missing:
Symptom:
Swig version must be 1.3.39 or greater! (You have 0.0.0)
-- Java version 1.6.0.24 configured successfully!
CMake Error at /usr/share/cmake-2.8/Modules/FindPackageHandleStandardArgs.cmake:91 (MESSAGE):
  Could NOT find Java (missing: Java_JAR_EXECUTABLE Java_JAVAC_EXECUTABLE)
  (found version "1.6.0.24")
Call Stack (most recent call first):
  /usr/share/cmake-2.8/Modules/FindPackageHandleStandardArgs.cmake:252 (_FPHSA_FAILURE_MESSAGE)
  /usr/share/cmake-2.8/Modules/FindJava.cmake:174 (find_package_handle_standard_args)
  wrappers/python/CMakeLists.txt:85 (find_package)
Solution:
sudo apt-get install swig

3. Java found and missing at the same time
Symptom:
-- Java version 1.6.0.24 configured successfully!
CMake Error at /usr/share/cmake-2.8/Modules/FindPackageHandleStandardArgs.cmake:91 (MESSAGE):
  Could NOT find Java (missing: Java_JAR_EXECUTABLE Java_JAVAC_EXECUTABLE)
  (found version "1.6.0.24")
Call Stack (most recent call first):
  /usr/share/cmake-2.8/Modules/FindPackageHandleStandardArgs.cmake:252 (_FPHSA_FAILURE_MESSAGE)
  /usr/share/cmake-2.8/Modules/FindJava.cmake:174 (find_package_handle_standard_args)
  wrappers/python/CMakeLists.txt:85 (find_package)
Solution:
sudo apt-get install openjdk-7-jdk

4. No module named xpath
Symptom:
Execution time: 1072 milliseconds
Memory used: 21270968
NamePool contents: 89 entries in 86 chains. 6 prefixes, 6 URIs
[ 87%] Creating OpenMM Python swig input files...
Traceback (most recent call last):
  File "/home/me/tmp/OpenMM4.0-Source/python/src/swig_doxygen/swigInputBuilder.py", line 15, in <module>
    import xpath
ImportError: No module named xpath
make[2]: *** [python/src/swig_doxygen/swig_lib/python/pythonprepend.i] Error 1
make[1]: *** [wrappers/python/CMakeFiles/BuildModule.dir/all] Error 2
make: *** [all] Error 2
Solution:
Download py-dom-xpath-0.1.tar.gz:

wget https://py-dom-xpath.googlecode.com/files/py-dom-xpath-0.1.tar.gz

Untar (tar -xvf) in ~/tmp
cd py-dom-xpath-0.1/
sudo python setup.py install

What didn't work:
sudo apt-get install libxml-xpath-perl
sudo apt-get install libghc-hxt-xpath-dev

5. Missing OpenMMUsersGuide.pdf
Symptom:
-- Installing: /usr/local/openmm/docs/API Reference.html
CMake Error at cmake_install.cmake:119 (FILE):
  file INSTALL cannot find
  "/home/me/tmp/OpenMM4.0-Source/docs/UsersGuide/OpenMMUsersGuide.pdf".

make: *** [install] Error 1

Solution:
WTF??? The build can fail over something so trivial???
Anyway,
mkdir ~/tmp/OpenMM4.0-Source/docs/UsersGuide
cp ~/tmp/OpenMM4.0-Source/docs/OpenMMUsersGuide.pdf ~/tmp/OpenMM4.0-Source/docs/UsersGuide/

6. Linking CXX shared library libOpenMM.so failure
Symptom:
[  6%] Building CXX object CMakeFiles/OpenMM.dir/src/cuda/kCalculateLocalForces.cu_OpenMMCuda_generated.cpp.o
Linking CXX shared library libOpenMM.so
CMakeFiles/OpenMM.dir/src/cuda/kCalculateCDLJForces.cu_OpenMMCuda_generated.cpp.o: In function `__device_stub__Z29kFindBlockBoundsCutoff_kernelv()':
kCalculateCDLJForces.cu_OpenMMCuda_generated.cpp:(.text+0x200): multiple definition of `__device_stub__Z29kFindBlockBoundsCutoff_kernelv()'
CMakeFiles/OpenMM.dir/src/cuda/kCalculateNonbondedSoftcore.cu_OpenMMFreeEnergyCuda_generated.cpp.o:kCalculateNonbondedSoftcore.cu_OpenMMFreeEnergyCuda_generated.cpp:(.text+0x1b0): first defined here
[..]
CMakeFiles/OpenMM.dir/src/cuda/kCalculateAmoebaCudaUtilities.cu_OpenMMAmoebaCuda_generated.cpp.o: In function `kFindInteractionsWithinBlocksPeriodic_kernel(unsigned int*)':
kCalculateAmoebaCudaUtilities.cu_OpenMMAmoebaCuda_generated.cpp:(.text+0x1d0): multiple definition of `kFindInteractionsWithinBlocksPeriodic_kernel(unsigned int*)'
CMakeFiles/OpenMM.dir/src/cuda/kCalculateNonbondedSoftcore.cu_OpenMMFreeEnergyCuda_generated.cpp.o:kCalculateNonbondedSoftcore.cu_OpenMMFreeEnergyCuda_generated.cpp:(.text+0x3a0): first defined here
collect2: ld returned 1 exit status
make[2]: *** [libOpenMM.so] Error 1
make[1]: *** [CMakeFiles/OpenMM.dir/all] Error 2
make: *** [all] Error 2

Solution:
You had one of errors 1-5, you solved it and tried to run make again. You need to do

make clean
cmake CMakeList.txt

first before proceeding with make or you end up with this error.