forked from simon-r/intel-parallel-studio-xe
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPKGBUILD
399 lines (314 loc) · 13.4 KB
/
PKGBUILD
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
# Maintainer: J. Derek Tucker: derek at tetonedge net
# Contributor: simone riva: siomone.rva -a- gmail com
# Intel Parallel Studio XE 2016 for Linux - ( Intel compiler icc suite )
##########################################################################
# intel-compiler: Intel C/C++ compiler and base libs
###########################################################################
# Parallel Studio XE
# Copyright (C) 2015 J. Derek Tucker
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
pkgbase="intel-parallel-studio-xe"
pkgname=('intel-compiler')
PKGEXT='.pkg.tar.gz'
########################################
#OPTIONS begin
# set to true if you want to remove documentations and examples form the packages.
_remove_docs=false
# set to true if you want to remove the static objects from the libs.
_remove_static_objects_mkl=false
_remove_static_objects_ipp=false
########################################
_year='2016'
_v_a='1'
_v_b='150'
_update='update1'
pkgrel=1
_sp=''
_studio_ver='16.0.1'
pkgver=${_year}.${_studio_ver}.${_v_a}.${_v_b}
_dir_nr='8369'
options=(strip libtool staticlibs)
url="http://software.intel.com/en-us/articles/non-commercial-software-download/"
arch=('i686' 'x86_64')
license=('custom')
makedepends=('libarchive' 'sed' 'gzip')
_parallel_studio_xe_dir="parallel_studio_xe${_year:+_${_year}}${_sp:+_${_sp}}_composer_edition${_update:+_${_update}}"
source=(
"http://registrationcenter-download.intel.com/akdlm/irc_nas/${_dir_nr}/${_parallel_studio_xe_dir}.tgz"
'intel_compilers.sh'
'intel-composer.install'
'intel-compiler-base.conf'
'intel-fortran.conf'
'intel-openmp.conf'
'intel-mkl.conf'
'intel-ipp.conf'
'intel-tbb.conf'
'intel-mkl.sh'
'intel-mkl-th.conf'
'EULA.txt'
)
sha256sums=(
'bd7e56b257a1f3047c1b94b83900b0a218ec886f103bbbb1741d8416c091fb73' # parallel_studio_xe_2016_composer_edition_update1.tgz
'ab087b1d4e0ccb45ea695cd61a7e8b2817e4d579053c3bfd78658625d65f8ed3' # intel_compilers.sh
'51f9d94d66aab79129fc51794e32cd5e2abdfd85cd87e70b7a102d746b850257' # intel-composer.install
'31ac4d0f30a93fe6393f48cb13761d7d1ce9719708c76a377193d96416bed884' # intel-compiler-base.conf
'c165386ba33b25453d4f5486b7fefcdba7d31e156ad280cbdfa13ed924b01bef' # intel-fortran.conf
'99cc9683cc75934cc21bb5a09f6ad83365ee48712719bfd914de9444695eed13' # intel-openmp.conf
'a856326362e9b80c19dc237cbf66bf3d96a69bd7ad1baff99ec9849f8208348c' # intel-mkl.conf
'da6f41c2e002c9a793c75a18c8d1c85ef7ef5bf83a7a0a158ff144481491aac8' # intel-ipp.conf
'aee2ae7f87f12f4af38d52423b40d547fd5bbe77e18694b9847e9f2a96d33c6e' # intel-tbb.conf
'5e68c529c65cac54218026c869e54b2ddb268179725fc1e6b56d920470dad999' # intel-mkl.sh
'e515cb28bf40cdb0db818db6a2688a0028575153a1b9d5acfb0bc5f13fe45722' # intel-mkl-th.conf
'228ac25e147adb9b872e1a562e522d2fd48809ccae89b765112009896a6d55a5' # EULA.txt
)
if [ "$CARCH" = "i686" ]; then
_i_arch='ia32'
_i_arch2='i486'
_not_arch='intel64'
_not_arch2='x86_64'
else
_i_arch='intel64'
_i_arch2='x86_64'
_not_arch='ia32'
_not_arch2='i486'
fi
extract_rpms() {
cd $2
for rpm_file in ${rpm_dir}/$1 ; do
echo -e " Extracting: ${rpm_file}"
bsdtar -xf ${rpm_file}
done
}
set_build_vars() {
_pkg_ver=${_year}.${_studio_ver}.${_v_a}.${_v_b}
_composer_xe_dir="compilers_and_libraries_${_year}.${_v_a}.${_v_b}"
rpm_dir=${srcdir}/${_parallel_studio_xe_dir}/rpm
xe_build_dir=${srcdir}/cxe_build
base_dir=${srcdir}/..
_man_dir=${xe_build_dir}/usr/share/man/man1
}
build() {
set_build_vars
echo ${xe_build_dir}
# clean the builds dirs
if [ -d ${srcdir}/opt ] ; then
rm -rf ${srcdir}/opt
fi
if [ -d ${srcdir}/etc ] ; then
rm -rf ${srcdir}/etc
fi
if [ -d ${srcdir}/usr ] ; then
rm -rf ${srcdir}/usr
fi
if [ -d ${xe_build_dir} ] ; then
rm -rf ${xe_build_dir}
fi
echo ${srcdir}
mkdir -p ${xe_build_dir}
# START !
cd ${xe_build_dir}
mkdir -p ${xe_build_dir}/etc/profile.d
if [ "$CARCH" = "i686" ]; then
sed 's/<arch>/ia32/' < ${srcdir}/intel_compilers.sh > ${xe_build_dir}/etc/profile.d/intel_compilers.sh
else
sed 's/<arch>/intel64/' < ${srcdir}/intel_compilers.sh > ${xe_build_dir}/etc/profile.d/intel_compilers.sh
fi
chmod a+x ${xe_build_dir}/etc/profile.d/intel_compilers.sh
mkdir -p ${xe_build_dir}/etc/ld.so.conf.d
_cnt=0
for files in ${base_dir}/*.lic ; do
_lic_file[_cnt]=${files}
_cnt=$(($_cnt+1))
done
echo -e ""
echo -e "-----------------------------------------------------------------------------------"
mkdir -p ${xe_build_dir}/opt/intel/licenses
if [ -f "${_lic_file[0]}" ]; then
cp ${base_dir}/*.lic ${xe_build_dir}/opt/intel/licenses
echo -e "\e[1mFound license files in ${base_dir}."
echo -e "These will be installed into /opt/intel/licenses ...\e[0m"
else
echo -e "\e[1mNo license files found in ${base_dir}."
echo -e "Remember to place license files in one of these locations:"
echo -e " /opt/intel/licenses"
echo -e " ~/intel/licenses"
echo -e "Or the compiler will not work!\e[0m"
fi
echo -e "-----------------------------------------------------------------------------------"
echo -e ""
cp ${srcdir}/${_parallel_studio_xe_dir}/license.txt ${xe_build_dir}/opt/intel/license.txt
echo -e ""
echo -e "-----------------------------------------------------------------------------------"
echo -e "\e[1mIMPORTANT - READ BEFORE COPYING, INSTALLING, OR USING.\e[0m"
echo -e ""
echo -e "Do not copy, install, or use the \"Materials\" provided under this license agreement (\"Agreement\"), until you"
echo -e "have carefully read the following terms and conditions."
echo -e ""
echo -e "By copying, installing, or otherwise using the Materials, you agree to be bound by the terms of this"
echo -e "Agreement. If you do not agree to the terms of this Agreement, do not copy, install, or use the Materials."
echo -e " - A copy of the EULA has been copied in the PKGBUILD directory; plase read carefully the terms and "
echo -e " - conditions of the Intel license before installing the packages. "
echo -e "-----------------------------------------------------------------------------------"
echo -e ""
echo -e "-----------------------------------------------------------------------------------"
echo -e " ATTENTION: This PKGBUILD may need up to 20 minutes if you use XZ as a compressor!"
echo -e " - The build of the packages: intel-mkl and intel-ipp is particularly slow - "
echo -e "-----------------------------------------------------------------------------------"
echo -e ""
echo -e ""
echo -e "-----------------------------------------------------------------------------------"
echo -e " \e[1m\e[5mATTENTION: \e[0m \e[1m\e[31mThis PKGBUILD works with yaourt, "
echo -e "but consumes a lot of RAM! \e[0m "
echo -e " Using the makepkg command for building this package is recommended."
echo -e "-----------------------------------------------------------------------------------"
echo -e ""
echo -e ""
echo -e "-----------------------------------------------------------------------------------"
echo -e "\e[1m #################### \e[0m"
echo -e "\e[1m ##### Options: ##### \e[0m"
if ${_remove_docs} ; then
echo -e " Remove Documentation: YES "
else
echo -e " Remove Documentation: NO "
fi
if ${_remove_static_objects_mkl} ; then
echo -e ""
echo -e "\e[1m Remove Static Objects from MKL: YES \e[0m \e[1m\e[5m\e[31m ATTENTION !!!! \e[0m "
echo -e "\e[1m If your software is based on the static objects edit the option at the line 50 of this PKGBUILD \e[0m "
else
echo -e " Remove Static Objects: NO "
fi
echo -e "-----------------------------------------------------------------------------------"
echo -e ""
if ${_remove_static_objects_ipp} ; then
echo -e ""
echo -e "\e[1m Remove Static Objects from IPP: YES \e[0m \e[1m\e[5m\e[31m ATTENTION !!!! \e[0m "
echo -e "\e[1m If your software is based on the static objects edit the option at the line 50 of this PKGBUILD \e[0m "
else
echo -e " Remove Static Objects: NO "
fi
echo -e "-----------------------------------------------------------------------------------"
echo -e ""
echo -e ""
cd ${xe_build_dir}/opt/intel
ln -s ./${_composer_xe_dir} composerxe-${_year}
ln -s ./composerxe-${_year} composerxe
ln -s ./composerxe/linux/bin/${_i_arch} bin
ln -s ./composerxe/linux/pkg_bin pkg_bin
ln -s ./composerxe/linux/ipp/ ipp
ln -s ./composerxe/linux/compiler/lib/${_i_arch} lib
ln -s ./composerxe/linux/mkl/ mkl
ln -s ./composerxe/linux/tbb/ tbb
_current_dir=`pwd`
if [ -d ${pkgdir}/opt ] ; then
cd ${pkgdir}
rm -rf opt
cd $_current_dir
fi ;
cd ${srcdir}/${_parallel_studio_xe_dir}/rpm
rm -v -f *.${_not_arch2}.rpm
cd $_current_dir
}
package_intel-compiler() {
set_build_vars
pkgdesc="Intel C/C++ compiler"
pkgver=${_pkg_ver}
provides=("intel-tbb" "intel-mkl")
install=intel-composer.install
echo -e " # Start Building"
mkdir -p ${xe_build_dir}/opt
mkdir -p ${xe_build_dir}/etc/profile.d
mkdir -p ${_man_dir}
cp ${srcdir}/intel-compiler-base.conf ${xe_build_dir}/etc/ld.so.conf.d
cd ${xe_build_dir}
echo -e " # Extracting RPMS"
extract_rpms 'intel-*.rpm' $xe_build_dir
echo -e " # Editing variables"
cd ${xe_build_dir}/opt/intel/${_composer_xe_dir}/linux/bin
rm *.csh
for f in *.sh ; do
sed -i 's/<PRODDIR>/\/opt\/intel/g' $f
sed -i 's/<INSTALLDIR>/\/opt\/intel\/composerxe\/linux/g' $f
done
cd $_i_arch
sed -i 's/<INSTALLDIR>/\/opt\/intel\/composerxe\/linux/g' loopprofileviewer.sh
chmod a+x loopprofileviewer.sh
rm loopprofileviewer.csh
cd ${xe_build_dir}/opt/intel/${_composer_xe_dir}/linux/ipp/bin
rm ippvars.csh
sed -i 's/<INSTALLDIR>/\/opt\/intel\/composerxe\/linux/g' ippvars.sh
cd ${xe_build_dir}/opt/intel/${_composer_xe_dir}/linux/mkl/bin
rm mklvars.csh
sed -i 's/<INSTALLDIR>/\/opt\/intel\/composerxe\/linux/g' mklvars.sh
rm -rf ./${_not_arch}
#cd $_i_arch
#rm mklvars_${_i_arch}.csh
#sed -i 's/<INSTALLDIR>/\/opt\/intel\/composerxe\/linux/g' mklvars_${_i_arch}.sh
echo -e " # Coping man pages"
mv ${xe_build_dir}/opt/intel/documentation_${_year}/en/man/common/man1/*.1 ${_man_dir}
cd ${_man_dir}
for f in *.1 ; do
gzip $f
done
cd ${xe_build_dir}
cp ${srcdir}/intel-compiler-base.conf ${xe_build_dir}/etc/ld.so.conf.d
if [ "$CARCH" = "i686" ]; then
sed 's/<arch>/ia32/' < ${srcdir}/intel-fortran.conf > ${xe_build_dir}/etc/ld.so.conf.d/intel-fortran.conf
else
sed 's/<arch>/intel64/' < ${srcdir}/intel-fortran.conf > ${xe_build_dir}/etc/ld.so.conf.d/intel-fortran.conf
fi
cp ${srcdir}/intel-openmp.conf ${xe_build_dir}/etc/ld.so.conf.d
if [ "$CARCH" = "i686" ]; then
sed 's/<arch>/ia32/' < ${srcdir}/intel-ipp.conf > ${xe_build_dir}/etc/ld.so.conf.d/intel-ipp.conf
else
sed 's/<arch>/intel64/' < ${srcdir}/intel-ipp.conf > ${xe_build_dir}/etc/ld.so.conf.d/intel-ipp.conf
fi
if [ "$CARCH" = "i686" ]; then
sed 's/<arch>/ia32/' < ${srcdir}/intel-tbb.conf > ${xe_build_dir}/etc/ld.so.conf.d/intel-tbb.conf
sed -i 's/<INSTALLDIR>/\/opt\/intel\/composerxe\/linux/g' ${xe_build_dir}/etc/ld.so.conf.d/intel-tbb.conf
else
sed 's/<arch>/intel64/' < ${srcdir}/intel-tbb.conf > ${xe_build_dir}/etc/ld.so.conf.d/intel-tbb.conf
sed -i 's/<INSTALLDIR>/\/opt\/intel\/composerxe\/linux/g' ${xe_build_dir}/etc/ld.so.conf.d/intel-tbb.conf
fi
cp ${srcdir}/intel-mkl.sh ${xe_build_dir}/etc/profile.d
chmod a+x ${xe_build_dir}/etc/profile.d/intel-mkl.sh
cp ${srcdir}/intel-mkl-th.conf ${xe_build_dir}/etc/
if [ "$CARCH" = "i686" ]; then
sed 's/<arch>/ia32/' < ${srcdir}/intel-mkl.conf > ${xe_build_dir}/etc/ld.so.conf.d/intel-mkl.conf
else
sed 's/<arch>/intel64/' < ${srcdir}/intel-mkl.conf > ${xe_build_dir}/etc/ld.so.conf.d/intel-mkl.conf
fi
if $_remove_docs ; then
echo -e " # Remove docs"
rm -rf ${xe_build_dir}/opt/intel/documentation_${_year}
rm -rf ${xe_build_dir}/opt/intel/samples_${_year}
fi
if ${_remove_static_objects_ipp} ; then
echo -e " # intel-ipp: Remove static objects"
rm -f ${xe_build_dir}/opt/intel/${_composer_xe_dir}/linux/ipp/lib/${_i_arch}/libipp*.a
rm -f ${xe_build_dir}/opt/intel/${_composer_xe_dir}/linux/ipp/lib/mic/libipp*.a
fi
if ${_remove_static_objects_mkl} ; then
echo -e " # intel-mkl: remove static objects"
rm -f ${xe_build_dir}/opt/intel/${_composer_xe_dir}/linux/mkl/lib/${_i_arch}/libmkl_*.a
rm -f ${xe_build_dir}/opt/intel/${_composer_xe_dir}/linux/mkl/lib/mic/libmkl_*.a
fi
echo -e " # Move package"
mv ${xe_build_dir}/opt ${pkgdir}
mv ${xe_build_dir}/etc ${pkgdir}
mv ${xe_build_dir}/usr ${pkgdir}
}
pkgdesc="Intel C++ C and fortran compiler - Intel Parallel Studio XE - intel compiler - icc icpc ifort ipp mkl "
depends=('bash' 'gcc')