Can't compile CILK program with ICC in Intel Parallel XE studio

Can't compile CILK program with ICC in Intel Parallel XE studio

Yuan Tang's picture

Hi All,

I installed Intel Parallel XE studio in my Ubuntu 10.04
(64 bits) system. The installation itself is smooth except it first
reports some unknown OS error. But I can complete the installation by
skipping this message. I checked in my installation directory, it has
very weird organization:

yuantang@Octave:/opt/intel$ ls -l
total
32
drwxr-xr-x 2 root root 4096 2010-06-25 11:14 bin
lrwxrwxrwx 1
root root 16 2010-06-25 11:14 compilerpro -> compilerpro-12.0
drwxr-xr-x
3 root root 4096 2010-06-25 11:14 compilerpro-12.0
drwxr-xr-x 14
root root 4096 2010-06-25 11:14 compilerpro-12.0.0.025
lrwxrwxrwx 1
root root 19 2010-06-25 11:14 include -> compilerpro/include
drwxr-xr-x
13 root root 4096 2010-06-25 11:14 inspector_xe
-rw-r--r-- 1 root
root 5658 2010-06-25 11:14 intel_sdp_products.db
lrwxrwxrwx 1 root
root 15 2010-06-25 11:14 ipp -> compilerpro/ipp
lrwxrwxrwx 1
root root 15 2010-06-25 11:14 lib -> compilerpro/lib
drwxr-xr-x
2 root root 4096 2010-06-25 11:12 licenses
lrwxrwxrwx 1 root root
15 2010-06-25 11:14 man -> compilerpro/man
lrwxrwxrwx 1 root
root 15 2010-06-25 11:14 mkl -> compilerpro/mkl
drwxr-xr-x 4
root root 4096 2010-06-25 11:14 parallel_studio_xe_2011
lrwxrwxrwx 1
root root 15 2010-06-25 11:14 tbb -> compilerpro/tbb

while
the 'icc' under 'bin' directory is a symbolic link to the 'icc' under
the directory 'compilerpro'. However, there's no 'mcpcom' under
'compilerpro' which is itself a symbolic link to 'compilerpro-12.0'. But
there's a 'mcpcom' found under 'compilerpro-12.0.0.025'. So, I manually
use the binary executable under 'compilerpro-12.0.0.025' to compile my
cilk program as follows:

icc -o heat.64 -O3 -DNDEBUG
-I/opt/intel/compilerpro-12.0.0.025/compiler/include/cilk -Wall -Werror
-mkl -xSSE4.2 -m64 heat.cpp common.cpp heat_loops.cpp
heat_recursive.cpp heat_util.cpp heat_tests.cpp heat_meta.cpp -L
/opt/intel/compilerpro-12.0.0.025/compiler/lib/intel64 -L lib/x86_64
/usr/lib/gcc/x86_64-linux-gnu/4.4.3/../../../../lib64/crt1.o:
In function `_start':
(.text+0x20): undefined reference to `main'
make:
*** [heat.64] Error 1

Could anybody tell me what might be wrong
with that? and how to fix it?

Thanks !

Yuan

6 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.
mark-sabahi (Intel)'s picture

Yuan,

If you source iccvars.sh under the top level "bin" directory (e.g. source bin/iccvars.sh intel64) the compiler build environment will be set and you can simply invoke icc without explicit path names for icc or the libraries, etc. Please let us know if that works for you.

Thanks,
--mark

Yuan Tang's picture

Hi Mark,

Thank you so much for the help!

By "source /opt/intel/bin/iccvars.h", I can invoke icc, but if I compile it with CILK program, it reports:

icc -o heat.64 -O3 -DNDEBUG -Wall -Werror -mkl -xSSE4.2 -m64 heat.cpp common.cpp heat_loops.cpp
heat_recursive.cpp heat_util.cpp heat_tests.cpp heat_meta.cpp -L lib/x86_64
common.h(33): catastrophic error: cannot open source file "cilk.h"
#include

If I include the path to Intel CILK as follows, it will report:

icc -o heat.64 -O3 -DNDEBUG -Wall -Werror -mkl -xSSE4.2 -I/opt/intel/compilerpro-12.0.0.025/compiler/include/cilk -m64 heat.cpp common.cpp heat_loops.cpp heat_recursive.cpp heat_util.cpp heat_tests.cpp heat_meta.cpp -L lib/x86_64
/usr/lib/gcc/x86_64-linux-gnu/4.4.3/../../../../lib64/crt1.o: In function `_start':
(.text+0x20): undefined reference to `main'
make: *** [heat.64] Error 1

In the above 'make', "-I/opt/intel/compilerpro-12.0.0.025/compiler/include/cilk" is the location of Intel cilk header file.

Would you give me more advices?

Thanks!

Yuan

mark-sabahi (Intel)'s picture

Yuan,

Please try:

#include or

#include "cilk.h"

and let us know if that resolves the issue.

Thanks,
--mark

yosoqoo's picture

Hi, mark
I also have the problem that can't find the cilk.h when I make the cilk samples with the Intel Parallel XE studio.
Do you mean that "#include or #include "cilk.h" " in the cilk program?
The cilk samples have included these.

So, would you give us other advices?
Thanks.

Tina

Brandon Hewitt (Intel)'s picture

From linear_recurrence.cpp:

*snip*
#include
*snip*

Then if I compile:

[cilk_samples]$ icc -V -I. -c linear-recurrence.cpp
Intel C Compiler XE for applications running on Intel 64, Version 12.0.0 Beta Build 20100512
Copyright (C) 1985-2010 Intel Corporation. All rights reserved.

icc: NOTE: The Beta evaluation period for this product ends on 13-dec-2010 UTC.
Edison Design Group C/C++ Front End, version 4.1 (May 12 2010 20:29:19)
Copyright 1988-2009 Edison Design Group, Inc.

Works for me. Can you do a "which icc" and an "icc -V" and send me the output for those two commands?

Brandon Hewitt Technical Consulting Engineer Tools Knowledge Base: "http://software.intel.com/en-us/articles/tools" Software Product Support info: "http://www.intel.com/software/support"

Login to leave a comment.