- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Istarted to cilkify my program with an error serial program. I took the line that said
int main()
and changed it to
int cilk_main()
I also aded the include file
cilk.h this way
include
Iadded the line at the bottom of my include file list for the main function. I am not sure why I must precede it by
cilk/
,but I did.
I then got the error
ld: /usr/lib/debug/usr/lib/i386-linux-gnu/crtl1.o(.debug_info): relocation 0 has invalid symbol index 12
several more lines similar
/usr/lib/i386-linux-gnu/gcc/i686-linux-gnu/4.5.2/../../crtl.o: In function " _start':
(.text+ox18): undefined reference to "main"
I did not change any file extensions from *.c to *.cilk.I am usng icc and it compiles all files with a c extension fine.
The compiler seems to believe that i do not have a main function. I changed theint main() to int cilk_main().
When I compiled I got the output that I listed above. What did I do wrong? I did everything that it said to do on the Cilk++ Programmers Guide.
Thanks in advance.
Newport_j
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
In this case, I would just recommend renaming cilk_main back to main and see if that works.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Since, I posted my question, I thought about the problem. At first, I named int main() to int cilk_main, but I did not change the file extension from *.c to *.cilk. This the icc compiler is treating this as straight c code, and does not undertstand cilk_main(). Hence, it claims that I do not have a main function. Maybe I should give the file that contains a main function, the file extension *.cilk.
I did not understand your first sentence in your reply. I have switched exclusivley to Intel Cilk Plus. Thus the changes thta I madeare outlined on page 14 of the Programmer's Guide.
I will try your recommendation. But please elaborate on the first sentence in your reply. I have removed all previous versions of cilk from my hardrive.
If I change cilk_main() back to main(), then how will icc know my code is cilk? I assume that I still must have #include
I am using the icc command to compile my c source code.
Newport_j
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Yes, I see your point. I was using the wrong manual for Intel's Cilk compiler. Sorry, I have talken the Cilk Arts documents out of my notebook.
You are correct in what you say. I have made modifications to avoid this in the future(see above).
Newport_j
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The Intel Cilk Plus Tools User's Guide is only shipped as an HTML document, cilktools.html, so it doesn't have page numbers. However, I did find one stray reference to cilk_main. I've removed it and it will be fixed the next time we update the tools.
The Intel Cilk Plus documentation is available at http://software.intel.com/sites/products/documentation/hpc/composerxe/en-us/2011Update/cpp/lin/index.htm#cref_cls/common/cilk_bk_using_cilk.htm If it contains any references to cilk_main, they're also an error. Please point me at the topic and I'll have it fixed.
If you look inside the version of cilk.h shipped with the Intel compiler, you'll see that there's very little there. Basically only macros to make using the Cilk keywords easier.
The icc compiler recognizes the use of the cilk_spawn keyword and marks your function as a "spawning function". That means that it will allocate a __cilkrts_stack_frame in the function and do the appropriate things to initialize it in the function prologue and tear it down in the function epilogue.
- Barry

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page