Intel® C++ Compiler
Community support and assistance for creating C++ code that runs on platforms based on Intel® processors.

Bug Report: icc 18

Nicholas_K_1
Beginner
655 Views

I recently tried compiling R 3.4.0 from source using the icc 18 (18.0.0.061) and found that the resulting program is broken.  This is the script I use to configure and install R:

 

#!/bin/bash

_mkllibpath=${MKLROOT}/lib/intel64

#MKL=" -L${_mkllibpath} -lmkl_rt -lpthread -lm"
MKL="-L${MKLROOT}/lib/intel64 -lmkl_intel_lp64 -lmkl_tbb_thread -lmkl_core -ltbb -lstdc++ -lpthread -lm -ldl"
fast="-g -qopt-report=5 -qopt-report-annotate=html -qopt-report-phase=all -fp-model precise -O3 -xHost -I${MKLROOT}/include"
export CC="icc"
export CFLAGS="$fast"
export CXX="icpc"
export CXXFLAGS="$fast"
export AR="xiar"
export LD="xild"
export F77="ifort"
export FFLAGS="$fast"

export FC="ifort"
export FCFLAGS="$fast"


export CXX14="icpc"
export CXX14STD="-std=c++14"

 

./configure --with-blas="${MKL}" --enable-R-shlib --enable-BLAS-shlib --with-lapack 

make -j 10

Running "make check" fails.  I've further narrowed down the problem to be somewhere in  radixsort.c .  For reference, here's the link to the file in question https://fossies.org/dox/R-3.4.0/radixsort_8c.html.   I'm also attaching the optimization report for icc 17 (which works) and icc 18 (which does not)

 

thanks so much!

Nick

 

0 Kudos
4 Replies
Viet_H_Intel
Moderator
655 Views

Hi Nick,

When you said "the resulting program is broken", you meant you hit a compile time error or a run-time error?

If it's a compile time error, then can you create a reprocess file and submit it to http://supporttickets.intel.com 

Best regards,

Viet Hoang

 

0 Kudos
Devorah_H_Intel
Moderator
655 Views

Helllo Nicholas,

Please refer to this article for building R using Intel compilers:

https://software.intel.com/en-us/articles/build-r-301-with-intel-c-compiler-and-intel-mkl-on-linux

I was able to build R with no problem using the latest 18.0 compiler.

0 Kudos
Nicholas_K_1
Beginner
655 Views

Hi Devorah,

Does `make check` pass when you build R using the linked instructions? (I don't think it will)  Also I think there are some typos in the article (e.g -O3m should be -O3, and '--with-blas=-lmkl' should be '--with-blas=$MKL'.  As I said in my original post, I believe the problem stems from icc 2018 incorrectly compiling the radixsort.c source file, which is the basis of the default implementation of R's sort function.  The following R snippet succinctly summarizes the issue:

#First create a vector of unsorted integers
x <- sample(1:1000)


#method="radix" is the default
x_radix <- sort(x,method="radix")
#method="shell" implements shell sort
x_shell <- sort(x,method="shell")
#This should be true if all the values of x are unique, but doesn't work for icc 2018
all.equal(x_radix,x_shell)

#This should obviously be true, but isn't for icc 2018
!is.unsorted(x_radix)

 

0 Kudos
Zand__Matt
Beginner
655 Views

I am just running into the same issue. I wonder if you have got any solution for this.

 

Thanks,

 

Matt

https://coding-bootcamps.com/

https://myhsts.org/

https://dcwebmakers.com/

0 Kudos
Reply