Commit 25375db8f20252ad2a967e90446ef818fa649d7c

Authored by Carlos Picanco
1 parent 2a641a65
Exists in master

compile with static linked libzmq

- also print ZMQ_VERSION at start up
- on windows, zmq_version may be saved at a file, it is just a temporary workaround before an about form.
dependencies/delphizmq
1 -Subproject commit 4f72c4989a46e294d2275b4a9262220f2af2c12f 1 +Subproject commit 2a0f49dee5513c8074aa10317c71408849ae693c
experiment_runner/experiment_runner.lpi
@@ -32,7 +32,7 @@ @@ -32,7 +32,7 @@
32 </Target> 32 </Target>
33 <SearchPaths> 33 <SearchPaths>
34 <IncludeFiles Value="$(ProjOutDir)"/> 34 <IncludeFiles Value="$(ProjOutDir)"/>
35 - <Libraries Value="/usr/lib/gcc/x86_64-linux-gnu/4.9"/> 35 + <Libraries Value="/usr/lib/gcc/x86_64-linux-gnu/4.9/"/>
36 <OtherUnitFiles Value="units;../dependencies/delphizmq"/> 36 <OtherUnitFiles Value="units;../dependencies/delphizmq"/>
37 <UnitOutputDirectory Value="lib/$(TargetCPU)-$(TargetOS)"/> 37 <UnitOutputDirectory Value="lib/$(TargetCPU)-$(TargetOS)"/>
38 </SearchPaths> 38 </SearchPaths>
@@ -47,7 +47,8 @@ @@ -47,7 +47,8 @@
47 </Options> 47 </Options>
48 </Linking> 48 </Linking>
49 <Other> 49 <Other>
50 - <CustomOptions Value="-dUseCThreads"/> 50 + <CustomOptions Value="-dUseCThreads
  51 +-dZMQ_STATIC_LINK"/>
51 </Other> 52 </Other>
52 </CompilerOptions> 53 </CompilerOptions>
53 </Item2> 54 </Item2>
@@ -59,7 +60,7 @@ @@ -59,7 +60,7 @@
59 </Target> 60 </Target>
60 <SearchPaths> 61 <SearchPaths>
61 <IncludeFiles Value="$(ProjOutDir)"/> 62 <IncludeFiles Value="$(ProjOutDir)"/>
62 - <Libraries Value="/usr/lib/gcc/x86_64-linux-gnu/4.9"/> 63 + <Libraries Value="/usr/lib/gcc/x86_64-linux-gnu/4.9/"/>
63 <OtherUnitFiles Value="units;../dependencies/delphizmq"/> 64 <OtherUnitFiles Value="units;../dependencies/delphizmq"/>
64 <UnitOutputDirectory Value="lib/$(TargetCPU)-$(TargetOS)"/> 65 <UnitOutputDirectory Value="lib/$(TargetCPU)-$(TargetOS)"/>
65 </SearchPaths> 66 </SearchPaths>
@@ -70,6 +71,10 @@ @@ -70,6 +71,10 @@
70 </Win32> 71 </Win32>
71 </Options> 72 </Options>
72 </Linking> 73 </Linking>
  74 + <Other>
  75 + <CustomOptions Value="-dZMQ_STATIC_LINK
  76 +-Fo/home/rafael/Downloads/zeromq-3.2.5/src/"/>
  77 + </Other>
