]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/tools/build/src/tools/pgi.jam
bump version to 18.2.2-pve1
[ceph.git] / ceph / src / boost / tools / build / src / tools / pgi.jam
1 # Copyright Noel Belcourt 2007.
2 # Copyright 2017, NVIDIA CORPORATION.
3 # Distributed under the Boost Software License, Version 1.0.
4 # (See accompanying file LICENSE.txt or copy at
5 # https://www.bfgroup.xyz/b2/LICENSE.txt)
6
7 import property ;
8 import generators ;
9 import os ;
10 import toolset : flags ;
11 import feature ;
12 import fortran ;
13 import type ;
14 import common ;
15 import gcc ;
16
17 feature.extend toolset : pgi ;
18 toolset.inherit pgi : unix ;
19 generators.override pgi.prebuilt : builtin.lib-generator ;
20 generators.override pgi.searched-lib-generator : searched-lib-generator ;
21
22 # Documentation and toolchain description located
23 # http://www.pgroup.com/resources/docs.htm
24
25 rule init ( version ? : command * : options * )
26 {
27 local condition = [ common.check-init-parameters pgi : version $(version) ] ;
28
29 local l_command = [ common.get-invocation-command pgi : pgc++ : $(command) ] ;
30
31 common.handle-options pgi : $(condition) : $(l_command) : $(options) ;
32
33 command_c = $(command_c[1--2]) $(l_command[-1]:B=pgcc) ;
34
35 toolset.flags pgi CONFIG_C_COMMAND $(condition) : $(command_c) ;
36
37 flags pgi.compile DEFINES $(condition) :
38 [ feature.get-values <define> : $(options) ] : unchecked ;
39
40 # set link flags
41 flags pgi.link FINDLIBS-ST : [
42 feature.get-values <find-static-library> : $(options) ] : unchecked ;
43 }
44
45 # Declare generators
46 generators.register-c-compiler pgi.compile.c : C : OBJ : <toolset>pgi ;
47 generators.register-c-compiler pgi.compile.c++ : CPP : OBJ : <toolset>pgi ;
48 generators.register-fortran-compiler pgi.compile.fortran : FORTRAN : OBJ : <toolset>pgi ;
49
50 # Declare flags and actions for compilation
51 flags pgi.compile.c++ OPTIONS <cxxstd>98 : -std=c++03 ;
52 flags pgi.compile.c++ OPTIONS <cxxstd>03 : -std=c++03 ;
53 flags pgi.compile.c++ OPTIONS <cxxstd>0x : -std=c++11 ;
54 flags pgi.compile.c++ OPTIONS <cxxstd>11 : -std=c++11 ;
55 flags pgi.compile.c++ OPTIONS <cxxstd>1y : -std=c++14 ;
56 flags pgi.compile.c++ OPTIONS <cxxstd>14 : -std=c++14 ;
57 flags pgi.compile.c++ OPTIONS <cxxstd>1z : -std=c++17 ;
58 flags pgi.compile.c++ OPTIONS <cxxstd>17 : -std=c++17 ;
59 flags pgi.compile.c++ OPTIONS <cxxstd>2a : -std=c++17 ;
60 flags pgi.compile.c++ OPTIONS <cxxstd>20 : -std=c++17 ;
61 flags pgi.compile.c++ OPTIONS <cxxstd>latest : -std=c++17 ;
62
63 flags pgi.compile OPTIONS <link>shared : -fpic ;
64 flags pgi.compile OPTIONS <debug-symbols>on : -gopt ;
65 flags pgi.compile OPTIONS <optimization>off : -O0 ;
66 flags pgi.compile OPTIONS <optimization>speed : -fast ;
67 flags pgi.compile OPTIONS <optimization>space : -fast ;
68
69 flags pgi.compile OPTIONS <warnings>off : -Minform=severe ;
70 flags pgi.compile OPTIONS <warnings>on : -Minform=warn ;
71 flags pgi.compile OPTIONS <warnings>all : -Minform=warn ;
72 flags pgi.compile OPTIONS <warnings>extra : -Minform=inform ;
73 flags pgi.compile OPTIONS <warnings>pedantic : -Minform=inform ;
74 flags pgi.compile OPTIONS <warnings-as-errors>on : -Werror ;
75
76 flags pgi.compile.c++ OPTIONS <rtti>off : --no_rtti ;
77 flags pgi.compile.c++ OPTIONS <exception-handling>off : --no_exceptions ;
78
79 flags pgi.compile OPTIONS <cflags> ;
80 flags pgi.compile.c++ OPTIONS <cxxflags> ;
81 flags pgi.compile DEFINES <define> ;
82 flags pgi.compile INCLUDES <include> ;
83
84 flags pgi.compile.fortran OPTIONS <fflags> ;
85
86 actions compile.c
87 {
88 "$(CONFIG_C_COMMAND)" $(OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" -c -o "$(<)" "$(>)"
89 }
90
91 actions compile.c++
92 {
93 "$(CONFIG_COMMAND)" $(OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" -c -o "$(<)" "$(>)"
94 }
95
96 actions compile.fortran
97 {
98 "$(CONFIG_F_COMMAND)" $(OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" -c -o "$(<)" "$(>)"
99 }
100
101 # Declare flags and actions for linking
102 flags pgi.link OPTIONS <debug-symbols>on : -gopt ;
103 # Strip the binary when no debugging is needed
104 flags pgi.link OPTIONS <debug-symbols>off : -s ;
105 flags pgi.link OPTIONS <linkflags> ;
106 flags pgi.link OPTIONS <link>shared : -fpic ;
107 flags pgi.link LINKPATH <library-path> ;
108 flags pgi.link FINDLIBS-ST <find-static-library> ;
109 flags pgi.link FINDLIBS-SA <find-shared-library> ;
110 flags pgi.link FINDLIBS-SA <threading>multi : pthread rt ;
111 flags pgi.link LIBRARIES <library-file> ;
112 flags pgi.link LINK-RUNTIME <runtime-link>static : static ;
113 flags pgi.link LINK-RUNTIME <runtime-link>shared : dynamic ;
114 flags pgi.link RPATH <dll-path> ;
115
116 rule link ( targets * : sources * : properties * )
117 {
118 SPACE on $(targets) = " " ;
119 }
120
121 actions link bind LIBRARIES
122 {
123 "$(CONFIG_COMMAND)" $(OPTIONS) -L"$(LINKPATH)" -R"$(RPATH)" -o "$(<)" "$(>)" "$(LIBRARIES)" -l$(FINDLIBS-ST) -l$(FINDLIBS-SA)
124 }
125
126 # Slight mods for dlls
127 rule link.dll ( targets * : sources * : properties * )
128 {
129 SPACE on $(targets) = " " ;
130 }
131
132 actions link.dll bind LIBRARIES
133 {
134 "$(CONFIG_COMMAND)" $(OPTIONS) -shared -L"$(LINKPATH)" -R"$(RPATH)" -soname $(<[-1]:D=) -o "$(<)" "$(>)" "$(LIBRARIES)" -l$(FINDLIBS-SA) -l$(FINDLIBS-ST)
135 }
136
137 actions updated together piecemeal pgi.archive
138 {
139 ar -rc$(ARFLAGS:E=) "$(<)" "$(>)"
140 }
141