Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 266514a

Browse files
committed
Issue #25827: Merge with 3.5
2 parents 060ed71 + 5af8564 commit 266514a

6 files changed

Lines changed: 196 additions & 0 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
*.gc??
1515
*.profclang?
1616
*.profraw
17+
*.dyn
1718
.gdb_history
1819
Doc/build/
1920
Doc/venv/

.hgignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ libpython*.so*
5353
*.gc??
5454
*.profclang?
5555
*.profraw
56+
*.dyn
5657
Lib/distutils/command/*.pdb
5758
Lib/lib2to3/*.pickle
5859
Lib/test/data/*

Makefile.pre.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1593,6 +1593,7 @@ clean: pycremoval
15931593
profile-removal:
15941594
find . -name '*.gc??' -exec rm -f {} ';'
15951595
find . -name '*.profclang?' -exec rm -f {} ';'
1596+
find . -name '*.dyn' -exec rm -f {} ';'
15961597
rm -f $(COVERAGE_INFO)
15971598
rm -rf $(COVERAGE_REPORT)
15981599

Misc/NEWS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -509,6 +509,9 @@ Tests
509509
Build
510510
-----
511511

512+
- Issue #25827: Add support for building with ICC to ``configure``, including
513+
a new ``--with-icc`` flag.
514+
512515
- Issue #25696: Fix installation of Python on UNIX with make -j9.
513516

514517
- Issue #24986: It is now possible to build Python on Windows without errors

configure

Lines changed: 151 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -801,6 +801,7 @@ with_universal_archs
801801
with_framework_name
802802
enable_framework
803803
with_gcc
804+
with_icc
804805
with_cxx_main
805806
with_suffix
806807
enable_shared
@@ -1480,6 +1481,7 @@ Optional Packages:
14801481
specify an alternate name of the framework built
14811482
with --enable-framework
14821483
--without-gcc never use gcc
1484+
--with-icc build with icc
14831485
--with-cxx-main=<compiler>
14841486
compile main() and link python executable with C++
14851487
compiler
@@ -3549,6 +3551,29 @@ fi
35493551
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $without_gcc" >&5
35503552
$as_echo "$without_gcc" >&6; }
35513553

3554+
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for --with-icc" >&5
3555+
$as_echo_n "checking for --with-icc... " >&6; }
3556+
3557+
# Check whether --with-icc was given.
3558+
if test "${with_icc+set}" = set; then :
3559+
withval=$with_icc;
3560+
case $withval in
3561+
no) CC=${CC:-cc}
3562+
with_icc=no;;
3563+
yes) CC=icc
3564+
CXX=icpc
3565+
with_icc=yes;;
3566+
*) CC=$withval
3567+
with_icc=$withval;;
3568+
esac
3569+
else
3570+
3571+
with_icc=no
3572+
fi
3573+
3574+
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_icc" >&5
3575+
$as_echo "$with_icc" >&6; }
3576+
35523577
# If the user switches compilers, we can't believe the cache
35533578
if test ! -z "$ac_cv_prog_CC" -a ! -z "$CC" -a "$CC" != "$ac_cv_prog_CC"
35543579
then
@@ -4934,6 +4959,104 @@ yes:)
49344959
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
49354960
$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
49364961
ac_tool_warned=yes ;;
4962+
esac
4963+
CXX=$ac_pt_CXX
4964+
fi
4965+
else
4966+
CXX="$ac_cv_path_CXX"
4967+
fi
4968+
;;
4969+
icc|*/icc) if test -n "$ac_tool_prefix"; then
4970+
# Extract the first word of "${ac_tool_prefix}icpc", so it can be a program name with args.
4971+
set dummy ${ac_tool_prefix}icpc; ac_word=$2
4972+
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
4973+
$as_echo_n "checking for $ac_word... " >&6; }
4974+
if ${ac_cv_path_CXX+:} false; then :
4975+
$as_echo_n "(cached) " >&6
4976+
else
4977+
case $CXX in
4978+
[\\/]* | ?:[\\/]*)
4979+
ac_cv_path_CXX="$CXX" # Let the user override the test with a path.
4980+
;;
4981+
*)
4982+
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
4983+
for as_dir in notfound
4984+
do
4985+
IFS=$as_save_IFS
4986+
test -z "$as_dir" && as_dir=.
4987+
for ac_exec_ext in '' $ac_executable_extensions; do
4988+
if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
4989+
ac_cv_path_CXX="$as_dir/$ac_word$ac_exec_ext"
4990+
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
4991+
break 2
4992+
fi
4993+
done
4994+
done
4995+
IFS=$as_save_IFS
4996+
4997+
;;
4998+
esac
4999+
fi
5000+
CXX=$ac_cv_path_CXX
5001+
if test -n "$CXX"; then
5002+
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5
5003+
$as_echo "$CXX" >&6; }
5004+
else
5005+
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
5006+
$as_echo "no" >&6; }
5007+
fi
5008+
5009+
5010+
fi
5011+
if test -z "$ac_cv_path_CXX"; then
5012+
ac_pt_CXX=$CXX
5013+
# Extract the first word of "icpc", so it can be a program name with args.
5014+
set dummy icpc; ac_word=$2
5015+
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
5016+
$as_echo_n "checking for $ac_word... " >&6; }
5017+
if ${ac_cv_path_ac_pt_CXX+:} false; then :
5018+
$as_echo_n "(cached) " >&6
5019+
else
5020+
case $ac_pt_CXX in
5021+
[\\/]* | ?:[\\/]*)
5022+
ac_cv_path_ac_pt_CXX="$ac_pt_CXX" # Let the user override the test with a path.
5023+
;;
5024+
*)
5025+
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
5026+
for as_dir in notfound
5027+
do
5028+
IFS=$as_save_IFS
5029+
test -z "$as_dir" && as_dir=.
5030+
for ac_exec_ext in '' $ac_executable_extensions; do
5031+
if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
5032+
ac_cv_path_ac_pt_CXX="$as_dir/$ac_word$ac_exec_ext"
5033+
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
5034+
break 2
5035+
fi
5036+
done
5037+
done
5038+
IFS=$as_save_IFS
5039+
5040+
;;
5041+
esac
5042+
fi
5043+
ac_pt_CXX=$ac_cv_path_ac_pt_CXX
5044+
if test -n "$ac_pt_CXX"; then
5045+
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_CXX" >&5
5046+
$as_echo "$ac_pt_CXX" >&6; }
5047+
else
5048+
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
5049+
$as_echo "no" >&6; }
5050+
fi
5051+
5052+
if test "x$ac_pt_CXX" = x; then
5053+
CXX="icpc"
5054+
else
5055+
case $cross_compiling:$ac_tool_warned in
5056+
yes:)
5057+
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
5058+
$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
5059+
ac_tool_warned=yes ;;
49375060
esac
49385061
CXX=$ac_pt_CXX
49395062
fi
@@ -6438,6 +6561,12 @@ fi
64386561

