Windows build » History » Version 71

pospelov, 16 Jul 2015 13:20

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