PageRenderTime 40ms CodeModel.GetById 16ms RepoModel.GetById 0ms app.codeStats 1ms

/skychart-3.6-2150-src/tools/doc/wiki_doc/en/documentation/installation_and_compilation_of_the_source_code.html

#
HTML | 281 lines | 228 code | 45 blank | 8 comment | 0 complexity | ca906704bd29cb20d46ca0d1f43af177 MD5 | raw file
Possible License(s): GPL-2.0, LGPL-2.0, BSD-3-Clause, LGPL-2.1
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  2. "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  3. <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"
  4. lang="en" dir="ltr">
  5. <head>
  6. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  7. <title>en:documentation:installation_and_compilation_of_the_source_code</title>
  8. <meta name="generator" content="DokuWiki Release 2009-12-25c &quot;Lemming&quot;" />
  9. <meta name="robots" content="index,follow" />
  10. <meta name="date" content="2011-09-29T14:59:19+0200" />
  11. <meta name="keywords" content="en,documentation,installation_and_compilation_of_the_source_code" />
  12. <link rel="search" type="application/opensearchdescription+xml" href="http://ap-i.net/static/skychart/lib/exe/opensearch.php" title="Skychart" />
  13. <link rel="start" href="http://ap-i.net/static/skychart/" />
  14. <link rel="contents" href="http://ap-i.net/static/skychart/en/documentation/installation_and_compilation_of_the_source_code?do=index" title="Index" />
  15. <link rel="alternate" type="application/rss+xml" title="Recent Changes" href="http://ap-i.net/static/skychart/feed.php" />
  16. <link rel="alternate" type="application/rss+xml" title="Current Namespace" href="http://ap-i.net/static/skychart/feed.php?mode=list&amp;ns=en:documentation" />
  17. <link rel="alternate" type="text/html" title="Plain HTML" href="http://ap-i.net/static/skychart/_export/xhtml/en/documentation/installation_and_compilation_of_the_source_code" />
  18. <link rel="alternate" type="text/plain" title="Wiki Markup" href="http://ap-i.net/static/skychart/_export/raw/en/documentation/installation_and_compilation_of_the_source_code" />
  19. <link rel="canonical" href="installation_and_compilation_of_the_source_code.html" />
  20. <link rel="stylesheet" media="all" type="text/css" href="../../lib/exe/css.php@s=all&amp;t=skychart&amp;tseed=1264943874.css" />
  21. <link rel="stylesheet" media="screen" type="text/css" href="../../lib/exe/css.php@t=skychart&amp;tseed=1264943874.css" />
  22. <link rel="stylesheet" media="print" type="text/css" href="../../lib/exe/css.php@s=print&amp;t=skychart&amp;tseed=1264943874.css" />
  23. </head>
  24. <body>
  25. <div class="dokuwiki export">
  26. <!-- TOC START -->
  27. <div class="toc">
  28. <div class="tocheader toctoggle" id="toc__header">Table of Contents</div>
  29. <div id="toc__inside">
  30. <ul class="toc">
  31. <li class="clear">
  32. <ul class="toc">
  33. <li class="level2"><div class="li"><span class="li"><a href="installation_and_compilation_of_the_source_code.html#how_to_install_the_software_from_the_source_code" class="toc">How to install the software from the source code</a></span></div>
  34. <ul class="toc">
  35. <li class="level3"><div class="li"><span class="li"><a href="installation_and_compilation_of_the_source_code.html#get_the_source_code" class="toc">Get the source code</a></span></div></li>
  36. <li class="level3"><div class="li"><span class="li"><a href="installation_and_compilation_of_the_source_code.html#automated_compilation_and_installation" class="toc">Automated Compilation and installation</a></span></div></li>
  37. <li class="level3"><div class="li"><span class="li"><a href="installation_and_compilation_of_the_source_code.html#interactive_compilation" class="toc">Interactive compilation</a></span></div></li>
  38. </ul>
  39. </li>
  40. <li class="level2"><div class="li"><span class="li"><a href="installation_and_compilation_of_the_source_code.html#install_lazarus" class="toc">Install Lazarus</a></span></div></li>
  41. <li class="level2"><div class="li"><span class="li"><a href="installation_and_compilation_of_the_source_code.html#naming_convention_for_the_program_source" class="toc">Naming convention for the program source</a></span></div></li>
  42. <li class="level2"><div class="li"><span class="li"><a href="installation_and_compilation_of_the_source_code.html#directory_structure" class="toc">Directory structure</a></span></div></li></ul>
  43. </li></ul>
  44. </div>
  45. </div>
  46. <!-- TOC END -->
  47. <h2><a name="how_to_install_the_software_from_the_source_code" id="how_to_install_the_software_from_the_source_code">How to install the software from the source code</a></h2>
  48. <div class="level2">
  49. </div>
  50. <!-- SECTION "How to install the software from the source code" [1-62] -->
  51. <h3><a name="get_the_source_code" id="get_the_source_code">Get the source code</a></h3>
  52. <div class="level3">
  53. <p>
  54. Create a new directory for the source code.
  55. You have two ways to get the code:
  56. </p>
  57. <ul>
  58. <li class="level1"><div class="li"> Download the source file skychart_v3_xxx_source.tar.gz <br/>
  59. to this directory and extract the files.<br/>
  60. On Linux use : tar xzf skychart_v3_xxx_source.tar.gz <br/>
  61. On Windows use 7-zip available from: <a href="http://sourceforge.net/projects/sevenzip/" class="urlextern" title="http://sourceforge.net/projects/sevenzip/" rel="nofollow">http://sourceforge.net/projects/sevenzip/</a></div>
  62. </li>
  63. </ul>
  64. <ul>
  65. <li class="level1"><div class="li"> Or better use a <a href="http://subversion.tigris.org" class="urlextern" title="http://subversion.tigris.org" rel="nofollow">Subversion client</a> to ease the update of daily changes.<br/>
  66. The command is: <br/>
  67. <pre class="code">svn co https://svn.origo.ethz.ch/skychart/trunk .</pre>
  68. </div>
  69. </li>
  70. </ul>
  71. </div>
  72. <!-- SECTION "Get the source code" [63-609] -->
  73. <h3><a name="automated_compilation_and_installation" id="automated_compilation_and_installation">Automated Compilation and installation</a></h3>
  74. <div class="level3">
  75. <p>
  76. If you just want to compile the software without using the Lazarus interactive environment you can use the scripts available in the base directory.
  77. </p>
  78. <p>
  79. Before running these scripts be sure to have the Free Pascal binaries in your PATH environment, this is where you find the fpcmake command.
  80. </p>
  81. <p>
  82. In the base directory you also found the daily_build.sh script I use to automatically build the packages for Linux and Windows.
  83. </p>
  84. </div>
  85. <h4><a name="for_linux_and_mac" id="for_linux_and_mac">For Linux and Mac</a></h4>
  86. <div class="level4">
  87. <pre class="code">./configure [fpc=free_pascal_path] [lazarus=lazarus_path] [prefix=installation_path]
  88. make
  89. make install
  90. make install_data
  91. </pre>
  92. <p>
  93. For example to install the complete software from source on Ubuntu 11.10:
  94. </p>
  95. <pre class="code">sudo apt-get install build-essential lazarus subversion
  96. svn co https://svn.origo.ethz.ch/skychart/trunk skychart
  97. cd skychart
  98. ./configure fpc=/usr/lib/fpc/2.4.4 lazarus=/usr/lib/lazarus/0.9.30 prefix=/usr/local
  99. make
  100. sudo make install
  101. sudo make install_data
  102. sudo make install_cat1
  103. sudo make install_cat2
  104. sudo make install_pict
  105. </pre>
  106. </div>
  107. <h4><a name="for_windows" id="for_windows">For Windows</a></h4>
  108. <div class="level4">
  109. <ul>
  110. <li class="level1"><div class="li"> Beware not to have another make command than the Free Pascal one in your path. <br/>
  111. </div>
  112. </li>
  113. <li class="level1"><div class="li"> Manually compile the library getdss and plan404 with <a href="http://www.mingw.org/" class="urlextern" title="http://www.mingw.org/" rel="nofollow">Mingw</a>.<br/>
  114. </div>
  115. </li>
  116. <li class="level1"><div class="li"> Install the command <a href="http://gnuwin32.sourceforge.net/packages/sed.htm" class="urlextern" title="http://gnuwin32.sourceforge.net/packages/sed.htm" rel="nofollow">sed for Windows</a>.<br/>
  117. </div>
  118. </li>
  119. <li class="level1"><div class="li"> Edit the file configure.cmd to adjust the values for sed=, fpc=, lazarus=, prefix=</div>
  120. </li>
  121. <li class="level1"><div class="li"> You may have to adjust the scripts according to the Linux version because I not use them and they are probably out of date. </div>
  122. </li>
  123. </ul>
  124. <pre class="code">configure.cmd
  125. make
  126. make install
  127. make install_data
  128. </pre>
  129. </div>
  130. <!-- SECTION "Automated Compilation and installation" [610-2235] -->
  131. <h3><a name="interactive_compilation" id="interactive_compilation">Interactive compilation</a></h3>
  132. <div class="level3">
  133. <p>
  134. First, install the required components from src/skychart/component directory.
  135. </p>
  136. <p>
  137. Click “Open Package”, select “component/cdccomponents.lpk”, click “Compile”, “Install”.<br/>
  138. When the install tells you to rebuild Lazarus say Yes.
  139. </p>
  140. <p>
  141. You can now open the main project files skychart/cdc.lpi and compile.
  142. </p>
  143. <p>
  144. To run in debug adjust Run-Run Parameters-Working Directory to your CDC directory.
  145. </p>
  146. <p>
  147. To reduce the executable size for production, use strip and upx.
  148. </p>
  149. <p>
  150. The library getdss and plan404 are written in C language. To compile them, install the gcc compiler (<a href="http://www.mingw.org/" class="urlextern" title="http://www.mingw.org/" rel="nofollow">Mingw</a> on Windows) and run make from each library folder.
  151. </p>
  152. <p>
  153. A few Windows specific libraries and plugins are not yet ported to Lazarus,
  154. please use Delphi if you want to compile them.
  155. </p>
  156. </div>
  157. <!-- SECTION "Interactive compilation" [2236-3025] -->
  158. <h2><a name="install_lazarus" id="install_lazarus">Install Lazarus</a></h2>
  159. <div class="level2">
  160. <p>
  161. To know which version of Lazarus is require for a specific version of Skychart, install the binary version and look at the menu Help / About. There is a line that show the FPC and Lazarus version used.
  162. </p>
  163. <p>
  164. Install Lazarus from <a href="http://lazarus.freepascal.org" class="urlextern" title="http://lazarus.freepascal.org" rel="nofollow">http://lazarus.freepascal.org</a>. See <a href="http://wiki.lazarus.freepascal.org/Installing_Lazarus" class="urlextern" title="http://wiki.lazarus.freepascal.org/Installing_Lazarus" rel="nofollow">http://wiki.lazarus.freepascal.org/Installing_Lazarus</a> for more information.
  165. </p>
  166. <p>
  167. Launch Lazarus and open Components-Configure, Installed Packages.
  168. </p>
  169. <p>
  170. Check that Printer4Lazarus and TurboPowerIPro are installed, this is normally the case.<br/>
  171. If not, install them from lazarus/component :
  172. </p>
  173. <ul>
  174. <li class="level1"><div class="li"> printers/printer4lazarus.lpk</div>
  175. </li>
  176. <li class="level1"><div class="li"> turbopower_ipro/turbopoweripro.lpk</div>
  177. </li>
  178. </ul>
  179. <p>
  180. I use the following procedure to install or update Free Pascal and Lazarus on Linux with the cross compiler for Windows:
  181. </p>
  182. <pre class="code">cd ~/fpc
  183. # svn co http://svn.freepascal.org/svn/fpc/branches/fixes_2_2 .
  184. svn up
  185. make clean
  186. make build
  187. sudo make install
  188. make clean OS_TARGET=win32 CPU_TARGET=i386
  189. make build OS_TARGET=win32 CPU_TARGET=i386
  190. sudo make crossinstall OS_TARGET=win32 CPU_TARGET=i386
  191. ver=`fpc -iV`
  192. sudo ln -f -s /usr/local/lib/fpc/$ver/ppc386 /usr/local/bin
  193. sudo ln -f -s /usr/local/lib/fpc/$ver/ppcross386 /usr/local/bin
  194. cd ~/lazarus
  195. # svn co http://svn.freepascal.org/svn/lazarus/trunk .
  196. svn up
  197. make clean
  198. make OS_TARGET=win32 CPU_TARGET=i386 clean
  199. make bigide
  200. make OS_TARGET=win32 CPU_TARGET=i386 bigide
  201. </pre>
  202. </div>
  203. <!-- SECTION "Install Lazarus" [3026-4388] -->
  204. <h2><a name="naming_convention_for_the_program_source" id="naming_convention_for_the_program_source">Naming convention for the program source</a></h2>
  205. <div class="level2">
  206. <p>
  207. The following naming convention is used for the main project source code
  208. to enable quick recognition of the destination of the units.
  209. </p>
  210. <pre class="code">
  211. cdc.lpi : The main project
  212. pu_*.pas : Form units with specific code only
  213. pu_*.lfm : Form definition
  214. cu_*.pas : Unit containing non-visual object.
  215. u_*.pas : Unit with generic code.
  216. </pre>
  217. </div>
  218. <!-- SECTION "Naming convention for the program source" [4389-4810] -->
  219. <h2><a name="directory_structure" id="directory_structure">Directory structure</a></h2>
  220. <div class="level2">
  221. <pre class="code">
  222. |- src -| &lt; base directory, compilation scripts
  223. |- skychart | &lt; skychart module
  224. |- component &lt; project component
  225. |- library &lt; project library
  226. |- ...
  227. |- units &lt; all compilation object go here
  228. |- varobs | &lt; varobs module
  229. |- tools | - data &lt; the &quot;data&quot; directory structure require to run the progran
  230. | - cat &lt; the basic catalogs, the program used to build them
  231. | - ... &lt; other data files
  232. </pre>
  233. </div>
  234. <!-- SECTION "Directory structure" [4811-] --></div>
  235. </body>
  236. </html>