Skip to content

Commit d220fb4

Browse files
authored
ansible: install clang on AIX (#4234)
Refs: #4091
1 parent 522b933 commit d220fb4

File tree

6 files changed

+143
-29
lines changed

6 files changed

+143
-29
lines changed

ansible.cfg

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ become_method = sudo
2626

2727
[hosts:aix]
2828
ansible_python_interpreter = /opt/freeware/libexec/python3
29+
ansible_remote_tmp = /tmp
2930

3031
[hosts:smartos]
3132
ansible_python_interpreter = /opt/local/bin/python

ansible/MANUAL_STEPS.md

Lines changed: 79 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,41 @@
11
# Manual steps required to setup machines
22

3-
* [Adding firewall entries for Jenkins workers](#adding-firewall-entries-for-jenkins-workers)
4-
* [`release-*` machines](#release--machines)
5-
* [`release-*container*` machines](#release-container-machines)
6-
* [AIX](#aix)
7-
* [Disk layout](#disk-layout)
8-
* [OpenSSL](#openssl)
9-
* [Remove en1 network interface](#remove-en1-network-interface)
10-
* [AIX 7.1](#aix-71)
11-
* [Update XL C/C++ Runtime](#update-xl-cc-runtime)
12-
* [AIX 7.2 Install](#aix-72-install)
13-
* [ccache 3.7.4 on AIX 7.2](#ccache-374-on-aix-72)
14-
* [Enable the AHA fs](#enable-the-aha-fs)
15-
* [Install XL compilers](#install-xl-compilers)
16-
* [Preparing gcc distributables](#preparing-gcc-distributables)
17-
* [Windows (Azure/Rackspace)](#windows-azurerackspace)
18-
* [Control machine (where Ansible is run)](#control-machine-where-ansible-is-run)
19-
* [Target machines](#target-machines)
20-
* [jenkins-workspace](#jenkins-workspace)
21-
* [benchmark](#benchmark)
22-
* [Static analysis](#static-analysis)
23-
* [Docker hosts](#docker-hosts)
24-
* [SmartOS](#smartos)
25-
* [IBM i](#ibm-i)
26-
* [z/OS](#zos)
3+
- [Manual steps required to setup machines](#manual-steps-required-to-setup-machines)
4+
- [Adding firewall entries for Jenkins workers](#adding-firewall-entries-for-jenkins-workers)
5+
- [`release-*` machines](#release--machines)
6+
- [`release-*container*` machines](#release-container-machines)
7+
- [AIX](#aix)
8+
- [Disk Layout](#disk-layout)
9+
- [OpenSSL](#openssl)
10+
- [Remove en1 network interface](#remove-en1-network-interface)
11+
- [AIX 7.1](#aix-71)
12+
- [Update XL C/C++ Runtime](#update-xl-cc-runtime)
13+
- [AIX 7.2 Install](#aix-72-install)
14+
- [ccache 3.7.4 on AIX 7.2](#ccache-374-on-aix-72)
15+
- [Enable the AHA fs](#enable-the-aha-fs)
16+
- [Install XL compilers](#install-xl-compilers)
17+
- [Preparing gcc distributables](#preparing-gcc-distributables)
18+
- [Install Clang Backend](#install-clang-backend)
19+
- [Preparing ccache distributables](#preparing-ccache-distributables)
20+
- [Windows (Azure/Rackspace)](#windows-azurerackspace)
21+
- [Control machine (where Ansible is run)](#control-machine-where-ansible-is-run)
22+
- [Target machines](#target-machines)
23+
- [Port Configuration](#port-configuration)
24+
- [Test](#test)
25+
- [jenkins-workspace](#jenkins-workspace)
26+
- [benchmark](#benchmark)
27+
- [Static analysis](#static-analysis)
28+
- [Docker hosts](#docker-hosts)
29+
- [SmartOS](#smartos)
30+
- [Provisioning the Machines](#provisioning-the-machines)
31+
- [Configuring the Host Environment](#configuring-the-host-environment)
32+
- [IBM i](#ibm-i)
33+
- [Install open source ecosystem](#install-open-source-ecosystem)
34+
- [Create Nodejs user](#create-nodejs-user)
35+
- [Create Nodejs user's home directory](#create-nodejs-users-home-directory)
36+
- [Set global PATH and .bashrc to use Open Source Ecosystem](#set-global-path-and-bashrc-to-use-open-source-ecosystem)
37+
- [Use bash as the default shell for your user (maintainer convenience) and the nodejs user](#use-bash-as-the-default-shell-for-your-user-maintainer-convenience-and-the-nodejs-user)
38+
- [z/OS](#zos)
2739

2840
## Adding firewall entries for Jenkins workers
2941

@@ -487,6 +499,49 @@ the version numbers.
487499
Example search for 4.8.5 gcc on bullfreeware:
488500
- http://www.bullfreeware.com/?searching=true&package=gcc&from=&to=&libraries=false&exact=true&version=5
489501

502+
### Install Clang Backend
503+
504+
The clang frontend will be auto installed via ansible playbook from:
505+
https://github.com/IBM/llvm-project/releases
506+
507+
The clang backend requires manually installing xl runtime and xl utilities
508+
509+
runtime:
510+
511+
1. Download the current *.tar.Z from https://www.ibm.com/support/pages/fix-list-xl-cc-runtime-aix
512+
513+
2. scp the tar onto the target - it helps to put both tarfiles into a single folder and scp the folder
514+
515+
3. On the target
516+
517+
```sh
518+
uncompress IBM_OPEN_XL_CPP_RUNTIME_17.1.4.1_AIX.tar.Z
519+
tar -xf IBM_OPEN_XL_CPP_RUNTIME_17.1.4.1_AIX.tar
520+
installp -aFXYd . ALL
521+
```
522+
523+
524+
utilities:
525+
526+
1. Download the current *.tar.Z from https://www.ibm.com/support/pages/ibm-open-xl-cc-utilities-aix-1712#DNLD
527+
2. scp tar onto the target
528+
3. On the target
529+
530+
```sh
531+
uncompress IBM_OPEN_XL_CPP_UTILITIES_17.1.2.8_AIX.tar.Z
532+
tar -xf IBM_OPEN_XL_CPP_UTILITIES_17.1.2.8_AIX.tar
533+
inutoc .
534+
installp -aFXYd . ALL
535+
```
536+
537+
After installing these packages we will need to update dnf:
538+
539+
```sh
540+
/usr/sbin/updtvpkg
541+
```
542+
543+
544+
490545
### Preparing ccache distributables
491546

492547
Notes:

ansible/roles/baselayout/tasks/main.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,3 +177,15 @@
177177
- "{{ role_path }}/tasks/partials/ntp/{{ os|stripversion }}.yml"
178178
- "{{ role_path }}/tasks/partials/ntp/{{ os|match_key(ntp_service, raise_error=False) }}.yml"
179179
skip: true
180+
181+
182+
- name: install clang
183+
include_tasks: "{{ clang_include }}"
184+
loop_control:
185+
loop_var: clang_include
186+
with_first_found:
187+
- files:
188+
- "{{ role_path }}/tasks/partials/clang/{{ os }}-{{ arch }}.yml"
189+
- "{{ role_path }}/tasks/partials/clang/{{ os }}.yml"
190+
- "{{ role_path }}/tasks/partials/clang/{{ os|stripversion }}.yml"
191+
skip: true
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
---
2+
#
3+
# Downloads and installs clang
4+
#
5+
6+
- name: Check if clang is already installed
7+
changed_when: no
8+
check_mode: no
9+
command: "/opt/clang+llvm-20.1.7-powerpc64-ibm-aix-7.2/bin/clang --version"
10+
register: clang
11+
ignore_errors: yes
12+
13+
# If we're already using the latest there is no need to do anything.
14+
# TODO improve the error handling
15+
- name: check existing clang version is up to date
16+
set_fact:
17+
update_clang: "{{ 'clang version 20.1.7' not in clang.stdout }}"
18+
19+
- name: create cache directory for clang binaries
20+
file:
21+
path: "/var/cache/clang-binaries"
22+
state: directory
23+
when: update_clang == True
24+
25+
- name: download clang binary
26+
get_url:
27+
checksum: sha256:a18aea07f5b977e64bc7fe7358e95897c7ba05fbe68eeefb1614631347be4b3a
28+
dest: "/var/cache/clang-binaries/clang+llvm-20.1.7-powerpc64-ibm-aix-7.2.tar.xz"
29+
url: "https://github.com/IBM/llvm-project/releases/download/llvmorg-20.1.7/clang+llvm-20.1.7-powerpc64-ibm-aix-7.2.tar.xz"
30+
register: clang_local
31+
when: update_clang == True
32+
33+
- name: unpack clang binary
34+
register: clang_unpacked
35+
unarchive:
36+
dest: "/opt/"
37+
list_files: yes
38+
remote_src: yes
39+
src: "{{ clang_local.dest }}"
40+
when: update_clang == True
41+
42+
# if we don't have the clang runtime libraries installed this will fail
43+
- name: Check if we have a runnable clang
44+
changed_when: no
45+
check_mode: no
46+
ansible.builtin.command: "/opt/clang+llvm-20.1.7-powerpc64-ibm-aix-7.2/bin/clang --version"

ansible/roles/baselayout/vars/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ common_packages: [
3737
# % ansible -m debug -a "var=os" HOST
3838
packages: {
3939
aix: [
40-
'bash,cmake,coreutils,curl,gcc-c++,tar,unzip,git,make,sudo,python3-setuptools,python3',
40+
'bash,cmake,coreutils,curl,gcc-c++,tar,unzip,git,make,sudo,python3-setuptools,python3,xz',
4141
],
4242

4343
# Appears to be some issue with the Ansible dnf task on AIX and gcc10-c++, so handle separately.

ansible/roles/bootstrap/tasks/partials/aix.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@
1616
size: 6G
1717
state: present
1818

19-
- name: Set size of /var to 2G
19+
- name: Set size of /var to 5G
2020
aix_filesystem:
2121
filesystem: /var
22-
size: 2G
22+
size: 5G
2323
state: present
2424

2525
- name: Set size of /tmp to 2G
@@ -34,10 +34,10 @@
3434
size: 50G
3535
state: present
3636

37-
- name: Set size of /opt to 5G
37+
- name: Set size of /opt to 12G
3838
aix_filesystem:
3939
filesystem: /opt
40-
size: 5G
40+
size: 12G
4141
state: present
4242

4343
# This is to mount the AIX file event infrastructure to get the file watcher tests passing

0 commit comments

Comments
 (0)