/
Step8-BuildOOTModules.ps1
1775 lines (1713 loc) · 105 KB
/
Step8-BuildOOTModules.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#
# Step8_BuildOOTModules.ps1
#
# script setup
$ErrorActionPreference = "Stop"
# setup helper functions
if ($script:MyInvocation.MyCommand.Path -eq $null) {
$mypath = "."
} else {
$mypath = Split-Path $script:MyInvocation.MyCommand.Path
}
if (Test-Path $mypath\Setup.ps1) {
. $mypath\Setup.ps1 -Force
} else {
. $root\scripts\Setup.ps1 -Force
}
$configmode = $args[0]
if ($configmode -eq $null) {$configmode = "all"}
$env:PYTHONPATH=""
$mm = GetMajorMinor($gnuradio_version)
function BuildDrivers
{
$configuration = $args[0]
$buildsymbols=$true
$pythonroot = "$root/src-stage3/staged_install/$configuration/gr-python27"
if ($configuration -match "Release") {
$buildconfig="Release";$pythonexe = "python.exe"; $debugext = ""; $debug_ext = ""; $runtime = "/MD"
}
else {
$buildconfig="Debug"; $pythonexe = "python_d.exe";$debugext = "d"; $debug_ext = "_d";$runtime = "/MDd"
}
if ($buildsymbols -and $buildconfig -eq "Release") {$buildconfig="RelWithDebInfo"}
if ($configuration -match "AVX2") {$arch="/arch:AVX2"} else {$arch=""}
# ____________________________________________________________________________________________________________
#
# airspy
#
# links to libusb dynamically and pthreads statically
#
SetLog "airspy $configuration"
Write-Host -NoNewline "building $configuration airspy..."
cd $root/src-stage3/oot_code/airspy/libairspy/vc
$env:_CL_ = " $arch $runtime "
msbuild .\airspy_2015.sln /m /p:"configuration=$configuration;platform=x64" *>> $Log
Write-Host -NoNewLine "installing..."
New-Item -ItemType Directory -Force -Path $root/src-stage3/staged_install/$configuration/include/libairspy *>> $Log
Copy-Item -Force -Path "$root/src-stage3/oot_code/airspy/libairspy/x64/$configuration/airspy.lib" "$root/src-stage3/staged_install/$configuration/lib" *>> $Log
Copy-Item -Force -Path "$root/src-stage3/oot_code/airspy/libairspy/x64/$configuration/airspy.dll" "$root/src-stage3/staged_install/$configuration/bin" *>> $Log
Copy-Item -Force -Path "$root/src-stage3/oot_code/airspy/libairspy/x64/$configuration/*.exe" "$root/src-stage3/staged_install/$configuration/bin" *>> $Log
Copy-Item -Force -Path "$root/src-stage3/oot_code/airspy/libairspy/src/airspy.h" "$root/src-stage3/staged_install/$configuration/include/libairspy" *>> $Log
Copy-Item -Force -Path "$root/src-stage3/oot_code/airspy/libairspy/src/airspy_commands.h" "$root/src-stage3/staged_install/$configuration/include/libairspy" *>> $Log
Validate "$root/src-stage3/oot_code/airspy/libairspy/x64/$configuration/airspy.dll"
CheckNoAVX "$root/src-stage3/oot_code/airspy/libairspy/x64/$configuration"
# ____________________________________________________________________________________________________________
#
# airspyhf
#
# links to libusb dynamically and pthreads statically
#
# Note no AVX config is present, so the Release will actually be built twice.
#
SetLog "airspyhf $configuration"
Write-Host -NoNewline "building $configuration airspyhf..."
cd $root/src-stage3/oot_code/airspyhf/libairspyhf
if ($configuration -match "Release") {
$airspyhf_buildconfig="Release"
} else {
$airspyhf_buildconfig="Debug"
}
$env:_CL_ = " $arch $runtime /I$root/build/$configuration/include"
$env:_LINK_ = " $root/build/$configuration/lib/libusb-1.0.lib "
msbuild .\airspyhf.sln /m /p:"PlatformToolset=v140;configuration=$airspyhf_buildconfig;platform=x64" *>> $Log
Write-Host -NoNewLine "installing..."
New-Item -ItemType Directory -Force -Path $root/src-stage3/staged_install/$configuration/include/libairspyhf *>> $Log
Copy-Item -Force -Path "$root/src-stage3/oot_code/airspyhf/libairspyhf/x64/$airspyhf_buildconfig/airspyhf.lib" "$root/src-stage3/staged_install/$configuration/lib" *>> $Log
Copy-Item -Force -Path "$root/src-stage3/oot_code/airspyhf/libairspyhf/x64/$airspyhf_buildconfig/airspyhf.dll" "$root/src-stage3/staged_install/$configuration/bin" *>> $Log
Copy-Item -Force -Path "$root/src-stage3/oot_code/airspyhf/libairspyhf/x64/$airspyhf_buildconfig/*.exe" "$root/src-stage3/staged_install/$configuration/bin" *>> $Log
Copy-Item -Force -Path "$root/src-stage3/oot_code/airspyhf/libairspyhf/src/airspyhf.h" "$root/src-stage3/staged_install/$configuration/include/libairspyhf" *>> $Log
Copy-Item -Force -Path "$root/src-stage3/oot_code/airspyhf/libairspyhf/src/airspyhf_commands.h" "$root/src-stage3/staged_install/$configuration/include/libairspyhf" *>> $Log
Validate "$root/src-stage3/oot_code/airspyhf/libairspyhf/x64/$airspyhf_buildconfig/airspyhf.dll" "$root/src-stage3/staged_install/$configuration/include/libairspyhf/airspyhf.h"
CheckNoAVX "$root/src-stage3/oot_code/airspyhf/libairspyhf/x64/$airspyhf_buildconfig"
$env:_CL_ = ""
$env:_LINK_ = ""
# ____________________________________________________________________________________________________________
#
# SoapySDR
#
# links to libusb dynamically and pthreads statically
#
SetLog "SoapySDR $configuration"
Write-Host -NoNewline "building $configuration SoapySDR..."
New-Item -ItemType Directory -Force -Path $root/src-stage3/oot_code/SoapySDR/build/$configuration *>> $Log
$env:_CL_ = " $arch $runtime "
cd $root/src-stage3/oot_code/SoapySDR/build/$configuration
$ErrorActionPreference = "Continue"
cmake ../../ `
-G "Visual Studio 14 2015 Win64" `
-DLIBUSB_PATH="$root/build/$configuration" `
-DLIBUSB_LIBRARY_PATH_SUFFIX="lib" `
-DLIBUSB_LIBRARIES="$root/build/$configuration/lib/libusb-1.0.lib" `
-DLIBUSB_HEADER_FILE="$root/build/$configuration/include/libusb.h" `
-DLIBUSB_VERSION="$libusb_version" `
-DLIBUSB_SKIP_VERSION_CHECK=TRUE `
-DENABLE_BACKEND_LIBUSB=TRUE `
-DLIBPTHREADSWIN32_PATH="$root/build/$configuration" `
-DLIBPTHREADSWIN32_LIB_COPYING="$root/build/$configuration/lib/COPYING.lib" `
-DPTHREAD_LIBRARY="$root/build/$configuration/lib/pthreadVC2.lib" `
-DPYTHON_LIBRARY="$root/src-stage3/staged_install/$configuration/gr-python27/libs/python27$debug_ext.lib" `
-DPYTHON_LIBRARY_DEBUG="$root/src-stage3/staged_install/$configuration/gr-python27/libs/python27_d.lib" `
-DPYTHON_EXECUTABLE="$root/src-stage3/staged_install/$configuration/gr-python27/$pythonexe" `
-DPYTHON_INCLUDE_DIR="$root/src-stage3/staged_install/$configuration/gr-python27/include" `
-DSWIG_EXECUTABLE="$root/bin/swig.exe" `
-DCMAKE_INSTALL_PREFIX="$root/src-stage3/staged_install/$configuration" `
-Wno-dev `
-DCMAKE_C_FLAGS="/D_TIMESPEC_DEFINED $arch /DWIN32 /D_WINDOWS /W3 /DPTW32_STATIC_LIB " *>> $Log
Write-Host -NoNewline "building..."
msbuild .\SoapySDR.sln /m /p:"configuration=$buildconfig;platform=x64" *>> $Log
Write-Host -NoNewline "installing..."
msbuild .\INSTALL.vcxproj /m /p:"configuration=$buildconfig;platform=x64;BuildProjectReferences=false" *>> $Log
Validate "$root/src-stage3/staged_install/$configuration/bin/SoapySDR.dll"
$ErrorActionPreference = "Stop"
<# # ____________________________________________________________________________________________________________
#
# freeSRP
#
# not working currently, CMAKE files have windows issues and then duplicate ambiguous symbols
#
SetLog "freeSRP $configuration"
Write-Host -NoNewline "building $configuration freeSRP..."
New-Item -ItemType Directory -Force -Path $root/src-stage3/oot_code/libfreesrp/build/$configuration *>> $Log
$env:_CL_ = " $arch $runtime "
cd $root/src-stage3/oot_code/libfreesrp/build/$configuration
$ErrorActionPreference = "Continue"
cmake ../../ `
-G "Visual Studio 14 2015 Win64" `
-DCMAKE_INSTALL_PREFIX="$root/src-stage3/staged_install/$configuration" `
-DLIBUSB_PATH="$root/build/$configuration" `
-DLIBUSB_1_LIBRARY="$root/build/$configuration/lib/libusb-1.0.lib" `
-DLIBUSB_1_INCLUDE_DIR="$root/build/$configuration/include" `
-DLIBUSB_SKIP_VERSION_CHECK=TRUE `
-DENABLE_BACKEND_LIBUSB=TRUE `
-DLIBPTHREADSWIN32_PATH="$root/build/$configuration" `
-DLIBPTHREADSWIN32_LIB_COPYING="$root/build/$configuration/lib/COPYING.lib" `
-DPTHREAD_LIBRARY="$root/build/$configuration/lib/pthreadVC2.lib" `
-Wno-dev `
-DCMAKE_C_FLAGS="/D_TIMESPEC_DEFINED $arch /DWIN32 /D_WINDOWS /W3 /DPTW32_STATIC_LIB " *>> $Log
Write-Host -NoNewline "building..."
msbuild .\libfreesrp.sln /m /p:"configuration=$buildconfig;platform=x64" *>> $Log
Write-Host -NoNewline "installing..."
msbuild .\INSTALL.vcxproj /m /p:"configuration=$buildconfig;platform=x64;BuildProjectReferences=false" *>> $Log
Validate "$root/src-stage3/staged_install/$configuration/bin/libfreesrp.dll"
$ErrorActionPreference = "Stop" #>
# ____________________________________________________________________________________________________________
#
# bladeRF
#
# links to libusb dynamically and pthreads statically
# Note that to get this to build without a patch, we needed to place pthreads and libusb dll's in non-standard locations.
# pthreads dll can actually be deleted afterwards since we statically link it in this build
#
SetLog "bladeRF $configuration"
Write-Host -NoNewline "configuring $configuration bladeRF..."
New-Item -ItemType Directory -Force -Path $root/src-stage3/oot_code/bladeRF/host/build/$configuration *>> $Log
$env:_CL_ = " $arch $runtime "
cd $root/src-stage3/oot_code/bladeRF/host/build/$configuration
cmake ../../ `
-G "Visual Studio 14 2015 Win64" `
-DLIBUSB_PATH="$root/build/$configuration" `
-DLIBUSB_LIBRARY_PATH_SUFFIX="lib" `
-DLIBUSB_LIBRARIES="$root/build/$configuration/lib/libusb-1.0.lib" `
-DLIBUSB_HEADER_FILE="$root/build/$configuration/include/libusb.h" `
-DLIBUSB_VERSION="$libusb_version" `
-DLIBUSB_SKIP_VERSION_CHECK=TRUE `
-DLIBUSB_EXTRA_PATHS="$root/build/$configuration/lib $root/build/$configuration/include" `
-DENABLE_BACKEND_LIBUSB=TRUE `
-DLIBPTHREADSWIN32_PATH="$root/build/$configuration" `
-DLIBPTHREADSWIN32_LIB_COPYING="$root/build/$configuration/lib/COPYING.lib" `
-DPTHREAD_LIBRARY="$root/build/$configuration/lib/pthreadVC2.lib" `
-DCMAKE_INSTALL_PREFIX="$root/src-stage3/staged_install/$configuration" `
-Wno-dev `
-DCMAKE_C_FLAGS="/D_TIMESPEC_DEFINED $arch /DWIN32 /D_WINDOWS /W3 /DPTW32_STATIC_LIB " *>> $Log
Write-Host -NoNewline "building..."
msbuild .\bladeRF.sln /m /p:"configuration=$buildconfig;platform=x64" *>> $Log
Write-Host -NoNewline "installing..."
msbuild .\INSTALL.vcxproj /m /p:"configuration=$buildconfig;platform=x64;BuildProjectReferences=false" *>> $Log
Copy-Item -Force -Path "$root/src-stage3/staged_install/$configuration/lib/bladeRF.dll" "$root/src-stage3/staged_install/$configuration/bin"
Remove-Item -Force -Path "$root/src-stage3/staged_install/$configuration/lib/bladeRF.dll"
Validate "$root/src-stage3/oot_code/bladeRF/host/build/$configuration/output/$buildconfig/bladeRF.dll"
CheckNoAVX "$root/src-stage3/oot_code/bladeRF/host/build/$configuration/output/$buildconfig"
# ____________________________________________________________________________________________________________
#
# rtl-sdr
#
# links to libusb dynamically and pthreads statically
#
SetLog "rtl-sdr $configuration"
Write-Host -NoNewline "configuring $configuration rtl-sdr..."
New-Item -ItemType Directory -Force -Path $root/src-stage3/oot_code/rtl-sdr/build/$configuration *>> $Log
$env:_CL_ = " $arch $runtime "
cd $root/src-stage3/oot_code/rtl-sdr/build/$configuration
cmake ../../ `
-G "Visual Studio 14 2015 Win64" `
-DTHREADS_PTHREADS_WIN32_LIBRARY="$root/build/$configuration/lib/pthreadVC2.lib" `
-DTHREADS_PTHREADS_INCLUDE_DIR="$root/build/$configuration/include" `
-DLIBUSB_LIBRARIES="$root/build/$configuration/lib/libusb-1.0.lib" `
-DLIBUSB_INCLUDE_DIR="$root/build/$configuration/include/" `
-DCMAKE_C_FLAGS="/D_TIMESPEC_DEFINED $arch /DWIN32 /D_WINDOWS /W3 /DPTW32_STATIC_LIB " `
-DCMAKE_INSTALL_PREFIX="$root/src-stage3/staged_install/$configuration" *>> $Log
Write-Host -NoNewline "building..."
msbuild .\rtlsdr.sln /m /p:"configuration=$buildconfig;platform=x64" *>> $Log
Write-Host -NoNewline "installing..."
msbuild .\INSTALL.vcxproj /m /p:"configuration=$buildconfig;platform=x64;BuildProjectReferences=false" *>> $Log
Validate "$root/src-stage3/oot_code/rtl-sdr/build/$configuration/src/$buildconfig/rtlsdr.dll"
CheckNoAVX "$root/src-stage3/oot_code/rtl-sdr/build/$configuration/src/$buildconfig"
# ____________________________________________________________________________________________________________
#
# hackRF
#
# links to libusb dynamically and pthreads statically
#
SetLog "HackRF $configuration"
Write-Host -NoNewline "configuring $configuration HackRF..."
New-Item -ItemType Directory -Force -Path $root/src-stage3/oot_code/hackrf/build/$configuration *>> $Log
cd $root/src-stage3/oot_code/hackrf/build/$configuration
$env:_CL_ = " $arch $runtime "
$ErrorActionPreference = "Continue"
cmake ../../host/ `
-G "Visual Studio 14 2015 Win64" `
-DCMAKE_PREFIX_PATH="$root\build\$configuration" `
-DLIBUSB_INCLUDE_DIR="$root/build/$configuration/include/" `
-DLIBUSB_LIBRARIES="$root/build/$configuration/lib/libusb-1.0.lib" `
-DTHREADS_PTHREADS_INCLUDE_DIR="$root/build/$configuration/include" `
-DTHREADS_PTHREADS_WIN32_LIBRARY="$root/build/$configuration/lib/pthreadVC2.lib" `
-DCMAKE_C_FLAGS="/D_TIMESPEC_DEFINED $arch /DWIN32 /D_WINDOWS /W3 /DPTW32_STATIC_LIB " `
-DFFTW_LIBRARIES="$root/build/$configuration/lib/libfftw3f.lib" `
-DCMAKE_INSTALL_PREFIX="$root/src-stage3/staged_install/$configuration" *>> $Log
Write-Host -NoNewline "building..."
msbuild .\hackrf_all.sln /m /p:"configuration=$buildconfig;platform=x64" *>> $Log
Write-Host -NoNewline "installing..."
msbuild .\INSTALL.vcxproj /m /p:"configuration=$buildconfig;platform=x64;BuildProjectReferences=false" *>> $Log
# this installs hackrf libs to the bin dir, we want to move them
Copy-Item -Force -Path "$root/src-stage3/staged_install/$configuration/bin/hackrf.lib" "$root/src-stage3/staged_install/$configuration/lib"
Copy-Item -Force -Path "$root/src-stage3/staged_install/$configuration/bin/hackrf_static.lib" "$root/src-stage3/staged_install/$configuration/lib"
$ErrorActionPreference = "Stop"
Validate "$root\src-stage3\oot_code\hackrf\build\$configuration\libhackrf\src\$buildconfig\hackrf.dll"
CheckNoAVX "$root\src-stage3\oot_code\hackrf\build\$configuration\libhackrf\src\$buildconfig"
# ____________________________________________________________________________________________________________
#
# osmo-sdr
#
# links to libusb dynamically and pthreads statically
#
SetLog "osmo-sdr $configuration"
Write-Host -NoNewline "configuring $configuration osmo-sdr..."
New-Item -ItemType Directory -Force -Path $root/src-stage3/oot_code/osmo-sdr/build/$configuration *>> $Log
cd $root/src-stage3/oot_code/osmo-sdr/build/$configuration
$env:_CL_ = " $arch $runtime "
cmake ../../software/libosmosdr/ `
-G "Visual Studio 14 2015 Win64" `
-DCMAKE_PREFIX_PATH="$root\build\$configuration" `
-DLIBUSB_INCLUDE_DIR="$root/build/$configuration/include/" `
-DLIBUSB_LIBRARIES="$root/build/$configuration/lib/libusb-1.0.lib" `
-DCMAKE_C_FLAGS="/D_TIMESPEC_DEFINED $arch /DWIN32 /D_WINDOWS /W3 /DPTW32_STATIC_LIB " `
-DCMAKE_INSTALL_PREFIX="$root/src-stage3/staged_install/$configuration" *>> $Log
Write-Host -NoNewline "building osmo-sdr..."
msbuild .\osmosdr.sln /m /p:"configuration=$buildconfig;platform=x64" *>> $Log
Write-Host -NoNewline "installing..."
msbuild .\INSTALL.vcxproj /m /p:"configuration=$buildconfig;platform=x64;BuildProjectReferences=false" *>> $Log
Validate "$root\src-stage3\oot_code\osmo-sdr\build\$configuration\src\$buildconfig\osmosdr.dll"
CheckNoAVX "$root\src-stage3\oot_code\osmo-sdr\build\$configuration\src\$buildconfig"
# ____________________________________________________________________________________________________________
#
# UHD
#
# This was previously built, but now we want to install it properly over top of the GNURadio install
# and also retrieve the UHD firmware images as the utility script has now been installed
#
# TODO download firmware once and copy into each location instead of downloading separately for each configuration
#
SetLog "UHD $configuration configuration"
Write-Host -NoNewline "configuring $configuration UHD..."
robocopy "$root/build/$configuration/uhd" "$root/src-stage3/staged_install/$configuration" /e *>> $log
New-Item -ItemType Directory $root/src-stage3/staged_install/$configuration/share/uhd/images -Force *>> $log
"complete"
Write-Host -NoNewline "downloading $configuration UHD firmware images..."
$ErrorActionPreference = "Continue"
& $pythonroot/$pythonexe $root/src-stage3/staged_install/$configuration/lib/uhd/utils/uhd_images_downloader.py -v -i "$root/src-stage3/staged_install/$configuration/share/uhd/images" *>> $log
"complete"
$ErrorActionPreference = "Stop"
# ____________________________________________________________________________________________________________
#
# gr-iqbal
#
# this doesn't add gnuradio-pmt.lib as a linker input, so we hack it manually
# TODO submit issue to source (add gnuradio-pmt.lib as a linker input to gr-iqbal)
# Also the upstream sources uses C99 complex constructs that MSVC doesn't support
# so we're using a custom version of the source.
#
if ($mm -eq "3.8") {
Write-Host "gr-iqbal not gr3.8 compatible"
} else {
SetLog "gr-iqbal $configuration"
$ErrorActionPreference = "Continue"
Write-Host -NoNewline "configuring $configuration gr-iqbal..."
New-Item -ItemType Directory -Force -Path $root/src-stage3/oot_code/gr-iqbal/build/$configuration *>> $Log
cd $root/src-stage3/oot_code/gr-iqbal/build/$configuration
$env:_CL_ = " $arch $runtime "
$env:_LINK_= " $root/src-stage3/staged_install/$configuration/lib/gnuradio-pmt.lib /DEBUG "
if ($mm -eq '3.8') {$env:_LINK_= $env:_LINK_ + " $root/build/$configuration/lib/log4cpp.lib "}
if (Test-Path CMakeCache.txt) {Remove-Item -Force CMakeCache.txt} # Don't keep the old cache because if the user is fixing a config problem it may not re-check the fix
cmake ../../ `
-G "Visual Studio 14 2015 Win64" `
-DCMAKE_PREFIX_PATH="$root\build\$configuration" `
-DCMAKE_C_FLAGS="/D_TIMESPEC_DEFINED $arch $runtime /EHsc /DWIN32 /DNOMINMAX /D_WINDOWS /W3 /DENABLE_GR_LOG=ON " `
-DCMAKE_CXX_FLAGS="/D_TIMESPEC_DEFINED $arch $runtime /EHsc /DWIN32 /DNOMINMAX /D_WINDOWS /W3 /DENABLE_GR_LOG=ON " `
-DPYTHON_LIBRARY="$root/src-stage3/staged_install/$configuration/gr-python27/libs/python27$debug_ext.lib" `
-DPYTHON_LIBRARY_DEBUG="$root/src-stage3/staged_install/$configuration/gr-python27/libs/python27_d.lib" `
-DPYTHON_EXECUTABLE="$root/src-stage3/staged_install/$configuration/gr-python27/$pythonexe" `
-DPYTHON_INCLUDE_DIR="$root/src-stage3/staged_install/$configuration/gr-python27/include" `
-DBOOST_LIBRARYDIR=" $root/build/$configuration/lib/" `
-DBOOST_INCLUDEDIR="$root/build/$configuration/include" `
-DBOOST_ROOT="$root/build/$configuration/" `
-DCMAKE_INSTALL_PREFIX="$root/src-stage3/staged_install/$configuration" `
-DFFTW3F_LIBRARIES="$root/build/Release/lib/libfftw3f.lib" `
-DFFTW3F_INCLUDE_DIRS="$root/build/Release/include/" `
-DLINK_LIBRARIES="gnuradio-pmt.lib" `
-DSWIG_EXECUTABLE="$root/bin/swig.exe" `
-Wno-dev *>> $Log
Write-Host -NoNewline "building..."
msbuild .\gr-iqbalance.sln /m /p:"configuration=$buildconfig;platform=x64" *>> $Log
Write-Host -NoNewline "installing..."
msbuild .\INSTALL.vcxproj /m /p:"configuration=$buildconfig;platform=x64;BuildProjectReferences=false" *>> $Log
Validate "$root\src-stage3\oot_code\gr-iqbal\build\$configuration\lib\$buildconfig\gnuradio-iqbalance.dll" "$root\src-stage3\staged_install\$configuration\lib\site-packages\gnuradio\iqbalance\_iqbalance_swig.pyd"
CheckNoAVX "$root\src-stage3\oot_code\gr-iqbal\build\$configuration\lib\$buildconfig"
$env:_LINK_ = ""
$ErrorActionPreference = "Stop"
}
# ____________________________________________________________________________________________________________
#
# gr-osmosdr
#
# Note this must be built at the end, after all the other libraries are ready
#
# /EHsc is important or else you get boost::throw_exception linker errors
# ENABLE_RFSPACE=False is because the latest gr-osmosdr has linux-only support for that SDR
# /DNOMINMAX prevents errors related to std::min definition
#
SetLog "gr-osmosdr $configuration"
Write-Host -NoNewline "configuring $configuration gr-osmosdr..."
New-Item -Force -ItemType Directory $root/src-stage3/oot_code/gr-osmosdr/build/$configuration *>> $Log
cd $root/src-stage3/oot_code/gr-osmosdr/build/$configuration
$ErrorActionPreference = "Continue"
$env:LIB = "$root/build/$configuration/lib;" + $oldlib
$env:_CL_ = " $arch $runtime "
$env:_LINK_= " $root/src-stage3/staged_install/$configuration/lib/gnuradio-pmt.lib $root/src-stage3/staged_install/$configuration/lib/gnuradio-runtime.lib $root/src-stage3/staged_install/$configuration/lib/gnuradio-blocks.lib $root/build/$configuration/lib/log4cpp.lib /DEBUG "
if ($mm -eq '3.8') {$env:_LINK_= $env:_LINK_ + " $root/build/$configuration/lib/log4cpp.lib "}
if ($configuration -match "AVX") {$SIMD="-DUSE_SIMD=""AVX"""} else {$SIMD=""}
$env:Path = "$root/src-stage3\staged_install\$configuration;$root/src-stage3\staged_install\$configuration\bin;$root/src-stage3\staged_install\$configuration\lib;" + $oldPath
& cmake ../../ `
-G "Visual Studio 14 2015 Win64" `
-DPKG_CONFIG_EXECUTABLE="$root/bin/pkg-config.exe" `
-DCMAKE_PREFIX_PATH="$root\build\$configuration" `
-DCMAKE_INCLUDE_PATH="$root/build/$configuration/include" `
-DCMAKE_LIBRARY_PATH="$root/build/$configuration/lib" `
-DCMAKE_INSTALL_PREFIX="$root/src-stage3/staged_install/$configuration" `
-DPYTHON_LIBRARY="$root/src-stage3/staged_install/$configuration/gr-python27/libs/python27.lib" `
-DPYTHON_LIBRARY_DEBUG="$root/src-stage3/staged_install/$configuration/gr-python27/libs/python27_d.lib" `
-DPYTHON_EXECUTABLE="$root/src-stage3/staged_install/$configuration/gr-python27/$pythonexe" `
-DPYTHON_INCLUDE_DIR="$root/src-stage3/staged_install/$configuration/gr-python27/include" `
-DBOOST_LIBRARYDIR=" $root/build/$configuration/lib/" `
-DBOOST_INCLUDEDIR="$root/build/$configuration/include" `
-DBOOST_ROOT="$root/build/$configuration/" `
-DLIBAIRSPY_INCLUDE_DIRS="..\libairspy\src" `
-DLIBAIRSPY_LIBRARIES="$root\src-stage3\staged_install\$configuration\lib\airspy.lib" `
-DLIBAIRSPYHF_INCLUDE_DIRS="..\libairspy\src" `
-DLIBAIRSPYHF_LIBRARIES="$root\src-stage3\staged_install\$configuration\lib\airspyhf.lib" `
-DLIBBLADERF_INCLUDE_DIRS="$root\src-stage3\staged_install\$configuration\include\" `
-DLIBBLADERF_LIBRARIES="$root\src-stage3\staged_install\$configuration\lib\bladeRF.lib" `
-DLIBHACKRF_INCLUDE_DIRS="$root\src-stage3\staged_install\$configuration\include\" `
-DLIBHACKRF_LIBRARIES="$root\src-stage3\staged_install\$configuration\lib\hackrf.lib" `
-DLIBRTLSDR_INCLUDE_DIRS="$root\src-stage3\staged_install\$configuration\include\" `
-DLIBRTLSDR_LIBRARIES="$root\src-stage3\staged_install\$configuration\lib\rtlsdr.lib" `
-DLIBOSMOSDR_INCLUDE_DIRS="$root\src-stage3\staged_install\$configuration\include\" `
-DLIBOSMOSDR_LIBRARIES="$root\src-stage3\staged_install\$configuration\lib\osmosdr.lib" `
-DVOLK_LIBRARIES="$root\src-stage3\staged_install\$configuration\lib\volk.lib" `
-DVOLK_INCLUDE_DIRS="$root\src-stage3\staged_install\$configuration\include\" `
-DCMAKE_CXX_FLAGS="/DNOMINMAX /D_TIMESPEC_DEFINED $arch /DWIN32 /D_WINDOWS /W3 /DPTW32_STATIC_LIB /I$root/build/$configuration/include /EHsc /DBOOST_ALL_DYN_LINK" `
-DCMAKE_C_FLAGS="/DNOMINMAX /D_TIMESPEC_DEFINED $arch /DWIN32 /D_WINDOWS /W3 /DPTW32_STATIC_LIB /EHsc " `
-DSWIG_EXECUTABLE="$root/bin/swig.exe" `
$SIMD `
-DENABLE_DOXYGEN="TRUE" `
-DENABLE_RFSPACE="FALSE" *>> $Log # RFSPACE not building in current git pull (0.1.5git 164a09fc 3/13/2016), due to having linux-only headers being added
Write-Host -NoNewline "building..."
msbuild .\gr-osmosdr.sln /m /p:"configuration=$buildconfig;platform=x64" *>> $Log
Write-Host -NoNewline "installing..."
msbuild .\INSTALL.vcxproj /m /p:"configuration=$buildconfig;platform=x64;BuildProjectReferences=false" *>> $Log
# osmocom_fft.py tries to set up a file sink to /dev/null, so we need to replace that with nul
(Get-Content $root\src-stage3\staged_install\$configuration\bin\osmocom_fft.py).replace('/dev/null', 'nul') | Set-Content $root\src-stage3\staged_install\$configuration\bin\osmocom_fft.py
Validate "$root\src-stage3\oot_code\gr-osmosdr\build\$configuration\lib\$buildconfig\gnuradio-osmosdr.dll"
CheckNoAVX "$root\src-stage3\oot_code\gr-osmosdr\build\$configuration\lib\$buildconfig"
$env:_LINK_ = ""
$env:Path = $oldPath
}
function BuildOOTModules
{
$configuration = $args[0]
$buildsymbols=$true
$pythonroot = "$root/src-stage3/staged_install/$configuration/gr-python27"
if ($configuration -match "Release") {
$buildconfig="Release";$pythonexe = "python.exe"; $debugext = ""; $debug_ext = ""; $runtime = "/MD"
}
else {
$buildconfig="Debug"; $pythonexe = "python_d.exe";$debugext = "d"; $debug_ext = "_d";$runtime = "/MDd"
}
if ($buildsymbols -and $buildconfig -eq "Release") {$buildconfig="RelWithDebInfo"}
if ($configuration -match "AVX2") {$arch="/arch:AVX2"} else {$arch=""}
# ____________________________________________________________________________________________________________
#
# gr-soapy
#
#
SetLog "gr-soapy $configuration"
$ErrorActionPreference = "Continue"
Write-Host -NoNewline "configuring $configuration gr-soapy..."
New-Item -ItemType Directory -Force -Path $root/src-stage3/oot_code/gr-soapy/build/$configuration *>> $Log
Copy-Item -Force $root\src-stage3\staged_install\$configuration\include\gnuradio\swig\gnuradio.i $root/bin/Lib
cd $root/src-stage3/oot_code/gr-soapy/build/$configuration
$linkflags = " /DEFAULTLIB:$root/src-stage3/staged_install/$configuration/lib/gnuradio-pmt.lib /DEBUG /NODEFAULTLIB:m.lib "
$env:_LINK_= ""
$env:_CL_ = ""
$env:Path=""
cmake ../../ `
-G "Visual Studio 14 2015 Win64" `
-DCMAKE_PREFIX_PATH="$root\build\$configuration" `
-DCMAKE_C_FLAGS=" /DBOOST_ALL_DYN_LINK /DUSING_GLEW /EHsc /D_USE_MATH_DEFINES /DNOMINMAX /D_TIMESPEC_DEFINED $arch $runtime /DWIN32 /D_WINDOWS /W3 /I""$root/src-stage3/staged_install/$configuration"" /I""$root/src-stage3/staged_install/$configuration/include"" /I""$root/src-stage3/staged_install/$configuration/include/swig"" " `
-DCMAKE_CXX_FLAGS=" /DBOOST_ALL_DYN_LINK /DUSING_GLEW /EHsc /D_USE_MATH_DEFINES /DNOMINMAX /D_TIMESPEC_DEFINED $arch $runtime /DWIN32 /D_WINDOWS /W3 /I""$root/src-stage3/staged_install/$configuration"" /I""$root/src-stage3/staged_install/$configuration/include"" /I""$root/src-stage3/staged_install/$configuration/include/swig"" " `
-DPYTHON_LIBRARY="$root/src-stage3/staged_install/$configuration/gr-python27/libs/python27.lib" `
-DPYTHON_LIBRARY_DEBUG="$root/src-stage3/staged_install/$configuration/gr-python27/libs/python27_d.lib" `
-DPYTHON_EXECUTABLE="$root/src-stage3/staged_install/$configuration/gr-python27/$pythonexe" `
-DPYTHON_INCLUDE_DIR="$root/src-stage3/staged_install/$configuration/gr-python27/include" `
-DBOOST_LIBRARYDIR=" $root/build/$configuration/lib" `
-DBOOST_INCLUDEDIR="$root/build/$configuration/include" `
-DBOOST_ROOT="$root/build/$configuration/" `
-DCMAKE_INSTALL_PREFIX="$root/src-stage3/staged_install/$configuration" `
-DSWIG_EXECUTABLE="$root/bin/swig.exe" `
-DCMAKE_SHARED_LINKER_FLAGS=" $linkflags " `
-DCMAKE_EXE_LINKER_FLAGS=" $linkflags " `
-DCMAKE_STATIC_LINKER_FLAGS=" $linkflags " `
-DCMAKE_MODULE_LINKER_FLAGS=" $linkflags " `
-Wno-dev *>> $Log
$env:Path = $oldPath
Write-Host -NoNewline "building gr-soapy..."
msbuild .\gr-soapy.sln /m /p:"configuration=$buildconfig;platform=x64" *>> $Log
Write-Host -NoNewline "installing..."
msbuild .\INSTALL.vcxproj /m /p:"configuration=$buildconfig;platform=x64;BuildProjectReferences=false" *>> $Log
$env:_CL_ = ""
$env:_LINK_ = ""
$ErrorActionPreference = "Stop"
Validate "$root/src-stage3/staged_install/$configuration/bin/gnuradio-soapy.dll"
# ____________________________________________________________________________________________________________
#
# gr-acars2
#
# We can make up for most of the windows incompatibilities, but the inclusion of the "m" lib requires a CMake file change
# so need to use a patch
# TODO update CMake to include m only with not win32
# fails on debug as the include/swig directory is not created during the Debug build
#
if ($mm -eq "3.8") {
Write-Host "gr-acars2 not gr3.8 compatible"
} else {
SetLog "gr-acars2 $configuration"
$ErrorActionPreference = "Continue"
Write-Host -NoNewline "configuring $configuration gr-acars2..."
New-Item -ItemType Directory -Force -Path $root/src-stage3/oot_code/gr-acars2/build/$configuration *>> $Log
Copy-Item -Force $root\src-stage3\staged_install\$configuration\include\gnuradio\swig\gnuradio.i $root/bin/Lib
cd $root/src-stage3/oot_code/gr-acars2/build/$configuration
$linkflags = " /DEFAULTLIB:$root/src-stage3/staged_install/$configuration/lib/gnuradio-pmt.lib /DEBUG /NODEFAULTLIB:m.lib "
if ($mm -eq '3.8') {$linkflags = $linkflags + " /DEFAULTLIB:$root/build/$configuration/lib/log4cpp.lib "}
$env:_LINK_= ""
$env:_CL_ = ""
$env:Path=""
cmake ../../ `
-G "Visual Studio 14 2015 Win64" `
-DCMAKE_PREFIX_PATH="$root\build\$configuration" `
-DGNURADIO_RUNTIME_LIBRARIES="$root/src-stage3/staged_install/$configuration/lib/gnuradio-runtime.lib" `
-DGNURADIO_RUNTIME_INCLUDE_DIRS="$root/src-stage3/staged_install/$configuration/include" `
-DCPPUNIT_LIBRARIES="$root/build/$configuration/lib/cppunit.lib" `
-DCMAKE_C_FLAGS=" /DUSING_GLEW /EHsc /D_USE_MATH_DEFINES /DNOMINMAX /D_TIMESPEC_DEFINED $arch $runtime /DWIN32 /D_WINDOWS /W3 /I""$root/src-stage3/staged_install/$configuration"" /I""$root/src-stage3/staged_install/$configuration/include"" /I""$root/src-stage3/staged_install/$configuration/include/swig"" " `
-DCMAKE_CXX_FLAGS=" /DUSING_GLEW /EHsc /D_USE_MATH_DEFINES /DNOMINMAX /D_TIMESPEC_DEFINED $arch $runtime /DWIN32 /D_WINDOWS /W3 /I""$root/src-stage3/staged_install/$configuration"" /I""$root/src-stage3/staged_install/$configuration/include"" /I""$root/src-stage3/staged_install/$configuration/include/swig"" " `
-DPYTHON_LIBRARY="$root/src-stage3/staged_install/$configuration/gr-python27/libs/python27.lib" `
-DPYTHON_LIBRARY_DEBUG="$root/src-stage3/staged_install/$configuration/gr-python27/libs/python27_d.lib" `
-DPYTHON_EXECUTABLE="$root/src-stage3/staged_install/$configuration/gr-python27/$pythonexe" `
-DPYTHON_INCLUDE_DIR="$root/src-stage3/staged_install/$configuration/gr-python27/include" `
-DBOOST_LIBRARYDIR=" $root/build/$configuration/lib" `
-DBOOST_INCLUDEDIR="$root/build/$configuration/include" `
-DBOOST_ROOT="$root/build/$configuration/" `
-DCMAKE_INSTALL_PREFIX="$root/src-stage3/staged_install/$configuration" `
-DSWIG_EXECUTABLE="$root/bin/swig.exe" `
-DCMAKE_SHARED_LINKER_FLAGS=" $linkflags " `
-DCMAKE_EXE_LINKER_FLAGS=" $linkflags " `
-DCMAKE_STATIC_LINKER_FLAGS=" $linkflags " `
-DCMAKE_MODULE_LINKER_FLAGS=" $linkflags " `
-Wno-dev *>> $Log
$env:Path = $oldPath
Write-Host -NoNewline "building gr-acars2..."
msbuild .\gr-acars2.sln /m /p:"configuration=$buildconfig;platform=x64" *>> $Log
Write-Host -NoNewline "installing..."
msbuild .\INSTALL.vcxproj /m /p:"configuration=$buildconfig;platform=x64;BuildProjectReferences=false" *>> $Log
# the cmake files don't install the samples or examples or docs so let's see what we can do here
# TODO update the CMAKE file to move these over
New-Item -ItemType Directory -Force $root/src-stage3/staged_install/$configuration/share/acars2/examples *>> $Log
Copy-Item $root/src-stage3/oot_code/gr-acars2/examples/simple.grc $root/src-stage3/staged_install/$configuration/share/acars2/examples
Copy-Item $root/src-stage3/oot_code/gr-acars2/samples/*.grc $root/src-stage3/staged_install/$configuration/share/acars2/examples
Copy-Item $root/src-stage3/oot_code/gr-acars2/samples/*.wav $root/src-stage3/staged_install/$configuration/share/acars2/examples
Copy-Item $root/src-stage3/oot_code/gr-acars2/samples/*.py $root/src-stage3/staged_install/$configuration/share/acars2/examples
$env:_CL_ = ""
$env:_LINK_ = ""
$ErrorActionPreference = "Stop"
Validate "$root/src-stage3/staged_install/$configuration/bin/gnuradio-acars2.dll" "$root/src-stage3/staged_install/$configuration/lib/site-packages/acars2/_acars2_swig.pyd"
}
# ____________________________________________________________________________________________________________
#
# gr-adsb
#
#
<# SetLog "gr-adsb $configuration"
$ErrorActionPreference = "Continue"
Write-Host -NoNewline "configuring $configuration gr-adsb..."
New-Item -ItemType Directory -Force -Path $root/src-stage3/oot_code/gr-adsb/build/$configuration *>> $Log
cd $root/src-stage3/oot_code/gr-adsb/build/$configuration
$env:_CL_ = " $arch $runtime "
$env:_LINK_= " $root/src-stage3/staged_install/$configuration/lib/gnuradio-pmt.lib /DEBUG /NODEFAULTLIB:m.lib "
$env:_CL_ = $env:_CL_ + " -D_USE_MATH_DEFINES -I""$root/src-stage3/staged_install/$configuration/include"" -I""$root/src-stage3/staged_install/$configuration/include/swig"" "
$env:Path=""
cmake ../../ `
-G "Visual Studio 14 2015 Win64" `
-DCMAKE_PREFIX_PATH="$root\build\$configuration" `
-DGNURADIO_RUNTIME_LIBRARIES="$root/src-stage3/staged_install/$configuration/lib/gnuradio-runtime.lib" `
-DGNURADIO_RUNTIME_INCLUDE_DIRS="$root/src-stage3/staged_install/$configuration/include" `
-DCMAKE_C_FLAGS="/D_USE_MATH_DEFINES /D_TIMESPEC_DEFINED $arch $runtime /DWIN32 /D_WINDOWS /W3 /I""$root/src-stage3/staged_install/$configuration"" " `
-DPYTHON_EXECUTABLE="$root/src-stage3/staged_install/$configuration/gr-python27/$pythonexe" `
-DCMAKE_INSTALL_PREFIX="$root/src-stage3/staged_install/$configuration" `
-Wno-dev *>> $Log
$env:Path = $oldPath
Write-Host -NoNewline "building gr-adsb..."
msbuild .\gr-adsb.sln /m /p:"configuration=$buildconfig;platform=x64" *>> $Log
Write-Host -NoNewline "installing..."
msbuild .\INSTALL.vcxproj /m /p:"configuration=$buildconfig;platform=x64;BuildProjectReferences=false" *>> $Log
# the cmake files don't install the samples or examples or docs so let's see what we can do here
# TODO update the CMAKE file to move these over
New-Item -ItemType Directory -Force $root/src-stage3/staged_install/$configuration/share/adsb/examples *>> $Log
Copy-Item $root/src-stage3/oot_code/gr-adsb/examples/*.* $root/src-stage3/staged_install/$configuration/share/adsb/examples
$env:_CL_ = ""
$env:_LINK_ = ""
$ErrorActionPreference = "Stop"
Validate "$root/src-stage3/staged_install/$configuration/Lib/site-packages/adsb/decoder.py" #>
# ____________________________________________________________________________________________________________
#
# gr-air-modes
#
# The modes_gui application will not work because Qt4 is currently built without webkit. However, the command line portion will work just fine.
#
SetLog "gr-air-modes $configuration"
$ErrorActionPreference = "Continue"
Write-Host -NoNewline "configuring $configuration gr-air-modes..."
New-Item -ItemType Directory -Force -Path $root/src-stage3/oot_code/gr-air-modes/build/$configuration *>> $Log
cd $root/src-stage3/oot_code/gr-air-modes/build/$configuration
$linkflags = " /DEFAULTLIB:$root/src-stage3/staged_install/$configuration/lib/gnuradio-pmt.lib /DEBUG /NODEFAULTLIB:m.lib "
if ($mm -eq '3.8') {$linkflags = $linkflags + " /DEFAULTLIB:$root/build/$configuration/lib/log4cpp.lib "}
$env:_CL_ = ""
$env:Path= "$root/build/$configuration/lib;" + $oldPath
$env:PYTHONPATH="$pythonroot/Lib/site-packages"
cmake ../../ `
-G "Visual Studio 14 2015 Win64" `
-DCMAKE_PREFIX_PATH="$root\build\$configuration" `
-DCMAKE_INSTALL_PREFIX="$root/src-stage3/staged_install/$configuration" `
-DGNURADIO_RUNTIME_LIBRARIES="$root/src-stage3/staged_install/$configuration/lib/gnuradio-runtime.lib" `
-DGNURADIO_RUNTIME_INCLUDE_DIRS="$root/src-stage3/staged_install/$configuration/include" `
-DCMAKE_C_FLAGS="/DBOOST_ALL_DYN_LINK /D_USE_MATH_DEFINES /DNOMINMAX /EHsc /D_TIMESPEC_DEFINED $arch $runtime /DWIN32 /D_WINDOWS /W3 /I""$root/src-stage3/staged_install/$configuration"" /I""$root/src-stage3/staged_install/$configuration/include"" /I""$root/src-stage3/staged_install/$configuration/include/swig"" " `
-DCMAKE_CXX_FLAGS="/DBOOST_ALL_DYN_LINK /D_USE_MATH_DEFINES /DNOMINMAX /EHsc /D_TIMESPEC_DEFINED $arch $runtime /DWIN32 /D_WINDOWS /W3 /I""$root/src-stage3/staged_install/$configuration"" /I""$root/src-stage3/staged_install/$configuration/include"" /I""$root/src-stage3/staged_install/$configuration/include/swig"" " `
-DPYTHON_LIBRARY="$root/src-stage3/staged_install/$configuration/gr-python27/libs/python27.lib" `
-DPYTHON_LIBRARY_DEBUG="$root/src-stage3/staged_install/$configuration/gr-python27/libs/python27_d.lib" `
-DPYTHON_EXECUTABLE="$root/src-stage3/staged_install/$configuration/gr-python27/$pythonexe" `
-DPYTHON_INCLUDE_DIR="$root/src-stage3/staged_install/$configuration/gr-python27/include" `-DCMAKE_INSTALL_PREFIX="$root/src-stage3/staged_install/$configuration" `
-DBOOST_LIBRARYDIR=" $root/build/$configuration/lib" `
-DBOOST_INCLUDEDIR="$root/build/$configuration/include" `
-DBOOST_ROOT="$root/build/$configuration/" `
-DPYUIC4_EXECUTABLE="$root/src-stage3/staged_install/$configuration/gr-python27/pyuic4.bat" `
-DSWIG_EXECUTABLE="$root/bin/swig.exe" `
-DCMAKE_SHARED_LINKER_FLAGS=" $linkflags " `
-DCMAKE_EXE_LINKER_FLAGS=" $linkflags " `
-DCMAKE_STATIC_LINKER_FLAGS=" $linkflags " `
-DCMAKE_MODULE_LINKER_FLAGS=" $linkflags " `
-Wno-dev *>> $Log
Write-Host -NoNewline "building gr-air-modes..."
msbuild .\gr-air-modes.sln /m /p:"configuration=$buildconfig;platform=x64" *>> $Log
Write-Host -NoNewline "installing..."
msbuild .\INSTALL.vcxproj /m /p:"configuration=$buildconfig;platform=x64;BuildProjectReferences=false" *>> $Log
$env:Path = $oldPath
$env:PYTHONPATH=""
$env:_CL_ = ""
$env:_LINK_ = ""
$ErrorActionPreference = "Stop"
Validate "$root/src-stage3/oot_code/gr-air-modes/build/$configuration/lib/$buildconfig/air_modes.dll" "$root\src-stage3\staged_install\$configuration\lib\site-packages\air_modes\_air_modes_swig.pyd"
# ____________________________________________________________________________________________________________
#
# glfw
#
# required by gr-fosphor
#
SetLog "glfw $configuration"
Write-Host -NoNewline "configuring $configuration glfw..."
New-Item -Force -ItemType Directory $root/src-stage3/oot_code/glfw/build/$configuration *>> $Log
cd $root/src-stage3/oot_code/glfw/build/$configuration
$env:_CL_ = " $arch $runtime "
$ErrorActionPreference = "Continue"
& cmake ../../ `
-G "Visual Studio 14 2015 Win64" `
-DBUILD_SHARED_LIBS="true" *>> $Log
Write-Host -NoNewline "building for shared..."
msbuild .\glfw.sln /m /p:"configuration=$buildconfig;platform=x64" *>> $Log
& cmake ../../ `
-G "Visual Studio 14 2015 Win64" `
-DBUILD_SHARED_LIBS="false" *>> $Log
Write-Host -NoNewline "building for static..."
msbuild .\glfw.sln /m /p:"configuration=$buildconfig;platform=x64" *>> $Log
$env:_CL_ = ""
$ErrorActionPreference = "Stop"
Validate "$root\src-stage3\oot_code\glfw\build\$configuration\src\$buildconfig\glfw3.dll"
# ____________________________________________________________________________________________________________
#
# gr-fosphor
#
# needed to macro out __attribute__, include gnuradio-pmt, and include glew64.lib and a glewInit() call
#
SetLog "gr-fosphor $configuration"
if ($env:AMDAPPSDKROOT) {
if ($mm -eq "3.8") {
"gr-fosphor with 3.8 requires python >= 3, skipping"
} else {
$ErrorActionPreference = "Continue"
Write-Host -NoNewline "configuring $configuration gr-fosphor..."
New-Item -ItemType Directory -Force -Path $root/src-stage3/oot_code/gr-fosphor/build/$configuration *>> $Log
cd $root/src-stage3/oot_code/gr-fosphor/build/$configuration
if ($configuration -match "AVX2") {
$DLLconfig="ReleaseDLL-AVX2"
} else {
$DLLconfig = $configuration + "DLL"
}
$env:_CL_ = ""
$env:_LINK_= " /DEBUG /OPT:ref,icf "
if ($mm -eq '3.8') {$env:_LINK_= $env:_LINK_ + " $root/build/$configuration/lib/log4cpp.lib "}
$env:Path = $env:AMDAPPSDKROOT + ";" + $oldPath
cmake ../../ `
-G "Visual Studio 14 2015 Win64" `
-DCMAKE_PREFIX_PATH="$root\build\$configuration" `
-DCMAKE_INSTALL_PREFIX="$root/src-stage3/staged_install/$configuration" `
-DBOOST_LIBRARYDIR=" $root/build/$configuration/lib" `
-DBOOST_INCLUDEDIR="$root/build/$configuration/include" `
-DBOOST_ROOT="$root/build/$configuration/" `
-DOpenCL_LIBRARY="$env:AMDAPPSDKROOT/lib/x86_64/OpenCL.lib" `
-DOpenCL_INCLUDE_DIR="$env:AMDAPPSDKROOT/include" `
-DFREETYPE2_PKG_INCLUDE_DIRS="$root/build/$configuration/include" `
-DFREETYPE2_PKG_LIBRARY_DIRS="$root/build/$configuration/lib" `
-DCMAKE_C_FLAGS="/D_TIMESPEC_DEFINED $arch $runtime /DNOMINMAX /DWIN32 /D_WINDOWS /W3 /Zi /EHsc " `
-DCMAKE_CXX_FLAGS="/D_TIMESPEC_DEFINED $arch $runtime /DNOMINMAX /DWIN32 /D_WINDOWS /W3 /Zi /EHsc" `
-DPYTHON_LIBRARY="$root/src-stage3/staged_install/$configuration/gr-python27/libs/python27.lib" `
-DPYTHON_LIBRARY_DEBUG="$root/src-stage3/staged_install/$configuration/gr-python27/libs/python27_d.lib" `
-DPYTHON_EXECUTABLE="$root/src-stage3/staged_install/$configuration/gr-python27/$pythonexe" `
-DPYTHON_INCLUDE_DIR="$root/src-stage3/staged_install/$configuration/gr-python27/include" `
-DQT_QMAKE_EXECUTABLE="$root/build/$configuration/bin/qmake.exe" `
-DQT_UIC_EXECUTABLE="$root/build/$configuration/bin/uic.exe" `
-DQT_MOC_EXECUTABLE="$root/build/$configuration/bin/moc.exe" `
-DQT_RCC_EXECUTABLE="$root/build/$configuration/bin/rcc.exe" `
-DGLFW3_PKG_INCLUDE_DIRS="$root\src-stage3\oot_code\glfw\include\" `
-DGLFW3_PKG_LIBRARY_DIRS="$root\src-stage3\oot_code\glfw\build\$configuration\src\$buildconfig" `
-DSWIG_EXECUTABLE="$root/bin/swig.exe" `
-Wno-dev *>> $Log
Write-Host -NoNewline "building gr-fosphor..."
msbuild .\gr-fosphor.sln /m /p:"configuration=$buildconfig;platform=x64" *>> $Log
Write-Host -NoNewline "installing..."
msbuild .\INSTALL.vcxproj /m /p:"configuration=$buildconfig;platform=x64;BuildProjectReferences=false" *>> $Log
cp $env:AMDAPPSDKROOT/bin/x86_64/glew64.dll $root/src-stage3/staged_install/$configuration/bin
$env:_LINK_ = ""
$env:_CL_ = ""
$env:Path = $oldPath
$ErrorActionPreference = "Stop"
Validate "$root/src-stage3/staged_install/$configuration/bin/gnuradio-fosphor.dll" "$root\src-stage3\staged_install\$configuration\lib\site-packages\gnuradio\fosphor\_fosphor_swig.pyd"
}
} else {
"Unable to build gr-fosphor, AMD APP SDK not found, skipping"
}
# ____________________________________________________________________________________________________________
#
# gqrx
#
# Requires Qt5,
# TODO Doesn't currently seem to support UHD devices, even though the same gr-osmosdr block in GRC with the same device string will work.
#
SetLog "gqrx $configuration"
Write-Host -NoNewline "configuring $configuration gqrx..."
$env:_CL_ = ""
if ($mm -eq "3.8") {
New-Item -Force -ItemType Directory $root/src-stage3/oot_code/gqrx/build/$configuration *>> $Log
cd $root/src-stage3/oot_code/gqrx/build/$configuration
$ErrorActionPreference = "Continue"
$env:_LINK_= " /DEBUG /DEFAULTLIB:$root/build/$configuration/lib/log4cpp.lib /DEFAULTLIB:$root/src-stage3/staged_install/$configuration/lib/volk.lib "
& cmake ../../ `
-G "Visual Studio 14 2015 Win64" `
-DCMAKE_PREFIX_PATH="$root\build\$configuration;$root/src-stage3/staged_install/$configuration" `
-DCMAKE_INSTALL_PREFIX="$root/src-stage3/staged_install/$configuration" `
-DBOOST_LIBRARYDIR="$root\build\$configuration\lib" `
-DCMAKE_C_FLAGS=" $arch $runtime /EHsc /DENABLE_GR_LOG=ON " `
-DCMAKE_CXX_FLAGS=" $arch $runtime /EHsc /DENABLE_GR_LOG=ON " `
-Wno-dev *>> $Log
Write-Host -NoNewline "building..."
msbuild .\gqrx.sln /m /p:"configuration=$buildconfig;platform=x64" *>> $Log
Write-Host -NoNewline "installing..."
msbuild .\INSTALL.vcxproj /m /p:"configuration=$buildconfig;platform=x64;BuildProjectReferences=false" *>> $Log
cp $root/build/$configuration/bin/Qt5Network*.dll $root\src-stage3\staged_install\$configuration\bin\
cp $root/build/$configuration/bin/Qt5Core*.dll $root\src-stage3\staged_install\$configuration\bin\
cp $root/build/$configuration/bin/Qt5Gui*.dll $root\src-stage3\staged_install\$configuration\bin\
cp $root/build/$configuration/bin/Qt5Widgets*.dll $root\src-stage3\staged_install\$configuration\bin\
cp $root/build/$configuration/bin/Qt5Svg*.dll $root\src-stage3\staged_install\$configuration\bin\
New-Item -ItemType Directory $root\src-stage3\staged_install\$configuration\plugins -Force *>> $Log
cp -Recurse -Force $root/build/$configuration/plugins/platforms $root\src-stage3\staged_install\$configuration\bin
cp -Recurse -Force $root/build/$configuration/plugins/iconengines $root\src-stage3\staged_install\$configuration\bin
cp -Recurse -Force $root/build/$configuration/plugins/imageformats $root\src-stage3\staged_install\$configuration\bin
"[Paths]" | out-file -FilePath $root/src-stage3/staged_install/$configuration/bin/qt.conf -encoding ASCII
"Prefix = ." | out-file -FilePath $root/src-stage3/staged_install/$configuration/bin/qt.conf -encoding ASCII -append
$env:_LINK_= ""
} else {
New-Item -Force -ItemType Directory $root/src-stage3/oot_code/gqrx/build/$configuration *>> $Log
cd $root/src-stage3/oot_code/gqrx/build/$configuration
$ErrorActionPreference = "Continue"
& cmake ../../ `
-G "Visual Studio 14 2015 Win64" `
-DCMAKE_PREFIX_PATH="$root\build\$configuration\gqrx" `
-DCMAKE_INSTALL_PREFIX="$root/src-stage3/staged_install/$configuration" `
-DBOOST_LIBRARYDIR="$root\build\$configuration\lib" `
-DCMAKE_C_FLAGS=" $arch $runtime /EHsc /DENABLE_GR_LOG=ON " `
-DCMAKE_CXX_FLAGS=" $arch $runtime /EHsc /DENABLE_GR_LOG=ON " `
-Wno-dev *>> $Log
Write-Host -NoNewline "building..."
msbuild .\gqrx.sln /m /p:"configuration=$buildconfig;platform=x64" *>> $Log
Write-Host -NoNewline "installing..."
msbuild .\INSTALL.vcxproj /m /p:"configuration=$buildconfig;platform=x64;BuildProjectReferences=false" *>> $Log
cp $root/build/$configuration/gqrx/bin/Qt5Network*.dll $root\src-stage3\staged_install\$configuration\bin\
cp $root/build/$configuration/gqrx/bin/Qt5Core*.dll $root\src-stage3\staged_install\$configuration\bin\
cp $root/build/$configuration/gqrx/bin/Qt5Gui*.dll $root\src-stage3\staged_install\$configuration\bin\
cp $root/build/$configuration/gqrx/bin/Qt5Widgets*.dll $root\src-stage3\staged_install\$configuration\bin\
cp $root/build/$configuration/gqrx/bin/Qt5Svg*.dll $root\src-stage3\staged_install\$configuration\bin\
New-Item -ItemType Directory $root\src-stage3\staged_install\$configuration\plugins -Force *>> $Log
cp -Recurse -Force $root/build/$configuration/gqrx/plugins/platforms $root\src-stage3\staged_install\$configuration\bin
cp -Recurse -Force $root/build/$configuration/gqrx/plugins/iconengines $root\src-stage3\staged_install\$configuration\bin
cp -Recurse -Force $root/build/$configuration/gqrx/plugins/imageformats $root\src-stage3\staged_install\$configuration\bin
"[Paths]" | out-file -FilePath $root/src-stage3/staged_install/$configuration/bin/qt.conf -encoding ASCII
"Prefix = ." | out-file -FilePath $root/src-stage3/staged_install/$configuration/bin/qt.conf -encoding ASCII -append
}
$env:_CL_ = ""
Validate "$root/src-stage3/staged_install/$configuration/bin/gqrx.exe"
# ____________________________________________________________________________________________________________
#
# Armadillo
#
# Required by GNSS-SDR and gr-specest
#
SetLog "Armadillo $configuration"
$ErrorActionPreference = "Continue"
Write-Host -NoNewline "configuring $configuration Armadillo..."
New-Item -ItemType Directory -Force -Path $root/src-stage3/oot_code/armadillo-7.800.1/build/$configuration *>> $Log
cd $root/src-stage3/oot_code/armadillo-7.800.1/build/$configuration
$linkflags= " /DEFAULTLIB:$root/build/$configuration/lib/log4cpp.lib /DEFAULTLIB:$root/src-stage3/staged_install/$configuration/lib/gnuradio-pmt.lib /DEBUG /NODEFAULTLIB:m.lib "
$env:_CL_ = ""
$env:_LINK_ = ""
cmake ../../ `
-G "Visual Studio 14 2015 Win64" `
-DCMAKE_PREFIX_PATH="$root\build\$configuration" `
-DCMAKE_INSTALL_PREFIX="$root\build\$configuration" `
-DCMAKE_SYSTEM_LIBRARY_PATH="$root\build\$configuration\lib" `
-DCMAKE_C_FLAGS="/D_USE_MATH_DEFINES /D_TIMESPEC_DEFINED $arch $runtime /DWIN32 /D_WINDOWS /W3 /EHsc /I""$root/src-stage3/staged_install/$configuration"" /I""$root/src-stage3/staged_install/$configuration/include/swig"" " `
-DCMAKE_CXX_FLAGS="/D_USE_MATH_DEFINES /D_TIMESPEC_DEFINED $arch $runtime /DWIN32 /D_WINDOWS /W3 /EHsc /I""$root/src-stage3/staged_install/$configuration"" /I""$root/src-stage3/staged_install/$configuration/include/swig"" " `
-DCMAKE_SHARED_LINKER_FLAGS=" $linkflags " `
-DCMAKE_EXE_LINKER_FLAGS=" $linkflags " `
-DCMAKE_STATIC_LINKER_FLAGS=" $linkflags " `
-DCMAKE_MODULE_LINKER_FLAGS=" $linkflags " `
-DOpenBLAS_NAMES="libopenblas_static" `
-DMKL_ROOT="${MY_IFORT}mkl" `
-Wno-dev *>> $Log
Write-Host -NoNewline "building armadillo-7.800.1..."
msbuild .\armadillo.sln /m /p:"configuration=$buildconfig;platform=x64" *>> $Log
Write-Host -NoNewline "installing..."
msbuild .\INSTALL.vcxproj /m /p:"configuration=$buildconfig;platform=x64;BuildProjectReferences=false" *>> $Log
$env:_CL_ = ""
$env:_LINK_ = ""
$ErrorActionPreference = "Stop"
Validate "$root/build/$configuration/lib/armadillo.lib"
# ____________________________________________________________________________________________________________
#
# gr-specest
#
if ($hasIFORT) {
SetLog "gr-specest $configuration"
$ErrorActionPreference = "Continue"
Write-Host -NoNewline "configuring $configuration gr-specest..."
New-Item -ItemType Directory -Force -Path $root/src-stage3/oot_code/gr-specest/build/$configuration *>> $Log
cd $root/src-stage3/oot_code/gr-specest/build/$configuration
# the quotes that are likely to be in the below path make it impossible to added to the cmake config
$env:_LINK_ = " /LIBPATH:""${MY_IFORT}compiler/lib/intel64_win/"" "
$linkflags= " /DEBUG /NODEFAULTLIB:m.lib /NODEFAULTLIB:LIBCMT.lib /NODEFAULTLIB:LIBCMTD.lib /DEFAULTLIB:$root/build/$configuration/lib/log4cpp.lib /DEFAULTLIB:$root/src-stage3/staged_install/$configuration/lib/gnuradio-pmt.lib "
if ($configuration -match "AVX2") {$fortflags = " /QaxCORE-AVX2 /QxCORE-AVX2 /tune:haswell /arch:AVX2 "} else {$fortflags = " /arch:SSE2 "}
$froot = $root.Replace('\','/')
# set path to empty to ensure another GR install is not located
$env:Path=""
cmake ../../ `
-G "Visual Studio 14 2015 Win64" `
-DCMAKE_PREFIX_PATH="$root\build\$configuration" `
-DCMAKE_INSTALL_PREFIX="$root/src-stage3/staged_install/$configuration" `
-DCMAKE_SYSTEM_LIBRARY_PATH="$root\build\$configuration\lib" `
-DCMAKE_C_FLAGS="/D_USE_MATH_DEFINES /DNOMINMAX /D_TIMESPEC_DEFINED /DWIN32 /D_WINDOWS /W3 /EHsc /I""$root/src-stage3/staged_install/$configuration/include"" /I""$root/src-stage3/staged_install/$configuration/include/swig"" $arch $runtime " `
-DCMAKE_CXX_FLAGS="/D_USE_MATH_DEFINES /DNOMINMAX /D_TIMESPEC_DEFINED /DWIN32 /D_WINDOWS /W3 /EHsc /I""$root/src-stage3/staged_install/$configuration/include"" /I""$root/src-stage3/staged_install/$configuration/include/swig"" $arch $runtime " `
-DCMAKE_SHARED_LINKER_FLAGS=" $linkflags " `
-DCMAKE_EXE_LINKER_FLAGS=" $linkflags " `
-DCMAKE_STATIC_LINKER_FLAGS=" $linkflags " `
-DCMAKE_MODULE_LINKER_FLAGS=" $linkflags " `
-DPYTHON_LIBRARY="$root/src-stage3/staged_install/$configuration/gr-python27/libs/python27.lib" `
-DPYTHON_LIBRARY_DEBUG="$root/src-stage3/staged_install/$configuration/gr-python27/libs/python27_d.lib" `
-DPYTHON_EXECUTABLE="$root/src-stage3/staged_install/$configuration/gr-python27/$pythonexe" `
-DPYTHON_INCLUDE_DIR="$root/src-stage3/staged_install/$configuration/gr-python27/include" `
-DGNURADIO_RUNTIME_LIBRARIES="$root/src-stage3/staged_install/$configuration/lib/gnuradio-runtime.lib" `
-DGNURADIO_RUNTIME_INCLUDE_DIRS="$root/src-stage3/staged_install/$configuration/include" `
-DBLAS_LIBRARIES="$froot/build/$configuration/lib/libopenblas_static.lib;$froot/build/$configuration/lib/cblas.lib;$froot/build/$configuration/lib/lapack.lib" `
-DLAPACK_LIBRARIES="$froot/build/$configuration/lib/libopenblas_static.lib;$froot/build/$configuration/lib/lapack.lib" `
-DCMAKE_Fortran_FLAGS=" /assume:underscore /names:lowercase $fortflags " `
-DSWIG_EXECUTABLE="$root/bin/swig.exe" `
-Wno-dev *>> $Log
$env:Path = $oldPath
Write-Host -NoNewline "building gr-specest..."
# use devenv instead of msbuild because of vfproj files unsupported by msbuild
devenv .\gr-specest.sln /project ALL_BUILD /clean "$buildconfig|x64" *>> $Log
devenv .\gr-specest.sln /project pygen_swig_9b7e5 /build "$buildconfig|x64" *>> $Log
devenv .\gr-specest.sln /project ALL_BUILD /build "$buildconfig|x64" *>> $Log
# devenv .\gr-specest.sln /project ALL_BUILD /build "$buildconfig|x64" *>> $Log
Write-Host -NoNewline "installing..."
msbuild .\INSTALL.vcxproj /m /p:"configuration=$buildconfig;platform=x64;BuildProjectReferences=false" *>> $Log
$env:_CL_ = ""
$env:_LINK_ = ""
$ErrorActionPreference = "Stop"
Validate "$root/src-stage3/staged_install/$configuration/bin/gnuradio-specest.dll" "$root/src-stage3/staged_install/$configuration/lib/site-packages/specest/_specest_swig.pyd"
} else {
Write-Host "skipping $configuration gr-specest, no fortran compiler available"
}
# ____________________________________________________________________________________________________________
#
# gr-inspector
#
#
if ($mm -eq "3.8") {
Write-Host "gr-inspector not gr3.8 compatible"
} else {
SetLog "gr-inspector $configuration"
if ($configuration -match "Debug") {
Write-Host "skipping gr-inspector in debug" | Tee-Object -FilePath $Log
} else {
if ($mm -eq "3.8") {
Write-Host "skipping gr-inspector in v3.8 as requires Qt4" | Tee-Object -FilePath $Log
} else {
Write-Host -NoNewline "configuring $configuration gr-inspector..."
New-Item -Force -ItemType Directory $root/src-stage3/oot_code/gr-inspector/build/$configuration *>> $Log
cd $root/src-stage3/oot_code/gr-inspector/build/$configuration
$env:_CL_=""
$env:_LINK_= " /DEBUG:FULL "
$ErrorActionPreference = "Continue"
$env:Path=""
& cmake ../../ `
-G "Visual Studio 14 2015 Win64" `
-DCMAKE_PREFIX_PATH="$root\build\$configuration" `
-DCMAKE_INSTALL_PREFIX="$root/src-stage3/staged_install/$configuration" `
-DCMAKE_C_FLAGS=" $arch $runtime /D_USE_MATH_DEFINES /DNOMINMAX /D_TIMESPEC_DEFINED /EHsc /Zi " `
-DCMAKE_CXX_FLAGS=" $arch $runtime /D_USE_MATH_DEFINES /DNOMINMAX /D_TIMESPEC_DEFINED /EHsc /Zi " `
-DBOOST_LIBRARYDIR="$root/build/$configuration/lib" `
-DBOOST_INCLUDEDIR="$root/build/$configuration/include" `
-DBOOST_ROOT="$root/build/$configuration/" `
-DPYTHON_LIBRARY="$root/src-stage3/staged_install/$configuration/gr-python27/libs/python27.lib" `
-DPYTHON_LIBRARY_DEBUG="$root/src-stage3/staged_install/$configuration/gr-python27/libs/python27_d.lib" `
-DPYTHON_EXECUTABLE="$root/src-stage3/staged_install/$configuration/gr-python27/$pythonexe" `
-DPYTHON_INCLUDE_DIR="$root/src-stage3/staged_install/$configuration/gr-python27/include" `
-DQT_QWTPLOT3D_LIBRARY="$root\build\$configuration\lib\qwtplot3d.lib" `
-DQT_QWTPLOT3D_INCLUDE_DIR="$root\build\$configuration\include\qwt3d" `
-DQT_UIC_EXECUTABLE="$root/build/$configuration/bin/uic.exe" `
-DQT_MOC_EXECUTABLE="$root/build/$configuration/bin/moc.exe" `
-DQT_RCC_EXECUTABLE="$root/build/$configuration/bin/rcc.exe" `
-DQWT_INCLUDE_DIRS="$root\build\$configuration\include\qwt6" `
-DQWT_LIBRARIES="$root\build\$configuration\lib\qwt${debugext}6.lib" `
-DSWIG_EXECUTABLE="$root/bin/swig.exe" `
-DCMAKE_CXX_FLAGS="/D_USE_MATH_DEFINES /D_TIMESPEC_DEFINED /EHsc /Zi " `
-DCMAKE_C_FLAGS="/D_USE_MATH_DEFINES /D_TIMESPEC_DEFINED /Zi " `
-Wno-dev *>> $Log
$env:Path = $oldPath
Write-Host -NoNewline "building gr-inspector..."
msbuild .\gr-inspector.sln /m /p:"configuration=$buildconfig;platform=x64" *>> $Log
Write-Host -NoNewline "installing..."
msbuild .\INSTALL.vcxproj /m /p:"configuration=$buildconfig;platform=x64;BuildProjectReferences=false" *>> $Log
# copy the examples across
New-Item -Force -ItemType Directory $root/src-stage3/staged_install/$configuration/share/gnuradio/examples/gr-inspector *>> $Log
cp -Recurse -Force $root/src-stage3/oot_code/gr-inspector/examples/*.grc $root/src-stage3/staged_install/$configuration/share/gnuradio/examples/gr-inspector *>> $Log
$env:_CL_ = ""
$env:_LINK_ = ""
Validate "$root/src-stage3/staged_install/$configuration/bin/gnuradio-inspector.dll" "$root\src-stage3\staged_install\$configuration\lib\site-packages\inspector\_inspector_swig.pyd"
}
}
}
# ____________________________________________________________________________________________________________
#
# gr-cdma
#
# TODO: need to manually change the cdma_parameters.py to alter the fixed path it is looking for
#
if ($mm -eq "3.8") {
Write-Host "gr-cdma not gr3.8 compatible"
} else {
SetLog "gr-cdma $configuration"
Write-Host -NoNewline "configuring $configuration gr-cdma..."
New-Item -Force -ItemType Directory $root/src-stage3/oot_code/gr-cdma/build/$configuration *>> $Log
cd $root/src-stage3/oot_code/gr-cdma/build/$configuration
$env:_CL_=" $arch /DNOMINMAX /D_USE_MATH_DEFINES /D_TIMESPEC_DEFINED /EHsc /Zi "
$env:_LINK_= " /DEBUG:FULL /DEFAULTLIB:$root/src-stage3/staged_install/$configuration/lib/gnuradio-pmt.lib "
if ($mm -eq '3.8') {$env:_LINK_= $env:_LINK_ + " $root/build/$configuration/lib/log4cpp.lib "}
(Get-Content "../../python/cdma_parameters.py").replace('/home/anastas/gr-cdma/', '../lib/site-packages/cdma') | Set-Content "../../python/cdma_parameters.py"
$ErrorActionPreference = "Continue"
$env:Path=""
& cmake ../../ `
-G "Visual Studio 14 2015 Win64" `
-DCMAKE_PREFIX_PATH="$root\build\$configuration" `
-DCMAKE_INSTALL_PREFIX="$root/src-stage3/staged_install/$configuration" `
-DGNURADIO_RUNTIME_LIBRARIES="$root/src-stage3/staged_install/$configuration/lib/gnuradio-runtime.lib" `
-DGNURADIO_RUNTIME_INCLUDE_DIRS="$root/src-stage3/staged_install/$configuration/include" `
-DBOOST_LIBRARYDIR="$root/build/$configuration/lib" `
-DBOOST_INCLUDEDIR="$root/build/$configuration/include" `
-DBOOST_ROOT="$root/build/$configuration/" `
-DPYTHON_LIBRARY="$root/src-stage3/staged_install/$configuration/gr-python27/libs/python27.lib" `
-DPYTHON_LIBRARY_DEBUG="$root/src-stage3/staged_install/$configuration/gr-python27/libs/python27_d.lib" `
-DPYTHON_EXECUTABLE="$root/src-stage3/staged_install/$configuration/gr-python27/$pythonexe" `
-DPYTHON_INCLUDE_DIR="$root/src-stage3/staged_install/$configuration/gr-python27/include" `
-DSWIG_EXECUTABLE="$root/bin/swig.exe" `
-DCMAKE_CXX_FLAGS="/D_USE_MATH_DEFINES /D_TIMESPEC_DEFINED /EHsc /DNOMINMAX /Zi $arch $runtime " `
-DCMAKE_C_FLAGS="/D_USE_MATH_DEFINES /D_TIMESPEC_DEFINED /DNOMINMAX /Zi $arch $runtime " `
-Wno-dev *>> $Log
$env:Path = $oldPath
Write-Host -NoNewline "building gr-cdma..."
msbuild .\gr-cdma.sln /m /p:"configuration=$buildconfig;platform=x64" *>> $Log
Write-Host -NoNewline "installing..."
msbuild .\INSTALL.vcxproj /m /p:"configuration=$buildconfig;platform=x64;BuildProjectReferences=false" *>> $Log
# copy the examples across
New-Item -Force -ItemType Directory $root/src-stage3/staged_install/$configuration/share/gnuradio/examples/gr-cdma *>> $Log
cp -Recurse -Force $root/src-stage3/oot_code/gr-cdma/apps/*.grc $root/src-stage3/staged_install/$configuration/share/gnuradio/examples/gr-cdma *>> $Log
# copy the fsm files across
New-Item -Force -ItemType Directory $root/src-stage3/staged_install/$configuration/lib/site-packages/cdma/python/fsm_files *>> $Log
cp -Recurse -Force $root/src-stage3/oot_code/gr-cdma/python/fsm_files/*.fsm $root/src-stage3/staged_install/$configuration/lib/site-packages/cdma/python/fsm_files *>> $Log
$env:_CL_ = ""
$env:_LINK_ = ""
Validate "$root/src-stage3/staged_install/$configuration/bin/gnuradio-cdma.dll" "$root\src-stage3\staged_install\$configuration\lib\site-packages\cdma\_cdma_swig.pyd"
}
# ____________________________________________________________________________________________________________
#