Windows build » History » Version 25

pospelov, 05 Sep 2013 16:55

1 1 herck
h1. Windows build
2 1 herck
3 9 pospelov
Experimental compilation under Windows using Mingw or Microsoft Visual Studio.
4 6 pospelov
To be updated.
5 1 herck
6 13 pospelov
7 6 pospelov
h5. Install packages for happier life
8 1 herck
9 6 pospelov
* Atlassian SourceTree (v0.9.2.3) 
10 6 pospelov
> https://www.atlassian.com/software/sourcetree/overview
11 6 pospelov
* Kate from KDE 
12 6 pospelov
> http://download.kde.org/stable/kdewin/installer/kdewin-installer-gui-latest.exe.mirrorlist 
13 1 herck
* far manager
14 1 herck
> http://www.farmanager.com/download.php?l=en
15 9 pospelov
* WinSCP
16 9 pospelov
> http://winscp.net/eng/index.php
17 9 pospelov
18 14 pospelov
First assure compilation of MinGW, then switch to Visual Studio recipe
19 9 pospelov
20 9 pospelov
h2. Mingw build
21 9 pospelov
22 6 pospelov
h5. Install Qt, cmake
23 1 herck
24 25 pospelov
* Install Qt 5.1.0
25 6 pospelov
> http://qt-project.org/downloads
26 18 pospelov
> Add to PATH C:\Qt\Tools\mingw48_32\bin;C:\Qt\Tools\mingw48_32\lib;C:\Qt\5.1.0\mingw48_32\bin;C:\Qt\Tools\QtCreator\bin
27 19 pospelov
>> this will allow usage of mingw from any command line
28 1 herck
29 1 herck
* install cmake
30 1 herck
> http://www.cmake.org/cmake/resources/software.html by running cmake-2.8.11.2-win32-x86.exe
31 1 herck
32 25 pospelov
h5. Install MinGW (yes, again)
33 25 pospelov
34 25 pospelov
* We need full MinGW suite to compile latest libgsl
35 25 pospelov
* download mingw-get-setup.exe installer from http://www.mingw.org/
36 25 pospelov
* run installer and select something like  "M-SYS", "MinGW Developer Toolkit" and the "GCC-C" compiler at the very least
37 25 pospelov
* select default C:\MinGW as an installation directory
38 25 pospelov
39 16 pospelov
h5. Install Python and Co
40 16 pospelov
41 16 pospelov
* Install Python
42 16 pospelov
> install through http://www.python.org/ftp/python/2.7.5/python-2.7.5.msi into C:/Python27
43 16 pospelov
44 16 pospelov
* install numpy 
45 16 pospelov
> from unofficial http://www.lfd.uci.edu/~gohlke/pythonlibs/#numpy   by running   numpy-unoptimized-1.7.1.win32-py2.7.‌exe
46 16 pospelov
47 16 pospelov
* install matplotlib 
48 1 herck
> from http://matplotlib.org/downloads.html  by running matplotlib-1.2.1.win32-py2.7.exe
49 6 pospelov
50 1 herck
> (alternative install Anaconda pack (python + mingw + numpy) from http://continuum.io/downloads ) Not checked!
51 1 herck
52 1 herck
h5. Comment about installation of additional libraries
53 1 herck
> All further installations should end up in C:\opt\local
54 1 herck
55 25 pospelov
h5. Install gsl
56 1 herck
57 25 pospelov
> create empty directory c:\gsl-1.16
58 25 pospelov
> download source gsl-1.16.tar.gz from ftp://ftp.gnu.org/gnu/gsl/ 
59 25 pospelov
> copy unpacked directory to C:\mingw\msys\1.0\home\pospelov
60 25 pospelov
> run  c:\mingw\msys\msys.bat
61 25 pospelov
> there, navigate to c:\mingw\msys\1.0\home\pospelov\gsl-1.16
62 25 pospelov
> compile
63 25 pospelov
>> ./configure --enable-static=yes --enable-shared=yes --prefix=/c/gsl-1.16
64 25 pospelov
>> make
65 25 pospelov
>> make install
66 25 pospelov
> copy "C:\gsl-1.16\include\gsl"  to "C:\opt\local\include\gsl"
67 25 pospelov
> copy libgsl-0.dll and libgslcnlas-0.dll into "C:\opt\local\lib"
68 1 herck
69 25 pospelov
70 25 pospelov
>> using corresponding gnuwin32 setup file from http://gnuwin32.sourceforge.net/packages.html
71 25 pospelov
>> install in the default location
72 25 pospelov
>> copy "C:\Program Files (x86)\GnuWin32\include\gsl"  to "C:\opt\local\include\gsl"
73 25 pospelov
>> copy libgsl.dll and libgslcblas.dll  from "C:\Program Files (x86)\GnuWin32\bin" to "C:\opt\local\lib"
74 25 pospelov
75 25 pospelov
h5. Install fftw3 
76 25 pospelov
77 12 pospelov
> from http://www.fftw.org/install/windows.html download  fftw-3.3.3-dll32.zip
78 6 pospelov
> unpack archive somewhere
79 6 pospelov
> copy fftw3.h to C:\opt\local\include
80 6 pospelov
> copy libfftw3-3.dll and libfftw3-3.def to C:\opt\local\lib
81 15 pospelov
82 15 pospelov
h5. install BOOST
83 6 pospelov
84 6 pospelov
* install zlib and bzip2
85 6 pospelov
> from http://www.zlib.net/ into C:/opt/local/source/zlib-1.2.8
86 6 pospelov
> from http://www.bzip.org/downloads.html into C:/opt/local/source/bzip2-1.0.6
87 6 pospelov
88 6 pospelov
* Download and compile boost_1_54_0 
89 6 pospelov
> from http://sourceforge.net/projects/boost/files/boost/1.54.0/ and unpack
90 6 pospelov
> cd <BOOSTDIR>
91 6 pospelov
> bootstrap.bat mingw
92 6 pospelov
> b2 install --prefix=c:/opt/local toolset=gcc -sBZIP2_SOURCE="C:\opt\local\source\bzip2-1.0.6"   -sZLIB_SOURCE="C:\opt\local\source\zlib-1.2.8" address-model=32 variant=release link=static,shared threading=single,multi
93 6 pospelov
> Move c:/opt/local/include/boost_1.54/boost directory into c:/opt/local/include/boost
94 6 pospelov
95 6 pospelov
96 1 herck
h5. %PATH%
97 17 pospelov
98 17 pospelov
* Add c:\home\pospelov\development\git\BornAgain\lib;c:\opt\local\lib to PATH
99 6 pospelov
100 6 pospelov
101 6 pospelov
h5. Where we are?
102 6 pospelov
103 6 pospelov
* At this point Qt creator should work (except App and GUI)
104 6 pospelov
105 8 pospelov
* At this point cmake should work too
106 20 pospelov
> cmake -G "MinGW Makefiles"  ../BornAgain
107 20 pospelov
> mingw32-make -j4
108 20 pospelov
> mingw32-make check
109 20 pospelov
110 20 pospelov
111 20 pospelov
h2. MS Visual Studio build
112 20 pospelov
113 20 pospelov
114 20 pospelov
h5. Install VS.NET2012
115 20 pospelov
> Install En language pack
116 20 pospelov
> install "stop build on error" plugin http://visualstudiogallery.msdn.microsoft.com/91aaa139-5d3c-43a7-b39f-369196a84fa5
117 20 pospelov
118 20 pospelov
h5. Comment about installation of additional libraries
119 20 pospelov
> All further installations should end up in C:\opt\local_vc110
120 20 pospelov
121 20 pospelov
* Install gsl 
122 21 pospelov
> Download source gsl-1.8-src.zip from http://gnuwin32.sourceforge.net/downlinks/gsl-src-zip.php
123 21 pospelov
> Copy gsl-1.8 source dir into C:/opt/local_vc110/source
124 21 pospelov
> Open  VC8/libgsl.sln in Visual Studio and compile project
125 21 pospelov
> Copy libgsl.dll and libgsl_dll.lib from VC8/libgsl/Release-DLL/ to C:/opt/local_vc110/lib
126 22 pospelov
> Copy libgslcblas.dll and libgslcblas_dll.lib from VC8/libgslcblas/Release-DLL/ to C:/opt/local_vc110/lib
127 22 pospelov
> Copy C:/opt/local/include/gsl to C:/opt/local_vc110/include/gsl
128 22 pospelov
129 22 pospelov
* Install fftw3
130 22 pospelov
> from http://www.fftw.org/install/windows.html download  fftw-3.3.3-dll32.zip
131 22 pospelov
> unpack archive somewhere
132 1 herck
> copy fftw3.h to C:\opt\local_vc110\include
133 1 herck
> copy libfftw3-3.dll and libfftw3-3.def to C:\opt\local_vc110\lib
134 1 herck
> generate corresponding lib file
135 1 herck
>> run "VS2012 x86 native tools command prompt"
136 23 pospelov
>>  run there "lib /def:libfftw3-3.def" to generate lib file
137 23 pospelov
138 23 pospelov
h5. install BOOST
139 23 pospelov
140 23 pospelov
* install zlib and bzip2
141 23 pospelov
> from http://www.zlib.net/ into C:/opt/local_vc110/source/zlib-1.2.8
142 24 pospelov
> from http://www.bzip.org/downloads.html into C:/opt/local_vc110/source/bzip2-1.0.6
143 23 pospelov
>> Patch bzip2 installation (MSVC specific!)
144 23 pospelov
>> Namely delete first line ("LIBRARY   LIBBZ2") from file libbz2.def
145 23 pospelov
>> This will remove unnecessary dependency from external bzip2 during MSVC boost compilation
146 23 pospelov
147 23 pospelov
* Download and compile boost_1_54_0 
148 23 pospelov
> from http://sourceforge.net/projects/boost/files/boost/1.54.0/ and unpack
149 23 pospelov
> cd <BOOSTDIR>
150 23 pospelov
> bootstrap.bat
151 23 pospelov
> b2 install --prefix=c:/opt/local_vc110 -sBZIP2_SOURCE="C:\opt\local_vc110\source\bzip2-1.0.6"   -sZLIB_SOURCE="C:\opt\local_vc110\source\zlib-1.2.8" variant=release   link=static,shared threading=multi
152 1 herck
> Move c:/opt/local_vc110/include/boost_1.54/boost directory into c:/opt/local_vc110/include/boost