HOW-TO Install CalculiX in Windows 10 with Windows Subsystem for Linux (WSL) from original source

With the recent updates in Microsoft Windows 10, it is possible to execute several of CLI programs for Linux directly at Windows, without the need of a virtualization tool such as VirtualBox. It installs a subsystem similar to what WINE does on Linux to run Windows software. The feature is called Windows Subsystem for Linux (WSL) and its available with the Creators Update of Windows 10. (More information about WSL here )

Windows Subsystem for Linux allows us to run CalculiX CrunchiX and GraphiX in Windows 10 using the official binaries available here. The main advantage of this is that it allows the user to have the latest update from the official source, decreasing room for instability in ported versions. As mentioned above, performance differences should be negligible.

If you still haven’t heard of CalculiX, I invite you to have a look to the official website. CCX is a FE solver totally open source. It uses a quite similar syntax as ABAQUS, so that different preprocessing tools can be used when selecting ABAQUS INP compatible input decks.

Is it fast?

The performance, while is not the same as native software, looks promising and constantly improving. For CPU intensive tasks it can be as good as native software! For intensive read/write operations is definitely slower, in case you plan to simulate with very big models.

In my personal tests with static contact problems I haven’t noticed differences.

Installation Procedure

Within a few steps, is possible to execute the binaries of CalculiX CrunchiX (CCX) and CalculiX GraphiX (CGX) that are directly available from the official CalculiX website.

Installation Steps for CalculiX CrunchiX

Install WSL

A good guide to do so is the official one from Microsoft here.

  1. Open PowerShell as Administrator and run:
 Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux
  1. Restart your computer when prompted.

Opening Bash for Windows

As explained in the aforementioned tutorial, you can access the Linux terminal (bash) after installing WSL by typing bash in the command line by accessing it through the Start Menu. There is another way that may become handy. By typing bash in the address bar in the Windows Explorer, it will be opened at the same working directory of the Explorer.

bashwinexp

Microsoft does not recommend to edit files from the Linux subsystem from Windows software. Still, I have edited the files with Sublime Text without any problem.

After setting up your UNIX account, lets update the current installation by typing:

sudo apt-get update
sudo apt-get upgrade

Install CCX executable

Once that the Bash is running we can proceed to install CCX.

In order to get both programs running, we will need some additional libraries and compilers.
Type in the bash the following command:

sudo apt-get install -y gfortran gcc

Then we will download, extract and move the CalculiX executable for Linux, directly from the official website.

wget http://www.dhondt.de/ccx_2.13.tar.bz2
bunzip2 ccx_2.13.tar.bz2
tar -xvf ccx_2.13.tar
sudo mv ccx_2.13 /usr/local/bin/ccx_2.13
chmod ao+rx /usr/local/bin/ccx_2.13 # change permissions of file

As last step we will set the amount of logical processors to work with OpenMP in our .bashrc file, which has several default settings of the bash. In the case of my computer (i7-6700K) is 8 but should be set accordingly for each CPU. It can be checked following this instructions.

echo "export OMP_NUM_THREADS=8" >> ~/.bashrc
source ~/.bashrc

Now it should be ready to run by using the command ccx_2.13.

Install CalculiX GraphiX

There no official support for software with graphic interface in Bash for Windows for now, but some workarounds have been found for a very good way to do this.

The installation process is similar, but we will need couple extra steps for the graphic libraries to run.

Install Xming

The first step is to install a Xserver for Windows. A good alternative is Xming.

Follow the default installation options. In order to use it, run Xming and you will notice in the tray bar ready to be used.

Install Gedit

Before installing CGX, we still need some libraries to run GUI software. An easy way to install the remaining libraries is to install Gedit from apt-get:

sudo apt-get install -y gedit

I also installed Gvim and even Thunar and seemed to worked reasonably well.

Install CGX executable

Then, we can proceed to install CGX with the following commands:

wget http://www.dhondt.de/cgx_2.13.bz2
bunzip2 cgx_2.13.bz2
sudo mv cgx_2.13 /usr/local/bin/cgx_2.13
chmod ao+rx /usr/local/bin/cgx_2.13 # change permissions of file

Ready!

Have a look at the official documentation here to learn how to use CalculiX.

Enjoy 😉

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