CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Announcements from Other Sources (https://www.cfd-online.com/Forums/openfoam-news-announcements-other/)
-   -   "Universal buildscript" based on Ansible (https://www.cfd-online.com/Forums/openfoam-news-announcements-other/187306-universal-buildscript-based-ansible.html)

gschaider May 3, 2017 12:15

"Universal buildscript" based on Ansible
 
Wanted to draw you attention on my latest project: a "script" to compile OpenFOAM-variants on different Linux-versions. It makes sure that the required software is installed.

The script is implemented with Ansible a tool for automating adminsitrative tasks.

Currently supported Foam-versions are OpenFOAM 4.1, OpenFOAM+ v1612 and Foam-extend 4.0

Implemented Linux-versions are Centos /, ArchLinux, Ubuntu 1604 and Fedora 25.

For details see the project page https://sourceforge.net/p/openfoam-e...tree/README.md and the Wiki-page https://openfoamwiki.net/index.php/Installation/Ansible

The project should be currently be considered in the Alpha-phase: it was only run on my machines, worked there but nobody else has tried it. So if you are new to OpenFOAM don't try it yet

Feedback and contributions are welcome

Have fun
Bernhard Gschaider

markusrehm August 26, 2017 10:03

1 Attachment(s)
Hi Bernhard,

this is really a nice tool and application of it!

I tried to modify it in order to make it work with CentOS6. I just copied all CentOS7 content. Do you know if any further modifications are necessary?

I appended my error log.
The first foam compilation that occurs is
Code:

"/home/openfoam/OpenFOAM/OpenFOAM-4.1/etc/config.sh/mpi: Zeile 46: mpicc: Kommando nicht gefunden."
Best regards, Markus.

wyldckat August 26, 2017 14:07

Quick answer @Markus: I haven't managed yet to study this installation mechanism that Bernhard created, but the error message that you're getting seems to be because the correct module was not loaded in time and/or because the environment isn't up-to-date yet (logout + login might be necessary).

However, check the step by step instructions for when doing the installation manually: https://openfoamwiki.net/index.php/I...HEL#CentOS_6.8
The trick used there for when the environment isn't ready yet (logout+login hasn't been done yet) is to run the following command (this is for 64-bit):
Code:

module load openmpi-x86_64 || export PATH=$PATH:/usr/lib64/openmpi/bin

gschaider August 28, 2017 06:50

Quote:

Originally Posted by markusrehm (Post 661954)
Hi Bernhard,

this is really a nice tool and application of it!

I tried to modify it in order to make it work with CentOS6. I just copied all CentOS7 content. Do you know if any further modifications are necessary?

I appended my error log.
The first foam compilation that occurs is
Code:

"/home/openfoam/OpenFOAM/OpenFOAM-4.1/etc/config.sh/mpi: Zeile 46: mpicc: Kommando nicht gefunden."
Best regards, Markus.

Hello Markus!

I started porting it to CentOS 6 already but it is currently not very high priority. There are two problems with CentOS6
  • The old (Python 2.6) Python version
  • The old compiler that doesn't compile OF 5.0 and 1706+
  • Installation of MPI is different on Centos 6 than 7 (see Brunos post).
To work around the old Python I currently run Ansible on a Centos7 machine and tell it to apply the Playbook on the target machine
Code:

ansible-playbook exampleConfigs/buildfoam.yml -i sampleConfigs/workstation010 -u root -k
(use your own inventory-file)
For the compiler I make the script compile its own OF-compiler (Gcc 6.1) and use that. For OpenMPI I do the same
Currently this only compiles OF 5.0. The problem with v1706+ is that the download of the tarball fails (seems that the Python 2.6 TLS-libraries have a problem).

I pushed the branch to both repos: https://sourceforge.net/p/openfoam-e...tos6/%7E/tree/ and https://bitbucket.org/bgschaid/ansib...e/port/centos6 (pull requests are welcome on both)
These are work-in-progress and I can't promise that the issue will be fixed this week (something like https://bitbucket.org/bgschaid/ansib...e/port/centos6 might fix the 1706+ problem. But I'd like to look at this more closely).

Bernhard

markusrehm September 1, 2017 16:11

1 Attachment(s)
Hi Bernhard,

it worked. I have to check more thoroughly but it seems that only 1606 and 1706 were not installed. Anyway, a really great tool that kept my poor i3-Notebook busy for days ;).

However, I needed to do some changes. Not sure if this makes sense, but that's how it worked for me:

Code:

hg clone https://bitbucket.org/bgschaid/ansiblefoaminstallation

hg branch feature/port/centos6

sed 's:python2-pip:python-pip:' /home/openfoam/ansible_bb/ansiblefoaminstallation/roles/pyfoam/tasks/install_centos7.yml /home/openfoam/ansible_bb/ansiblefoaminstallation/roles/pyfoam/tasks/install_centos6.yml

yum install glibc-devel*.i686 libgcc.i686

I also quickly appended the error from 1706 compilation. I will have a closer look when I find more time.

Best regards, Markus.

gschaider September 8, 2017 07:23

Quote:

Originally Posted by markusrehm (Post 662810)
Hi Bernhard,

it worked. I have to check more thoroughly but it seems that only 1606 and 1706 were not installed. Anyway, a really great tool that kept my poor i3-Notebook busy for days ;).

However, I needed to do some changes. Not sure if this makes sense, but that's how it worked for me:

Code:

hg clone https://bitbucket.org/bgschaid/ansiblefoaminstallation

hg branch feature/port/centos6

sed 's:python2-pip:python-pip:' /home/openfoam/ansible_bb/ansiblefoaminstallation/roles/pyfoam/tasks/install_centos7.yml /home/openfoam/ansible_bb/ansiblefoaminstallation/roles/pyfoam/tasks/install_centos6.yml

yum install glibc-devel*.i686 libgcc.i686

I also quickly appended the error from 1706 compilation. I will have a closer look when I find more time.

Best regards, Markus.

Hello Markus!

Thanks. Your changes are correct. I know because I did them indepently in changes that I hadn't pushed yet.

Also your problem with 1706 is probably fixed. The problem is that the sources were untarred as root but then the openfoam-user could not write into the created directories

I pushed the missing changes and merged them into the develop-branch

Bernhard


All times are GMT -4. The time now is 07:13.