Skip to content

shaobin/geomeculus

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Geomeculus

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.

Getting started

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-tools

If 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 --build

To build the debug version, run:

python3 scripts/build.py --build --debug

You can also build the release version and the debug version at the same time:

python3 scripts/build.py --build --release --debug

The 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 clang

The 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.sh

Then, you can build the system using the icx compiler:

python3 scripts/build.py --build --release --compiler icx

Sanity tests

After building Geomeculus, you can run the sanity tests:

python3 scripts/build.py --sanity-test --release

You 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 --debug

Running Geomeculus Scripts

A 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.gmc

Alternatively, we can use standard input redirection to run the script:

./build/release/bin/geomeculus < samples/playground.gmc

We can also use piping to run the script:

cat samples/playground.gmc | ./build/release/bin/geomeculus

We can import a script using --import and enter the interactive mode:

./build/release/bin/geomeculus --import samples/playground.gmc

The 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/geomeculus

Then, we can type the exec commands in the interactive mode.

exec samples/playground.gmc

When 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.

License

Licensed under the Apache 2.0 license.

Contributing

Bug reports

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.

Code contributions

Please submit a pull request.

Disclaimer

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.

About

A program for doing geometric algebra and geometric calculus.

Resources

License

Stars

Watchers

Forks