- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am starting to use Cilk in my work. In this case I am trying to embed Cilk in some legacy C code. Here is the relevant code.
#ifdef __INTEL_COMPILER
CILK_C_REDUCER_OPADD(sum1, double, 0.0);
CILK_C_REGISTER_REDUCER(sum1);
cilk_for(L = L1; L <= L2; L++)
{
REDUCER_VIEW(sum1) += a
}
CILK_C_UNREGISTER_REDUCER(sum1);
#endif
I am using the __stdcall convention.
I am using Intel Parallel Studio 2013 with VS 2012. I am getting the following link errors:
1>test.obj : error LNK2019: unresolved external symbol __imp____cilkrts_hyperobject_noop_destroy@8 referenced in function _LU6LT@16
1>test.obj : error LNK2019: unresolved external symbol __imp__cilk_c_reducer_opadd_reduce_int@12 referenced in function _LU6LT@16
1>test.obj : error LNK2019: unresolved external symbol __imp__cilk_c_reducer_opadd_identity_int@8 referenced in function _LU6LT@16
1>test.obj : error LNK2019: unresolved external symbol __imp____cilkrts_hyperobject_alloc@8 referenced in function _LU6LT@16
1>test.obj : error LNK2019: unresolved external symbol __imp____cilkrts_hyperobject_dealloc@8 referenced in function _LU6LT@16
1>C:\Apps\test.dll : fatal error LNK1120: 5 unresolved externals
Any ideas on what could be causing this? Any help is greatly appreciated.
Regards
Chris
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The compiler should be automatically including a reference to the Cilk runtime when it recognizes the use of Cilk features. This might be a bug, or you might have told the linker to ignore default libraries.
Either way, you can add cilkrts.lib to your link command manually by specifying it as an additional dependency.
- Open the project's properites by right-clicking on the project and select Properties from the context menu
- Expand the list of Linker pages by clicking on the little plus next to "Linker" in the treelist on the left.
- Select the "Input" page
- Add "cilkrts.lib" to the list of "Additional Dependencies"
Be sure to do this for all of your configurations (Release, Debug) and platforms (Win32, x64).
- Barry
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Barry,
Thank you for your help.
Regards
Chris
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page