Community
cancel
Showing results for 
Search instead for 
Did you mean: 
psing51
Beginner
138 Views

Error compililing qhull library with icc & icpc

I am trying to compile octave with intel compilers.I am facing trouble building downloaded qhull-2012.1-src.tgz dependency for octave.
now while trying to compile the qhull package (with cmake)
cmake .. -DCMAKE_CXX_COMPILER=icpc -DCMAKE_CC_COMPILER=icc
i get following error:
 

In file included from /usr/include/limits.h:125,
                 from /home/puneet/OCTAVE/qhull-2012.1/src/libqhull/qhull_a.h:42,
                 from /home/puneet/OCTAVE/qhull-2012.1/src/libqhull/global.c:19:
/opt/intel/include/limits.h:36:54: error: missing binary operator before token "("
/home/puneet/OCTAVE/qhull-2012.1/src/libqhull/global.c: In function ‘qh_clear_outputflags’:
/home/puneet/OCTAVE/qhull-2012.1/src/libqhull/global.c:182: error: ‘DBL_MAX’ undeclared (first use in this function)
/home/puneet/OCTAVE/qhull-2012.1/src/libqhull/global.c:182: error: (Each undeclared identifier is reported only once
/home/puneet/OCTAVE/qhull-2012.1/src/libqhull/global.c:182: error: for each function it appears in.)
/home/puneet/OCTAVE/qhull-2012.1/src/libqhull/global.c: In function ‘qh_initflags’:
/home/puneet/OCTAVE/qhull-2012.1/src/libqhull/global.c:1411: error: ‘DBL_MAX’ undeclared (first use in this function)
/home/puneet/OCTAVE/qhull-2012.1/src/libqhull/global.c: In function ‘qh_initqhull_buffers’:
/home/puneet/OCTAVE/qhull-2012.1/src/libqhull/global.c:1443: error: ‘DBL_MAX’ undeclared (first use in this function)
/home/puneet/OCTAVE/qhull-2012.1/src/libqhull/global.c: In function ‘qh_initqhull_globals’:
/home/puneet/OCTAVE/qhull-2012.1/src/libqhull/global.c:1495: error: ‘DBL_MAX’ undeclared (first use in this function)
/home/puneet/OCTAVE/qhull-2012.1/src/libqhull/global.c:1523: error: ‘DBL_EPSILON’ undeclared (first use in this function)
/home/puneet/OCTAVE/qhull-2012.1/src/libqhull/global.c: In function ‘qh_initqhull_outputflags’:
/home/puneet/OCTAVE/qhull-2012.1/src/libqhull/global.c:1714: error: ‘DBL_MAX’ undeclared (first use in this function)
/home/puneet/OCTAVE/qhull-2012.1/src/libqhull/global.c: In function ‘qh_initqhull_start2’:
/home/puneet/OCTAVE/qhull-2012.1/src/libqhull/global.c:1858: error: ‘DBL_MAX’ undeclared (first use in this function)
/home/puneet/OCTAVE/qhull-2012.1/src/libqhull/global.c:1869: error: ‘DBL_MIN’ undeclared (first use in this function)
/home/puneet/OCTAVE/qhull-2012.1/src/libqhull/global.c: In function ‘qh_initthresholds’:
/home/puneet/OCTAVE/qhull-2012.1/src/libqhull/global.c:2002: error: ‘DBL_MAX’ undeclared (first use in this function)
make[2]: *** [CMakeFiles/libqhull.dir/src/libqhull/global.c.o] Error 1
make[1]: *** [CMakeFiles/libqhull.dir/all] Error 2
make: *** [all] Error 2

But , the package builds suceeds once i unexport intel compiler paths, from my environment;

version=5.0.1.035
source /opt/intel/mkl/bin/mklvars.sh intel64
source /opt/intel/bin/compilervars.sh intel64
source /opt/intel/impi/$version/intel64/bin/mpivars.sh intel64

Where am i going wrong? Any help/hint will be very useful,
Eagerly awaiting your reply,

Regards,
Puneet Singh

0 Kudos
8 Replies
TimP
Black Belt
138 Views

Did you examine the suspect limits.h for possible corruption or problem with processing of defines?

I suppose, on your platform installation, the linux supplied <limits.h> may be OK, at least for this application.

The subsequent errors appear to be symptoms of missing a required #include <float.h>

Judith_W_Intel
Employee
138 Views

 

There is no "missing binary operator" diagnostic in the Intel compiler. This is a diagnostic from gcc.

So you must be compiling with a version of gcc older than 5.0 and they do not have support the __has_include_next directive which is used in our limits.h header.

Judy

Kittur_G_Intel
Employee
138 Views

That's correct Judy, I realized that as well.  Presently, the latest version of ICC 15.0 update 2 that's out officially supports GCC versions through 4.9 only.

_Kittur

Kittur_G_Intel
Employee
138 Views

Hi,
Please let me know if that's the case, thanks.
_Kittur

Judith_W_Intel
Employee
138 Views

 

While it is true that the current version of ICC only supports 4.9 that's not the problem here. The problem is that you can't compile an Intel supplied header file with gcc. I think the customer needs to set something differently to compile the library with icpc (i.e. -DCMAKE_CC_COMPILER=icc is not enough or is not working as expected).

TimP
Black Belt
138 Views

More exactly, it may mean that gcc or g++ aren't able to pre-process the icc/icpc include files.  If you keep a log of your build, you should be able to see which tool is pre-processing.  If your cmakefile chooses the pre-processor, you may have an inconsistent choice.

Kittur_G_Intel
Employee
138 Views

That's a good point Judy/Tim, makes sense.

_Kittur

Kittur_G_Intel
Employee
138 Views

Hi Puneet,
Is this still an issue? Or does the previous communication(s) help? Thanks

_Kittur