Windows build » History » Version 78

« Previous - Version 78/98 (diff) - Next » - Current version
herck, 11 Nov 2015 17:52


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 http://www.microsoft.com/en-US/download/details.aspx?id=40783
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

from http://continuum.io/downloads
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

C:\opt\local_x86\include
C:\opt\local_x86\lib

Install boost
  • install zlib and bzip2

from http://www.zlib.net/ into C:\temp\zlib-1.2.8
from http://www.bzip.org/downloads.html 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 http://sourceforge.net/projects/boost/files/boost/
Unpack boost_1_58_0.zip to C:\temp\boost_1_58_0
Run VS2012 x86 native tools command prompt
cd C:\temp\boost_1_58_0
bootstrap.bat
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 fftw-3.3.4-dll32.zip 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 gsl-1.16_winbin.zip from https://azylstra.net/blog/post/building-gsl-on-windows
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 tiff-4.0.6.zip from http://download.osgeo.org/libtiff/
  • 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 makefile.vc"

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\.

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

C:\development\build-x86
cmake -G "Visual Studio 12" -DCMAKE_INCLUDE_PATH=C:/opt/local_x86/include -DCMAKE_LIBRARY_PATH=C:/opt/local_x86/lib ../BornAgain

  • Then 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 http://www.farmanager.com/download.php?l=en
Install conemy http://conemu.github.io/

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\.