64396562

64406563
# Enable PGO flags.
6564+
6565+
6566+
6567+
6568+
6569+
64416570
# Extract the first word of "llvm-profdata", so it can be a program name with args.
64426571
set dummy llvm-profdata; ac_word=$2
64436572
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
@@ -6509,6 +6638,12 @@ case $CC in
65096638
;;
65106639
esac
65116640
;;
6641+
*icc*)
6642+
PGO_PROF_GEN_FLAG="-prof-gen"
6643+
PGO_PROF_USE_FLAG="-prof-use"
6644+
LLVM_PROF_MERGER="true"
6645+
LLVM_PROF_FILE=""
6646+
;;
65126647
esac
65136648

65146649
# XXX Shouldn't the code above that fiddles with BASECFLAGS and OPT be
@@ -6655,6 +6790,13 @@ $as_echo "$ac_cv_no_strict_aliasing" >&6; }
66556790
BASECFLAGS="$BASECFLAGS -fno-strict-aliasing"
66566791
fi
66576792

6793+
# ICC doesn't recognize the option, but only emits a warning
6794+
## XXX does it emit an unused result warning and can it be disabled?
6795+
case "$CC" in
6796+
*icc*)
6797+
ac_cv_disable_unused_result_warning=no
6798+
;;
6799+
*)
66586800
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can turn off $CC unused result warning" >&5
66596801
$as_echo_n "checking if we can turn off $CC unused result warning... " >&6; }
66606802
ac_save_cc="$CC"
@@ -6692,6 +6834,8 @@ fi
66926834
CC="$ac_save_cc"
66936835
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_disable_unused_result_warning" >&5
66946836
$as_echo "$ac_cv_disable_unused_result_warning" >&6; }
6837+
;;
6838+
esac
66956839

