Windows build » History » Version 78

herck, 11 Nov 2015 17:52

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
50 67 pospelov
h5. Install boost
51 67 pospelov
52 70 pospelov
* install zlib and bzip2
53 70 pospelov
> from http://www.zlib.net/ into C:\temp\zlib-1.2.8
54 70 pospelov
> from http://www.bzip.org/downloads.html into C:\temp\bzip2-1.0.6
55 70 pospelov
>> Patch bzip2 installation (MSVC specific!)
56 70 pospelov
>> Namely delete first line ("LIBRARY LIBBZ2") from file libbz2.def
57 70 pospelov
>> This will remove unnecessary dependency from external bzip2 during later linking of boost libraries into other project
58 1 herck
59 70 pospelov
* Compile boost
60 70 pospelov
> Download boost from http://sourceforge.net/projects/boost/files/boost/
61 70 pospelov
> Unpack boost_1_58_0.zip to C:\temp\boost_1_58_0
62 70 pospelov
> Run VS2012 x86 native tools command prompt
63 70 pospelov
> cd C:\temp\boost_1_58_0
64 70 pospelov
> bootstrap.bat
65 70 pospelov
> 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
66 72 pospelov
67 72 pospelov
* Copy boost
68 72 pospelov
> Copy or move directory c:\temp\boost_1_58_0_installed\include\boost-1_58\boost to  C:\opt\local_x86\include\boost
69 72 pospelov
> Copy or move content of c:\temp\boost_1_58_0_installed\lib\* to C:\opt\local_x86\lib\.
70 67 pospelov
71 70 pospelov
72 67 pospelov
h5. Install fftw3
73 67 pospelov
74 67 pospelov
* Install fftw3 from http://www.fftw.org/install/windows.html
75 67 pospelov
> download  fftw-3.3.4-dll32.zip and unpack into temporary directory C:\temp\fftw3
76 67 pospelov
> generate lib file
77 67 pospelov
>> open "VS2013 x86 Native Tools Command Prompt" from Windows menu All Programs/Microsoft Visual Studio 2013/Tools
78 67 pospelov
>> cd C:\temp\fftw3
79 67 pospelov
>> lib /def:libfftw3-3.def
80 67 pospelov
81 67 pospelov
> copy c:\temp\fftw3\fftw3.h to C:\opt\local_x86\include\.
82 67 pospelov
> copy c:\temp\fftw3\libfftw3-3.lib to C:\opt\local_x86\lib\.
83 1 herck
> copy c:\temp\fftw3\libfftw3-3.def to C:\opt\local_x86\lib\.
84 1 herck
> copy c:\temp\fftw3\libfftw3-3.dll to C:\opt\local_x86\lib\.
85 68 pospelov
86 68 pospelov
h5. Install GSL
87 68 pospelov
88 68 pospelov
* All previous recepies disappeared from internet
89 68 pospelov
* Found out that one
90 68 pospelov
> Download gsl-1.16_winbin.zip from https://azylstra.net/blog/post/building-gsl-on-windows
91 68 pospelov
> Unpack to C:\temp\gsl-1.16
92 68 pospelov
> Copy directory C:\temp\gsl-1.16\gsl\x86\include\gsl to  C:\opt\local_x86\include\.
93 68 pospelov
> Copy content C:\temp\gsl-1.16\gsl\x86\lib\* to  C:\opt\local_x86\lib\.
94 68 pospelov
95 75 pospelov
h5. Install TIFF
96 75 pospelov
97 75 pospelov
* Download tiff-4.0.6.zip from http://download.osgeo.org/libtiff/
98 75 pospelov
* Unpack to C:\temp\libtiff-4.0.6
99 75 pospelov
* Run from Start menu "VS2013 x86 Tools Command Prompt" console
100 75 pospelov
* cd C:\temp\libtiff-4.0.6, compile with "nmake /f makefile.vc"
101 75 pospelov
> Copy library file C:\temp\libtiff-4.0.6\libtiff\libtiff.dll to C:\opt\local_x86\lib\.
102 75 pospelov
> Copy library file C:\temp\libtiff-4.0.6\libtiff\libtiff.lib to C:\opt\local_x86\lib\.
103 78 herck
> Copy header files C:\temp\libtiff-4.0.6\libtiff\*.h* to C:\opt\local_x86\include\libtiff\.
104 75 pospelov
105 68 pospelov
h5. PATH
106 68 pospelov
107 68 pospelov
* Add c:\opt\local_x86\lib to PATH
108 68 pospelov
109 69 pospelov
h5. Generate project file for MSVS 2013
110 1 herck
111 69 pospelov
* Change to build directory
112 69 pospelov
> C:\development\build-x86
113 76 herck
> cmake -G "Visual Studio 12" -DCMAKE_INCLUDE_PATH=C:/opt/local_x86/include -DCMAKE_LIBRARY_PATH=C:/opt/local_x86/lib ../BornAgain
114 77 herck
* Then open BornAgain.sln in Microsoft Visual Studio, select Release/32bit build type. Build project.
115 69 pospelov
116 69 pospelov
h5. Making binary installer
117 69 pospelov
118 69 pospelov
* After build is complete, installer is generated by running in the build directory the command
119 69 pospelov
> CPack -C Release
120 69 pospelov
121 69 pospelov
122 1 herck
h2. Useful programs
123 1 herck
124 1 herck
* FarManager together with Conemy helps to work in console, for example it gives possibility to scroll long output
125 1 herck
> Install FarManager from http://www.farmanager.com/download.php?l=en
126 1 herck
> Install conemy http://conemu.github.io/
127 70 pospelov
128 70 pospelov
129 70 pospelov
h2. Some obsolete staff
130 70 pospelov
131 70 pospelov
* Install boost from http://sourceforge.net/projects/boost/files/boost-binaries
132 70 pospelov
> by running boost_1_58_0-msvc-12.0-32.exe
133 70 pospelov
> Install in the temporary directory C:\temp\boost_1_58_0
134 70 pospelov
> Copy content of the directory C:\temp\boost_1_58_0\lib32-msvc-12.0\* in the C:\opt\local_x86\lib\.
135 70 pospelov
> Copy whole directory C:\temp\boost_1_58_0\boost into C:\opt\local_x86\include\.