Showing posts with label source. Show all posts
Showing posts with label source. Show all posts

29 November 2012

287. Compiling Wine 1.5.5 from source using the carbon-dev deb patches

UPDATE 16 May 2013: See here for Wine 1.5.30: http://verahill.blogspot.com.au/2013/05/416-wine-1530-in-chroot.html

UPDATE (10th Jan 2013): See here for Wine 1.5.21 using the multiarch approach: http://verahill.blogspot.com.au/2013/01/308-compiling-wine-1521-on-debian.html
. Use the updated build instead of what follows below.


Here's how to build the wine 1.5.5 packages without any errors.

I'm cheating and using the debian rules from dev.carbon-project.org.-- it's a small file and is a better solution than downloading the deb files from there.

Note that you will probably need more packages than the ones listed here.

1. Download the source and debian build patches

sudo apt-get install bzip2
cd ~/tmp
mkdir wine-1.5.5_carbon/
cd wine-1.5.5_carbon/
wget http://sourceforge.net/projects/wine/files/Source/wine-1.5.5.tar.bz2
mv wine-1.5.5.tar.bz2 wine-unstable_1.5.5.orig.tar.bz2
tar xvf wine-unstable_1.5.5.orig.tar.bz2
cd wine-1.5.5/
wget http://dev.carbon-project.org/debian/wine-unstable/wine-unstable_1.5.5-0.1.debian.tar.bz2
tar xvf wine-unstable_1.5.5-0.1.debian.tar.bz2
rm wine-unstable_1.5.5-0.1.debian.tar.bz2 

2.  Edit control, control.in and rules
Allow any version of gcc (this may obviously backfire if your version is no good)
Edit debian/control and control.in

 27  gcc-4.5-multilib [amd64 kfreebsd-amd64], gcc-4.5 [amd64 kfreebsd-amd64]
 28  g++-4.5 [amd64 kfreebsd-amd64],

so that is says
 27  gcc-multilib [amd64 kfreebsd-amd64], gcc [amd64 kfreebsd-amd64],
 28  g++ [amd64 kfreebsd-amd64],

Edit debian/rules
 53 ifeq ($(DEB_HOST_GNU_CPU),x86_64)
 54 CC=gcc-4.5
 55 CXX=g++-4.5
 56 else
 57 CC=gcc
 58 CXX=g++

to say
 53 ifeq ($(DEB_HOST_GNU_CPU),x86_64)
 54 CC=gcc
 55 CXX=g++
 56 else
 57 CC=gcc
 58 CXX=g++

2. Get dependencies
Note that this list is based on a very old post -- some packages may not be needed.


sudo apt-get install ia32-libs ia32-libs-dev bison flex gcc libc6-dev libfontconfig-dev libfreetype6-dev libglu-dev libgsm1-dev libice-dev libjpeg-dev libldap-dev libmpg123-dev libncurses5-dev libopenal-dev libpng-dev libsm-dev libssl-dev libusb-dev libx11-dev libxcomposite-dev libxcursor-dev libxext-dev libxi-dev libxinerama-dev libxml2-dev libxrandr-dev libxrender-dev libxslt-dev libxt-dev libxxf86vm-dev make libcapi20-dev liblcms-dev libsane-dev libhal-dev libdbus-1-dev valgrind prelink libcups2-dev opencl-dev lib32opencl1 oss4-dev gettext lib32v4l-dev lib32ncurses5-dev lib32asound2-dev libtiff4-dev libgphoto2-2-dev
sudo apt-get install libxkbfile-dev libxxf86dga-dev freeglut3-dev unixodbc-dev gcc-multilib dpkg-dev

Note: I used the following list on debian stable/squeeze.
sudo apt-get install ia32-libs ia32-libs-dev bison flex gcc libc6-dev libfontconfig-dev libfreetype6-dev libglu-dev libgsm1-dev libice-dev libjpeg-dev libldap-dev libmpg123-dev libncurses5-dev libopenal-dev libpng-dev libsm-dev libssl-dev libusb-dev libx11-dev libxcomposite-dev libxcursor-dev libxext-dev libxi-dev libxinerama-dev libxml2-dev libxrandr-dev libxrender-dev libxslt-dev libxt-dev libxxf86vm-dev make libcapi20-dev liblcms-dev libsane-dev libhal-dev libdbus-1-dev valgrind prelink libcups2-dev oss4-dev gettext lib32v4l-dev lib32ncurses5-dev lib32asound2-dev libtiff4-dev libgphoto2-2-dev libxkbfile-dev libxxf86dga-dev freeglut3-dev unixodbc-dev gcc-multilib dpkg-dev debhelper libxmu-dev dctrl-tools lzma sharutils lib32z1-dev libgstreamer-plugins-base0.10-dev
sudo apt-get install lib32opencl1


