I was able to get a working Cygwin build of ledger 3 built from git master 
on my 64-bit Windows 7 machine.

Steps:

Using Cygwin setup, install the following packages:  libboost-devel, gmp, 
mpfr, gettext, libedit, python, doxygen, texinfo, cmake, gcc.

I was not able to find the following packages stock from Cygwin, so I just 
skipped them:  graphvis, lcov, sloccount

When setup was completed, I ran into the infamous process fork error, 
requiring a "rebaseall" to fix.  See http://cygwin.wikia.com/wiki/Rebaseall

If you have a Win32 version of CMake installed in addition to Cygwin cmake, 
make sure that the Win32 Cmake is not on your path at all.  It is not 
enough to ensure that the Cygwin cmake is first on the path.  I ran into 
this.  Even though "which cmake" from the Cygwin shell responded with the 
expected "/usr/bin/cmake", when I actually ran the CMake I found that it 
was somehow running the Win32 Cmake.  The Win32 Cmake uses different path 
defaults for finding packages, and it will not work to build ledger.  
Debugging this was the most time-consuming part of this whole process.

The Cygwin packaging of boost is strange.  Cygwin setup makes a distinction 
between installing the binaries and installing the source for each 
package.  Of course, boost is mostly source code.  The current Cygwin 
package directory has boost 1.46.1 and 1.48.  I was unable to get it to 
install the boost headers for 1.46.1 with any combination of "binary" and 
"source" installation options.  I eventually just installed libboost-devel, 
which installed the headers for boost 1.48.  I had to modify CMakeLists.txt 
to specify 1.48 instead of 1.46.

>From a Cygwin prompt at the top level ledger directory, run
    
    cmake -G "Unix Makefiles" .

Strangely, I had to repeat this a few times before it succeeded.  I didn't 
take detailed notes at this point, but I'm sure it failed a few times not 
being able to find mpfr and gmp, but then it eventually found them even 
though I had already installed them before I ran cmake for the first time.  
The Win32 cmake conflict may have caused this.  

Finally:

   ./acprep update

and ledger built without any further difficulties.  When I ran the 
resulting executable, I got yet another Cygwin process fork error.  I had 
to do another Cygwin rebaseall; I suppose this remapped the load address 
for libledger.

As other people have already described, when I ran ledger I got a segfault 
with the error "Exception during initialization: 
locale::facet::_S_create_locale name not valid".  I set LANG to "" and that 
problem went away, i.e.:

    export LANG=""
    ledger bal

This produced the desired ledger balance report.  That's all I've tried so 
far.

Tim Crews

Reply via email to