summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Dragan <bulk88@hotmail.com>2013-11-19 16:25:51 -0500
committerTony Cook <tony@develop-help.com>2013-11-20 16:18:37 +1100
commita48cc4c4277ae7875bbf28793177c100f1d5784c (patch)
tree543a599b558ffd0b01c83101a702418329c66cf0
parent670de6d6a9c900cd23ea5f542b7d35bbd83f1084 (diff)
downloadperl-a48cc4c4277ae7875bbf28793177c100f1d5784c.tar.gz
add Intel C++ Compiler for Win32 support
-most fixes involve code detecting Perl on VC, and changing it to ICC is another kind of VC, but ICC's version isn't this "other kind of VC"'s version number, call the partner VC to find out the "VC version number" of ICC not yet done -no Intel C specific optimization flags -long doubles and C99 -ccversion behavior might not be ideal/rethink
-rw-r--r--README.win3213
-rw-r--r--ext/POSIX/t/posix.t9
-rw-r--r--pod/perldelta.pod4
-rw-r--r--win32/Makefile18
-rw-r--r--win32/config_sh.PL14
5 files changed, 53 insertions, 5 deletions
diff --git a/README.win32 b/README.win32
index d66ff740ab..4d91f133f8 100644
--- a/README.win32
+++ b/README.win32
@@ -40,6 +40,7 @@ system). Currently, this port is capable of using one of the
following compilers on the Intel x86 architecture:
Microsoft Visual C++ version 6.0 or later
+ Intel C++ Compiler (experimental, nmake only)
Gcc by mingw.org gcc version 3.2 or later
Gcc by mingw-w64.sf.net gcc version 4.4.3 or later
@@ -312,6 +313,18 @@ L<http://www.mingw.org/>
You also need dmake. See L</"Make"> above on how to get it.
+=item Intel C++ Compiler
+
+Experimental support for using Intel C++ Compiler has been added. You must use
+nmake, not dmake. Edit win32/Makefile and pick the correct CCTYPE for the
+Visual C that Intel C was installed into. Also uncomment __ICC to enable Intel
+C on Visual C support. To set up the build enviroment, from the Start Menu run
+IA-32 Visual Studio 20__ mode or Intel 64 Visual Studio 20__ mode as
+appropriate. Then run nmake as usually in that prompt box.
+
+Only Intel C++ Compiler v12.1 has been tested. Other versions probably will
+work.
+
=back
=head2 Building
diff --git a/ext/POSIX/t/posix.t b/ext/POSIX/t/posix.t
index 88fe2ca0d9..febf4d818d 100644
--- a/ext/POSIX/t/posix.t
+++ b/ext/POSIX/t/posix.t
@@ -210,9 +210,12 @@ $lc = &POSIX::setlocale(&POSIX::LC_TIME, 'C') if $Config{d_setlocale};
try_strftime("Wed Feb 28 00:00:00 1996 059", 0,0,0, 28,1,96);
SKIP: {
skip("VC++ 8 and Vista's CRTs regard 60 seconds as an invalid parameter", 1)
- if ($Is_W32 and (($Config{cc} eq 'cl' and
- $Config{ccversion} =~ /^(\d+)/ and $1 >= 14) or
- (Win32::GetOSVersion())[1] >= 6));
+ if ($Is_W32
+ and (($Config{cc} eq 'cl' and
+ $Config{ccversion} =~ /^(\d+)/ and $1 >= 14)
+ or ($Config{cc} eq 'icl' and
+ `cl --version 2>&1` =~ /^.*Version\s+([\d.]+)/ and $1 >= 14)
+ or (Win32::GetOSVersion())[1] >= 6));
try_strftime("Thu Feb 29 00:00:60 1996 060", 60,0,-24, 30,1,96);
}
diff --git a/pod/perldelta.pod b/pod/perldelta.pod
index 4e0fc3a2ed..7f9d3e216c 100644
--- a/pod/perldelta.pod
+++ b/pod/perldelta.pod
@@ -385,6 +385,10 @@ Support for building with Visual C++ 2013 has been added. There are currently
two possible test failures (see L<perlwin32/"Testing Perl on Windows">) which
will hopefully be resolved soon.
+Experimental support for building with Intel C++ Compiler has been added. Only
+the nmake makefile (win32/Makefile) can be used. A "nmake test" will not pass
+at this time due to "cpan/CGI/t/url.t".
+
=item WinCE
Perl can now be built in one shot with no user intervention on WinCE by running
diff --git a/win32/Makefile b/win32/Makefile
index c06b377206..bdefe90c83 100644
--- a/win32/Makefile
+++ b/win32/Makefile
@@ -132,6 +132,11 @@ CCTYPE = MSVC60
#CCTYPE = MSVC120FREE
#
+# If you are using Intel C++ Compiler uncomment this
+#
+#__ICC = define
+
+#
# uncomment next line if you want debug version of perl (big,slow)
# If not enabled, we automatically try to use maximum optimization
# with all compilers that are known to have a working optimizer.
@@ -417,8 +422,13 @@ INST_HTML = $(INST_TOP)$(INST_VER)\html
# Programs to compile, build .lib files and link
#
+!IF "$(__ICC)" != "define"
CC = cl
LINK32 = link
+!ELSE
+CC = icl
+LINK32 = xilink
+!ENDIF
LIB32 = $(LINK32) -lib
RSC = rc
@@ -488,6 +498,14 @@ LIBBASEFILES = \
netapi32.lib uuid.lib ws2_32.lib mpr.lib winmm.lib \
version.lib odbc32.lib odbccp32.lib comctl32.lib
+# Avoid __intel_new_proc_init link error for libircmt.
+# libmmd is /MD equivelent, other variants exist.
+# libmmd is Intel C's math addon funcs to MS CRT, contains long doubles, C99,
+# and optimized C89 funcs
+!IF "$(__ICC)" == "define"
+LIBBASEFILES = $(LIBBASEFILES) libircmt.lib libmmd.lib
+!ENDIF
+
# The 64 bit Windows Server 2003 SP1 SDK compilers link against MSVCRT.dll, which
# doesn't include the buffer overrun verification code used by the /GS switch.
# Since the code links against libraries that are compiled with /GS, this
diff --git a/win32/config_sh.PL b/win32/config_sh.PL
index d9bfd9922b..7553b59cac 100644
--- a/win32/config_sh.PL
+++ b/win32/config_sh.PL
@@ -93,7 +93,7 @@ else {
if (exists $opt{cc}) {
# cl version detection borrowed from Test::Smoke's configsmoke.pl
- if ($opt{cc} =~ /\bcl/) { #MSVC can come as clarm.exe
+ if ($opt{cc} =~ /\b(?:cl|icl)/) { #MSVC can come as clarm.exe, icl=Intel C
my $output = `$opt{cc} --version 2>&1`;
$opt{ccversion} = $output =~ /^.*Version\s+([\d.]+)/ ? $1 : '?';
}
@@ -115,7 +115,7 @@ $opt{libpth} = mungepath($opt{libpth}) if exists $opt{libpth};
$opt{incpath} = mungepath($opt{incpath}) if exists $opt{incpath};
my($int64, $int64f);
-if ($opt{cc} =~ /\bcl/) {
+if ($opt{cc} =~ /\b(?:cl|icl)/) {
$int64 = '__int64';
$int64f = 'I64';
}
@@ -205,6 +205,16 @@ if ($opt{cc} =~ /\bcl/ and $opt{ccversion} =~ /^(\d+)/) {
$opt{ar} ='lib';
}
}
+#find out which MSVC this ICC is using
+elsif ($opt{cc} =~ /\bicl/) {
+ my $output = `cl --version 2>&1`;
+ my $num_ver = $output =~ /^.*Version\s+([\d.]+)/ ? $1 : '?';
+ if($num_ver =~ /^(\d+)/ && $1 >= 14) {
+ $opt{sGMTIME_max} = 32535291599;
+ $opt{sLOCALTIME_max} = 32535244799;
+ }
+ $opt{ar} ='xilib';
+}
if ($opt{useithreads} eq 'define' && $opt{ccflags} =~ /-DPERL_IMPLICIT_SYS\b/) {
$opt{d_pseudofork} = 'define';