updated autotools files to improve build and install procedures (credit to Vincent...
[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-jp3d'
36   '--enable-jpwl'
37   '--prefix=/path/to/install/directory' (example : '--prefix=$PWD/installed')
38   '--enable-debug' (default : disabled)
39
40 You can also specify your own CFLAGS and LDFLAGS with (for example):
41   CFLAGS="-O3 -pipe" LDFLAGS="-Wl,-s" ./configure
42
43
44 2) Using cmake (see www.cmake.org)
45
46 Type:
47   cmake .
48   make
49
50 If you are root:
51   make install
52   make clean
53
54 else:
55   sudo make install
56   make clean
57
58 Binaries are located in the 'bin' directory.
59
60 Main available cmake flags:
61 * To specify the install path: '-DCMAKE_INSTALL_PREFIX=/path'
62 * To build the shared libraries and links the executables against it: '-DBUILD_SHARED_LIBS:bool=on' (default: 'ON')
63   Note: when using this option, static libraries are not built and executables are dynamically linked.
64 * To build the CODEC executables: '-DBUILD_CODEC:bool=on' (default: 'ON')
65 * To build the MJ2 executables: '-DBUILD_MJ2:bool=on' (default: 'OFF')
66 * To build the JPWL executables and JPWL library: '-DBUILD_JPWL:bool=on' (default: 'OFF')
67 * To build the JP3D executables and JP3D library: '-DBUILD_JP3D:bool=on' (default: 'OFF')
68 * [WIN32 ONLY] To build the INDEXER_JPIP executable: '-DBUILD_INDEXER_JPIP:bool=on' (default: 'OFF')
69 * To build the doxygen documentation: '-DBUILD_DOC: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' and/or 'WITH_JP3D' are 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 neither 'WITH_JPWL' nor 'WITH_JP3D' is defined in config.nix
86   and you want to clean/compile/install/uninstall JPWL/JP3D:
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.