Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Novice
90 Views

Getting a gcc include error trying to build vector-add example for FPGA emulation using OneAPI on my local server.

I followed the FPGA OneAPI tutorial in https://devcloud.intel.com/oneapi/get-started/base-toolkit/#fpga-vector-add-sample-walkthrough and successfully built and ran the example on the dev cloud, both in emulation and in hardware. However, the FPGA build took quite a long time, so I'd prefer to build on my local server, which I think will be quicker. To that end, I downloaded the base toolkit for OneAPI, plus the FPGA add-on, and I installed both. I cloned the vector-add example locally, modified the tutorial's build_fpga_emu.sh to point to my local copy of inteloneapi, and tried to build. I get the following error:

 

In file included from /.alpha/public/inteloneapi/compiler/2021.1-beta05/linux/lib/clang/11.0.0/include/CL/sycl/intel/sub_group.hpp:18:

/.alpha/public/inteloneapi/compiler/2021.1-beta05/linux/lib/clang/11.0.0/include/CL/sycl/intel/functional.hpp:28:17: error: too few template arguments for class template 'less'

   return std::less<>()(std::forward<const T>(lhs), std::forward<const U>(rhs))

               ^

/usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../../include/c++/4.8.5/bits/stl_function.h:231:12: note: template is declared here

   struct less : public binary_function<_Tp, _Tp, bool>

          ^

 

I tried re-doing the installation while pointing at a previously-installed version 8.3.0 of gcc instead, but when all is said and done, I'm getting the same error. I'm guessing it's because the includes are still pointing to the default gcc 4.8.5 on my server. Maybe?

 

I'm an FPGA RTL designer, not a C programmer, so I'm not very familiar with how to point installations to correct versions of gcc. What am I doing wrong? Ancillary info: I do not have root or sudo privileges on this system. I must install these as a user.

 

Thanks for suggestions!

0 Kudos
7 Replies
Highlighted
Employee
16 Views

Hi,

 

May I know how do you performed the installation? Have you check your system environment? You could check the environment by running the command "env" in the terminal.

0 Kudos
Highlighted
Novice
16 Views

Hi John, thanks for responding.

 

My steps were as follows:

* open a terminal window

* download OneAPI base toolkit from https://software.intel.com/en-us/oneapi/base-kit:

* under 'download the toolkit' selected 'get it now'

* chose Linux, chose Online Installer, downloaded l_BaseKit_b_2021.1.5.720.tar.gz

* tar xvf l_BaseKit_b_2021.1.5.720.tar.gz

* module load gcc/8.3.0

* in l_BaseKit: ./install.sh --tmp-dir ../tmp

* download FPGA add-on from https://dynamicinstaller.intel.com/oneapi/toolkits/base-kit/linux/ -- "Intel® FPGA Add-on for oneAPI Base Toolkit"

* tar xvf intel-fpga-addon-for-oneapi-base-kit-for-a10gx-linux.zip

* in addon l_intel subdirectory: ./setup.sh --install-dir /.alpha/public/inteloneapi --tmp-dir ../../tmp

 

The possibly-relevant entries in my environment (from running 'env' as you suggested):

 

TERM=xterm

SHELL=/bin/bash

QSYS_ROOTDIR=/.alpha/public/inteloneapi/intelfpgadpcpp/2021.1-beta05/QuartusPrimePro/17.1.1/qsys/bin

LD_LIBRARY_PATH=/.alpha/public/opt/gcc-8.3.0/lib64

QUARTUS_ROOTDIR=/.alpha/local/common/pkg/altera/quartus

