- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello everyone,
I'm trying to offload the openmp parts of a code to be offloaded on Phi. I added
#pragma offload target (mic)
just before
#pragma omp parallel
and had to add
__attribute__((target(mic)))
to a function to prevent the error
function has not been declared with compatible "target" attribute
However now I get
catastrophic error: *MIC* cannot open source file "gsl/gsl_rng.h"
#include <gsl/gsl_rng.h>
Can anyone help me with this please?
Cheers,
Babak
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You don't say which function you added the target(mic) attribute to and you don't say how you built your gsl library. I suspect the answer is in there. You will need a copy of the gsl library built for the coprocessor and the gsl include files will need to be where the compiler can find them when compiling your offloaded code. Perhaps if you could provide a simplified test case illustrating the problem, it would be helpful.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Frances,
Thank you for responding. The function that generates this error at compile time calls several other functions that are all written for a homogeneous system (they are shared between parallel and serial parts). Because of this, I changed my strategy to just run the whole thing natively. Is premade gsl library available or I should build it myself?
Cheers,
Babak
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Sorry, I don't know of a prebuilt gsl library. However, there are a number of people who have built it. After you source the environment script for the Intel compilers, you should be able to configure the make for gsl as:
./configure --host=x86_64-unknown-linux-gnu CC=icc CXX=icpc CFLAGS="-mmic"
and be able to build it.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Regarding the include file gsl/gsl_rng.h add the location of gsl to MIC_LD_LIBRARAY_PATH also.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
FWIW: About 1 year ago I built gsl 1.16 for the Xeon Phi. There are two files that did not pass the test suit:
- matrix/minmax_source.c
- vector/minmax_source.c
but a simple "#pragma novector" solved the problem in those files.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you JJK!
I managed to compile gsl using Intel's composerxe. The trick is to link mic's library to the gsl make file.
Cheers,
Babak

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