Forum Discussion

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

OpenCL library example1 - aocl-opt error

Hello!

I am interested in packaging VHDL code as a part of OpenCL library. I am trying to run the examples listed on the website https://www.altera.com/support/support-resources/design-examples/design-software/opencl/library-design-example.html

This is specific to example 1, but I get the same error for example 2 as well.

I have followed the steps in the Readme.html present in the package.

 dg252267@is231451:/local2/library_example1/device/lib1$ ls
c_model.cl  div  double_lib.aoclib  double_lib.aoco  double_lib.h  double_lib.xml  dspba_library  rsqrt  sqrt
dg252267@is231451:/local2/library_example1/device/lib1$ aocl library hdl-comp-pkg double_lib.xml -o double_lib.aoco
dg252267@is231451:/local2/library_example1/device/lib1$ aocl library create -name double_lib double_lib.aoco
dg252267@is231451:/local2/library_example1/device/lib1$ cp double_lib.aoclib ..
dg252267@is231451:/local2/library_example1/device/lib1$ cd ../../
dg252267@is231451:/local2/library_example1$ ls
bin  device  host  Makefile  README.html
dg252267@is231451:/local2/library_example1$ aoc device/example1.cl -o bin/example1.aocx -I device/lib1 -L device -l double_lib.aoclib --board alaric_v3_prod
aocl-opt: Too many positional arguments specified!
Can specify at most 1 positional arguments: See: /local2/is231451/intelFPGA_pro/16.1/hld/linux64/bin/aocl-opt -help
Error: Optimizer FAILED.
Refer to example1/example1.log for details.
dg252267@is231451:/local2/library_example1$ aoc -march=emulator device/example1.cl -o bin/example1.aocx -I device/lib1 -L device -l double_lib.aoclib --board alaric_v3_prod
aocl-opt: Too many positional arguments specified!
Can specify at most 1 positional arguments: See: /local2/intelFPGA_pro/16.1/hld/linux64/bin/aocl-opt -help
Error: Optimizer FAILED.
Refer to example1/example1.log for details.

I have tried the command both with and without the emulator.

If I run aocl-opt - help , I get a list of available parameters that I can pass on. My issue is, the example1.cl does not use this command. And the device libraries are obfuscated code, so I cannot actually see where the aocl-opt is being called.

I have tried the multi vector add example and it executed successfully. I haven't tried the other 2 examples listed as they are for v17.0 and I am using v16.1.

I am targeting ReflexCES alaric Arria 10 board. I am running this example on Ubuntu 14.04.

Has anyone come across this error before? I welcome any suggestions.

Thank you!

2 Replies

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

    Hi,

    I had the same error with code I made (not from the examples form Intel).

    Also, I've tried the step you did with the example 1 and everything worked fine : no error.

    When I got this error, as strange as it could be, I only moved my code on my desktop, repeat the exact same thing as you did and it compiled.

    I was working from a SVN repository and a path with spaces in it.

    So try to move your code somewhere safe with short path, no spaces and on C drive (because I don't see any drive in the path you're using).

    As a difference, I am working on Windows, so it is possible that it may not fix your issue

    Try this and let us know if it worked !
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Hi Tibs,

    Thank you for the suggestion. I did have a space in my $PATH variable and the folder name ( I had edited the path to put in the forum). Moving the code elsewhere fixed it.

    Thank you! :)