Wednesday, May 8, 2024
 Popular · Latest · Hot · Upcoming
2
rated 0 times [  2] [ 0]  / answers: 1 / hits: 497  / 3 Years ago, wed, may 19, 2021, 5:06:50

I am a noob with linux and I use Synaptic package manager to install all the software I need. I did so also for mathgl, the library for scientific graphs.



Recently a new version appeared online, but not in the package manager. I downloaded the sources and tried to install it manually. The instructions said:



cmake .
cmake .
make
make install


I did exactly the same, but then I realized that I forgot some build options. I did a web search to find a way how to uninstall the library, so that I can install it with the new settings, but I did not get a clear answer. What I found out is that when it comes to uninstalling under Linux, unless the developer provided an uninstall script, you are on your own and it is not trivial.



With this in mind I just tried to install the library without removing the misconfigured one.



cmake -D enable-all=on -D enable-langall=on .
cmake -D enable-all=on -D enable-langall=on .
make
make install


Everything seems to be fine. My question is this: is there any chance that the consequence of my action will come back to haunt me?



I am also concerned, because the old library was not removed as well as the old headers. Another strange thing is that the old headers are in



/usr/lib/mgl


while the new ones are in



/usr/local/lib/mgl2


Is there any explanation for this?


More From » 12.04

 Answers
3

is there any chance that the consequence of my action will come back to haunt me?




Maybe. Read on:




  • The new ("enable...:) configured libraries have overwritten the new misconfigured libraries you installed...no harm done.


  • The new libraries are installed under /usr/local because that's the default for a lot of Linux distributions, but not Ubuntu; Ubuntu puts them under /usr. The former is OK for binaries (/usr/local/bin), which Ubuntu has in its default path, and those will take precedence over any binaries installed in /usr/bin, but this is not true for libraries, because /usr/local/lib is not in the default path.


  • Any programs that use this library will continue using the older headers/version in /usr/lib, unless you specifically tell those programs to use the new ones, e.g. by prefixing them with LD_LIBRARY_PATH=... or by explicitly adding /usr/local/lib to your path. For compiling things which depend on this library, you'll need to explicitly specify the /usr/local/lib path to include the new headers.


  • To fix this:




    1. It's a good idea to remove the repo-installed version of the library, unless it has lots of dependencies, in which case leave it be (or you'd have to recompile the lot).

    2. Install checkinstall, which you can use instead of the final make install step to give you a deb file that is easy to install and uninstall.

    3. Set the correct install prefix via the -DCMAKE_INSTALL_PREFIX=/usr directive before compiling.




That should do it!


[#37474] Thursday, May 20, 2021, 3 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
zebrla

Total Points: 356
Total Questions: 110
Total Answers: 120

Location: Sudan
Member since Tue, Aug 3, 2021
3 Years ago
;