Install-LibRaw.html 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  2. <html>
  3. <head>
  4. <meta http-equiv="content-type" content="text/html; charset=windows-1252">
  5. <title>LibRaw Compilation and Installation</title>
  6. </head>
  7. <body> <a href="index.html">[back to Index]</a>
  8. <h1>LibRaw Compilation and Installation</h1>
  9. <p>LibRaw is distributed in the form of source codes. For further use, they
  10. should be compiled (and, if desired, placed into system folders with
  11. libraries and include-files).</p>
  12. <a name="unix"></a>
  13. <h2>Unix Systems (FreeBSD, Linux, Mac OS X)</h2>
  14. <p> To build the library, you will need a working C++ compiler (gcc 3+ and
  15. clang 2+ are OK) and the make utility. </p>
  16. <p>Additional libraries (optional):</p>
  17. <ul>
  18. <li>zlib (used to decode deflated DNGs)</li>
  19. <li>libjasper (used to decode RED files)</li>
  20. <li>libjpeg8 (used to decode lossy DNGs and several old Kodak cameras)</li>
  21. </ul>
  22. <p> LibRaw has been tested on 32- and 64-bit Unix systems working on x86-
  23. (and AMD64-) compatible processors. Building and work on other
  24. architectures have not been tested. </p>
  25. <h3>Compilation of Library and Examples</h3>
  26. <p> Unpack the downloaded distribution package.</p>
  27. <pre> tar xzvf LibRaw-X.YY.tar.gz
  28. </pre>
  29. <p>For GitHub downloads (clones), perform ./configure script generation via</p>
  30. <pre> autoreconf --install</pre>
  31. <p>Go to LibRaw directory and run <b>./configure</b> and <b>make</b>: </p>
  32. <pre>cd LibRaw-X.YY
  33. ./configure # with optional args
  34. make
  35. </pre>
  36. <p>As a result, you will compile</p>
  37. <ul>
  38. <li>Library libraw.a in the lib/ folder</li>
  39. <li><a href="Samples-LibRaw.html">Examples</a> in the bin/ folder (source
  40. codes of examples are in the samples/ folder).</li>
  41. </ul>
  42. <p>In the current version, only static libraries are built:</p>
  43. <ul>
  44. <li>libraw.a: non-thread-safe version</li>
  45. <li>libraw_r.a: thread-safe</li>
  46. </ul>
  47. <h3>Build parameters</h3>
  48. <p> ./configure script have some non-standard parameters: </p>
  49. <dl>
  50. <dt> --enable-openmp<br>
  51. --disable-openmp </dt>
  52. <dd> Enable/disable OpenMP support if compiler supports it. OpenMP is
  53. enabled by default. </dd>
  54. <dt> --enable-lcms<br>
  55. --disable-lcms </dt>
  56. <dd> Enable/disable LCMS color engine support. If enabled, ./configure
  57. will try to find lcms library. Both LCMS-1.x and LCMS-2.x are supported
  58. LCMS support is enabled by default </dd>
  59. <dt> --enable-examples<br>
  60. --disable-examples </dt>
  61. <dd> Enables/disables examples compilation and installation. Enabled by
  62. default </dd>
  63. </dl>
  64. <h3>Installation and Usage</h3>
  65. <p>To install the library, run</p>
  66. <pre> sudo make install
  67. </pre>
  68. <p> It will place the libraries in <b>/usr/local/lib</b>, the include-files
  69. in <b>/usr/local/include</b> (subfolder of libraw) and LibRaw samples to
  70. <b>/usr/local/bin</b>. You can override installation path by using
  71. ./configure script. <br>
  72. To use LibRaw, add the following parameters to the compiler call (when
  73. building your own projects): </p>
  74. <ul>
  75. <li>Path to include-files: -I/usr/local/include</li>
  76. <li>Path to libraries: -L/usr/local/lib</li>
  77. <li>Library: -lraw (ordinary version) or -lraw_r (thread-safe version).</li>
  78. </ul>
  79. <h2>Windows: Building under Cygwin</h2>
  80. <p> Building and installation are completely similar to <a href="#unix">building
  81. and installation under Unix systems</a>. </p>
  82. <h2>Windows: Native Building</h2>
  83. <p> Building under Windows has three steps: </p>
  84. <ul>
  85. <li>Unpack the distribution package (if you have got no tar+gzip, take the
  86. LibRaw distribution package in the .ZIP format) and go to folder
  87. LibRaw-X.YYY. </li>
  88. <li>Set the environment parameters so that the compiler/linker would find
  89. the libraries and include-files. For Visual C++, this is done by running
  90. <b>vcvars32.bat</b>. </li>
  91. <li> Run<br>
  92. <b>nmake -f Makefile.msvc</b><br>
  93. </li>
  94. </ul>
  95. <p>You may need to edit Makefile.msvc to provide libjpeg/zlib/libjasper
  96. paths to INCLUDE/LIB.</p>
  97. <p> If all paths are set correctly and the include-files/libraries have been
  98. found, then the following will be compiled:</p>
  99. <ul>
  100. <li>Library libraw_static.lib in folder lib</li>
  101. <li>Dynamic library bin/libraw.dll and linking library for it
  102. lib/libraw.lib</li>
  103. <li>Examples in folder bin/.</li>
  104. </ul>
  105. <p>Only the thread-safe library is built under Win32, but it can be used
  106. with non-threaded applications as well. All examples are linked with the
  107. dynamic library (DLL); if static linking is necessary, one should link
  108. applications with library libraw_static.lib and set the preprocessor
  109. option /DLIBRAW_NODLL during compilation. </p>
  110. <p> Windows-version compiles without LCMS support for now. </p>
  111. <p> During building of DLL, all public functions are exported; further, the
  112. exported subset may be reduced. </p>
  113. <p> Unfortunately, paths to include/ libraries depend on the way Visual C
  114. (or other compiler) is installed; therefore, it is impossible to specify
  115. some standard paths in Makefile.msvc. </p>
  116. <h2>Windows Installation</h2>
  117. <p> No installation under Windows is supported. It is assumed that all DLLs
  118. will be supplied together with the software using them (and this software
  119. will perform the installation). Accordingly, in building of programs using
  120. LibRaw, the paths to libraries, DLLs, and include-files should be
  121. specified manually. </p>
  122. <a href="index.html">[back to Index]</a>
  123. </body>
  124. </html>