bluespec.com Forum Index bluespec.com
Bluespec Forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Error g++2 when compiling

 
Post new topic   Reply to topic    bluespec.com Forum Index -> Tools: BSC (Bluespec Compiler)
View previous topic :: View next topic  
Author Message
PhantomFav



Joined: 13 Jun 2011
Posts: 16

PostPosted: Mon Sep 02, 2013 2:27 pm    Post subject: Error g++2 when compiling Reply with quote

Hi, after installing a new OS (xubuntu 13.04) i have encountered a problem during compilation, when I press the compile button in the GUI an error pop up saying:

Code:
Error:
g++2
/media/sda3/Bluespec-2012.01.A/lib/bin/bsenv: 1: /media/sda3/Bluespec-2012.01.A/lib/bin/bsenv: c++: not found
g++2
/media/sda3/Bluespec-2012.01.A/lib/bin/bsenv: 1: /media/sda3/Bluespec-2012.01.A/lib/bin/bsenv: c++: not found
    while executing
"exec $env(BLUESPECDIR)/bin/bsenv c++_family"
    (procedure "customize_custom_command" line 8)
    invoked from within
"customize_custom_command $exe"
    (procedure "commands::link_via_bsc" line 18)
    invoked from within
"commands::link_via_bsc"
    (procedure "link_get_cmd" line 9)
    invoked from within
"link_get_cmd"
    (procedure "commands::comp_and_link" line 3)
    invoked from within
"commands::comp_and_link"
    (procedure "menu_actions::build_comp_and_link" line 2)
    invoked from within
"menu_actions::build_comp_and_link"
    invoked from within
".tb.compilelink invoke"
    ("uplevel" body line 1)
    invoked from within
"uplevel #0 [list $w invoke]"
    (procedure "tk::ButtonUp" line 22)
    invoked from within
"tk::ButtonUp .tb.compilelink"
    (command bound to event)


I can't figure out how to get rid of this error, can you help me?

EDIT: the problem show up every time the compiler try to create the out executable, the .ba and .bo file are normaly created
Back to top
View user's profile Send private message
quark
Site Admin


Joined: 02 Nov 2007
Posts: 495

PostPosted: Mon Sep 02, 2013 3:19 pm    Post subject: Re: Error g++2 when compiling Reply with quote

Have a look at the script "bsenv" in the Bluespec installation. This script is used by BSC to determine the C++ compiler and flags to use when compiling C++ files on your system. The first thing that BSC does is to try to determine which version of C++ you have, so that I can decide which pre-compiled shared object files to use (since earlier versions of GCC are not compatible with later ones, for instance). So try this command:
Code:
/media/sda3/Bluespec-2012.01.A/lib/bin/bsenv c++_family

I suspect that this will give you same error that you saw about the command "c++" not being found. If you look in the script, you'll see that it first consults the environment variable "CXX" to see if your environment has specified the command for the C++ compiler; if not, then it defaults to "c++".

So the first question is whether you have a C++ compiler installed on your system. For instance, does GCC come installed standard on xubuntu 13.04 or do you need to install it?

If GCC or another C++ compiler is installed, then you should either make "/usr/bin/c++" be a link to it or you should set CXX in your environment to be the command to run.
Back to top
View user's profile Send private message
PhantomFav



Joined: 13 Jun 2011
Posts: 16

PostPosted: Mon Sep 02, 2013 3:52 pm    Post subject: Reply with quote

thanks for your help, you were right, so as you say i have checked for gcc, and i have found it. So i've created a symbolic link:
Code:
sudo ln -s /usr/bin/gcc /usr/bin/c++


but when the compiler do:
Code:
+ bsc -e mkTb -sim -o ./out -simdir . -p .:%/Prelude:%/Libraries -keep-fires

another error come out:
Code:
c++: error trying to exec 'cc1plus': execvp: No such file or directory


what is the problem?


Last edited by PhantomFav on Mon Sep 02, 2013 3:59 pm; edited 1 time in total
Back to top
View user's profile Send private message
quark
Site Admin


Joined: 02 Nov 2007
Posts: 495

PostPosted: Mon Sep 02, 2013 3:58 pm    Post subject: Reply with quote

I did some googling around and it looks like, while you have gcc installed, maybe you don't have g++ installed -- which could explain why c++ was not linked to it. I'd suggest removing the link to "gcc" and trying to install the "g++" package. Hopefully that will also create a link for "c++" (to point to "g++" and not to "gcc").
Back to top
View user's profile Send private message
PhantomFav



Joined: 13 Jun 2011
Posts: 16

PostPosted: Mon Sep 02, 2013 4:13 pm    Post subject: Reply with quote

oh thanks a lot! you are my savior, this is the solution for the specific problem:

Code:
sudo apt-get update
sudo apt-get install build-essential
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    bluespec.com Forum Index -> Tools: BSC (Bluespec Compiler) All times are GMT - 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum
bluespec.com topic RSS feed 


Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP