After checking the related posts, still cannot install GCC 4.7 on Linux without root privilege? - linux

After checking the posts:
Install gcc on linux with no root privilege
https://stackoverflow.com/questions/9316118/installing-gcc-as-non-root
My problem still cannot be solved so I post it here.
I am trying to install GCC 4.7 on Linux with gcc version 4.1.2 20080704 (Red Hat 4.1.2-52).
I run configure with prefix to be my home directory.
./configure \
--with-gmp=/remote/home/gcc_4_7_2012_5_28/gmp505 \
--with-mpfr=/remote/home/gcc_4_7_2012_5_28/mpfr242 \
--with-mpc=/remote/home/gcc_4_7_2012_5_28/mpc081 \
--disable-libjava
Then, make is ok. But, make check is not ok, I got error:
make[1]: Entering directory `/remote/home/gcc_4_7_2012_5_28/trunk'
make[2]: Entering directory `/remote/gcc_4_7_2012_5_28/trunk/host-x86_64-unknown-linux-gnu/fixincludes'
autogen -T ../.././fixincludes/check.tpl ../.././fixincludes/inclhack.def
make[2]: execvp: autogen: Permission denied
make install is not ok.
make[1]: Entering directory `/remote/home/gcc_4_7_2012_5_28/trunk'
/bin/sh ./mkinstalldirs /usr/local /usr/local
make[2]: Entering directory `/remote/home/gcc_4_7_2012_5_28/trunk/host-x86_64-unknown-linux-gnu/fixincludes'
rm -rf /usr/local/libexec/gcc/x86_64-unknown-linux-gnu/4.8.0/install-tools
/bin/sh ../.././fixincludes/../mkinstalldirs /usr/local/libexec/gcc/x86_64-unknown-linux-gnu/4.8.0/install-tools
mkdir -p -- /usr/local/libexec/gcc/x86_64-unknown-linux-gnu/4.8.0/install-tools
mkdir: cannot create directory `/usr/local/libexec/gcc': Permission denied
I cannot get root privilege.
Any help is appreciated.
Thanks !

When compiling GCC, you should never build it in its source tree!
You forgot a prefix in your configure arguments, perhaps something like
mkdir $HOME/gcc-build
cd $HOME/gcc-build
/your/path/to-source-tree/gcc-4.7.0/configure --prefix $HOME/pref \
--program-suffix -my4.7 \
# other configure arguments go here
of course, you'll find your compiler installed in $HOME/pref/bin/gcc-my4.7 so I recommend adding $HOME/pref/bin to your $PATH and $HOME/pref/lib to your $LD_LIBRARY_PATH
You might try to build the GCC MELT [meta-] plugin once you installed successfully your GCC 4.7
The gcc-help#gcc.gnu.org mailing list is a good place to get such help.

You need to check the config.log file, look for the "checking for suffix of object files". You should see an error message somewhere near there which should help you out.
Or, use EasyBuild for building GCC 4.7, which does everything for you, see http://hpcugent.github.com/easybuild.

Related

How to build qtwayland?

I spent whole day trying to use QtWayland.Compositor 1.0 in Qt creator. I have followed all the steps from there https://wiki.qt.io/QtWayland but I get the following error. I don't know what does it mean, that is my first contact with linux. I have the newest linux mint on a vm.
$ sudo make install
cd src/ && ( test -e Makefile || /usr/lib/x86_64-linux-gnu/qt5/bin/qmake /home/emil/wayland/qtwayland/src/src.pro -o Makefile ) && make -f Makefile install
make[1]: Entering directory '/home/emil/wayland/qtwayland/src'
make[1]: Nothing to be done for 'install'.
make[1]: Leaving directory '/home/emil/wayland/qtwayland/src'
cd examples/ && ( test -e Makefile || /usr/lib/x86_64-linux-gnu/qt5/bin/qmake /home/emil/wayland/qtwayland/examples/examples.pro -o Makefile ) && make -f Makefile install
make[1]: Entering directory '/home/emil/wayland/qtwayland/examples'
cd wayland/ && ( test -e Makefile || /usr/lib/x86_64-linux-gnu/qt5/bin/qmake /home/emil/wayland/qtwayland/examples/wayland/wayland.pro -o Makefile ) && make -f Makefile install
make[2]: Entering directory '/home/emil/wayland/qtwayland/examples/wayland'
Some of the required modules (qtHaveModule(waylandcompositor) qtConfig(opengl)) are not available.
Skipped.
make[2]: Leaving directory '/home/emil/wayland/qtwayland/examples/wayland'
make[1]: Leaving directory '/home/emil/wayland/qtwayland/examples'
how can I fix that? All I want to do is to run the examples from the Qt installation :c.
Most of the content on the wiki page was written many years ago. I made an effort to clean up things I know are not relevant anymore and hope to get the wiki page in a usable state.
The problem as I see it, is that there are so many ways to build Qt, and how to build QtWayland depends on that.
The two most common options:
Building QtWayland as part of a full (or toplevel Qt build)
When configuring Qt, you can add -feature-wayland-server to you configure line. And it will make sure the wayland compositor API is part of your Qt build. Configure will then fail if the dependencies of QtWayland is not met. I.e. if you need dev packages for Wayland.
Then you can either just run make which will build all of Qt as you configured it, or run make module-qtwayland which should only build QtWayland and the required dependencies (qtbase, qtdeclarative, qtxmlpatterns).
Building QtWayland against an existing Qt installation (without QtWayland)
First you need to find qmake for your desired Qt version. If it's the one provided by the system, it's usually on your PATH already. If you are going to use Qt provided by the Qt installer, it's usually in ~/Qt/5.10.0/gcc_64/bin/qmake or equivalent for your version and architecture.
Clone qtwayland
git clone git://code.qt.io/qt/qtwayland.git
cd qtwayland
git checkout v5.10.0 #or whatever version your qmake reports
Configure with qmake
qmake
or
~/Qt/5.10.0/gcc_64/bin/qmake
You should now see:
Qt Wayland Client ........................ yes
Qt Wayland Compositor .................... yes
In your terminal, or else you are probably missing some dependencies.
Build with make
make
make install
Build examples
Depending on your configuration, this may need to be run explicitly:
make sub-examples

Toolchain binaries cannot be found

Trying to build recent version of u-boot bootloader for my mini2440 ARM board I managed to download a toolchain package from codesourcery and extract it to following path: /usr/local/arm-2008q3/
I also exported following values for current session:
export PATH=$PATH:/usr/local/arm-2008q3/bin
export CROSS_COMPILE=arm-none-linux-gnueabi-
When I run make I get a following output and I cant figure out why:
make: arm-none-linux-gnueabi-gcc: Command not found
for dir in tools examples api_examples ; do make -C $dir _depend ; done
make[1]: arm-none-linux-gnueabi-gcc: Command not found
make[1]: Entering directory `/home/deth/uboot/mini2440/tools'
make[1]: Nothing to be done for `_depend'.
make[1]: Leaving directory `/home/deth/uboot/mini2440/tools'
make[1]: arm-none-linux-gnueabi-gcc: Command not found
make[1]: Entering directory `/home/deth/uboot/mini2440/examples'
/bin/sh: 1: arm-none-linux-gnueabi-gcc: not found
I double checked everything and binaries indeed reside in mentioned folder but... Please explain where I'm wrong.
Well, after almost three days of headbanging into the wall I managed to solve this. To be honest I might have never solved it if occasionally hadn't installed the COdesourcery toolchain with executable installer which they also provide. After doing that the manually unpacked version started to execute! This of course led to a conclusion that there were libraries missing. I tried to reproduce the problem on separate virtual machine and voila, here are couple of words that solved the whole issue:
sudo apt-get install lib32z1 lib32ncurses5 lib32bz2-1.0
Hope this will help someone, and thanks to everyone for help!

How do I build the ManDVD package from compressed source on Linux?

When I try to install any compressed file into Linux I never can, because:
When I execute ./configure the system says bash: ./configure: No such file or directory.
When I execute sudo ./configure the system says sudo: ./configure: command not found.
Worst , when I execute make the system says make: *** No rule to make target '/usr/lib64/qt-3.3/mkspecs/default/qmake.conf', needed by 'Makefile'. Stop.
With make install the system says make: *** No rule to make target '/usr/lib64/qt-3.3/mkspecs/default/qmake.conf', needed by 'Makefile'. Stop.
Completion: I can't install nothing that is not in the repository into my system.
Note: I use Linux Mint XFCE 13 (Maya).
What can I do to solve this unpleasant problem?
As ManDVD's Makefile says:
#############################################################################
# Makefile for building: mandvd
# Generated by qmake (1.07a) (Qt 3.3.8b) on: Sun Mar 8 18:32:50 2009
# Project: mandvd.pro
# Template: app
# Command: $(QMAKE) -o Makefile mandvd.pro
#############################################################################
Makefile was autogenerated by qmake.
I'm no expert at using qmake, but I think executing qmake will re-generate Makefile, so then you can run make && sudo make install as INSTALL file says.
You should've already discovered project is kind of messy (if not discontinued at all), so take care, and may the force be with you :)

How do I run libsvm on linux?

I'm having trouble installing libsvm, presently im running via a ubuntu virtual machine . When I follow the instructions such that on Unix systems, "type make' to build thesvm-train' and `svm-predict'programs. Run them without arguments to show the usages of them". This is my following error output: I am rather new to both libsvm and unix systems so any help would be greatly appreciated.
aaron#aaron-laptop:~$ cd Document
bash: cd: Document: No such file or directory
aaron#aaron-laptop:~$ cd Documents
aaron#aaron-laptop:~/Documents$ libsvm-3.12
libsvm-3.12: command not found
aaron#aaron-laptop:~/Documents$ cd libsvm-3.12
aaron#aaron-laptop:~/Documents/libsvm-3.12$ make
g++ -Wall -Wconversion -O3 -fPIC -c svm.cpp
make: g++: Command not found
make: *** [svm.o] Error 127
aaron#aaron-laptop:~/Documents/libsvm-3.12$
Open your terminal and type these commands in order.
sudo apt-get update
sudo apt-get install build-essential
If this still doesn't work,
open up your terminal, type in 'g+' (without the quotes) and press the button multiple times. It will show you if the name of the command g++ has been changed or not. (Sometimes updating your linux changes the name of g++ to g++-3.x (where x is a number).
If this is the case, in your installation instructions, replace every g++ by whatever number you got after pressing the key.

Error while building glibc

I'm trying to install glibc to debug a C-framework I'm working on. But, I'm getting an error in the build process. Here's the error msg:
make[3]: Leaving directory `/root/glibc-source/glibc-2.14/elf'
/usr/bin/install -c /root/glibc-2.14-build/elf/ld.so /usr/local/myglibc/lib/ld-2.14.so.new
mv -f /usr/local/myglibc/lib/ld-2.14.so.new /usr/local/myglibc/lib/ld-2.14.so
/usr/bin/install -c /root/glibc-2.14-build/libc.so /usr/local/myglibc/lib/libc-2.14.so.new
mv -f /usr/local/myglibc/lib/libc-2.14.so.new /usr/local/myglibc/lib/libc-2.14.so
echo ld-2.14.so /usr/local/myglibc/lib/ld-linux-x86-64.so.2 >> /root/glibc-2.14-build/elf/symlink.list
/usr/bin/install -c /root/glibc-2.14-build/elf/sotruss-lib.so /usr/local/myglibc/lib/audit/sotruss-lib.so.new
mv -f /usr/local/myglibc/lib/audit/sotruss-lib.so.new /usr/local/myglibc/lib/audit/sotruss-lib.so
make[2]: *** No rule to make target `/root/glibc-2.14-build/dlfcn/libdl.so.2', needed by `/root/glibc-2.14-build/elf/sprof'. Stop.
make[2]: Leaving directory `/root/glibc-source/glibc-2.14/elf'
make[1]: *** [elf/subdir_install] Error 2
make[1]: Leaving directory `/root/glibc-source/glibc-2.14'
make: *** [install] Error 2
Is this a known problem?
I had built glibc on the same machine earlier last week without any errors. I'm rebuilding it because glibc is compiled with optimization level 2(-O2) by default and I'm unable to look into the values of a few variables inside the library functions from the code dump as they've been optimized out. I'm currently trying to compile with optimization level 1.
Thanks
It looks like you are trying to make install, without first doing a successful make all.
This is for the benefit of anyone who might be trying to build glibc on their ubuntu box.
I went through the following problems and resolved them the following way.
These problems were encountered in ubuntu 12.04
I created a directory glib-build on the same level as the glib-VERSION and ran the following command
$> ../glibc-2.16.0/configure --prefix=/home/gugovind/tsapp/glibc/glibc-build/
that gave me the following error that makeinfo is missing.
for that
$>sudo apt-get install texinfo
will resolve the problem.
It threw and error about LD_LIBRARY_PATH having the current directory (even if it does not exist)
for that run the following in your command prompt
$>set LD_LIBRARY_PATH
this will clear the LD_LIBRARY_PATH only for that console temporarily. Then run the configure again.
You might encounter another problem with configure..
"function strtonum never defined"
look at the config.log file and it might be missing mawk or gawk. install them using
sudo apt-get install gawk
This should get you through the configure part.
now run
make all
if in case you encounter a particular file not compiling.. just copy the gcc ... before that and paste it in the command prompt again after you have cd to that directory (the command lines before the error should tell you where to go.)
make install
You might get a warning about not able to find etc/ld.config... file. ignore that..
you are all set now.

Resources