I have to develop C++ programs that have to run on Scientific Linux 5 or 6. I would like to develop with QtCreator on Ubuntu which has much more recent libraries than the one found on SCL6.
Is there an equivalent of Python's virtualenv for C/C++ programs ?
Using a chroot with all the required libraries and dependencies could do the job. Does this exist ? See http://rcrowley.org/articles/dependencies.html on the use of chroot.
Use debootstrap to create the chroot environment (or even install ubuntu on a separate partition). Mount your home dir with mount -o bind. Use schroot convenient chroot setup.
http://manpages.ubuntu.com/manpages/precise/en/man8/debootstrap.8.html
http://manpages.ubuntu.com/manpages/precise/en/man8/mount.8.html
http://manpages.ubuntu.com/manpages/precise/en/man1/schroot.1.html
You can use tools below:
Not sure it is lightweight enough for what you need (I'm not very familiar with virtualenv) but you can try the CDE Project which is a very nice way of creating a virtual sandbox with all kinds of dependencies.
You can establish the dependencies and the compiler for a given project using a build system like bazel (https://bazel.build/) or please (https://please.build/).
It will never be the same exact as a virtualenv, due to the different nature of the language, and since it will still be using the system compiler. In case you want to have your project completely isolated, you can ship the project on a docker container.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With