How to run FUNWAVE-TVD on WindowsΒΆ
This document is provided by Zhouteng Ye.
Preface
The FUNWAVE code is developed with UNIX based operation systems (Linux and OSX). It used to be easy to compile with Microsoft Windows, but after the MPI feature was introduced in FUNWAVE, people found diffculties when compiling with Windows OS. Now, owing to a new feature of Windows 10, called Windows Subsystem for Linux, the FUNWAVE code can be compiled with Windows 10 without annoying compling rules for windows. The Linux subsystem allows the users to run Linux command in Windows OS. In some sense, the Linux subsystem is similar to the virtual machine approach, but it is much easier and much more power than the virtual machine in the following aspects:
Fantastic connection between Windows and Linux. You can log in to the Linux subsystem by simply typing
bash
in the Windows terminal. In addition, one can get access and write files to any files using thebash
commands.No limitation of CPU and RAM. Unlike the virtual machine, Linux system can use all CPU and RAM of the PC without any restriction.
Install Linux Subsystem for Windows 10
Make sure you have installed Windows 10 and logged in with your Microsoft account.
The first step is to enable the Developer mode in windows settings:
Then turn on Windows Subsystem for Linux in Control Panel:
Now Download a Linux distribution in Microsoft Store. Personally I prefer Ubuntu 16.04 LTS, but if this is unavailable, download the latest version (e.g., 18.04 LTS).
After install, you should be able to launch the Linux subsystem.
Get ready with Linux Subsytem
The first time one launch the Linux subsystem, it takes a couple minutes to initialize. After the initialization, one would be requested to set the username and password.
Type the following commands then you are all set
sudo apt update
sudo apt upgrade
sudo apt install make
sudo apt install gfortran
sudo apt install mpich
If you are in China, I would remommend you to change the apt source to the Chinese host.
Compile and run FUNWAVE
To launch the Linux subsystem, you can simply run bash
in Windows command window, then you are in the real Linux.
It should be noted that you may not get access to all folders. If so, try to get the permission.
With the example vessel_flat_bottom
and number of processors set to 4:
make
mpirun -np 4 ./funwave_vessel
The code will be rnuning in the Linux subsystem. Do not worry about the communication between Linux and Windows. As you run the code in Linux, you can get real-time access to the data files generated by the Linux excutive.