Compile FUNWAVE on Windows 10 ( via Linux Subsystem )

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 type bash in windows command window, Besides, one can get access and write files to any files using the bash commends,
  • 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

1.JPG

Then turn on Windows Subsystem for Linux in Control Panel

2.JPG

Now Download a Linux distribution in Microsoft Store. Personally I prefer Ubuntu 16.04 LTS.

3.jpg

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 initialization. After the initialization, one would be requested to set the username and password.

5.JPG

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 lanch 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 folder. If so, try to get the permission.

7.JPG

With the emaxple vessel_flat_bottom and set process number as 4, typing

make
mpirun -np 4 ./funwave_vessel

The code will be runing in the linux sunsystem. You do not have to worry about the communication between Linux and Windows, as you can see, as you run the code in Linux, you can get real-time access to the data files generated by the Linux excutive. 8.JPG

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s