3 For more details and other workflows see the "Advanced guide" below.
5 ## Checking out the code
8 git clone https://github.com/libjxl/libjxl.git --recursive --shallow-submodules
11 This repository uses git submodules to handle some third party dependencies
12 under `third_party`, that's why it is important to pass `--recursive`. If you
13 didn't check out with `--recursive`, or any submodule has changed, run:
16 git submodule update --init --recursive --depth 1 --recommend-shallow
19 The `--shallow-submodules` and `--depth 1 --recommend-shallow` options create
20 shallow clones which only downloads the commits requested, and is all that is
21 needed to build `libjxl`. Should full clones be necessary, you could always run:
24 git submodule foreach git fetch --unshallow
25 git submodule update --init --recursive
28 which pulls the rest of the commits in the submodules.
30 Important: If you downloaded a zip file or tarball from the web interface you
31 won't get the needed submodules and the code will not compile. You can download
32 these external dependencies from source running `./deps.sh`. The git workflow
33 described above is recommended instead.
35 ## Installing dependencies
37 Required dependencies for compiling the code, in a Debian/Ubuntu based
41 sudo apt install cmake pkg-config libbrotli-dev
44 Optional dependencies for supporting other formats in the `cjxl`/`djxl` tools,
45 in a Debian/Ubuntu based distribution run:
48 sudo apt install libgif-dev libjpeg-dev libopenexr-dev libpng-dev libwebp-dev
51 We recommend using a recent Clang compiler (version 7 or newer), for that
52 install clang and set `CC` and `CXX` variables.
55 sudo apt install clang
56 export CC=clang CXX=clang++
65 cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=OFF ..
66 cmake --build . -- -j$(nproc)
69 The encoder/decoder tools will be available in the `build/tools` directory.
71 ## <a name="installing"></a> Installing
74 sudo cmake --install .
78 ## Building JPEG XL for developers
80 For experienced developers, we provide build instructions for several other environments:
82 * [Building on Debian](doc/developing_in_debian.md)
83 * Building on Windows with [vcpkg](doc/developing_in_windows_vcpkg.md) (Visual Studio 2019)
84 * Building on Windows with [MSYS2](doc/developing_in_windows_msys.md)
85 * [Cross Compiling for Windows with Crossroad](doc/developing_with_crossroad.md)