llvm.org GIT mirror llvm / 5ebd7ba
[OPENMP] Make -fopenmp to turn on OpenMP support by default. Patch turns on OpenMP support in clang by default after fixing OpenMP buildbots. Differential Revision: http://reviews.llvm.org/D13802 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@255222 91177308-0d34-0410-b5e6-96231b3b80d8 Alexey Bataev 3 years ago
5 changed file(s) with 25 addition(s) and 53 deletion(s). Raw diff Collapse all Expand all
13421342 AC_ARG_WITH(clang-default-openmp-runtime,
13431343 AS_HELP_STRING([--with-clang-default-openmp-runtime],
13441344 [The default OpenMP runtime for Clang.]),,
1345 withval="libgomp")
1345 withval="libomp")
13461346 AC_DEFINE_UNQUOTED(CLANG_DEFAULT_OPENMP_RUNTIME,"$withval",
13471347 [Default OpenMP runtime used by -fopenmp.])
13481348
59535953 if test "${with_clang_default_openmp_runtime+set}" = set; then
59545954 withval=$with_clang_default_openmp_runtime;
59555955 else
5956 withval="libgomp"
5956 withval="libomp"
59575957 fi
59585958
59595959
5353 * ``cd where-you-want-llvm-to-live``
5454 * ``cd llvm/projects``
5555 * ``svn co http://llvm.org/svn/llvm-project/compiler-rt/trunk compiler-rt``
56
57 #. Checkout Libomp (required for OpenMP support):
58
59 * ``cd where-you-want-llvm-to-live``
60 * ``cd llvm/projects``
61 * ``svn co http://llvm.org/svn/llvm-project/openmp/trunk openmp``
5662
5763 #. Checkout libcxx and libcxxabi **[Optional]**:
5864
534540 % cd llvm/projects
535541 % git clone http://llvm.org/git/compiler-rt.git
536542
543 If you want to check out libomp (required for OpenMP support), run:
544
545 .. code-block:: console
546
547 % cd llvm/projects
548 % git clone http://llvm.org/git/openmp.git
549
537550 If you want to check out libcxx and libcxxabi (optional), run:
538551
539552 .. code-block:: console
633646 % git config svn-remote.svn.fetch :refs/remotes/origin/master
634647 % git svn rebase -l
635648
636 Likewise for compiler-rt and test-suite.
649 Likewise for compiler-rt, libomp and test-suite.
637650
638651 To update this clone without generating git-svn tags that conflict with the
639652 upstream Git repo, run:
647660 git checkout master &&
648661 git svn rebase -l)
649662
650 Likewise for compiler-rt and test-suite.
663 Likewise for compiler-rt, libomp and test-suite.
651664
652665 This leaves your working directories on their master branches, so you'll need to
653666 ``checkout`` each working branch individually and ``rebase`` it on top of its
5252 ---------------
5353
5454 This script will check-out, configure and compile LLVM+Clang (+ most add-ons, like ``compiler-rt``,
55 ``libcxx`` and ``clang-extra-tools``) in three stages, and will test the final stage.
55 ``libcxx``, ``libomp`` and ``clang-extra-tools``) in three stages, and will test the final stage.
5656 It'll have installed the final binaries on the Phase3/Releasei(+Asserts) directory, and
5757 that's the one you should use for the test-suite and other external tests.
5858
3333 do_libs="yes"
3434 do_libunwind="yes"
3535 do_test_suite="yes"
36 do_openmp="no"
36 do_openmp="yes"
3737 BuildDir="`pwd`"
3838 use_autoconf="no"
3939 ExtraConfigureFlags=""
6161 echo " -no-libs Disable check-out & build libcxx/libcxxabi/libunwind"
6262 echo " -no-libunwind Disable check-out & build libunwind"
6363 echo " -no-test-suite Disable check-out & build test-suite"
64 echo " -openmp Check out and build the OpenMP run-time (experimental)"
64 echo " -no-openmp Disable check-out & build libomp"
6565 }
6666
6767 if [ `uname -s` = "Darwin" ]; then
142142 -no-test-suite )
143143 do_test_suite="no"
144144 ;;
145 -openmp )
146 do_openmp="yes"
145 -no-openmp )
146 do_openmp="no"
147147 ;;
148148 -help | --help | -h | --h | -\? )
149149 usage
291291 fi
292292 if [ -d $BuildDir/compiler-rt.src ] && [ ! -h compiler-rt ]; then
293293 ln -s ../../compiler-rt.src compiler-rt
294 fi
295 if [ -d $BuildDir/openmp.src ] && [ ! -h openmp ]; then
296 ln -s ../../openmp.src openmp
294297 fi
295298 if [ -d $BuildDir/libcxx.src ] && [ ! -h libcxx ]; then
296299 ln -s ../../libcxx.src libcxx
442445 cd $cwd
443446 }
444447
445 # Build and package the OpenMP run-time. This is still experimental and not
446 # meant for official testing in the release, but as a way for providing
447 # binaries as a convenience to those who want to try it out.
448 function build_OpenMP() {
449 cwd=`pwd`
450
451 rm -rf $BuildDir/Phase3/openmp
452 rm -rf $BuildDir/Phase3/openmp.install
453 mkdir -p $BuildDir/Phase3/openmp
454 cd $BuildDir/Phase3/openmp
455 clang=$BuildDir/Phase3/Release/llvmCore-$Release-$RC.install/usr/local/bin/clang
456
457 echo "#" cmake -DCMAKE_C_COMPILER=${clang} -DCMAKE_CXX_COMPILER=${clang}++ \
458 -DCMAKE_BUILD_TYPE=Release -DLIBOMP_MICRO_TESTS=on \
459 $BuildDir/openmp.src/runtime
460 cmake -DCMAKE_C_COMPILER=${clang} -DCMAKE_CXX_COMPILER=${clang}++ \
461 -DCMAKE_BUILD_TYPE=Release -DLIBOMP_MICRO_TESTS=on \
462 $BuildDir/openmp.src/runtime
463
464 echo "# Building OpenMP run-time"
465 echo "# ${MAKE} -j $NumJobs VERBOSE=1"
466 ${MAKE} -j $NumJobs VERBOSE=1
467 echo "# ${MAKE} libomp-micro-tests VERBOSE=1"
468 ${MAKE} libomp-micro-tests VERBOSE=1
469 echo "# ${MAKE} install DESTDIR=$BuildDir/Phase3/openmp.install"
470 ${MAKE} install DESTDIR=$BuildDir/Phase3/openmp.install
471
472 OpenMPPackage=OpenMP-$Release
473 if [ $RC != "final" ]; then
474 OpenMPPackage=$OpenMPPackage-$RC
475 fi
476 OpenMPPackage=$OpenMPPackage-$Triple
477
478 mv $BuildDir/Phase3/openmp.install/usr/local $BuildDir/$OpenMPPackage
479 cd $BuildDir
480 tar cvfJ $BuildDir/$OpenMPPackage.tar.xz $OpenMPPackage
481 mv $OpenMPPackage $BuildDir/Phase3/openmp.install/usr/local
482 cd $cwd
483 }
484
485448 # Exit if any command fails
486449 # Note: pipefail is necessary for running build commands through
487450 # a pipe (i.e. it changes the output of ``false | tee /dev/null ; echo $?``)
593556 fi
594557 done
595558
596 if [ $do_openmp = "yes" ]; then
597 build_OpenMP
598 fi
599
600559 ) 2>&1 | tee $LogDir/testing.$Release-$RC.log
601560
602561 package_release