{"id":227,"date":"2016-12-07T20:17:09","date_gmt":"2016-12-07T20:17:09","guid":{"rendered":"https:\/\/doublelayer.eu\/vilab\/?p=227"},"modified":"2017-03-02T15:47:48","modified_gmt":"2017-03-02T15:47:48","slug":"installation-of-libxc-3-0-0-trunk-gpaw1-1-0-ase","status":"publish","type":"post","link":"https:\/\/doublelayer.eu\/vilab\/2016\/12\/07\/installation-of-libxc-3-0-0-trunk-gpaw1-1-0-ase\/","title":{"rendered":"Installation of LibXC 3.0.0 trunk + GPAW1.1.0 + ASE"},"content":{"rendered":"<p>For a long time we\u00a0wanted to try SCAN functional implemented in LibXC using GPAW. However, at first, fresh LibXC 3.0.0 did not work. Then we could not compile GPAW. Unit today. Here is a recipe\u00a0that works for Fedora 25.<\/p>\n<p>First, let&#8217;s prepare clean Fedora 25:<\/p>\n<p><code>sudo dnf groupinstall \"Development Tools\"<br \/>\nsudo dnf groupinstall 'C Development Tools and Libraries'<br \/>\nsudo dnf install gcc-gfortran python-devel zlib-devel<br \/>\nsudo dnf install python-pip blas-devel lapack-devel atlas-devel openblas-devel rpm-build<br \/>\nsudo dnf install openmpi-devel scalapack-openmpi-devel blacs-openmpi-devel<br \/>\nsudo pip install --upgrade pip<br \/>\npip install --upgrade --user numpy scipy matplotlib<br \/>\nsudo dnf install nano<\/code><\/p>\n<p>Nano is installed in case you don&#8217;t like vi or emacs. Some packages might not be needed, but\u00a0we installed them anyway.<\/p>\n<p>LibXC compilation:<\/p>\n<p><code>svn co http:\/\/www.tddft.org\/svn\/libxc\/trunk\/ libxc<br \/>\ncd libxc<br \/>\nautoreconf -i<br \/>\n.\/configure --enable-shared --prefix=\/home\/USER\/xc<br \/>\nmake -j N<br \/>\nmake install<\/code><\/p>\n<p>After compiling LibXC add these lines to your <code>.bashrc<\/code>:<\/p>\n<p><code>export C_INCLUDE_PATH=\/home\/USER\/xc\/include<br \/>\nexport LIBRARY_PATH=\/home\/USER\/xc\/lib<br \/>\nexport LD_LIBRARY_PATH=\/home\/USER\/xc\/lib<\/code><\/p>\n<p>Let&#8217;s install ASE using pip, because it is easy.<\/p>\n<p><code>pip install --upgrade --user ase<\/code><\/p>\n<p>Get the GPAW source code and remove in <code>libxc.c<\/code> in <code>c\/xc\/<\/code> line &#8220;xc_mgga_x_tb09_set_params(self-&gt;functional[0], c);&#8221;. Them compile GPAW with <code>python setup.py install --user<\/code>. \u00a0YOu might want to add the <code>.local\/bin<\/code> to the path.<\/p>\n<p>Don&#8217;t forget to get setups. E.g. execute <code>gpaw install-data DIR<\/code>. After that try this example:<\/p>\n<p><code><br \/>\nfrom ase import Atom, Atoms<br \/>\nfrom gpaw import GPAW<br \/>\nxc = 'MGGA_X_SCAN+MGGA_C_SCAN'<br \/>\nbulk = Atoms([Atom('Li')], pbc=True)<br \/>\nk = 4<br \/>\ng = 8<br \/>\ncalc = GPAW(gpts=(g, g, g), kpts=(k, k, k),<br \/>\nxc=xc)#, txt=None)<br \/>\nbulk.set_calculator(calc)<br \/>\nbulk.get_potential_energy()<br \/>\n<\/code><\/p>\n","protected":false},"excerpt":{"rendered":"<p>For a long time we\u00a0wanted to try SCAN functional implemented in LibXC using GPAW. However, at first, fresh LibXC 3.0.0 did not work. Then we could not compile GPAW. Unit today. Here is a recipe\u00a0that works for Fedora 25. First, let&#8217;s prepare clean Fedora 25: sudo dnf groupinstall &#8220;Development Tools&#8221; sudo dnf groupinstall &#8216;C Development&hellip; <a class=\"read-more\" href=\"https:\/\/doublelayer.eu\/vilab\/2016\/12\/07\/installation-of-libxc-3-0-0-trunk-gpaw1-1-0-ase\/\">Read More<\/a><\/p>\n","protected":false},"author":5,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12],"tags":[34],"class_list":["post-227","post","type-post","status-publish","format-standard","hentry","category-know-how","tag-software"],"_links":{"self":[{"href":"https:\/\/doublelayer.eu\/vilab\/wp-json\/wp\/v2\/posts\/227","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/doublelayer.eu\/vilab\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/doublelayer.eu\/vilab\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/doublelayer.eu\/vilab\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/doublelayer.eu\/vilab\/wp-json\/wp\/v2\/comments?post=227"}],"version-history":[{"count":7,"href":"https:\/\/doublelayer.eu\/vilab\/wp-json\/wp\/v2\/posts\/227\/revisions"}],"predecessor-version":[{"id":288,"href":"https:\/\/doublelayer.eu\/vilab\/wp-json\/wp\/v2\/posts\/227\/revisions\/288"}],"wp:attachment":[{"href":"https:\/\/doublelayer.eu\/vilab\/wp-json\/wp\/v2\/media?parent=227"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/doublelayer.eu\/vilab\/wp-json\/wp\/v2\/categories?post=227"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/doublelayer.eu\/vilab\/wp-json\/wp\/v2\/tags?post=227"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}