Debian squeeze, which is currently the stable distribution at the time of this commit, has both a Boost and a CMake that is too old for Ledger. This FAQ entry explains how to build your own Boost and CMake for use with Ledger, and the exact commands to type to build and install each, and then configure, build and install Ledger against those new versions.
156 lines
6.4 KiB
Text
156 lines
6.4 KiB
Text
|
|
README FIRST!!!
|
|
|
|
To build this code after doing a Git clone, run:
|
|
|
|
$ ./acprep update
|
|
|
|
If you try to configure and build on your own, you are almost certainly going
|
|
to run into problems. In future, you can run this command again and again,
|
|
and it will keep you updated to the very latest version.
|
|
|
|
I further recommend building both debug and optimized versions of Ledger, in a
|
|
subdirectory of your source tree named 'build' (which acprep will manage for
|
|
you, you simply need to create it):
|
|
|
|
$ mkdir build
|
|
$ ./acprep opt make
|
|
$ ./acprep debug make
|
|
|
|
Now install the optimized version, but know that you have 'build/debug/ledger'
|
|
available for testing and more useful bug reports.
|
|
|
|
===============================================================================
|
|
|
|
IF YOU HAVE CONFIGURE OR BUILD PROBLEMS
|
|
|
|
To build and install Ledger requires several dependencies on various
|
|
platforms. You can install these dependencies very simply for most of them
|
|
using:
|
|
|
|
$ ./acprep dependencies
|
|
|
|
The first order of business if acprep update doesn't work is to find out where
|
|
things went wrong. So follow these steps to produce a bug report I can track
|
|
down easily:
|
|
|
|
$ ./acprep --debug update # shows what acprep was thinking
|
|
$ <edit config.log> # shows what configure was thinking
|
|
|
|
With the contents of config.log, and the output from acprep --debug update,
|
|
it's usually fairly obvious where things have gone astray.
|
|
|
|
===============================================================================
|
|
|
|
F.A.Q.
|
|
|
|
- Q: The build fails saying it can't find utf8.h
|
|
|
|
A: You didn't run ./acprep update.
|
|
|
|
----------------------------------------------------------------------
|
|
|
|
- Q: Configure fails saying it can't find boost_regex
|
|
|
|
A: Look in config.log and search for "boost_regex", then scroll down a bit
|
|
until you see the exact compile error. Usually it's failing because
|
|
your include directory is different from anything acprep is expecting to
|
|
see. It could also be failing because your Boost libraries have a
|
|
custom "suffix" on them.
|
|
|
|
Let's say your Boost was installed in ~/boost, and every library has the
|
|
suffix '-xgcc42'. This is what you would run:
|
|
|
|
CPPFLAGS=-I$HOME/boost acprep --boost=xgcc42 update
|
|
|
|
----------------------------------------------------------------------
|
|
|
|
- Q: Configure fails saying it can't find MPFR
|
|
|
|
A: You need MPFR version 2.4.0 or higher. This version does not come with
|
|
most Debian distributions, so you will need to build it.
|
|
|
|
----------------------------------------------------------------------
|
|
|
|
- Q: I'm seeing a segfault deep inside the boost_regex code!
|
|
|
|
A: Actually, the real segfault is in libstdc++'s facet code. It's being
|
|
caused by using a debug Boost with a non-debug build of Ledger, or
|
|
vice-versa.
|
|
|
|
----------------------------------------------------------------------
|
|
|
|
- Q: Something else fails, or Ledger crashes on startup
|
|
|
|
A: This, I am most interested in hearing about. Please e-mail me a copy of
|
|
config.log and your build log to <johnw@newartisans.com>. Also, if
|
|
Ledger is crashing, try running it under gdb like so:
|
|
|
|
$ gdb ledger
|
|
(gdb) run <ARGS TO LEDGER>
|
|
... runs till crash ...
|
|
(gdb) bt
|
|
|
|
Send me that backtrace output, and the output from "ledger --version".
|
|
|
|
----------------------------------------------------------------------
|
|
|
|
- Q: Whenever I try to use the Python support, I get a segfault
|
|
|
|
A: Make sure that the boost_python library you linked against is using the
|
|
exact same Python as the Ledger executable. In particular I see this
|
|
bug on OS X systems where boost_python is linked against the default
|
|
Python, while Ledger is linked against the version provided by MacPorts.
|
|
Or vice versa.
|
|
|
|
Solution: Use one or the other. If you prefer the system Python, run
|
|
"port deactivate -f python26", to get MacPorts' version out of the way.
|
|
You'll then need to delete the Ledger binary and run "make" to relink
|
|
it.
|
|
|
|
----------------------------------------------------------------------
|
|
|
|
- Q: When I run "make check", the Python unit tests always crash
|
|
|
|
A: This can happen for the same reason as above. It can also happen if you
|
|
have ICU support enabled. This is a bug I'm still trying to track down.
|
|
|
|
----------------------------------------------------------------------
|
|
|
|
- Q: My distribution has a versions of Boost and/or CMake that are too
|
|
old for Ledger. How do I build my own Boost and/or CMake binaries
|
|
that will work properly with Ledger? Thereafter, how do I configure
|
|
Ledger properly to use those newly built verisons of Boost and/or
|
|
CMake?
|
|
|
|
A: Here's commands that one user used to make this work, for Boost
|
|
1.51.0 on Debian GNU/Linux 6.0.x (aka Debian squeeze). It's likely
|
|
to work ok for other versions of Boost as well. YMMV on other
|
|
distributions and/or other Debian distribution versions, though.
|
|
|
|
# Preparing and building Boost 1.51.0
|
|
|
|
$ cd /somewhere/you/want/to/build/boost
|
|
$ wget -N http://iweb.dl.sourceforge.net/project/boost/boost/1.51.0/boost_1_51_0.tar.bz2
|
|
$ tar xvf boost_1_51_0.tar.bz2
|
|
$ cd boost_1_51_0
|
|
$ ./bootstrap.sh
|
|
$ ./b2 --build-type=complete --layout=tagged --prefix=/where/you/want/boost/installed
|
|
$ ./b2 --build-type=complete --layout=tagged --prefix=/where/you/want/boost/installed install
|
|
|
|
# Preparing and building CMake 2.8.8
|
|
|
|
$ cd /somewhere/you/want/to/build/cmake
|
|
$ wget -N http://www.cmake.org/files/v2.8/cmake-2.8.8.tar.gz
|
|
$ tar xvf cmake-2.8.8.tar.gz
|
|
$ cd cmake-2.8.8
|
|
$ ./configure --prefix=/where/you/want/cmake/installed/
|
|
$ make
|
|
$ make install
|
|
|
|
# Building Ledger using the CMake and/or Boost as installed above
|
|
|
|
$ cd /path/to/ledger/sources
|
|
$ env PATH=/where/you/want/cmake/installed/bin:$PATH BOOST_ROOT=/where/you/want/boost/installed ./acprep --prefix=/where/you/want/ledger/installed --debug --python config
|
|
$ env PATH=/where/you/want/cmake/installed/bin:$PATH BOOST_ROOT=/where/you/want/boost/installed ./acprep --prefix=/where/you/want/ledger/installed --debug --python make
|
|
$ env PATH=/where/you/want/cmake/installed/bin:$PATH BOOST_ROOT=/where/you/want/boost/installed ./acprep --prefix=/where/you/want/ledger/installed --debug --python install
|