Software Archive
Read-only legacy content
Announcements
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.
17060 Discussions

catastrophic error: *MIC* cannot open source file "gsl/gsl_rng.h"

rasoolpour__babak
2,069 Views

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

0 Kudos
6 Replies
Frances_R_Intel
Employee
2,069 Views

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.

0 Kudos
rasoolpour__babak
2,069 Views

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

0 Kudos
Frances_R_Intel
Employee
2,069 Views

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.

0 Kudos
Ravi_N_Intel
Employee
2,069 Views

Regarding the include file gsl/gsl_rng.h  add the location of gsl to MIC_LD_LIBRARAY_PATH also.

0 Kudos
JJK
New Contributor III
2,069 Views

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:

  1.   matrix/minmax_source.c
  2.   vector/minmax_source.c

but a simple "#pragma novector"  solved the problem in those files.

 

0 Kudos
rasoolpour__babak
2,069 Views

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

0 Kudos
Reply