1
2How to build and install openjpeg binaries
3==========================================
4
5UNIX/LINUX similar systems
6--------------------------
7
81) Using autotools
9
10It is highly recommended that pkg-config is installed. If needed, you have to
11properly set the environment variable PKG_CONFIG_PATH so that the .pc files
12are found.
13
14To build from top-level directory, you can simply type:
15  ./bootstrap.sh
16  ./configure
17  make
18
19To 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
26To install:
27  sudo make install
28
29To clean:
30  make clean
31  make distclean
32
33To 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
37Main './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
44You can also specify your own CFLAGS and LDFLAGS with (for example):
45  CFLAGS="-O3 -pipe" LDFLAGS="-Wl,-s" ./configure
46
47The (optional) dependencies of some binaries are libpng, libtiff, libcms 1 or 2
48and FastCGI. Only libtiff and FastCGI have no .pc file. There should be some
49automatic detection if they are installed in /usr, /usr/local or /opt/local.
50Otherwise, you can tune their detection (as well as for libpng and libcms1 or 2
51too) with the environment variables:
52
53TIFF_CFLAGS
54TIFF_LIBS
55FCGI_CFLAGS
56FCGI_LIBS
57
58See './configure --help' output for more details.
59
60
612) Using cmake (see www.cmake.org)
62
63Type:
64  cmake .
65  make
66
67If you are root:
68  make install
69
70else if you have sudo power:
71  sudo make install
72
73else
74  DESTDIR=$HOME/local make install
75
76To build the Doxygen documentation (Doxygen needs to be found on the system):
77(A 'html' directory is generated in the 'doc' directory)
78  make doc
79
80Binaries are located in the 'bin' directory.
81
82Main available cmake flags:
83* To specify the install path: '-DCMAKE_INSTALL_PREFIX=/path', or use DESTDIR env variable (see above)
84* To build the shared libraries and links the executables against it: '-DBUILD_SHARED_LIBS:bool=on' (default: 'ON')
85  Note: when using this option, static libraries are not built and executables are dynamically linked.
86* To build the CODEC executables: '-DBUILD_CODEC:bool=on' (default: 'ON')
87* To build the MJ2 executables: '-DBUILD_MJ2:bool=on' (default: 'OFF')
88* To build the JPWL executables and JPWL library: '-DBUILD_JPWL:bool=on' (default: 'OFF')
89* To build the JPIP library and utilities: '-DBUILD_JPIP:bool=on' (default: 'OFF')
90* To enable testing (and automatic result upload to http://my.cdash.org/index.php?project=OPENJPEG):
91    cmake . -DBUILD_TESTING:BOOL=ON -DOPJ_DATA_ROOT:PATH='path/to/the/data/directory'
92    make
93    make Experimental
94  Note : JPEG2000 test files are available with 'svn checkout http://openjpeg.googlecode.com/svn/data' (about 70 Mo).
95  If '-DOPJ_DATA_ROOT:PATH' option is omitted, test files will be automatically searched in '${CMAKE_SOURCE_DIR}/../data',
96  corresponding to the location of the data directory when compiling from the trunk (and assuming the data directory has
97  been checked out of course).
98
99MACOSX
100------
101
102The same building procedures as above (autotools and cmake) work for MACOSX.
103The xcode project file can also be used.
104
105If it does not work, try adding the following flag to the cmake command :
106  '-DCMAKE_OSX_ARCHITECTURES:STRING=i386'
107
108WINDOWS
109-------
110
111If you're using cygwin or MinGW+MSYS, the same procedures as for Unix can be used.
112
113Otherwise you can use cmake to generate project files for the IDE you are using (VC2010, etc).
114Type 'cmake --help' for available generators on your platform.
115