73 </CompilerOptions> 78 </CompilerOptions>
74 </Item3> 79 </Item3>
75 <Item4 Name="Win32 Release"> 80 <Item4 Name="Win32 Release">
@@ -80,7 +85,7 @@ @@ -80,7 +85,7 @@
80 </Target> 85 </Target>
81 <SearchPaths> 86 <SearchPaths>
82 <IncludeFiles Value="$(ProjOutDir)"/> 87 <IncludeFiles Value="$(ProjOutDir)"/>
83 - <Libraries Value="/usr/lib/gcc/x86_64-linux-gnu/4.9"/> 88 + <Libraries Value="/usr/lib/gcc/x86_64-linux-gnu/4.9/"/>
84 <OtherUnitFiles Value="units;../dependencies/delphizmq"/> 89 <OtherUnitFiles Value="units;../dependencies/delphizmq"/>
85 <UnitOutputDirectory Value="lib/$(TargetCPU)-$(TargetOS)"/> 90 <UnitOutputDirectory Value="lib/$(TargetCPU)-$(TargetOS)"/>
86 </SearchPaths> 91 </SearchPaths>
@@ -119,69 +124,69 @@ @@ -119,69 +124,69 @@
119 <IsPartOfProject Value="True"/> 124 <IsPartOfProject Value="True"/>
120 </Unit0> 125 </Unit0>
121 <Unit1> 126 <Unit1>
122 - <Filename Value="form_matrixgame.pas"/> 127 + <Filename Value="../sc_split/experiment_runner/form_matrixgame.pas"/>
123 <IsPartOfProject Value="True"/> 128 <IsPartOfProject Value="True"/>
124 <ComponentName Value="FormMatrixGame"/> 129 <ComponentName Value="FormMatrixGame"/>
125 <HasResources Value="True"/> 130 <HasResources Value="True"/>
126 <ResourceBaseClass Value="Form"/> 131 <ResourceBaseClass Value="Form"/>
127 </Unit1> 132 </Unit1>
128 <Unit2> 133 <Unit2>
129 - <Filename Value="README.md"/> 134 + <Filename Value="../sc_split/experiment_runner/README.md"/>
130 <IsPartOfProject Value="True"/> 135 <IsPartOfProject Value="True"/>
131 </Unit2> 136 </Unit2>
132 <Unit3> 137 <Unit3>
133 - <Filename Value="units/zmq_network.pas"/> 138 + <Filename Value="../sc_split/experiment_runner/units/zmq_network.pas"/>
134 <IsPartOfProject Value="True"/> 139 <IsPartOfProject Value="True"/>
135 </Unit3> 140 </Unit3>
136 <Unit4> 141 <Unit4>
137 - <Filename Value="units/game_zmq_actors.pas"/> 142 + <Filename Value="../sc_split/experiment_runner/units/game_zmq_actors.pas"/>
138 <IsPartOfProject Value="True"/> 143 <IsPartOfProject Value="True"/>
139 </Unit4> 144 </Unit4>
140 <Unit5> 145 <Unit5>
141 - <Filename Value="units/game_actors.pas"/> 146 + <Filename Value="../sc_split/experiment_runner/units/game_actors.pas"/>
142 <IsPartOfProject Value="True"/> 147 <IsPartOfProject Value="True"/>
143 </Unit5> 148 </Unit5>
144 <Unit6> 149 <Unit6>
145 - <Filename Value="units/game_experiment.pas"/> 150 + <Filename Value="../sc_split/experiment_runner/units/game_experiment.pas"/>
146 <IsPartOfProject Value="True"/> 151 <IsPartOfProject Value="True"/>
147 </Unit6> 152 </Unit6>
148 <Unit7> 153 <Unit7>
149 - <Filename Value="units/game_file_methods.pas"/> 154 + <Filename Value="../sc_split/experiment_runner/units/game_file_methods.pas"/>
150 <IsPartOfProject Value="True"/> 155 <IsPartOfProject Value="True"/>
151 </Unit7> 156 </Unit7>
152 <Unit8> 157 <Unit8>
153 - <Filename Value="units/game_resources.pas"/> 158 + <Filename Value="../sc_split/experiment_runner/units/game_resources.pas"/>
154 <IsPartOfProject Value="True"/> 159 <IsPartOfProject Value="True"/>
155 </Unit8> 160 </Unit8>
156 <Unit9> 161 <Unit9>
157 - <Filename Value="units/game_control.pas"/> 162 + <Filename Value="../sc_split/experiment_runner/units/game_control.pas"/>
158 <IsPartOfProject Value="True"/> 163 <IsPartOfProject Value="True"/>
159 </Unit9> 164 </Unit9>
160 <Unit10> 165 <Unit10>
161 - <Filename Value="units/string_methods.pas"/> 166 + <Filename Value="../sc_split/experiment_runner/units/string_methods.pas"/>
162 <IsPartOfProject Value="True"/> 167 <IsPartOfProject Value="True"/>
163 </Unit10> 168 </Unit10>
164 <Unit11> 169 <Unit11>
165 - <Filename Value="units/game_actors_point.pas"/> 170 + <Filename Value="../sc_split/experiment_runner/units/game_actors_point.pas"/>
166 <IsPartOfProject Value="True"/> 171 <IsPartOfProject Value="True"/>
167 </Unit11> 172 </Unit11>
168 <Unit12> 173 <Unit12>
169 - <Filename Value="units/game_visual_elements.pas"/> 174 + <Filename Value="../sc_split/experiment_runner/units/game_visual_elements.pas"/>
170 <IsPartOfProject Value="True"/> 175 <IsPartOfProject Value="True"/>
171 </Unit12> 176 </Unit12>
172 <Unit13> 177 <Unit13>
173 - <Filename Value="form_chooseactor.pas"/> 178 + <Filename Value="../sc_split/experiment_runner/form_chooseactor.pas"/>
174 <IsPartOfProject Value="True"/> 179 <IsPartOfProject Value="True"/>
175 <ComponentName Value="FormChooseActor"/> 180 <ComponentName Value="FormChooseActor"/>
176 <HasResources Value="True"/> 181 <HasResources Value="True"/>
177 <ResourceBaseClass Value="Form"/> 182 <ResourceBaseClass Value="Form"/>
178 </Unit13> 183 </Unit13>
179 <Unit14> 184 <Unit14>
180 - <Filename Value="units/csv_writer.pas"/> 185 + <Filename Value="../sc_split/experiment_runner/units/csv_writer.pas"/>
181 <IsPartOfProject Value="True"/> 186 <IsPartOfProject Value="True"/>
182 </Unit14> 187 </Unit14>
183 <Unit15> 188 <Unit15>
184 - <Filename Value="units/helpers.pas"/> 189 + <Filename Value="../sc_split/experiment_runner/units/helpers.pas"/>
185 <IsPartOfProject Value="True"/> 190 <IsPartOfProject Value="True"/>
186 </Unit15> 191 </Unit15>
187 </Units> 192 </Units>
@@ -193,7 +198,7 @@ @@ -193,7 +198,7 @@
193 </Target> 198 </Target>
194 <SearchPaths> 199 <SearchPaths>
195 <IncludeFiles Value="$(ProjOutDir)"/> 200 <IncludeFiles Value="$(ProjOutDir)"/>
196 - <Libraries Value="/usr/lib/gcc/x86_64-linux-gnu/4.9"/> 201 + <Libraries Value="/usr/lib/gcc/x86_64-linux-gnu/4.9/"/>
197 <OtherUnitFiles Value="units;../dependencies/delphizmq"/> 202 <OtherUnitFiles Value="units;../dependencies/delphizmq"/>
198 <UnitOutputDirectory Value="lib/$(TargetCPU)-$(TargetOS)"/> 203 <UnitOutputDirectory Value="lib/$(TargetCPU)-$(TargetOS)"/>
199 </SearchPaths> 204 </SearchPaths>
@@ -205,7 +210,8 @@ @@ -205,7 +210,8 @@
205 </Options> 210 </Options>
206 </Linking> 211 </Linking>
207 <Other> 212 <Other>
208 - <CustomOptions Value="-dUseCThreads"/> 213 + <CustomOptions Value="-dUseCThreads
  214 +-dZMQ_STATIC_LINK"/>