PATH=/.alpha/public/opt/gcc-8.3.0/bin:/.alpha/lib64/qt-3.3/bin:/.alpha/local/sbin:/.alpha/local/bin:/.alpha/sbin:/.alpha/bin:/sbin:/bin:/bin:/.alpha/bin:/.alpha/X11R6/bin:/.alpha/local/common/pkg/altera/quartus/bin:/.alpha/local/common/pkg/altera/quartus/sopc_builder/bin:/.alpha/local/common/pkg/altera/modelsim_ase/linux:/.alpha/public/bin:/.alpha/local/common/pkg/altera/quartus/bin:/.alpha/local/common/pkg/altera/quartus/sopc_builder/bin:/.alpha/local/common/pkg/altera/modelsim_ase/linux:/.alpha/public/bin:/.alpha/local/common/pkg/altera/quartus/bin:/.alpha/local/common/pkg/altera/quartus/sopc_builder/bin:/.alpha/local/common/pkg/altera/modelsim_ase/linux:/.alpha/public/bin:/.alpha/local/common/pkg/altera/quartus/bin:/.alpha/local/common/pkg/altera/quartus/sopc_builder/bin:/.alpha/local/common/pkg/altera/modelsim_ase/linux:/.alpha/public/bin

ALTERA_ROOTDIR=/.alpha/local/common/pkg/altera

_LMFILES_=/.alpha/public/modulefiles/gcc/8.3.0

LOADEDMODULES=gcc/8.3.0

 

Thanks for any advice!

0 Kudos
Highlighted
Novice
16 Views

One additional clue (perhaps) from today. My colleague sent me the following:

 

In Makefile.fpga I replaced the following line:

   CXX := dpcpp

with:

   CXX := dpcpp --gcc-toolchain=/.alpha/public/opt/gcc-8.3.0

 

That got rid of the include file complaints, but added the new complaint

 

 "Error: No recognized input file format on the command line".

 

Not sure whether it actually fixed the original problem and allowed the process to hit the next problem, or just caused a new problem to occur before the old problem could actually be encountered.

 

The only reason I have for thinking it's the first rather than the second is that while the commands

 

   clang -x c -v -E /dev/null

 

and

 

   dpcpp -x c -v -E /dev/null

 

both produce output that includes

 

   "Selected GCC installation: /.alpha/lib/gcc/x86_64-redhat-linux/4.8.5",

 

the command

 

   dpcpp --gcc-toolchain=/.alpha/public/opt/gcc-8.3.0 -x c -v -E /dev/null

 

produces output that includes:

 

   "Selected GCC installation: /.alpha/public/opt/gcc-8.3.0/lib/gcc/x86_64-pc-linux-gnu/8.3.0".

 

Not really sure where to go from here.

0 Kudos
Highlighted
Employee
16 Views

Hi,

 

Could you try to manually compile the vector add design by using the command "dpcpp -fintelfpga *.cpp"? Please refer to https://software.intel.com/en-us/oneapi-programming-guide-offline-compilation-for-fpga for the command to compile the design.

0 Kudos
Highlighted
Employee
16 Views

Hi,

 

After further checking, you do not run the "/opt/intel/inteloneapi/setvars.sh" which will setup the environment of your system. You can get more information on the setup fromhttps://software.intel.com/en-us/get-started-with-debugging-dpcpp-linux.

0 Kudos
Highlighted
Novice
16 Views

Hi John,

 

We actually do run setvars.sh, though it is a slightly modified version for our local environment.

 

We narrowed the problem down to something that gets set when we "export INTELFPGAOCLSDKROOT=/.alpha/local/common/pkg/altera/hld". We obviously can't build a bitfile without that, but we can build the emulation without that variable set, and if we don't set it, the emulations seem to build and run fine.

 

We have not, however, been able to get past the above error when INTELFPGAOCLSDKROOT is set.

 

For now, we're giving up. We're going to try to work on the cloud for the time being.

 

If you or anyone has some further suggestions, we'll happily have a look at this again.

 

Thank you!

0 Kudos
Highlighted
Employee
16 Views

Hi,

 

May I know how do you set INTELFPGAOCLSDKROOT?

 

Could you check if you have "/.alpha/public/inteloneapi/compiler/<oneapi version>/linux/lib/oclfpga" directory? If yes, please set the INTELFPGAOCLSDKROOT to this directory.

0 Kudos