0

I need to run C++ application that I build on my local developer Linux machine(Ubuntu 14.04) under VirtualBox on Linux server(Ubuntu 12), the problem that application have lots of dependencies and I don't have sudo on that server, so I can't do something like sudo apt-get install <libname-dev>.

I use ldd to figure out what libs are missing on server.

For example:

libopenblas.so.0 => not found
liblapack.so.3 => not found

Than I copy this libs from my local machine /usr/lib/ to server near application and than create symbolic links by hand.

Files to copy:

liblapack.so.3.0
libopenblas.so.0

Links to create:

liblapack.so.3
libopenblas.so
  1. Is it bad idea to do this kind of trick, will it always work?
  2. I wonder about Linux .so naming conventions, what is the meaning of .so.3.0, .so.0, etc. ?
mrgloom
  • 20,061
  • 36
  • 171
  • 301
  • Those are versions, and if you build your program against version X and run against version Y – n. m. could be an AI Sep 27 '16 at 14:18
  • Your trick is in fact a bad idea, the hint being that you have clearly two different operating systems with likely different libraries that might or might not work. So, you probably will get lucky, but no, it will not necessarily work. Even if it appears to run, there may be a latent crash awaiting your execution of a particular library call. As to the numbering system, I just saw mention of semver.org, an authoritative and clear writeup. Docker might be appropriate. – John Griffin Sep 28 '16 at 01:40

1 Answers1

1

recompile on another Ubuntu 12 and link the missing lib's statically. e.g:

gcc -lsome_dynamic_lib code.c some_static_lib.a
Danny
  • 1,603
  • 1
  • 15
  • 25
  • What is the proper way of getting these static libs for Server Linux if I can't `sudo apt-get install`? – mrgloom Sep 28 '16 at 09:45
  • use another server where you have sudo access, or spin of one on digitalocean.com or whatever VPS provider or use docker and pull an ubuntu12 image. – Danny Sep 28 '16 at 09:51