User Tools

Site Tools


library-install-sources

======== Build and install the library from sources ======== The first sub-section is for native build on Unix-like systems, the next ones for other platforms and [[wp>Cross_compilation|cross-compilation]]. **This procedure is for versions >= 1.6.0 only. Older versions are not supported any more.** FIXME a shelr screencast would be great ===== Native build on Unix-like systems ===== The instructions hereafter are for native build on Unix-like systems, such as [[wp>Linux|Linux]], [[wp>FreeBSD]], or [[wp>OpenBSD]]. See next sections for other targets ([[wp>Windows|Microsoft Windows]], [[wp>Cross_compilation|cross-compilation]]...). - Log in as normal user on the system on which you want to install the ROHC library. - Check that [[library-requirements|your system is ready to build the ROHC library]]. - Retrieve the sources: * preferred way: download the source archive of the lastest ROHC release on the [[https://rohc-lib.org/support/download/|download page]]:<code> $ wget https://rohc-lib.org/download/rohc-latest.tar.xz $ wget https://rohc-lib.org/download/rohc-latest.tar.xz.sha256 $ wget https://rohc-lib.org/download/rohc-latest.tar.xz.asc $ sha256sum -c rohc-latest.tar.xz.sha256 # verify the file integrity rohc-latest.tar.xz.sha256: OK $ gpg --recv-keys 008E8DAD # retrieve GPG key, first time only $ gpg --verify rohc-latest.tar.xz.asc # verify the file authenticity $ tar xvJf rohc-latest.tar.xz # OpenBSD note: use gtar instead of tar $ cd rohc-X.Y.Z # replace X.Y.Z by the release number</code> * OR retrieve the latest development version:<code> $ git clone --depth 10 https://github.com/didier-barvaux/rohc.git $ cd rohc</code> - Configure the library:<code> $ ./configure --prefix=/usr</code> * Run %%./autogen.sh%% script instead of %%./configure%% script if you use a development version from GIT. For ./autogen.sh script use the following build tool versions autoconf >= 2.68, automake >= 1.11.2 and libtool >= 2.2.2 * Add [[library-install-sources-options|optional configure options]] to customize the behaviour of the ROHC library and/or build additional tools. - Build the code:<code> $ make all</code> - Run non-regression tests (optional):<code> $ make check</code>For more details, see [[library-tests|how to run the library tests]]. - Install the library as root:<code> $ su # make install # exit</code> The library is now installed on your system in subdirectories of ///usr//. In case you want to change the installation path, run //./configure %%--prefix=/path/to/your/directory%%// at step 4. The ROHC library is installed, you may now test it and/or use it: * run the [[summary#rohc_sniffer|sniffer application]] to test the ROHC library on your system, * <del>run the [[rohc-tunnel|ROHC over UDP tunnel application]] to test the ROHC library on your system</del>, * run the [[summary#ip_rohc_tunnel|IP/ROHC tunnel application]] to optimize your traffic over the Internet, * generate [[rohc-statistics|compression statistics]] for a recorded stream * [[library-first-application|use the ROHC library in your own program]] ===== Cross-compilation for ARM/PowerPC on Unix-like systems ===== The instructions hereafter are for building the ROHC library for other CPU architectures on Unix-like systems. See [[library-install-sources#native_build_on_unix-like_systems|previous section]] for native build on Unix-like systems. - Install or build one ARM/PowerPC cross-compiler. The installation of the cross-compiler is outside the scope of this small document, however [[cross-compiler-gentoo|here are some instructions]] to build a ARM/PowerPC cross-compiler on [[http://www.gentoo.org/|Gentoo]]. - Follow the instructions given for [[library-install-sources#native_build_on_unix-like_systems|Unix-like systems]] except for the following steps: - step 4:<code> $ ./configure --prefix=/usr --host=<target-tuple></code> * //target-tuple// is the ARCH-VENDOR-OS-LIBC tuple of your cross-compiler, eg. arm-softfloat-linux-gnueabi or powerpc-softfloat-linux-gnu. * You can enable tests with %%--enable-rohc-tests%% if you have the [[http://www.tcpdump.org/|libpcap]] and [[https://cmocka.org/|cmocka]] libraries and their headers cross-compiled for the target system, and the [[http://www.qemu.org/|Qemu]] tools installed on your system. Tests are then run with //make check// as usual. * Running tests within [[http://valgrind.org/info/tools.html#memcheck|Valgrind's memcheck]] is untested. * You can enable applications with %%--enable-rohc-apps%% as usual. - step 7:<code> $ make install DESTDIR=/path/to/target/root/</code> ===== Cross-compilation for Android ARM on Unix-like systems ===== The instructions hereafter are for building the ROHC library for Android systems on Unix-like systems. See [[library-install-sources#native_build_on_unix-like_systems|previous section]] for native build on Unix-like systems. - Go get the [[https://developer.android.com/tools/sdk/ndk/index.html|Android NDK]]. Example (change x86_64 to match your build platform):<code> $ wget http://dl.google.com/android/ndk/android-ndk-r10e-linux-x86_64.bin</code> - Install the Android NDK ([[https://developer.android.com/tools/sdk/ndk/index.html#Installing|full instructions]]):<code> $ chmod +x android-ndk-r10e-linux-x86_64.bin $ ./android-ndk-r10e-linux-x86_64.bin</code> - Setup environment for using the NDK (change x86_64 to match your build platform):<code> $ export NDK=$PWD/android-ndk-r10e $ export SYSROOT=$NDK/platforms/android-21/arch-arm/ $ export TOOLCHAIN=$NDK/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/ $ export ANDROID_CC="$TOOLCHAIN/bin/arm-linux-androideabi-gcc --sysroot=$SYSROOT"</code> - If you use a release archive, configure the library as follow:<code> $ CC=$ANDROID_CC LD=$ANDROID_CC \ ./configure --host=arm-linux-androideabi \ --enable-static --disable-shared \ --enable-examples</code> - If you use a GIT branch, configure the library as follow:<code> $ CC=$ANDROID_CC LD=$ANDROID_CC \ ./autogen.sh --host=arm-linux-androideabi \ --enable-static --disable-shared \ --disable-rohc-tests --disable-doc \ --disable-app-fuzzer --disable-app-performance \ --disable-app-sniffer --disable-app-stats \ --disable-linux-kernel-module</code> - Build the library:<code> $ CC=$ANDROID_CC LD=$ANDROID_CC make clean all</code> - You now have static ROHC libraries (and a simple application to test the library):<code> $ file src/.libs/librohc.a src/.libs/librohc.a: current ar archive $ file examples/simple_rohc_program examples/print_rohc_version examples/example_rohc_decomp examples/rtp_detection examples/simple_rohc_program: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), dynamically linked, interpreter /system/bin/linker, not stripped examples/print_rohc_version: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), dynamically linked, interpreter /system/bin/linker, not stripped examples/example_rohc_decomp: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), dynamically linked, interpreter /system/bin/linker, not stripped examples/rtp_detection: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), dynamically linked, interpreter /system/bin/linker, not stripped</code> Build tested only. Last fully tested on real Android target with NDK 8e and Android 2.3. ===== Cross-compilation for Microsoft Windows on Unix-like systems ===== The instructions hereafter are for building the ROHC library for [[wp>Windows|Microsoft Windows]] on Unix-like systems. See [[library-install-sources#native_build_on_unix-like_systems|previous section]] for native build on Unix-like systems. - Install or build the [[http://mingw.org/|MinGW]] cross-compiler. The installation of MinGW is outside the scope of this small document, however [[cross-compiler-gentoo#mingw_toolchain_for_windows|here are some instructions]] to build a MinGW cross-compiler on [[http://www.gentoo.org/|Gentoo]]. - Follow the instructions given for [[library-install-sources#native_build_on_unix-like_systems|Unix-like systems]] except for the following steps: - step 4:<code> $ ./configure --prefix=/usr --host=i686-pc-mingw32</code> * You can enable tests with %%--enable-rohc-tests%% if you have the [[http://www.winpcap.org/|WinPcap]] library and the [[http://www.winehq.org/about/|Wine]] tool installed on your system. Tests are then run with //make check// as usual. * You can enable tests within [[http://valgrind.org/info/tools.html#memcheck|Valgrind's memcheck]] tool, but they will fail because [[http://www.winehq.org/about/|Wine]] causes many memory warnings unrelated to the ROHC library itself. * You cannot enable applications with %%--enable-app-*%% yet. - step 7:<code> $ make install DESTDIR=/path/to/windows/root/</code> ===== Build for Microsoft Windows with Cygwin ===== The instructions hereafter are to build the ROHC library for [[wp>Windows|Microsoft Windows]] with [[wp>Cygwin]]. See [[library-install-sources#cross-compilation_for_microsoft_windows_on_unix-like_systems|this section]] for cross-compilation for Windows on Unix-like systems. - If not already done, [[http://cygwin.com/install.html|download the Cygwin installer]] and install the Cygwin environment with (at least) the following packages selected: * bash * make * binutils * libtool * gcc4 * coreutils * gawk * grep * sed * tar * bzip2 * GIT (only if you retrieve sources from the GIT repository, ignore otherwise) * ca-certificates (only if you retrieve sources from the GIT repository, ignore otherwise) **TBC** * autoconf (only if you retrieve sources from the GIT repository, ignore otherwise) * automake (only if you retrieve sources from the GIT repository, ignore otherwise) * doxygen (only if --enable-doc, ignore otherwise) - Start the Cygwin Terminal from the Start Menu. Next steps are all run in the Cygwin Terminal. - Follow the instructions given for [[library-install-sources#native_build_on_unix-like_systems|Unix-like systems]] starting from step 3, and except for the following steps: - step 4:<code> $ ./configure --prefix=/usr </code> * You can enable tests with %%--enable-rohc-tests%% if you have the [[winpcap#winpcap_for_cygwin|WinPcap library installed on your system]]. Tests are then run with //make check// as usual. * You can enable tests within [[http://valgrind.org/info/tools.html#memcheck|Valgrind's memcheck]] tool. * You cannot enable applications with %%--enable-app-*%% yet. ======== What to do next? ======== Once the ROHC library is installed, you may: * generate [[summary#rohc_statistics|compression statistics]] for a recorded stream, * [[summary#rohc_sniffer|test the ROHC library with your local network traffic]], * run the [[iprohc-overview|IP/ROHC tunnel application]] to establish a tunnel with compression capabilities between 2 machines, * [[library-first-application|use the ROHC library in your own program]].

library-install-sources.txt · Last modified: 2016/07/03 12:02 by didier