---
# System prepended metadata

title: modmesh README draft
tags: [modmesh]

---

# modmesh README draft

###### tags: `modmesh`



## Dependencies

Required for development: Python 3, numpy, pytest, flake8

Optional: LLVM, qt6, setuptools

## Build Modmesh
Note that there are two build types: `Debug` and `Release`. For example, `CMAKE_BUILD_TYPE=Debug`.
```shell
$ make buildext                                       
    VERBOSE=1 BUILD_QT=OFF
    CMAKE_BUILD_TYPE=[build type]
    CMAKE_ARGS="-DPYTHON_EXECUTABLE=$(which python3)"
```

## Build Modmesh with Viewer
Due to the complexity and the nature of modmesh, modmesh can be built with a viewer which visualizes how modmesh works and what modmesh provides. 
However, the viewer demands qt6 so qt6 must be installed in advance and the environment variable `CMAKE_PREFIX_PATH` must be set to find the path of qt6 directory. 
As the path of qt6 directory varies with each machine, creating `setup.mk` in the root directory of modmesh and writing the following code within could help.
```makefile
CMAKE_PREFIX_PATH := [path to the Qt directory] # For example, CMAKE_PREFIX_PATH := "~/Qt/6.3.1/macos/"
```
Moving on, run the following command to build modmesh with the viewer. 

```shell
$ make viewer                                   
    VERBOSE=1 BUILD_QT=ON
    CMAKE_BUILD_TYPE=[build type]
    CMAKE_ARGS="-DPYTHON_EXECUTABLE=$(which python3)"
```

## Have fun
```script
./build/dev39/cpp/binary/viewer/viewer.app/Contents/MacOS/viewer
```
On the menu bar are two kinds of app which can be loaded into the viewer.
Try out the *sample_mesh* first to see what's hidden behind!