Windows build » History » Version 79

herck, 12 Nov 2015 11:18

1 1 herck
h1. Windows build
2 1 herck
3 61 pospelov
4 1 herck
BornAgain compilation under Windows using Microsoft Visual Studio 2013.
5 68 pospelov
> see also [[Obsolete instruction for MSVC2012]]
6 1 herck
7 1 herck
8 68 pospelov
9 69 pospelov
10 68 pospelov
h1. To install x86
11 68 pospelov
12 63 pospelov
h5. Install VS.NET2013
13 47 pospelov
14 47 pospelov
* Install Visual Studio using our VS.NET2012 package
15 66 pospelov
> Download and install Microsoft Visual Studio 2013 Language Pack from http://www.microsoft.com/en-US/download/details.aspx?id=40783
16 66 pospelov
> Set English in Tools -> Optionen -> Internationale
17 67 pospelov
18 67 pospelov
19 67 pospelov
h5. Install cmake
20 67 pospelov
21 67 pospelov
* Install cmake from http://www.cmake.org/download 
22 67 pospelov
> by running cmake-3.2.3-win32-x86.exe
23 67 pospelov
> select option "add cmake to the system PATH for all users"
24 67 pospelov
25 67 pospelov
26 67 pospelov
h5. Install NSIS
27 67 pospelov
28 67 pospelov
* Install NSIS from http://nsis.sourceforge.net/Download 
29 1 herck
> version NSIS 3.0b1
30 67 pospelov
31 68 pospelov
h5. Install Qt5.5
32 1 herck
33 68 pospelov
* Use online installer
34 68 pospelov
> Deselect 5.4, select 5.5 and msvc2013 32-bit and msvc2013 64-bit
35 68 pospelov
> Add to path c:\Qt\5.5\msvc2013\bin
36 69 pospelov
> Create environment variable QTDIR=C:\Qt\5.5\msvc2013
37 68 pospelov
38 73 pospelov
h5. Install Python
39 73 pospelov
40 73 pospelov
* Install Anaconda Python 2.7 32bit
41 73 pospelov
> from http://continuum.io/downloads
42 74 pospelov
> For all users, into C:\Anaconda (this path is hard coded in Core/CMakeLists.txt to pick up Python27.dll)
43 74 pospelov
> let it modify PATH
44 73 pospelov
45 67 pospelov
h5. Create directory C:\opt\local_x86
46 67 pospelov
> C:\opt\local_x86\include
47 67 pospelov
> C:\opt\local_x86\lib
48 67 pospelov
49 67 pospelov
h5. Install boost
50 67 pospelov
51 70 pospelov
* install zlib and bzip2
52 70 pospelov
> from http://www.zlib.net/ into C:\temp\zlib-1.2.8
53 70 pospelov
> from http://www.bzip.org/downloads.html into C:\temp\bzip2-1.0.6
54 70 pospelov
>> Patch bzip2 installation (MSVC specific!)
55 70 pospelov
>> Namely delete first line ("LIBRARY LIBBZ2") from file libbz2.def
56 70 pospelov
>> This will remove unnecessary dependency from external bzip2 during later linking of boost libraries into other project
57 1 herck
58 70 pospelov
* Compile boost
59 1 herck
> Download boost from http://sourceforge.net/projects/boost/files/boost/
60 79 herck
> Unpack boost_1_59_0.zip to C:\temp\boost_1_59_0
61 1 herck
> Run VS2012 x86 native tools command prompt
62 79 herck
> cd C:\temp\boost_1_59_0
63 1 herck
> bootstrap.bat
64 79 herck
> b2 toolset=msvc-12.0 --abbreviate-paths architecture=x86 address-model=32 install --prefix=c:\temp\boost_1_59_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
65 72 pospelov
66 72 pospelov
* Copy boost
67 79 herck
> Copy or move directory c:\temp\boost_1_59_0_installed\include\boost-1_59\boost to  C:\opt\local_x86\include\boost
68 79 herck
> Copy or move content of c:\temp\boost_1_59_0_installed\lib\* to C:\opt\local_x86\lib\.
69 70 pospelov
70 67 pospelov
h5. Install fftw3
71 67 pospelov
72 67 pospelov
* Install fftw3 from http://www.fftw.org/install/windows.html
73 67 pospelov
> download  fftw-3.3.4-dll32.zip and unpack into temporary directory C:\temp\fftw3
74 67 pospelov
> generate lib file
75 67 pospelov
>> open "VS2013 x86 Native Tools Command Prompt" from Windows menu All Programs/Microsoft Visual Studio 2013/Tools
76 67 pospelov
>> cd C:\temp\fftw3
77 67 pospelov
>> lib /def:libfftw3-3.def
78 67 pospelov
79 67 pospelov
> copy c:\temp\fftw3\fftw3.h to C:\opt\local_x86\include\.
80 67 pospelov
> copy c:\temp\fftw3\libfftw3-3.lib to C:\opt\local_x86\lib\.
81 1 herck
> copy c:\temp\fftw3\libfftw3-3.def to C:\opt\local_x86\lib\.
82 1 herck
> copy c:\temp\fftw3\libfftw3-3.dll to C:\opt\local_x86\lib\.
83 68 pospelov
84 68 pospelov
h5. Install GSL
85 68 pospelov
86 68 pospelov
* All previous recepies disappeared from internet
87 68 pospelov
* Found out that one
88 68 pospelov
> Download gsl-1.16_winbin.zip from https://azylstra.net/blog/post/building-gsl-on-windows
89 68 pospelov
> Unpack to C:\temp\gsl-1.16
90 68 pospelov
> Copy directory C:\temp\gsl-1.16\gsl\x86\include\gsl to  C:\opt\local_x86\include\.
91 68 pospelov
> Copy content C:\temp\gsl-1.16\gsl\x86\lib\* to  C:\opt\local_x86\lib\.
92 68 pospelov
93 75 pospelov
h5. Install TIFF
94 75 pospelov
95 75 pospelov
* Download tiff-4.0.6.zip from http://download.osgeo.org/libtiff/
96 75 pospelov
* Unpack to C:\temp\libtiff-4.0.6
97 75 pospelov
* Run from Start menu "VS2013 x86 Tools Command Prompt" console
98 75 pospelov
* cd C:\temp\libtiff-4.0.6, compile with "nmake /f makefile.vc"
99 75 pospelov
> Copy library file C:\temp\libtiff-4.0.6\libtiff\libtiff.dll to C:\opt\local_x86\lib\.
100 75 pospelov
> Copy library file C:\temp\libtiff-4.0.6\libtiff\libtiff.lib to C:\opt\local_x86\lib\.
101 78 herck
> Copy header files C:\temp\libtiff-4.0.6\libtiff\*.h* to C:\opt\local_x86\include\libtiff\.
102 75 pospelov
103 68 pospelov
h5. PATH
104 68 pospelov
105 68 pospelov
* Add c:\opt\local_x86\lib to PATH
106 68 pospelov
107 69 pospelov
h5. Generate project file for MSVS 2013
108 1 herck
109 69 pospelov
* Change to build directory
110 69 pospelov
> C:\development\build-x86
111 76 herck
> cmake -G "Visual Studio 12" -DCMAKE_INCLUDE_PATH=C:/opt/local_x86/include -DCMAKE_LIBRARY_PATH=C:/opt/local_x86/lib ../BornAgain
112 77 herck
* Then open BornAgain.sln in Microsoft Visual Studio, select Release/32bit build type. Build project.
113 69 pospelov
114 69 pospelov
h5. Making binary installer
115 69 pospelov
116 69 pospelov
* After build is complete, installer is generated by running in the build directory the command
117 69 pospelov
> CPack -C Release
118 69 pospelov
119 69 pospelov
120 1 herck
h2. Useful programs
121 1 herck
122 1 herck
* FarManager together with Conemy helps to work in console, for example it gives possibility to scroll long output
123 1 herck
> Install FarManager from http://www.farmanager.com/download.php?l=en
124 1 herck
> Install conemy http://conemu.github.io/
125 70 pospelov
126 70 pospelov
127 70 pospelov
h2. Some obsolete staff
128 70 pospelov
129 70 pospelov
* Install boost from http://sourceforge.net/projects/boost/files/boost-binaries
130 70 pospelov
> by running boost_1_58_0-msvc-12.0-32.exe
131 70 pospelov
> Install in the temporary directory C:\temp\boost_1_58_0
132 70 pospelov
> Copy content of the directory C:\temp\boost_1_58_0\lib32-msvc-12.0\* in the C:\opt\local_x86\lib\.
133 70 pospelov
> Copy whole directory C:\temp\boost_1_58_0\boost into C:\opt\local_x86\include\.