Which Directory Should You Run Configure Again
Troubleshooting ./configure, make and make install Tutorial
- Configuration Management, Programmer, Linux
Sometimes, the typical sequence to compile a plan doesn't piece of work. Information technology starts spitting out all kinds of errors and seems to do everything but compiling that annoying programme already. What to practise then? This tutorial describes how to get rid of many oft occuring errors during a typical Linux compiling sequence. Note: You should but compile software when you actually demand to do information technology. Compiling tin can be dangerous to your Linux installation. If y'all desire to install some software, please look for a precompiled package (like a .rpm or a .deb) beginning. If yous really demand to compile, practise it with care. Note: This tutorial assumes that y'all take some linux command line knowledge and that you know how to work with your distro's package manager.Nosotros tin carve up the errors in 3 categories:
- ./configure errors
- make errors
- make install errors
It should be quite obvious how to recognize them: ./configure errors are outputted past the configure script, make errors by the make control and so on. I'll now list common errors, with solutions, in these three categories.
./configure errors
The following listing contains some common errors that ./configure can give, sorted by frequency of appearance. The first one is the most occuring i. Things between ( and ) are optional, they do non always appear. A assuming italic OR indicates that multiple errors have the same solution. Text between < and > describes the kind of string that should announced on that place.
- (configure:) (mistake:) <somename> (<someversion> (or higher)) not found. (Delight bank check your installation!) OR checking for <somename>… (configure:) (fault:) not found. OR (configure:) (mistake:) <somename> (<someversion> (or newer)) is required to build <packet-you're-trying-to-compile>
- This commonly ways that the -dev or -devel version of the package with the name <somename> is non installed on your figurer. Please use your distro's packet manager (or any other method to find and install packages) to search for <somename> and install, if possible, the -dev or -devel version.If the -dev or -devel version is already installed, or if it doesn't exist, have a expect at the version number currently installed. Is it high enough? If information technology is lower than <someversion> (if applicable), endeavour upgrading the parcel. If that is non an choice for you, you can likewise try compiling an older version of the package y'all're trying to compile. Older releases generally use earlier version of the libraries / programs they depend upon.If the bundle that ./configure cannot find is a library (usually indicated by the package name being lib<something>), and you're certain you've got the right version installed, effort to find the location where the library's files are located. If this directory is not included in your ld conf file (which is usually located at /etc/ld.conf or /etc/ld.so.conf) you should add together it, and run ldconfig (normally located at /sbin/ldconfig). Delight note that ldconfig should normally be executed with root permissions. If you don't know how to practise that, have a look at the start signal of Make install errors.Notation: If you don't accept access to the ld conf file, y'all can also add the directory to the LD_LIBRARY_PATH variable. This is pretty ugly and not quite the all-time practice, just sometimes yous don't have whatsoever other options. You can add the directory to LD_LIBRARY_PATH this mode:
[rechosen@localhost ~]$ consign LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/your/library/directory"
Of course, replace /your/library/directory with the applicable directory in your case. Note that the LD_LIBRARY_PATH volition also take to hold /your/library/directory when running the program yous compiled.
- This commonly ways that the -dev or -devel version of the package with the name <somename> is non installed on your figurer. Please use your distro's packet manager (or any other method to find and install packages) to search for <somename> and install, if possible, the -dev or -devel version.If the -dev or -devel version is already installed, or if it doesn't exist, have a expect at the version number currently installed. Is it high enough? If information technology is lower than <someversion> (if applicable), endeavour upgrading the parcel. If that is non an choice for you, you can likewise try compiling an older version of the package y'all're trying to compile. Older releases generally use earlier version of the libraries / programs they depend upon.If the bundle that ./configure cannot find is a library (usually indicated by the package name being lib<something>), and you're certain you've got the right version installed, effort to find the location where the library's files are located. If this directory is not included in your ld conf file (which is usually located at /etc/ld.conf or /etc/ld.so.conf) you should add together it, and run ldconfig (normally located at /sbin/ldconfig). Delight note that ldconfig should normally be executed with root permissions. If you don't know how to practise that, have a look at the start signal of Make install errors.Notation: If you don't accept access to the ld conf file, y'all can also add the directory to the LD_LIBRARY_PATH variable. This is pretty ugly and not quite the all-time practice, just sometimes yous don't have whatsoever other options. You can add the directory to LD_LIBRARY_PATH this mode:
- (configure:) (error:) cannot find header (file) <somename>.h OR (configure:) (error:) (header) (file) <somename>.h missing! OR <similar>
- The configure script tin can't notice a .h file required for compilation. This error is similar to the one above, as information technology requires you to install the -dev or -devel version of a sure bundle. Notwithstanding, it is usually less clear which bundle should be installed, as <somename> can be a very generic name. Try searching the web for <somename>.h to find out which package it belongs to, then try installing that bundle (including its -dev or -devel version, if bachelor) using your distro's package director.
- (configure:) (mistake:) no acceptable cc found in <somedirectories>
- Your gcc installation is either missing or the CC environment variable is not set. Bank check if the packet gcc is installed, using your distro'due south package manager. If it isn't, install it. If information technology is installed, however, effort using this control:
[rechosen@localhost ~]$ export CC="/usr/bin/cc"
If that worked, you can add together the command to your /etc/contour (a file total of commands that are executed whenever any user logs in) then you won't have to set information technology again.
- Your gcc installation is either missing or the CC environment variable is not set. Bank check if the packet gcc is installed, using your distro'due south package manager. If it isn't, install it. If information technology is installed, however, effort using this control:
- (configure:) (error:) C++ preprocessor "/lib/cpp" fails sanity check
- Your k++ package is either missing or corrupted. Please use your distro's packet manager (or whatever other method to observe and install packages) to search for one thousand++ and install the corresponding parcel. Notation that quite some distro'southward practice non phone call the package thou++. Fedora, for example, uses the packagename gcc-c++ in its yum repositories. If you lot can't notice g++, try searching for c++, cpp and/or gcc.
- (configure:) (fault:) C++ preprocessor "CC (-E)" fails sanity bank check
- This is caused past a foreign bug in certain versions of libtool that makes the configure script bank check for all compilers supported by libtool. The quickest solution is to install g++ (come across the solution above this 1).
Make errors
Every bit make errors commonly are besides specific to make a prissy list of generic ones, I will give you a list of general things to practise that might help:
- If you're compiling using gcc iv (utilise gcc -dumpversion to find out), try using an older compiler version. Get-go, brand sure that some older version is installed. This tin can unremarkably be detected this way:
[rechosen@localhost ~]$ ls /usr/bin/gcc*
If that returns something like this:
/usr/bin/gcc /usr/bin/gcc32
Then you tin use, in this instance, the gcc32 control to compile with an older gcc version. If not, try using your distro'southward bundle director to search for older versions of gcc (usually called something like compat-gcc or gcc-<versionnumber>). After installing, y'all should be able to detect the alternative gcc version using the ls command above. Tell the ./configure, brand and make install sequence to use the older gcc version in a manner like this:
[rechosen@localhost ~]$ CC="/usr/bin/gcc32″ ./configure[rechosen@localhost ~]$ CC="/usr/bin/gcc32″ make[rechosen@localhost ~]$ CC="/usr/bin/gcc32″ make install
Note: in nigh cases, you can leave the /usr/bin away and just put the gcc executable name. However, some non-standard Makefiles might handle it in a unlike style. Therefore, including the full path is the safest option.Of course, replace the /usr/bin/gcc32 with the location of your alternative gcc control.
- Sometimes make errors are just caused by a plain bug. Try obtaining the latest development version of the software (using their cvs, svn or similar repository, or by downloading a nightly snapshot) and try compiling that one to see if they fixed the issues at that place.
- Make errors tin can likewise be caused past having incorrect versions of certain libraries / programs. Particularly very new and very quondam packages endure from this problem. Take a wait at the dependencies of the parcel (they are commonly listed somewhere on the site of the software) and compare the version numbers there with the version numbers on your own computer (they can usually be plant using the search function of your distro's bundle managing director). If the version numbers on your system are way higher than the ones on the packet'due south site, you are probably trying to compile a very one-time package. If you really demand to compile information technology, endeavor downgrading the dependencies. Notwithstanding, it commonly is a better selection to search for an other way to install the parcel or to await for an alternative. If the version numbers on your system are way lower than the ones on the bundle's site, you are either trying to compile a bleeding-edge package, or your distro is quite quondam, or both =). You could try updating the required libraries / programs or compiling an older version of the program. Too, have a expect if a overnice package made for your distro of the programme exists. Installing such a bundle is usually easier than trying to deal with compilation errors.
- Another affair to effort is searching the spider web for your specific fault. If you don't discover annihilation useful, try stripping abroad things like line numbers (they can change with versions), version numbers (y'all tin supervene upon them with an asterisk if they are contained in (file) names) and not-alphanumerical characters like quotes, as they influence the search engine's seeking. You can usually find a lot of information on mailing lists. Sometimes, a patch is provided that will set the source code. Patches can be applied this manner:
[rechosen@localhost ~]$ patch -Np1 -i <patchfile>
Note that you will need to be in the source directory to apply a patch.
Make install errors
These errors unremarkably are quite piece of cake to empathise, simply I'll document them anyway. At that place are two frequent causes that'll terminate you from succesfully using make install:
- You do not have root permission. Endeavour running make install using sudo or endeavour becoming root using su. Sudo should be used this way:
[rechosen@localhost ~]$ sudo make install
It will inquire for a password; this usually is either your own password or the system root password. You can utilise su to get root this manner:
[rechosen@localhost ~]$ su
This command will besides inquire for a countersign, merely it e'er is the organization root countersign. Afterwards becoming root, merely run make install as yous'd practice normally. And after that, don't forget to return to your normal user once again if you used su. Y'all can do this by pressing Ctrl + D or, if that didn't piece of work, typing 'exit' or 'logout' and then pressing enter. All the same, this is only recommended if yous became root using su. The sudo plan only runs a command with root permissions, it doesn't log you lot in as root.
- The package you just compiled doesn't have the install target. In this case you will have to re-create the compiled binaries to a bin directory yourself. If you exercise an ls in the source directory, executable files should appear low-cal-green. These files could be copied to /usr/bin (or /usr/local/bin, if you prefer) in a way similar this:
[rechosen@localhost ~]$ cp <executablefile> /usr/bin
However, this will make a mess of your /usr directory if you use it too much. You lot could also add the directory in which the executable is located to your PATH variable. Get to the directory, get the whole path of it this way:
[rechosen@localhost ~]$ pwd
Then paste the output of pwd into this command:
[rechosen@localhost ~]$ export PATH="$PATH:<pwdoutput>"
If you can just run the control now, it worked. Add the export command you ran to your /etc/profile, so yous won't have to type it again.I hold that this isn't really a clean and easy way, but sometimes developers don't have the time to create a (proper) install target. Nosotros should not be angry with them: recall of all the work they exercise to let u.s.a. savour useful and/or funny programs =).
Other problems
Here is a list of some other full general problems, with solutions:
- Everything went alright, only when I type the command I only installed bash says it cannot exist constitute. This is usually caused past brand install installing everything in /usr/local or in /opt/<packagename>. Have a look at the output of brand install: where did it re-create the files to? Try adding the bin directory of that location to your PATH variable (the following instance assumes the package was installed to /usr/local):
[rechosen@localhost ~]$ consign PATH="$PATH:/usr/local/bin"
Yous tin just replace /usr/local/bin with the bin directory in which the executables of your parcel were installed. If this works, add together the line to your /etc/profile so y'all won't have to type this again and once more. By the way, you can control the place in which the package volition exist installed by specifying this option when running the configure script:
[rechosen@localhost ~]$ ./configure –prefix=/usr
Supplant /usr if necessary with the directory in which you'd like to accept the parcel installed. Note that yous are only setting the prefix; the binaries will be installed in a subdirectory of the prefix, just similar the libraries, header files and so on. When using the higher up prefix, for example, you volition find the binaries in /usr/bin.
- I want to install a very old version of a parcel, but I can't discover the source archive of it on the net. You all the same take a pocket-size chance. Try searching for rpm'southward of the version you desire and download the corresponding src rpm. Unpack information technology this way:
[rechosen@localhost ~]$ rpm2cpio <rpmfile> | cpio -idv
Now, use the source file that should accept been extracted from the source rpm.
Final words
This tutorial is not finished yet. I plan to update it every now and so with solutions to requests from users. Therefore, I ask y'all to comment on it and say what y'all'd similar to run across documented in information technology. Remember that this tutorial is about generic troubleshooting. Don't ask me how to brand a sure version of a certain programme compile. Anyway, I hope this tutorial has been useful to you lot. Thanks for reading and skillful luck with that immersively complicated thing called compiling!
Recommended
Go more than insights, news, and contrasted awesomeness effectually all things cloud learning.
Source: https://acloudguru.com/blog/engineering/troubleshooting-configure-make-and-make-install-tutorial
0 Response to "Which Directory Should You Run Configure Again"
Post a Comment