@@ -33,6 +33,7 @@ do_compare="yes"
33
33
do_rt=" yes"
34
34
do_libs=" yes"
35
35
do_test_suite=" yes"
36
+ do_openmp=" no"
36
37
BuildDir=" ` pwd` "
37
38
use_autoconf=" no"
38
39
ExtraConfigureFlags=" "
@@ -59,6 +60,7 @@ function usage() {
59
60
echo " -no-rt Disable check-out & build Compiler-RT"
60
61
echo " -no-libs Disable check-out & build libcxx/libcxxabi/libunwind"
61
62
echo " -no-test-suite Disable check-out & build test-suite"
63
+ echo " -openmp Check out and build the OpenMP run-time (experimental)"
62
64
}
63
65
64
66
if [ ` uname -s` = " Darwin" ]; then
@@ -136,6 +138,9 @@ while [ $# -gt 0 ]; do
136
138
-no-test-suite )
137
139
do_test_suite=" no"
138
140
;;
141
+ -openmp )
142
+ do_openmp=" yes"
143
+ ;;
139
144
-help | --help | -h | --h | -\? )
140
145
usage
141
146
exit 0
191
196
if [ $do_test_suite = " yes" ]; then
192
197
projects=" $projects test-suite"
193
198
fi
199
+ if [ $do_openmp = " yes" ]; then
200
+ projects=" $projects openmp"
201
+ fi
194
202
195
203
# Go to the build directory (may be different from CWD)
196
204
BuildDir=$BuildDir /$RC
@@ -427,6 +435,41 @@ function package_release() {
427
435
cd $cwd
428
436
}
429
437
438
+ # Build and package the OpenMP run-time. This is still experimental and not
439
+ # meant for official testing in the release, but as a way for providing
440
+ # binaries as a convenience to those who want to try it out.
441
+ function build_OpenMP() {
442
+ cwd=` pwd`
443
+
444
+ rm -rf $BuildDir /Phase3/openmp
445
+ rm -rf $BuildDir /Phase3/openmp.install
446
+ mkdir -p $BuildDir /Phase3/openmp
447
+ cd $BuildDir /Phase3/openmp
448
+ clang=$BuildDir /Phase3/Release/llvmCore-$Release -$RC .install/usr/local/bin/clang
449
+
450
+ echo " #" cmake -DCMAKE_C_COMPILER=${clang} -DCMAKE_CXX_COMPILER=${clang} ++ \
451
+ -DCMAKE_BUILD_TYPE=Release -DLIBOMP_MICRO_TESTS=on \
452
+ $BuildDir /openmp.src/runtime
453
+ cmake -DCMAKE_C_COMPILER=${clang} -DCMAKE_CXX_COMPILER=${clang} ++ \
454
+ -DCMAKE_BUILD_TYPE=Release -DLIBOMP_MICRO_TESTS=on \
455
+ $BuildDir /openmp.src/runtime
456
+
457
+ echo " # Building OpenMP run-time"
458
+ echo " # ${MAKE} -j $NumJobs VERBOSE=1"
459
+ ${MAKE} -j $NumJobs VERBOSE=1
460
+ echo " # ${MAKE} libomp-micro-tests VERBOSE=1"
461
+ ${MAKE} libomp-micro-tests VERBOSE=1
462
+ echo " # ${MAKE} install DESTDIR=$BuildDir /Phase3/openmp.install"
463
+ ${MAKE} install DESTDIR=$BuildDir /Phase3/openmp.install
464
+
465
+ OpenMPPackage=OpenMP-$Triple
466
+ mv $BuildDir /Phase3/openmp.install/usr/local $BuildDir /$OpenMPPackage
467
+ cd $BuildDir
468
+ tar cvfJ $BuildDir /$OpenMPPackage .tar.xz $OpenMPPackage
469
+ mv $OpenMPPackage $BuildDir /Phase3/openmp.install/usr/local
470
+ cd $cwd
471
+ }
472
+
430
473
# Exit if any command fails
431
474
# Note: pipefail is necessary for running build commands through
432
475
# a pipe (i.e. it changes the output of ``false | tee /dev/null ; echo $?``)
@@ -459,7 +502,6 @@ for Flavor in $Flavors ; do
459
502
460
503
c_compiler=" $CC "
461
504
cxx_compiler=" $CXX "
462
-
463
505
llvmCore_phase1_objdir=$BuildDir /Phase1/$Flavor /llvmCore-$Release -$RC .obj
464
506
llvmCore_phase1_destdir=$BuildDir /Phase1/$Flavor /llvmCore-$Release -$RC .install
465
507
@@ -538,6 +580,11 @@ for Flavor in $Flavors ; do
538
580
done
539
581
fi
540
582
done
583
+
584
+ if [ $do_openmp = " yes" ]; then
585
+ build_OpenMP
586
+ fi
587
+
541
588
) 2>&1 | tee $LogDir /testing.$Release -$RC .log
542
589
543
590
package_release
0 commit comments