[1.5] Man page syntax fixes. Thanks to vskytta for patch.
[openjpeg.git] / INSTALL
1
2 How to build and install openjpeg binaries
3 ==========================================
4
5 UNIX/LINUX similar systems
6 --------------------------
7
8 1) Using autotools
9
10 It is highly recommended that pkg-config is installed. If needed, you have to
11 properly set the environment variable PKG_CONFIG_PATH so that the .pc files
12 are found.
13
14 To build from top-level directory, you can simply type: 
15   ./bootstrap.sh
16   ./configure
17   make
18
19 To keep all build files in a separate directory, you can type instead: 
20   ./bootstrap.sh
21   mkdir build
22   cd build
23   ../configure
24   make
25
26 To install:
27   sudo make install
28   
29 To clean:
30   make clean
31   make distclean
32
33 To build doc (requires 'doxygen' to be found on your system):
34 (this will create an html directory in TOP_LEVEL/doc)
35   make doc
36
37 Main './configure' options (type './configure --help' for more details)
38   '--enable-mj2'
39   '--enable-jpwl'
40   '--enable-jpip'
41   '--prefix=/path/to/install/directory' (example : '--prefix=$PWD/installed')
42   '--enable-debug' (default : disabled)
43
44 You can also specify your own CFLAGS and LDFLAGS with (for example):
45   CFLAGS="-O3 -pipe" LDFLAGS="-Wl,-s" ./configure
46
47 The (optional) dependencies of some binaries are libpng, libtiff, libcms 1 or 2
48 and FastCGI. Only libtiff and FastCGI have no .pc file. There should be some
49 automatic detection if they are installed in /usr, /usr/local or /opt/local.
50 Otherwise, you can tune their detection (as well as for libpng and libcms1 or 2
51 too) with the environment variables:
52
53 TIFF_CFLAGS
54 TIFF_LIBS
55 FCGI_CFLAGS
56 FCGI_LIBS
57
58 See './configure --help' output for more details.
59
60
61 2) Using cmake (see www.cmake.org)
62
63 Type:
64   cmake .
65   make
66
67 If you are root:
68   make install
69
70 else if you have sudo power:
71   sudo make install
72
73 else
74   DESTDIR=$HOME/local make install
75
76 To build the Doxygen documentation (Doxygen needs to be found on the system):
77 (A 'html' directory is generated in the 'doc' directory)
78   make doc
79
80 Binaries are located in the 'bin' directory.
81
82 Main available cmake flags:
83 * To specify the install path: '-DCMAKE_INSTALL_PREFIX=/path', or use DESTDIR env variable (see above)
84 * To build the shared libraries and links the executables against it: '-DBUILD_SHARED_LIBS:bool=on' (default: 'ON')
85   Note: when using this option, static libraries are not built and executables are dynamically linked.
86 * To build the CODEC executables: '-DBUILD_CODEC:bool=on' (default: 'ON')
87 * To build the MJ2 executables: '-DBUILD_MJ2:bool=on' (default: 'OFF')
88 * To build the JPWL executables and JPWL library: '-DBUILD_JPWL:bool=on' (default: 'OFF')
89 * To build the JPIP library and utilities: '-DBUILD_JPIP:bool=on' (default: 'OFF')
90 * To enable testing (and automatic result upload to http://my.cdash.org/index.php?project=OPENJPEG):
91     cmake . -DBUILD_TESTING:BOOL=ON -DOPJ_DATA_ROOT:PATH='path/to/the/data/directory'
92     make
93     make Experimental
94   Note : JPEG2000 test files are available with 'svn checkout http://openjpeg.googlecode.com/svn/data' (about 70 Mo).
95   If '-DOPJ_DATA_ROOT:PATH' option is omitted, test files will be automatically searched in '${CMAKE_SOURCE_DIR}/../data',
96   corresponding to the location of the data directory when compiling from the trunk (and assuming the data directory has
97   been checked out of course).
98
99 MACOSX
100 ------
101
102 The same building procedures as above (autotools and cmake) work for MACOSX.
103 The xcode project file can also be used.
104
105 If it does not work, try adding the following flag to the cmake command : 
106   '-DCMAKE_OSX_ARCHITECTURES:STRING=i386'
107
108 WINDOWS
109 -------
110
111 If you're using cygwin or MinGW+MSYS, the same procedures as for Unix can be used. 
112
113 Otherwise you can use cmake to generate project files for the IDE you are using (VC2010, etc).
114 Type 'cmake --help' for available generators on your platform.