Geomeculus is a program for doing geometric algebra and geometric calculus. It is a command-line tool implemented in C.
Geomeculus provides an environment for learning and applying mathematical and physical concepts. Whether you're a student, researcher, or enthusiast, Geomeculus can help you deepen your understanding, build intuition, and solve real-world problems.
To explore the fundamentals of geometric algebra and geometric calculus, as well as how Geomeculus can be applied in practice, check out this tutorial.
You can use the scripts/build.py script to set up the development environment and build Geomeculus. This project provides a meta build system that automatically detects the code dependencies, generates the Ninja build scripts, and builds the project. The meta build system should work for most modern Linux systems.
To install the build tools, run the following command (python3 is required) if a supported package manager, apt, dnf, pacman, or zypper, is available on your system:
python3 scripts/build.py --install-build-toolsIf the build script cannot locate a supported package manager, it will print the required packages that are missing and you need to install them manually. The following packages are required:
- python3 (for running the build script)
- git (for cloning the source code)
- C and C++ compiler (GCC, Clang, or Intel® C/C++ compiler)
- Ninja Build system
To build Geomeculus (release version), simply run:
python3 scripts/build.py --buildTo build the debug version, run:
python3 scripts/build.py --build --debugYou can also build the release version and the debug version at the same time:
python3 scripts/build.py --build --release --debugThe supported compilers include Clang, GCC, and Intel® C compiler (icx). You can specify the compiler by using "--compiler" option, with the following choices: "clang", "gcc", and "icx". For example, to use clang:
python3 scripts/build.py --build --release --compiler clangThe default compiler is gcc. To use the icx compiler, you need to install the Intel® oneAPI Base Toolkit and configure the local environment variables using the setvars.sh script, which can be found in the installation directory, for example:
source /opt/intel/oneapi/setvars.shThen, you can build the system using the icx compiler:
python3 scripts/build.py --build --release --compiler icxAfter building Geomeculus, you can run the sanity tests:
python3 scripts/build.py --sanity-test --releaseYou can run the sanity tests for both the release version and the debug version if you have built both versions:
python3 scripts/build.py --sanity-test --release --debugA geomeculus script (.gmc) can be run in multiple ways. The simplest way is to run geomeculus executable with the script file as the argument. For example:
./build/release/bin/geomeculus samples/playground.gmcAlternatively, we can use standard input redirection to run the script:
./build/release/bin/geomeculus < samples/playground.gmcWe can also use piping to run the script:
cat samples/playground.gmc | ./build/release/bin/geomeculusWe can import a script using --import and enter the interactive mode:
./build/release/bin/geomeculus --import samples/playground.gmcThe named expressions defined in the script following --import will be imported into the current interactive session.
We can run the script in the interactive mode as well. First, run the geomeculus executable without any arguments:
./build/release/bin/geomeculusThen, we can type the exec commands in the interactive mode.
exec samples/playground.gmcWhen we use the exec command in the interactive mode, geomeculus will execute the script and then return to the interactive mode. We can use the exec command to "import" the named expressions defined in the script into the current interactive session.
Licensed under the Apache 2.0 license.
The memory management summary will be printed at the end of the program execution. Any status codes is not "OK", please file a bug report.
Please submit a pull request.
This project shares the same lead developer as LightAIMD, so you may notice similarities in code style and design patterns. For details on source code files reused from the LightAIMD repository, please refer to the NOTICE file.