Skip to content

Commit 0683e99

Browse files
jBarzmhdawson
authored andcommitted
build: 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 LD_LIBRARY_PATH="/data/gcc-4.9/lib64:$LD_LIBRARY_PATH" PR-URL: #1157 Reviewed-By: Michael Dawson <[email protected]> Reviewed-By: Gibson Fahnestock <[email protected]>
1 parent 5c9ab90 commit 0683e99

File tree

5 files changed

+318
-2
lines changed

5 files changed

+318
-2
lines changed

ansible/inventory.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@ hosts:
127127
- linuxonecc:
128128
rhel72-s390x-1: {ip: 148.100.110.63}
129129
rhel72-s390x-2: {ip: 148.100.110.64}
130+
rhel72-s390x-3: {ip: 148.100.110.12}
130131

131132
- mininodes:
132133
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

@@ -127,6 +127,13 @@
127127
regexp: '^127\.0\.1\.1\s+\w.+$'
128128
line: '127.0.1.1 {{safe_hostname}}'
129129

130+
- name: run ccache installer
131+
when: os == "rhel72" and arch == "s390x" and not has_ccache.stat.exists
132+
include: ccache.yml
133+
static: false
134+
vars:
135+
- version: 3.3.3
136+
130137
- name: run ccache installer
131138
when: os in ccache_no_binpkg and not has_ccache.stat.exists
132139
include: ccache.yml

ansible/roles/gcc/tasks/main.yml

Lines changed: 292 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,292 @@
1+
---
2+
3+
#
4+
# installs gcc 4.9 @ /data/gcc-4.9 on rhel7.x
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 binutils 2.28.1
183+
get_url:
184+
url: https://ftp.gnu.org/gnu/binutils/binutils-2.28.1.tar.gz
185+
dest: /data/tmp/
186+
when: build_gcc_49.stat.exists == False
187+
tags: gcc49
188+
189+
- name: unarchive binutils 2.28.1
190+
unarchive:
191+
src: /data/tmp/binutils-2.28.1.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 binutils 2.28.1
206+
shell: /data/tmp/binutils-2.28.1/configure --with-mpfr=/data/gcc-4.9 --with-gmp=/data/gcc-4.9 --prefix=/data/gcc-4.9
207+
args:
208+
chdir: /data/tmp/build
209+
when: build_gcc_49.stat.exists == False
210+
tags: gcc49
211+
212+
- name: build binutils 2.28.1
213+
shell: make -j{{ ansible_processor_cores }}
214+
args:
215+
chdir: /data/tmp/build
216+
when: build_gcc_49.stat.exists == False
217+
tags: gcc49
218+
219+
- name: install binutils 2.28.1
220+
shell: make install
221+
args:
222+
chdir: /data/tmp/build
223+
when: build_gcc_49.stat.exists == False
224+
tags: gcc49
225+
226+
- name: Clean path
227+
file:
228+
state: absent
229+
path: /data/tmp/
230+
when: build_gcc_49.stat.exists == False
231+
tags: gcc49
232+
233+
- name: Create working directory
234+
file:
235+
path: /data/tmp
236+
state: directory
237+
mode: 0755
238+
when: build_gcc_49.stat.exists == False
239+
tags: gcc49
240+
241+
- name: download gcc 4.9.4
242+
get_url:
243+
url: http://ftp.gnu.org/gnu/gcc/gcc-4.9.4/gcc-4.9.4.tar.gz
244+
dest: /data/tmp/
245+
when: build_gcc_49.stat.exists == False
246+
tags: gcc49
247+
248+
- name: unarchive gcc 4.9.4
249+
unarchive:
250+
src: /data/tmp/gcc-4.9.4.tar.gz
251+
remote_src: yes
252+
dest: /data/tmp/
253+
when: build_gcc_49.stat.exists == False
254+
tags: gcc49
255+
256+
- name: Create build directory
257+
file:
258+
path: /data/tmp/build
259+
state: directory
260+
mode: 0755
261+
when: build_gcc_49.stat.exists == False
262+
tags: gcc49
263+
264+
- name: configure gcc4.9
265+
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
266+
args:
267+
chdir: /data/tmp/build
268+
when: build_gcc_49.stat.exists == False
269+
tags: gcc49
270+
271+
- name: build gcc49
272+
shell: make -j{{ ansible_processor_cores }}
273+
async: 3600
274+
poll: 10
275+
args:
276+
chdir: /data/tmp/build
277+
when: build_gcc_49.stat.exists == False
278+
tags: gcc49
279+
280+
- name: install gcc49
281+
shell: make install
282+
args:
283+
chdir: /data/tmp/build
284+
when: build_gcc_49.stat.exists == False
285+
tags: gcc49
286+
287+
- name: Clean path
288+
file:
289+
state: absent
290+
path: /data/tmp/
291+
when: build_gcc_49.stat.exists == False
292+
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|startswith("rhel7") }

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

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

4040
- name: create user
41-
when: not os|startswith("zos")
41+
when: not os|startswith("zos") and not "'rhel72-s390x' in inventory_hostname"
42+
user:
43+
name: "{{ server_user }}"
44+
group: "{{ server_user }}"
45+
shell: "{{ bash_path[os|stripversion]|default('/bin/bash') }}"
46+
47+
- name: create user for rhel72-s390x
4248
user:
4349
name: "{{ server_user }}"
4450
group: "{{ server_user }}"
51+
home: "/data/{{server_user }}"
4552
shell: "{{ bash_path[os|stripversion]|default('/bin/bash') }}"
53+
when: "'rhel72-s390x' in inventory_hostname"
54+
55+
- name: create symbolic link for home directory on rhel72-s390x
56+
file:
57+
src: "/data/{{ server_user }}"
58+
dest: "/home/{{ server_user }}"
59+
state: link
60+
when: "'rhel72-s390x' in inventory_hostname"
4661

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

0 commit comments

Comments
 (0)