[1.5] fix issue #104
[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   make clean
70
71 else:
72   sudo make install
73   make clean
74   
75 To build the Doxygen documentation (Doxygen needs to be found on the system):
76 (A 'html' directory is generated in the 'doc' directory)
77   make doc
78
79 Binaries are located in the 'bin' directory.
80
81 Main available cmake flags:
82 * To specify the install path: '-DCMAKE_INSTALL_PREFIX=/path'
83 * To build the shared libraries and links the executables against it: '-DBUILD_SHARED_LIBS:bool=on' (default: 'ON')
84   Note: when using this option, static libraries are not built and executables are dynamically linked.
85 * To build the CODEC executables: '-DBUILD_CODEC:bool=on' (default: 'ON')
86 * To build the MJ2 executables: '-DBUILD_MJ2:bool=on' (default: 'OFF')
87 * To build the JPWL executables and JPWL library: '-DBUILD_JPWL:bool=on' (default: 'OFF')
88 * To build the JPIP library and utilities: '-DBUILD_JPIP:bool=on' (default: 'OFF')
89 * To enable testing (and automatic result upload to http://my.cdash.org/index.php?project=OPENJPEG):
90     cmake . -DBUILD_TESTING:BOOL=ON -DOPJ_DATA_ROOT:PATH='path/to/the/data/directory'
91     make
92     make Experimental
93   Note : JPEG2000 test files are available with 'svn checkout http://openjpeg.googlecode.com/svn/data' (about 70 Mo).
94   If '-DOPJ_DATA_ROOT:PATH' option is omitted, test files will be automatically searched in '${CMAKE_SOURCE_DIR}/../data',
95   corresponding to the location of the data directory when compiling from the trunk (and assuming the data directory has
96   been checked out of course).
97
98 MACOSX
99 ------
100
101 The same building procedures as above (autotools and cmake) work for MACOSX.
102 The xcode project file can also be used.
103
104 If it does not work, try adding the following flag to the cmake command : 
105   '-DCMAKE_OSX_ARCHITECTURES:STRING=i386'
106
107 WINDOWS
108 -------
109
110 If you're using cygwin or MinGW+MSYS, the same procedures as for Unix can be used. 
111
112 Otherwise you can use cmake to generate project files for the IDE you are using (VC2010, etc).
113 Type 'cmake --help' for available generators on your platform.