Can't run the compilation script
#1
Just got a fancy new pi 2. I know that gcc-4.8 and g++-4.8 are needed in orger to compile correctly, so i ran
Code:
sudo apt-get install g++-4.8 gcc-4.8 clang git cmake make
which should fulfill the requirements. However, running the compilation script tells me that i need to install gcc and g++. Installing those allows me to continue to cloning repos and compiling causes compilation to fail at about 12%, probably because apt-get install gcc installs 4.6.3, not 4.8. I then removed gcc-4.6 and g++-4.6 and created aliases from gcc-4.8 to gcc and g++-4.8 to g++. After starting a new session, gcc --version returns
Quote:gcc-4.8 (Raspbian 4.8.2-21~rpi3rpi1) 4.8.2
Copyright © 2013 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.

But the script still says that I need to install gcc and g++ again. Any way to fix this or do I need to just use a precompiled build? Huh
Reply
Thanks given by:
#2
Hello, please try setting your system-wide default compiler to the newer gcc using this:

Code:
sudo update-alternatives --config gcc

You may need to undo what you've done with the aliases.
Reply
Thanks given by:
#3
Quote:pi@raspberrypi-Server ~ $ sudo update-alternatives --config gcc
update-alternatives: error: no alternatives for gcc
pi@raspberrypi-Server ~ $ sudo update-alternatives --config gcc-4.8
update-alternatives: error: no alternatives for gcc-4.8
pi@raspberrypi-Server ~ $
Reply
Thanks given by:
#4
How exactly did you create the aliases? If you used the `alias` command, it won't affect any scripts you execute.

You can try compiling manually:
Code:
git clone --recursive https://github.com/cuberite/cuberite.git
cd cuberite
cmake . -DCMAKE_BUILD_TYPE=RELEASE
make . -j 4
Reply
Thanks given by:
#5
Yeah, it was alias. Im compiling manually, but how should I have made the aliases?
Reply
Thanks given by:
#6
In all honesty, any way to alias would have been dirty. The proper solution would be to find out what exactly is wrong with `compile.sh` or your setup. What was the output of `compile.sh`? Also, does typing `gcc` at the terminal without using aliases return a `command not found`?
Reply
Thanks given by:
#7
Yes, no aliases + gcc command = command not found.
Reply
Thanks given by:
#8
(12-26-2015, 06:24 AM)DaPorkchop Wrote: Yes, no aliases + gcc command = command not found.

I think this shouldn't normally happen. Did you install gcc4.8 from the normal repo?

One way to resolve it is to create a symlink:

Code:
sudo ln -s /usr/bin/gcc /usr/bin/gcc-4.8
sudo ln -s /usr/bin/g++ /usr/bin/g++-4.8

Note that I don't know where your gcc-4.8 is installed, so you may need to modify the `/usr/bin/gcc-4.8` and `/usr/bin/g++-4.8` parts. To easily find where they are, use `whereis gcc-4.8`.
Reply
Thanks given by: DaPorkchop
#9
Ok, I'll try that later. Im on my phone right now, pasting long commands is not a good idea...
Reply
Thanks given by:
#10
I think a link here is the wrong thing to do, a bash alias would be more appropriate.
Reply
Thanks given by:




Users browsing this thread: 5 Guest(s)