{"id":56,"date":"2022-06-15T08:08:04","date_gmt":"2022-06-15T02:38:04","guid":{"rendered":"https:\/\/varuna.aero.iitb.ac.in\/ace\/?p=56"},"modified":"2022-09-01T09:46:18","modified_gmt":"2022-09-01T04:16:18","slug":"openfoam-9-compilation-from-source-code-on-centos7","status":"publish","type":"post","link":"https:\/\/varuna.aero.iitb.ac.in\/ace\/index.php\/2022\/06\/15\/openfoam-9-compilation-from-source-code-on-centos7\/","title":{"rendered":"OpenFoam 9 Compilation from Source Code on CentOs7"},"content":{"rendered":"\n<p style=\"font-size:16px\">These steps are for ACE cluster. But can be run on any CentOs7 machine. Provided you have completed installing the prerequisites. If not do the 1st 4 steps from here &#8211; <a rel=\"noreferrer noopener\" href=\"https:\/\/cutt.ly\/MJ5ApMA\" target=\"_blank\">OpenFoamWiKi<\/a><\/p>\n\n\n\n<p style=\"font-size:15.5px\"><strong>Use default openmpi for openfoam on SOUMYA as the Intel Omnipath does not support any other version.<\/strong><\/p>\n\n\n\n<p style=\"font-size:16px\">On ACE prerequisites are already installed, so you can continue from the below command. Connect to the internet before proceeding. If you are unaware of how to connect to the internet on a terminal, please follow the guide created by Computer Centre &#8211; &#8220;<a rel=\"noreferrer noopener\" href=\"https:\/\/www.cc.iitb.ac.in\/attachments\/sso\/InternetAccess_WithoutGUI.pdf\" target=\"_blank\">Internet without GUI<\/a>&#8220;<\/p>\n\n\n\n<pre class=\"wp-block-code\" style=\"font-size:15px\"><code>1. #OpenFOAM downloading and installation\ncd ~\nmkdir OpenFOAM\ncd OpenFOAM\nwget -O - ftp:\/\/ftp.aero.iitb.ac.in\/ace\/openfoam\/o9.tar.gz | tar -xvz\nwget -O - ftp:\/\/ftp.aero.iitb.ac.in\/ace\/openfoam\/t9.tar.gz | tar -xvz\nmv OpenFOAM-9-version-9 OpenFOAM-9\nmv ThirdParty-9-version-9 ThirdParty-9\n\n2. #Add source paths in your bashrc before proceeding with the installation \nAdd in the end -\nvi ~\/.bashrc\n\n#openfoam9\nsource \/opt\/rh\/python27\/enable\nsource \/opt\/rh\/devtoolset-7\/enable\nsource $HOME\/OpenFOAM\/OpenFOAM-9\/etc\/bashrc\n\n3. #Source your bashrc\nsource ~\/.bashrc\n\n4.  Download required extra files before openfoam installation\n\ncd ThirdParty-9\nmkdir download\nwget -P download https:\/\/github.com\/CGAL\/cgal\/releases\/download\/releases%2FCGAL-5.0.2\/CGAL-5.0.2.tar.xz\nwget -P download https:\/\/sourceforge.net\/projects\/boost\/files\/boost\/1.72.0\/boost_1_72_0.tar.bz2\n\ntar -xJf download\/CGAL-5.0.2.tar.xz\ntar -xjf download\/boost_1_72_0.tar.bz2\n\ncd ..\n\nsed -i -e 's\/\\(boost_version=\\)boost-system\/\\1boost_1_72_0\/' OpenFOAM-9\/etc\/config.sh\/CGAL\nsed -i -e 's\/\\(cgal_version=\\)cgal-system\/\\1CGAL-5.0.2\/' OpenFOAM-9\/etc\/config.sh\/CGAL\n\n8. We can now start to install OpenFoam now. Navigate to OpenFoam directory\n\ncd OpenFOAM-9\n\n9. Run the command \"export WM_NCOMPPROCS=ncpus\" for multithreading compilation. Below command will set 12 Cores\nexport WM_NCOMPPROCS=16\n\n10. Start installation\n.\/Allwmake -j \n\nYou can run it again just to verify -\n.\/Allwmake -j \n\n\n11. If it is compiled without any errors, then it is done. You can check \n\nicoFoam -help\n\n12. Install Paraview (<strong>Paraview still does not work in remote ssh connection. Below steps are just for your information.<\/strong>)\ncd ..\/ThirdParty-9\nwget -P download http:\/\/www.paraview.org\/files\/v5.6\/ParaView-v5.6.3.tar.gz\nwget -P download http:\/\/download.qt.io\/archive\/qt\/5.9\/5.9.6\/single\/qt-everywhere-opensource-src-5.9.6.tar.xz\nwget -P download  https:\/\/www.cmake.org\/files\/v3.9\/cmake-3.9.0.tar.gz\n\n\ntar -xJf download\/qt-everywhere-opensource-src-5.9.6.tar.xz --transform='s\/qt-everywhere-opensource-src\/qt-everywhere-src\/'\ntar -xzf download\/ParaView-v5.6.3.tar.gz --transform='s\/ParaView-v5.6.3\/ParaView-5.6.3\/'\ntar -xzf download\/cmake-3.9.0.tar.gz\n\ncd $WM_THIRD_PARTY_DIR\n.\/makeCmake > log.makeCmake 2>&amp;1\nwmRefresh\n\nwget https:\/\/github.com\/wyldckat\/scripts4OpenFOAM3rdParty\/raw\/master\/makeQt5\nwget -P etc\/tools\/ https:\/\/github.com\/OpenFOAM\/ThirdParty-2.4.x\/raw\/master\/etc\/tools\/QtFunctions\n \n#make them executable\nchmod +x makeQt5\n \n.\/makeQt5 qt-5.9.6 > log.makeQt 2>&amp;1\n\n\ncd $WM_THIRD_PARTY_DIR\nrm -r build\nrm -r qt-everywhere-src-5.9.6\n\n##Compile Paraview\nexport CMAKE_PREFIX_PATH=$WM_THIRD_PARTY_DIR\/platforms\/$WM_ARCH$WM_COMPILER\/qt-5.9.6\/\n\n\n.\/makeParaView -qt-5.9.6 -mpi -python -python-lib \/opt\/rh\/python27\/root\/usr\/lib64\/libpython2.7.so -python-include \/opt\/rh\/python27\/root\/usr\/include\/python2.7 > log.makePV 2>&amp;1\n\n\nYou need to run Allwmake in OpenFoam-9 directory again after paraview compilation.\n\nNow Source bashrc once.\nsource ~\/.bashrc\n\n\n<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>These steps are for ACE cluster. But can be run on any CentOs7 machine. Provided you have completed installing the prerequisites. If not do the 1st 4 steps from here &#8211; OpenFoamWiKi Use default openmpi for openfoam on SOUMYA as the Intel Omnipath does not support any other version. On ACE prerequisites are already installed, <a class=\"read-more\" href=\"https:\/\/varuna.aero.iitb.ac.in\/ace\/index.php\/2022\/06\/15\/openfoam-9-compilation-from-source-code-on-centos7\/\">&hellip;&nbsp;<span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"ngg_post_thumbnail":0,"footnotes":""},"categories":[1],"tags":[5,7,6,4],"class_list":["post-56","post","type-post","status-publish","format-standard","hentry","category-uncategorized","tag-ace","tag-centos7","tag-cluster","tag-openfoam"],"_links":{"self":[{"href":"https:\/\/varuna.aero.iitb.ac.in\/ace\/index.php\/wp-json\/wp\/v2\/posts\/56","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/varuna.aero.iitb.ac.in\/ace\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/varuna.aero.iitb.ac.in\/ace\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/varuna.aero.iitb.ac.in\/ace\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/varuna.aero.iitb.ac.in\/ace\/index.php\/wp-json\/wp\/v2\/comments?post=56"}],"version-history":[{"count":23,"href":"https:\/\/varuna.aero.iitb.ac.in\/ace\/index.php\/wp-json\/wp\/v2\/posts\/56\/revisions"}],"predecessor-version":[{"id":222,"href":"https:\/\/varuna.aero.iitb.ac.in\/ace\/index.php\/wp-json\/wp\/v2\/posts\/56\/revisions\/222"}],"wp:attachment":[{"href":"https:\/\/varuna.aero.iitb.ac.in\/ace\/index.php\/wp-json\/wp\/v2\/media?parent=56"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/varuna.aero.iitb.ac.in\/ace\/index.php\/wp-json\/wp\/v2\/categories?post=56"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/varuna.aero.iitb.ac.in\/ace\/index.php\/wp-json\/wp\/v2\/tags?post=56"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}