The Morpho language. Morpho is a programmable environment for shape optimization and scientific computing tasks more generally. Morpho aims to be:
- Familiar. Morpho uses syntax similar to other C-family languages. The syntax fits on a postcard, so it's easy to learn.
- Fast. Morpho programs run as efficiently as other well-implemented dynamic languages like wren or lua (Morpho is often significantly faster than Python, for example). Morpho leverages numerical libraries like BLAS, LAPACK and SUITESPARSE to provide high performance.
- Class-based. Morpho is highly object-oriented, which simplifies coding and enables reusability.
- Extendable. Functionality is easy to add via packages, both in Morpho and in C or other compiled languages.
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.
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
If you need to uninstall morpho, simply open a terminal and type brew uninstall 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 povray libfreetype6-dev libunistring-dev
You can build the shared library, hosted in this repository.
- Obtain the source by cloning the repository:
git clone https://github.com/Morpho-lang/morpho.git
- Navigate to the morpho folder and build the library:
cd morpho
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release ..
sudo make install
- Navigate back out of the morpho folder:
cd ../../
The terminal app provides an interactive interface to morpho, and can also run morpho files. To build it:
- Obtain the source by cloning the github public repository:
git clone https://github.com/Morpho-lang/morpho-cli.git
- Navigate to the morpho-cli folder and build the library:
cd morpho-cli
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release ..
sudo make install
- Check it works by typing:
morpho6
- Assuming that the morpho terminal app starts correctly, type
quit
to return to the shell and then
cd ../../
to navigate back out of the morph-cli folder.
Morphoview is a simple viewer application to visualize morpho results.
- Obtain the source by cloning the github public repository:
git clone https://github.com/Morpho-lang/morpho-morphoview.git
- Navigate to the morpho-cli folder and build the library:
cd morpho-morphoview
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release ..
sudo make install
- Check it works by typing:
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.
-
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.