Skip to content

Commit

Permalink
Merge pull request #38 from HydLa/fix/readme-ubuntu
Browse files Browse the repository at this point in the history
fix README
  • Loading branch information
nikosai authored Feb 19, 2024
2 parents 674af17 + 701e172 commit 0b12def
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 31 deletions.
2 changes: 1 addition & 1 deletion .github/actions/setup-ubuntu/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ runs:
shell: bash
- name: install mathematica
run: |
wget https://account.wolfram.com/download/public/wolfram-engine/desktop/LINUX -O WolframEngine_LINUX.sh
wget 'https://account.wolfram.com/dl/WolframEngine?version=14.0&platform=Linux&downloadManager=false&includesDocumentation=false' -O WolframEngine_LINUX.sh
sudo bash WolframEngine_LINUX.sh
shell: bash
- name: setting libraries
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/build-on-ubuntu.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@ jobs:
- uses: ./.github/actions/setup-ubuntu
- name: build
run: |
make -j 4 MATHPATH=/usr/local/Wolfram/WolframEngine/13.2 CC=clang CXX=clang++
make -j 4 MATHPATH=/usr/local/Wolfram/WolframEngine/14.0 CC=clang CXX=clang++
ubuntu20_04-gcc9_3_0-python3_8_5:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- uses: ./.github/actions/setup-ubuntu
- name: build
run: |
make -j 4 MATHPATH=/usr/local/Wolfram/WolframEngine/13.2 CC=gcc CXX=g++
make -j 4 MATHPATH=/usr/local/Wolfram/WolframEngine/14.0 CC=gcc CXX=g++
ubuntu22_04-clang14_0_0-python3_10_6:
runs-on: ubuntu-22.04
Expand All @@ -32,12 +32,12 @@ jobs:
- uses: ./.github/actions/setup-ubuntu
- name: build
run: |
make -j 4 MATHPATH=/usr/local/Wolfram/WolframEngine/13.2 CC=clang CXX=clang++
make -j 4 MATHPATH=/usr/local/Wolfram/WolframEngine/14.0 CC=clang CXX=clang++
ubuntu22_04-gcc11_3_0-python3_10_6:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v2
- uses: ./.github/actions/setup-ubuntu
- name: build
run: |
make -j 4 MATHPATH=/usr/local/Wolfram/WolframEngine/13.2 CC=gcc CXX=g++
make -j 4 MATHPATH=/usr/local/Wolfram/WolframEngine/14.0 CC=gcc CXX=g++
71 changes: 45 additions & 26 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ http://www.ueda.info.waseda.ac.jp/hydla/

## Build

Also, you can use HydLa on [webHydLa](http://webhydla.ueda.info.waseda.ac.jp) even if you don't build HyLaGI.
You can also use [webHydLa](http://webhydla.ueda.info.waseda.ac.jp) to run HydLa programs without building HyLaGI on your own.

### Required packages

Expand All @@ -22,28 +22,43 @@ Also, you can use HydLa on [webHydLa](http://webhydla.ueda.info.waseda.ac.jp) ev
- Python
- Wolfram system (Mathematica, or WolframEngine)

### Ubuntu 22.04
### Ubuntu 22.04 with Clang

1. Install required packages
```
sudo apt update && sudo apt install -y git make clang libboost-all-dev
```bash
sudo apt update && sudo apt install -y git make clang libboost-all-dev uuid-dev
```
1. Install and activate Mathematica
If you don't have Wolfram's license, you can use [Free Wolfram Engine for Developers](https://www.wolfram.com/engine/index.php).
1. Library settings
e.g. Mathematica 11.3
1. Set `$MATHPATH` (see **What is `MATHPATH`?** below)
e.g., Wolfram Engine 14.0
```bash
echo "export MATHPATH='/usr/local/Wolfram/WolframEngine/14.0'" >> ~/.bashrc
source ~/.bashrc # or restart the terminal
```
echo "$MATHPATH/SystemFiles/Links/WSTP/DeveloperKit/Linux-x86-64/CompilerAdditions" >> /etc/ld.so.conf && ldconfig
1. Library settings
```bash
echo "$MATHPATH/SystemFiles/Links/WSTP/DeveloperKit/Linux-x86-64/CompilerAdditions" | sudo tee /etc/ld.so.conf.d/wstp.conf
sudo ldconfig
```
1. Build HyLaGI
```
```bash
git clone https://github.com/HydLa/HyLaGI.git
cd HyLaGI
make -j 4
export PATH="$PATH:/usr/local/Wolfram/Mathematica/11.3/Executables:$(pwd)/bin"
make -j 4 MATHPATH=$MATHPATH
echo "export PATH='$PATH:$MATHPATH/Executables:$(pwd)/bin'" >> ~/.bashrc
source ~/.bashrc # or restart the terminal
```
Then, you can use `hylagi` command.

Then, you can use `hylagi` command. For example:
```bash
hylagi -p 6 examples/bouncing_particle.hydla
```
1. 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:
```bash
make test fnum=2
```

### Other environments

HyLaGI supports several environments.
Expand Down Expand Up @@ -73,28 +88,32 @@ you can set environment variables when you exec `make`.
make -j 4 CC=gcc CXX=g++
```

#### Other path/to/Mathematica:
#### When using Python3 with `python` command:

- in other version:
```
make -j 4 MATHPATH=/usr/local/Wolfram/Mathematica/12.1
```
- using WolframEngine:
```
make -j 4 MATHPATH=/usr/local/Wolfram/WolframEngine/12.1
```
```
make -j 4 PYTHON_CONFIG=python-config
```

##### What is `MATHPATH`?
## What is `MATHPATH`?

Actually, `MATHPATH` is the path to the directory where the Wolfram system is installed.<br>
`MATHPATH` is the path to the directory where the Wolfram system is installed.
You can see it in [$InstallationDirectory](https://reference.wolfram.com/language/ref/$InstallationDirectory.html).

#### When using Python3 with `python` command:

```
make -j 4 PYTHON_CONFIG=python-config
$ 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`


## Known issues

### libc++abi: terminating with uncaught exception of type hydla::backend::LinkError: math link error: can not link : 1
Expand Down

0 comments on commit 0b12def

Please sign in to comment.