Skip to content
This repository has been archived by the owner on May 28, 2022. It is now read-only.

maxwell-k/ledger-windows-build

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build ledger on Windows

Overview and versions

These instructions assume the ``git`` command line client is available and on ``$PATH``.

  1. Install Visual Studio Community 2019
  2. Install CMake 3.14.4
  3. Clone this repository
  4. Build Boost 1.70.0
  5. Build MPIR (master)
  6. Build MPFR (master)
  7. Build ledger (master)

Detail

  1. Download, install Visual Studio Community 2019
  2. Download and install CMake; adding it to the PATH

In the steps below 'at the command prompt' means use the `Developer Command Prompt for VS 2019` to execute the commands listed, starting with the current directory as the repository root.

  1. At the command prompt run the following to clone this repository and the sub-modules:

    git clone https://github.com/maxwell-k/ledger-windows-build --recursive
    

    Use a different URL above if you are using a fork of the original instructions.

  2. Download and extract boost_1_70_0 to the root of this repository, then build Boost using the following at the command prompt:

    ren boost_1_70_0 boost
    cd boost
    .\bootstrap.bat
    .\b2.exe link=static runtime-link=static threading=multi ^
       --layout=versioned
    
  3. Patch build files for mpir: On lines 22 and 23 of mpirmsvcvs19msbuild.bat change 15.0 to Current. On lines 76 and 85 of mpirmsvcvs19lib_mpir_gclib_mpir_gc.vcxproj change 17 to 19

  4. At the command prompt run the following to build mpir:

    cd mpir\msvc\vs19
    .\msbuild.bat gc LIB Win32 Release
    

    Note

    For unknown reasons, possibly due to a subtle bug in the build script the last command may fail on the first two attempts. It ususally works at the third attempt or later.

  5. At the command prompt run the following to build mpfr:

    cd mpfr\build.vs19\lib_mpfr
    msbuild /p:Configuration=Release lib_mpfr.vcxproj
    
  6. At the command prompt run the following to build ledger.exe:

    cd ledger
    cmake ^
        -DCMAKE_BUILD_TYPE:STRING="Release" ^
        -DBUILD_LIBRARY=OFF ^
        -DMPFR_LIB:FILEPATH="../../mpfr/build.vs19/lib/Win32/Release/mpfr"^
        -DGMP_LIB:FILEPATH="../../mpir/lib/win32/Release/mpir" ^
        -DMPFR_PATH:PATH="../mpfr/lib/Win32/Release" ^
        -DGMP_PATH:PATH="../mpir/lib/win32/Release" ^
        -DBUILD_DOCS:BOOL="0" ^
        -DHAVE_REALPATH:BOOL="0" ^
        -DHAVE_GETPWUID:BOOL="0" ^
        -DHAVE_GETPWNAM:BOOL="0" ^
        -DHAVE_IOCTL:BOOL="0" ^
        -DHAVE_ISATTY:BOOL="0" ^
        -DBOOST_ROOT:PATH="../boost/" ^
        -DBoost_USE_STATIC_LIBS:BOOL="1" ^
        -DCMAKE_CXX_FLAGS_RELEASE:STRING="/MT /Zi /Ob0 /Od" ^
        -A Win32
        -G "Visual Studio 16"
    msbuild /p:Configuration=Release src\ledger.vcxproj
    copy Release\ledger.exe ..\
    

    Note

    The error message about not being able to find Python can be safely ignored. Python is only used for running tests, which is not part of the build process described here.

Updating to a later version of ledger, mpir or mpfr

To build a more recent version of ledger, or either the mpir or mpfr dependency, run the following at the command prompt after the initial git clone above:

cd ledger
git checkout master
cd ../mpir
git checkout master
cd ../mpfr
git checkout master

Note

To produce a different version or use different dependencies, you can use any appropriate branch or commit hash in place of master. Other versions may require a different build process to that documented above.

Notes

  • These instructions are based upon the wiki page by Tim Crews.
  • Boost is time consuming to build, especially as we have to build all of the libraries to build the unit test framework; the other libraries can be built at the same time.
  • Thanks to Andrew Savinykh for recent updates.

Licenses

Boost

Distributed under the Boost Software License, Version 1.0. (See
accompanying file LICENSE_1_0.txt or copy at
http://www.boost.org/LICENSE_1_0.txt)

MPIR

Copyright 1993, 1994, 1995, 1996, 1997, 2000, 2001, 2002, 2003, 2005 Free
Software Foundation, Inc.

Copyright 2009 B R Gladman

This file is part of the GNU MP Library.

The GNU MP Library is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation; either version 2.1 of the License, or (at
your option) any later version.

The GNU MP Library is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
License for more details.

You should have received a copy of the GNU Lesser General Public License
along with the GNU MP Library; see the file COPYING.LIB.  If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.

MPFR

Copyright 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
2011, 2012, 2013 Free Software Foundation, Inc. Contributed by the AriC and
Caramel projects, INRIA.

The GNU MPFR Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public License as
published by the Free Software Foundation; either version 3 of the License,
or (at your option) any later version.

The GNU MPFR Library is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
License for more details.

You should have received a copy of the GNU Lesser General Public License
along with the GNU MPFR Library; see the file COPYING.LESSER.  If not, see
http://www.gnu.org/licenses/ or write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.

Ledger

Copyright (c) 2003-2009, John Wiegley.  All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

- Redistributions of source code must retain the above copyright notice,
  this list of conditions and the following disclaimer.

- Redistributions in binary form must reproduce the above copyright notice,
  this list of conditions and the following disclaimer in the documentation
  and/or other materials provided with the distribution.

- Neither the name of New Artisans LLC nor the names of its
  contributors may be used to endorse or promote products derived from
  this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.

About

Instructions for building ledger on Windows

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published