Then continue as normal.

If you're on Wheezy/Testing you should be following this post instead anyway.

3. Compile
in wine-1.5.5/:
dpkg-buildpackage -us -uc
If all went well you saw:
dpkg-deb: building package `wine-unstable' in `../wine-unstable_1.5.5-0.1_amd64.deb'.
dpkg-deb: building package `wine-bin-unstable' in `../wine-bin-unstable_1.5.5-0.1_amd64.deb'.
dpkg-deb: building package `libwine-dbg-unstable' in `../libwine-dbg-unstable_1.5.5-0.1_amd64.deb'.
dpkg-deb: building package `libwine-dev-unstable' in `../libwine-dev-unstable_1.5.5-0.1_amd64.deb'.
dpkg-deb: building package `libwine-unstable' in `../libwine-unstable_1.5.5-0.1_amd64.deb'.
dpkg-deb: building package `libwine-alsa-unstable' in `../libwine-alsa-unstable_1.5.5-0.1_amd64.deb'.
dpkg-deb: building package `libwine-bin-unstable' in `../libwine-bin-unstable_1.5.5-0.1_amd64.deb'.
dpkg-deb: building package `libwine-capi-unstable' in `../libwine-capi-unstable_1.5.5-0.1_amd64.deb'.
dpkg-deb: building package `libwine-cms-unstable' in `../libwine-cms-unstable_1.5.5-0.1_amd64.deb'.
dpkg-deb: building package `libwine-gl-unstable' in `../libwine-gl-unstable_1.5.5-0.1_amd64.deb'.
dpkg-deb: building package `libwine-gphoto2-unstable' in `../libwine-gphoto2-unstable_1.5.5-0.1_amd64.deb'.
dpkg-deb: building package `libwine-ldap-unstable' in `../libwine-ldap-unstable_1.5.5-0.1_amd64.deb'.
dpkg-deb: building package `libwine-openal-unstable' in `../libwine-openal-unstable_1.5.5-0.1_amd64.deb'.
dpkg-deb: building package `libwine-oss-unstable' in `../libwine-oss-unstable_1.5.5-0.1_amd64.deb'.
dpkg-deb: building package `libwine-print-unstable' in `../libwine-print-unstable_1.5.5-0.1_amd64.deb'.
dpkg-deb: building package `libwine-sane-unstable' in `../libwine-sane-unstable_1.5.5-0.1_amd64.deb'.
[..]
dpkg-source: info: using options from wine-1.5.5/debian/source/options: --compression=bzip2 --compression-level=9
dpkg-source: info: unapplying Bug#28201_proposed-fix-modified.patch
dpkg-source: info: unapplying Bug#28898_squashed-proposed-patches.patch
dpkg-source: info: unapplying fix-winegcc-paths.patch
dpkg-source: info: unapplying Bug#29669_proposed-fix.patch
dpkg-source: info: unapplying function_grep.patch
dpkg-source: info: unapplying readd_xpm.patch
dpkg-source: info: unapplying debian-changes-from-1.1.32-1.patch
dpkg-buildpackage: full upload (original source is included)

Your packages will be found in the wine-1.5.5_carbon/ directory.
../libwine-alsa-unstable_1.5.5-0.1_amd64.deb
../libwine-bin-unstable_1.5.5-0.1_amd64.deb
../libwine-capi-unstable_1.5.5-0.1_amd64.deb
../libwine-cms-unstable_1.5.5-0.1_amd64.deb
../libwine-dbg-unstable_1.5.5-0.1_amd64.deb
../libwine-dev-unstable_1.5.5-0.1_amd64.deb
../libwine-gl-unstable_1.5.5-0.1_amd64.deb
../libwine-gphoto2-unstable_1.5.5-0.1_amd64.deb
../libwine-ldap-unstable_1.5.5-0.1_amd64.deb
../libwine-openal-unstable_1.5.5-0.1_amd64.deb
../libwine-oss-unstable_1.5.5-0.1_amd64.deb
../libwine-print-unstable_1.5.5-0.1_amd64.deb
../libwine-sane-unstable_1.5.5-0.1_amd64.deb
../libwine-unstable_1.5.5-0.1_amd64.deb
../wine-bin-unstable_1.5.5-0.1_amd64.deb
../wine-unstable_1.5.5-0.1_amd64.deb

If something went wrong, it's probably because of a missing dependency.

To install just run
sudo dpkg -i *.deb in the wine-1.5.5_carbon/ directory.

07 June 2012

179. Building ECCE on Debian Testing/Wheezy

UPDATE: Build went fine. Upgrade went fine. But the organizer doesn't show my jobs properly i.e. the files are there but they aren't recognised as jobs. I haven't had a solid look at this yet, and it might just be because I need to restart more services than just the http server. It's been a long day...

