forked from mzdb/pwiz-mzdb
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jamroot.jam
1276 lines (1085 loc) · 47.6 KB
/
Jamroot.jam
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
#
# $Id: Jamroot.jam 7320 2015-03-18 17:54:26Z chambm $
#
#
# Original author: Darren Kessner <[email protected]>
#
# Copyright 2008 Spielberg Family Center for Applied Proteomics
# Cedars-Sinai Medical Center, Los Angeles, California 90048
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
if ( "--help" in [ modules.peek : ARGV ] )
{ # slip our own help text in here
ECHO
################################
## Targets and Related Options #
################################
# build Build ProteoWizard applications
# =====
# --libraries-path=<DIR> Find libraries directory here.
# Default: "./libraries"
#
# --boost-src=<DIR> Find Boost source distribution here.
# Default: "<libraries-path>/boost_*"
#
# --zlib-src=<DIR> Find zlib source distribution here.
# Default: "<libraries-path>/zlib-1.23.0"
#
# --i-agree-to-the-vendor-licenses For windows builds, indicates
# your willingness to comply with
# license terms of the vendor DLLs
# that enable reading of proprietary
# binary data formats. Without this
# switch your build will not include
# support for reading vendor binary
# files.
#
# --incremental Skip the checks for extracting external library
# tarballs - useful after your initial build
#
# --without-mz5 Build without mz5 support
#
# --without-binary-msdata Build with support for mass spec text formats only
# (mzML, mzXML, MGF, etc - no binary formats
# like mz5 or vendor-specifics )
#
#
# If you just want to build a subset of pwiz, add a target to
# your command line. For example to build just the msdata file
# read/write stuff, add:
#
# pwiz/data/msdata
#
# Or to build a particular item of that subset, such as a test,
# you could add (note the double slashes!) :
#
# pwiz/data/msdata//MSDataFileTest
#
; # end of our own help text
}
.os = [ modules.peek : OS ] ; # NT, LINUX, MACOSX
.platform = [ modules.peek : OSPLAT ] ; # X86, X86_64, POWERPC
# set up explicit 32-bit or 64-bit builds
if "address-model=64" in [ modules.peek : ARGV ] || ( ! ( $(.os) = "NT" ) && $(.platform:L) = "x86_64" )
{
constant PROCESSOR_ARCHITECTURE : "AMD64" ;
constant PLATFORM : "x64" ;
}
else if "address-model=32" in [ modules.peek : ARGV ] || $(.platform:L) = "x86" || $(.os) = "NT"
{
constant PROCESSOR_ARCHITECTURE : "x86" ;
constant PLATFORM : "x86" ;
}
else
{
echo "Unable to determine address-model for platform $(.platform:L). The only supported platforms are x86 and x86_64." ;
exit ;
}
local default_libraries_path = "./libraries" ;
local libraries_path = [ MATCH --libraries-path=(.*) : [ modules.peek : ARGV ] ] ;
libraries_path ?= $(default_libraries_path) ; # set default path in absence of command-line path
local default_boost_src = "$(libraries_path)/boost_1_56_0" ;
local boost_src = [ MATCH --boost-src=(.*) : [ modules.peek : ARGV ] ] ;
boost_src ?= $(default_boost_src) ; # set default path in absence of command-line path
local default_zlib_src = "$(libraries_path)/zlib-1.2.3" ;
local zlib_src = [ MATCH --zlib-src=(.*) : [ modules.peek : ARGV ] ] ;
zlib_src ?= $(default_zlib_src) ; # set default path in absence of command-line path
# TODO: get version from boost/version.hpp
import regex ;
local boost_version_suffix = [ MATCH "boost_(._..(_.)?)" : $(boost_src:L) ] ;
if ! $(boost_version_suffix) { errors.user-error "Unable to determine version from external Boost source; expected x_xx[_xx] format." ; }
constant BOOST_VERSION : [ regex.split $(boost_version_suffix[1]) _ ] ;
import path ;
import feature ;
# declare a feature indicating vendor API support is desired (but not necessarily possible on the current platform)
if [ modules.peek : NT ] && --i-agree-to-the-vendor-licenses in [ modules.peek : ARGV ]
{
feature.feature vendor-api-support : on off : incidental propagated ; # on is the default
}
else
{
feature.feature vendor-api-support : off on : incidental propagated ; # off is the default
}
rule vendor-api-support ( properties * )
{
if [ modules.peek : NT ] && --i-agree-to-the-vendor-licenses in [ modules.peek : ARGV ]
{
return <vendor-api-support>on ;
}
else
{
return <vendor-api-support>off ;
}
}
if ( "--without-binary-msdata" in [ modules.peek : ARGV ] ) # support only text formats like mzML, mzXML, MGF etc
{
echo "NOTICE: building without support for binary msdata formats as requested" ;
}
else if ( "--without-mz5" in [ modules.peek : ARGV ] )
{
echo "NOTICE: building without mz5 support as requested" ;
}
# do we want to skip mz5 support?
rule without-mz5 ( properties * )
{
if --without-mz5 in [ modules.peek : ARGV ]
{
return <location-prefix>without-mz5 <define>WITHOUT_MZ5 ;
}
else
{
return [ without-binary-msdata $(properties) ] ;
}
}
# do we want to skip all binary file formats (vendors and mz5)?
rule without-binary-msdata ( properties * )
{
if --without-binary-msdata in [ modules.peek : ARGV ]
{
return <location-prefix>without-binary-msdata <define>WITHOUT_MZ5 <vendor-api-support>off ;
}
}
path-constant PWIZ_ROOT_PATH : . ;
path-constant PWIZ_BUILD_PATH : build-$(.os:L)-$(.platform:L) ;
path-constant PWIZ_LIBRARIES_PATH : $(libraries_path) ;
import testing ; # needed to enable unit-test rule
import package ; # needed for package install
import path ; # needed for glob, exists, etc.
import project ; # needed for project.current
import errors ;
if --teamcity-test-decoration in [ modules.peek : ARGV ]
{
if [ modules.peek : NT ]
{
TEST_PRECOMMAND = "set pp=##\necho %pp%teamcity[testStarted name='%name%']" ;
TEST_POSTCOMMAND =
"set pp=##\n"
"IF %status% NEQ 0"
"(echo %pp%teamcity[testFailed name='%name%' message='Exit status: %status%'] )\n" # TODO: does testFailed go to stderr? 1>&2
"echo %pp%teamcity[testFinished name='%name%']" ;
TEST_POSTCOMMAND = $(TEST_POSTCOMMAND:J=" ") ;
}
else
{
TEST_PRECOMMAND = "pp=##\necho $pp\"teamcity[testStarted name='$name']\"" ;
TEST_POSTCOMMAND =
"pp=##"
"if test $status -ne 0 ; then"
"echo $pp\"teamcity[testFailed name='$name' message='Exit status: $status']\" ;"
"fi"
"echo $pp\"teamcity[testFinished name='$name']\"" ;
TEST_POSTCOMMAND = $(TEST_POSTCOMMAND:J=\n) ;
}
# put raw commands in global module
modules.poke : TEST_PRECOMMAND : $(TEST_PRECOMMAND) ;
modules.poke : TEST_POSTCOMMAND : $(TEST_POSTCOMMAND) ;
TEAMCITY_TEST_DECORATION = <testing.arg>--teamcity-test-decoration ;
}
# return the itemname if textonly build is off (the default)
rule binary-readers-build ( itemname )
{
if ( ! [ without-binary-msdata ] )
{
return $(itemname) ; # do build binary readers
}
}
# return the itemname if mz5 build is on (the default)
rule mz5-build ( itemname )
{
if ( ! [ without-mz5 ] )
{
return $(itemname) ; # do build mz5
}
}
project pwiz
: requirements
<include>$(PWIZ_ROOT_PATH)
<include>$(PWIZ_LIBRARIES_PATH)/boost_aux
<include>$(boost_src)
<include>$(zlib_src)
<toolset>gcc,<link>shared:<runtime-link>shared
<toolset>darwin,<link>shared:<runtime-link>shared
# any module which links with .NET (either dynamically or statically) must use the shared runtime
<toolset>msvc:<runtime-link>shared
# SEH exceptions crossing native/managed boundaries are problematic with this set to off;
# also, catch(...) will catch SEH exceptions with this on
<toolset>msvc:<asynch-exceptions>on
# special msvc hacks
<toolset>msvc:<define>WIN32 # windows
<toolset>msvc:<define>_CRT_SECURE_NO_DEPRECATE # don't deprecate the standard library
<toolset>msvc:<define>_SCL_SECURE_NO_DEPRECATE # don't deprecate the standard library
<toolset>msvc:<define>_USE_MATH_DEFINES # for M_PI in <cmath>
<toolset>msvc:<define>BOOST_ALL_NO_LIB # disable auto-link
<toolset>msvc:<cxxflags>/wd4100 # warning: unreferenced formal parameter
<toolset>msvc:<cxxflags>/wd4512 # warning: assignment operator could not be generated
<toolset>msvc:<cxxflags>/wd4127 # warning: conditional expression is constant (boost::lexical_cast)
<toolset>msvc:<cxxflags>/wd4701 # warning: potentially uninitialized local variable 'result' used (boost::lexical_cast, debug)
<toolset>msvc:<cxxflags>/wd4245 # warning: conversion from 'type1' to 'type2', signed/unsigned mismatch (boost/filesystem/convenience.hpp)
<toolset>msvc:<cxxflags>/wd4251 # warning: class needs to have dll-interface to be used by clients of class
<toolset>msvc:<cxxflags>/wd4267 # warning: conversion from 'type1' to 'type2', possible loss of data (boost::lexical_cast)
<toolset>msvc:<cxxflags>/wd4244 # warning: conversion from 'int' to 'unsigned short', possible loss of data (boost/date_time/microsec_time_clock.hpp)
<toolset>msvc:<cxxflags>/wd4275 # warning: non dll-interface class 'base' used as base for dll-interface class 'derived'
<toolset>msvc:<cxxflags>/wd4702 # warning: unreachable code (boost::lexical_cast)
#just test to handle SE exception
<toolset>msvc:<cxxflags>"/EHa"
<toolset>msvc,<debug-symbols>off:<linkflags>/OPT:REF,ICF
<toolset>msvc,<toolset-msvc:version>12.0:<define>_HAS_TR1
<conditional>@secure-scl-throws
# special gcc hack - Cygwin gcc 3.4.4, Ubuntu gcc 4.1.2
# warning: '__cur' might be used uninitialized in this function
<toolset>gcc:<cxxflags>-Wno-uninitialized
# starting with gcc 4.8, gcc is extremely verbose about unused typedefs; heavily used in Boost concept checks
<toolset>gcc:<cxxflags>-Wno-unused-local-typedefs
# special Cygwin gcc-3.4.4 hack
# linker "multiple definition" error on inclusion of boost-1.34.1 filesystem headers
<toolset>gcc-3.4.4:<linkflags>-Wl,--allow-multiple-definition
<toolset>gcc-mingw-3.4.5:<linkflags>-Wl,--allow-multiple-definition
<toolset-gcc:flavor>mingw:<linkflags>-Wl,--allow-multiple-definition
# allow "long long" even with -pedantic
<toolset>gcc:<cxxflags>-Wno-long-long
<toolset>darwin:<cxxflags>-Wno-long-long
<toolset>darwin:<cxxflags>-std=c++11
<toolset>clang:<cxxflags>-std=c++11
# any GCC executable that uses shared libraries must have all its code built with -fPIC
<conditional>@static-with-fpic
# mz5 support?
<conditional>@without-mz5
# msdata text only?
<conditional>@without-binary-msdata
# don't call 'strip' -- causes 'Bus error' in some cases
# e.g. find_if with inline predicate
<toolset>darwin:<debug-symbols>on
# use of boost::thread requires multithreaded runtime
<threading>multi
# change boost debug assertions to exceptions by force including Exception.hpp
<variant>debug,<toolset>msvc:<cxxflags>/FIpwiz/utility/misc/Exception.hpp
<variant>debug,<toolset>gcc:<cxxflags>"-include pwiz/utility/misc/Exception.hpp"
<variant>debug,<toolset>darwin:<cxxflags>"-include pwiz/utility/misc/Exception.hpp"
$(TEAMCITY_TEST_DECORATION)
: build-dir $(PWIZ_BUILD_PATH)
: usage-requirements
<include>.
: default-build
release
<link>static
<runtime-link>static
#<warnings-as-errors>on
<warnings>all
<threading>multi
;
# external library declarations
lib pthread
: # sources
: # requirements
<name>pthread
<link>shared
<toolset>gcc:<linkflags>-pthread # sometimes segfault without this -- dk
: # default-build
: # usage-requirements
<toolset>gcc:<linkflags>-pthread # sometimes segfault without this -- dk
;
lib fftw3 : : <threading>multi <search>$(PWIZ_LIBRARIES_PATH)/fftw-3.1.2/.libs : : <include>$(PWIZ_LIBRARIES_PATH)/fftw-3.1.2/api ;
lib fftw3 : : <threading>multi <toolset>msvc <name>libfftw3-3 <search>$(PWIZ_LIBRARIES_PATH) : : <include>$(PWIZ_LIBRARIES_PATH)/fftw-3.1.2/api ;
alias svm : $(PWIZ_LIBRARIES_PATH)/libsvm-3.0//svm ;
modules.poke : BOOST_BUILD_PATH : [ modules.peek : BOOST_BUILD_PATH ] $(PWIZ_LIBRARIES_PATH) ;
# get version info (used for tarball filenames)
import svnrev ;
import generate-version ;
constant PWIZ_MAJOR : 3 ;
constant PWIZ_MINOR : 0 ;
generate-version.cpp $(PWIZ_ROOT_PATH)/pwiz/data/msdata/Version.cpp : pwiz msdata : $(PWIZ_MAJOR) : $(PWIZ_MINOR) :
[ path.glob $(PWIZ_ROOT_PATH)/pwiz/data/msdata
$(PWIZ_ROOT_PATH)/pwiz/utility/misc
$(PWIZ_ROOT_PATH)/pwiz/utility/minimxml
$(PWIZ_ROOT_PATH)/pwiz/data/vendor_readers/ABI
$(PWIZ_ROOT_PATH)/pwiz/data/vendor_readers/ABI/T2D
$(PWIZ_ROOT_PATH)/pwiz/data/vendor_readers/Agilent
$(PWIZ_ROOT_PATH)/pwiz/data/vendor_readers/Bruker
$(PWIZ_ROOT_PATH)/pwiz/data/vendor_readers/Waters
$(PWIZ_ROOT_PATH)/pwiz/data/vendor_readers/Thermo
$(PWIZ_ROOT_PATH)/pwiz_aux/msrc/utility/vendor_api/ABI
$(PWIZ_ROOT_PATH)/pwiz_aux/msrc/utility/vendor_api/ABI/T2D
$(PWIZ_ROOT_PATH)/pwiz_aux/msrc/utility/vendor_api/Agilent
$(PWIZ_ROOT_PATH)/pwiz_aux/msrc/utility/vendor_api/Bruker
$(PWIZ_ROOT_PATH)/pwiz_aux/msrc/utility/vendor_api/thermo
$(PWIZ_ROOT_PATH)/pwiz_aux/msrc/utility/vendor_api/Waters
: *.?pp *.h Jamfile.jam *.manifest* : Version.cpp
] ;
generate-version.cpp $(PWIZ_ROOT_PATH)/pwiz/analysis/Version.cpp : pwiz analysis : $(PWIZ_MAJOR) : $(PWIZ_MINOR) :
[ path.glob-tree $(PWIZ_ROOT_PATH)/pwiz/analysis
$(PWIZ_ROOT_PATH)/pwiz/utility/math
$(PWIZ_ROOT_PATH)/pwiz/utility/misc
$(PWIZ_ROOT_PATH)/pwiz/utility/minimxml
: *.?pp Jamfile.jam : Version.cpp
] ;
generate-version.cpp $(PWIZ_ROOT_PATH)/pwiz/data/identdata/Version.cpp : pwiz identdata : $(PWIZ_MAJOR) : $(PWIZ_MINOR) :
[ path.glob-tree $(PWIZ_ROOT_PATH)/pwiz/data/identdata
$(PWIZ_ROOT_PATH)/pwiz/utility/misc
$(PWIZ_ROOT_PATH)/pwiz/utility/minimxml
: *.?pp Jamfile.jam : Version.cpp
] ;
generate-version.cpp $(PWIZ_ROOT_PATH)/pwiz/data/tradata/Version.cpp : pwiz tradata : $(PWIZ_MAJOR) : $(PWIZ_MINOR) :
[ path.glob-tree $(PWIZ_ROOT_PATH)/pwiz/data/tradata
$(PWIZ_ROOT_PATH)/pwiz/utility/misc
$(PWIZ_ROOT_PATH)/pwiz/utility/minimxml
: *.?pp Jamfile.jam : Version.cpp
] ;
generate-version.cpp $(PWIZ_ROOT_PATH)/pwiz/data/proteome/Version.cpp : pwiz proteome : $(PWIZ_MAJOR) : $(PWIZ_MINOR) :
[ path.glob $(PWIZ_ROOT_PATH)/pwiz/data/proteome : *.?pp Jamfile.jam : Version.cpp ] ;
# TODO: collecting global revision info should use revision info that's already been collected;
# TODO: especially for things like SeeMS which have some MSVC-generated files that aren't versioned
local revision-info =
[ generate-version.cpp $(PWIZ_ROOT_PATH)/pwiz/Version.cpp : pwiz : $(PWIZ_MAJOR) : $(PWIZ_MINOR) :
$(PWIZ_ROOT_PATH)/Jamroot.jam
[ path.glob $(PWIZ_ROOT_PATH)/libraries : *.jam ]
[ path.glob-tree $(PWIZ_ROOT_PATH)/pwiz
$(PWIZ_ROOT_PATH)/pwiz_aux/msrc
$(PWIZ_ROOT_PATH)/pwiz_tools/commandline
$(PWIZ_ROOT_PATH)/pwiz_tools/common
$(PWIZ_ROOT_PATH)/pwiz_tools/examples
$(PWIZ_ROOT_PATH)/pwiz_tools/SeeMS
$(PWIZ_ROOT_PATH)/pwiz_tools/MSConvertGUI
$(PWIZ_ROOT_PATH)/pwiz_tools/sld
$(PWIZ_ROOT_PATH)/scripts/wix
: *.?pp *.h *.jam *.cs *.manifest* *.wxs.template
: tar.excluded Version.cpp Resources.Designer.cs Settings.Designer.cs *DataSet.Designer.cs AssemblyInfo.*
]
: warn-on-missing
#: print-revision-info
] ;
# revision-info is a sequence: <max revision> <max year> <max month> <max day> <number of modified files in working copy>
local year = $(revision-info[2]) ;
local month = $(revision-info[3]) ;
local day = $(revision-info[4]) ;
constant PWIZ_SVNREV : $(revision-info[1]) ;
constant PWIZ_SVNREVDATE : "(last committed change: $(year)-$(month)-$(day))" ;
import numbers ;
if [ numbers.less 32000 $(PWIZ_SVNREV) ]
{
errors.error "out of range SVN revision $(PWIZ_SVNREV)." ;
}
version-tag = $(PWIZ_MAJOR) $(PWIZ_MINOR) $(PWIZ_SVNREV) ;
if $(revision-info[5]) > 0
{
version-tag += "modified" ;
echo NOTICE: WORKING COPY HAS $(revision-info[5]) MODIFIED FILES. ;
}
constant PWIZ_VERSION_TAG : $(version-tag:J=.) ;
echo ProteoWizard $(version-tag:J=.) $(PWIZ_SVNREVDATE:J=) $(PLATFORM) $(PROCESSOR_ARCHITECTURE) ;
# create a VERSION file which can be used by TC to parse the canonical pwiz version
make VERSION : : @make_VERSION : <location>$(PWIZ_BUILD_PATH) ;
actions make_VERSION { @($(STDOUT):E=$(version-tag:J=.)) > "$(<)" }
import tar ;
using tar ;
if ! [ without-mz5 ]
{
tar.extract $(PWIZ_LIBRARIES_PATH)/hdf5-1.8.7.tar.bz2 : *.c* *.h* *.jam *.settings : <location>$(PWIZ_LIBRARIES_PATH) ;
}
path-constant BOOST_SOURCE : $(boost_src) ;
path-constant ZLIB_SOURCE : $(zlib_src) ;
path-constant GD_SOURCE : $(PWIZ_LIBRARIES_PATH)/libgd-2.1.0alpha ;
path-constant PNG_SOURCE : $(PWIZ_LIBRARIES_PATH)/libpng-1.5.6 ;
path-constant FREETYPE_SOURCE : $(PWIZ_LIBRARIES_PATH)/freetype-2.4.7 ;
path-constant EXPAT_SOURCE : $(PWIZ_LIBRARIES_PATH)/expat-2.0.1 ;
using ext-boost : $(BOOST_VERSION:J=.) : $(BOOST_SOURCE) : <zlib-src-location>$(ZLIB_SOURCE) ;
if [ modules.peek : NT ]
{
import path ;
if ( ! --incremental in [ modules.peek : ARGV ] ) && ! [ without-binary-msdata ]
{
# extract the vendor APIs if the user agrees to the licenses
if --i-agree-to-the-vendor-licenses in [ modules.peek : ARGV ]
{
echo "Extracting vendor APIs..." ;
SHELL "$(PWIZ_LIBRARIES_PATH)\\7za.exe x -aoa -pi-agree-to-the-vendor-licenses -o$(PWIZ_ROOT_PATH)\\pwiz_aux\\msrc\\utility $(PWIZ_ROOT_PATH)\\pwiz_aux\\msrc\\utility\\vendor_api_ABI.7z" ;
SHELL "$(PWIZ_LIBRARIES_PATH)\\7za.exe x -aoa -pi-agree-to-the-vendor-licenses -o$(PWIZ_ROOT_PATH)\\pwiz_aux\\msrc\\utility $(PWIZ_ROOT_PATH)\\pwiz_aux\\msrc\\utility\\vendor_api_Agilent.7z" ;
SHELL "$(PWIZ_LIBRARIES_PATH)\\7za.exe x -aoa -pi-agree-to-the-vendor-licenses -o$(PWIZ_ROOT_PATH)\\pwiz_aux\\msrc\\utility $(PWIZ_ROOT_PATH)\\pwiz_aux\\msrc\\utility\\vendor_api_Bruker.7z" ;
SHELL "$(PWIZ_LIBRARIES_PATH)\\7za.exe x -aoa -pi-agree-to-the-vendor-licenses -o$(PWIZ_ROOT_PATH)\\pwiz_aux\\msrc\\utility $(PWIZ_ROOT_PATH)\\pwiz_aux\\msrc\\utility\\vendor_api_Shimadzu.7z" ;
SHELL "$(PWIZ_LIBRARIES_PATH)\\7za.exe x -aoa -pi-agree-to-the-vendor-licenses -o$(PWIZ_ROOT_PATH)\\pwiz_aux\\msrc\\utility $(PWIZ_ROOT_PATH)\\pwiz_aux\\msrc\\utility\\vendor_api_Thermo.7z" ;
SHELL "$(PWIZ_LIBRARIES_PATH)\\7za.exe x -aoa -pi-agree-to-the-vendor-licenses -o$(PWIZ_ROOT_PATH)\\pwiz_aux\\msrc\\utility $(PWIZ_ROOT_PATH)\\pwiz_aux\\msrc\\utility\\vendor_api_Waters.7z" ;
RESCAN ;
}
else
{
echo "NOTICE: not extracting vendor APIs; use --i-agree-to-the-vendor-licenses to extract and use them." ;
}
}
# overwrite the original header files because of MSVC looking in the current header's path with #include "foo"
# HACK: bug in boost::interprocess (up to at least 1.55) requires a patch to support opening memory-mapped files with UTF-8 filenames
# Boost bug ticket: https://svn.boost.org/trac/boost/ticket/4335
#SHELL "@IF NOT EXIST $(BOOST_SOURCE)\\boost\\interprocess\\detail\\os_file_functions.hpp.bak rename $(BOOST_SOURCE)\\boost\\interprocess\\detail\\os_file_functions.hpp os_file_functions.hpp.bak" ;
SHELL "@IF NOT EXIST $(BOOST_SOURCE)\\boost\\interprocess\\detail\\win32_api.hpp.bak rename $(BOOST_SOURCE)\\boost\\interprocess\\detail\\win32_api.hpp win32_api.hpp.bak" ;
#SHELL "@copy /Y $(PWIZ_LIBRARIES_PATH)\\boost_aux\\boost\\interprocess\\detail\\os_file_functions.hpp $(BOOST_SOURCE)\\boost\\interprocess\\detail" ;
SHELL "@copy /Y $(PWIZ_LIBRARIES_PATH)\\boost_aux\\boost\\interprocess\\detail\\win32_api.hpp $(BOOST_SOURCE)\\boost\\interprocess\\detail" ;
}
rule project-exists ( project-path )
{
if [ path.exists $(project-path) ] &&
[ path.glob $(project-path) : [Jj]amroot.jam [Jj]amfile.jam [Jj]amroot [Jj]amfile ]
{
return true ;
}
else
{
return ;
}
}
# to make subsetting the source tree much easier,
# use these rules to test that a sub-project path exists before building it
rule build-project-if-exists ( project-path )
{
local project = [ project.current ] ;
local p = [ path.native [ path.join [ $(project).location ] $(project-path) ] ] ;
if [ project-exists $(p) ]
{
local attributes = [ project.attributes [ $(project).name ] ] ;
local now = [ $(attributes).get projects-to-build ] ;
$(attributes).set projects-to-build : $(now) $(project-path) ;
}
}
rule run-if-exists ( sources + : args * : input-files * : requirements * : target-name ? : default-build * )
{
local project = [ project.current ] ;
local full-path = [ path.native [ path.join [ $(project).location ] $(project-path) $(sources[1]) ] ] ;
if [ path.exists $(full-path) ]
{
return [ run $(sources) : $(args) : $(input-files) : $(requirements) : $(target-name) : $(default-build) ] ;
}
}
rule run-fail-if-exists ( sources + : args * : input-files * : requirements * : target-name ? : default-build * )
{
local project = [ project.current ] ;
local full-path = [ path.native [ path.join [ $(project).location ] $(project-path) $(sources[1]) ] ] ;
if [ path.exists $(full-path) ]
{
return [ run-fail $(sources) : $(args) : $(input-files) : $(requirements) : $(target-name) : $(default-build) ] ;
}
}
rule unit-test-if-exists ( target : sources + : properties * )
{
local project = [ project.current ] ;
local full-path = [ path.native [ path.join [ $(project).location ] $(project-path) $(sources[1]) ] ] ;
if [ path.exists $(full-path) ]
{
return [ unit-test $(target) : $(sources) : $(properties) ] ;
}
}
# build/install
build-project-if-exists pwiz ;
build-project-if-exists pwiz_aux ;
build-project-if-exists pwiz_tools ;
rule install-location ( properties * )
{
local toolsets = [ feature.get-values <toolset> : $(properties) ] ;
local variants = [ feature.get-values <variant> : $(properties) ] ;
local location = [ path.make $(PWIZ_BUILD_PATH)/$(toolsets[1])-$(variants[1]) ] ;
if <link>shared in $(properties) { location = $(location)-shared ; }
if <address-model>64 in $(properties) { location = $(location)-x86_64 ; }
return <location>$(location) ;
}
rule install-type ( properties * )
{
local result = <install-type>EXE ;
if <link>shared in $(properties)
{
result += <install-dependencies>on <install-type>SHARED_LIB <install-type>MANIFEST ;
}
return $(result) ;
}
rule install-vendor-api-dependencies ( properties * )
{
properties = $(properties) [ vendor-api-support $(properties) ] ;
local location = [ install-location $(properties) ] ;
local dependencies ;
if <toolset>msvc in $(properties) && <link>static in $(properties) && ! [ without-binary-msdata ]
{
if [ path.exists pwiz_aux/msrc/utility/vendor_api/ABI ] { dependencies += <dependency>pwiz_aux/msrc/utility/vendor_api/ABI//install_pwiz_vendor_api_abi/$(location) ; }
if [ path.exists pwiz_aux/msrc/utility/vendor_api/ABI/T2D ] { dependencies += <dependency>pwiz_aux/msrc/utility/vendor_api/ABI/T2D//install_pwiz_vendor_api_abi_t2d/$(location) ; }
if [ path.exists pwiz_aux/msrc/utility/vendor_api/Agilent ] { dependencies += <dependency>pwiz_aux/msrc/utility/vendor_api/Agilent//install_pwiz_vendor_api_agilent/$(location) ; }
if [ path.exists pwiz_aux/msrc/utility/vendor_api/Bruker ] { dependencies += <dependency>pwiz_aux/msrc/utility/vendor_api/Bruker//install_pwiz_vendor_api_bruker/$(location) ; }
if [ path.exists pwiz_aux/msrc/utility/vendor_api/Shimadzu ] { dependencies += <dependency>pwiz_aux/msrc/utility/vendor_api/Shimadzu//install_pwiz_vendor_api_shimadzu/$(location) ; }
if [ path.exists pwiz_aux/msrc/utility/vendor_api/thermo ] { dependencies += <dependency>pwiz_aux/msrc/utility/vendor_api/thermo//install_pwiz_vendor_api_thermo/$(location) ; }
if [ path.exists pwiz_aux/msrc/utility/vendor_api/UIMF ] { dependencies += <dependency>pwiz_aux/msrc/utility/vendor_api/UIMF//install_pwiz_vendor_api_uimf/$(location) ; }
if [ path.exists pwiz_aux/msrc/utility/vendor_api/Waters ] { dependencies += <dependency>pwiz_aux/msrc/utility/vendor_api/Waters//install_pwiz_vendor_api_waters/$(location) ; }
if <vendor-api-support>on in $(properties) { dependencies += <dependency>pwiz_tools/prototype//ThermoRawMetaDumpInstall/$(location) ; }
}
return $(dependencies) ;
}
rule install-identdata-dependencies ( properties * )
{
local location = [ install-location $(properties) ] ;
local dependencies ;
if [ path.exists pwiz/data/identdata ] { dependencies += <dependency>pwiz/data/identdata//install_pwiz_identdata/$(location) ; }
return $(dependencies) ;
}
rule pwiz-bindings-dependency ( properties * )
{
if <toolset>msvc in $(properties)
{
local variants = [ feature.get-values <variant> : $(properties) ] ;
local location = <location>$(PWIZ_BUILD_PATH)/obj/$(PLATFORM)/$(variants[1]) ;
return <assembly>$(PWIZ_ROOT_PATH)/pwiz/utility/bindings/CLI//pwiz_bindings_cli
<dependency>$(PWIZ_ROOT_PATH)/pwiz/utility/bindings/CLI//pwiz_bindings_cli/$(location)
<dependency>$(PWIZ_ROOT_PATH)/pwiz/utility/bindings/CLI//pwiz_bindings_cli.xml/$(location) ;
}
}
rule dotNET-dependencies ( properties * )
{
if <toolset-msvc:version>12.0 in $(properties)
{
local location = [ install-location $(properties) ] ;
return <dependency>pwiz_tools/MSConvertGUI//MSConvertGUI.exe/$(location)
<dependency>pwiz_tools/SeeMS//seems.exe/$(location) ;
}
}
rule gcc-install-dll-path ( properties * )
{
if <toolset>gcc in $(properties) && <link>shared in $(properties) && <target-os>linux in $(properties)
{
return <dll-path>'$ORIGIN' ;
}
}
install executables
: pwiz_tools/commandline
pwiz_tools/sld//sldout
pwiz_tools/examples//example_tools
: <conditional>@install-type
<conditional>@install-location
<conditional>@install-identdata-dependencies
<conditional>@install-vendor-api-dependencies
<conditional>@dotNET-dependencies
<conditional>@gcc-install-dll-path
<dependency>VERSION
;
install package_docs
: doc/package/readme.txt
: <conditional>@install-location
;
# convenient test targets
install msconvert
: pwiz_tools/commandline//msconvert
: <conditional>@install-type
<conditional>@install-location
<conditional>@install-identdata-dependencies
<conditional>@install-vendor-api-dependencies
<conditional>@gcc-install-dll-path
;
explicit msconvert ;
install idconvert
: pwiz_tools/commandline//idconvert
: <conditional>@install-type
<conditional>@install-location
<conditional>@install-identdata-dependencies
<conditional>@install-vendor-api-dependencies
<conditional>@gcc-install-dll-path
;
explicit idconvert ;
alias all-tests : pwiz pwiz_tools pwiz_aux ;
# for copying all libraries and headers to one dir each
alias libraries : install-pwiz-lib install-boost-headers ;
explicit libraries ;
# default install location
local default-prefix = /usr/local ; # LINUX, MACOS
if [ modules.peek : NT ] { default-prefix = "C:\\" ; }
# set the default option value to be used when building the lib tarball
option.set prefix : $(default-prefix) ;
local headers = [ path.glob-tree pwiz : *.h *.hpp : .svn ] ;
package.install install-pwiz-lib
: <install-source-root>$(PWIZ_ROOT_PATH)
: # executables
: pwiz
: $(headers)
;
explicit install-pwiz-lib ;
# move boost headers separately because install-source-root is different
local boost_headers = [ path.glob-tree $(BOOST_SOURCE)/boost : *.h *.hpp : .svn ] ;
package.install install-boost-headers
: <install-source-root>$(BOOST_SOURCE)
: # exe
: # lib
: $(boost_headers)
;
explicit install-boost-headers ;
# warning: _SECURE_SCL_THROWS is deprecated
# checked iterators throw instead of crash
rule secure-scl-throws ( properties * )
{
if <toolset>msvc in $(properties) &&
! ( <toolset-msvc:version>11.0 in $(properties) ) &&
! ( <toolset-msvc:version>12.0 in $(properties) )
{
return <define>_SILENCE_DEPRECATION_OF_SECURE_SCL_THROWS
<define>_SECURE_SCL_THROWS=1 ;
}
}
# any GCC executable that uses shared libraries must have all its code built with -fPIC
rule static-with-fpic ( properties * )
{
if ( <toolset>gcc in $(properties) || <toolset>darwin in $(properties) ) &&
<link>static in $(properties)
{
return <cflags>-fPIC <cxxflags>-fPIC <linkflags>-fPIC ;
}
}
# predicate for use as a <conditional> requirement of targets that must only build with MSVC
rule msvc-requirement ( properties * )
{
if ! <toolset>msvc in $(properties) { return <build>no ; }
}
# predicate for use as a <conditional> requirement of targets that must only build with MSVC and current .NET Framework
rule msvc-dotnet-requirement ( properties * )
{
# require VS 2013 because of .NET Framework version
if ! ( <toolset-msvc:version>12.0 in $(properties) )
{ return <build>no ; }
}
# predicate for use as a <conditional> requirement of targets that must only build with non-express version of MSVC
rule no-express-requirement ( properties * )
{
# only the latest, non-express version of MSVC
if ! <toolset-msvc:version>12.0 in $(properties) { return <build>no ; }
if 12.0express in $(properties:G=) { return <build>no ; }
}
# special support for MSFileReader on Windows
if [ modules.peek : NT ]
{
# can't build or run 64-bit version on Windows 32-bit OS
import os ;
local ProgramFiles = [ os.environ ProgramFiles ] ;
local ProgramFilesX86 = [ os.environ "ProgramFiles(x86)" ] ;
ProgramFilesX86 = $(ProgramFilesX86:E=$(ProgramFiles)) ;
if ( [ MATCH (x64) : $(PLATFORM) ] )
{
# HACK: we can't just look at the PROCESSOR_ARCHITECTURE environment variable, because it is
# set to "x86" even on a 64-bit machine, probably because bjam is running in 32-bit mode
if ( ! $(ProgramFilesX86) && [ MATCH (x86) : $(ProgramFiles) ] ) # infer 64-bit machine from (x86) appended to ProgramFiles
{
EXIT "\n*** ERROR: It is not possible to build or run a 64-bit build on 32-bit Windows." ;
}
# MSFileReader install directory
constant ProgramFilesLibs : "C:\\Program Files" ;
constant MSFILEREADER_SUFFIX : "_x64" ;
}
else
{
# MSFileReader install directory
constant ProgramFilesLibs : "$(ProgramFilesX86)" ;
constant MSFILEREADER_SUFFIX : "" ;
}
constant MSFILEREADER_INSTALL_DIR : "$(ProgramFilesLibs)\\Thermo\\MSFileReader" ;
} # if NT
# HACK: find location of WiffFileDataReader DLLs (it must be in Jamroot so both vendor_readers and vendor_api can use it)
rule wiff-dll-location ( api-path : properties * )
{
# .NET 4 DLLs should work for anything .NET 4 or greater (hopefully); there's no Boost.Build property for .NET version
local result = $(api-path) ;
if --i-agree-to-the-vendor-licenses in [ modules.peek : ARGV ] &&
[ path.exists $(result)\\Clearcore2.Data.WiffReader.dll ]
{
return $(result) ;
}
}
rule bruker-dll-location ( api-path : properties * )
{
local result ;
if ( [ MATCH (x64) : $(PLATFORM) ] )
{
result = $(api-path)\\x64 ;
}
else
{
result = $(api-path)\\x86 ;
}
if --i-agree-to-the-vendor-licenses in [ modules.peek : ARGV ] &&
$(result) &&
[ path.exists $(result)\\CompassXtractMS.dll ]
{
return $(result) ;
}
}
rule shimadzu-dll-location ( api-path : properties * )
{
local result ;
if ( [ MATCH (x64) : $(PLATFORM) ] )
{
result = $(api-path)\\x64 ;
}
else
{
result = $(api-path)\\x86 ;
}
if --i-agree-to-the-vendor-licenses in [ modules.peek : ARGV ] &&
$(result) &&
[ path.exists $(result)\\DataReader.dll ]
{
return $(result) ;
}
}
rule mhdac-dll-location ( api-path : properties * )
{
local result ;
if ( [ MATCH (x64) : $(PLATFORM) ] )
{
result = $(api-path)\\x64 ;
}
else
{
result = $(api-path)\\x86 ;
}
if --i-agree-to-the-vendor-licenses in [ modules.peek : ARGV ] &&
$(result) &&
[ path.exists $(result)\\MassSpecDataReader.dll ]
{
return $(result) ;
}
}
rule uimf-dll-location ( api-path : properties * )
{
local result ;
if <toolset-msvc:version>9.0 in $(properties) ||
<toolset-msvc:version>9.0express in $(properties)
{
# not supported
}
else # VC10 DLLs should work for VC11 as well (it's dependent on .NET version)
{
if ( [ MATCH (x64) : $(PLATFORM) ] )
{
result = $(api-path)\\x64 ;
}
else
{
result = $(api-path)\\x86 ;
}
}
if --i-agree-to-the-vendor-licenses in [ modules.peek : ARGV ] &&
[ path.exists $(result)\\UIMFLibrary.dll ]
{
return $(result) ;
}
}
rule masslynxraw-dll-location ( api-path : properties * )
{
local result ;
if <toolset>msvc in $(properties) &&
<runtime-debugging>off
{
if <toolset-msvc:version>12.0 in $(properties) ||
<toolset-msvc:version>12.0express in $(properties)
{
if ( [ MATCH (x64) : $(PLATFORM) ] )
{
result = $(api-path)\\vc12_x64 ;
}
else
{
result = $(api-path)\\vc12_x86 ;
}
}
# else we don't have DLLs for this MSVC version (it's dependent on CRT version)
}
if --i-agree-to-the-vendor-licenses in [ modules.peek : ARGV ] &&
$(result) &&
[ path.exists $(result)\\MassLynxRaw.dll ]
{
return $(result) ;
}
}
rule msparser-path ( properties * )
{
# Assign the most likely msparser library path
local msparser_path_arg = [ MATCH --msparser-path=(.*) : [ modules.peek : ARGV ] ] ;
local lib-location ;
if $(msparser_path_arg)
{
lib-location = $(msparser_path_arg) ;
}
else if <toolset>msvc in $(properties)
{
if [ feature.get-values <toolset-msvc:version> : $(properties) ] in "9.0" "9.0express"
{
lib-location = "$(ProgramFilesLibs)\\Matrix Science\\Mascot Parser\\vs2008" ;
}
else if [ feature.get-values <toolset-msvc:version> : $(properties) ] in "10.0" "10.0express"
{
lib-location = "$(ProgramFilesLibs)\\Matrix Science\\Mascot Parser\\vs2010" ;
}
else if [ feature.get-values <toolset-msvc:version> : $(properties) ] in "11.0" "11.0express"
{
lib-location = "$(ProgramFilesLibs)\\Matrix Science\\Mascot Parser\\vs2012" ;
}
else if [ feature.get-values <toolset-msvc:version> : $(properties) ] in "12.0" "12.0express"
{
lib-location = "$(ProgramFilesLibs)\\Matrix Science\\Mascot Parser\\vs2013" ;
}
}
else if <toolset>gcc in $(properties)
{
lib-location = "/usr/local/msparser/gnu" ;
}
if [ without-binary-msdata ]
{
if ! $(.warn-once)
{
.warn-once = true ;
echo "Not using Mascot Parser due to --without-binary-msdata ." ;
}
}
# Check for msparser existence.
else if <toolset>msvc in $(properties) && [ path.exists $(lib-location)/lib/msparser.lib ]
{
if ! $(.warn-once)
{
.warn-once = true ;
echo "Using Mascot Parser in $(lib-location)" ;
}
return $(lib-location) ;
}
else if <toolset>gcc in $(properties) && [ path.exists $(lib-location)/lib/libmsparser.a ]
{
if ! $(.warn-once)
{
.warn-once = true ;
echo "Using Mascot Parser in $(lib-location)" ;
}
return $(lib-location) ;
}
else if ! $(.warn-once)
{
.warn-once = true ;