/
Step4-BuildPythonPackages.ps1
1355 lines (1290 loc) · 78.3 KB
/
Step4-BuildPythonPackages.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
#
# GNURadio Windows Build System
# Step4_BuildPythonPackages.ps1
#
# Geof Nieboer
#
# NOTES:
# Each module is designed to be run independently, so sometimes variables
# are set redundantly. This is to enable easier debugging if one package needs to be re-run
#
# This module builds the various python packages above the essentials included
# in the build originally. We are building three versions, one for AVX2 only
# and one for release and one for debug
# 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
}
$pythonexe = "python.exe"
$pythondebugexe = "python_d.exe"
$env:PYTHONPATH=""
#__________________________________________________________________________________________
# sip
#
# TODO static builds are not working, not vital as not truly needed to continue.
#
$ErrorActionPreference = "Continue"
SetLog "sip"
Write-Host "building sip..."
cd $root\src-stage1-dependencies\sip-$sip_version
# reset these in case previous run was stopped in mid-build
$env:_LINK_ = ""
$env:_CL_ = ""
Function MakeSip
{
$type = $args[0]
Write-Host -NoNewline " $type..."
$dflag = if ($type -match "Debug") {"--debug"} else {""}
$kflag = if ($type -match "Dll") {""} else {" --static"}
$debugext = if ($type -match "Debug") {"_d"} else {""}
if ((TryValidate "$pythonroot/sip.exe" "$pythonroot/include/sip.h" "$pythonroot/lib/site-packages/sip$debugext.pyd") -eq $false) {
if ($type -match "AVX2") {$env:_CL_ = "/Ox /arch:AVX2 "} else {$env:_CL_ = ""}
if (Test-Path sipconfig.py) {del sipconfig.py}
"FLAGS: $kflag $dflag" >> $Log
"command line : configure.py $dflag $kflag -p win32-msvc2015" >> $Log
Write-Host -NoNewline "configuring..."
& $pythonroot\python$debugext.exe configure.py $dflag $kflag --platform win32-msvc2015 *>> $Log
Write-Host -NoNewline "building..."
nmake clean *>> $Log
nmake *>> $Log
New-Item -ItemType Directory -Force -Path ./build/x64/$type *>> $Log
cd siplib
if ($type -match "Dll") {
copy sip$debugext.pyd ../build/x64/$type/sip$debugext.pyd
copy sip$debugext.exp ../build/x64/$type/sip$debugext.exp
if ($type -match "Debug") {
copy sip$debugext.pdb ../build/x64/$type/sip$debugext.pdb
copy sip$debugext.ilk ../build/x64/$type/sip$debugext.ilk
}
}
copy sip$debugext.lib ../build/x64/$type/sip$debugext.lib
copy sip.h ../build/x64/$type/sip.h
cd ../sipgen
copy sip.exe ../build/x64/$type/sip.exe
cd ..
copy sipdistutils.py ./build/x64/$type/sipdistutils.py
if ($type -match "Dll") {
Write-Host -NoNewline "installing..."
copy sipconfig.py ./build/x64/$type/sipconfig.py
nmake install *>> $Log
Validate "$pythonroot/sip.exe" "$pythonroot/include/sip.h" "$pythonroot/lib/site-packages/sip$debugext.pyd"
}
nmake clean *>> $Log
$env:_CL_ = ""
} else {
Write-Host "already built"
}
}
$pythonroot = "$root\src-stage2-python\gr-python27-debug"
#MakeSip "Debug"
MakeSip "DebugDLL"
$pythonroot = "$root\src-stage2-python\gr-python27"
#MakeSip "Release"
MakeSip "ReleaseDLL"
$pythonroot = "$root\src-stage2-python\gr-python27-avx2"
#MakeSip "Release-AVX2"
MakeSip "ReleaseDLL-AVX2"
$ErrorActionPreference = "Stop"
#_________________________________________________________________________________________
# Enum34
#
# Required by newest SIP 4.19.x
#
# TODO add validation
#
$ErrorActionPreference = "Continue"
SetLog "Enum34"
Write-Host -NoNewline "Installing Enum34"
function InstallEnum34
{
$type = $args[0]
Write-Host -NoNewline "...$type"
& $pythonroot/Scripts/pip.exe --disable-pip-version-check install enum34 -U -t $pythonroot\lib\site-packages *>> $log
Write-Host -NoNewline "...done"
}
$pythonroot = "$root\src-stage2-python\gr-python27-debug"
InstallEnum34 "Debug"
$pythonroot = "$root\src-stage2-python\gr-python27"
InstallEnum34 "Release"
$pythonroot = "$root\src-stage2-python\gr-python27-avx2"
InstallEnum34 "Release-AVX2"
$ErrorActionPreference = "Stop"
"...complete"
#__________________________________________________________________________________________
# PyQt
#
# building libraries separate from the actual install into Python
#
if ($mm -eq "3.7") {
$ErrorActionPreference = "Continue"
SetLog "PyQt"
cd $root\src-stage1-dependencies\PyQt4
$env:QMAKESPEC = "win32-msvc2015"
Write-Host -NoNewline "building PyQT..."
function MakePyQt
{
$type = $args[0]
Write-Host -NoNewline "$type"
$debugext = if ($type -match "Debug") {"_d"} else {""}
if ((TryValidate "$root/src-stage1-dependencies/PyQt4/build/x64/$type/package/PyQt4/Qt$debugext.pyd" "$root/src-stage1-dependencies/PyQt4/build/x64/$type/package/PyQt4/QtCore$debugext.pyd" "$root/src-stage1-dependencies/PyQt4/build/x64/$type/package/PyQt4/QtGui$debugext.pyd" "$root/src-stage1-dependencies/PyQt4/build/x64/$type/package/PyQt4/QtOpenGL$debugext.pyd" "$root/src-stage1-dependencies/PyQt4/build/x64/$type/package/PyQt4/QtSvg$debugext.pyd") -eq $false) {
if ($type -match "Debug") {$thispython = $pythondebugexe} else {$thispython = $pythonexe}
$flags = if ($type -match "Debug") {"-u"} else {""}
$flags += if ($type -match "Dll") {""} else {" -k"}
if ($type -match "AVX2") {$env:_CL_ = "/Ox /arch:AVX2 /wd4577 /MP " } else {$env:_CL_ = "/wd4577 /MP "}
$env:_LINK_= ""
$env:Path = "$root\src-stage1-dependencies\Qt4\build\$type\bin;" + $oldpath
& $pythonroot\$thispython configure.py $flags --destdir "build\x64\$type" --confirm-license --verbose --no-designer-plugin --enable QtOpenGL --enable QtGui --enable QtSvg -b build/x64/$type/bin -d build/x64/$type/package -p build/x64/$type/plugins --sipdir build/x64/$type/sip *>> $log
# BUG FIX
"all: ;" > .\pylupdate\Makefile
"install : ;" >> .\pylupdate\Makefile
"clean : ;" >> .\pylupdate\Makefile
nmake *>> $log
nmake install *>> $log
nmake clean *>> $log
$env:_CL_ = ""
$env:_LINK_ = ""
Write-Host -NoNewline "-done..."
} else {
Write-Host -NoNewline "...already built..."
}
}
$pythonroot = "$root\src-stage2-python\gr-python27-debug"
MakePyQt "DebugDLL"
#MakePyQt "Debug"
$pythonroot = "$root\src-stage2-python\gr-python27"
MakePyQt "ReleaseDLL"
#MakePyQt "Release"
$pythonroot = "$root\src-stage2-python\gr-python27-avx2"
MakePyQt "ReleaseDLL-AVX2"
#MakePyQt "Release-AVX2"
$ErrorActionPreference = "Stop"
"complete"
}
$mm = GetMajorMinor($gnuradio_version)
if ($mm -eq "3.8") {
#__________________________________________________________________________________________
# PyQt5
#
# building libraries separate from the actual install into Python
#
# TODO debug not working, needs validation as well, not just tryValidate
#
$ErrorActionPreference = "Continue"
SetLog "PyQt5"
cd $root\src-stage1-dependencies\PyQt5
$env:QMAKESPEC = "win32-msvc"
Write-Host -NoNewline "building PyQT5..."
function MakePyQt5
{
$type = $args[0]
Write-Host -NoNewline "$type"
if ($type -match "Debug") {$thispython = $pythondebugexe} else {$thispython = $pythonexe}
$debugext = if ($type -match "Debug") {"_d"} else {""}
if ((TryValidate "$root/src-stage1-dependencies/PyQt5/build/x64/$type/package/PyQt5/Qt$debugext.pyd" "$root/src-stage1-dependencies/PyQt5/build/x64/$type/package/PyQt5/QtGui$debugext.pyd" "$root/src-stage1-dependencies/PyQt5/build/x64/$type/package/PyQt5/QtOpenGL$debugext.pyd" "$root/src-stage1-dependencies/PyQt5/build/x64/$type/package/PyQt5/QtWidgets$debugext.pyd" "$root/src-stage1-dependencies/PyQt5/build/x64/$type/package/PyQt5/QtSvg$debugext.pyd" "$root/src-stage1-dependencies/PyQt5/build/x64/$type/package/PyQt5/QtCore$debugext.pyd") -eq $false) {
$flags = if ($type -match "Debug") {"--debug"} else {""}
$flags += if ($type -match "Dll") {""} else {" -k"}
if ($type -match "AVX2") {$env:_CL_ = "/Ox /arch:AVX2 /wd4577 /MP "} else {$env:_CL_ = "/wd4577 /MP " }
$env:_LINK_= ""
$env:Path = "$root\src-stage1-dependencies\Qt5Stage\build\$type\bin;" + $oldpath
$env:QTDIR = "$root\src-stage1-dependencies\Qt5Stage\build\$type"
# this version of PyQt5 + Sip requires enum34 to be installed as well
# since it's just for the build we'll install via pip
& $pythonroot\$thispython configure.py $flags --qmake "$root/src-stage1-dependencies/Qt5Stage/build/$type/bin/qmake.exe" --destdir "build\x64\$type" --confirm-license --verbose --no-designer-plugin --enable QtCore --enable QtOpenGL --enable QtGui --enable QtWidgets --enable QtSvg --spec win32-msvc -b build/x64/$type/bin -d build/x64/$type/package --sipdir build/x64/$type/sip --sip $pythonroot/sip.exe *>> $log
# BUG FIX
"all: ;" > .\pylupdate\Makefile
"install : ;" >> .\pylupdate\Makefile
"clean : ;" >> .\pylupdate\Makefile
nmake *>> $log
nmake install *>> $log
nmake clean *>> $log
$env:_CL_ = ""
$env:_LINK_ = ""
Write-Host -NoNewline "-done..."
} else {
Write-Host -NoNewline "...already built..."
}
}
$pythonroot = "$root\src-stage2-python\gr-python27"
#MakePyQt5 "Release"
MakePyQt5 "ReleaseDLL"
$pythonroot = "$root\src-stage2-python\gr-python27-avx2"
#MakePyQt5 "Release-AVX2"
MakePyQt5 "ReleaseDLL-AVX2"
$pythonroot = "$root\src-stage2-python\gr-python27-debug"
MakePyQt5 "DebugDLL"
#MakePyQt5 "Debug"
$env:Path = $oldpath
$env:QMAKESPEC = ""
$env:QTDIR = ""
$ErrorActionPreference = "Stop"
"complete"
}
#__________________________________________________________________________________________
# setup python
Function SetupPython
{
$configuration = $args[0]
""
"installing python packages for $configuration"
if ($configuration -match "Debug") {
$d = "d"
$debugext = "_d"
$debug = "--debug"
$pythonexe = "python_d.exe"
} else {
$d = ""
$debugext = ""
$debug = ""
$pythonexe = "python.exe"
}
if ($mm -eq "3.7") {
#__________________________________________________________________________________________
# PyQt4
#
SetLog "$configuration PyQt4"
if ((TryValidate "$pythonroot/lib/site-packages/PyQt4/Qt$debugext.pyd" "$pythonroot/lib/site-packages/PyQt4/QtCore$debugext.pyd" "$pythonroot/lib/site-packages/PyQt4/QtGui$debugext.pyd" "$pythonroot/lib/site-packages/PyQt4/QtOpenGL$debugext.pyd" "$pythonroot/lib/site-packages/PyQt4/QtSvg$debugext.pyd") -eq $false) {
Write-Host -NoNewline "configuring PyQt4..."
$ErrorActionPreference = "Continue"
cd $root\src-stage1-dependencies\PyQt4
$flags = if ($configuration -match "Debug") {"-u"} else {""}
if ($type -match "AVX2") {$env:_CL_ = "/Ox /arch:AVX2 /wd4577 /MP "} else {$env:_CL_ = "/wd4577 /MP " }
$env:Path = "$root\src-stage1-dependencies\Qt4\build\$configuration\bin;" + $oldpath
$env:QMAKESPEC = "win32-msvc2015"
$env:_LINK_= ""
& $pythonroot\$pythonexe configure.py $flags --confirm-license --verbose --no-designer-plugin --enable QtOpenGL --enable QtGui --enable QtSvg *>> $log
# BUG FIX
"all: ;" > .\pylupdate\Makefile
"install : ;" >> .\pylupdate\Makefile
"clean : ;" >> .\pylupdate\Makefile
Write-Host -NoNewline "building..."
Exec {nmake} *>> $log
Write-Host -NoNewline "installing..."
Exec {nmake install} *>> $log
$env:Path = $oldpath
$env:_CL_ = ""
$env:_LINK_ = ""
$ErrorActionPreference = "Stop"
Validate "$pythonroot/lib/site-packages/PyQt4/Qt$debugext.pyd" "$pythonroot/lib/site-packages/PyQt4/QtCore$debugext.pyd" "$pythonroot/lib/site-packages/PyQt4/QtGui$debugext.pyd" "$pythonroot/lib/site-packages/PyQt4/QtOpenGL$debugext.pyd" "$pythonroot/lib/site-packages/PyQt4/QtSvg$debugext.pyd"
} else {
Write-Host "PyQt4 already built..."
}
}
if ($mm -eq "3.8") {
#__________________________________________________________________________________________
# PyQt5
#
SetLog "$configuration PyQt5"
if ((TryValidate "$pythonroot/lib/site-packages/PyQt5/Qt$debugext.pyd" "$pythonroot/lib/site-packages/PyQt5/QtGui$debugext.pyd" "$pythonroot/lib/site-packages/PyQt5/QtCore$debugext.pyd" "$pythonroot/lib/site-packages/PyQt5/QtOpenGL$debugext.pyd" "$pythonroot/lib/site-packages/PyQt5/QtSvg$debugext.pyd" "$pythonroot/lib/site-packages/PyQt5/QtWidgets$debugext.pyd") -eq $false) {
Write-Host -NoNewline "configuring PyQt5..."
$ErrorActionPreference = "Continue"
cd $root\src-stage1-dependencies\PyQt5
$flags = if ($configuration -match "Debug") {"--debug"} else {""}
if ($type -match "AVX2") {$env:_CL_ = "/Ox /arch:AVX2 /wd4577 /MP "} else {$env:_CL_ = "/wd4577 /MP " }
$env:Path = "$root\src-stage1-dependencies\Qt5Stage\build\$configuration\bin;" + $oldpath
$env:QMAKESPEC = "win32-msvc"
$env:QTDIR = "$root\src-stage1-dependencies\Qt5Stage\build\$type"
$env:_LINK_= ""
& $pythonroot\$pythonexe configure.py $flags --qmake "$root/src-stage1-dependencies/Qt5Stage/build/$configuration/bin/qmake.exe" --confirm-license --verbose --no-designer-plugin --disable QtNfc --enable QtCore --enable QtGui --enable QtOpenGL --enable QtSvg --enable QtWidgets --spec win32-msvc --sip $pythonroot/sip.exe *>> $log
Write-Host -NoNewline "building..."
Exec {nmake} *>> $log
Write-Host -NoNewline "installing..."
Exec {nmake install} *>> $log
$env:Path = $oldpath
$env:QTDIR = ""
$env:_CL_ = ""
$env:_LINK_ = ""
$ErrorActionPreference = "Stop"
Validate "$pythonroot/lib/site-packages/PyQt5/Qt$debugext.pyd" "$pythonroot/lib/site-packages/PyQt5/QtGui$debugext.pyd" "$pythonroot/lib/site-packages/PyQt5/QtCore$debugext.pyd" "$pythonroot/lib/site-packages/PyQt5/QtOpenGL$debugext.pyd" "$pythonroot/lib/site-packages/PyQt5/QtSvg$debugext.pyd" "$pythonroot/lib/site-packages/PyQt5/QtWidgets$debugext.pyd"
$env:Path = $oldpath
$env:QMAKESPEC = ""
$env:QTDIR = ""
} else {
Write-Host "PyQt5 already built..."
}
}
#__________________________________________________________________________________________
# Cython
#
# TODO This is not working properly on the debug build... essentially it is linking against
# python27 instead of python27_d
SetLog "$configuration Cython"
$ErrorActionPreference = "Continue"
cd $root\src-stage1-dependencies\Cython-$cython_version
if ((TryValidate "dist/Cython-$cython_version-cp27-cp27${d}m-win_amd64.$configuration.whl" "$pythonroot/lib/site-packages/Cython-$cython_version-py2.7-win-amd64.egg/cython.py" "$pythonroot/lib/site-packages/Cython-$cython_version-py2.7-win-amd64.egg/Cython/Compiler/Code$debugext.pyd" "$pythonroot/lib/site-packages/Cython-$cython_version-py2.7-win-amd64.egg/Cython/Distutils/build_ext.py") -eq $false) {
Write-Host -NoNewline "installing Cython..."
if ($configuration -match "Debug") { $env:_LINK_ = " /LIB:python27_d.lib " } else { $env:_LINK_="" }
& $pythonroot/$pythonexe setup.py build $debug install *>> $log
Write-Host -NoNewline "creating wheel..."
& $pythonroot/$pythonexe setup.py bdist_wheel *>> $log
$env:_LINK_ = ""
move dist/Cython-$cython_version-cp27-cp27${d}m-win_amd64.whl dist/Cython-$cython_version-cp27-cp27${d}m-win_amd64.$configuration.whl -Force
$ErrorActionPreference = "Stop"
Validate "dist/Cython-$cython_version-cp27-cp27${d}m-win_amd64.$configuration.whl" "$pythonroot/lib/site-packages/Cython-$cython_version-py2.7-win-amd64.egg/cython.py" "$pythonroot/lib/site-packages/Cython-$cython_version-py2.7-win-amd64.egg/Cython/Compiler/Code$debugext.pyd" "$pythonroot/lib/site-packages/Cython-$cython_version-py2.7-win-amd64.egg/Cython/Distutils/build_ext.py"
} else {
Write-Host "Cython already built..."
}
#__________________________________________________________________________________________
# PyTest
# used for testing numpy/scipy etc only (after numpy 1.15), not in gnuradio directly
#
SetLog "$configuration pytest"
if ((TryValidate "$pythonroot/lib/site-packages/pytest.py") -eq $false) {
Write-Host -NoNewline "installing Nose using pip..."
$ErrorActionPreference = "Continue" # pip will "error" on debug
& $pythonroot/Scripts/pip.exe --disable-pip-version-check install pytest -U -t $pythonroot\lib\site-packages *>> $log
$ErrorActionPreference = "Stop"
Validate "$pythonroot/lib/site-packages/pytest.py"
} else {
Write-Host "pytest already installed..."
}
#__________________________________________________________________________________________
# numpy
# mkl_libs site.cfg lines generated with the assistance of:
# https://software.intel.com/en-us/articles/intel-mkl-link-line-advisor
#
# TODO numpy Debug OpenBLAS crashes during numpy.test('full')
#
SetLog "$configuration numpy"
cd $root\src-stage1-dependencies\numpy-$numpy_version
if ((TryValidate "$pythonroot/lib/site-packages/numpy-$numpy_version-py2.7-win-amd64.egg/numpy/core/_multiarray_umath.pyd" "dist/numpy-$numpy_version-cp27-cp27${d}m-win_amd64.$configuration.whl") -eq $false) {
Write-Host -NoNewline "configuring numpy..."
$ErrorActionPreference = "Continue"
# $static indicates if the MKL/OpenBLAS libraries will be linked statically into numpy/scipy or not. numpy/scipy themselves will be built as DLLs/pyd's always
# openblas lapack is always static
$static = $true
$staticconfig = ($configuration -replace "DLL", "")
if ($static -eq $true) {$staticlib = "_static"} else {$staticlib = ""}
if ($BuildNumpyWithMKL) {
# Build with MKL
Write-Host -NoNewline "MKL..."
if ($static -eq $false) {
"[mkl]" | Out-File -filepath site.cfg -Encoding ascii
"search_static_first=false" | Out-File -filepath site.cfg -Encoding ascii -Append
"include_dirs = ${env:ProgramFiles(x86)}\IntelSWTools\compilers_and_libraries\windows\mkl\include" | Out-File -filepath site.cfg -Encoding ascii -Append
"library_dirs = ${env:ProgramFiles(x86)}\IntelSWTools\compilers_and_libraries\windows\mkl\lib\intel64_win" | Out-File -filepath site.cfg -Encoding ascii -Append
"mkl_libs = mkl_rt" | Out-File -filepath site.cfg -Encoding ascii -Append
"lapack_libs = " | Out-File -filepath site.cfg -Encoding ascii -Append
if ($configuration -match "AVX2") {
"extra_compile_args=/MD /Zi /Oy /Ox /Oi /arch:AVX2" | Out-File -filepath site.cfg -Encoding ascii -Append
} elseif ($configuration -match "Debug") {
"extra_compile_args=/MDd /Zi" | Out-File -filepath site.cfg -Encoding ascii -Append
} else {
"extra_compile_args=/MD /Zi /Oy /Ox /Oi" | Out-File -filepath site.cfg -Encoding ascii -Append
}
} else {
"[mkl]" | Out-File -filepath site.cfg -Encoding ascii
"search_static_first=true" | Out-File -filepath site.cfg -Encoding ascii -Append
"include_dirs = ${env:ProgramFiles(x86)}\IntelSWTools\compilers_and_libraries\windows\mkl\include" | Out-File -filepath site.cfg -Encoding ascii -Append
"library_dirs = ${env:ProgramFiles(x86)}\IntelSWTools\compilers_and_libraries\windows\mkl\lib\intel64_win" | Out-File -filepath site.cfg -Encoding ascii -Append
"mkl_libs = mkl_intel_lp64, mkl_core, mkl_intel_thread, libiomp5md" | Out-File -filepath site.cfg -Encoding ascii -Append
"lapack_libs = " | Out-File -filepath site.cfg -Encoding ascii -Append
if ($configuration -match "AVX2") {
"extra_compile_args=/MD /Zi /Oy /Ox /Oi /arch:AVX2" | Out-File -filepath site.cfg -Encoding ascii -Append
} elseif ($configuration -match "Debug") {
"extra_compile_args=/MDd /Zi" | Out-File -filepath site.cfg -Encoding ascii -Append
} else {
"extra_compile_args=/MD /Zi /Oy /Ox /Oi" | Out-File -filepath site.cfg -Encoding ascii -Append
}
}
} else {
# Build with OpenBLAS
Write-Host -NoNewline "OpenBLAS..."
"[default]" | Out-File -filepath site.cfg -Encoding ascii
"libraries = libopenblas$staticlib, lapack" | Out-File -filepath site.cfg -Encoding ascii -Append
"library_dirs = $root/src-stage1-dependencies/openblas/build/$staticconfig/lib;$root/src-stage1-dependencies/lapack/dist/$staticconfig/lib" | Out-File -filepath site.cfg -Encoding ascii -Append
"include_dirs = $root/src-stage1-dependencies\OpenBLAS\lapack-netlib\CBLAS\include" | Out-File -filepath site.cfg -Encoding ascii -Append
"lapack_libs = libopenblas$staticlib, lapack" | Out-File -filepath site.cfg -Encoding ascii -Append
if ($configuration -match "AVX2") {
"extra_compile_args=/MD /Zi /Oy /Ox /Oi /arch:AVX2" | Out-File -filepath site.cfg -Encoding ascii -Append
} elseif ($configuration -match "Debug") {
"extra_compile_args=/MDd /Zi" | Out-File -filepath site.cfg -Encoding ascii -Append
} else {
"extra_compile_args=/MD /Zi /Oy /Ox /Oi" | Out-File -filepath site.cfg -Encoding ascii -Append
}
"[openblas]" | Out-File -filepath site.cfg -Encoding ascii -Append
"libraries = libopenblas$staticlib,lapack" | Out-File -filepath site.cfg -Encoding ascii -Append
"library_dirs = $root/src-stage1-dependencies/openblas/build/$staticconfig/lib;$root/src-stage1-dependencies/lapack/dist/$staticconfig/lib" | Out-File -filepath site.cfg -Encoding ascii -Append
"include_dirs = $root/src-stage1-dependencies\OpenBLAS\lapack-netlib\CBLAS\include/" | Out-File -filepath site.cfg -Encoding ascii -Append
"lapack_libs = lapack" | Out-File -filepath site.cfg -Encoding ascii -Append
if ($static -eq $false) {"runtime_library_dirs = $root/src-stage1-dependencies/openblas/build/lib/$staticconfig" | Out-File -filepath site.cfg -Encoding ascii -Append }
"[lapack]" | Out-File -filepath site.cfg -Encoding ascii -Append
"lapack_libs = libopenblas$staticlib, lapack" | Out-File -filepath site.cfg -Encoding ascii -Append
"library_dirs = $root/src-stage1-dependencies/lapack/dist/$staticconfig/lib/" | Out-File -filepath site.cfg -Encoding ascii -Append
"[blas]" | Out-File -filepath site.cfg -Encoding ascii -Append
"libraries = libopenblas$staticlib, lapack" | Out-File -filepath site.cfg -Encoding ascii -Append
"library_dirs = $root/src-stage1-dependencies/openblas/build/$staticconfig/lib;$root/src-stage1-dependencies/lapack/dist/$staticconfig/lib" | Out-File -filepath site.cfg -Encoding ascii -Append
"include_dirs = $root/src-stage1-dependencies/OpenBLAS/lapack-netlib/CBLAS/include" | Out-File -filepath site.cfg -Encoding ascii -Append
}
$env:VS90COMNTOOLS = $env:VS140COMNTOOLS
# clean doesn't really get it all...
del build/*.* -Recurse *>> $log
& $pythonroot/$pythonexe setup.py clean *>> $log
& $pythonroot/$pythonexe setup.py config --compiler=msvc2015 --fcompiler=intelvem *>> $log
Write-Host -NoNewline "building..."
$env:_LINK_=" /NODEFAULTLIB:""LIBCMT.lib"" /NODEFAULTLIB:""LIBMMT.lib"" "
& $pythonroot/$pythonexe setup.py build $debug *>> $log
Write-Host -NoNewline "installing..."
& $pythonroot/$pythonexe setup.py install *>> $log
# TODO This is a hack to move the openblas library into the right place. We should either link statically or figure a better so install moves this for us
if (!($BuildNumpyWithMKL) -and ($static = $false)) { cp $root/src-stage1-dependencies/openblas/build/lib/$staticconfig/libopenblas.dll $pythonroot\lib\site-packages\numpy-$numpy_version-py2.7-win-amd64.egg\numpy\core }
Write-Host -NoNewline "creating wheel..."
& $pythonroot/$pythonexe setup.py bdist_wheel *>> $log
move dist/numpy-$numpy_version-cp27-cp27${d}m-win_amd64.whl dist/numpy-$numpy_version-cp27-cp27${d}m-win_amd64.$configuration.whl -Force
$ErrorActionPreference = "Stop"
$env:_LINK_= ""
Validate "$pythonroot/lib/site-packages/numpy-$numpy_version-py2.7-win-amd64.egg/numpy/core/_multiarray_umath.pyd" "dist/numpy-$numpy_version-cp27-cp27${d}m-win_amd64.$configuration.whl"
} else {
Write-Host "numpy already built..."
}
#__________________________________________________________________________________________
# scipy
#
SetLog "$configuration scipy"
cd $root\src-stage1-dependencies\scipy
if ($hasIFORT) {
if ((TryValidate "dist/scipy-$scipy_version-cp27-cp27${d}m-win_amd64.$configuration.whl" "$pythonroot/lib/site-packages/scipy-$scipy_version-py2.7-win-amd64.egg/scipy/linalg/_flapack.pyd" "$pythonroot/lib/site-packages/scipy-$scipy_version-py2.7-win-amd64.egg/scipy/linalg/cython_lapack.pyd" "$pythonroot/lib/site-packages/scipy-$scipy_version-py2.7-win-amd64.egg/scipy/sparse/_sparsetools.pyd") -eq $false) {
Write-Host -NoNewline "configuring scipy..."
$ErrorActionPreference = "Continue"
$env:Path = "${MY_IFORT}bin\intel64;" + $oldPath
$env:LIB = "${MY_IFORT}compiler\lib\intel64_win;" + $oldLib
# $static indicates if the MKL/OpenBLAS libraries will be linked statically into numpy/scipy or not. numpy/scipy themselves will be built as DLLs/pyd's always
# openblas lapack is always static$static = $true
$staticconfig = ($configuration -replace "DLL", "")
if ($static -eq $true) {$staticlib = "_static"} else {$staticlib = ""}
if ($BuildNumpyWithMKL) {
# Build with MKL
Write-Host -NoNewline "MKL..."
if ($static -eq $false) {
"[mkl]" | Out-File -filepath site.cfg -Encoding ascii
"search_static_first=false" | Out-File -filepath site.cfg -Encoding ascii -Append
"include_dirs = ${MY_IFORT}mkl\include" | Out-File -filepath site.cfg -Encoding ascii -Append
"library_dirs = ${MY_IFORT}compiler\lib\intel64_win;${MY_IFORT}mkl\lib\intel64_win" | Out-File -filepath site.cfg -Encoding ascii -Append
"mkl_libs = mkl_rt" | Out-File -filepath site.cfg -Encoding ascii -Append
"lapack_libs = mkl_rt, mkl_lapack95_lp64,mkl_blas95_lp64" | Out-File -filepath site.cfg -Encoding ascii -Append
if ($configuration -match "AVX2") {
"extra_compile_args=/MD /Zi /Oy /Ox /Oi /arch:AVX2" | Out-File -filepath site.cfg -Encoding ascii -Append
} elseif ($configuration -match "Debug") {
"extra_compile_args=/MD /Zi" | Out-File -filepath site.cfg -Encoding ascii -Append
} else {
"extra_compile_args=/MD /Zi /Oy /Ox /Oi" | Out-File -filepath site.cfg -Encoding ascii -Append
}
} else {
"[mkl]" | Out-File -filepath site.cfg -Encoding ascii
"search_static_first=true" | Out-File -filepath site.cfg -Encoding ascii -Append
"include_dirs = ${MY_IFORT}mkl\include" | Out-File -filepath site.cfg -Encoding ascii -Append
"library_dirs = ${MY_IFORT}compiler\lib\intel64_win;${MY_IFORT}mkl\lib\intel64_win" | Out-File -filepath site.cfg -Encoding ascii -Append
"mkl_libs = mkl_lapack95_lp64,mkl_blas95_lp64,mkl_intel_lp64,mkl_sequential,mkl_core" | Out-File -filepath site.cfg -Encoding ascii -Append
"lapack_libs = mkl_lapack95_lp64,mkl_blas95_lp64,mkl_intel_lp64,mkl_sequential,mkl_core" | Out-File -filepath site.cfg -Encoding ascii -Append
if ($configuration -match "AVX2") {
"extra_compile_args=/MD /Zi /Oy /Ox /Oi /arch:AVX2" | Out-File -filepath site.cfg -Encoding ascii -Append
} elseif ($configuration -match "Debug") {
"extra_compile_args=/MDd /Zi" | Out-File -filepath site.cfg -Encoding ascii -Append
} else {
"extra_compile_args=/MD /Zi /Oy /Ox /Oi" | Out-File -filepath site.cfg -Encoding ascii -Append
}
}
} else {
# Build scipy with OpenBLAS
Write-Host -NoNewline "OpenBLAS..."
"[default]" | Out-File -filepath site.cfg -Encoding ascii
"libraries = libopenblas$staticlib, lapack" | Out-File -filepath site.cfg -Encoding ascii -Append
"library_dirs = ${MY_IFORT}compiler\lib\intel64_win;$root/src-stage1-dependencies/openblas/build/$staticconfig/lib;$root/src-stage1-dependencies/lapack/dist/$staticconfig/lib" | Out-File -filepath site.cfg -Encoding ascii -Append
"include_dirs = $root/src-stage1-dependencies\OpenBLAS\lapack-netlib\CBLAS\include" | Out-File -filepath site.cfg -Encoding ascii -Append
"lapack_libs = libopenblas$staticlib, lapack" | Out-File -filepath site.cfg -Encoding ascii -Append
if ($configuration -match "AVX2") {
"extra_compile_args=/MD /Zi /Oy /Ox /Oi /arch:AVX2" | Out-File -filepath site.cfg -Encoding ascii -Append
} elseif ($configuration -match "Debug") {
"extra_compile_args=/MDd /Zi" | Out-File -filepath site.cfg -Encoding ascii -Append
} else {
"extra_compile_args=/MD /Zi /Oy /Ox /Oi" | Out-File -filepath site.cfg -Encoding ascii -Append
}
"[openblas]" | Out-File -filepath site.cfg -Encoding ascii -Append
"libraries = libopenblas$staticlib, lapack" | Out-File -filepath site.cfg -Encoding ascii -Append
"library_dirs = $root/src-stage1-dependencies/openblas/build/$staticconfig/lib;$root/src-stage1-dependencies/lapack/dist/$staticconfig/lib" | Out-File -filepath site.cfg -Encoding ascii -Append
"include_dirs = $root/src-stage1-dependencies/OpenBLAS/lapack-netlib/CBLAS/include" | Out-File -filepath site.cfg -Encoding ascii -Append
"runtime_library_dirs = " | Out-File -filepath site.cfg -Encoding ascii -Append
"[lapack]" | Out-File -filepath site.cfg -Encoding ascii -Append
"lapack_libs = lapack" | Out-File -filepath site.cfg -Encoding ascii -Append
"libraries = lapack" | Out-File -filepath site.cfg -Encoding ascii -Append
"library_dirs = $root/src-stage1-dependencies/lapack/dist/$staticconfig/lib" | Out-File -filepath site.cfg -Encoding ascii -Append
"[blas]" | Out-File -filepath site.cfg -Encoding ascii -Append
"libraries = libopenblas$staticlib, lapack" | Out-File -filepath site.cfg -Encoding ascii -Append
"library_dirs = $root/src-stage1-dependencies/openblas/build/$staticconfig/lib;$root/src-stage1-dependencies/lapack/dist/$staticconfig/lib" | Out-File -filepath site.cfg -Encoding ascii -Append
"include_dirs = $root/src-stage1-dependencies/OpenBLAS/lapack-netlib/CBLAS/include" | Out-File -filepath site.cfg -Encoding ascii -Append
}
$env:VS90COMNTOOLS = $env:VS140COMNTOOLS
# clean doesn't really get it all...
del build/*.* -Recurse *>> $log
& $pythonroot/$pythonexe setup.py clean *>> $log
& $pythonroot/$pythonexe setup.py config --fcompiler=intelvem --compiler=msvc *>> $log
Write-Host -NoNewline "building..."
$env:_LINK_=" /NODEFAULTLIB:""LIBCMT.lib"" /NODEFAULTLIB:""LIBIFCOREMD.lib"" /DEFAULTLIB:""LIBIFCOREMT.lib"" /NODEFAULTLIB:""SVML_DISPMD.lib"" /DEFAULTLIB:""SVML_DISPMT.lib"" /NODEFAULTLIB:""LIBMMD.lib"" /DEFAULTLIB:""LIBMMDS.lib"" /DEFAULTLIB:""LIBMMT.lib"" /DEFAULTLIB:""libifport.lib"" /DEFAULTLIB:""legacy_stdio_definitions.lib"" /DEFAULTLIB:""libipgo.lib"" /DEFAULTLIB:""LIBIRC.lib"" "
# setup.py doesn't handle debug flag correctly for windows ifort, it adds a -g flag which is ambiguous so we'll do our best to emulate it manually
if ($configuration -match "Debug") {$env:__INTEL_POST_FFLAGS = " /debug:all "} else {$env:__INTEL_POST_FFLAGS = ""}
& $pythonroot/$pythonexe setup.py build --compiler=msvc --fcompiler=intelvem *>> $log
Write-Host -NoNewline "installing..."
& $pythonroot/$pythonexe setup.py install *>> $log
Write-Host -NoNewline "creating wheel..."
& $pythonroot/$pythonexe setup.py bdist_wheel *>> $log
move dist/scipy-$scipy_version-cp27-cp27${d}m-win_amd64.whl dist/scipy-$scipy_version-cp27-cp27${d}m-win_amd64.$configuration.whl -Force
$env:_CL_=""
$env:_LINK_=""
$env:__INTEL_POST_FFLAGS = ""
$ErrorActionPreference = "Stop"
Validate "dist/scipy-$scipy_version-cp27-cp27${d}m-win_amd64.$configuration.whl" "$pythonroot/lib/site-packages/scipy-$scipy_version-py2.7-win-amd64.egg/scipy/linalg/_flapack.pyd" "$pythonroot/lib/site-packages/scipy-$scipy_version-py2.7-win-amd64.egg/scipy/linalg/cython_lapack.pyd" "$pythonroot/lib/site-packages/scipy-$scipy_version-py2.7-win-amd64.egg/scipy/sparse/_sparsetools.pyd"
} else {
Write-Host "scipy already built..."
}
} else {
# Can't compile scipy without a fortran compiler, and gfortran won't work here
# because we can't mix MSVC and gfortran libraries
# So if we get here, we need to use the binary .whl instead
# Note that these are specifically built VS 2015 x64 versions for python 2.7.
# note the no-deps flag so we don't install 2x versions of numpy which will cause issues
if ((TryValidate "$pythonroot/lib/site-packages/scipy/linalg/_flapack.pyd" "$pythonroot/lib/site-packages/scipy/linalg/cython_lapack.pyd" "$pythonroot/lib/site-packages/scipy/sparse/_sparsetools.pyd") -eq $false) {
$ErrorActionPreference = "Continue"
if ($BuildNumpyWithMKL) {
Write-Host -NoNewline "installing MKL scipy from wheel..."
Write-Host -NoNewline "Compatible Fortran compiler not available, installing scipy from custom binary wheel..."
& $pythonroot/Scripts/pip.exe --disable-pip-version-check install --no-dependencies http://www.gcndevelopment.com/gnuradio/downloads/libraries/scipy/mkl/scipy-$scipy_version-cp27-cp27${d}m-win_amd64.$configuration.whl -U -t $pythonroot\lib\site-packages *>> $log
} else {
Write-Host -NoNewline "installing OpenBLAS scipy from wheel..."
& $pythonroot/Scripts/pip.exe --disable-pip-version-check install --no-dependencies http://www.gcndevelopment.com/gnuradio/downloads/libraries/scipy/openBLAS/scipy-$scipy_version-cp27-cp27${d}m-win_amd64.$configuration.whl -U -t $pythonroot\lib\site-packages *>> $log
}
$ErrorActionPreference = "Stop"
Validate "$pythonroot/lib/site-packages/scipy/linalg/_flapack.pyd" "$pythonroot/lib/site-packages/scipy/linalg/cython_lapack.pyd" "$pythonroot/lib/site-packages/scipy/sparse/_sparsetools.pyd"
} else {
Write-Host "scipy already built..."
}
}
#__________________________________________________________________________________________
# PyQwt5
# requires Python, Qwt, Qt, PyQt, and Numpy
#
if ($mm -eq "3.7") {
SetLog "$configuration PyQwt5"
cd $root\src-stage1-dependencies\PyQwt5-master
if ((TryValidate "dist/PyQwt-5.2.1.win-amd64.$configuration.exe" "$pythonroot/lib/site-packages/PyQt4/Qwt5/Qwt$debugext.pyd" "$pythonroot/lib/site-packages/PyQt4/Qwt5/_iqt.pyd" "$pythonroot/lib/site-packages/PyQt4/Qwt5/qplt.py") -eq $false) {
Write-Host -NoNewline "configuring PyQwt5..."
$ErrorActionPreference = "Continue"
# qwt_version_info will look for QtCore4.dll, never Qt4Core4d.dll so point it to the ReleaseDLL regardless of the desired config
if ($configuration -eq "DebugDLL") {$QtVersion = "ReleaseDLL"} else {$QtVersion = $configuration}
$env:Path = "$root\src-stage1-dependencies\Qt4\build\$QtVersion\bin;$root\src-stage1-dependencies\Qwt-$qwt_version\build\x64\Debug-Release\lib;" + $oldpath
$envLib = $oldlib
if ($type -match "AVX2") {$env:_CL_ = "/Ox /arch:AVX2 /wd4577 " } else {$env:_CL_ = "/wd4577 " }
cd configure
# CALL "../../%1/Release/Python27/python.exe" configure.py %DEBUG% --extra-cflags=%FLAGS% %DEBUG% -I %~dp0..\qwt-5.2.3\build\include -L %~dp0..\Qt-4.8.7\lib -L %~dp0..\qwt-5.2.3\build\lib -l%QWT_LIB%
if ($configuration -eq "DebugDLL") {
$env:_LINK_ = " /FORCE /LIBPATH:""$root/src-stage1-dependencies/Qt4/build/ReleaseDLL/lib"" /LIBPATH:""$root/src-stage1-dependencies/Qt4/build/Release-AVX2/lib"" /DEFAULTLIB:user32 /DEFAULTLIB:advapi32 /DEFAULTLIB:ole32 /DEFAULTLIB:ws2_32 /DEFAULTLIB:qtcored4 "
& $pythonroot/$pythonexe configure.py --debug --extra-cflags="-Zi -wd4577" -I $root\src-stage1-dependencies\Qwt-$qwt_version\build\x64\Debug-Release\include -L $root\src-stage1-dependencies\Qt4\build\$QtVersion\lib -l qtcored4 -L $root\src-stage1-dependencies\Qwt-$qwt_version\build\x64\Debug-Release\lib -l"$root\src-stage1-dependencies\Qwt-$qwt_version\build\x64\Debug-Release\lib\qwtd" -j4 --sip-include-dirs ..\..\sip-$sip_version\build\x64\Debug --sip-include-dirs ..\..\PyQt4\sip *>> $log
} elseif ($configuration -eq "ReleaseDLL") {
& $pythonroot/$pythonexe configure.py --extra-cflags="-Zi -wd4577" -I $root\src-stage1-dependencies\Qwt-$qwt_version\build\x64\Debug-Release\include -L $root\src-stage1-dependencies\Qt4\build\ReleaseDLL\lib -l qtcore4 -L $root\src-stage1-dependencies\Qwt-$qwt_version\build\x64\Debug-Release\lib -l"$root\src-stage1-dependencies\Qwt-$qwt_version\build\x64\Debug-Release\lib\qwt" -j4 --sip-include-dirs ..\..\sip-$sip_version\build\x64\Release *>> $log
} else {
& $pythonroot/$pythonexe configure.py --extra-cflags="-Zi -Ox -arch:AVX2 -wd4577" -I $root\src-stage1-dependencies\Qwt-$qwt_version\build\x64\Release-AVX2\include -L $root\src-stage1-dependencies\Qt4\build\ReleaseDLL-AVX2\lib -l qtcore4 -L $root\src-stage1-dependencies\Qwt-$qwt_version\build\x64\Release-AVX2\lib -l"$root\src-stage1-dependencies\Qwt-$qwt_version\build\x64\Release-AVX2\lib\qwt" -j4 --sip-include-dirs ..\..\sip-$sip_version\build\x64\Release-AVX2 *>> $log
}
nmake clean *>> $log
Write-Host -NoNewline "building..."
Exec {nmake} *>> $log
Write-Host -NoNewline "installing..."
Exec {nmake install} *>> $log
#& $pythonroot/$pythonexe setup.py build *>> $log
#Write-Host -NoNewline "installing..."
#& $pythonroot/$pythonexe setup.py install *>> $log
Write-Host -NoNewline "creating winstaller..."
cd ..
& $pythonroot/$pythonexe setup.py bdist_wininst *>> $log
move dist/PyQwt-5.2.1.win-amd64.exe dist/PyQwt-5.2.1.win-amd64.$configuration.exe -Force
# TODO these move fail for lack of a wheel-compatible setup
# & $pythonroot/$pythonexe setup.py bdist_wheel *>> $log
# cd dist
# & $pythonroot/Scripts/wheel.exe convert PyQwt-5.2.1.win-amd64.DebugDLL.exe
$env:Path = $oldpath
$env:_CL_ = ""
$env:_LINK_ = ""
$ErrorActionPreference = "Stop"
Validate "dist/PyQwt-5.2.1.win-amd64.$configuration.exe" "$pythonroot/lib/site-packages/PyQt4/Qwt5/Qwt$debugext.pyd" "$pythonroot/lib/site-packages/PyQt4/Qwt5/_iqt.pyd" "$pythonroot/lib/site-packages/PyQt4/Qwt5/qplt.py"
} else {
Write-Host "PyQwt5 already built..."
}
}
#__________________________________________________________________________________________
# PyOpenGL
# requires Python
# python-only package so no need to rename the wheels since there is only one
#
SetLog "$configuration PyOpenGL"
cd $root\src-stage1-dependencies\PyOpenGL-$pyopengl_version
if ((TryValidate "$pythonroot/lib/site-packages/OpenGL/version.py" "dist/PyOpenGL-$pyopengl_version-py2-none-any.whl") -eq $false ) {
Write-Host -NoNewline "installing PyOpenGL..."
$ErrorActionPreference = "Continue"
& $pythonroot/$pythonexe setup.py install --single-version-externally-managed --root=/ *>> $log
Write-Host -NoNewline "crafting wheel..."
& $pythonroot/$pythonexe setup.py bdist_wheel *>> $log
$ErrorActionPreference = "Stop"
Validate "$pythonroot/lib/site-packages/OpenGL/version.py" "dist/PyOpenGL-$pyopengl_version-py2-none-any.whl"
} else {
Write-Host "PyOpenGL already built..."
}
#__________________________________________________________________________________________
# PyOpenGL-accelerate
# requires Python, PyOpenGL
#
cd $root\src-stage1-dependencies\PyOpenGL-accelerate-$pyopengl_version
if ((TryValidate "$pythonroot/lib/site-packages/OpenGL_accelerate/wrapper$debugext.pyd" "dist/PyOpenGL_accelerate-$pyopengl_version-cp27-cp27${d}m-win_amd64.$configuration.whl") -eq $false) {
Write-Host -NoNewline "installing PyOpenGL-accelerate..."
$ErrorActionPreference = "Continue"
& $pythonroot/$pythonexe setup.py clean *>> $log
if ($configuration -match "Debug") {$env:_LINK_=" /LIBPATH:""$root\src-stage1-dependencies\Qt4\build\$configuration\lib"" "}
& $pythonroot/$pythonexe setup.py build $debug install --single-version-externally-managed --root=/ *>> $log
Write-Host -NoNewline "crafting wheel..."
& $pythonroot/$pythonexe setup.py bdist_wheel *>> $log
move dist/PyOpenGL_accelerate-$pyopengl_version-cp27-cp27${d}m-win_amd64.whl dist/PyOpenGL_accelerate-$pyopengl_version-cp27-cp27${d}m-win_amd64.$configuration.whl -Force
$env:_LINK_ = ""
$ErrorActionPreference = "Stop"
Validate "$pythonroot/lib/site-packages/OpenGL_accelerate/wrapper$debugext.pyd" "dist/PyOpenGL_accelerate-$pyopengl_version-cp27-cp27${d}m-win_amd64.$configuration.whl"
} else {
Write-Host "PyOpenGL-accelerate already built..."
}
#__________________________________________________________________________________________
# pkg-config
# both the binary (using pkg-config-lite to avoid dependency issues) and the python wrapper
#
SetLog "$configuration pkg-config"
cd $root\src-stage1-dependencies\pkgconfig-$pkgconfig_version
if ((TryValidate "$root\bin\pkg-config.exe" "dist/pkgconfig-$pkgconfig_version-py2-none-any.whl" "$pythonroot/lib/site-packages/pkgconfig/pkgconfig.py") -eq $false) {
Write-Host -NoNewline "building pkg-config..."
$ErrorActionPreference = "Continue"
& $pythonroot/$pythonexe setup.py build $debug *>> $log
Write-Host -NoNewline "installing..."
& $pythonroot/$pythonexe setup.py install --single-version-externally-managed --root=/ *>> $log
Write-Host -NoNewline "crafting wheel..."
& $pythonroot/$pythonexe setup.py bdist_wheel *>> $log
# yes, this copies the same file three times, but since it's conceptually linked to
# the python wrapper, I kept this here for ease of maintenance
cp $root\src-stage1-dependencies\pkg-config-lite-0.28-1\bin\pkg-config.exe $root\bin -Force *>> $log
New-Item -ItemType Directory -Force $pythonroot\lib\pkgconfig *>> $log
$ErrorActionPreference = "Stop"
Validate "$root\bin\pkg-config.exe" "dist/pkgconfig-$pkgconfig_version-py2-none-any.whl" "$pythonroot/lib/site-packages/pkgconfig/pkgconfig.py"
} else {
Write-Host "pkg-config already built..."
}
#__________________________________________________________________________________________
# py2cairo
# requires pkg-config
# While the latest version gets rid of the WAF build system (thank you!)
# the new version doesn't generate a pkgconfig file that pyGTK is looking for later.
# So we need to manually build it for the moment
#
SetLog "$configuration pycairo"
cd $root\src-stage1-dependencies\pycairo-$py2cairo_version
if ((TryValidate "$pythonroot\lib\site-packages\cairo\_cairo.pyd") -eq $false) {
Write-Host -NoNewline "configuring py2cairo..."
$ErrorActionPreference = "Continue"
$env:PATH = "$root/bin;$root/src-stage1-dependencies/x64/bin;$root/src-stage1-dependencies/x64/lib;" + $oldpath
$env:PKG_CONFIG_PATH = "$root/bin;$root/src-stage1-dependencies/x64/lib/pkgconfig;$pythonroot/lib/pkgconfig"
if ($configuration -match "AVX2") {$env:_CL_ = "/arch:AVX2"} else {$env:_CL_ = $null}
if ($configuration -match "Debug") {$env:_CL_ = $env:_CL_ + " /Zi /D_DEBUG "; $env:_LINK_ = " /DEBUG:FULL"}
Write-Host -NoNewline "building..."
$env:INCLUDE = "$root/src-stage1-dependencies/x64/include;$root/src-stage1-dependencies/x64/include/cairo;" + $oldInclude
$env:LIB = "$root/src-stage1-dependencies/cairo/build/x64/Release;$root/src-stage1-dependencies/cairo/build/x64/ReleaseDLL;$pythonroot/libs;" + $oldlib
$env:_CL_ = "/MD$d /I$root/src-stage1-dependencies/x64/include /I$root/src-stage1-dependencies/x64/include/cairo /DCAIRO_WIN32_STATIC_BUILD"
$env:_LINK_ = "/DEFAULTLIB:cairo /DEFAULTLIB:pixman-1 /DEFAULTLIB:freetype /LIBPATH:$root/src-stage1-dependencies/x64/lib /LIBPATH:$pythonroot/libs"
& $pythonroot/$pythonexe setup.py build $debug --compiler=msvc *>> $Log
Write-Host -NoNewline "installing..."
& $pythonroot/$pythonexe setup.py install --single-version-externally-managed --root=/ *>> $Log
Write-Host -NoNewline "creating wheel..."
& $pythonroot/$pythonexe setup.py bdist_wheel *>> $Log
$env:_LINK_ = ""
$env:_CL_ = ""
$env:LIB = $oldLib
$env:INCLUDE = $oldInclude
cp -Recurse -Force build/x64/$configuration/lib/python2.7/site-packages/cairo $pythonroot\lib\site-packages *>> $log
if ($configuration -match "Debug") {
cp -Force "$pythonroot\lib\site-packages\cairo\_cairo.pyd" "$pythonroot\lib\site-packages\cairo\_cairo_d.pyd"
}
# Create pc file manually
"prefix=$root\src-stage1-dependencies\py2cairo-$py2cairo_version\build\x64\$configuration" | out-file -FilePath $pythonroot/lib/pkgconfig/pycairo.pc -encoding ASCII
"" | out-file -FilePath $pythonroot/lib/pkgconfig/pycairo.pc -encoding ASCII -append
"Name: Pycairo" | out-file -FilePath $pythonroot/lib/pkgconfig/pycairo.pc -encoding ASCII -append
"Description: Python bindings for cairo" | out-file -FilePath $pythonroot/lib/pkgconfig/pycairo.pc -encoding ASCII -append
"Version: $py2cairo_version" | out-file -FilePath $pythonroot/lib/pkgconfig/pycairo.pc -encoding ASCII -append
"Requires: cairo" | out-file -FilePath $pythonroot/lib/pkgconfig/pycairo.pc -encoding ASCII -append
"Cflags: -I$root\src-stage1-dependencies\py2cairo-$py2cairo_version\build\x64\$configuration\include/pycairo" | out-file -FilePath $pythonroot/lib/pkgconfig/pycairo.pc -encoding ASCII -append
"Libs:" | out-file -FilePath $pythonroot/lib/pkgconfig/pycairo.pc -encoding ASCII -append
Validate "$pythonroot\lib\site-packages\cairo\_cairo.pyd"
} else {
Write-Host "py2cairo already built..."
}
#__________________________________________________________________________________________
# Pygobject
# requires Python
#
# 2.X VERSION WARNING: higher than 2.28 does not have setup.py so do not try to use )
#
SetLog "$configuration pygobject"
if ($mm -eq "3.8") {
cd $root\src-stage1-dependencies\Pygobject-$pygobject3_version
if ((TryValidate "dist/gtk-3.0/pygobject-$pygobject3_version-cp27-cp27${d}m-win_amd64.$configuration.whl" "$pythonroot\lib\site-packages\gi\_gi.pyd") -eq $false) {
Write-Host -NoNewline "building Pygobject 3..."
$ErrorActionPreference = "Continue"
$env:INCLUDE = "$root/src-stage1-dependencies/x64/include;$root/src-stage1-dependencies/x64/include/gobject-introspection-1.0/girepository;$root/src-stage1-dependencies/x64/include/glib-2.0;$root/src-stage1-dependencies/x64/include;$root/src-stage1-dependencies/x64/include/cairo;$root/src-stage1-dependencies/x64/include;$root/src-stage1-dependencies/x64/lib/glib-2.0/include;$root/src-stage1-dependencies/x64/include/gobject-introspection-1.0;$root/src-stage1-dependencies/x64/include/gtk-3.0" + $oldInclude
$env:PATH = "$root/bin;$root/src-stage1-dependencies/x64/bin;$root/src-stage1-dependencies/x64/lib;" + $oldpath
$env:PKG_CONFIG_PATH = "$root/bin;$root/src-stage1-dependencies/x64/lib/pkgconfig;$pythonroot/lib/pkgconfig"
$env:LIB = "$root/src-stage1-dependencies/x64/lib;" + $oldlib
if ((Test-Path "$root/src-stage1-dependencies/x64/lib/libffi.lib") -and !(Test-Path "$root/src-stage1-dependencies/x64/lib/ffi.lib")) {
Rename-Item -Path "$root/src-stage1-dependencies/x64/lib/libffi.lib" -NewName "ffi.lib"
}
if ($configuration -match "AVX2") {$env:_CL_ = "/arch:AVX2"} else {$env:_CL_ = $null}
if ($configuration -match "Debug") {$env:_CL_ = $env:_CL_ + " /Zi /D_DEBUG "; $env:_LINK_ = " /DEBUG:FULL"}
& $pythonroot/$pythonexe setup.py build $debug --compiler=msvc *>> $Log
Write-Host -NoNewline "installing..."
& $pythonroot/$pythonexe setup.py install --single-version-externally-managed --root=/ *>> $Log
Write-Host -NoNewline "creating exe..."
& $pythonroot/$pythonexe setup.py bdist_wininst *>> $Log
Write-Host -NoNewline "crafting wheel..."
& $pythonroot/$pythonexe setup.py bdist_wheel *>> $Log
New-Item -ItemType Directory -Force -Path .\dist\gtk-3.0 *>> $Log
cd dist
move ./pygobject-$pygobject3_version-cp27-cp27${d}m-win_amd64.whl gtk-3.0/pygobject-$pygobject3_version-cp27-cp27${d}m-win_amd64.$configuration.whl -Force
cd ..
$env:_CL_ = ""
$env:LIB = $oldLIB
$env:PATH = $oldPath
$env:PKG_CONFIG_PATH = ""
$ErrorActionPreference = "Stop"
Validate "dist/gtk-3.0/pygobject-$pygobject3_version-cp27-cp27${d}m-win_amd64.$configuration.whl" "$pythonroot\lib\site-packages\gi\_gi.pyd"
} else {
Write-Host "pygobject3 already built..."
}
} else {
cd $root\src-stage1-dependencies\Pygobject-$pygobject_version
if ((TryValidate "dist/gtk-2.0/pygobject-cp27-none-win_amd64.$configuration.whl" "$pythonroot\lib\site-packages\gtk-2.0\gobject\_gobject.pyd") -eq $false) {
Write-Host -NoNewline "building Pygobject..."
$ErrorActionPreference = "Continue"
$env:PATH = "$root/bin;$root/src-stage1-dependencies/x64/bin;$root/src-stage1-dependencies/x64/lib;" + $oldpath
$env:PKG_CONFIG_PATH = "$root/bin;$root/src-stage1-dependencies/x64/lib/pkgconfig;$pythonroot/lib/pkgconfig"
if ($configuration -match "AVX2") {$env:_CL_ = "/arch:AVX2"} else {$env:_CL_ = $null}
if ($configuration -match "Debug") {$env:_CL_ = $env:_CL_ + " /Zi /D_DEBUG "; $env:_LINK_ = " /DEBUG:FULL"}
& $pythonroot/$pythonexe setup.py build $debug --compiler=msvc --enable-threading *>> $Log
Write-Host -NoNewline "installing..."
& $pythonroot/$pythonexe setup.py install *>> $Log
Write-Host -NoNewline "creating exe..."
& $pythonroot/$pythonexe setup.py bdist_wininst *>> $Log
Write-Host -NoNewline "crafting wheel from exe..."
New-Item -ItemType Directory -Force -Path .\dist\gtk-2.0 *>> $Log
cd dist
& $pythonroot/Scripts/wheel.exe convert pygobject-$pygobject_version.win-amd64-py2.7.exe *>> $Log
move gtk-2.0/pygobject-cp27-none-win_amd64.whl gtk-2.0/pygobject-cp27-none-win_amd64.$configuration.whl -Force
cd ..
$env:_CL_ = ""
$env:PATH = $oldPath
$env:PKG_CONFIG_PATH = ""
$ErrorActionPreference = "Stop"
Validate "dist/gtk-2.0/pygobject-cp27-none-win_amd64.$configuration.whl" "$pythonroot\lib\site-packages\gtk-2.0\gobject\_gobject.pyd"
} else {
Write-Host "pygobject already built..."
}
}
#__________________________________________________________________________________________
# PyGTK
# requires Python, Pygobject
#
SetLog "$configuration pygtk"
if ($mm -eq "3.8") {
Write-Host "skipping pygtk as using GTK3" >> $Log
Write-Host "skipping pygtk as using GTK3"
} else {
cd $root\src-stage1-dependencies\pygtk-$pygtk_version.0
if ((TryValidate "dist/gtk-2.0/pygtk-cp27-none-win_amd64.$configuration.whl" "$pythonroot\lib\site-packages\gtk-2.0\gtk\_gtk.pyd") -eq $false) {
Write-Host -NoNewline "building PyGTK..."
if ($configuration -match "AVX2") {$env:_CL_ = "/arch:AVX2"} else {$env:_CL_ = $null}
$env:PATH = "$root/bin;$root/src-stage1-dependencies/x64/bin;$root/src-stage1-dependencies/x64/lib;$pythonroot/Scripts;$pythonroot;" + $oldpath
$env:_CL_ = "/I$root/src-stage1-dependencies/x64/lib/gtk-2.0/include /I$root/src-stage1-dependencies/pycairo-$py2cairo_version/cairo " + $env:_CL_
if ($configuration -match "Debug") {$env:_CL_ = $env:_CL_ + " /Zi /D_DEBUG "; $env:_LINK_ = " /DEBUG:FULL"}
$env:PKG_CONFIG_PATH = "$root/bin;$root/src-stage1-dependencies/x64/lib/pkgconfig;$pythonroot/lib/pkgconfig"
$ErrorActionPreference = "Continue"
& $pythonroot/$pythonexe setup.py clean *>> $Log
& $pythonroot/$pythonexe setup.py build $debug --compiler=msvc --enable-threading *>> $log
Write-Host -NoNewline "installing..."
& $pythonroot/$pythonexe setup.py install *>> $Log
Write-Host -NoNewline "building exe..."
& $pythonroot/$pythonexe setup.py bdist_wininst *>> $Log
New-Item -ItemType Directory -Force -Path .\dist\gtk-2.0 *>> $Log
cd dist
Write-Host -NoNewline "crafting wheel from exe..."
& $pythonroot/Scripts/wheel.exe convert pygtk-$pygtk_version.0.win-amd64-py2.7.exe *>> $Log
move gtk-2.0/pygtk-cp27-none-win_amd64.whl gtk-2.0/pygtk-cp27-none-win_amd64.$configuration.whl -Force *>> $Log
cd ..
$env:_CL_ = ""
$env:_LINK_ = ""
$env:PATH = $oldPath
$env:PKG_CONFIG_PATH = ""
$ErrorActionPreference = "Stop"
Validate "dist/gtk-2.0/pygtk-cp27-none-win_amd64.$configuration.whl" "$pythonroot\lib\site-packages\gtk-2.0\gtk\_gtk.pyd"
} else {
Write-Host "pyGTK already built..."
}
}
#__________________________________________________________________________________________
# Pyyaml
# requires Python
#
SetLog "$configuration pyyaml"
if ($mm -eq "3.8") {
cd $root\src-stage1-dependencies\pyyaml
if ((TryValidate "dist/pyyaml-$pyyaml_version-cp27-cp27${d}m-win_amd64.$configuration.whl" "$pythonroot/lib/site-packages/yaml/__init__.py") -eq $false) {
Write-Host -NoNewline "building pyyaml..."
$ErrorActionPreference = "Continue"
if ($configuration -match "AVX2") {$env:_CL_ = "/arch:AVX2"} else {$env:_CL_ = $null}
if ($configuration -match "Debug") {$env:_CL_ = $env:_CL_ + " /Zi /D_DEBUG "; $env:_LINK_ = " /DEBUG:FULL"}
& $pythonroot/$pythonexe setup.py build $debug --compiler=msvc *>> $Log
Write-Host -NoNewline "installing..."
& $pythonroot/$pythonexe setup.py install *>> $Log
Write-Host -NoNewline "creating exe..."
& $pythonroot/$pythonexe setup.py bdist_wininst *>> $Log
Write-Host -NoNewline "crafting wheel..."
& $pythonroot/$pythonexe setup.py bdist_wheel *>> $Log
cd dist
move ./pyyaml-$pyyaml_version-cp27-cp27${d}m-win_amd64.whl pyyaml-$pyyaml_version-cp27-cp27${d}m-win_amd64.$configuration.whl -Force
cd ..
$ErrorActionPreference = "Stop"
Validate "dist/pyyaml-$pyyaml_version-cp27-cp27${d}m-win_amd64.$configuration.whl" "$pythonroot/lib/site-packages/yaml/__init__.py"
} else {
Write-Host "pyyaml already built..."
}
}
#__________________________________________________________________________________________
# wxpython
#
# v3.0.2 is not VC140 compatible, so the patch fixes those things
# TODO submit changes to source tree
#
# TODO so the debug build is not working because of it's looking for the wrong file to link to
# (debug vs non-debug). So the workaround is to build wx in release even when python is
# being built in debug.
#
if ($mm -eq "3.7") {
SetLog "$configuration wxpython"
cd $root\src-stage1-dependencies\wxpython\wxPython
if ((TryValidate "$pythonroot\lib\site-packages\wx-3.0-msw\wx\_core_.pyd" "dist\wx-3.0-cp27-none-win_amd64.$configuration.whl") -eq $false) {
Write-Host -NoNewline "prepping wxpython..."
$canbuildwxdebug = $true
$wxdebug = ($canbuildwxdebug -and $d -eq "d")
$wxdebugstring = ""
$env:WXWIN="$root\src-stage1-dependencies\wxpython"
$env:PATH = "$root/src-stage1-dependencies/x64/bin;$root/src-stage1-dependencies/x64/lib;$pythonroot/Scripts;$pythonroot" + $oldpath
$env:_CL_ = "/I$root/src-stage1-dependencies/wxpython/include/msvc /I$root/src-stage1-dependencies/wxpython/lib/vc140_dll/mswu /DWXWIN=.. /DMSLU /D_UNICODE /DUNICODE /DwxMSVC_VERSION_AUTO "
if ($configuration -match "AVX2") {$env:_CL_ = $env:_CL_ + " /arch:AVX2 "}
$ErrorActionPreference = "Continue"
if (Test-Path .\build) {del -recurse .\build\*.* *>> $Log}
& $pythonroot\$pythonexe build-wxpython.py --clean *>> $Log
if ($wxdebug) {
Write-Host -NoNewline "building release..."
$env:_CL_ = " /D__WXMSW__ /MDd " + $env:_CL_
& $pythonroot\$pythonexe build-wxpython.py --build_dir=../build --force_config *>> $Log
$env:_CL_ = " /I$root/src-stage1-dependencies/wxpython/lib/vc140_dll/mswud /D__WXDEBUG__ /D_DEBUG " + $env:_CL_
$wxdebugstring = "--debug"
Write-Host -NoNewline "building & installing..."
& $pythonroot\$pythonexe build-wxpython.py --build_dir=../build --force_config --install $wxdebugstring *>> $Log
} else {
Write-Host -NoNewline "building & installing..."
& $pythonroot\$pythonexe build-wxpython.py --build_dir=../build --force_config --install *>> $Log
}
# the above assumes the core WX dll's will be installed to the system someplace on the PATH.
# That's not what we want to do, so since these are gr-python-only DLLs, we'll put then in the site packages dir
cp "$root/src-stage1-dependencies/wxpython/lib/vc140_dll/wx*.dll" "$pythonroot/Lib/site-packages/wx-3.0-msw/wx"
#Write-Host -NoNewline "configing..."
#& $pythonroot\$pythonexe setup.py clean *>> $Log
#& $pythonroot\$pythonexe setup.py config MONOLITHIC=1 *>> $Log
#Write-Host -NoNewline "building..."
#& $pythonroot\$pythonexe setup.py build $wxdebugstring MONOLITHIC=1 *>> $Log
#Write-Host -NoNewline "installing..."
#& $pythonroot\$pythonexe setup.py install *>> $Log
Write-Host -NoNewline "crafting wheel..."
& $pythonroot\$pythonexe setup.py bdist_wininst UNICODE=1 BUILD_BASE=build *>> $Log
cd dist
& $pythonroot/Scripts/wheel.exe convert wxpython-$wxpython_version.win-amd64-py2.7.exe *>> $Log
del wxpython-$wxpython_version.win-amd64-py2.7.exe
move wx-3.0-cp27-none-win_amd64.whl wx-3.0-cp27-none-win_amd64.$configuration.whl -Force *>> $Log
move .\wxPython-common-$wxpython_version.win-amd64.exe .\wxPython-common-$wxpython_version.win-amd64.$configuration.exe -Force *>> $Log
$ErrorActionPreference = "Stop"
$env:_CL_ = ""
$env:PATH = $oldPath
Validate "$pythonroot\lib\site-packages\wx-3.0-msw\wx\_core_.pyd" "wx-3.0-cp27-none-win_amd64.$configuration.whl"
} else {
Write-Host "wxpython already built..."
}
}
#__________________________________________________________________________________________
# cheetah
#
# will download and install Markdown automatically
SetLog "$configuration cheetah"
cd $root\src-stage1-dependencies\Cheetah-$cheetah_version
if ((TryValidate "dist/Cheetah-$cheetah_version-cp27-cp27${d}m-win_amd64.$configuration.whl" "$pythonroot/lib/site-packages/Cheetah-$cheetah_version-py2.7-win-amd64.egg/Cheetah/_namemapper.pyd" "$pythonroot/lib/site-packages/Cheetah-$cheetah_version-py2.7-win-amd64.egg/Cheetah/Compiler.py") -eq $false) {
Write-Host -NoNewline "building cheetah..."
$ErrorActionPreference = "Continue"
& $pythonroot/$pythonexe setup.py build $debug *>> $log
Write-Host -NoNewline "installing..."
& $pythonroot/$pythonexe setup.py install *>> $log
Write-Host -NoNewline "crafting wheel..."
& $pythonroot/$pythonexe setup.py bdist_wheel *>> $log
move dist/Cheetah-$cheetah_version-cp27-cp27${d}m-win_amd64.whl dist/Cheetah-$cheetah_version-cp27-cp27${d}m-win_amd64.$configuration.whl -Force *>> $log
$ErrorActionPreference = "Stop"
Validate "dist/Cheetah-$cheetah_version-cp27-cp27${d}m-win_amd64.$configuration.whl" "$pythonroot/lib/site-packages/Cheetah-$cheetah_version-py2.7-win-amd64.egg/Cheetah/_namemapper.pyd" "$pythonroot/lib/site-packages/Cheetah-$cheetah_version-py2.7-win-amd64.egg/Cheetah/Compiler.py"
} else {
Write-Host "cheetah already built..."
}
#__________________________________________________________________________________________
# sphinx
#
# will also download/install a large number of dependencies
# pytz, babel, colorama, snowballstemmer, sphinx-rtd-theme, six, Pygments, docutils, Jinja2, alabaster, sphinx
# all are python only packages
SetLog "$configuration sphinx"
if ((TryValidate "$pythonroot/lib/site-packages/sphinx/__main__.py") -eq $false) {