Skip to content

Installation

Niklaus Schen edited this page Nov 16, 2023 · 6 revisions

Installation

Meproc is written in Melang scripting language. So we just need to install Melang interpreter.

And Melang is derived from a C core library named Melon, so it should be installed at first.

You can pull the built container image to run it.

docker pull melonc/meproc

Or you can use the following shell to install Melon and Melang quickly.

git clone https://github.com/Water-Melon/Melon.git
cd Melon && ./configure && make && sudo make install && cd ../ && rm -rf Melon
sudo echo "/usr/local/melon/lib/" >> /etc/ld.so.conf
sudo ldconfig
git clone https://github.com/Water-Melon/Melang.git
cd Melang && ./configure && make all && sudo make install && cd ../ && rm -rf Melang

Now, we can start up Meproc.

melang Meproc/meproc.m

Or run in background

melang -d Meproc/meproc.m

You will see the output of Meproc.

11/10/2023 16:19:12 UTC [INFO]: Listen: 0.0.0.0:8606

The following content teaches you how to compile and install Melon and Melang with default installation parameters on UNIX/Linux step by step.

If you are a Windows developer, please refer to the Github repository of Melon for more details.

Step 1. Install Melon

git clone https://github.com/Water-Melon/Melon.git
cd Melon
./configure
make
sudo make install

It will be installed at /usr/local/melon.

But this path is not the default library search path, so there are several solutions to resolve the loading issue during compilation and runtime.

Compilation

We can create symbolic links in /usr/lib and /usr/include to the lib and include subdirectories of our library installation path.

ln -s /usr/local/melon/conf /etc/melon
ln -s /usr/local/melon/lib/libmelon.* /usr/lib/
ln -s /usr/local/melon/include /usr/include/melon

In this example, we also create a symbolic link for its configuration.

Runtime

When using Melon's dynamic library, the path to the library needs to be added to the system configuration

sudo echo "/usr/local/melon/lib/" >> /etc/ld.so.conf
sudo ldconfig

Or use the command given below to solve dynamic library not found problem:

export LD_LIBRARY_PATH=/path/to/melon/libdir:$LD_LIBRARY_PATH

Step 2. Install Melang

git clone https://github.com/Water-Melon/Melang.git
cd Melang
./configure
make all
sudo make install

Now we can use melang to run a Melang program.

Step 3. Install Meproc

git clone https://github.comMelonCTech/Meproc.git

That's all.

Clone this wiki locally