Skip to content

Building PyGLM

Zuzu-Typ edited this page Nov 11, 2019 · 3 revisions

Setting up the environment

In order to build PyGLM, you're going to need a working C++ development environment.
Although compilation should work with any C++ compiler, the only ones officially supported are

  • MSVC (Microsoft Visual C++) for Windows -- Click here to download the build tools
  • GCC (GNU Compiler Collection) mostly for Linux -- sudo apt install gcc (probably)
  • Clang default Mac OS X compiler -- Should already be installed.

That should be all there is to it.

Build options

If you want to install the default version of PyGLM, now that you've set up the environment, you should be able to simply use the PyPI.
pip install PyGLM (if pip is in your path. Otherwise find your Python isntallation folder and open a command prompt in the Scripts folder)

If you instead want to change some build options or make a completely custom build, go ahead and clone PyGLM or download the latest release.

There are three different predefined build options that you can choose from inside of PyGLM.cpp.
One of the first lines in PyGLM.cpp should be
#define PyGLM_BUILD PyGLM_DEFAULT.
You can change PyGLM_DEFAULT to one of the following options:
PyGLM_FAST - No support for using iterables instead of PyGLM types
PyGLM_NO_FUNCTIONS - Only build the types
PYGLM_MINIMAL - Combines PyGLM_FAST and PyGLM_NO_FUNCTIONS

Another option PyGLM_SLIM is planned, which is supposed to only build the float types, to decrease the file size.

Starting the build process

To build PyGLM, simply run
python setup.py install.

Clone this wiki locally