Fedora - Reinstalling GMP with C++ support - linux

I'm trying to install a library that uses gmp and am running the ./configure on it.
So far, I've gotten past several snags, such as requiring gcc, g++, and m4 by using:
yum install gcc
yum install gcc-g++
yum install m4
Now I'm getting this error:
checking for the GMP library version 4.1.3 or above... no
configure: error: Cannot find GMP version 4.1.3 or higher.
GMP is the GNU Multi-Precision library:
see http://www.swox.com/gmp/ for more information.
When compiling the GMP library, do not forget to enable the C++ interface:
add --enable-cxx to the configuration options.
As such, I tried both installing and updating gmp using yum:
yum install gmp
yum update gmp
Install tells me it's already installed and is v. 5.1.2
Updating says there's nothing to update.
I went to the gmp site and it is currently v. 6.0.0
I downloaded it and ran configure (using --enable-cxx), make, and make install.
Yet, nothing has changed. It still says I have v. 5.1.2 and the configure for the library still says it can't find 4.1.3 and above / try enabling c++.
The gmp files (such as gmp.h) are being placed in /usr/local/lib and /include
I've been at this for hours without any progress. I'm rather new to linux so I imagine there's something I just don't know about.
Am I not installing 6.0.0 correctly to overwrite the already installed one?
Or is there a way to reinstall the original with the c++ option?
Any help would be appreciated. Thanks.

dnf install gmp-devel resolved this for me on rhel

