HyLaGI is a C++ implementation of hybrid constraint language HydLa.
Email address: hydla@ueda.info.waseda.ac.jp
More information about HydLa: http://www.ueda.info.waseda.ac.jp/hydla/
You can also use webHydLa to run HydLa programs without building HyLaGI on your own.
- Git
- Make
- GCC or Clang, and Boost library
- Python
- Wolfram system (Mathematica, or WolframEngine)
- Install required packages
sudo apt update && sudo apt install -y git make clang libboost-all-dev uuid-dev
- Install and activate Mathematica
If you don't have Wolfram's license, you can use Free Wolfram Engine for Developers. - Set
$MATHPATH
(see What isMATHPATH
? below)
e.g., Wolfram Engine 14.0echo "export MATHPATH='/usr/local/Wolfram/WolframEngine/14.0'" >> ~/.bashrc source ~/.bashrc # or restart the terminal
- Library settings
echo "$MATHPATH/SystemFiles/Links/WSTP/DeveloperKit/Linux-x86-64/CompilerAdditions" | sudo tee /etc/ld.so.conf.d/wstp.conf sudo ldconfig
- Build HyLaGI
Then, you can use
git clone https://github.com/HydLa/HyLaGI.git cd HyLaGI make -j 4 MATHPATH=$MATHPATH echo "export PATH='$PATH:$MATHPATH/Executables:$(pwd)/bin'" >> ~/.bashrc source ~/.bashrc # or restart the terminal
hylagi
command. For example:hylagi -p 6 examples/bouncing_particle.hydla
- Run tests
By default,make test
tries to do tests in parallel with too many threads. You should specify the number of threads as follows:make test fnum=2
HyLaGI supports several environments.
- OS: Ubuntu and macOS
- C++ compiler: Clang (default) and GCC
Build confirmed environment
- Ubuntu 20.04.1, GCC 9.3.0, Python 3.8.5
- Ubuntu 20.04.1, Clang 10.0.0, Python 3.8.5
- Ubuntu 22.04.1, GCC 11.3.0, Python 3.10.6
- Ubuntu 22.04.1, Clang 14.0.0, Python 3.10.6
- macOS 10.15.7, Apple clang 12.0.0, Python 3.6.9
- macOS 10.15.7, Apple clang 12.0.0, Python 3.8.5
To build several environments,
you can set environment variables when you exec make
.
make -j 4 CC=gcc CXX=g++
make -j 4 PYTHON_CONFIG=python-config
MATHPATH
is the path to the directory where the Wolfram system is installed.
You can see it in $InstallationDirectory.
$ math
Wolfram Language 14.0.0 Engine for Linux x86 (64-bit)
Copyright 1988-2023 Wolfram Research, Inc.
In[1]:= $InstallationDirectory
Out[1]= /usr/local/Wolfram/WolframEngine/14.0
Examples of MATHPATH
:
- With WolframEngine 14.0:
/usr/local/Wolfram/WolframEngine/14.0
- With Mathematica 12.1:
/usr/local/Wolfram/Mathematica/12.1
libc++abi: terminating with uncaught exception of type hydla::backend::LinkError: math link error: can not link : 1
HyLaGI uses the wolfram system to calculate constraints.
It uses WSTP communication with the math
command to make the call.
If you see this error, please make sure that the math
command is installed and in the path.
If the math
command does not exist (as confirmed when using WolframEngine on MacOS), create a symbolic link to WolframKernel
named math.
CI supports only build (not include testing examples). If you want to test them, do make test
after building HyLaGI on your terminal.