Skip to content

Building Aether

KAHR-Alpha edited this page Aug 1, 2023 · 5 revisions

Dependencies

Linux

Here are the instructions to build the Aether from scratch under Ubuntu with GCC. The process should be similar on other Linux distributions.

Prerequisites

First, you will need building tools. In a terminal, run the following commands

  • sudo apt install gcc
  • sudo apt install g++
  • sudo apt install build-essential

Look for CMake inside Ubuntu Software and install it.

Then, as a convenience, in your user directory create a Libs directory, and sources and builds subdirectories inside it.

Default packages

You will then need the development packages of the various libraries, to do so, run

  • sudo apt install libfftw3-dev
  • sudo apt install libeigen3-dev
  • sudo apt install liblua5.4-dev
  • sudo apt install zlib1g-dev
  • sudo apt install libpng-dev
  • sudo apt install libfreetype-dev
  • sudo apt install libwxgtk3.0-gtk3-dev

wxWidgets (for the development version)

Inspired from https://wiki.wxwidgets.org/Compiling_and_getting_started

Decompress the wxWidgets 3.1.4 sources into the sources directory mentionned previously.

Go into the wxWidget directory, and create a new one called gtkbuild. Go into it and launch a terminal there.

First, you'll need to make sure you have the gtk library and the OpenGL dev files with:

  • sudo apt install libgtk2.0-dev
  • sudo apt install freeglut3-dev

Then, we'll run configure with: ../configure --with-gtk=2 --with-opengl --disable-shared --prefix=/home/${USER}/Libs/builds/wxWidgets

Once this is done, run make -j N && make install where N is the number of CPU threads you want to allocate to the process.

Aether

Create a build directory that will be used by CMake, and an install directory that will be used to install Aether.

Set CMake to Aether's root directory (containing CMakeLists.txt) and the building directory appropriately, click on Configure and select the relevant building solution (Unix Makefiles usually).

Switch the TASK to "Build CLI+GUI" and run Configure again to access all the useful variables. Set the INSTALL_PATH variable to your install directory. Most dependencies should be found automatically at this point, but you'll need to define a few ones still.

If you want to use your own wxWidgets library, set WXWIDGETS_CONFIG_EXECUTABLE to the wx-config file found in Libs/builds/wxWidgets/bin and WXWIDGETS_WXRC_EXECUTABLE to the wxrc file of the same directory. (you might need to click on Configure several times)

Finally, invoque make -jX (see the wxWidgets guide above) and make install inside the build directory to build Aether and install it.

Windows

Provided scripts

Aether's repository contains Powershell scripts that should download and build Aether and its dependencies automatically, both for MinGW and VS2022. You'll find them in contribs/build_mingw and contribs/build_vs2022:

  1. Download a compiler, either MinGW64 through MSYS2, or Visual Studio 2022

  2. Drop the relevant scripts into a directory

  3. Run the script to build the dependencies

  4. Run the script to build Aether

Step by step

If you want to build the various libraries by yourself, the best practice is to look at each library documentation. However, here is a quick summary on Windows with MinGw.

FFTW

It is advised to download the prebuilt binaries and use them as is, the building process is pretty convoluted.

Lua

See https://www.lua.org/manual/5.4/readme.html

Otherwise first decompress the sources, and go to the Lua main directory.

Invoke mingw32-make mingw to start building the library. The dll file will be built in the src directory.

zlib

Uncompress the sources, and create cmake_build and cmake_install directories, for convenience. Launch CMake, set it to the zlib main directory, and set the cache directory to the cmake_build directory. Run the Configure for MinGW.

Set the CMAKE_BUILD_TYPE to release and CMAKE_INSTALL_PREFIX to the cmake_install directory. Delete the INSTALL_X entries and run Configure again to update the various paths, and Generate.

Go to the cmake_build directory, and run mingw32-make and mingw32-make install successively.

libpng

Uncompress the sources, and create cmake_build and cmake_install directories, for convenience. Launch Cmake, set it to the libpng main directory, and set the cache directory to the cmake_build directory. Run the Configure for MinGW.

Set the CMAKE_BUILD_TYPE to release and CMAKE_INSTALL_PATH to the cmake_install directory.

Go to the cmake_build directory, and run mingw32-make and mingw32-make install successively.

FreeType

The procedure is essentially the same as for libpng above.

However, if any of the BZIP2, HarfBuzz, PNG or ZLIB fields are somehow autocompleted by CMake, make them blank to avoid linking issue, as we are not using them together with Freetype.

wxWidgets

Inspired by https://wiki.wxwidgets.org/Compiling_wxWidgets_with_MinGW

Unzip the sources, and go to the build\msw directory.

Edit the config.gcc file to make sure that SHARED is set to 1 and BUILD to release.

Odds are the setup.h is not set properly, so first invoke mingw32-make -f makefile.gcc setup_h.

You can then start building the library with mingw32-make -f makefile.gcc -jX, where X is the number of threads you want to use (typically 8 on an i7 for instance).

Once this is done, copy content of the include directory to someplace. There, copy the content found in lib/gcc_dll. You will be asked to overwrite some file, accept.

Aether

First make sure you have either built or downloaded all the binaries and include files of the libraries described previously.

Create a build directory that will be used by CMake, and an install directory that will be used to install Aether.

Set CMake to Aether's root directory (containing CMakeLists.txt) and the building directory appropriately, click on Configure and select the relevant building solution.

Switch the TASK to "Build CLI+GUI" and run Configure again to access all the useful variables.

Set the INSTALL_PATH variable to your install directory. Next you need to set up the dependencies.

Set EIGEN3_INCLUDE_DIR to the directory containing signature_of_eigen3_matrix_library

Set FFTW_INCLUDES to the directory containing fftw3.h, and FFTW_LIB to the binary file (libfftw3-3.dll on Windows)

Set FREETYPE_INCLUDE_DIRS to the Freetype include directory, containing ft2build.h, and FREETYPE_LIBRARIES to the binary file (libfreetype.a on Windows for instance)

Set LUA_INCLUDE_DIR to the Lua directory containing lua.h, and LUA_LIBRARY to the binary file (lua54.dll on Windows)

Set PNG_INCLUDE_DIR to the directory containing png.h, and PNG_LIBRARY_RELEASE to the binary file (libpng16.dll on Windows)

Set WXWIDGETS_INCLUDES to the directory containing build.cfg, and WXWIDGETS_ADV, WXWIDGETS_BASE, WXWIDGETS_CORE and WXWIDGETS_GL to the associated binary files. For instance on Windows, and depending on how wxWidgets was built, they are: wxmsw314u_adv_gcc_mingw64_103.dll wxbase314u_gcc_mingw64_103.dll wxmsw314u_core_gcc_mingw64_103.dll wxmsw314u_gl_gcc_mingw64_103.dll

Set ZLIB_INCLUDE_DIR to the directory containing zlib.h, and ZLIB_LIBRARY_RELEASE to the binary file (libzlib.dll on Windows) Once this is done, click on Generate

Finally, invoque mingw32-make -jX (see the wxWidgets guide above) and mingw32-make install inside the build directory to build Aether and install it.