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

Compiling qhull

Fabio_G_
Beginner
681 Views

Dear all,

I'm trying to compiler qhull http://www.qhull.org/. I edited the makefile

by specifying CC = icc and CXX = icpc, I've thought it was enough.

However the compilation fails. There are an additional options for CC/CXX

CC_OPTS1  = -O2 -fPIC -ansi -Isrc/libqhull $(CC_WARNINGS)
CXX_OPTS1 = -O2 -Dqh_QHpointer -Isrc/ -Isrc/libqhullcpp -Isrc/libqhull $(CXX_WARNINGS)

the warning switches are

CC_WARNINGS  = -Wall -Wcast-qual -Wextra -Wwrite-strings -Wshadow
CXX_WARNINGS = -Wall -Wcast-qual -Wextra -Wwrite-strings -Wno-sign-conversion -Wshadow -Wconversion

The (main) error occurs at line (106) of qhull-2012.1/src/libqhull/qhull_a.h, i.e. at

#if defined(__INTEL_COMPILER) && !defined(QHULL_OS_WIN)
template <typename T>
inline void qhullUnused(T &x) { (void)x; }
#  define QHULL_UNUSED(x) qhullUnused(x);
#else
#  define QHULL_UNUSED(x) (void)x;
#endif

I cannot figure what is the solution. Can anyone help me?

Thank you, very much.

Fabio

0 Kudos
6 Replies
Judith_W_Intel
Employee
681 Views

 

Can you please tell us what error you are seeing and attach the preprocessed source so we can see what the macro is being expanded to?

thanks,

Judy

0 Kudos
Fabio_G_
Beginner
681 Views

Well, launching icc -EP qhull_a.h it gives a long output and the macro expand as

template <typename T>
inline void qhullUnused(T &x) { (void)x; }

It is a template function and nothing seems to be missing.

The output of full compilation is quite short

mkdir -p bin lib
icc -c -O2 -fPIC -ansi -Isrc/libqhull -Wall -Wcast-qual -Wextra -Wwrite-strings -Wshadow -o src/rbox/rbox.o src/rbox/rbox.c
icc -c -O2 -fPIC -ansi -Isrc/libqhull -Wall -Wcast-qual -Wextra -Wwrite-strings -Wshadow -o src/libqhullstatic/global.o src/libqhull/global.c
src/libqhull/qhull_a.h(106): warning #77: this declaration has no storage class or type specifier
  template <typename T>
  ^

src/libqhull/qhull_a.h(106): error: expected a ";"
  template <typename T>
           ^

src/libqhull/qhull_a.h(115): warning #12: parsing restarts here after previous syntax error
  void    qh_qhull(void);
                        ^

compilation aborted for src/libqhull/global.c (code 2)
make: *** [src/libqhullstatic/global.o] Errore 2

Thanks!

However, I am looking for a ND Delaunay triangulator, do someone know kinda-of working with ICC??

0 Kudos
Judith_W_Intel
Employee
681 Views

 

It looks like you are compiling a C++ file with icc not icpc.

Judy

0 Kudos
Judith_W_Intel
Employee
681 Views

 

Either that or there's a bug in the header file that causes it to only work for C++ (since templates are a C++ only feature).

 

0 Kudos
Fabio_G_
Beginner
681 Views

@Judith: Thanks, it could be. I'll try to force C++ compilation on whole code.

Does someone know a working C routine for n-dimensional Delaunay triangulation?

 

0 Kudos
bernaske
New Contributor I
679 Views

Hi

i have download qhull and compiled with Parallel Studio XE 2013 ( Compiler Version 14.0.2 )

no problems.

1) cmake CMakeLists.txt

2) build with

make CC=icpc CXX=icc

no problems , correct compile, build all,

testqset works normal, q_test works normal

i use as environment:

Linux openSUSE 13.2 Milestone 0 64 Bit (x86_64) Kernel 3.14.0-5, KDE 4.13, XServer 11.0 NVIDIA Driver 334.21

icc (ICC) 14.0.2 20140120
Copyright (C) 1985-2014 Intel Corporation.  All rights reserved.

icpc (ICC) 14.0.2 20140120
Copyright (C) 1985-2014 Intel Corporation.  All rights reserved.

 

 

 

 

 

 

0 Kudos
Reply