Skip to content

Commit e1434ff

Browse files
committed
build and install gcc 4.9.4 on rhel72
Builds and installs gcc 4.9 which isn't officially supported. The install could take up to 30 mins. Must use the following export PATH=/data/gcc-4.9/bin:$PATH export LDFLAGS="-Wl,-rpath,$(dirname $(/data/gcc-4.9/bin/gcc --print-file-name libgcc_s.so))"
1 parent 1bb25a1 commit e1434ff

File tree

5 files changed

+259
-2
lines changed

5 files changed

+259
-2
lines changed

ansible/inventory.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,7 @@ hosts:
125125
- linuxonecc:
126126
rhel72-s390x-1: {ip: 148.100.110.63}
127127
rhel72-s390x-2: {ip: 148.100.110.64}
128+
rhel72-s390x-3: {ip: 148.100.110.12}
128129

129130
- mininodes:
130131
ubuntu1604-arm64_odroid_c2-1: {ip: 70.167.220.147}

ansible/roles/baselayout/tasks/main.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
skip: true
4545

4646
- name: check for a recent enough ccache
47-
when: os in ccache_no_binpkg
47+
when: os in ccache_no_binpkg or 'rhel72-s390x' in inventory_hostname
4848
stat: path="{{ binary_dest }}"
4949
register: has_ccache
5050

@@ -98,6 +98,13 @@
9898
regexp: '^127\.0\.1\.1\s+\w.+$'
9999
line: '127.0.1.1 {{safe_hostname}}'
100100

101+
- name: run ccache installer
102+
when: os == "rhel72" and arch == "s390x" and not has_ccache.stat.exists
103+
include: ccache.yml
104+
static: false
105+
vars:
106+
- version: 3.3.3
107+
101108
- name: run ccache installer
102109
when: os in ccache_no_binpkg and not has_ccache.stat.exists
103110
include: ccache.yml

ansible/roles/gcc/tasks/main.yml

