fixed wrong patch with the return value of fgets into convert.c file
[openjpeg.git] / INSTALL
1
2 How to build and install openjpeg binaries
3 ==========================================
4
5 UNIX/LINUX similar systems
6 --------------------------
7
8 1) Using configure tools
9
10 To build from top-level directory, you can simply type: 
11   ./bootstrap.sh
12   ./configure
13   make
14
15 To keep all build files in a separate directory, you can type instead: 
16   ./bootstrap.sh
17   mkdir build
18   cd build
19   ../configure
20   make
21
22 To install:
23   sudo make install
24   
25 To clean:
26   make clean
27   make distclean
28
29 To build doc (requires 'doxygen' to be found on your system):
30 (this will create an html directory in TOP_LEVEL/doc)
31   make doc
32
33 Main './configure' options (type './configure --help' for more details)
34   '--enable-mj2'
35   '--enable-jpwl'
36   '--prefix=/path/to/install/directory' (example : '--prefix=$PWD/installed')
37   '--enable-debug' (default : disabled)
38
39 You can also specify your own CFLAGS and LDFLAGS with (for example):
40   CFLAGS="-O3 -pipe" LDFLAGS="-Wl,-s" ./configure
41
42
43 2) Using cmake (see www.cmake.org)
44
45 Type:
46   cmake .
47   make
48
49 If you are root:
50   make install
51   make clean
52
53 else:
54   sudo make install
55   make clean
56   
57 To build the Doxygen documentation (Doxygen needs to be found on the system):
58 (A 'html' directory is generated in the 'doc' directory)
59   make doc
60
61 Binaries are located in the 'bin' directory.
62
63 Main available cmake flags:
64 * To specify the install path: '-DCMAKE_INSTALL_PREFIX=/path'
65 * To build the shared libraries and links the executables against it: '-DBUILD_SHARED_LIBS:bool=on' (default: 'ON')
66   Note: when using this option, static libraries are not built and executables are dynamically linked.
67 * To build the CODEC executables: '-DBUILD_CODEC:bool=on' (default: 'ON')
68 * To build the MJ2 executables: '-DBUILD_MJ2:bool=on' (default: 'OFF')
69 * To build the JPWL executables and JPWL library: '-DBUILD_JPWL:bool=on' (default: 'OFF')
70 * To enable testing (and automatic result upload to http://my.cdash.org/index.php?project=OPENJPEG):
71     cmake . -DBUILD_TESTING:BOOL=ON -DJPEG2000_CONFORMANCE_DATA_ROOT:PATH=/path/to/your/JPEG2000/test/files
72     make
73     make Experimental
74   Note : JPEG2000 test files are available here : http://www.crc.ricoh.com/~gormish/jpeg2000conformance/
75
76 3) Manually using Makefile.nix:
77 - Manually edit the config.nix file
78 - Manually create an opj_config.h file from opj_config.h.in.user
79   and edit this opj_config.h
80 - Then : (if 'WITH_JPWL' is defined in config.nix)
81     make -f Makefile.nix all
82     make -f Makefile.nix install
83     make -f Makefile.nix clean
84     make -f Makefile.nix uninstall
85 - If 'WITH_JPWL' is not defined in config.nix
86   and you want to clean/compile/install/uninstall JPWL:
87   call the respective target in the respective directory.
88
89 MACOSX
90 ------
91
92 The same building procedures as above (autotools and cmake) work for MACOSX.
93 The xcode project file can also be used.
94
95 If it does not work, try adding the following flag to the cmake command : 
96   '-DCMAKE_OSX_ARCHITECTURES:STRING=i386'
97
98 WINDOWS
99 -------
100
101 If you're using cygwin or MinGW, the same procedures as for Unix can be used. 
102
103 Otherwise you can use cmake to generate project files for the IDE you are using (VC2010, etc).
104 Type 'cmake --help' for available generators on your platform.