1

I'm trying to compile a kernel for emulation with aoc in the Intel FPGA SDK, I have set all environment variables as possible even using the init_opencl.bat included in the SDK. I'm running the following line using the visual studio 2017 developers command prompt in order to use visual studio linker:

aoc -march=emulator -v -board=a10gx my_kernel.cl -o my_kernel.aocx

but it always throws a linker error (the errors are in Spanish, sorry about that).

Creando biblioteca libkernel.lib y objeto libkernel.exp

libkernel.obj : error LNK2019: símbolo externo __imp___translate_sampler_initializer sin resolver al que se hace referencia en la función my_kernel

libkernel.obj : error LNK2019: símbolo externo floorf sin resolver al que se hace referencia en la función __acl__copysignf

libkernel.obj : error LNK2019: símbolo externo ceilf sin resolver al que se hace referencia en la función __acl__copysignf

libkernel.obj : error LNK2019: símbolo externo log2 sin resolver al que se hace referencia en la función __acl__sppow_approx

libkernel.obj : error LNK2019: símbolo externo exp2 sin resolver al que se hace referencia en la función __acl__sppow_approx

LINK : error LNK2001: símbolo externo _DllMainCRTStartup sin resolver

C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\lib\x86\msvcrt.lib : warning LNK4272: el tipo de máquina de biblioteca 'x86' está en conflicto con el tipo de máquina de destino 'x64'

C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\lib\x86\legacy_stdio_definitions.lib : warning LNK4272: el tipo de máquina de biblioteca 'x86' está en conflicto con el tipo de máquina de destino 'x64'

libkernel.dll : fatal error LNK1120: 6 externos sin resolver

I have no idea what else to do.

Note: The kernel uses image2d objects which I'm not entirely sure are compatible with FPGAs. Actually that's another question.

1
  • Update: By running the command using the X64 Visual Studio Developers Command Promt it manages to resolve most of the external symbols, but there's still one wich is not resolved __imp___translate_sampler_initializer. Is this symbol tied to the image sampler in the kernel??? Can i use images2d_t with FPGAs???? Commented May 11, 2019 at 18:43

3 Answers 3

0

Quite likely the problem is that they (Altera, now Intel) still require on Windows to use MSVC 2010 to successfully link their libraries with the host project.

That is at least the case for fft-2d where is such a requirement.

So you probably have 2 choices:

  1. Install MSVC 2010

  2. Figure out how to successfully link with their libraries being built using MSVC 2010


Update

I checked my notes. To be able to successfully link with Altera libraries using VS 2015 I was additionally linking with legacy_stdio_definitions.lib. That should go into AdditionalDependencies in the linker section. Can't assure this will help your case too but it's worth a try.

Sign up to request clarification or add additional context in comments.

Comments

0

First of all thanks doqtor for your answer...in the end I was finnaly able to compile without having to change much....actually if you run the aoc offline compiler from the Visual Studio Developers Command Prompt x64 most of the problems are solved.

I decided to cleanly reinstall the entire Intel FPGA SDK and this time set up correctly every environment variable...and everything worked perfectly...I was able to compile and execute the SDK examples.

But one problem could not be solved....my kernel uses image2d_t objects and of course sampler_t....turns out according to the Intel SDK Programming Guide...the SDK does not support images and samplers while working with OpenCL 1.0.

The weird thing is that the FPGA Emulator platform does support it so i was able to compile using the emulator....although this wont solve much for me.....I have decided to change my kernel and find an alternative to image and samplers.

Thanks

Comments

0

Answering your questions:

  1. FPGA emulator is not supporting x86 platform, just x86_64 (but I see you are already resolved this I guess).
  2. About images. The SDK isn't supporting image type indeed, but it doesn't mean that aoc will fail during compilation. You will fail later when you try to run your application.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.