Forum Discussion

sThei's avatar
sThei
Icon for New Contributor rankNew Contributor
7 years ago

Cannot run HLS Compile example "counter"

Hi,

I've got a similar error like here:

https://forums.intel.com/s/question/0D50P00003yyTceSAE/intel-hls-can-not-generate-execution-file?

I tried to run the example "counter":

cd C:\intelFPGA_pro\18.1\hls

init_hls.bat (->The i++ compiler is now available at 'C:\intelFPGA_pro\18.1\hls\bin\' (through your %Path%))

cd C:\intelFPGA_pro\18.1\hls\examples\counter

build.bat test-x86-64

i++  -march=x86-64 counter.cpp -o test-x86-64.exe
c:/program files (x86)/microsoft visual studio 14.0/vc/bin/link.exe : fatal error LNK1107: invalid or corrupt file: cannot read at 0x320
HLS Link x86-64 FAILED.
Run test-x86-64.exe to execute the test.

Any suggestions on how to solve that problem?

I'm using:

Quartus Prime 18.1.0 Patch 0.04

VS 2015 Update 3

Win 10 64Bit

11 Replies

  • KennyT_altera's avatar
    KennyT_altera
    Icon for Super Contributor rankSuper Contributor
    My guess is something to do with the setup. Just to have a fast confirmation 1) Are you following the HLS starting guide guide ? did you run the init_hls.bat first? User need to run this *.bat before any compilation as it will setup the environment. 2) Did you installed the VS 2010? when you manually go to the path c:/program files (x86)/microsoft visual studio 10.0/vc/bin/link.exe , did you see the link.exe file is present? 3) This error is saying user is adding a 32 bit link file for usage which is incorrect, HLS have to use the 64 bit link file. \VC\bin\amd64\link.exe
    • sThei's avatar
      sThei
      Icon for New Contributor rankNew Contributor

      Hi,

      and thank you for your answer.

      1) I followed the HLS starting guide and ran the init_hls.bat.

      2) I'm using Quartus Prime Pro 18.1 with patch 0.04. That is why I installed VS 2015. File C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\link.exe is present.

      3) File C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\amd64\link.exe is also present. I changed my PATH variable to C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\amd64\ and rebooted (!).

      Problem is solved, but was followed by the linker not possible to find 'msvcprt.lib'. I had to set the include and lib path:

      Set INCLUDE="C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include;C:\intelFPGA_pro\18.1\hls\include;"
       
      Set LIB="C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\lib;"

      Now the problem is:

      In file included from counter.cpp:1:
      C:/intelFPGA_pro/18.1/hls/include\HLS/hls.h:16:10: fatal error: 'type_traits' file not found
      #include <type_traits>
               ^~~~~~~~~~~~~
      1 error generated.
      HLS x86-64 compile FAILED.
      Run test-x86-64.exe to execute the test.
  • sThei's avatar
    sThei
    Icon for New Contributor rankNew Contributor
        *******************************************************
         i++ debug log file                                    
         This file contains diagnostic information. Any errors 
         or unexpected behavior encountered when running i++   
         should be reported as bugs. Thank you.                
        *******************************************************
         
        Compiler Command: i++ -march=Arria10 counter.cpp -o test-fpga.exe
         
        2019.01.14.16:23:17 Info: Doing: qsys-script --script=count.tcl --quartus-project=none
        2019.01.14.16:23:21 Info: create_system count
        2019.01.14.16:23:21 Info: set_project_property HIDE_FROM_IP_CATALOG false
        2019.01.14.16:23:21 Info: set_project_property DEVICE_FAMILY Arria10
        2019.01.14.16:23:21 Info: Info: The device and speed grade is changed to the defaults of the device family, Arria10.
        2019.01.14.16:23:21 Info: set_project_property DEVICE 10AX115U1F45I1SG
        2019.01.14.16:23:21 Info: add_instance count_internal_inst count_internal
        2019.01.14.16:23:22 Info: set_instance_property count_internal_inst AUTO_EXPORT true
        2019.01.14.16:23:22 Info: save_system count.ip
        2019.01.14.16:23:29 Info: Saving generation log to C:/intelFPGA_pro/18.1/hls/examples/counter/test-fpga.prj/components/count/count/count_generation.rpt
        2019.01.14.16:23:29 Info: Generated by version: 18.1 build 222
        2019.01.14.16:23:29 Info: Starting: Create HDL design files for synthesis
        2019.01.14.16:23:29 Info: qsys-generate C:\intelFPGA_pro\18.1\hls\examples\counter\test-fpga.prj\components\count\count.ip --synthesis=VERILOG --output-directory=C:\intelFPGA_pro\18.1\hls\examples\counter\test-fpga.prj\components\count\count --family="Cyclone 10 GX" --part=Unknown
        2019.01.14.16:23:29 Warning: count_internal_inst: Invalid device family name in input file: Arria 10
        2019.01.14.16:23:29 Warning: count_internal_inst: Invalid device name in input file: 10AX115U1F45I1SG
        2019.01.14.16:23:29 Error: count: Component count_internal_inst does not support selected device family Cyclone 10 GX
        2019.01.14.16:23:29 Error: qsys-generate failed with exit code 3: 1 Error, 2 Warnings
        2019.01.14.16:23:29 Info: Finished: Create HDL design files for synthesis
        2019.01.14.16:23:29 Info: Starting: IP-XACT
        2019.01.14.16:23:29 Info: qsys-generate C:\intelFPGA_pro\18.1\hls\examples\counter\test-fpga.prj\components\count\count.ip --synthesis=VERILOG --ipxact --output-directory=C:\intelFPGA_pro\18.1\hls\examples\counter\test-fpga.prj\components\count\count --family="Cyclone 10 GX" --part=Unknown
        2019.01.14.16:23:29 Info: Finished: IP-XACT
  • I am trying to reproduce the error but not able to do it so far. Can you please try opening the terminal 'x64 Native Tools Command Prompt' command window available in the Microsoft Visual Studio installation.

    Then run init_hls.bat in that window.

    And then try running counter example build.bat.

    • sThei's avatar
      sThei
      Icon for New Contributor rankNew Contributor

      Same problem.

      C:/intelFPGA_pro/18.1/hls/include\HLS/hls.h:16:10: fatal error: 'type_traits' file not found

      If I copy the "type_traits" file to "examples/counter" it can be found. Next problem is, that it cannot find the "xstddef" file. Looks like the linker cannot find files in "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include".

      • Prince_J_Intel's avatar
        Prince_J_Intel
        Icon for New Contributor rankNew Contributor

        -- adding this comment again with images attached.

        i am able to reproduce the issue. See the attached image which shows same error of LNK1107. This is because you are not using the command prompt i suggested. This leads to not recoginizing the correct visual studio libraries. see the blue encircled name of the command window.

        Use below window instead. You can see that all works greats with no issues.

  • i am able to reproduce the issue. See the attached image which shows same error of LNK1107. This is because you are not using the command prompt i suggested. This leads to not recoginizing the correct visual studio libraries. see the blue encircled name of the command window.

    Use below window instead. You can see that all works greats with no issues.