|
| 1 | +# Background |
| 2 | + |
| 3 | +Building giv isn't that easy, due to the large number of of dependencies, including some patches and some obsolete tools. Especially building it for windows is hard because of the cross compiling the dependencies. |
| 4 | + |
| 5 | +It is my goal to simplify this in the future, but currently the goal of this document is to describe how to build. |
| 6 | + |
| 7 | +The building steps below have been tested on Fedora, but they probably work with small modifications under any Linux system. |
| 8 | + |
| 9 | +# Prerequisites |
| 10 | + |
| 11 | +Both the linux and the cross compilation build require the following dependencies: |
| 12 | + |
| 13 | +- https://github.com/dov/gob2/tree/cpp-new - The `cpp-new` branch. |
| 14 | +- vala - "Any" resent version will do |
| 15 | +- scons |
| 16 | + |
| 17 | +# Linux |
| 18 | + |
| 19 | +The prefered building system is scons under Linux. automake is currently broken, and I started porting to meson, but I haven't finished it. |
| 20 | + |
| 21 | +## Prerequisites for giv |
| 22 | + |
| 23 | +### libplis |
| 24 | + |
| 25 | +This is a small c++ string library that I have been using for various projects. To install do: |
| 26 | + |
| 27 | +``` |
| 28 | +git clone http://github.com/dov/libplis |
| 29 | +cd libplis |
| 30 | +./autogen.sh --prefix=/usr/local; make -j 8 install |
| 31 | +``` |
| 32 | + |
| 33 | +## Prerequisites for the plugins |
| 34 | + |
| 35 | +- cfitsio-devel |
| 36 | +- dcmtk |
| 37 | +- libwebp |
| 38 | + |
| 39 | +These are all available by dnf |
| 40 | + |
| 41 | +## Building giv |
| 42 | + |
| 43 | +Giv may be built: |
| 44 | + |
| 45 | +To build giv do in the top directory |
| 46 | + |
| 47 | +``` |
| 48 | +scons -j 8 |
| 49 | +scons -j 8 install |
| 50 | +``` |
| 51 | + |
| 52 | +# Windows |
| 53 | + |
| 54 | +The windows build and installer are cross compiled with mingw libraries under Linux. The following are the requirements for building giv under Fedora: |
| 55 | + |
| 56 | +``` |
| 57 | +sudo dnf -y install mingw64-filesystem |
| 58 | +sudo dnf -y install mingw64-gcc |
| 59 | +sudo dnf -y install mingw64-gcc-c++ |
| 60 | +sudo dnf -y install mingw32-nsis |
| 61 | +sudo dnf -y install mingw64-pcre |
| 62 | +sudo dnf -y install mingw64-gtk3 |
| 63 | +sudo dnf -y install mingw64-libzip |
| 64 | +sudo dnf -y install mingw64-libwebp |
| 65 | +``` |
| 66 | + |
| 67 | +The following libraries are not available as binary downloads and may be installed from source as follows described below: |
| 68 | + |
| 69 | +## Prerequisites |
| 70 | + |
| 71 | +### libplis |
| 72 | + |
| 73 | +``` |
| 74 | +git clone http://github.com/dov/libplis |
| 75 | +# The following is needed to generate the "compile" file |
| 76 | +./autogen.sh --prefix=/usr/local |
| 77 | +mingw64-configure --prefix=/usr/local/mingw64 --exec_prefix=/usr/local/mingw64 --libdir=/usr/local/mingw64/lib --includedir=/usr/local/mingw64/include |
| 78 | +make install |
| 79 | +``` |
| 80 | + |
| 81 | +### dcmtk |
| 82 | + |
| 83 | +- TBD - (I got it to work by tweaking with the CMakeCache.txt file, but I don't have a reproducible method. Mail me for my CMakeCache.txt file if you want) |
| 84 | + |
| 85 | + |
| 86 | +### cfitsio |
| 87 | + - Using cmake toolchain |
| 88 | +``` |
| 89 | +mkcd /space3/pub-repos/cfitsio-4.2.0/build_mingw64/ |
| 90 | +cmake -DCMAKE_TOOLCHAIN_FILE=/home/dov/git/dov-env/cmake/mingw-w64-x86_64.cmake -DCMAKE_INSTALL_PREFIX=/usr/local/mingw64 .. |
| 91 | +``` |
| 92 | + - This fails because of missing zlibrary |
| 93 | + - Edit `CMakeCache.txt` |
| 94 | + - Search for the missing library and change them, e.g.: |
| 95 | +``` |
| 96 | +//Path to a file. |
| 97 | +ZLIB_INCLUDE_DIR:PATH=/usr/x86_64-w64-mingw32/sys-root/mingw/include/ |
| 98 | +
|
| 99 | +//Path to a library. |
| 100 | +ZLIB_LIBRARY_DEBUG:FILEPATH=/usr/x86_64-w64-mingw32/sys-root/mingw/lib/libz.a |
| 101 | +
|
| 102 | +//Path to a library. |
| 103 | +ZLIB_LIBRARY_RELEASE:FILEPATH=/usr/x86_64-w64-mingw32/sys-root/mingw/lib/libz.a |
| 104 | +``` |
| 105 | + - After this change, ~cmake~ may be run again and it worked |
| 106 | + |
| 107 | +### fmt |
| 108 | + - Compilation: |
| 109 | +``` |
| 110 | +unzip ~/hd/Download/fmt-9.1.0.zip |
| 111 | +cd fmt-9.1.0 |
| 112 | +mkdir build_mingw64 |
| 113 | +cd build_mingw64 |
| 114 | +cmake -DFMT_TEST=OFF -DCMAKE_TOOLCHAIN_FILE=/home/dov/git/dov-env/cmake/mingw-w64-x86_64.cmake -DCMAKE_INSTALL_PREFIX=/usr/local/mingw64 .. |
| 115 | +``` |
| 116 | + |
| 117 | +### glm |
| 118 | + - Currently the main branch is broken with regards to installation. The following pull request fixes it. Use this glm version: |
| 119 | + - https://github.com/g-truc/glm/pull/1117 |
| 120 | + - Compilation |
| 121 | + |
| 122 | +``` |
| 123 | +wget https://github.com/Tachi107/glm/archive/refs/heads/cmake-install-improvements.zip |
| 124 | +unzip cmake-install-improvements.zip |
| 125 | +cd glm-cmake-install-improvements |
| 126 | +mkdir build_mingw64 |
| 127 | +cd build_mingw64 |
| 128 | +cmake -DGLM_TEST_ENABLE=OFF -DCMAKE_TOOLCHAIN_FILE=/home/dov/git/dov-env/cmake/mingw-w64-x86_64.cmake -DCMAKE_INSTALL_PREFIX=/usr/local/mingw64 .. |
| 129 | +make install |
| 130 | +``` |
0 commit comments