<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<!--[if IE]><meta http-equiv="X-UA-Compatible" content="IE=edge"><![endif]-->
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="generator" content="Asciidoctor 1.5.7.1">
<meta name="author" content="Rene Rivera">
<meta name="copyright" content="Copyright 2017-2018 Rene Rivera">
<title>C++ Compile</title>
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Open+Sans:300,300italic,400,400italic,600,600italic%7CNoto+Serif:400,400italic,700,700italic%7CDroid+Sans+Mono:400,700">
<style>
/* Asciidoctor default stylesheet | MIT License | http://asciidoctor.org */
/* Uncomment @import statement below to use as custom stylesheet */
/*@import "https://fonts.googleapis.com/css?family=Open+Sans:300,300italic,400,400italic,600,600italic%7CNoto+Serif:400,400italic,700,700italic%7CDroid+Sans+Mono:400,700";*/
article,aside,details,figcaption,figure,footer,header,hgroup,main,nav,section,summary{display:block}
audio,canvas,video{display:inline-block}
audio:not([controls]){display:none;height:0}
script{display:none!important}
html{font-family:sans-serif;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}
a{background:transparent}
a:focus{outline:thin dotted}
a:active,a:hover{outline:0}
h1{font-size:2em;margin:.67em 0}
abbr[title]{border-bottom:1px dotted}
b,strong{font-weight:bold}
dfn{font-style:italic}
hr{-moz-box-sizing:content-box;box-sizing:content-box;height:0}
mark{background:#ff0;color:#000}
code,kbd,pre,samp{font-family:monospace;font-size:1em}
pre{white-space:pre-wrap}
q{quotes:"\201C" "\201D" "\2018" "\2019"}
small{font-size:80%}
sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}
sup{top:-.5em}
sub{bottom:-.25em}
img{border:0}
svg:not(:root){overflow:hidden}
figure{margin:0}
fieldset{border:1px solid silver;margin:0 2px;padding:.35em .625em .75em}
legend{border:0;padding:0}
button,input,select,textarea{font-family:inherit;font-size:100%;margin:0}
button,input{line-height:normal}
button,select{text-transform:none}
button,html input[type="button"],input[type="reset"],input[type="submit"]{-webkit-appearance:button;cursor:pointer}
button[disabled],html input[disabled]{cursor:default}
input[type="checkbox"],input[type="radio"]{box-sizing:border-box;padding:0}
button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0}
textarea{overflow:auto;vertical-align:top}
table{border-collapse:collapse;border-spacing:0}
*,*::before,*::after{-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box}
html,body{font-size:100%}
body{background:#fff;color:rgba(0,0,0,.8);padding:0;margin:0;font-family:"Noto Serif","DejaVu Serif",serif;font-weight:400;font-style:normal;line-height:1;position:relative;cursor:auto;tab-size:4;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}
a:hover{cursor:pointer}
img,object,embed{max-width:100%;height:auto}
object,embed{height:100%}
img{-ms-interpolation-mode:bicubic}
.left{float:left!important}
.right{float:right!important}
.text-left{text-align:left!important}
.text-right{text-align:right!important}
.text-center{text-align:center!important}
.text-justify{text-align:justify!important}
.hide{display:none}
img,object,svg{display:inline-block;vertical-align:middle}
textarea{height:auto;min-height:50px}
select{width:100%}
.center{margin-left:auto;margin-right:auto}
.stretch{width:100%}
.subheader,.admonitionblock td.content>.title,.audioblock>.title,.exampleblock>.title,.imageblock>.title,.listingblock>.title,.literalblock>.title,.stemblock>.title,.openblock>.title,.paragraph>.title,.quoteblock>.title,table.tableblock>.title,.verseblock>.title,.videoblock>.title,.dlist>.title,.olist>.title,.ulist>.title,.qlist>.title,.hdlist>.title{line-height:1.45;color:#7a2518;font-weight:400;margin-top:0;margin-bottom:.25em}
div,dl,dt,dd,ul,ol,li,h1,h2,h3,#toctitle,.sidebarblock>.content>.title,h4,h5,h6,pre,form,p,blockquote,th,td{margin:0;padding:0;direction:ltr}
a{color:#2156a5;text-decoration:underline;line-height:inherit}
a:hover,a:focus{color:#1d4b8f}
a img{border:none}
p{font-family:inherit;font-weight:400;font-size:1em;line-height:1.6;margin-bottom:1.25em;text-rendering:optimizeLegibility}
p aside{font-size:.875em;line-height:1.35;font-style:italic}
h1,h2,h3,#toctitle,.sidebarblock>.content>.title,h4,h5,h6{font-family:"Open Sans","DejaVu Sans",sans-serif;font-weight:300;font-style:normal;color:#ba3925;text-rendering:optimizeLegibility;margin-top:1em;margin-bottom:.5em;line-height:1.0125em}
h1 small,h2 small,h3 small,#toctitle small,.sidebarblock>.content>.title small,h4 small,h5 small,h6 small{font-size:60%;color:#e99b8f;line-height:0}
h1{font-size:2.125em}
h2{font-size:1.6875em}
h3,#toctitle,.sidebarblock>.content>.title{font-size:1.375em}
h4,h5{font-size:1.125em}
h6{font-size:1em}
hr{border:solid #ddddd8;border-width:1px 0 0;clear:both;margin:1.25em 0 1.1875em;height:0}
em,i{font-style:italic;line-height:inherit}
strong,b{font-weight:bold;line-height:inherit}
small{font-size:60%;line-height:inherit}
code{font-family:"Droid Sans Mono","DejaVu Sans Mono",monospace;font-weight:400;color:rgba(0,0,0,.9)}
ul,ol,dl{font-size:1em;line-height:1.6;margin-bottom:1.25em;list-style-position:outside;font-family:inherit}
ul,ol{margin-left:1.5em}
ul li ul,ul li ol{margin-left:1.25em;margin-bottom:0;font-size:1em}
ul.square li ul,ul.circle li ul,ul.disc li ul{list-style:inherit}
ul.square{list-style-type:square}
ul.circle{list-style-type:circle}
ul.disc{list-style-type:disc}
ol li ul,ol li ol{margin-left:1.25em;margin-bottom:0}
dl dt{margin-bottom:.3125em;font-weight:bold}
dl dd{margin-bottom:1.25em}
abbr,acronym{text-transform:uppercase;font-size:90%;color:rgba(0,0,0,.8);border-bottom:1px dotted #ddd;cursor:help}
abbr{text-transform:none}
blockquote{margin:0 0 1.25em;padding:.5625em 1.25em 0 1.1875em;border-left:1px solid #ddd}
blockquote cite{display:block;font-size:.9375em;color:rgba(0,0,0,.6)}
blockquote cite::before{content:"\2014 \0020"}
blockquote cite a,blockquote cite a:visited{color:rgba(0,0,0,.6)}
blockquote,blockquote p{line-height:1.6;color:rgba(0,0,0,.85)}
@media screen and (min-width:768px){h1,h2,h3,#toctitle,.sidebarblock>.content>.title,h4,h5,h6{line-height:1.2}
h1{font-size:2.75em}
h2{font-size:2.3125em}
h3,#toctitle,.sidebarblock>.content>.title{font-size:1.6875em}
h4{font-size:1.4375em}}
table{background:#fff;margin-bottom:1.25em;border:solid 1px #dedede}
table thead,table tfoot{background:#f7f8f7}
table thead tr th,table thead tr td,table tfoot tr th,table tfoot tr td{padding:.5em .625em .625em;font-size:inherit;color:rgba(0,0,0,.8);text-align:left}
table tr th,table tr td{padding:.5625em .625em;font-size:inherit;color:rgba(0,0,0,.8)}
table tr.even,table tr.alt,table tr:nth-of-type(even){background:#f8f8f7}
table thead tr th,table tfoot tr th,table tbody tr td,table tr td,table tfoot tr td{display:table-cell;line-height:1.6}
h1,h2,h3,#toctitle,.sidebarblock>.content>.title,h4,h5,h6{line-height:1.2;word-spacing:-.05em}
h1 strong,h2 strong,h3 strong,#toctitle strong,.sidebarblock>.content>.title strong,h4 strong,h5 strong,h6 strong{font-weight:400}
.clearfix::before,.clearfix::after,.float-group::before,.float-group::after{content:" ";display:table}
.clearfix::after,.float-group::after{clear:both}
*:not(pre)>code{font-size:.9375em;font-style:normal!important;letter-spacing:0;padding:.1em .5ex;word-spacing:-.15em;background-color:#f7f7f8;-webkit-border-radius:4px;border-radius:4px;line-height:1.45;text-rendering:optimizeSpeed;word-wrap:break-word}
*:not(pre)>code.nobreak{word-wrap:normal}
*:not(pre)>code.nowrap{white-space:nowrap}
pre,pre>code{line-height:1.45;color:rgba(0,0,0,.9);font-family:"Droid Sans Mono","DejaVu Sans Mono",monospace;font-weight:400;text-rendering:optimizeSpeed}
em em{font-style:normal}
strong strong{font-weight:400}
.keyseq{color:rgba(51,51,51,.8)}
kbd{font-family:"Droid Sans Mono","DejaVu Sans Mono",monospace;display:inline-block;color:rgba(0,0,0,.8);font-size:.65em;line-height:1.45;background-color:#f7f7f7;border:1px solid #ccc;-webkit-border-radius:3px;border-radius:3px;-webkit-box-shadow:0 1px 0 rgba(0,0,0,.2),0 0 0 .1em white inset;box-shadow:0 1px 0 rgba(0,0,0,.2),0 0 0 .1em #fff inset;margin:0 .15em;padding:.2em .5em;vertical-align:middle;position:relative;top:-.1em;white-space:nowrap}
.keyseq kbd:first-child{margin-left:0}
.keyseq kbd:last-child{margin-right:0}
.menuseq,.menuref{color:#000}
.menuseq b:not(.caret),.menuref{font-weight:inherit}
.menuseq{word-spacing:-.02em}
.menuseq b.caret{font-size:1.25em;line-height:.8}
.menuseq i.caret{font-weight:bold;text-align:center;width:.45em}
b.button::before,b.button::after{position:relative;top:-1px;font-weight:400}
b.button::before{content:"[";padding:0 3px 0 2px}
b.button::after{content:"]";padding:0 2px 0 3px}
p a>code:hover{color:rgba(0,0,0,.9)}
#header,#content,#footnotes,#footer{width:100%;margin-left:auto;margin-right:auto;margin-top:0;margin-bottom:0;max-width:62.5em;*zoom:1;position:relative;padding-left:.9375em;padding-right:.9375em}
#header::before,#header::after,#content::before,#content::after,#footnotes::before,#footnotes::after,#footer::before,#footer::after{content:" ";display:table}
#header::after,#content::after,#footnotes::after,#footer::after{clear:both}
#content{margin-top:1.25em}
#content::before{content:none}
#header>h1:first-child{color:rgba(0,0,0,.85);margin-top:2.25rem;margin-bottom:0}
#header>h1:first-child+#toc{margin-top:8px;border-top:1px solid #ddddd8}
#header>h1:only-child,body.toc2 #header>h1:nth-last-child(2){border-bottom:1px solid #ddddd8;padding-bottom:8px}
#header .details{border-bottom:1px solid #ddddd8;line-height:1.45;padding-top:.25em;padding-bottom:.25em;padding-left:.25em;color:rgba(0,0,0,.6);display:-ms-flexbox;display:-webkit-flex;display:flex;-ms-flex-flow:row wrap;-webkit-flex-flow:row wrap;flex-flow:row wrap}
#header .details span:first-child{margin-left:-.125em}
#header .details span.email a{color:rgba(0,0,0,.85)}
#header .details br{display:none}
#header .details br+span::before{content:"\00a0\2013\00a0"}
#header .details br+span.author::before{content:"\00a0\22c5\00a0";color:rgba(0,0,0,.85)}
#header .details br+span#revremark::before{content:"\00a0|\00a0"}
#header #revnumber{text-transform:capitalize}
#header #revnumber::after{content:"\00a0"}
#content>h1:first-child:not([class]){color:rgba(0,0,0,.85);border-bottom:1px solid #ddddd8;padding-bottom:8px;margin-top:0;padding-top:1rem;margin-bottom:1.25rem}
#toc{border-bottom:1px solid #efefed;padding-bottom:.5em}
#toc>ul{margin-left:.125em}
#toc ul.sectlevel0>li>a{font-style:italic}
#toc ul.sectlevel0 ul.sectlevel1{margin:.5em 0}
#toc ul{font-family:"Open Sans","DejaVu Sans",sans-serif;list-style-type:none}
#toc li{line-height:1.3334;margin-top:.3334em}
#toc a{text-decoration:none}
#toc a:active{text-decoration:underline}
#toctitle{color:#7a2518;font-size:1.2em}
@media screen and (min-width:768px){#toctitle{font-size:1.375em}
body.toc2{padding-left:15em;padding-right:0}
#toc.toc2{margin-top:0!important;background-color:#f8f8f7;position:fixed;width:15em;left:0;top:0;border-right:1px solid #efefed;border-top-width:0!important;border-bottom-width:0!important;z-index:1000;padding:1.25em 1em;height:100%;overflow:auto}
#toc.toc2 #toctitle{margin-top:0;margin-bottom:.8rem;font-size:1.2em}
#toc.toc2>ul{font-size:.9em;margin-bottom:0}
#toc.toc2 ul ul{margin-left:0;padding-left:1em}
#toc.toc2 ul.sectlevel0 ul.sectlevel1{padding-left:0;margin-top:.5em;margin-bottom:.5em}
body.toc2.toc-right{padding-left:0;padding-right:15em}
body.toc2.toc-right #toc.toc2{border-right-width:0;border-left:1px solid #efefed;left:auto;right:0}}
@media screen and (min-width:1280px){body.toc2{padding-left:20em;padding-right:0}
#toc.toc2{width:20em}
#toc.toc2 #toctitle{font-size:1.375em}
#toc.toc2>ul{font-size:.95em}
#toc.toc2 ul ul{padding-left:1.25em}
body.toc2.toc-right{padding-left:0;padding-right:20em}}
#content #toc{border-style:solid;border-width:1px;border-color:#e0e0dc;margin-bottom:1.25em;padding:1.25em;background:#f8f8f7;-webkit-border-radius:4px;border-radius:4px}
#content #toc>:first-child{margin-top:0}
#content #toc>:last-child{margin-bottom:0}
#footer{max-width:100%;background-color:rgba(0,0,0,.8);padding:1.25em}
#footer-text{color:rgba(255,255,255,.8);line-height:1.44}
#content{margin-bottom:.625em}
.sect1{padding-bottom:.625em}
@media screen and (min-width:768px){#content{margin-bottom:1.25em}
.sect1{padding-bottom:1.25em}}
.sect1:last-child{padding-bottom:0}
.sect1+.sect1{border-top:1px solid #efefed}
#content h1>a.anchor,h2>a.anchor,h3>a.anchor,#toctitle>a.anchor,.sidebarblock>.content>.title>a.anchor,h4>a.anchor,h5>a.anchor,h6>a.anchor{position:absolute;z-index:1001;width:1.5ex;margin-left:-1.5ex;display:block;text-decoration:none!important;visibility:hidden;text-align:center;font-weight:400}
#content h1>a.anchor::before,h2>a.anchor::before,h3>a.anchor::before,#toctitle>a.anchor::before,.sidebarblock>.content>.title>a.anchor::before,h4>a.anchor::before,h5>a.anchor::before,h6>a.anchor::before{content:"\00A7";font-size:.85em;display:block;padding-top:.1em}
#content h1:hover>a.anchor,#content h1>a.anchor:hover,h2:hover>a.anchor,h2>a.anchor:hover,h3:hover>a.anchor,#toctitle:hover>a.anchor,.sidebarblock>.content>.title:hover>a.anchor,h3>a.anchor:hover,#toctitle>a.anchor:hover,.sidebarblock>.content>.title>a.anchor:hover,h4:hover>a.anchor,h4>a.anchor:hover,h5:hover>a.anchor,h5>a.anchor:hover,h6:hover>a.anchor,h6>a.anchor:hover{visibility:visible}
#content h1>a.link,h2>a.link,h3>a.link,#toctitle>a.link,.sidebarblock>.content>.title>a.link,h4>a.link,h5>a.link,h6>a.link{color:#ba3925;text-decoration:none}
#content h1>a.link:hover,h2>a.link:hover,h3>a.link:hover,#toctitle>a.link:hover,.sidebarblock>.content>.title>a.link:hover,h4>a.link:hover,h5>a.link:hover,h6>a.link:hover{color:#a53221}
.audioblock,.imageblock,.literalblock,.listingblock,.stemblock,.videoblock{margin-bottom:1.25em}
.admonitionblock td.content>.title,.audioblock>.title,.exampleblock>.title,.imageblock>.title,.listingblock>.title,.literalblock>.title,.stemblock>.title,.openblock>.title,.paragraph>.title,.quoteblock>.title,table.tableblock>.title,.verseblock>.title,.videoblock>.title,.dlist>.title,.olist>.title,.ulist>.title,.qlist>.title,.hdlist>.title{text-rendering:optimizeLegibility;text-align:left;font-family:"Noto Serif","DejaVu Serif",serif;font-size:1rem;font-style:italic}
table.tableblock.fit-content>caption.title{white-space:nowrap;width:0}
.paragraph.lead>p,#preamble>.sectionbody>[class="paragraph"]:first-of-type p{font-size:1.21875em;line-height:1.6;color:rgba(0,0,0,.85)}
table.tableblock #preamble>.sectionbody>[class="paragraph"]:first-of-type p{font-size:inherit}
.admonitionblock>table{border-collapse:separate;border:0;background:none;width:100%}
.admonitionblock>table td.icon{text-align:center;width:80px}
.admonitionblock>table td.icon img{max-width:none}
.admonitionblock>table td.icon .title{font-weight:bold;font-family:"Open Sans","DejaVu Sans",sans-serif;text-transform:uppercase}
.admonitionblock>table td.content{padding-left:1.125em;padding-right:1.25em;border-left:1px solid #ddddd8;color:rgba(0,0,0,.6)}
.admonitionblock>table td.content>:last-child>:last-child{margin-bottom:0}
.exampleblock>.content{border-style:solid;border-width:1px;border-color:#e6e6e6;margin-bottom:1.25em;padding:1.25em;background:#fff;-webkit-border-radius:4px;border-radius:4px}
.exampleblock>.content>:first-child{margin-top:0}
.exampleblock>.content>:last-child{margin-bottom:0}
.sidebarblock{border-style:solid;border-width:1px;border-color:#e0e0dc;margin-bottom:1.25em;padding:1.25em;background:#f8f8f7;-webkit-border-radius:4px;border-radius:4px}
.sidebarblock>:first-child{margin-top:0}
.sidebarblock>:last-child{margin-bottom:0}
.sidebarblock>.content>.title{color:#7a2518;margin-top:0;text-align:center}
.exampleblock>.content>:last-child>:last-child,.exampleblock>.content .olist>ol>li:last-child>:last-child,.exampleblock>.content .ulist>ul>li:last-child>:last-child,.exampleblock>.content .qlist>ol>li:last-child>:last-child,.sidebarblock>.content>:last-child>:last-child,.sidebarblock>.content .olist>ol>li:last-child>:last-child,.sidebarblock>.content .ulist>ul>li:last-child>:last-child,.sidebarblock>.content .qlist>ol>li:last-child>:last-child{margin-bottom:0}
.literalblock pre,.listingblock pre:not(.highlight),.listingblock pre[class="highlight"],.listingblock pre[class^="highlight "],.listingblock pre.CodeRay,.listingblock pre.prettyprint{background:#f7f7f8}
.sidebarblock .literalblock pre,.sidebarblock .listingblock pre:not(.highlight),.sidebarblock .listingblock pre[class="highlight"],.sidebarblock .listingblock pre[class^="highlight "],.sidebarblock .listingblock pre.CodeRay,.sidebarblock .listingblock pre.prettyprint{background:#f2f1f1}
.literalblock pre,.literalblock pre[class],.listingblock pre,.listingblock pre[class]{-webkit-border-radius:4px;border-radius:4px;word-wrap:break-word;padding:1em;font-size:.8125em}
.literalblock pre.nowrap,.literalblock pre[class].nowrap,.listingblock pre.nowrap,.listingblock pre[class].nowrap{overflow-x:auto;white-space:pre;word-wrap:normal}
@media screen and (min-width:768px){.literalblock pre,.literalblock pre[class],.listingblock pre,.listingblock pre[class]{font-size:.90625em}}
@media screen and (min-width:1280px){.literalblock pre,.literalblock pre[class],.listingblock pre,.listingblock pre[class]{font-size:1em}}
.literalblock.output pre{color:#f7f7f8;background-color:rgba(0,0,0,.9)}
.listingblock pre.highlightjs{padding:0}
.listingblock pre.highlightjs>code{padding:1em;-webkit-border-radius:4px;border-radius:4px}
.listingblock pre.prettyprint{border-width:0}
.listingblock>.content{position:relative}
.listingblock code[data-lang]::before{display:none;content:attr(data-lang);position:absolute;font-size:.75em;top:.425rem;right:.5rem;line-height:1;text-transform:uppercase;color:#999}
.listingblock:hover code[data-lang]::before{display:block}
.listingblock.terminal pre .command::before{content:attr(data-prompt);padding-right:.5em;color:#999}
.listingblock.terminal pre .command:not([data-prompt])::before{content:"$"}
table.pyhltable{border-collapse:separate;border:0;margin-bottom:0;background:none}
table.pyhltable td{vertical-align:top;padding-top:0;padding-bottom:0;line-height:1.45}
table.pyhltable td.code{padding-left:.75em;padding-right:0}
pre.pygments .lineno,table.pyhltable td:not(.code){color:#999;padding-left:0;padding-right:.5em;border-right:1px solid #ddddd8}
pre.pygments .lineno{display:inline-block;margin-right:.25em}
table.pyhltable .linenodiv{background:none!important;padding-right:0!important}
.quoteblock{margin:0 1em 1.25em 1.5em;display:table}
.quoteblock>.title{margin-left:-1.5em;margin-bottom:.75em}
.quoteblock blockquote,.quoteblock blockquote p{color:rgba(0,0,0,.85);font-size:1.15rem;line-height:1.75;word-spacing:.1em;letter-spacing:0;font-style:italic;text-align:justify}
.quoteblock blockquote{margin:0;padding:0;border:0}
.quoteblock blockquote::before{content:"\201c";float:left;font-size:2.75em;font-weight:bold;line-height:.6em;margin-left:-.6em;color:#7a2518;text-shadow:0 1px 2px rgba(0,0,0,.1)}
.quoteblock blockquote>.paragraph:last-child p{margin-bottom:0}
.quoteblock .attribution{margin-top:.5em;margin-right:.5ex;text-align:right}
.quoteblock .quoteblock{margin-left:0;margin-right:0;padding:.5em 0;border-left:3px solid rgba(0,0,0,.6)}
.quoteblock .quoteblock blockquote{padding:0 0 0 .75em}
.quoteblock .quoteblock blockquote::before{display:none}
.verseblock{margin:0 1em 1.25em}
.verseblock pre{font-family:"Open Sans","DejaVu Sans",sans;font-size:1.15rem;color:rgba(0,0,0,.85);font-weight:300;text-rendering:optimizeLegibility}
.verseblock pre strong{font-weight:400}
.verseblock .attribution{margin-top:1.25rem;margin-left:.5ex}
.quoteblock .attribution,.verseblock .attribution{font-size:.9375em;line-height:1.45;font-style:italic}
.quoteblock .attribution br,.verseblock .attribution br{display:none}
.quoteblock .attribution cite,.verseblock .attribution cite{display:block;letter-spacing:-.025em;color:rgba(0,0,0,.6)}
.quoteblock.abstract{margin:0 1em 1.25em;display:block}
.quoteblock.abstract>.title{margin:0 0 .375em;font-size:1.15em;text-align:center}
.quoteblock.abstract blockquote,.quoteblock.abstract blockquote p{word-spacing:0;line-height:1.6}
.quoteblock.abstract blockquote::before,.quoteblock.abstract p::before{display:none}
table.tableblock{max-width:100%;border-collapse:separate}
p.tableblock:last-child{margin-bottom:0}
td.tableblock>.content{margin-bottom:-1.25em}
table.tableblock,th.tableblock,td.tableblock{border:0 solid #dedede}
table.grid-all>thead>tr>.tableblock,table.grid-all>tbody>tr>.tableblock{border-width:0 1px 1px 0}
table.grid-all>tfoot>tr>.tableblock{border-width:1px 1px 0 0}
table.grid-cols>*>tr>.tableblock{border-width:0 1px 0 0}
table.grid-rows>thead>tr>.tableblock,table.grid-rows>tbody>tr>.tableblock{border-width:0 0 1px}
table.grid-rows>tfoot>tr>.tableblock{border-width:1px 0 0}
table.grid-all>*>tr>.tableblock:last-child,table.grid-cols>*>tr>.tableblock:last-child{border-right-width:0}
table.grid-all>tbody>tr:last-child>.tableblock,table.grid-all>thead:last-child>tr>.tableblock,table.grid-rows>tbody>tr:last-child>.tableblock,table.grid-rows>thead:last-child>tr>.tableblock{border-bottom-width:0}
table.frame-all{border-width:1px}
table.frame-sides{border-width:0 1px}
table.frame-topbot,table.frame-ends{border-width:1px 0}
table.stripes-all tr,table.stripes-odd tr:nth-of-type(odd){background:#f8f8f7}
table.stripes-none tr,table.stripes-odd tr:nth-of-type(even){background:none}
th.halign-left,td.halign-left{text-align:left}
th.halign-right,td.halign-right{text-align:right}
th.halign-center,td.halign-center{text-align:center}
th.valign-top,td.valign-top{vertical-align:top}
th.valign-bottom,td.valign-bottom{vertical-align:bottom}
th.valign-middle,td.valign-middle{vertical-align:middle}
table thead th,table tfoot th{font-weight:bold}
tbody tr th{display:table-cell;line-height:1.6;background:#f7f8f7}
tbody tr th,tbody tr th p,tfoot tr th,tfoot tr th p{color:rgba(0,0,0,.8);font-weight:bold}
p.tableblock>code:only-child{background:none;padding:0}
p.tableblock{font-size:1em}
td>div.verse{white-space:pre}
ol{margin-left:1.75em}
ul li ol{margin-left:1.5em}
dl dd{margin-left:1.125em}
dl dd:last-child,dl dd:last-child>:last-child{margin-bottom:0}
ol>li p,ul>li p,ul dd,ol dd,.olist .olist,.ulist .ulist,.ulist .olist,.olist .ulist{margin-bottom:.625em}
ul.checklist,ul.none,ol.none,ul.no-bullet,ol.no-bullet,ol.unnumbered,ul.unstyled,ol.unstyled{list-style-type:none}
ul.no-bullet,ol.no-bullet,ol.unnumbered{margin-left:.625em}
ul.unstyled,ol.unstyled{margin-left:0}
ul.checklist{margin-left:.625em}
ul.checklist li>p:first-child>.fa-square-o:first-child,ul.checklist li>p:first-child>.fa-check-square-o:first-child{width:1.25em;font-size:.8em;position:relative;bottom:.125em}
ul.checklist li>p:first-child>input[type="checkbox"]:first-child{margin-right:.25em}
ul.inline{display:-ms-flexbox;display:-webkit-box;display:flex;-ms-flex-flow:row wrap;-webkit-flex-flow:row wrap;flex-flow:row wrap;list-style:none;margin:0 0 .625em -1.25em}
ul.inline>li{margin-left:1.25em}
.unstyled dl dt{font-weight:400;font-style:normal}
ol.arabic{list-style-type:decimal}
ol.decimal{list-style-type:decimal-leading-zero}
ol.loweralpha{list-style-type:lower-alpha}
ol.upperalpha{list-style-type:upper-alpha}
ol.lowerroman{list-style-type:lower-roman}
ol.upperroman{list-style-type:upper-roman}
ol.lowergreek{list-style-type:lower-greek}
.hdlist>table,.colist>table{border:0;background:none}
.hdlist>table>tbody>tr,.colist>table>tbody>tr{background:none}
td.hdlist1,td.hdlist2{vertical-align:top;padding:0 .625em}
td.hdlist1{font-weight:bold;padding-bottom:1.25em}
.literalblock+.colist,.listingblock+.colist{margin-top:-.5em}
.colist td:not([class]):first-child{padding:.4em .75em 0;line-height:1;vertical-align:top}
.colist td:not([class]):first-child img{max-width:none}
.colist td:not([class]):last-child{padding:.25em 0}
.thumb,.th{line-height:0;display:inline-block;border:solid 4px #fff;-webkit-box-shadow:0 0 0 1px #ddd;box-shadow:0 0 0 1px #ddd}
.imageblock.left,.imageblock[style*="float: left"]{margin:.25em .625em 1.25em 0}
.imageblock.right,.imageblock[style*="float: right"]{margin:.25em 0 1.25em .625em}
.imageblock>.title{margin-bottom:0}
.imageblock.thumb,.imageblock.th{border-width:6px}
.imageblock.thumb>.title,.imageblock.th>.title{padding:0 .125em}
.image.left,.image.right{margin-top:.25em;margin-bottom:.25em;display:inline-block;line-height:0}
.image.left{margin-right:.625em}
.image.right{margin-left:.625em}
a.image{text-decoration:none;display:inline-block}
a.image object{pointer-events:none}
sup.footnote,sup.footnoteref{font-size:.875em;position:static;vertical-align:super}
sup.footnote a,sup.footnoteref a{text-decoration:none}
sup.footnote a:active,sup.footnoteref a:active{text-decoration:underline}
#footnotes{padding-top:.75em;padding-bottom:.75em;margin-bottom:.625em}
#footnotes hr{width:20%;min-width:6.25em;margin:-.25em 0 .75em;border-width:1px 0 0}
#footnotes .footnote{padding:0 .375em 0 .225em;line-height:1.3334;font-size:.875em;margin-left:1.2em;margin-bottom:.2em}
#footnotes .footnote a:first-of-type{font-weight:bold;text-decoration:none;margin-left:-1.05em}
#footnotes .footnote:last-of-type{margin-bottom:0}
#content #footnotes{margin-top:-.625em;margin-bottom:0;padding:.75em 0}
.gist .file-data>table{border:0;background:#fff;width:100%;margin-bottom:0}
.gist .file-data>table td.line-data{width:99%}
div.unbreakable{page-break-inside:avoid}
.big{font-size:larger}
.small{font-size:smaller}
.underline{text-decoration:underline}
.overline{text-decoration:overline}
.line-through{text-decoration:line-through}
.aqua{color:#00bfbf}
.aqua-background{background-color:#00fafa}
.black{color:#000}
.black-background{background-color:#000}
.blue{color:#0000bf}
.blue-background{background-color:#0000fa}
.fuchsia{color:#bf00bf}
.fuchsia-background{background-color:#fa00fa}
.gray{color:#606060}
.gray-background{background-color:#7d7d7d}
.green{color:#006000}
.green-background{background-color:#007d00}
.lime{color:#00bf00}
.lime-background{background-color:#00fa00}
.maroon{color:#600000}
.maroon-background{background-color:#7d0000}
.navy{color:#000060}
.navy-background{background-color:#00007d}
.olive{color:#606000}
.olive-background{background-color:#7d7d00}
.purple{color:#600060}
.purple-background{background-color:#7d007d}
.red{color:#bf0000}
.red-background{background-color:#fa0000}
.silver{color:#909090}
.silver-background{background-color:#bcbcbc}
.teal{color:#006060}
.teal-background{background-color:#007d7d}
.white{color:#bfbfbf}
.white-background{background-color:#fafafa}
.yellow{color:#bfbf00}
.yellow-background{background-color:#fafa00}
span.icon>.fa{cursor:default}
a span.icon>.fa{cursor:inherit}
.admonitionblock td.icon [class^="fa icon-"]{font-size:2.5em;text-shadow:1px 1px 2px rgba(0,0,0,.5);cursor:default}
.admonitionblock td.icon .icon-note::before{content:"\f05a";color:#19407c}
.admonitionblock td.icon .icon-tip::before{content:"\f0eb";text-shadow:1px 1px 2px rgba(155,155,0,.8);color:#111}
.admonitionblock td.icon .icon-warning::before{content:"\f071";color:#bf6900}
.admonitionblock td.icon .icon-caution::before{content:"\f06d";color:#bf3400}
.admonitionblock td.icon .icon-important::before{content:"\f06a";color:#bf0000}
.conum[data-value]{display:inline-block;color:#fff!important;background-color:rgba(0,0,0,.8);-webkit-border-radius:100px;border-radius:100px;text-align:center;font-size:.75em;width:1.67em;height:1.67em;line-height:1.67em;font-family:"Open Sans","DejaVu Sans",sans-serif;font-style:normal;font-weight:bold}
.conum[data-value] *{color:#fff!important}
.conum[data-value]+b{display:none}
.conum[data-value]::after{content:attr(data-value)}
pre .conum[data-value]{position:relative;top:-.125em}
b.conum *{color:inherit!important}
.conum:not([data-value]):empty{display:none}
dt,th.tableblock,td.content,div.footnote{text-rendering:optimizeLegibility}
h1,h2,p,td.content,span.alt{letter-spacing:-.01em}
p strong,td.content strong,div.footnote strong{letter-spacing:-.005em}
p,blockquote,dt,td.content,span.alt{font-size:1.0625rem}
p{margin-bottom:1.25rem}
.sidebarblock p,.sidebarblock dt,.sidebarblock td.content,p.tableblock{font-size:1em}
.exampleblock>.content{background-color:#fffef7;border-color:#e0e0dc;-webkit-box-shadow:0 1px 4px #e0e0dc;box-shadow:0 1px 4px #e0e0dc}
.print-only{display:none!important}
@page{margin:1.25cm .75cm}
@media print{*{-webkit-box-shadow:none!important;box-shadow:none!important;text-shadow:none!important}
html{font-size:80%}
a{color:inherit!important;text-decoration:underline!important}
a.bare,a[href^="#"],a[href^="mailto:"]{text-decoration:none!important}
a[href^="http:"]:not(.bare)::after,a[href^="https:"]:not(.bare)::after{content:"(" attr(href) ")";display:inline-block;font-size:.875em;padding-left:.25em}
abbr[title]::after{content:" (" attr(title) ")"}
pre,blockquote,tr,img,object,svg{page-break-inside:avoid}
thead{display:table-header-group}
svg{max-width:100%}
p,blockquote,dt,td.content{font-size:1em;orphans:3;widows:3}
h2,h3,#toctitle,.sidebarblock>.content>.title{page-break-after:avoid}
#toc,.sidebarblock,.exampleblock>.content{background:none!important}
#toc{border-bottom:1px solid #ddddd8!important;padding-bottom:0!important}
body.book #header{text-align:center}
body.book #header>h1:first-child{border:0!important;margin:2.5em 0 1em}
body.book #header .details{border:0!important;display:block;padding:0!important}
body.book #header .details span:first-child{margin-left:0!important}
body.book #header .details br{display:block}
body.book #header .details br+span::before{content:none!important}
body.book #toc{border:0!important;text-align:left!important;padding:0!important;margin:0!important}
body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-break-before:always}
.listingblock code[data-lang]::before{display:block}
#footer{padding:0 .9375em}
.hide-on-print{display:none!important}
.print-only{display:block!important}
.hide-for-print{display:none!important}
.show-for-print{display:inherit!important}}
@media print,amzn-kf8{#header>h1:first-child{margin-top:1.25rem}
.sect1{padding:0!important}
.sect1+.sect1{border:0}
#footer{background:none}
#footer-text{color:rgba(0,0,0,.6);font-size:.9em}}
@media amzn-kf8{#header,#content,#footnotes,#footer{padding:0}}
</style>
</head>
<body class="article toc2 toc-left">
<div id="header">
<h1>C++ Compile</h1>
<div class="details">
<span id="author" class="author">Rene Rivera</span><br>
<span id="email" class="email"><a href="mailto:grafikrobot@gmail.com">grafikrobot@gmail.com</a></span><br>
<span id="revnumber"> P1178R0,</span>
<span id="revdate">2018-10-06</span>
<br><span id="revremark">Initial</span>
</div>
<div id="toc" class="toc2">
<div id="toctitle">Table of Contents</div>
<ul class="sectlevel1">
<li><a href="#_introduction">1. Introduction</a>
<ul class="sectlevel2">
<li><a href="#_background_and_motivation">1.1. Background and Motivation</a></li>
<li><a href="#_impact_on_the_standard">1.2. Impact On the Standard</a></li>
<li><a href="#_design_goals">1.3. Design Goals</a></li>
<li><a href="#_design_decisions">1.4. Design Decisions</a>
<ul class="sectlevel3">
<li><a href="#_exceptions">1.4.1. Exceptions</a></li>
<li><a href="#_argument_exclusivity">1.4.2. Argument Exclusivity</a></li>
<li><a href="#_option_prefix">1.4.3. <code>+</code> Option Prefix</a></li>
<li><a href="#_use_cases">1.4.4. Use Cases</a></li>
</ul>
</li>
<li><a href="#_about_linking">1.5. About Linking</a></li>
<li><a href="#_link_compatibility">1.6. Link Compatibility</a></li>
</ul>
</li>
<li><a href="#_argument_specifications">2. Argument Specifications</a>
<ul class="sectlevel2">
<li><a href="#_core_arguments">2.1. Core Arguments</a></li>
<li><a href="#_experimental_arguments">2.2. Experimental Arguments</a></li>
<li><a href="#_vendor_arguments">2.3. Vendor Arguments</a></li>
</ul>
</li>
<li><a href="#_future_work">3. Future Work</a></li>
<li><a href="#_technical_specification">4. Technical Specification</a>
<ul class="sectlevel2">
<li><a href="#_header_compile_synopsis">4.1. Header <code>&lt;compile&gt;</code> Synopsis</a></li>
<li><a href="#_specification">4.2. Specification</a>
<ul class="sectlevel3">
<li><a href="#_arguments">4.2.1. Arguments</a>
<ul class="sectlevel4">
<li><a href="#_long_short_options">4.2.1.1. Long &amp; Short Options</a></li>
<li><a href="#_core_options">4.2.1.2. Core Options</a></li>
<li><a href="#_experimental_options">4.2.1.3. Experimental Options</a></li>
<li><a href="#_vendor_options">4.2.1.4. Vendor Options</a></li>
<li><a href="#_compatibility">4.2.1.5. Compatibility</a></li>
<li><a href="#_options">4.2.1.6. Options</a></li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
<li><a href="#_prior_art">5. Prior Art</a>
<ul class="sectlevel2">
<li><a href="#_clang_cl">5.1. <code>clang-cl</code></a></li>
<li><a href="#_gxlc">5.2. <code>gxlc++</code></a></li>
<li><a href="#_nvrtc">5.3. NVRTC</a></li>
<li><a href="#_b2_build_system">5.4. <code>B2</code> build system</a></li>
<li><a href="#_cmake_build_system">5.5. Cmake build system</a></li>
</ul>
</li>
<li><a href="#_acknowledgements">6. Acknowledgements</a></li>
</ul>
</div>
</div>
<div id="content">
<div id="preamble">
<div class="sectionbody">
<style>
.admonitionblock .icon .title {
    font-size: 2.5em;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, .5);
}
.caution .icon .title {
    color: rgba(192, 51, 0, 1);
}
.important .icon .title {
    color: rgba(192, 0, 0, 1);
}
.note .icon .title {
    color: rgba(26, 64, 128, 1);
}
.tip .icon .title {
    color: rgba(255, 192, 0, 1);
}
.warning .icon .title {
    color: rgba(192, 102, 0, 1);
}
.hdlist p {
    margin-bottom: 0.25rem;
}
td.hdlist1, td.hdlist2 {
    padding-bottom: 0;
}
</style>
<div class="hdlist">
<table>
<tr>
<td class="hdlist1">
Document number
</td>
<td class="hdlist2">
<p>ISO/IEC/JTC1/SC22/WG21/P1178R0</p>
</td>
</tr>
<tr>
<td class="hdlist1">
Date
</td>
<td class="hdlist2">
<p>2018-10-06</p>
</td>
</tr>
<tr>
<td class="hdlist1">
Reply-to
</td>
<td class="hdlist2">
<p>Rene Rivera, <a href="mailto:grafikrobot@gmail.com">grafikrobot@gmail.com</a></p>
</td>
</tr>
<tr>
<td class="hdlist1">
Audience
</td>
<td class="hdlist2">
<p>Tooling (SG15), Library Evolution</p>
</td>
</tr>
</table>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_introduction"><a class="anchor" href="#_introduction"></a>1. Introduction</h2>
<div class="sectionbody">
<div class="paragraph">
<p>This proposes to add an interface for transforming C++ source into
usable executable programs. As such it aims to provide a common definition of
compiler frontend tool arguments and options for transforming source code to
translation units and linking those into executable programs.</p>
</div>
<div class="sect2">
<h3 id="_background_and_motivation"><a class="anchor" href="#_background_and_motivation"></a>1.1. Background and Motivation</h3>
<div class="paragraph">
<p>This proposal is based on the notion that it should be possible for a C++
user, both beginner and advanced, to easily transform their source to
immediately executable form in a consistent method across compilers.</p>
</div>
<div class="paragraph">
<p>One aspect of this proposal is to make it possible for future C++
educators, and book authors, to provide complete usage examples that work for
any particular tool they and their audience use. While this proposal does not
prescribe a particular executable tool, it is trivial to write minimal tool
that passes arguments directly to these interfaces. It is hoped that vendors
would provide ready made compiler front ends for their tools accepting the
standard arguments.</p>
</div>
<div class="paragraph">
<p>It is also the intent for this proposal to be an initial step in the road
towards standardizing the tooling around C++. With the goal of having a
global and consistent tooling ecosystem to facilitate the introduction into
C++ for anyone and to ease the interoperability of future tooling like
package and dependency managers by having a single common set of options
to base solutions on.</p>
</div>
<div class="paragraph">
<p>Additionally this facility could also support runtime compilation, for example
for runtime generated source, and other compilation models where the particular
execution platform is not known ahead of time.</p>
</div>
</div>
<div class="sect2">
<h3 id="_impact_on_the_standard"><a class="anchor" href="#_impact_on_the_standard"></a>1.2. Impact On the Standard</h3>
<div class="paragraph">
<p>This proposal is a library extension and specification. As such it does not
prescribe changes to any standard classes or functions. It adds one function,
and overloads, in a new header file, <code>&lt;compile&gt;</code>.</p>
</div>
</div>
<div class="sect2">
<h3 id="_design_goals"><a class="anchor" href="#_design_goals"></a>1.3. Design Goals</h3>
<div class="paragraph">
<p>The design herein is driven primarily by the following, in approximate
order of importance:</p>
</div>
<div class="ulist">
<ul>
<li>
<p>Mirror the <code>main</code> entry point to make a frontend program trivial.</p>
</li>
<li>
<p>Minimize variability in arguments and options.</p>
</li>
<li>
<p>Use common practice option names for familiarity.</p>
</li>
<li>
<p>Do not attempt to specify all possible options as that&#8217;s not technically
possible.</p>
</li>
<li>
<p>Specify how, and if, options are compatible with others to facilitate
tooling checks for binary compatibility.</p>
</li>
</ul>
</div>
</div>
<div class="sect2">
<h3 id="_design_decisions"><a class="anchor" href="#_design_decisions"></a>1.4. Design Decisions</h3>
<div class="sect3">
<h4 id="_exceptions"><a class="anchor" href="#_exceptions"></a>1.4.1. Exceptions</h4>
<div class="paragraph">
<p>So as to reduce error handling cases for callers of <code>compile</code>, i.e. <code>main</code>,
there are no exceptions allowed from calls to <code>compile</code>. This has the effect
of removing the need for exception handling at the caller as any error
situations are indicated by the simpler return value which can be directly
mapped to the return value of <code>main</code>.</p>
</div>
</div>
<div class="sect3">
<h4 id="_argument_exclusivity"><a class="anchor" href="#_argument_exclusivity"></a>1.4.2. Argument Exclusivity</h4>
<div class="paragraph">
<p>Recognizing that specifying a complete set of argument options is not possible
we need to provide for a mechanism to pass vendor specific arguments for
compilation; but at the same time we want to ensure that defined arguments
are not ignored in favor of vendor only arguments. Hence we specify this
implementation rule:</p>
</div>
<div class="sidebarblock">
<div class="content">
<div class="paragraph">
<p>When a defined core argument option exists an equivalent vendor specific
argument is <strong>not</strong> allowed as an acceptable argument option.</p>
</div>
</div>
</div>
<div class="dlist">
<dl>
<dt class="hdlist1">For instance</dt>
<dd>
<p>We specify the <code>++address_model</code> core option. It would not be allowed for
a vendor to specify an <code>++v:xyz:m64</code> (to specify 64 bit address model) option
as that would overlap with the core option.</p>
</dd>
</dl>
</div>
</div>
<div class="sect3">
<h4 id="_option_prefix"><a class="anchor" href="#_option_prefix"></a>1.4.3. <code>+</code> Option Prefix</h4>
<div class="paragraph">
<p>Like choosing names for programming language constructs, choosing a prefix
for the option arguments is a contentious decision. For this we chose to
use <code>+</code> as the prefix, and hence <code>++</code> for the long form, for these reasons:</p>
</div>
<div class="ulist">
<ul>
<li>
<p>It&#8217;s not used widely by current compiler tooling and hence avoids confusion
with existing options.</p>
</li>
<li>
<p>It doesn&#8217;t conflict with operating system specific path specifications.</p>
</li>
<li>
<p>Is a non-alphanumeric ASCII glyph.</p>
</li>
<li>
<p>Not frequently used as the first character of file names.</p>
</li>
<li>
<p>And finally, it harkens to C++ itself.</p>
</li>
</ul>
</div>
<div class="paragraph">
<p>Regardless of this choice, this is ostensibly a straw-man choice. There are
valid reasons to choose other prefix (say <code>-</code>). And this proposal does not
hinge on what this prefix is. But do note that the sample implementation does
use <code>+</code> and <code>++</code>.</p>
</div>
<div class="admonitionblock note">
<table>
<tr>
<td class="icon">
<div class="title">ℹ</div>
</td>
<td class="content">
There is at least one class of compilers that historically use the <code>+</code>
prefix. For example the <a href="https://www.csee.umbc.edu/portal/help/VHDL/verilog/command_line_plus_options.html">Verilog-XL</a>
uses the <code>+</code> option prefix exclusive.
</td>
</tr>
</table>
</div>
</div>
<div class="sect3">
<h4 id="_use_cases"><a class="anchor" href="#_use_cases"></a>1.4.4. Use Cases</h4>
<div class="paragraph">
<p>This facility is designed to facilitate primarily these groups of users:
teachers (and their students), and tool creators. For teachers this feature
would improve the teaching materials presented to students.</p>
</div>
<div class="dlist">
<dl>
<dt class="hdlist1">For instance</dt>
<dd>
<p>This is the first code example from a popular C++ programming book:</p>
<div class="quoteblock">
<blockquote>
<div class="paragraph">
<p>For example:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-c++ hljs" data-lang="c++">#include&lt;iostream&gt;

int main()
{
  std::cout &lt;&lt; "Hello, new world!\n";
}</code></pre>
</div>
</div>
</blockquote>
<div class="attribution">
&#8212; Bjarne Stroustrup<br>
<cite>The C++ Programming Language Third Edition</cite>
</div>
</div>
<div class="paragraph">
<p>Which is shortly followed by this explanation:</p>
</div>
<div class="quoteblock">
<blockquote>
<div class="paragraph">
<p>The language used in this book is &#8220;pure C++&#8221; as defined in the C++ standard
[C++,1998]. Therefore, the example ought to run on every C++ implementation.
The major program fragments in this book were tried using several C++
implementations.</p>
</div>
</blockquote>
</div>
<div class="paragraph">
<p>But how to run and compile examples is not described in the entirety of the
book for good reasons. As it would take a whole chapter onto itself just
to skim at that subject given the current state of compiler tools. With this
proposal it would at least be possible to give a short explanation of what a
compiler invocation would look like. The above example could be followed by:</p>
</div>
<div class="quoteblock">
<blockquote>
<div class="paragraph">
<p>You can compile the example with this command, substituting a compiler
program of your choice:</p>
</div>
<div class="listingblock">
<div class="content">
<pre>&gt; cpp hello.cpp ++output=hello.exe</pre>
</div>
</div>
<div class="paragraph">
<p>And run it by invoking the resulting program:</p>
</div>
<div class="listingblock">
<div class="content">
<pre>&gt; hello.exe
Hello, new world!</pre>
</div>
</div>
</blockquote>
</div>
</dd>
</dl>
</div>
<div class="paragraph">
<p>For tool creators the uses vary depending on the tools in question. They could
be a build system, like <code>b2</code> (aka Boost.Build) that has complicated toolset
definition files that translate portable build descriptions to specific
tool invocations.</p>
</div>
<div class="dlist">
<dl>
<dt class="hdlist1">For instance</dt>
<dd>
<p>In <code>b2</code> one would indicate include search paths by adding
<code>&lt;include&gt;my/include</code> to the specification of the build definition. It will
then translate that to a compile invocation depending on the tool:
<code>cc -Imy/include</code>, <code>bcc32.exe -I"my/include"</code>,
<code>clang -I"my/include"</code>, <code>gcc -I"my/include"</code>, <code>cl.exe /I"my/include"</code>, and so
on. This is obviously a very simple example and the options get less uniform
across compilers the more "esoteric" the options are. And the build system
needs lots of human programed knowledge to create these mappings. Instead
with this proposal the mapping would be universal and only non-core options
and the tool executable would need special treatment.</p>
</dd>
</dl>
</div>
<div class="paragraph">
<p>Publishing libraries, with or without source, also poses a problem for those
doing the publishing. As part of publishing, your library will have specific
options it needs a program to compile with to make use of the library. This
can involve rather complex distributions to account for the varied compilers
end users have. And many times this involves publishing many different files
for each possible configuration and compiler you support.</p>
</div>
<div class="dlist">
<dl>
<dt class="hdlist1">For instance</dt>
<dd>
<p>One common method of doing that is to use pkg-config. You might end up with
this kind of file for GCC:</p>
<div class="listingblock">
<div class="content">
<pre>Name: libpng
Description: Loads and saves PNG files
Version: 1.2.8
Libs: -L${libdir} -lpng12 -lz
Cflags: -I${includedir}/libpng12</pre>
</div>
</div>
<div class="paragraph">
<p>And another for MSVC:</p>
</div>
<div class="listingblock">
<div class="content">
<pre>Name: libpng
Description: Loads and saves PNG files
Version: 1.2.8
Libs: /LIBPATH:${libdir} png12.lib z.lib
Cflags: /I${includedir}/libpng12</pre>
</div>
</div>
<div class="paragraph">
<p>With this proposal it would be possible to only include one such file
regardless of compiler used:</p>
</div>
<div class="listingblock">
<div class="content">
<pre>Name: libpng
Description: Loads and saves PNG files
Version: 1.2.8
Libs: ++library_path=${libdir} +lpng12 +lz
Cflags: +I${includedir}/libpng12</pre>
</div>
</div>
</dd>
</dl>
</div>
<div class="paragraph">
<p>The uses are not limited to the above two groups of users though. This
facility also opens the door for some users that need to process
generated source into executable form.</p>
</div>
<div class="dlist">
<dl>
<dt class="hdlist1">For instance</dt>
<dd>
<p>One can have a system that uses database schema definitions to generate C++
source code to implement that schema, and related queries, in an optimal
form backed by a custom C++ database engine. This would let one do that
operation in a much simpler and direct method.</p>
</dd>
</dl>
</div>
</div>
</div>
<div class="sect2">
<h3 id="_about_linking"><a class="anchor" href="#_about_linking"></a>1.5. About Linking</h3>
<div class="paragraph">
<p>When considering this extension the question comes up about the definition of
generating compiled source files and linking them into a program. The key issue
is that there is the claim that there is no normative text in the standard
that defines the process of separate compilation and linking.</p>
</div>
<div class="paragraph">
<p>My research, with regards to reading the standard text, is that even though
the standard does tread carefully to avoid specifics about the interaction
of external linkage, compiling, and the resulting program; There is a definite
understood specification that one "translates" source code units into separate
"blobs" that are then "linked" into the final runnable program. Specifically
section 6.5 ([basic.link]) defines this process with:</p>
</div>
<div class="sidebarblock">
<div class="content">
<div class="paragraph">
<p>A <em>program</em> consists of one or more <em>translation units</em> (Clause 5) linked
together. A translation unit consists of a sequence of declarations.</p>
</div>
</div>
</div>
<div class="paragraph">
<p>This proposal doesn&#8217;t claim to define the compilation and linkage any further
than is currently defined. The options mandated herein do not specify any
particular process or mechanisms past the existing specification of program
and linkage. This proposal does not:</p>
</div>
<div class="olist arabic">
<ol class="arabic">
<li>
<p>Prescribe any particular storage mechanism for source code, translated
source code, nor a program.</p>
</li>
<li>
<p>Prescribe any particular format for translated source code nor program.</p>
</li>
</ol>
</div>
<div class="paragraph">
<p>And hence the specifics of what the results of compiling the translation units
into linkable outputs and linking those outputs into an executable program
is entirely implementation defined.</p>
</div>
</div>
<div class="sect2">
<h3 id="_link_compatibility"><a class="anchor" href="#_link_compatibility"></a>1.6. Link Compatibility</h3>
<div class="paragraph">
<p>This proposal defines a <em>link compatibility</em> for options to make it clear what
compiled translation units are compatible with each other. This information
facilitates various use cases:</p>
</div>
<div class="ulist">
<ul>
<li>
<p>It makes it possible for build systems to detect and respond to the
compatibility. To either notify the user of the problem, or to create
variations that are compatible with your request.</p>
</li>
<li>
<p>It makes it possible for package managers that support pre-compiled binary
libraries to detect if the available packages are usable with your program.
And possibly adjust to find the particular binary variation that will work
for your case.</p>
</li>
</ul>
</div>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_argument_specifications"><a class="anchor" href="#_argument_specifications"></a>2. Argument Specifications</h2>
<div class="sectionbody">
<div class="sect2">
<h3 id="_core_arguments"><a class="anchor" href="#_core_arguments"></a>2.1. Core Arguments</h3>
<div class="paragraph">
<p>Core arguments encompass those that are globally available in all compilers.
Their specification needs to be done through a mechanism that requires compiler
vendors to implement them to be able to attain a minimal usable API. At this
time the available method for achieving this is to include the specification
of core arguments in the <em>International Standard</em>. Which is what we propose
herein with the <code>std::compile</code> function.</p>
</div>
<div class="dlist">
<dl>
<dt class="hdlist1">Requirements for core arguments</dt>
<dd>
<div class="ulist">
<ul>
<li>
<p>Implementable by many compilers.</p>
</li>
<li>
<p>Already in wide use.</p>
</li>
<li>
<p>Experiential knowledge of behavior as an <em>experimental argument</em> or
<em>vendor argument</em>.</p>
</li>
<li>
<p>Have a meaningful, but terse, long form name.</p>
</li>
</ul>
</div>
</dd>
</dl>
</div>
</div>
<div class="sect2">
<h3 id="_experimental_arguments"><a class="anchor" href="#_experimental_arguments"></a>2.2. Experimental Arguments</h3>
<div class="paragraph">
<p>Experimental arguments allow for a period of review before adding core
arguments. We recognize that it&#8217;s important to acquire experience with
arguments before adding them to the International Standard. We propose to have
a standing document defining arguments that are intended to become core
arguments but that otherwise do not have sufficient real-world implementation
experience. Benefits include:</p>
</div>
<div class="ulist">
<ul>
<li>
<p>Allowing time for tool implementations to support the change.</p>
</li>
<li>
<p>Acquire experience on compiler, and other tools, support.</p>
</li>
</ul>
</div>
<div class="paragraph">
<p>Recognizing that experimental arguments will most likely come from vendor
arguments, and that there needs to be a period of for tools to adjust, vendor
arguments would be allowed to overlap with experimental arguments, unlike
core arguments.</p>
</div>
</div>
<div class="sect2">
<h3 id="_vendor_arguments"><a class="anchor" href="#_vendor_arguments"></a>2.3. Vendor Arguments</h3>
<div class="paragraph">
<p>Given the faster rate at which compilers change with respect to the C++
standard we need to allow for specification of arguments as quickly as
possible to facilitate support in tooling.</p>
</div>
<div class="dlist">
<dl>
<dt class="hdlist1">For instance</dt>
<dd>
<p>A vendor releases a new version of their compiler to support a new CPU.
This new CPU is not compatible with an existing CPU and hence packages must
be recompiled for it. But the next scheduled committee meeting that could
approve adding that new CPU option is months later.</p>
</dd>
</dl>
</div>
<div class="paragraph">
<p>Hence we propose the use <em>Standing Documents</em> for specifying the vendor
specific options and for the highly volatile option values as needed. Such
that SG15 could meet and approve changes to those <em>Standing Documents</em>
as needed in a timely matter.</p>
</div>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_future_work"><a class="anchor" href="#_future_work"></a>3. Future Work</h2>
<div class="sectionbody">
<div class="paragraph">
<p>This is currently a limited and incomplete technical specification.
Future revisions will grow the set of core and vendor options. The current
options where chosen as a minimal working set to create working programs with
minimal compilation complexity.</p>
</div>
<div class="paragraph">
<p>There are various existing tools and APIs that either perform argument mapping
from one compiler to another, or are direct compiler frontend drivers.
There will be a more thorough listing of such tools and APIs in future
revisions.</p>
</div>
<div class="paragraph">
<p>We will also add background as to which C++ tools benefit from standard argument
options, and how, in future revisions.</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_technical_specification"><a class="anchor" href="#_technical_specification"></a>4. Technical Specification</h2>
<div class="sectionbody">
<div class="admonitionblock note">
<table>
<tr>
<td class="icon">
<div class="title">ℹ</div>
</td>
<td class="content">
This is a <strong><em>very rough</em></strong> draft of a specification. As such it will
contain errors and not be written in the most precise manner.
</td>
</tr>
</table>
</div>
<div class="sect2">
<h3 id="_header_compile_synopsis"><a class="anchor" href="#_header_compile_synopsis"></a>4.1. Header <code>&lt;compile&gt;</code> Synopsis</h3>
<div class="listingblock">
<div class="content">
<pre>namespace std
{
  int compile(int, char * *) noexcept;
  int compile(vector&lt;string&gt;) noexcept;
}</pre>
</div>
</div>
</div>
<div class="sect2">
<h3 id="_specification"><a class="anchor" href="#_specification"></a>4.2. Specification</h3>
<div class="listingblock">
<div class="content">
<pre>int compile(int argument_count, char * * arguments) noexcept;</pre>
</div>
</div>
<div class="hdlist">
<table>
<tr>
<td class="hdlist1">
Requires
</td>
<td class="hdlist2">
<p><code>argument_count &gt; 0</code>, where <code>arguments[0]</code> is the name of the
program executable. And <code>arguments[1..argument_count)</code> are either options or
names of source files.</p>
</td>
</tr>
<tr>
<td class="hdlist1">
Effect
</td>
<td class="hdlist2">
<p>Executes the compilation according to the given <code>arguments</code>.
Implementations should indicate an error if the functionality is not
available.</p>
</td>
</tr>
<tr>
<td class="hdlist1">
Returns
</td>
<td class="hdlist2">
<p>zero (<code>0</code>) for success, non-zero (<code>!= 0</code>) for an error.</p>
</td>
</tr>
</table>
</div>
<div class="listingblock">
<div class="content">
<pre>int compile(vector&lt;string&gt; arguments) noexcept;</pre>
</div>
</div>
<div class="hdlist">
<table>
<tr>
<td class="hdlist1">
Requires
</td>
<td class="hdlist2">
<p><code>!arguments.empty()</code>, where <code>arguments[0]</code> is the name of the
program executable. And <code>arguments[1..N)</code> are either options or names of
source files.</p>
</td>
</tr>
<tr>
<td class="hdlist1">
Effect
</td>
<td class="hdlist2">
<p>Executes the compilation according to the given <code>arguments</code>.
Implementations should indicate an error if the functionality is not
available.</p>
</td>
</tr>
<tr>
<td class="hdlist1">
Returns
</td>
<td class="hdlist2">
<p>zero (<code>0</code>) for success, non-zero (<code>!= 0</code>) for an error.</p>
</td>
</tr>
</table>
</div>
<div class="sect3">
<h4 id="_arguments"><a class="anchor" href="#_arguments"></a>4.2.1. Arguments</h4>
<div class="paragraph">
<p>The <code>arguments</code> specify the set of options, translation units to transform,
or transformed translation units to link into a program. An argument is either
an option and option value, or a name of a translation unit source. Options
start with the <code>+</code> or <code>++</code> option prefix.</p>
</div>
<div class="sect4">
<h5 id="_long_short_options"><a class="anchor" href="#_long_short_options"></a>4.2.1.1. Long &amp; Short Options</h5>
<div class="paragraph">
<p>Arguments that start with <code>++</code> are <em>long options</em>. And arguments that start
with a single <code>+</code> are <em>short options</em>. <em>Long options</em> are expected to be
succinct but reasonably human readable names of options. And <em>short options</em>
are expected to be well known one or two character alternatives to the
<em>long options</em>.</p>
</div>
</div>
<div class="sect4">
<h5 id="_core_options"><a class="anchor" href="#_core_options"></a>4.2.1.2. Core Options</h5>
<div class="paragraph">
<p><em>Core options</em> follow this syntax:</p>
</div>
<div class="literalblock">
<div class="content">
<pre>++<em>name</em>[=<em>value</em>]
++<em>name</em> [<em>value</em>]
+<em>n</em> [<em>value</em>]</pre>
</div>
</div>
<div class="paragraph">
<p>Where the <em>value</em> for the option may be optional, and may have additional
syntax constraints, as specified for any particular option.</p>
</div>
</div>
<div class="sect4">
<h5 id="_experimental_options"><a class="anchor" href="#_experimental_options"></a>4.2.1.3. Experimental Options</h5>
<div class="paragraph">
<p><em>Experimental options</em> follow the same syntax as <em>core options</em> and are
specified in a <em>standing document</em>.</p>
</div>
</div>
<div class="sect4">
<h5 id="_vendor_options"><a class="anchor" href="#_vendor_options"></a>4.2.1.4. Vendor Options</h5>
<div class="paragraph">
<p><em>Vendor options</em> are specified in a vendor specific <em>standing document</em> and
follow this syntax:</p>
</div>
<div class="literalblock">
<div class="content">
<pre>++<em>vendor-key</em>:<em>name</em>[=<em>value</em>]
++<em>vendor-key</em>:<em>name</em> [<em>value</em>]
+<em>vendor-key</em>:<em>n</em> [<em>value</em>]</pre>
</div>
</div>
<div class="paragraph">
<p>Where the <em>value</em> for the option may be optional, and may have additional
syntax constraints, as specified for any particular option. And where
<em>vendor-key</em> is a unique, short, name for the vendor specific compiler.</p>
</div>
</div>
<div class="sect4">
<h5 id="_compatibility"><a class="anchor" href="#_compatibility"></a>4.2.1.5. Compatibility</h5>
<div class="paragraph">
<p>Options, and their values, can have a <em>compatibility</em> of:</p>
</div>
<div class="dlist">
<dl>
<dt class="hdlist1"><em>Link incompatible</em></dt>
<dd>
<p>Wherein translation units transformed with differing options or values <strong>can not</strong>
be linked together into a program.</p>
</dd>
<dt class="hdlist1"><em>Link compatible</em></dt>
<dd>
<p>Wherein translation units transformed with differing options or values <strong>can</strong>
be linked together into a program.</p>
</dd>
<dt class="hdlist1"><em>Implementation defined</em></dt>
<dd>
<p>Wherein translation units transformed with differing options or values are
compatible depending on the particular C++ implementation.</p>
</dd>
<dt class="hdlist1"><em>NA</em></dt>
<dd>
<p>Wherein the compatibility is not directly impacted by the option or values.</p>
</dd>
</dl>
</div>
<div class="paragraph">
<p>Options that are <em>link incompatible</em> with other options also indicate which other
options affect compatibility. Otherwise a <em>link incompatible</em> option is only
incompatible between its own different values.</p>
</div>
</div>
<div class="sect4">
<h5 id="_options"><a class="anchor" href="#_options"></a>4.2.1.6. Options</h5>
<div class="sect5">
<h6 id="_help"><a class="anchor" href="#_help"></a>4.2.1.6.1. help</h6>
<div class="literalblock">
<div class="content">
<pre>+h
+?
++help</pre>
</div>
</div>
<div class="hdlist">
<table>
<tr>
<td class="hdlist1">
Effect
</td>
<td class="hdlist2">
<p>Displays all available options and exits.</p>
</td>
</tr>
</table>
</div>
</div>
<div class="sect5">
<h6 id="_output"><a class="anchor" href="#_output"></a>4.2.1.6.2. output</h6>
<div class="literalblock">
<div class="content">
<pre>+o <em>file</em>
++output=<em>file</em></pre>
</div>
</div>
<div class="hdlist">
<table>
<tr>
<td class="hdlist1">
Argument
</td>
<td class="hdlist2">
<p>An implementation defined path to a <em>file</em>.</p>
</td>
</tr>
<tr>
<td class="hdlist1">
Effect
</td>
<td class="hdlist2">
<p>Sets the destination file of the compilation.</p>
</td>
</tr>
<tr>
<td class="hdlist1">
Support
</td>
<td class="hdlist2">
<p>Required</p>
</td>
</tr>
<tr>
<td class="hdlist1">
Compatibility
</td>
<td class="hdlist2">
<p>NA</p>
</td>
</tr>
</table>
</div>
</div>
<div class="sect5">
<h6 id="_define"><a class="anchor" href="#_define"></a>4.2.1.6.3. define</h6>
<div class="literalblock">
<div class="content">
<pre>+D <em>definition</em>
++define=<em>definition</em></pre>
</div>
</div>
<div class="hdlist">
<table>
<tr>
<td class="hdlist1">
Argument
</td>
<td class="hdlist2">
<p>A preprocessor <em>definition</em> of the form <code><em>name</em>=<em>value</em></code></p>
</td>
</tr>
<tr>
<td class="hdlist1">
Effect
</td>
<td class="hdlist2">
<p>Instructs the preprocessing phase to define the given <em>name</em> symbol
to the given <em>value</em>, or to <code>1</code> if <em>value</em> is not given.</p>
</td>
</tr>
<tr>
<td class="hdlist1">
Support
</td>
<td class="hdlist2">
<p>Required</p>
</td>
</tr>
<tr>
<td class="hdlist1">
Compatibility
</td>
<td class="hdlist2">
<p>NA</p>
</td>
</tr>
</table>
</div>
</div>
<div class="sect5">
<h6 id="_include_directory"><a class="anchor" href="#_include_directory"></a>4.2.1.6.4. include directory</h6>
<div class="literalblock">
<div class="content">
<pre>+I <em>directory</em>
++include-dir=<em>directory</em></pre>
</div>
</div>
<div class="hdlist">
<table>
<tr>
<td class="hdlist1">
Argument
</td>
<td class="hdlist2">
<p>An implementation defined path to a <em>directory</em>.</p>
</td>
</tr>
<tr>
<td class="hdlist1">
Effect
</td>
<td class="hdlist2">
<p>Adds the given <em>directory</em> to the end of the search path of the preprocessor.</p>
</td>
</tr>
<tr>
<td class="hdlist1">
Support
</td>
<td class="hdlist2">
<p>Required</p>
</td>
</tr>
<tr>
<td class="hdlist1">
Compatibility
</td>
<td class="hdlist2">
<p>NA</p>
</td>
</tr>
</table>
</div>
</div>
<div class="sect5">
<h6 id="_debug_information"><a class="anchor" href="#_debug_information"></a>4.2.1.6.5. debug information</h6>
<div class="literalblock">
<div class="content">
<pre>+g
++debug</pre>
</div>
</div>
<div class="hdlist">
<table>
<tr>
<td class="hdlist1">
Argument
</td>
<td class="hdlist2">
<p>None</p>
</td>
</tr>
<tr>
<td class="hdlist1">
Effect
</td>
<td class="hdlist2">
<p>Adds source-level debug information to the compiled output.</p>
</td>
</tr>
<tr>
<td class="hdlist1">
Support
</td>
<td class="hdlist2">
<p>Required if supported by the environment.</p>
</td>
</tr>
<tr>
<td class="hdlist1">
Compatibility
</td>
<td class="hdlist2">
<p>NA</p>
</td>
</tr>
</table>
</div>
</div>
<div class="sect5">
<h6 id="_standard_conformance"><a class="anchor" href="#_standard_conformance"></a>4.2.1.6.6. standard conformance</h6>
<div class="literalblock">
<div class="content">
<pre>+std <em>standard</em>
++standard=<em>standard</em></pre>
</div>
</div>
<div class="hdlist">
<table>
<tr>
<td class="hdlist1">
Argument
</td>
<td class="hdlist2">
<p>One of: <code>98</code>, <code>03</code>, <code>11</code>, <code>14</code>, <code>17</code>, or <code>2a</code> indicating the year of the <em>standard</em>.</p>
</td>
</tr>
<tr>
<td class="hdlist1">
Effect
</td>
<td class="hdlist2">
<p>Instructs compilation to use the given <em>standard</em> as the version of
the C++ language standard for the source TU.</p>
</td>
</tr>
<tr>
<td class="hdlist1">
Support
</td>
<td class="hdlist2">
<p>The language levels accepted, within the allowed values, is implementation defined.</p>
</td>
</tr>
<tr>
<td class="hdlist1">
Compatibility
</td>
<td class="hdlist2">
<p>Link incompatible.</p>
</td>
</tr>
</table>
</div>
</div>
<div class="sect5">
<h6 id="_warnings"><a class="anchor" href="#_warnings"></a>4.2.1.6.7. warnings</h6>
<div class="literalblock">
<div class="content">
<pre>+W <em>warning_option</em>
++warnings=<em>warning_option</em></pre>
</div>
</div>
<div class="hdlist">
<table>
<tr>
<td class="hdlist1">
Argument
</td>
<td class="hdlist2">
<p>One of: <code>off</code>, <code>on</code>, <code>all</code>, <code>error</code> indicating the level of
warnings to report and whether to treat warnings as errors.</p>
</td>
</tr>
<tr>
<td class="hdlist1">
Effect
</td>
<td class="hdlist2">
<p>Instructs compilation to: not report warnings (<code>off</code>), report a default
set of warnings that is implementation defined (<code>on</code>), to report all
possible warnings (<code>all</code>), and if instead of reporting warnings they
should be considered compilation errors (<code>errors</code>).</p>
</td>
</tr>
<tr>
<td class="hdlist1">
Support
</td>
<td class="hdlist2">
<p>Implementations are only required to have an effect for <code>off</code> and
<code>on</code> values. Other unimplemented values must be ignored.</p>
</td>
</tr>
<tr>
<td class="hdlist1">
Compatibility
</td>
<td class="hdlist2">
<p>Link compatible.</p>
</td>
</tr>
</table>
</div>
</div>
<div class="sect5">
<h6 id="_optimize"><a class="anchor" href="#_optimize"></a>4.2.1.6.8. optimize</h6>
<div class="literalblock">
<div class="content">
<pre>+O <em>optimization_level</em>
++optimize=<em>optimization_level</em></pre>
</div>
</div>
<div class="hdlist">
<table>
<tr>
<td class="hdlist1">
Argument
</td>
<td class="hdlist2">
<p>One of: <code>off</code>, <code>on</code>, <code>speed</code>, or <code>size</code>.</p>
</td>
</tr>
<tr>
<td class="hdlist1">
Effect
</td>
<td class="hdlist2">
<p>Instructs compilation to optimize the generated code using the
indicated level and type.</p>
</td>
</tr>
<tr>
<td class="hdlist1">
Support
</td>
<td class="hdlist2">
<p>Implementations are only required to have an effect for <code>off</code> and
<code>on</code> values. Other unimplemented values must be ignored.</p>
</td>
</tr>
<tr>
<td class="hdlist1">
Compatibility
</td>
<td class="hdlist2">
<p>Link compatible.</p>
</td>
</tr>
</table>
</div>
</div>
<div class="sect5">
<h6 id="_address_model"><a class="anchor" href="#_address_model"></a>4.2.1.6.9. address_model</h6>
<div class="literalblock">
<div class="content">
<pre>++address_model=<em>bits</em></pre>
</div>
</div>
<div class="hdlist">
<table>
<tr>
<td class="hdlist1">
Argument
</td>
<td class="hdlist2">
<p>A positive number greater than 0 indicating the number of bits
to base pointer and number generated instructions on.</p>
</td>
</tr>
<tr>
<td class="hdlist1">
Effect
</td>
<td class="hdlist2">
<p>Instructs compilation to generate instructions that conform to an
implementation defined size of pointers and numbers.</p>
</td>
</tr>
<tr>
<td class="hdlist1">
Support
</td>
<td class="hdlist2">
<p>The values accepted are implementation defined. And any not
understood values shall fail compilation and produce an error.</p>
</td>
</tr>
<tr>
<td class="hdlist1">
Compatibility
</td>
<td class="hdlist2">
<p>Link incompatible.</p>
</td>
</tr>
</table>
</div>
</div>
<div class="sect5">
<h6 id="_library"><a class="anchor" href="#_library"></a>4.2.1.6.10. library</h6>
<div class="literalblock">
<div class="content">
<pre>+l <em>library</em>
++library=<em>library</em></pre>
</div>
</div>
<div class="hdlist">
<table>
<tr>
<td class="hdlist1">
Argument
</td>
<td class="hdlist2">
<p>An implementation defined name of the <em>library</em>.</p>
</td>
</tr>
<tr>
<td class="hdlist1">
Effect
</td>
<td class="hdlist2">
<p>Adds the given <em>library</em> to the program linking as an already compiled
single translation unit, or collection thereof.</p>
</td>
</tr>
<tr>
<td class="hdlist1">
Support
</td>
<td class="hdlist2">
<p>Required</p>
</td>
</tr>
<tr>
<td class="hdlist1">
Compatibility
</td>
<td class="hdlist2">
<p>NA</p>
</td>
</tr>
</table>
</div>
</div>
<div class="sect5">
<h6 id="_library_directory"><a class="anchor" href="#_library_directory"></a>4.2.1.6.11. library directory</h6>
<div class="literalblock">
<div class="content">
<pre>+L <em>directory</em>
++library-dir=<em>directory</em></pre>
</div>
</div>
<div class="hdlist">
<table>
<tr>
<td class="hdlist1">
Vendor
</td>
<td class="hdlist2">
<p>gcc</p>
</td>
</tr>
<tr>
<td class="hdlist1">
Argument
</td>
<td class="hdlist2">
<p>An implementation defined path to a <em>directory</em>.</p>
</td>
</tr>
<tr>
<td class="hdlist1">
Effect
</td>
<td class="hdlist2">
<p>Adds the given <em>directory</em> to the end of the search path for finding
libraries specified with <code>++library</code> option.</p>
</td>
</tr>
<tr>
<td class="hdlist1">
Compatibility
</td>
<td class="hdlist2">
<p>NA</p>
</td>
</tr>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_prior_art"><a class="anchor" href="#_prior_art"></a>5. Prior Art</h2>
<div class="sectionbody">
<div class="sect2">
<h3 id="_clang_cl"><a class="anchor" href="#_clang_cl"></a>5.1. <code>clang-cl</code></h3>
<div class="paragraph">
<p>The Microsoft Visual Studio development environment supports using Clang
as an alternative compiler to their msvc (<code>cl.exe</code>) compiler. In order
to avoid reflecting the Clang specific options up into the IDE
<code>clang-cl</code> implements a compiler front end that translates from
msvc options to Clang options.</p>
</div>
<div class="sidebarblock">
<div class="content">
<div class="paragraph">
<p><a href="http://clang.llvm.org/docs/UsersManual.html#clang-cl">clang-cl</a> is an
alternative command-line interface to Clang, designed for compatibility with
the Visual C++ compiler, <code>cl.exe</code>.</p>
</div>
</div>
</div>
</div>
<div class="sect2">
<h3 id="_gxlc"><a class="anchor" href="#_gxlc"></a>5.2. <code>gxlc++</code></h3>
<div class="paragraph">
<p>The IBM XL C/C++ compiler implements a translation driver program that
provides a GCC compatible frontend. The express goal of the utility is to
"help you reuse make files created for applications previously developed with
GNU C/C++".</p>
</div>
<div class="sidebarblock">
<div class="content">
<div class="paragraph">
<p>XL C and XL C/C++ provides the
<a href="https://www-01.ibm.com/support/docview">gxlc and gxlc++</a>
utilities to map many GCC compiler options to their XL C and XL C/C++ counterparts.</p>
</div>
</div>
</div>
</div>
<div class="sect2">
<h3 id="_nvrtc"><a class="anchor" href="#_nvrtc"></a>5.3. NVRTC</h3>
<div class="paragraph">
<p>There is an existing example of providing a direct interface to the compiler:</p>
</div>
<div class="sidebarblock">
<div class="content">
<div class="paragraph">
<p><a href="https://docs.nvidia.com/cuda/nvrtc/index.html">NVRTC</a> is a runtime
compilation library for CUDA++</p>
</div>
</div>
</div>
<div class="paragraph">
<p>It provides for a way to take CUDA specific C++ source (as data) and compile
it to produce a CUDA specific binary executable program. Although not as simple
of an interface as we are proposing in this extension it&#8217;s very similar in
approach. Providing for the arguments to control the compile as <code>options</code>:</p>
</div>
<div class="listingblock">
<div class="content">
<pre>nvrtcResult nvrtcCompileProgram ( nvrtcProgram prog, int  numOptions, const char** options )</pre>
</div>
</div>
</div>
<div class="sect2">
<h3 id="_b2_build_system"><a class="anchor" href="#_b2_build_system"></a>5.4. <code>B2</code> build system</h3>
<div class="paragraph">
<p>The <code>B2</code> (aka Boost Build) build system uses the concept of features to
portably abstract the declaration of compiler options to a portable
specification. For example:</p>
</div>
<div class="ulist">
<ul>
<li>
<p><code>optimization=off</code> would add the compiler specific option to turn off
any code optimization.</p>
</li>
<li>
<p><code>debug-symbols=on</code> would add the compiler specific option to add source
level debugging information to the output.</p>
</li>
<li>
<p><code>address-model=64</code> would add compiler specific options to generate
64-bit addressing only code.</p>
</li>
</ul>
</div>
</div>
<div class="sect2">
<h3 id="_cmake_build_system"><a class="anchor" href="#_cmake_build_system"></a>5.5. Cmake build system</h3>
<div class="paragraph">
<p>Like the features of <code>b2</code> modern Cmake also implements a series of
variables that provide an abstraction to common compiler options.
For example:</p>
</div>
<div class="ulist">
<ul>
<li>
<p><code>set_property(TARGET foo PROPERTY CXX_STANDARD 11)</code> would add the compiler
specific option to restrict compilation to use Standard C++11 features.</p>
</li>
</ul>
</div>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_acknowledgements"><a class="anchor" href="#_acknowledgements"></a>6. Acknowledgements</h2>
<div class="sectionbody">
<div class="paragraph">
<p>Thanks to CppCon 2017 for providing the environment for "arguments" about
build systems, package managers, and dependency managers that created the
impetus for this idea.</p>
</div>
<div class="paragraph">
<p>Thanks to Jonathan Müller, Ben Craig, Corentin Jabot, Dan Kalowsky, Steve Downey,
Breno Rodrigues Guimarães, Robert Maynard, and others in the CppLang
Slack community who provided feedback to the draft version of this document.</p>
</div>
<div class="paragraph">
<p>Thanks to JF Bastien, Peter Sommerlad and others in the SG15 reflector
for providing valuable insights from the easrly draft of this document.</p>
</div>
<div class="paragraph">
<p>Special thanks to Peter Dimov and Vinnie Falco for reading and pointing out
some obvious English spelling and grammar mistakes.</p>
</div>
</div>
</div>
</div>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/styles/github.min.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/highlight.min.js"></script>
<script>hljs.initHighlighting()</script>
</body>
</html>