What to do when /lib or /usr/lib has a folder with cmake files? Installing pre-reqs for a program.
Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
What to do when /lib or /usr/lib has a folder with cmake files? Installing pre-reqs for a program.
I'm trying to build gmsh from source so I can use all the extra functionality, like PETSc, openMPI, openBLAS, etc...
[XY Problem Awareness]
I guess I'm doing the XY problem. I've come back to the top here and labeled [X], [Y] after writing most of this. Hopefully this partially explains why it's all over the place.
[X]
I want to install a solid FEM/FEA program and I chose gmsh with onelab, getDP, PETSc. Those aren't standard and so I'm building from source. Being new to linux, I don't know whether or not a library (fltk here, but there are others) is installed as PIC, I'm confused by the fact that APT shows it installed but the fltk directories in /lib/fltk and /usr/lib/fltk are filled with cmake files:
git clone https://github.com/fltk/fltk.git
cd fltk
mkdir build
cd build
# Notes:
# * by default FLTK is compiled as a static library, which has been reported to cause issues with OpenGL libraries on some systems; to build a shared library, add -DOPTION_BUILD_SHARED_LIBS=ON
# * if you don't have root access, add -DCMAKE_INSTALL_PREFIX=path-to-install
cmake -DCMAKE_POSITION_INDEPENDENT_CODE=ON ..
make
sudo make install
# Notes:
# * if you don't have root access, remove "sudo"
I tried configuring fltk using cmake gui but I don't know where the source code is (I'll bet I find a src directory if I look) but I'm not sure that's even the right way to do this. It doesn't seem like it.
So before I break anything, I am here asking for help/education.
What should I do when I think I need to recompile something that is likely used by the OS and change an option so I can use it in a different program?
the source is what you get with that git clone command (I think). The cmake files belong to the build system, not to the final "product". cmake gui will configure the build system, you need to [re]build the software after [re]configuration.
You can build whatever you want, that won't harm your system (don't do it as root), just don't replace the official version.
I'm confused by the fact that APT shows it installed but the fltk directories in /lib/fltk and /usr/lib/fltk are filled with cmake files:
Those are development files, put there by the libfltk1.3-dev package. You can confirm this with "dpkg-query --search /usr/lib/fltk/*"
To confirm the files in the main library, you can, use "dpkg-query --listfiles libfltk1.3" - there should be a libfltk.so file listed.
You can also use "dpkg-query --list '*fltk*'" to show the status of packages dpkg knows about.
(If you're unfamiliar with dpkg vs apt, dpkg is the low-level package management software; whilst apt is [intended as] the user-friendly front-end to it.)
Quote:
I ran
Code:
sudo apt list --installed | grep fltk
You don't need sudo or grep here - apt only needs super-user access when making changes, not for listing information, and the list command accepts a pattern - so "apt list --installed '*fltk*'" is enough.
One should never download (clone) an app into a system directory which your description seems to indicate may have been done.
I always do a git clone into a directory under my users home, do the compile as my user, then the install only of the compiled files (done with the make or cmake).
This process prevents damage to the system directories as well as ensuring the cruft of the text files used for compile is not placed into those directories.
I made a different post that asked the question a different way. In that post I asked if installing the differently compiled libs in my directory and changing the path when installing my target. How to do that is beyond my level of knowledge. I assume, as I wrote, that changing the path would suffice.
Setup a safe environment to experiment in: i.e. a VM, or a second system that it doesn't matter if you break and have to delete and reinstall from scratch.
Not being root and not using sudo adds a layer of protection, but it does NOT stop a system being harmed; a wrong command can still wipe out a home directory, which for many people is a bigger pain. (What's the current state of your backups...?)
Quote:
I want to install a solid FEM/FEA program and I chose gmsh with onelab, getDP, PETSc.
None of these terms mean anything to me, but if they are available in your repo's repositories, then make sure you get the source code from your repo's source repositories, and check the provided documentation.
Even though you want to compile with different options, starting with a known working setup - one that includes any Debian/Ubuntu-specific fixes already applied - is the sensible thing to do.
If the only repository is a separate one, be aware that any "Linux" instructions may not match the right way for your specific distro - whilst instructions for Debian will work on Ubuntu, the reverse is not always true, and instructions for Arch or RHEL or others can be completely different.
If there isn't relevant documentation, asking on the forums or mailing lists for the project may get better answers - even if they don't know how a different distro does something, they can inform what a command/script intends to do, which then allows finding the equivalent.
I tried configuring fltk using cmake gui but I don't know where the source code is (I'll bet I find a src directory if I look) but I'm not sure that's even the right way to do this. It doesn't seem like it. [/QUOTE]
Did you try it with the static libraries? The warning says you *may* have trouble, on *some* systems. You may not to rebuild.
If you do need to rebuild, there is no need to mess with the cmake gui. Go to the build directory for fltk, and do
I would get the source package from Debian and look at the necessary files, they may have used more options.
While you're at it, why not find out how to build the package after you make the modification? This way the files will be tracked by APT. I use Fedora and openSuSE, and when I find a package that doesn't have an option I need, I grab the source package, make the modifications, and build the package.
Of course that may be deeper than some people want to go, but I like my system applications and libraries tracked. This avoids future collisions and problems.
That warning also hints at an installation for your user. So, if you don't want to mess with the system installation, something like
Where <path-to-install> is, say, /home/user/lib/fltk. That gets kind of messy though and can lead to all kinds of conflicts with the system installed libs. Then you must make sure to build gmsh pointing to your personal lib dir. You ready for headaches tracking down issues?
Last edited by goumba; 12-16-2023 at 04:03 PM.
Reason: Added debian wiki reference.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.