Lines changed: 233 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,233 @@
1+
---
2+
3+
#
4+
# installs gcc 4.9 @ /data/gcc-4.9
5+
#
6+
7+
- stat: path=/data/gcc-4.9/bin/gcc-4.9
8+
register: build_gcc_49
9+
tags: gcc49
10+
11+
- name: Clean path
12+
file:
13+
state: absent
14+
path: /data/tmp/
15+
when: build_gcc_49.stat.exists == False
16+
tags: gcc49
17+
18+
- name: Create working directory
19+
file:
20+
path: /data/tmp
21+
state: directory
22+
mode: 0755
23+
when: build_gcc_49.stat.exists == False
24+
tags: gcc49
25+
26+
- name: download gmp 6.1.0
27+
get_url:
28+
url: http://ftp.gnu.org/gnu/gmp/gmp-6.1.0.tar.xz
29+
dest: /data/tmp/
30+
when: build_gcc_49.stat.exists == False
31+
tags: gcc49
32+
33+
- name: unarchive gmp 6.1.0
34+
unarchive:
35+
src: /data/tmp/gmp-6.1.0.tar.xz
36+
remote_src: yes
37+
dest: /data/tmp/
38+
when: build_gcc_49.stat.exists == False
39+
tags: gcc49
40+
41+
- name: Create build directory
42+
file:
43+
path: /data/tmp/build
44+
state: directory
45+
mode: 0755
46+
when: build_gcc_49.stat.exists == False
47+
tags: gcc49
48+
49+
- name: configure gmp 6.1.0
50+
shell: /data/tmp/gmp-6.1.0/configure --prefix=/data/gcc-4.9
51+
args:
52+
chdir: /data/tmp/build
53+
when: build_gcc_49.stat.exists == False
54+
tags: gcc49
55+
56+
- name: build gmp 6.1.0
57+
shell: make -j{{ ansible_processor_cores }} install
58+
args:
59+
chdir: /data/tmp/build
60+
when: build_gcc_49.stat.exists == False
61+
tags: gcc49
62+
63+
- name: Clean path
64+
file:
65+
state: absent
66+
path: /data/tmp/
67+
when: build_gcc_49.stat.exists == False
68+
tags: gcc49
69+
70+
- name: Create working directory
71+
file:
72+
path: /data/tmp
73+
state: directory
74+
mode: 0755
75+
when: build_gcc_49.stat.exists == False
76+
tags: gcc49
77+
78+
- name: download mprf 3.1.4
79+
get_url:
80+
url: http://ftp.gnu.org/gnu/mpfr/mpfr-3.1.4.tar.gz
81+
dest: /data/tmp/
82+
when: build_gcc_49.stat.exists == False
83+
tags: gcc49
84+
85+
- name: unarchive mprf 3.1.4
86+
unarchive:
87+
src: /data/tmp/mpfr-3.1.4.tar.gz
88+
remote_src: yes
89+
dest: /data/tmp/
90+
when: build_gcc_49.stat.exists == False
91+
tags: gcc49
92+
93+
- name: Create build directory
94+
file:
95+
path: /data/tmp/build
96+
state: directory
97+
mode: 0755
98+
when: build_gcc_49.stat.exists == False
99+
tags: gcc49
100+
101+
- name: build mprf 3.1.4
102+
shell: /data/tmp/mpfr-3.1.4/configure --with-gmp=/data/gcc-4.9 --prefix=/data/gcc-4.9
103+
args:
104+
chdir: /data/tmp/build
105+
when: build_gcc_49.stat.exists == False
106+
tags: gcc49
107+
108+
- name: build mprf 3.1.4
109+
shell: make -j{{ ansible_processor_cores }} install
110+
args:
111+
chdir: /data/tmp/build
112+
when: build_gcc_49.stat.exists == False
113+
tags: gcc49
114+
115+
- name: Clean path
116+
file:
117+
state: absent
118+
path: /data/tmp/
119+
when: build_gcc_49.stat.exists == False
120+
tags: gcc49
121+
122+
- name: Create working directory
123+
file:
124+
path: /data/tmp
125+
state: directory
126+
mode: 0755
127+
when: build_gcc_49.stat.exists == False
128+
tags: gcc49
129+
130+
- name: download mpc 1.0.3
131+
get_url:
132+
url: http://ftp.gnu.org/gnu/mpc/mpc-1.0.3.tar.gz
133+
dest: /data/tmp/
134+
when: build_gcc_49.stat.exists == False
135+
tags: gcc49
136+
137+
- name: unarchive mpc 1.0.3
138+
unarchive:
139+
src: /data/tmp/mpc-1.0.3.tar.gz
140+
remote_src: yes
141+
dest: /data/tmp/
142+
when: build_gcc_49.stat.exists == False
143+
tags: gcc49
144+
145+
- name: Create build directory
146+
file:
147+
path: /data/tmp/build
148+
state: directory
149+
mode: 0755
150+
when: build_gcc_49.stat.exists == False
151+
tags: gcc49
152+
153+
- name: configure mpc 1.0.3
154+
shell: /data/tmp/mpc-1.0.3/configure --with-mpfr=/data/gcc-4.9 --with-gmp=/data/gcc-4.9 --prefix=/data/gcc-4.9
155+
args:
156+
chdir: /data/tmp/build
157+
when: build_gcc_49.stat.exists == False
158+
tags: gcc49
159+
160+
- name: build mpc 1.0.3
161+
shell: make -j{{ ansible_processor_cores }} install
162+
args:
163+
chdir: /data/tmp/build
164+
when: build_gcc_49.stat.exists == False
165+
tags: gcc49
166+
167+
- name: Clean path
168+
file:
169+
state: absent
170+
path: /data/tmp/
171+
when: build_gcc_49.stat.exists == False
172+
tags: gcc49
173+
174+
- name: Create working directory
175+
file:
176+
path: /data/tmp
177+
state: directory
178+
mode: 0755
179+
when: build_gcc_49.stat.exists == False
180+
tags: gcc49
181+
182+
- name: download gcc 4.9.4
183+
get_url:
184+
url: http://ftp.gnu.org/gnu/gcc/gcc-4.9.4/gcc-4.9.4.tar.gz
185+
dest: /data/tmp/
186+
when: build_gcc_49.stat.exists == False
187+
tags: gcc49
188+
189+
- name: unarchive gcc 4.9.4
190+
unarchive:
191+
src: /data/tmp/gcc-4.9.4.tar.gz
192+
remote_src: yes
193+
dest: /data/tmp/
194+
when: build_gcc_49.stat.exists == False
195+
tags: gcc49
196+
197+
- name: Create build directory
198+
file:
199+
path: /data/tmp/build
200+
state: directory
201+
mode: 0755
202+
when: build_gcc_49.stat.exists == False
203+
tags: gcc49
204+
205+
- name: configure gcc4.9
206+
shell: /data/tmp/gcc-4.9.4/configure --with-mpfr=/data/gcc-4.9 --with-gmp=/data/gcc-4.9 --prefix=/data/gcc-4.9 --program-suffix=-4.9 --disable-multilib
207+
args:
208+
chdir: /data/tmp/build
209+
when: build_gcc_49.stat.exists == False
210+
tags: gcc49
211+
212+
- name: build gcc49
213+
shell: make -j{{ ansible_processor_cores }}
214+
async: 3600
215+
poll: 10
216+
args:
217+
chdir: /data/tmp/build
218+
when: build_gcc_49.stat.exists == False
219+
tags: gcc49
220+
221+
- name: install gcc49
222+
shell: make install
223+
args:
224+
chdir: /data/tmp/build
225+
when: build_gcc_49.stat.exists == False
226+
tags: gcc49
227+
228+
- name: Clean path
229+
file:
230+
state: absent
231+
path: /data/tmp/
232+
when: build_gcc_49.stat.exists == False
233+
tags: gcc49

ansible/roles/jenkins-worker/meta/main.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@
66

77
dependencies:
88
- { 'role': 'java-base' }
9+
- { 'role': 'gcc', when: os in 'rhel72' }

ansible/roles/jenkins-worker/tasks/main.yml

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,26 @@
3333
when: "'rhel72-s390x' in inventory_hostname"
3434

3535
- name: create user
36-
when: not os|startswith("zos")
36+
when: not os|startswith("zos") and not "'rhel72-s390x' in inventory_hostname"
37+
user:
38+
name: "{{ server_user }}"
39+
group: "{{ server_user }}"
40+
shell: "{{ bash_path[os|stripversion]|default('/bin/bash') }}"
41+
42+
- name: create user for rhel72-s390x
3743
user:
3844
name: "{{ server_user }}"
3945
group: "{{ server_user }}"
46+
home: "/data/{{server_user }}"
4047
shell: "{{ bash_path[os|stripversion]|default('/bin/bash') }}"
48+
when: "'rhel72-s390x' in inventory_hostname"
49+
50+
- name: create symbolic link for home directory on rhel72-s390x
51+
file:
52+
src: "/data/{{ server_user }}"
53+
dest: "/home/{{ server_user }}"
54+
state: link
55+
when: "'rhel72-s390x' in inventory_hostname"
4156

4257
- name: add ::1 to /etc/hosts for ipv6 compat
4358
when: not os|startswith("zos")

0 commit comments

Comments
 (0)