Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
11 years ago

Emulator Issue

Just want to start by saying I am fairly new to OpenCL.

I am currently trying to use the aoc emulator to emulate to OpenCL kernel on my windows machine (simply so that I can test future kernels before deploying them to the FPGA).

When I run the following command:

--- Quote Start ---

aoc -v -march=emulator device/hello_world.cl

--- Quote End ---

I get:

--- Quote Start ---

aoc: Environment checks are completed successfully.

You are now compiling the full flow!!

aoc: Selected target board de1soc_sharedonly

aoc: Running OpenCL parser....

aoc: OpenCL parser completed successfully.

aoc: Compiling for Emulation ....

Error: Optimizer FAILED.

Refer hello_world/hello_world.log for

--- Quote End ---

I checked the log file and this is all it says:

--- Quote Start ---

Microsoft (R) Incremental Linker Version 12.00.21005.1

Copyright (C) Microsoft Corporation. All rights reserved.

LINK : fatal error LNK1181: cannot open input file 'msvcrt.lib'

--- Quote End ---

I doubled checked my windows LIB variable it is pointed to the directory that contains that library:

--- Quote Start ---

C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\lib\store\amd64

--- Quote End ---

Has anyone come across something similiar to this?

Edit:

Also the board that I am using is the DE1-SOC board.

I have ran through setting up the appropriate windows variables for that board as well.

5 Replies

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    When you run the OpenCL emulator from a terminal window, you need to make sure you have a complete Microsoft toolchain setup.

    You need to setup search paths for binaries as well as for libraries and dlls.

    Seems like your setup only finds the linker not the needed libraries (the missing one reported is one from Microsofts tool chain).

    Easiest way to setup the Microsoft environment in your terminal window is to run ...\devstudio2010\VC\bin\amd64\vcvars64.bat
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Thank you, I was able to get it to compile, now I am just running into a platform issue. I need to spend some time debugging that now.

    Thank you for your assistant.
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    I ran into the issue requiring me to run the vcvars64.bat file as well. However, you need to set the environment variable CL_CONTEXT_EMULATOR_DEVICE_ALTERA environment variable in windows. To do this, in the window you are going to be running your executable simply execute "set CL_CONTEXT_EMULATOR_DEVICE_ALTERA=<your_board_name_here>" before running. For example, mine is "set CL_CONTEXT_EMULATOR_DEVICE_ALTERA=pcie385n_a7".

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    --- Quote Start ---

    Also the board that I am using is the DE1-SOC board.

    --- Quote End ---

    Does the Soc boards support emulator? I thought I've seen in the doc saying the soc boards are not supported currently.
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    sssdddong:

    Yes, I am pretty sure I read the same thing. I am not sure if they have released support for it or not. I was actually going to try and use the host CPU to run the kernel as well.

    Amaier17:

    Thank you for the recommendation, I have not had a chance to look further into the emulator issue.