When you manually install something, as you have, it doesn't get installed in the normal /usr/lib directory and therefore it doesn't overwrite it. This is a good thing. In general, you shouldn't mess with files installed by the package manager. (Except in the case that they are config files that are meant to be edited.)
When you install manually, it is installed to /usr/local/lib. Fortunately, GCC and other compilers don't care which directory something is installed in, they will find it (when it's in standard places like /usr/* or /usr/local/*).
Just include the C++ header and add the correct -l library flag.

I figured it out.
Under the --help section of the ./configure for the library I was trying to install, there was actually a feature just for this:
--with-gmp-include=DIR
--with-gmp-lib=DIR
Using these, I was able to get it to install.
Thanks for the help.
I think I was too focused on trying to update the system install of gmp.

Related

Which packages should I install on Cygwin to use simpleScalar - Alpha configuration?

I already installed the following packages version 4.3-1, gcc-core version 11.3.0-1, gcc-g++ version 11.3.0-1. However, when I run the make command after running the make config-alpha command, I get several errors on the screen. I already tried to install other versions of these packages but I still get the same results.errors that I got
Which other additional package should I install?
Assuming that SimpleScalar is the one here:
https://www.es.ele.tue.nl/~yhe/aca/Simplescalar_Download.html
the packaging is ancient (gcc gcc-2.7.2.3) and its manually crafted configure is not considering any recent platforms.
It seems very hard to adjust to a Cygwin build and you can not use the GCC Cygwin compiler for a cross build of a Alpha platform

How to install older gcc package using APT from a repository?

I have GCC v9. But I'm trying to install a GCC 4.8.1 version to test a library compilation on that very old version of GCC.
The version is not available in the official Ubuntu repos,it is deprecated, but I've found it in other mirrors as told by the official GCC website. This one seems like popular one:
https://launchpad.net/~ubuntu-toolchain-r/+archive/ubuntu/test
I have very little knowledge of linux package systems except for the basic. I want to keep both versions. So I should do this:
sudo apt -y install gcc-4.8.1 gcc-9
The reason why I want to use this command and not install it from the file, apart from the difficulty of doing that for me, is that I'm following a guide in order to have several GCCs on my system:
https://www.fosslinux.com/39386/how-to-install-multiple-versions-of-gcc-and-g-on-ubuntu-20-04.htm
When I add the url to the sources.list file seems like it is working.
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt update -q
But when I try to call the install with gcc-4.8.1 or gcc-4.8 , or even gcc-4 the package doesn't exist.
Package gcc-4.8 is not available, but is referred to by another
package. This may mean that the package is missing, has been
obsoleted, or is only available from another source E: Package
'gcc-4.8' has no installation candidate
Also, I don't know if websites like these can be added to the repos list in order to find the package using APT:
http://www.netgull.com/gcc/releases/gcc-4.8.1/
[EDIT]
I downloaded the package from the website I linked. I have no idea how to install this by hand. If only I could find a repository that could help me with this... I have no idea how to make APT help me with the installation.
But I'm trying to install a GCC 4.8.1 version to test a library compilation on that very old version of GCC.
Developers have tools up their sleeve so they don't have to install dependencies and bloating their systems for every library (and every configuration of that library!) they want to try out and test.
Use docker. You could write for example a testing script, assuming your project uses make:
# test_my_lib_in_gcc-4.8.sh
#!/bin/sh
docker run -ti --rm -v $PWD:/project -w /project gcc:4.8 -u $UID:$GID sh <<EOF
make && make test
EOF
that will compile and test your application in using 4.8 gcc. Consider how easy it is to change gcc version - just change the number. You could test your library in gcc, in different versions, and using other compilers and on different distributions to make sure it works for others. If you're a developer of the library, write an automatized CI pipeline that would automatically test your application each commit in specific docker environment, using ex. https://docs.gitlab.com/ee/ci/README.html or https://travis-ci.org/ .

Compiling Cairo-dock errors on GTK dependency

I've Redhat 7.2 running Cinnamon, and hate the docks provided, how come I can't resize the area a widgit is allocated? All apps are jammed into half the dock.
Drives me to compile cairo-dock from source as it isn't an ibm redhat blessed package.
cmake .. -DCMAKE_INSTALL_PREFIX=/usr
...
-- checking for module 'wayland-client>=1.0.0'
-- package 'wayland-client>=1.0.0' not found
-- checking for module 'gtk+-3.0>=3.4.0'
-- package 'gtk+-3.0>=3.4.0' not found
so I find gtk version is 3.14.13-16.el7 using yum list installed "gtk*"
I downloaded gtk 3.4.4 and compiled it and follow the INSTALL provided, sudo make install, which completes with no errors
rerunning cmake gives me the same error, so I'm wondering if I had to remove 3.14? I'm not really sure how best to proceed and thought it best to get some advice. I'm not really in the mood to break things. Thanks for your time and consideration.
Calvin, I'm also IBMer and installed RHEL7.2 from IBM's image.
I could successfully download the sources and install Cairo Docker and respective plugins.
I followed the instructions in this page here:
Glx-Dock - Generic:Compilation
First, install all dependencies below from official IBM repository.
I used the same package names for the Fedora dependencies and some may NOT exist for RHEL. Therefore, some plugins won't be available by fetching dependencies from official repository only - but the Cairo Docker will work.
sudo yum install cmake make pkgconfig gcc gcc-c++ gettext glib2-devel\
cairo-devel librsvg2-devel dbus-glib-devel libxml2-devel libXrender-devel\
mesa-libGL-devel mesa-libGLU-devel pango-devel libXxf86vm-devel\
libXtst-devel libXrandr-devel libX11-devel libcurl-devel gtk3-devel\
vte3-devel lm_sensors-devel libxklavier-devel libexif-devel\
libetpan-devel gnome-menus-devel alsa-lib-devel libical-devel\
upower-devel libzeitgeist-devel
Untar the packages and build with the commands described there except that you need to force the lib64 in both main and plugin builds with:
cmake .. -DCMAKE_INSTALL_PREFIX=/usr -DFORCE_LIB64=yes

Installing svgcairo on windows

I have managed to install cairo, but when I run cabal install svgcairo I get the following error:
setup.exe: The pkg-config package librsvg-2.0 version >=2.16.0 is required but it could not be found.
I'm on windows 8 x64, with cabal version 1.16.02 and ghc 7.6.3.
You need to install librsvg in a location that ghc can find first. Check out http://librsvg.sourceforge.net/download/ for downloads, but you might have to build it from source yourself, which is beyond the scope of this answer. Then just make sure that wherever you've installed the library is on your path and that pkg-config can find it, and you should be good to go.

Installing Qt on linux, cannot find -lGL

I'm having a hard time trying to install Qt on linux. I downloaded the .run file on the website and installed Qt. However, when I try to compile the default Hello World project using Qtcreator, I get the following :
error cannot find -lGL
I was able to solve the problem by issuing the command :
sudo apt-get install libqt4-dev
But, I'm not satisfied with the solution as I want to use Qt5 and the name of the lib I downloaded implies version 4. Can someone explain what is going on and tell me if my solution is correct? If not, what should I do to get a working Qt on Linux.
Additional question
The correct answer, as provided by LtWorf, was to install libgl-dev. For future problems of this sort, can someone tell me how I should have guessed that I had to download this particular library? And why are there some libs with -dev at the end? What do they provide?
Well it is trying to link with libgl and doesn't find it. You should install libgl-dev.
-l is a linker option, it tells the linker to use a certain library.
For example you can have -lmagic meaning that you want to use libmagic.
Normally all libraries are called libsomething, and on debian you will find 3 packages called:
libsomething
libsomething-dbg
libsomething-dev
The 1st one is the library, the second one is the library compiled with the debug symbols, so you can make sense of stacktraces more easily, and the final one is the development package, it contains the .h files so you can link to the library.
sudo apt-get install libgl-dev
On Fedora 17, I did:
sudo yum install mesa-libGL-devel
Do you have libgl-dev installed? If not install it and it should work.
Those other posters are correct, but on some systems, the lib to install is named differently. I just dealt with a 32bit Ubuntu 14.04.5 LTS system, and libgl-dev was not available.
Instead, I needed to install the libgl1-mesa-dev package via:
sudo apt-get install libgl1-mesa-dev

Resources