UPDATE 2: An update on a different computer went without a hitch, with all the old job files being imported properly.

UPDATE 3: I started ECCE and let the data manger chew on it for four hours. No luck on the troublesome computer. The only difference is the java -- openjdk 7 worked fine, oracle jre/jdk didn't. Dunno if this is the reason, but currently in the process of installing the binaries to see whether that works better. Updates will come...

UPDATE 4: Installing the prebuilt ECCE binaries did the trick. In summary: as far as I know you MUST use openjdk 7. SUN/Oracle Java does not appear to work. It's exhibited in a lack of ability to recognise old jobs as being...jobs rather than just folders and files.


POST BEGINS HERE:
I'm trying to document everything I'm doing these days, no matter how simple or (at least in retrospect) obvious it is.

Here's how to build the 4th of June 2012 version of ecce v6.3.

You need to be registered with EMSL/PNNL to download ecce. There are plans to open-source the software properly (i.e. no need to register) sometime this coming northern summer. But for now you need to be an academic group leader to have access.

(I originally posted a somewhat different post where I recommended making some changes to the build scripts re ECCE_HOME. Eventually I saw the light and realised the error of my ways)

Download ecce-v6.3.src.tar.bz2, and put it in a suitable folder, e.g. ~/tmp
cd ~/tmp
tar -xvf ecce-v6.3-src.tar.bz2
cd ecce-v6.3/
export ECCE_HOME=`pwd`
cd build/
./build_ecce

The first time you run ./build_ecce you'll be asked a series of questions relating to installed packages. If it's all good, answer
Do you want to skip these checks for future build_ecce invocations (y/n)? y
If anything came up, then read the message carefully and install the missing package.

NOTE: on one box I noticed different version of java and javac being found, as I had both openjdk 6 and 7 installed. I couldn't set javac to 6 but I could do
sudo update-alternatives --config java
and set it to openjdk 7.

[From my small, statistically unsound sample set Oracle/SUN java will NOT work.]

Then do ./build_ecce again. And again. And again. In all, I think you do it six or seven times - each time a new package is built.
I always get a
lib: No such file or directory.
at the end of the httpd build. Not sure why, but everything seems to be ok in spite of that.
Anyway, you know that you're done running ./build_ecce when you get
ECCE built and distribution created in /home/verahill/tmp/ecce-v6.3
At this point, you are ready to install
DO NOT USE ./install_ecce

GO UP ONE LEVEL AND DO
./install_ecce.v6.3.csh

But that's a different story. install_ecce will give you weird error messages about missing tar files. install_ecce.v6.3.csh on the other hand will work fine.

17 March 2012

109. Building Thunderbird 11 on Debian testing

The build is fairly straightforward and pretty much identical to building 10.0.2 (earlybird): http://verahill.blogspot.com.au/2012/02/debian-testing-wheezy-64-building.html

As always, uninstall existing versions before installing a new one.

--start here --
First install the dependencies:
sudo apt-get install libdbus-glib-1-dev gir1.2-notify-0.7 libnotify-dev yasm checkinstall libzip-dev zip 


Download the sources  and untar:
mkdir ~/tmp
cd ~/tmp

wget ftp://ftp.mozilla.org/pub/mozilla.org/thunderbird/releases/11.0/source/thunderbird-11.0.source.tar.bz2
tar -xvf thunder-bird-11.0.source.tar.bz2
cd comm-release/

Start the build
./configure --disable-necko-wifi
make -j3

3 is the number of cores +1. If you have a quadcore CPU substitute 3 with 5. The build takes a while so you will probably want to do a parallel build.

Finally, to install
sudo make install



checkinstall is segfaulting for me.

Error:

/home/me/tmp/comm-release/mozilla/js/src/config/nsinstall -R -m 644 ../mozilla-config.h ../../../config/nsStaticComponents.h  ../../../dist/include
make[5]: /home/me/tmp/comm-release/mozilla/js/src/config/nsinstall: Command not found
make[5]: *** [export] Error 127
make[5]: Leaving directory `/home/me/tmp/comm-release/mozilla/js/src/config'
make[4]: *** [export] Error 2
make[4]: *** Waiting for unfinished jobs....
make[4]: Leaving directory `/home/me/tmp/comm-release/mozilla/js/src'
make[3]: *** [export_tier_js] Error 2
make[3]: Leaving directory `/home/me/tmp/comm-release/mozilla'
make[2]: *** [tier_js] Error 2
make[2]: Leaving directory `/home/me/tmp/comm-release/mozilla'
make[1]: *** [default] Error 2
make[1]: Leaving directory `/home/me/tmp/comm-release/mozilla'
Solution:
I got this error because I accidentally untared the new sources into an existing directory with an older version of thunderbird. The solution was to delete the directory and untar the sources again.


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.