renamed and reorganized "jp3d" directory to "openjpeg3d". Is now a standalone directo...
[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 Binaries are located in the 'bin' directory.
58
59 Main available cmake flags:
60 * To specify the install path: '-DCMAKE_INSTALL_PREFIX=/path'
61 * To build the shared libraries and links the executables against it: '-DBUILD_SHARED_LIBS:bool=on' (default: 'ON')
62   Note: when using this option, static libraries are not built and executables are dynamically linked.
63 * To build the CODEC executables: '-DBUILD_CODEC:bool=on' (default: 'ON')
64 * To build the MJ2 executables: '-DBUILD_MJ2:bool=on' (default: 'OFF')
65 * To build the JPWL executables and JPWL library: '-DBUILD_JPWL:bool=on' (default: 'OFF')
66 * [WIN32 ONLY] To build the INDEXER_JPIP executable: '-DBUILD_INDEXER_JPIP:bool=on' (default: 'OFF')
67 * To build the doxygen documentation: '-DBUILD_DOC:bool=on' (default: 'OFF')
68 * To enable testing (and automatic result upload to http://my.cdash.org/index.php?project=OPENJPEG):
69     cmake . -DBUILD_TESTING:BOOL=ON -DJPEG2000_CONFORMANCE_DATA_ROOT:PATH=/path/to/your/JPEG2000/test/files
70     make
71     make Experimental
72   Note : JPEG2000 test files are available here : http://www.crc.ricoh.com/~gormish/jpeg2000conformance/
73
74 3) Manually using Makefile.nix:
75 - Manually edit the config.nix file
76 - Manually create an opj_config.h file from opj_config.h.in.user
77   and edit this opj_config.h
78 - Then : (if 'WITH_JPWL' is defined in config.nix)
79     make -f Makefile.nix all
80     make -f Makefile.nix install
81     make -f Makefile.nix clean
82     make -f Makefile.nix uninstall
83 - If 'WITH_JPWL' is not defined in config.nix
84   and you want to clean/compile/install/uninstall JPWL:
85   call the respective target in the respective directory.
86
87 MACOSX
88 ------
89
90 The same building procedures as above (autotools and cmake) work for MACOSX.
91 The xcode project file can also be used.
92
93 If it does not work, try adding the following flag to the cmake command : 
94   '-DCMAKE_OSX_ARCHITECTURES:STRING=i386'
95
96 WINDOWS
97 -------
98
99 If you're using cygwin or MinGW, the same procedures as for Unix can be used. 
100
101 Otherwise you can use cmake to generate project files for the IDE you are using (VC2010, etc).
102 Type 'cmake --help' for available generators on your platform.