209 </Other> 215 </Other>
210 </CompilerOptions> 216 </CompilerOptions>
211 <Debugging> 217 <Debugging>
experiment_runner/experiment_runner.lpr
@@ -95,6 +95,7 @@ const @@ -95,6 +95,7 @@ const
95 95
96 begin 96 begin
97 ApplicationPath := ExtractFilePath(Application.ExeName); 97 ApplicationPath := ExtractFilePath(Application.ExeName);
  98 + PrintZmqVersion(ApplicationPath);
98 {$IFDEF DEBUG} 99 {$IFDEF DEBUG}
99 if not CreateDebugFoldersForPlayers then Exit; 100 if not CreateDebugFoldersForPlayers then Exit;
100 {$ENDIF} 101 {$ENDIF}
experiment_runner/lib/x86_64-linux/experiment_runner.compiled
1 <?xml version="1.0" encoding="UTF-8"?> 1 <?xml version="1.0" encoding="UTF-8"?>
2 <CONFIG> 2 <CONFIG>
3 <Compiler Value="/usr/bin/fpc" Date="1449313866"/> 3 <Compiler Value="/usr/bin/fpc" Date="1449313866"/>
4 - <Params Value=" -MObjFPC -Scghi -Cg -O1 -g -gl -Xg -l -vewnhibq -Fi/home/rafael/git/sc_split/experiment_runner/lib/x86_64-linux -Fl/usr/lib/gcc/x86_64-linux-gnu/4.9 -Fl/opt/gnome/lib -Fu/home/rafael/git/sc_split/experiment_runner/units -Fu/home/rafael/git/sc_split/dependencies/delphizmq -Fu/usr/share/lazarus/1.6.2/lcl/units/x86_64-linux/gtk2 -Fu/usr/share/lazarus/1.6.2/lcl/units/x86_64-linux -Fu/usr/share/lazarus/1.6.2/components/lazutils/lib/x86_64-linux -Fu/usr/share/lazarus/1.6.2/packager/units/x86_64-linux -Fu/home/rafael/git/sc_split/experiment_runner/ -FU/home/rafael/git/sc_split/experiment_runner/lib/x86_64-linux/ -dLCL -dLCLgtk2 -dUseCThreads experiment_runner.lpr"/> 4 + <Params Value=" -MObjFPC -Scghi -Cg -O1 -g -gl -Xg -l -vewnhibq -Fi/home/rafael/git/free-mtrix/experiment_runner/lib/x86_64-linux -Fl/usr/lib/gcc/x86_64-linux-gnu/4.9 -Fl/opt/gnome/lib -Fu/home/rafael/git/free-mtrix/experiment_runner/units -Fu/home/rafael/git/free-mtrix/dependencies/delphizmq -Fu/usr/share/lazarus/1.6.2/lcl/units/x86_64-linux/gtk2 -Fu/usr/share/lazarus/1.6.2/lcl/units/x86_64-linux -Fu/usr/share/lazarus/1.6.2/components/lazutils/lib/x86_64-linux -Fu/usr/share/lazarus/1.6.2/packager/units/x86_64-linux -Fu/home/rafael/git/free-mtrix/experiment_runner/ -FU/home/rafael/git/free-mtrix/experiment_runner/lib/x86_64-linux/ -dLCL -dLCLgtk2 -dUseCThreads -dZMQ_STATIC_LINK experiment_runner.lpr"/>
5 </CONFIG> 5 </CONFIG>
experiment_runner/units/helpers.pas
@@ -8,9 +8,13 @@ uses @@ -8,9 +8,13 @@ uses
8 Classes, SysUtils; 8 Classes, SysUtils;
9 9
10 function RandomString(ALength : Integer): Utf8String; 10 function RandomString(ALength : Integer): Utf8String;
  11 +procedure PrintZmqVersion(AAplicationPath:string);
  12 +
