directory-structure.htm 35 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859
  1. <html>
  2. <head>
  3. <meta http-equiv="Content-Type"
  4. content="text/html; charset=iso-8859-1">
  5. <meta name="Template"
  6. content="C:\PROGRAM FILES\MICROSOFT OFFICE\OFFICE\html.dot">
  7. <meta name="GENERATOR" content="Microsoft FrontPage Express 2.0">
  8. <title></title>
  9. </head>
  10. <body bgcolor="#FFFFFF" link="#0000FF" vlink="#800080">
  11. <h2 align="center">A Proposal for the Boost Directory Structure</h2>
  12. <p align="center">By John Maddock.</p>
  13. <p>The following proposal consists of three sections: A list of
  14. requirements and objectives that the chosen structure must meet,
  15. a set of tools to facilitate working with boost, and an actual
  16. proposal for a structure that meets those requirements. In the
  17. past I have argued vociferously for a &quot;do as little as
  18. possible&quot; approach, however I have somewhat surprised myself
  19. by coming out in favour of a radical reorganisation here. In many
  20. ways though, the proposed directory structure is less important
  21. than its ability to meet the requirements listed below, nor is it
  22. the only structure that could arguably meet these requirements (especially
  23. as some requirements are contradictory). Finally a couple of
  24. caveats: All opinions expressed herein are my own; all ideas
  25. expressed herein belong to over people (especially the good ones!).
  26. Where possible credits are given, but my memory is far from
  27. infallible so speak up if you've been missed out.</p>
  28. <h2 align="center">Requirements</h2>
  29. <h3>Consistency</h3>
  30. <blockquote>
  31. <p><b>Comment</b>: this should speak for itself.</p>
  32. </blockquote>
  33. <h3>Discoverability</h3>
  34. <p>That is a casual user browsing the directory structure should
  35. be able to immediately tell what belongs where.</p>
  36. <blockquote>
  37. <p><b>Rationale</b>: some users read the documentation,
  38. others wander around aimlessly saying: &quot;I wonder what's
  39. in here?&quot;, speak up if you recognise anyone!</p>
  40. <p><b>Rationale</b>: automated tools should be able to glean
  41. most of the information they need direct from the directory
  42. structure.</p>
  43. <p><b>Comment</b>: This is probably the most important
  44. requirement and guides the choice of many others.</p>
  45. </blockquote>
  46. <h3>Boost is a single library</h3>
  47. <blockquote>
  48. <p>From an end users perspective boost should appear to be a
  49. single library, with a single integrated build process etc.</p>
  50. <p><b>Rationale</b>: This makes life much more comfortable
  51. for end uses.</p>
  52. </blockquote>
  53. <h3>Boost is a collection of separate libraries</h3>
  54. <blockquote>
  55. <p><b>Rationale</b>: some libraries have an existence of
  56. their own outside of boost, this should be able to continue.</p>
  57. <p><b>Rationale</b>: different developers maintain individual
  58. boost libraries.</p>
  59. <p><b>Rationale</b>: as boost grows it may be necessary to
  60. split the library into multiple zip file downloads, each
  61. download should encapsulate one domain, and provide all the
  62. files necessary for that domain (that may mean that some
  63. files appear in more than one zip file).</p>
  64. <p><b>Rationale</b>: some users will want to split off (and
  65. maybe freeze) those parts of boost that are being used by a
  66. particular project. These sub-libraries can then be checked
  67. into the users own version control system (for example into a
  68. local cvs repository as a vendor branch), and maintained
  69. alongside the users own source for that project.</p>
  70. <p><b>Implication:</b> that there exists some mechanism for
  71. locating and separating off all the files associated with a
  72. particular boost library, this should also take into account
  73. dependencies (both for headers and for binary dependencies).</p>
  74. </blockquote>
  75. <h3>Individual boost libraries can be checked out from the cvs
  76. repository</h3>
  77. <blockquote>
  78. <p>For example &quot;<code>cvs checkout regex</code>&quot;
  79. would check out the regex library alone.</p>
  80. <p><b>Rationale</b>: This makes maintenance much easier
  81. especially when working with cvs-branches.</p>
  82. <p><b>Implication</b>: we could isolate libraries into
  83. separate directories, however that's only a partial solution
  84. which takes no account of library dependencies (something
  85. that's likely to become increasingly important). A better
  86. solution is to use cvs module-aliases: as a test case I've
  87. defined the regex library as a module-alias (this seems to
  88. work very well). In this case I had to specify dependencies
  89. by hand (an error prone process), much better would be a tool
  90. that produced a list of library aliases to insert directly
  91. into the cvs modules file.</p>
  92. </blockquote>
  93. <h3>Boost libraries can have dependencies to other libraries</h3>
  94. <blockquote>
  95. <p>There are three kinds of dependency possible:</p>
  96. <ol>
  97. <li>Libraries may depend upon the headers from other
  98. boost libraries; these dependencies can be worked out
  99. automatically.</li>
  100. <li>Libraries may depend upon binaries from other boost
  101. libraries; these dependencies can be worked out
  102. automatically (hint: if library X depends upon header
  103. H, and header H is from a library Y which has
  104. mandatory source code associated with it, then there
  105. is a binary dependency from X to Y).</li>
  106. <li>Some domain specific libraries may depend upon third
  107. party libraries (the python library for example).
  108. These dependencies can not be deduced, and will
  109. require meta-data to describe.</li>
  110. </ol>
  111. <p><b>Rationale: </b>these dependencies already exist in the
  112. boost library.</p>
  113. </blockquote>
  114. <h3>Usable &quot;as is&quot;</h3>
  115. <blockquote>
  116. <p>That is the library should be usable directly from the
  117. checked out cvs tree, or the extracted zip file, without a
  118. mandatory install process.</p>
  119. <p><b>Rationale:</b> For single user installations it is
  120. sufficient and often easier to work directly from the zip/cvs
  121. structure.</p>
  122. <p><b>Rationale: </b>For &quot;occasional developers&quot;
  123. this simplifies their ability to port/debug parts of the
  124. library, and then submit patches based on changes made,
  125. without having to get involved with &quot;wrapper compilers&quot;
  126. and other tools that have been suggested, which may or may
  127. not function on their platform with their toolset.</p>
  128. <p><b>Implication:</b> that all header files are located
  129. together, and not split between multiple library paths.</p>
  130. <p><b>Comments:</b> during the recent discussion it was
  131. suggested splitting the header files into separate
  132. directories under &quot;boost-root/src/libname/boost&quot;,
  133. however this involves specifying a large number of -I options
  134. on the command line in order to be able to use boost direct
  135. from the cvs tree. One suggested workaround was to use a
  136. wrapper-compiler to pass the long list of includes to the
  137. compiler semi-automatically. However some compilers are
  138. integrated with their respective IDE's (this would make boost
  139. almost impossible to use from that IDE), other platforms/compilers
  140. have a restricted command line length (mingw32 is a
  141. particular culprit), the command line in such cases could
  142. easily become longer than the maximum permitted.</p>
  143. </blockquote>
  144. <h3>Header include mechanism reflects library name</h3>
  145. <blockquote>
  146. <p>We currently use:</p>
  147. <p><code>#include &lt;boost/something.hpp&gt;</code></p>
  148. <p>which immediately informs a casual browser of the code
  149. that something.hpp is a part of the boost library and
  150. separates it from:</p>
  151. <p><code>#include &lt;rw/thread.h&gt; // this is Rogue Wave
  152. library</code></p>
  153. <p><b>Rationale</b>: This has worked well up to now and
  154. should be continued.</p>
  155. <p><b>Implication</b>: The boost-root/boost/ directory must
  156. continue to exist (although there are possible arguments in
  157. favour of making it boost-root/include/boost).</p>
  158. </blockquote>
  159. <h3>Libraries can have &quot;non-end user&quot; header files.</h3>
  160. <blockquote>
  161. <p>There are several kinds of header that come into this
  162. category:</p>
  163. <blockquote>
  164. <p><b>Power user headers</b>: headers that should only be
  165. used by experts.</p>
  166. <p><b>Headers for library reuse</b>: these headers can be
  167. used by other boost libraries, but should not be used by
  168. end users.</p>
  169. <p><b>Domain specific headers</b>: large domain specific
  170. libraries may have a large number of headers that should
  171. not make it into the main boost-root/boost/ header
  172. directory (graph for example).</p>
  173. <p><b>Implementation headers</b>: libraries may have
  174. headers that contain implementation code, these headers
  175. should never be included by anything except other headers
  176. <i>in this library</i>.</p>
  177. </blockquote>
  178. <p><b>Implication: </b>the main header directory may contain
  179. sub-directories as follows:</p>
  180. <blockquote>
  181. <p>boost-root/boost/library-name/ for all non-end user
  182. headers, including domain specific headers.</p>
  183. <p>boost-root/boost/library-name/detail/ for all
  184. implementation detail headers.</p>
  185. </blockquote>
  186. </blockquote>
  187. <h3>Libraries can be combined into domains</h3>
  188. <blockquote>
  189. <p>For example we may want to combine multiple math-related
  190. libraries into a single &quot;numeric&quot; domain. In this
  191. case each library in the domain would have it's own directory
  192. under the domain name directory - for example headers for the
  193. rational library may end up in boost-root/boost/numeric/rational/.</p>
  194. <p><b>Rationale</b>: the aim here is to prevent the number of
  195. top level libraries growing to an unmanageable number, and to
  196. allow a logical group of libraries to be accessed with a
  197. single name (for cvs checkouts or for building part of boost).</p>
  198. </blockquote>
  199. <h3>Root directory name reflects boost version</h3>
  200. <blockquote>
  201. <p>That is the name of the root directory in the zip file
  202. reflects the boost version number &quot;boost_1_1_9/&quot;
  203. etc, subsequent directories - like the boost header file
  204. directory - then split off from this.</p>
  205. <p><b>Rationale: </b>Allows developers to have multiple
  206. versions coexisting on their machine within a single
  207. directory structure, developers can switch between versions
  208. with a by changing their compilers include and library search
  209. paths only.</p>
  210. </blockquote>
  211. <h3>Consistent handling of development code</h3>
  212. <blockquote>
  213. <p>If there exists development or non-reviewed code in the
  214. cvs tree then it should not interfere with release code or
  215. exist in the same directory tree as the release code. Nor
  216. should development code appear in zip files.</p>
  217. <p><b>Rationale</b>: developers will typically work with
  218. either the latest release code, or the latest development
  219. code, they should be able to switch between them fairly
  220. easily.</p>
  221. <p><b>Rationale</b>: end users don't generally need to see
  222. development code, it unnecessarily duplicates what's already
  223. in the library and may lead to confusion as to what's release
  224. code and what's still in development.</p>
  225. <p><b>Implication</b>: There are a couple of ways of dealing
  226. with this.</p>
  227. <blockquote>
  228. <p><b>Method 1</b>: provide a subdirectory &quot;<code>boost-root/development/library-name/</code>&quot;
  229. that internally mirrors the directory structure of <code>boost-root/</code>,
  230. to contain development code for library &quot;library-name&quot;.
  231. This has the advantage of being easy to work with, but
  232. requires setting multiple include and library search
  233. paths, it also complicates multiple development versions
  234. of the same library (for example multiple ports to new
  235. platforms may proceed in parallel).</p>
  236. <p><b>Method 2</b>: provide a separate top-level CVS
  237. directory for development code, development code could
  238. then be checked out with &quot;<code>cvs checkout
  239. development&quot;</code> instead of &quot;<code>cvs
  240. checkout boost&quot;</code>, otherwise this method is the
  241. same as Method 1 above, and has the same pros and cons.</p>
  242. <p><b>Method 3</b>: use a cvs branch for development work.
  243. This allows multiple development efforts to proceed in
  244. parallel, but may be harder to work with and keep in
  245. synch with the main branch.</p>
  246. </blockquote>
  247. <p>Ideally<b> </b>I see no reason why either method 1 or 2
  248. can't coexist with method 3, depending which method is easier
  249. for the task in hand. Personally I prefer (2) to (1), but
  250. that's just personal preference.</p>
  251. </blockquote>
  252. <h3>Mandatory Source code is centrally located</h3>
  253. <blockquote>
  254. <p>That is that there is some central directory (let's call
  255. it boost-root/src/) that contains all mandatory source files
  256. for a particular library in its sub-directories: boost-root/src/library1/,
  257. boost-root/src/library2/ etc.</p>
  258. <p><b>Rationale: </b>This ensures that the source is easily
  259. discoverable by the user; for example if a user suspects that
  260. there may be a bug in library X, and decides to try and debug
  261. the problem, they may want to add all the source code for
  262. library X directly to their project to facilitate debugging.
  263. (I appreciate that the build process <i>may</i> provide
  264. debugging versions of the library, but it is still often
  265. easier to add the source direct to the IDE's project,
  266. depending upon how well the IDE handles debugging of external
  267. libraries).</p>
  268. <p><b>Rationale: </b>some IDE's have search paths for source
  269. files as well as headers etc, this structure shortens the
  270. paths to mandatory source files (this is more of a feature
  271. request than a requirement).</p>
  272. </blockquote>
  273. <h3>Directories containing documentation contain an index.html
  274. file, and nothing but documentation</h3>
  275. <blockquote>
  276. <p><b>Rationale</b>: Some file browsers (KFM for example)
  277. will automatically display documentation when they see either
  278. index.htm or index.html in the current directory. Any other
  279. files located in that directory effectively become &quot;hidden&quot;
  280. from the user. Whether this is an annoyance or a great
  281. feature depends upon your point of view. Separating
  282. documentation into it's own sub-directory solves this problem
  283. (it happens to make installation of the documentation easier
  284. as well).</p>
  285. <p><b>Footnote</b>: actually KFM is usually quite intelligent
  286. about displaying documentation, however it does sometimes get
  287. it wrong.</p>
  288. </blockquote>
  289. <h3>Boost supports an integrated build process</h3>
  290. <blockquote>
  291. <p><b>Rationale</b>: Currently most boost libraries are
  292. &quot;headers only&quot;, those that are not have their own
  293. build processes or none at all. This is confusing for the end
  294. user, especially as boost is likely to get much larger.</p>
  295. </blockquote>
  296. <h3>Boost supports building of separate sub-libraries</h3>
  297. <blockquote>
  298. <p><b>Rationale</b>: Building boost as a single monolithic
  299. library is likely to put end users off - especially as boost
  300. grows in size - few users will use all of boost in a single
  301. project (even if they use all of it at some time or another).</p>
  302. <p><b>Implication</b>: Build each boost library separately
  303. using a consistent naming scheme incorporating the library
  304. name and the compiler name: libboost_timer_gcc.so, libboost_regex_gcc.so,
  305. lib_boost_thread_gcc.so etc. Provide a monolithic version of
  306. the library as an option for those that want a simple life (this
  307. is mainly more appropriate for static libraries where unused
  308. library code doesn't make it into the executable).</p>
  309. </blockquote>
  310. <h3>Boost supports multiple compiler build options.</h3>
  311. <blockquote>
  312. <p><b>Rationale</b>: some compilers ship with multiple run-time
  313. libraries. For example the Borland C++ compiler comes with 6
  314. different runtimes, any third party libraries must be built
  315. with the same runtime options as the executable to which it
  316. will be linked, failure to observe this rule leads to hard to
  317. track down runtime crashes.</p>
  318. <p><b>Implication</b>: boost libraries must each be built
  319. multiple times with the same runtime variants that the
  320. compiler ships with. As before name mangling separates the
  321. variants: </p>
  322. </blockquote>
  323. <pre> boost_regex_bc55_cw.lib
  324. boost_regex_bc55_cwi.lib
  325. boost_regex_bc55_cwi.dll
  326. boost_regex_bc55_cwm.lib
  327. boost_regex_bc55_cwmi.lib
  328. boost_regex_bc55_cwmi.dll
  329. boost_regex_bc55_cp.lib
  330. boost_regex_bc55_cpi.lib
  331. boost_regex_bc55_cpi.dll</pre>
  332. <blockquote>
  333. <p>(for non-Borland users the suffixes chosen here reflect
  334. the names of Borland's own runtime libraries).</p>
  335. </blockquote>
  336. <h3>Boost's build system uses the minimal amount of meta-data
  337. required.</h3>
  338. <blockquote>
  339. <p><b>Rationale</b>: some meta-data is likely to be required,
  340. but to reduce maintenance requirements this should be as
  341. small as possible. Generally speaking the smaller the meta-data
  342. requirement the more likely it is that the build system is in
  343. synch with the library. The worst case would be hand-crafted
  344. makefiles (hard to maintain), the best case no meta-data at
  345. all; for example the directory structure describes the
  346. library well enough that makefiles (or their equivalent) can
  347. be automatically generated.</p>
  348. </blockquote>
  349. <h3>Boost supports installation to a central location</h3>
  350. <blockquote>
  351. <p><b>Rationale</b>: most unix variants more or less require
  352. an install step before using third party libraries, this also
  353. allows network installs (for multiple compilers and/or
  354. platforms if required), from a single source tree.</p>
  355. </blockquote>
  356. <blockquote>
  357. <p><b>Implication</b>: Keep the boost directory structure as
  358. close as possible to the install structure to simplify the
  359. installation process (strictly speaking this is not an
  360. absolute requirement, but cross-platform installation is hard
  361. enough with making it any harder than it needs to be). The
  362. easiest way is to keep the documentation/header/build trees
  363. separate.</p>
  364. </blockquote>
  365. <h3>The boost directory structure should be &quot;optimally
  366. branched&quot;</h3>
  367. <blockquote>
  368. <p>This is a nebulous requirement that is based as much on
  369. personal preference as anything else.</p>
  370. <p><b>Rationale</b>: the directory structure is more &quot;discoverable&quot;
  371. if it branches consistently - that is with no directories
  372. with a massive number of entries.</p>
  373. <p><b>Implication</b>: where appropriate combine related
  374. libraries into domains.</p>
  375. <p><b>Implication</b>: avoid directories with a single sub-directory
  376. entry (redundancy).</p>
  377. </blockquote>
  378. <h2 align="center">Proposed tools to aid boost management (build
  379. system)</h2>
  380. <p>While writing the requirements above one theme kept
  381. reoccurring; that of interdependency of boost libraries, and the
  382. need for an automated tool to deal with this problem. In fact
  383. from a code-reuse point of view, we need a library that describes
  384. the boost library and determines library dependencies that can
  385. then be reused in multiple tools. In my view the gains in ease of
  386. management, and automatic generation of makefiles etc, means that
  387. these tools should be developed regardless of the actual
  388. directory structure chosen (although the code will probably be
  389. dependent upon the directory structure chosen).</p>
  390. <h3>Dependency library</h3>
  391. <blockquote>
  392. <p>This library would define two types:</p>
  393. <p><b>Library</b>: defines the files that belong to a
  394. particular library, plus header file dependencies and a list
  395. of binary dependencies to other boost libraries.</p>
  396. <p><b>Libraries</b>: a collection of Library objects, also
  397. maintains a database of which header belongs to which library
  398. (used to calculate binary dependencies).</p>
  399. <p>As far as is possible, these types should be able to load
  400. themselves directly from the boost directory structure, with
  401. only a minimal amount of meta-data used to describe the
  402. unusual cases.</p>
  403. </blockquote>
  404. <h3>Paths library</h3>
  405. <p>In order for the dependency library to do it's job it is
  406. necessary to iterate over a directory structure, join and split
  407. path names, and convert path names to/from a platform specific
  408. format. For example to insert relative-paths into makefiles which
  409. may be used on platforms other than the one on which the makefile
  410. is generated. Some, but by no means all, of this functionality is
  411. already covered by Dietmar Kühl's dir_it library.</p>
  412. <h3>Automatic alias generation</h3>
  413. <p>This is a short program that just iterates through a Libraries
  414. collection and prints out the dependencies, so that the result
  415. can be cut and pasted into the cvs modules file.</p>
  416. <h3>Boost distiller</h3>
  417. <p>This is almost the same program as the alias generator, but
  418. copies files to a new location instead of printing them out. Used
  419. to &quot;distil&quot; out a subset of the boost library (including
  420. dependencies). This can be used to: split boost into multiple (domain
  421. specific) zip files for easier download, or split out that subset
  422. of boost that is being used by a particular project (for
  423. integration with the project without getting the whole of boost).</p>
  424. <h3>Build system</h3>
  425. <p>By combining the description of the boost library contained in
  426. a Libraries object with a description of the compiler/platform in
  427. use, it is possible to do one of two things: directly build the
  428. library, or output compiler/platform specific makefiles for
  429. distribution with boost. For brevity I'm going to skip over a
  430. description of this here - my pencil and paper sketch has a list
  431. of around 14 points of variation between compilers, and another
  432. list of 7 options for each compiler configuration (release, debug,
  433. static, dynamic etc). Probably even this fairly long list is not
  434. complete.</p>
  435. <p>I'm assuming that the build system will probably output
  436. makefiles in the first instance; apart from anything else, most
  437. compilers come with some kind of make, using this avoids the need
  438. for the end user to have to build/install any tools that do not
  439. ship with their compiler. Here I'm assuming that the boost
  440. library maintainers periodically generate the makefiles, and then
  441. ship them with the library.</p>
  442. <h2 align="center">The directory structure</h2>
  443. <table border="0" cellpadding="7" cellspacing="1" width="100%">
  444. <tr>
  445. <td valign="top" width="6%">&nbsp;</td>
  446. <td valign="top" width="44%" bgcolor="#008080">Directory</td>
  447. <td valign="top" width="43%" bgcolor="#008080">Description</td>
  448. <td valign="top" width="7%">&nbsp;</td>
  449. </tr>
  450. <tr>
  451. <td valign="top" width="6%">&nbsp;</td>
  452. <td valign="top" width="44%" bgcolor="#C0C0C0">Boost-root/boost/</td>
  453. <td valign="top" width="43%" bgcolor="#C0C0C0">All entry
  454. point boost headers, mainly these should be called &quot;library-name.hpp&quot;</td>
  455. <td valign="top" width="7%">&nbsp;</td>
  456. </tr>
  457. <tr>
  458. <td valign="top" width="6%">&nbsp;</td>
  459. <td valign="top" width="44%" bgcolor="#C0C0C0">Boost-root/boost/library-name/</td>
  460. <td valign="top" width="43%" bgcolor="#C0C0C0">All domain
  461. specific headers, all &quot;expert-user&quot; non-entry
  462. point headers.</td>
  463. <td valign="top" width="7%">&nbsp;</td>
  464. </tr>
  465. <tr>
  466. <td valign="top" width="6%">&nbsp;</td>
  467. <td valign="top" width="44%" bgcolor="#C0C0C0">Boost-root/boost/library-name/detail/</td>
  468. <td valign="top" width="43%" bgcolor="#C0C0C0">All
  469. implementation private headers.</td>
  470. <td valign="top" width="7%">&nbsp;</td>
  471. </tr>
  472. <tr>
  473. <td valign="top" width="6%">&nbsp;</td>
  474. <td valign="top" width="44%" bgcolor="#C0C0C0">Boost-root/src/library-name/</td>
  475. <td valign="top" width="43%" bgcolor="#C0C0C0">All
  476. mandatory source files.</td>
  477. <td valign="top" width="7%">&nbsp;</td>
  478. </tr>
  479. <tr>
  480. <td valign="top" width="6%">&nbsp;</td>
  481. <td valign="top" width="44%" bgcolor="#C0C0C0">Boost-root/src/library-name/config/</td>
  482. <td valign="top" width="43%" bgcolor="#C0C0C0">Any
  483. private configuration code (for example autoconf scripts),
  484. if these grow then we could move to an integrated
  485. configure system in Boost-root/config/ but that isn't
  486. currently necessary.</td>
  487. <td valign="top" width="7%">&nbsp;</td>
  488. </tr>
  489. <tr>
  490. <td valign="top" width="6%">&nbsp;</td>
  491. <td valign="top" width="44%" bgcolor="#C0C0C0">Boost-root/src/library-name/build/</td>
  492. <td valign="top" width="43%" bgcolor="#C0C0C0">Temporary
  493. location for private build systems, until the boost-wide
  494. integrated build comes on line.</td>
  495. <td valign="top" width="7%">&nbsp;</td>
  496. </tr>
  497. <tr>
  498. <td valign="top" width="6%">&nbsp;</td>
  499. <td valign="top" width="44%" bgcolor="#C0C0C0">Boost-root/docs/</td>
  500. <td valign="top" width="43%" bgcolor="#C0C0C0">All common
  501. documentation.</td>
  502. <td valign="top" width="7%">&nbsp;</td>
  503. </tr>
  504. <tr>
  505. <td valign="top" width="6%">&nbsp;</td>
  506. <td valign="top" width="44%" bgcolor="#C0C0C0">Boost-root/docs/library-name/</td>
  507. <td valign="top" width="43%" bgcolor="#C0C0C0">All
  508. documentation for &quot;library-name&quot;; must include
  509. an index.htm file.</td>
  510. <td valign="top" width="7%">&nbsp;</td>
  511. </tr>
  512. <tr>
  513. <td>&nbsp;</td>
  514. <td valign="top" bgcolor="#C0C0C0">Boost-root/licence</td>
  515. <td bgcolor="#C0C0C0">A &quot;generic&quot; boost licence
  516. that describes the minimal guarantees made by all boost
  517. libraries (free for commercial use etc), with sub-directories
  518. for those boost libraries that have their own licences (currently
  519. just regex and graph, but this number is likely to grow).</td>
  520. <td>&nbsp;</td>
  521. </tr>
  522. <tr>
  523. <td valign="top" width="6%">&nbsp;</td>
  524. <td valign="top" width="44%" bgcolor="#C0C0C0">Boost-root/tests/library-name/</td>
  525. <td valign="top" width="43%" bgcolor="#C0C0C0">All test
  526. programs for &quot;library-name&quot;. These may be
  527. either: a single (multi-file) test program, multiple
  528. single file test programs, or multiple sub-directories (one
  529. for each test program).</td>
  530. <td valign="top" width="7%">&nbsp;</td>
  531. </tr>
  532. <tr>
  533. <td valign="top" width="6%">&nbsp;</td>
  534. <td valign="top" width="44%" bgcolor="#C0C0C0">Boost-root/examples/library-name/</td>
  535. <td valign="top" width="43%" bgcolor="#C0C0C0">All
  536. example programs for &quot;library-name&quot;. These may
  537. be either: a single (multi-file) example program,
  538. multiple single file example programs, or multiple sub-directories
  539. (one for each example program).</td>
  540. <td valign="top" width="7%">&nbsp;</td>
  541. </tr>
  542. <tr>
  543. <td valign="top" width="6%">&nbsp;</td>
  544. <td valign="top" width="44%" bgcolor="#C0C0C0">Boost-root/tools/tool-name/</td>
  545. <td valign="top" width="43%" bgcolor="#C0C0C0">Contains
  546. all files required to build and use the specified tool (makefile
  547. generators etc).</td>
  548. <td valign="top" width="7%">&nbsp;</td>
  549. </tr>
  550. <tr>
  551. <td valign="top" width="6%">&nbsp;</td>
  552. <td valign="top" width="44%" bgcolor="#C0C0C0">Boost-root/build/</td>
  553. <td valign="top" width="43%" bgcolor="#C0C0C0">The boost
  554. build system. Consists of a collection of makefiles (one
  555. for each supported compiler), plus subdirectories: libs/
  556. for built libraries, bin/ for built dll's (win32 only)
  557. and obj/ for object files.</td>
  558. <td valign="top" width="7%">&nbsp;</td>
  559. </tr>
  560. </table>
  561. <p>&nbsp;</p>
  562. <p>There are a couple of myths surrounding this structure that
  563. need exploding:</p>
  564. <h4>It is hard to check in new libraries to the cvs repository</h4>
  565. <p>Not true: if the submission arrives as a zip file containing
  566. the directory structure described above, then the command:</p>
  567. <p><code>cvs import boost library-name library-name-sub</code></p>
  568. <p>will import the whole of the <i>current</i> directory tree and
  569. &quot;intermingle&quot; it with the existing boost tree in the
  570. repository.</p>
  571. <p>There is one caveat to this however: if the imported source
  572. contains some files that were already in the boost directory tree
  573. (probably not a common situation), then an additional merge and
  574. resolve conflicts step arises:</p>
  575. <p>On the main branch working copy:</p>
  576. <p><code>cvs checkout -jlibrary-name-sub boost</code></p>
  577. <p>Resolve any conflicts, and then:</p>
  578. <p><code>cvs commit</code></p>
  579. <p>The latter two steps should not be necessary in most cases,
  580. and occur whatever directory structure is used (it is probably
  581. easier in most cases to resolve such conflicts manually before
  582. importing the new sources).</p>
  583. <h4>It is hard to checkout or to commit individual boost
  584. libraries.</h4>
  585. <p>By using cvs aliases (defined in the modules file) this
  586. situation does not arise, just specify the module/alias name when
  587. performing a checkout/commit.</p>
  588. <h2 align="center">Migrating to the new structure</h2>
  589. <p>This is probably the hardest and most painful part of the
  590. whole process. I'm going to suggest a migration method as follows:</p>
  591. <ol>
  592. <li>Instigate a moratorium on cvs commits.</li>
  593. <li>Copy the files to the new structure and commit the
  594. changes, leaving the boost-root/libs/ directory in place
  595. for now.</li>
  596. <li>Fix html links, and documentation descriptions of file
  597. locations.</li>
  598. <li>Fix any library specific scripts/makefiles.</li>
  599. <li>Publish the new structure (as a zip-file beta
  600. distribution) and ask boost users/authors to check that
  601. everything looks OK.</li>
  602. <li>Delete the boost-root/libs/ directory (actually this is
  603. quite hard, as cvs has no method for removing whole
  604. directory trees).</li>
  605. <li>Lift the moratorium on changes.</li>
  606. <li>Publish the next boost revision with the new structure.</li>
  607. </ol>
  608. <p>The whole process described above is quite likely to take 1-2
  609. weeks, during which no changes can be committed; this is going to
  610. require a fair amount of co-ordination between developers (actually
  611. this applies to any major change to the directory structure,
  612. irrespective of what the change is).</p>
  613. <p>You will note that I haven't mentioned a time scale for the
  614. associated tools that I have suggested, probably these will need
  615. to be developed after the directory structure changes - although
  616. I believe it is possible to develop a minimal subset (the library
  617. description and alias generator) before making the changes if
  618. that is required.</p>
  619. <p>&nbsp;</p>
  620. <p>There were a couple of other directory structures that were
  621. evaluated while preparing this document:</p>
  622. <p><i>The &quot;half way house structure&quot;:</i></p>
  623. <p>This is the same as the current structure, but moves mandatory
  624. source files to boost-root/src/libname. This is easier to migrate
  625. to from the current structure, but was felt to be neither one
  626. thing nor the other.</p>
  627. <p><i>The &quot;skinny root structure&quot;:</i></p>
  628. <p>This was proposed by John David, and Lois Goldthwaite, and
  629. moves the contents of the current boost-root/libs/ directory into
  630. boost-root/boost/. My main objection to this proposal is that it
  631. is less &quot;discoverable&quot; than the one presented here - my
  632. immediate reaction was &quot;where has everything gone&quot; - I
  633. also dislike mixing headers and non-headers in the same tree.
  634. However I'm prepared to accept that this could just be due to
  635. personal bias.</p>
  636. <h2 align="center">Acknowledgements</h2>
  637. <p>The following people have had their ideas reused,
  638. reconstituted and reformulated :-)</p>
  639. <p>Beman Dawes, Ed Brey, Walter E. Brown, John (EBo) David, Jeff
  640. Garland, Lois Goldthwaite, Jens Maurer, Jeff Squyres, Gary Powell
  641. and Daryle Walker.</p>
  642. <p>
  643. <hr>
  644. <p>
  645. <h2 align="center">An Alternative Directory Structure</h2>
  646. <p align="center">By Jens Maurer</p>
  647. I favor the following structure, which puts different emphasis on the
  648. some of the requirements.
  649. <p>
  650. <table border="1">
  651. <tr>
  652. <th>Directory</th>
  653. <th>Description</th>
  654. </tr>
  655. <tr>
  656. <td>Boost-root/include/boost/</td>
  657. <td>All entry-point boost headers, mainly these should be called
  658. "library-name.hpp".</td>
  659. </tr>
  660. <tr>
  661. <td>Boost-root/include/boost/.../</td>
  662. <td>Domain-specific subdirectory; the "..." can be empty or
  663. arbitrarily nested while observing the "optimally branched"
  664. requirement.</td>
  665. </tr>
  666. <tr>
  667. <td>Boost-root/include/boost/.../library-name/</td>
  668. <td>All domain-specific headers, all "expert-user" non-entry point
  669. headers.</td>
  670. </tr>
  671. <tr>
  672. <td>Boost-root/include/boost/.../library-name/detail/</td>
  673. <td>All implementation private headers.</td>
  674. </tr>
  675. <tr>
  676. <td>Boost-root/libs/.../</td>
  677. <td>Main directory for a given subdomain; the "..." can be empty or
  678. arbitrarily nested while observing the "optimally branched"
  679. requirement. The "..." must correspond to some "..." in the header
  680. tree. The directory should contain a "index.html" which links to all
  681. libraries and subdomains contained.</td>
  682. </tr>
  683. <tr>
  684. <td>Boost-root/libs/.../library-name/</td>
  685. <td>Main directory for a given library.</td>
  686. </tr>
  687. <tr>
  688. <td>Boost-root/libs/.../library-name/src/</td>
  689. <td>All mandatory source files for the library.</td>
  690. </tr>
  691. <tr>
  692. <td>Boost-root/libs/.../library-name/build/</td>
  693. <td>Temporary location for private build system, until the boost-wide
  694. integrated build becomes available.</td>
  695. </tr>
  696. <tr>
  697. <td>Boost-root/libs/.../library-name/config/</td>
  698. <td>Any private configuration code (for example, autoconf
  699. scripts).</td>
  700. </tr>
  701. <tr>
  702. <td>Boost-root/libs/.../library-name/doc/</td>
  703. <td>All documentation for the library.</td>
  704. </tr>
  705. <tr>
  706. <td>Boost-root/libs/.../library-name/test/</td>
  707. <td>All regression tests for the library, suitable for the regression
  708. test suite. Due to test execution time constraints, not all of the tests
  709. may actually be added to "regression.cfg".</td>
  710. </tr>
  711. <tr>
  712. <td>Boost-root/libs/.../library-name/example/</td>
  713. <td>All example programs for "library-name". These may be either: a
  714. single (multi-file) example program, multiple single file example
  715. programs, or multiple sub-directories (one for each example
  716. program).</td>
  717. </tr>
  718. <tr>
  719. <td>Boost-root/tools/tool-name/</td>
  720. <td>Contains all files required to build and use the specified tool
  721. (makefile generators etc).</td>
  722. </tr>
  723. <tr>
  724. <td>Boost-root/build</td>
  725. <td>The boost build system (user front-end; tools go in the "tools"
  726. hierarchy). Details still hazy.</td>
  727. </tr>
  728. <tr>
  729. <td>Boost-root/more/license.html</td>
  730. <td>A "generic" boost license that describes the minimal guarantee
  731. provided by all boost libraries. This should get a prominent link on
  732. the main boost page.</td>
  733. </tr>
  734. </table>
  735. <p>
  736. Note that the "include" path component contains only one subdirectory
  737. "boost" and thus violates the "optimally branched" requirement. It
  738. helps with discoverability, though, because people know what to expect
  739. under any directory named "include", i.e. header files.
  740. </body>
  741. </html>
粤ICP备19079148号