Data.table: Error with Oracle compiler (likely Solaris only)

Created on 14 Jan 2019  路  6Comments  路  Source: Rdatatable/data.table

Email received from Prof Ripley :


As you will see from the CRAN results page, this newly fails to install
with the Oracle compiler. It does install with gcc but many of the
packages depending on segfault in their checks, in function gforce.

(This seems not to be showing currently: the nub is

/home/ripley/developerstudio12.6/bin/cc -xc99 
-I"/home/ripley/R/cc/include" -DNDEBUG   -I/usr/local/include  -xopenmp 
-KPIC  -O -xlibmieee -xlibmil -xtarget=native -xcache=generic -nofstore 
-c froll.c -o froll.o
"froll.c", line 114: left operand must be modifiable lvalue: op "="
"froll.c", line 149: left operand must be modifiable lvalue: op "="

which are inside OpenMP sections. Using a parallel install shows similar
issues in frollR, frolladaptive at least.)

platform-specific

Most helpful comment

Reply from Prof Ripley :


The problem is the 'const' in

  const int threads = MIN(getDTthreads(), nx);
  #pragma omp parallel num_threads(threads) shared(truehasna)

If you remove it and similar instances elsewhere, the package compiles and passes its checks. See the attached patch.

patch.txt

All 6 comments

I didn't even know Oracle had a compiler let alone that CRAN uses it.

It might be Solaris. The flavors spec shows Oracle compiler just for Solaris.
https://cran.r-project.org/web/checks/check_flavors.html#r-patched-solaris-x86

Is this compiler freely available for project like our? Do we have access to it somewhere? What version of that compiler is in use for that CRAN check? It seems there was one false positive like that in the past: https://community.oracle.com/thread/2492099
Lines reported in error for froll.c looks pretty OK.
Also this very much related: https://blogs.oracle.com/d/the-pains-of-preprocessing
Mybe this compiler doesn't like we declare const thread number in own line.

Yes free: https://en.wikipedia.org/wiki/Oracle_Developer_Studio
Yes: https://www.oracle.com/technetwork/server-storage/developerstudio/downloads/index-jsp-141149.html
CRAN uses Oracle Developer Studio 12.6. See https://cran.r-project.org/web/checks/check_flavors.html, and https://www.stats.ox.ac.uk/pub/bdr/Rconfig/r-patched-solaris-x86 for settings.
Those compiler bug reports indeed seem related. Might also be use of volatile. Might be ans->ans[i]= (the same 'ans' symbol repeated)? The fact every other compiler (windows / gcc / clang) are ok kind of suggests a compiler glitch.

On Ubuntu 18.04 (bionic)
I downloaded OracleDeveloperStudio12.6-linux-x86-rpm.tar.bz2
$ tar xvjf OracleDeveloperStudio12.6-linux-x86-rpm.tar.bz2
$ cd OracleDeveloperStudio12.6-linux-x86-rpm
$ ls -lrth
total 457M
-r--r--r-- 1 mdowle mdowle 3.8K Aug 16 2017 README.txt
-rwxr-xr-x 1 mdowle mdowle 457M Aug 16 2017 developerstudio.sh
drwxr-xr-x 2 mdowle mdowle 4.0K Aug 18 2017 LEGAL
$ sudo ./developerstudio.sh
Configuring the installer...
Searching for JVM on the system...
This machine has an open source distribution of java (OpenJDK) installed. OpenJDK is not supported. Please install Oracle JDK to proceed.
To download Java installation bundle (JDK or JRE), visit http://www.oracle.com/technetwork/java/javase/downloads/index.html
$
Going to that site presents me with. I've no idea about these license restrictions and what's changed. It's just way too much work given we don't know anyone who uses Solaris. I'll ask CRAN if we are able to opt out of Solaris.
image

Reply from Prof Ripley :


The problem is the 'const' in

  const int threads = MIN(getDTthreads(), nx);
  #pragma omp parallel num_threads(threads) shared(truehasna)

If you remove it and similar instances elsewhere, the package compiles and passes its checks. See the attached patch.

patch.txt

Was this page helpful?
0 / 5 - 0 ratings

Related issues

andschar picture andschar  路  3Comments

st-pasha picture st-pasha  路  3Comments

sengoku93 picture sengoku93  路  3Comments

jangorecki picture jangorecki  路  3Comments

mattdowle picture mattdowle  路  3Comments