Thursday, March 10, 2011

Building AbiWord 2.9.0 on Ubuntu 10.04 / 64 bit from Source

Short and sweet information on this can be found from AbiWord wiki. This post just deals with a few commonest errors found in building AbiWord, when it goes wrong.

As we are happily moving towards the release of AbiWord-3.0.0, many developers are joining the effort. With the announcement of Google Summer of Code-2011, many students too are interested in joining the project. This guide targets to help anyone to build AbiWord on Ubuntu 10.04/64 bit. This is still applicable to many other linux distributions too, though it is tested on Ubuntu. Unlike the usual building guides, this one is going to follow the worst-path -- assuming every failed cases, for a complete novice.. :)
So, as mentioned in the AbiWord's wiki page, let's start with installing autoconf.
sudo apt-get install autoconf

pradeeban@pradeeban:~/programs/abiword$ sh
Can't exec "libtoolize": No such file or directory at /usr/bin/autoreconf line 189.
Use of uninitialized value in pattern match (m//) at /usr/bin/autoreconf line 189. error: possibly undefined macro: AC_LIBTOOL_WIN32_DLL
      If this token and others are legitimate, please use m4_pattern_allow.
      See the Autoconf documentation. error: possibly undefined macro: AC_PROG_LIBTOOL
autoreconf: /usr/bin/autoconf failed with exit status: 1
Running ./configure --enable-maintainer-mode ...
configure: error: cannot find install-sh,, or shtool in "." "./.." "./../.."
OK. We need libtool installed!

sudo apt-get install libtool


pradeeban@pradeeban:~/programs/abiword$ sh
checking pkg-config is at least version 0.9.0... yes
checking whether gcc understands -Wall... no
checking whether gcc understands -Wextra... no
checking whether gcc understands -Wsign-compare... no
checking whether gcc understands -Wpointer-arith... no
checking whether gcc understands -Wchar-subscripts... no
checking whether gcc understands -Wwrite-strings... no
checking whether gcc understands -Wmissing-noreturn... no
checking whether gcc understands -Wunused... no
checking whether gcc understands -Wpointer-arith... no
checking whether gcc understands -Wshadow... no
checking for libpng... no
checking for libpng14... no
checking for libpng12... no
checking png.h usability... no
checking png.h presence... no
checking for png.h... no
configure: error: `png.h' not found, install libpng or specify CPPFLAGS to include custom locations

As we can see, we will be installing each of the dependencies one by one, if we follow the same steps like this.
But we actually need not to!
pradeeban@pradeeban:~/programs/abiword$ sudo apt-get build-dep abiword
Reading package lists... Done
Building dependency tree      
Reading state information... Done
Note, selecting libwpd8-dev instead of libwpd-dev
Note, selecting libxslt1-dev instead of libxslt-dev
The following NEW packages will be installed:
  build-essential cdbs cvs debhelper diffstat dpkg-dev fakeroot fdupes g++ g++-4.4 gettext html2text intltool intltool-debian libaiksaurus-1.2-0c2a
  libaiksaurus-1.2-data libaiksaurus-1.2-dev libaiksaurusgtk-1.2-0c2a libaiksaurusgtk-1.2-dev libasio-dev libatk1.0-dev libboost-date-time-dev
  libboost-date-time1.40-dev libboost-date-time1.40.0 libboost-dev libboost-regex-dev libboost-regex1.40-dev libboost-regex1.40.0 libboost-serialization1.40-dev
  libboost-serialization1.40.0 libboost1.40-dev libbz2-dev libcairo2-dev libdbus-1-dev libdbus-glib-1-dev libdirectfb-dev libdirectfb-extra libenchant-dev
  libexpat1-dev libfontconfig1-dev libfreetype6-dev libfribidi-dev libgconf2-dev libgcrypt11-dev libgdome2-0 libgdome2-cpp-smart-dev libgdome2-cpp-smart0c2a
  libgdome2-dev libglade2-dev libglib2.0-dev libgnutls-dev libgoffice-0.8-8 libgoffice-0.8-8-common libgoffice-0.8-dev libgpg-error-dev libgsf-1-dev libgtk2.0-dev
  libgtkmathview-dev libgtkmathview0c2a libgucharmap2-dev libice-dev libicu-dev libidl-dev libidn11-dev libjpeg62-dev liblink-grammar4 liblink-grammar4-dev
  libloudmouth1-dev libmail-sendmail-perl libncurses5-dev liborbit2-dev libots-dev libots0 libpango1.0-dev libpixman-1-dev libpng12-dev libpopt-dev libpsiconv-dev
  libpsiconv6 libpthread-stubs0 libpthread-stubs0-dev libreadline-dev libreadline6-dev librsvg2-dev libsm-dev libsoup2.4-dev libssl-dev libstdc++6-4.4-dev
  libsys-hostname-long-perl libsysfs-dev libt1-dev libt1-doc libtasn1-3-dev libwmf-dev libwpd-stream8c2a libwpd8-dev libwpg-dev libwps-dev libwv-1.2-3 libwv-dev
  libx11-dev libxau-dev libxaw7-dev libxcb-render-util0-dev libxcb-render0-dev libxcb1-dev libxcomposite-dev libxcursor-dev libxdamage-dev libxdmcp-dev libxext-dev
  libxfixes-dev libxft-dev libxi-dev libxinerama-dev libxml2-dev libxmu-dev libxmu-headers libxpm-dev libxrandr-dev libxrender-dev libxslt1-dev libxt-dev
  link-grammar-dictionaries-en orbit2 po-debconf quilt x11proto-composite-dev x11proto-core-dev x11proto-damage-dev x11proto-fixes-dev x11proto-input-dev
  x11proto-kb-dev x11proto-randr-dev x11proto-render-dev x11proto-xext-dev x11proto-xinerama-dev xtrans-dev xz-utils zlib1g-dev
0 upgraded, 140 newly installed, 0 to remove and 3 not upgraded.
Need to get 60.4MB of archives.
After this operation, 269MB of additional disk space will be used.
Do you want to continue [Y/n]? Y
Now again,
pradeeban@pradeeban:~/programs/abiword$ sh
checking for libpng... yes
checking for PNG... yes
checking jpeglib.h usability... yes
checking jpeglib.h presence... yes
checking for jpeglib.h... yes
checking for jpeg_read_header in -ljpeg... yes
checking zlib.h usability... yes
checking zlib.h presence... yes
checking for zlib.h... yes
checking for DEPS... yes
checking for GTK214... yes
checking for GSFGI... yes
checking for PLUGIN... yes
checking for OPENDOCUMENT... configure: error: Package requirements ( libgsf-1 >= 1.12 redland >= 1.0.10 rasqal >= 0.9.17 ) were not met:

No package 'redland' found
No package 'rasqal' found

Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.

Alternatively, you may set the environment variables OPENDOCUMENT_CFLAGS
and OPENDOCUMENT_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.

Let's fix the redland RDF dependency issue by installing it.
pradeeban@pradeeban:~$ sudo apt-get install librdf0-dev

again, pradeeban@pradeeban:~/programs/abiword$ sh Now it builds fine!
config.status: creating plugins/ots/xp/Makefile
config.status: creating config.h
config.status: config.h is unchanged
config.status: executing depfiles commands
config.status: executing libtool commands

  host                  x86_64-unknown-linux-gnu
  dynamic binary        yes
  static binary         no
  platform              unix (embedded: no)
  toolkit               gtk
  debug                 no

Optional features:
  menubutton            no
  printing              yes
  spell checking        yes
  status bar            yes
  emacs keybinding      yes
  vi keybinding         yes
  clipart               no
  templates             no

Optional dependencies:
  gtk2 > 2.14           yes
  gnome-vfs             no
  gio            yes
  gsf-gio               yes
  goffice               yes

Builtin plugins        
Plugins                 opendocument

Now type `make' to compile.

pradeeban@pradeeban:~/programs/abiword$ make
"make" goes fine too.
Let's "make install" now!
pradeeban@pradeeban:~/programs/abiword$ make install
test -z "/usr/local/share/abiword-2.9/ui" || /bin/mkdir -p "/usr/local/share/abiword-2.9/ui"
/bin/mkdir: cannot create directory `/usr/local/share/abiword-2.9': Permission denied
make[6]: *** [install-uiDATA] Error 1
make[6]: Leaving directory `/home/pradeeban/programs/abiword/src/af/xap/gtk'
make[5]: *** [install-am] Error 2
make[5]: Leaving directory `/home/pradeeban/programs/abiword/src/af/xap/gtk'
make[4]: *** [install-recursive] Error 1
make[4]: Leaving directory `/home/pradeeban/programs/abiword/src/af/xap/gtk'
make[3]: *** [install-recursive] Error 1
make[3]: Leaving directory `/home/pradeeban/programs/abiword/src/af/xap'
make[2]: *** [install-recursive] Error 1
make[2]: Leaving directory `/home/pradeeban/programs/abiword/src/af'
make[1]: *** [install-recursive] Error 1
make[1]: Leaving directory `/home/pradeeban/programs/abiword/src'
make: *** [install-recursive] Error 1

If this permission issue arises, pls change the write permission of usr/local/share, usr/local/bin, usr/local/include, and usr/include/lib. That will make abiword-2.9 ending up in the above directories respectively.
pradeeban@pradeeban:~/programs/abiword$ make install
Now it goes fine indeed!

Now let's just run AbiWord from terminal and see whether it runs!
pradeeban@pradeeban:~$ abiword 
abiword: error while loading shared libraries: cannot open shared object file: No such file or directory

Typical linking issue.
pradeeban@pradeeban:~$cd /lib
pradeeban@pradeeban:/lib$sudo ln -s /usr/local/lib/

Now again,
pradeeban@pradeeban:~$ abiword

YAYYY! AbiWord-2.9.0 is running!!!

you also can debug AbiWord using gdb.
pradeeban@pradeeban:~$ gdb abiword

However, my apologies for posting this lengthy post for a simple task. Just followed the worst case to cover all the student queries regarding building AbiWord-2.9.0 from trunk using Linux on terminal.

No comments:

Post a Comment

Relevant comments and feedback are always encouraged.

Comments with spam links to random web sites and services are deleted, to maintain the quality and relevance of the forum. If you are rather interested in advertising in this blog, feel free to send a message to the blog administrator.

Thank you.