# Install MCCE

# Download and Install MCCE

## Download and Install MCCE

MCCE runs on Linux and Mac OSX natively.

On Windows, you will need a Linux environment. It could be a virtual box instance, Cygwin, or Linux subsystem that is included in Windows. Here is a short guide of installing Windows Subsystem Linux (to be done):

### Prerequisites

#### Compilers:

C, gfortran

MCCE comes with two parts:

- MCCE main code in c/c++
- Poisson Boltzmann equation solver delphi in c/fortran

You need basic Linux program tools like make and ar utility. They usually some with the operating system. If not, install them. On Ubuntu, run

`sudo apt install build-essential`

It is recommended to use the compilers under conda. Conda provides compilers and other programming tools under user space. If you don't have conda, you can follow instructions here [https://docs.conda.io/en/latest/miniconda.html](https://docs.conda.io/en/latest/miniconda.html) to install miniconda.

#### Python and modules

We need Python3 and optionally these modules: numpy, scipy, matplotlib, pygraphviz, pandas, xlrd, and openpyxl

- Install Miniconda Python3: [https://docs.conda.io/en/latest/miniconda.html](https://docs.conda.io/en/latest/miniconda.html)
- After installing Miniconda, install these optional modules for data analysis:

```
conda install requests numpy scipy matplotlib pygraphviz pandas xlrd openpyxl multiprocess
```

To install gfortran compiler that is compatible for delphi:

Create mcce environment

`conda create -n mcce `  
`conda activate mcce`

Install compilers

`conda install -c conda-forge gcc gfortran`

Now roll back gfortran to 9.5.0 (delphi requires an old compiler)

`conda install -c conda-forge gfortran=9.5.0`


### Install MCCE

#### Download from github

Under a terminal window, run:

[`git clone https://github.com/GunnerLab/MCCE4-Alpha.git`](https://github.com/GunnerLab/MCCE4-Alpha.git)

#### Compile the code

The above command creates a directory named MCCE4-Alpha, enter the directory and compile:

```
$ cd MCCE4-Alpha
$ make clean
$ make
```

#### Configure environment

Find the path of Stable-MCCE installation directory:

```
(base) jmao@pc:~/projects/MCCE4-Alpha$ pwd
/home/jmao/projects/MCCE4-Alpha
```

In my case the installation directory is **/home/jmao/projects/MCCE4-Alpha/**

Add the executable to your path:

```
export PATH=/home/jmao/projects/MCCE4-Alpha/bin:$PATH
export PATH=/home/jmao/projects/MCCE4-Alpha/MCCE_bin:$PATH
```

Remember to replace the installation directory **/home/jmao/projects/MCCE4-Alpha/** with your own installation path.

Also put this line at the end of .bashrc file under your home directory so that the environment is properly set every time you open a terminal window.