gcc-4.4.7

HLSを使うにはGCCの4.4.7を使う事

とかさらっと書いてある

https://www.altera.com/content/dam/altera-www/global/en_US/pdfs/literature/hb/hls/ug-hls-getting-started.pdf

 

ので、まあじゃあそうしようかと思ったら

案外いばらの道だった

https://www.alteraforum.com/forum/showthread.php?t=57465

アルテラフォーラムに

書いてあった通りにする

 

まず、以下のファイルを編集する

 /etc/apt/sources.list

内容は以下の2行を追加する

deb http://dk.archive.ubuntu.com/ubuntu/ trusty main universe
deb http://dk.archive.ubuntu.com/ubuntu/ trusty-updates main universe 

 

これでaptコマンドでgcc-4.4が指定出来る様になる

以下のコマンドを実行

>  sudo apt-get update
> sudo apt-get install gcc-4.4 g++-4.4

因みにgcc-4.4はgcc-4.4.7の事らしい

次に、現在デフォルトで使用しているバージョンからgcc-4.4.7にスイッチするには

以下のコマンドを入力

> sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-5 100 --slave /usr/bin/g++ g++ /usr/bin/g++-5
> sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.4 50 --slave /usr/bin/g++ g++ /usr/bin/g++-4.4
> sudo update-alternatives --config gcc

これでバージョンを確認

> gcc --version
gcc (Ubuntu/Linaro 4.4.7-8ubuntu1) 4.4.7
Copyright (C) 2010 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 

 よし、4.4.7が実行できた

 

forumではインクルードパスを追記しているみたいだけど

オリジナルのMakefileをいじりたくないので

> export CFLAGS="-I/usr/include/c++/4.4.7 -I/usr/include/c++/4.4.7/x86_64-linux-gnu -L/home/jb/intelFPGA_lite/17.1/hls/linux64/lib/dspba/linux64"

> export CXXFLAGS="-I/usr/include/c++/4.4.7 -I/usr/include/c++/4.4.7/x86_64-linux-gnu -L/home/jb/intelFPGA_lite/17.1/hls/linux64/lib/dspba/linux64"

としてみた

> make
No target specified, defaulting to test-x86-64
Available targets: test-x86-64, test-fpga, test-gpp, clean
i++ counter.cpp -I/usr/include/c++/4.4.7 -I/usr/include/c++/4.4.7/x86_64-linux-gnu -L/home/jb/intelFPGA_lite/17.1/hls/linux64/lib/dspba/linux64 -march=x86-64 -o test-x86-64
+----------------------------------------+
| Run ./test-x86-64 to execute the test. |
+----------------------------------------+ 

 おっ

できたー

インターネットは知恵の結晶だね

みんなありがとう