66966840
if test $ac_cv_disable_unused_result_warning = yes
66976841
then
@@ -6981,6 +7125,13 @@ $as_echo "$MACOSX_DEPLOYMENT_TARGET" >&6; }
69817125
;;
69827126
esac
69837127

7128+
# ICC needs -fp-model strict or floats behave badly
7129+
case "$CC" in
7130+
*icc*)
7131+
CFLAGS_NODIST="$CFLAGS_NODIST -fp-model strict"
7132+
;;
7133+
esac
7134+
69847135
if test "$Py_DEBUG" = 'true'; then
69857136
:
69867137
else

configure.ac

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -593,6 +593,22 @@ AC_ARG_WITH(gcc,
593593
esac])
594594
AC_MSG_RESULT($without_gcc)
595595

596+
AC_MSG_CHECKING(for --with-icc)
597+
AC_ARG_WITH(icc,
598+
AS_HELP_STRING([--with-icc], [build with icc]),
599+
[
600+
case $withval in
601+
no) CC=${CC:-cc}
602+
with_icc=no;;
603+
yes) CC=icc
604+
CXX=icpc
605+
with_icc=yes;;
606+
*) CC=$withval
607+
with_icc=$withval;;
608+
esac], [
609+
with_icc=no])
610+
AC_MSG_RESULT($with_icc)
611+
596612
# If the user switches compilers, we can't believe the cache
597613
if test ! -z "$ac_cv_prog_CC" -a ! -z "$CC" -a "$CC" != "$ac_cv_prog_CC"
598614
then
@@ -699,6 +715,7 @@ then
699715
gcc) AC_PATH_TOOL(CXX, [g++], [g++], [notfound]) ;;
700716
cc) AC_PATH_TOOL(CXX, [c++], [c++], [notfound]) ;;
701717
clang|*/clang) AC_PATH_TOOL(CXX, [clang++], [clang++], [notfound]) ;;
718+
icc|*/icc) AC_PATH_TOOL(CXX, [icpc], [icpc], [notfound]) ;;
702719
esac
703720
if test "$CXX" = "notfound"
704721
then
@@ -1259,6 +1276,12 @@ case $CC in
12591276
;;
12601277
esac
12611278
;;
1279+
*icc*)
1280+
PGO_PROF_GEN_FLAG="-prof-gen"
1281+
PGO_PROF_USE_FLAG="-prof-use"
1282+
LLVM_PROF_MERGER="true"
1283+
LLVM_PROF_FILE=""
1284+
;;
12621285
esac
12631286

12641287
# XXX Shouldn't the code above that fiddles with BASECFLAGS and OPT be
@@ -1370,6 +1393,13 @@ yes)
13701393
BASECFLAGS="$BASECFLAGS -fno-strict-aliasing"
13711394
fi
13721395

1396+
# ICC doesn't recognize the option, but only emits a warning
1397+
## XXX does it emit an unused result warning and can it be disabled?
1398+
case "$CC" in
1399+
*icc*)
1400+
ac_cv_disable_unused_result_warning=no
1401+
;;
1402+
*)
13731403
AC_MSG_CHECKING(if we can turn off $CC unused result warning)
13741404
ac_save_cc="$CC"
13751405
CC="$CC -Wunused-result -Werror"
@@ -1386,6 +1416,8 @@ yes)
13861416
CFLAGS="$save_CFLAGS"
13871417
CC="$ac_save_cc"
13881418
AC_MSG_RESULT($ac_cv_disable_unused_result_warning)
1419+
;;
1420+
esac
13891421

13901422
if test $ac_cv_disable_unused_result_warning = yes
13911423
then
@@ -1608,6 +1640,13 @@ yes)
16081640
;;
16091641
esac
16101642

1643+
# ICC needs -fp-model strict or floats behave badly
1644+
case "$CC" in
1645+
*icc*)
1646+
CFLAGS_NODIST="$CFLAGS_NODIST -fp-model strict"
1647+
;;
1648+
esac
1649+
16111650
if test "$Py_DEBUG" = 'true'; then
16121651
:
16131652
else

0 commit comments

Comments
 (0)