The Morpho language 🦋. Morpho is a small embeddable language for scientific computing applications.
The Morpho language. Morpho is a programmable environment for shape optimization and scientific computing tasks more generally. Morpho aims to be:
Morpho is based upon work supported by the National Science Foundation under grants DMR-1654283 and OAC-2003820.
Documentation is available on readthedocs, an extensive user manual and a developer guide. A Slack community is also available for people interested in using morpho and seeking support.
New! We now have a sequence of tutorial videos on our Youtube channel to help you learn Morpho:
In academic publications, please cite morpho as:
Joshi, C. et al., “Morpho – A programmable environment for shape optimization and shapeshifting problems”, arXiv:2208.07859 (2022)
We expect to update this once the paper is published.
Participation in the morpho community, both as users and developers, is bound by our Code of Conduct.
Morpho is under active development and we welcome contributions! Please see the Contributor’s guide for more information about how you can get involved in the morpho project. For those interested in extending morpho or working with the source a Developer guide is also provided in a separate repository.
We provide a Roadmap for future development plans that might give you ideas for how you could contribute.
We also welcome bug reports and suggestions: Please feel free to use the Issues feature on our github repository to bring these to the developers’ attention.
Code in this repository builds morpho as a shared library. Morpho also requires two subsidiary programs, a terminal app, and a viewer application.
For this release, morpho can be installed on all supported platforms using the homebrew package manager. Alternatively, the program can be installed from source as described below. We are continuously working on improving morpho installation, and hope to provide additional mechanisms for installation in upcoming releases.
The simplest way to install morpho is through the homebrew package manager. To do so:
If not already installed, install homebrew on your machine as described on the homebrew website
Open a terminal and type:
brew update
brew tap morpho-lang/morpho
brew install morpho morpho-cli morpho-morphoview
If you need to uninstall morpho, simply open a terminal and type brew uninstall morpho-cli morpho-morphoview morpho
. It’s very important to uninstall the homebrew morpho in this way before attempting to install from source as below.
The second way to install morpho is by compiling the source code directly. Morpho now leverages the Cmake build system, which enables platform independent builds. Windows users must first install Windows Subsystem for Linux; some instructions to do so are found below.
You can use any appropriate package manager to install morpho’s dependencies via the terminal. Using homebrew (preferred on macOS):
brew update
brew install cmake glfw suite-sparse freetype povray libgrapheme
Using apt (preferred on Ubuntu):
sudo apt update
sudo apt upgrade
sudo apt install build-essential cmake
sudo apt install libglfw3-dev libsuitesparse-dev liblapacke-dev povray libfreetype6-dev libunistring-dev
You can build the shared library, hosted in this repository.
git clone https://github.com/Morpho-lang/morpho.git
cd morpho
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release ..
sudo make install
cd ../../
The terminal app provides an interactive interface to morpho, and can also run morpho files. To build it:
git clone https://github.com/Morpho-lang/morpho-cli.git
cd morpho-cli
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release ..
sudo make install
morpho6
quit
to return to the shell and thencd ../../
to navigate back out of the morph-cli folder.
Morphoview is a simple viewer application to visualize morpho results.
git clone https://github.com/Morpho-lang/morpho-morphoview.git
cd morpho-morphoview
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release ..
sudo make install
morphoview
which should simply run and quit normally. You can then type
cd ../../
to navigate back out of the morpho-morphoview folder.
Windows support is provided through Windows Subsystem for Linux (WSL), which is an environment that enables windows to run linux applications. We highly recommend using WSL2, which is the most recent version and provides better support for GUI applications; some instructions for WSL1 are provided in the manual. Detailed information on running GUI applications in WSL2 is found on the Microsoft WSL support page.
Begin by installing the Ubuntu App from the Microsoft store.
Once the Ubuntu terminal is working in Windows, you can install morpho either through homebrew or by building from source.