Compile MIRKDC on Ubuntu
Qingyu Qu

Netlib is an online repository of various mathematical software, paper, and databases. This blog post record how to compile the MIRKDC, a Fortran routine capable of solving boundary value problems using MIRK methods with defect control and mesh refinement.

Compileing environment:

Ubuntu
gfortran
BLAS

Compile BLAS

First, to successfully compile the programs, we need BLAS, a set of linear algebra routines we will need in MIRKDC. We can download BLAS from netlib. After downloading BLAS from netlib, yeah, we hae downloaded a compressed file .tgz. Then we need to unzip the BLAS routine and make install:

1
2
3
tar -xvf blas-3.11.0.tgz
cd BLAS-3.11.0/
make

After these commands, there would be a blas_LINUX.a file, that is what we need in the linking step.

Compile and link

We download the MIRKDC routine and its driver program, here, while the driver program is a txt file, we need to use the Fortran code section and name it as mirkdc_driver.f.

Make sure all the three file, mirkdc.f, mirkdc_driver.f, blas_LINUX.a located in a same folder, then we can use gfortran to compile and link them:

1
gfortran -o testing mirkdc.f mirkdc_driver.f -std=legacy blas_LINUX.a

The above code generate a testing file, then we can run the execuable file by:

1
./testing

Hooray! Then we can specify our settings of the boundary value problem!

Some notes

Here, the MIRKDC routine and MIRKDC_driver routine are both Fortran77, which use a fixed-format. The fixed-format doesn’t allow writing any code in the first 6 column.(Free format doesn’t have this restriction) The first 6 column is only allowed to declare comments, declare a symbol which connent this line and the above line(Yeah, Fortran77 also restrict how many characters in one line😅, probably at that time, the coding machine couldn’t handle a line with too many characters).