11 13
12 implementation 14 implementation
13 15
  16 +uses zmq;
  17 +
14 function RandomString( ALength: Integer ): Utf8String; 18 function RandomString( ALength: Integer ): Utf8String;
15 const 19 const
16 Chars = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ'; 20 Chars = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ';
@@ -22,6 +26,26 @@ begin @@ -22,6 +26,26 @@ begin
22 Result := Result + Chars[Random(Length(Chars)) + 1]; 26 Result := Result + Chars[Random(Length(Chars)) + 1];
23 end; 27 end;
24 28
  29 +procedure PrintZmqVersion(AAplicationPath : string);
  30 +var
  31 + LPatch, LMinor, LMajor: Integer;
  32 + S : TStringList;
  33 +begin
  34 + LMajor := 0; LMinor := 0; LPatch := 0;
  35 + zmq_version(LMajor,LMinor,LPatch);
  36 + try
  37 + WriteLn('ZMQVERSION:',LMajor,'.',LMinor,'.',LPatch);
  38 + except
  39 + on E : Exception do
  40 + begin
  41 + S := TStringList.Create;
  42 + S.Append(IntToStr(LMajor)+IntToStr(LMinor)+IntToStr(LPatch));
  43 + S.SaveToFile(AAplicationPath+PathDelim+'ZMQVERSION');
  44 + S.Free;
  45 + end;
  46 + end;
  47 +end;
  48 +
25 initialization 49 initialization
26 50
27 Randomize; 51 Randomize;