minor changes in autotools installation README
[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 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   '--prefix=/path/to/install/directory' (example : '--prefix=$PWD/installed')
41   '--enable-debug' (default : disabled)
42
43 You can also specify your own CFLAGS and LDFLAGS with (for example):
44   CFLAGS="-O3 -pipe" LDFLAGS="-Wl,-s" ./configure
45
46 The (optional) dependencies of some binaries are libpng, libtiff, libcms 1 or 2
47 and FastCGI. Only libtiff and FastCGI have no .pc file. There should be some
48 automatic detection if they are installed in /usr, /usr/local or /opt/local.
49 Otherwise, you can tune their detection (as well as for libpng and libcms1 or 2
50 too) with the environment variables:
51
52 TIFF_CFLAGS
53 TIFF_LIBS
54 FCGI_CFLAGS
55 FCGI_LIBS
56
57 See './configure --help' output for more details.
58
59
60 2) Using cmake (see www.cmake.org)
61
62 Type:
63   cmake .
64   make
65
66 If you are root:
67   make install
68   make clean
69
70 else:
71   sudo make install
72   make clean
73   
74 To build the Doxygen documentation (Doxygen needs to be found on the system):
75 (A 'html' directory is generated in the 'doc' directory)
76   make doc
77
78 Binaries are located in the 'bin' directory.
79
80 Main available cmake flags:
81 * To specify the install path: '-DCMAKE_INSTALL_PREFIX=/path'
82 * To build the shared libraries and links the executables against it: '-DBUILD_SHARED_LIBS:bool=on' (default: 'ON')
83   Note: when using this option, static libraries are not built and executables are dynamically linked.
84 * To build the CODEC executables: '-DBUILD_CODEC:bool=on' (default: 'ON')
85 * To build the MJ2 executables: '-DBUILD_MJ2:bool=on' (default: 'OFF')
86 * To build the JPWL executables and JPWL library: '-DBUILD_JPWL:bool=on' (default: 'OFF')
87 * To enable testing (and automatic result upload to http://my.cdash.org/index.php?project=OPENJPEG):
88     cmake . -DBUILD_TESTING:BOOL=ON -DJPEG2000_CONFORMANCE_DATA_ROOT:PATH=/path/to/your/JPEG2000/test/files
89     make
90     make Experimental
91   Note : JPEG2000 test files are available here : http://www.crc.ricoh.com/~gormish/jpeg2000conformance/
92
93 3) Manually using Makefile.nix:
94 - Manually edit the config.nix file
95 - Manually create an opj_config.h file from opj_config.h.in.user
96   and edit this opj_config.h
97 - Then : (if 'WITH_JPWL' is defined in config.nix)
98     make -f Makefile.nix all
99     make -f Makefile.nix install
100     make -f Makefile.nix clean
101     make -f Makefile.nix uninstall
102 - If 'WITH_JPWL' is not defined in config.nix
103   and you want to clean/compile/install/uninstall JPWL:
104   call the respective target in the respective directory.
105
106 MACOSX
107 ------
108
109 The same building procedures as above (autotools and cmake) work for MACOSX.
110 The xcode project file can also be used.
111
112 If it does not work, try adding the following flag to the cmake command : 
113   '-DCMAKE_OSX_ARCHITECTURES:STRING=i386'
114
115 WINDOWS
116 -------
117
118 If you're using cygwin or MinGW+MSYS, the same procedures as for Unix can be used. 
119
120 Otherwise you can use cmake to generate project files for the IDE you are using (VC2010, etc).
121 Type 'cmake --help' for available generators on your platform.