CP2K in the cloud

This article describes how to deploy a Microsoft Azure compute instance to use with a CP2K compiled from scratch.

First, you need an instance. Login to MS Azure and switch to the resources tab. Select “Add” in the top menu to create a new virtual machine (or dedicated server if you go for the beefy machines). Select “Ubuntu Server” machines from Canonical. Select Ubuntu 16.04, one of the instance sizes matching your needs and fill all mandatory fields. For simple single-node calculations their actual content is of minimal interest. Make sure to paste your public SSH key into the appropriate field (the whole contents of the file .ssh/id_rsa.pub on most machines). As soon as your machine is available, you can directly login via SSH. Note that you specified the username during setup, so that username together with the IP/URL and your SSH key should allow you to connect directly. Depending on the availability provisioning your machine can take up to some 15 minutes.

Update the software database

Install the bare dependencies of CP2K and helpful tools:

Now two dependencies have to be built that are either not available in the repository or just compiled with the wrong flags.

with XX in the last line being the number of cores your machine offers. Now libxc is compiled. To help easy uninstalling, we use checkinstall as follows:

Just answer all the questions quickly – your answers are of no importance to the success of this method.

Then, we do the same with libint

Now you can checkout cp2k from your favourite source. Here, we take github:

Now for compilation you need to hint to the compiler where to find all libraries. In CP2K, this information is stored in ARCH files in the cp2k/arch/ directory. Put the following two files there (UbuntuServer.sopt for single-core calculations and UbuntuServer.popt for multicore calculations).


and UbuntuServer.popt:

Now enter the cp2k/makefiles folder and build cp2k

Leave a comment

Your email address will not be published.