Windows build » History » Version 75

« Previous - Version 75/98 (diff) - Next » - Current version
pospelov, 27 Oct 2015 16:36

Windows build

BornAgain compilation under Windows using Microsoft Visual Studio 2013.

see also Obsolete instruction for MSVC2012

To install x86

Install VS.NET2013
  • Install Visual Studio using our VS.NET2012 package

Download and install Microsoft Visual Studio 2013 Language Pack from
Set English in Tools -> Optionen -> Internationale

Install cmake

by running cmake-3.2.3-win32-x86.exe
select option "add cmake to the system PATH for all users"

Install NSIS

version NSIS 3.0b1

Install Qt5.5
  • Use online installer

Deselect 5.4, select 5.5 and msvc2013 32-bit and msvc2013 64-bit
Add to path c:\Qt\5.5\msvc2013\bin
Create environment variable QTDIR=C:\Qt\5.5\msvc2013

Install Python
  • Install Anaconda Python 2.7 32bit

For all users, into C:\Anaconda (this path is hard coded in Core/CMakeLists.txt to pick up Python27.dll)
let it modify PATH

Create directory C:\opt\local_x86


Install boost
  • install zlib and bzip2

from into C:\temp\zlib-1.2.8
from into C:\temp\bzip2-1.0.6

Patch bzip2 installation (MSVC specific!)
Namely delete first line ("LIBRARY LIBBZ2") from file libbz2.def
This will remove unnecessary dependency from external bzip2 during later linking of boost libraries into other project

  • Compile boost

Download boost from
Unpack to C:\temp\boost_1_58_0
Run VS2012 x86 native tools command prompt
cd C:\temp\boost_1_58_0
b2 toolset=msvc-12.0 --abbreviate-paths architecture=x86 address-model=32 install --prefix=c:\temp\boost_1_58_0_installed -sBZIP2_SOURCE="C:\temp\bzip2-1.0.6" -sZLIB_SOURCE="C:\temp\zlib-1.2.8" variant=release link=static,shared threading=multi

  • Copy boost

Copy or move directory c:\temp\boost_1_58_0_installed\include\boost-1_58\boost to C:\opt\local_x86\include\boost
Copy or move content of c:\temp\boost_1_58_0_installed\lib\* to C:\opt\local_x86\lib\.

Install fftw3

download and unpack into temporary directory C:\temp\fftw3
generate lib file

open "VS2013 x86 Native Tools Command Prompt" from Windows menu All Programs/Microsoft Visual Studio 2013/Tools
cd C:\temp\fftw3
lib /def:libfftw3-3.def

copy c:\temp\fftw3\fftw3.h to C:\opt\local_x86\include\.
copy c:\temp\fftw3\libfftw3-3.lib to C:\opt\local_x86\lib\.
copy c:\temp\fftw3\libfftw3-3.def to C:\opt\local_x86\lib\.
copy c:\temp\fftw3\libfftw3-3.dll to C:\opt\local_x86\lib\.

Install GSL
  • All previous recepies disappeared from internet
  • Found out that one

Download from
Unpack to C:\temp\gsl-1.16
Copy directory C:\temp\gsl-1.16\gsl\x86\include\gsl to C:\opt\local_x86\include\.
Copy content C:\temp\gsl-1.16\gsl\x86\lib\* to C:\opt\local_x86\lib\.

Install TIFF
  • Download from
  • Unpack to C:\temp\libtiff-4.0.6
  • Run from Start menu "VS2013 x86 Tools Command Prompt" console
  • cd C:\temp\libtiff-4.0.6, compile with "nmake /f"

Copy library file C:\temp\libtiff-4.0.6\libtiff\libtiff.dll to C:\opt\local_x86\lib\.
Copy library file C:\temp\libtiff-4.0.6\libtiff\libtiff.lib to C:\opt\local_x86\lib\.
Copy header files C:\temp\libtiff-4.0.6\libtiff\*.h to C:\opt\local_x86\include\libtiff\.

  • Add c:\opt\local_x86\lib to PATH
Generate project file for MSVS 2013
  • Change to build directory

cmake -G "Visual Studio 122" -DCMAKE_INCLUDE_PATH=C:/opt/local_x86/include -DCMAKE_LIBRARY_PATH=C:/opt/local_x86/lib ../BornAgain

  • When open BornAgain.sln in Microsoft Visual Studio, select Release/32bit build type. Build project.
Making binary installer
  • After build is complete, installer is generated by running in the build directory the command

CPack -C Release

Useful programs

  • FarManager together with Conemy helps to work in console, for example it gives possibility to scroll long output

Install FarManager from
Install conemy

Some obsolete staff

by running boost_1_58_0-msvc-12.0-32.exe
Install in the temporary directory C:\temp\boost_1_58_0
Copy content of the directory C:\temp\boost_1_58_0\lib32-msvc-12.0\* in the C:\opt\local_x86\lib\.
Copy whole directory C:\temp\boost_1_58_0\boost into C:\opt\local_x86\include\.