0

I have a project in c++ running very well on ubuntu on my local pc, I did copy the folder project to the server using Globus to run it there but when trying to run it there, I have this error message:

error while loading shared libraries: libboost_program_options.so.1.67.0: cannot open shared object file: No such file or directory

Despite the fact that the same project is running very nicely on my pc

How can I solve this error?

e. sfe
  • 11
  • You need to install boost (in particular the boost-program-options part) on the server. Did you do so? And did you compile the program against the same version of boost? – walnut Nov 05 '19 at 04:36
  • @uneven_mark, i did compile and run sucessfully on my local pc the program and i did copy the whole project with the libraries to the server. Should i do a compile in the server also? And In which directory of the server should i install boost ? – e. sfe Nov 05 '19 at 04:42
  • boost should be installed through the distribution's package manager (e.g. `apt-get` for ubuntu), if you didn't compile it yourself manually. How to install depends on the distribution the server is running. If you want the program to be portable without having to install libraries on the target system, you need to compile with the `-static` flag. – walnut Nov 05 '19 at 04:44
  • Compiling the program on the target machine would be preferred, because it will avoid library mismatches such as this. – walnut Nov 05 '19 at 04:47
  • @uneven_mark, to compile with the -static flag is done like this: make -static? – e. sfe Nov 05 '19 at 14:57
  • No, if you are using make, it belongs into the CFLAGS / CXXFLAGS environment variable(s). This is not guaranteed to work smoothly, especially if the Makefile is non-trivial. The better solution is to compile directly on the target. – walnut Nov 05 '19 at 15:24
  • @uneven_mark,i tried to run cmake .. on the target, but i got this error message: "CMake Error: The current CMakeCache.txt directory /home/eli93/spma/build/CMakeCache.txt is different than the directory /home/elie/spma/build where CMakeCache.txt was created. This may result in binaries being created in the wrong place. If you are not sure, reedit the CMakeCache.txt CMake Error: The source "/home/eli93/spma/CMakeLists.txt" does not match the source "/home/elie/spma/CMakeLists.txt" used to generate cache. Re-run cmake with a different source directory." is there any easy way to solve for this? – e. sfe Nov 05 '19 at 15:53
  • If you are using cmake (not only make as your previous comment suggests), then you need to run `cmake .` in the project directory to recreate the Makefile. If you are trying to add the static flag with cmake, [follow this](https://stackoverflow.com/questions/24648357/compiling-a-static-executable-with-cmake). – walnut Nov 05 '19 at 15:55
  • @uneven_mark Okay but how can i solve the user mismatch because in my local environment it is /home/elie/spma/build whereas in the server it is /home/eli93/spma/build, what can be an easy way to to solve for the user mismatch betweeen eli93 and elie? – e. sfe Nov 05 '19 at 16:35
  • Maybe [this](https://stackoverflow.com/questions/35784700/cmake-error-when-building-opencv-cmakelists-not-match) helps? If not you should probably open a question specifically about the cmake issue. – walnut Nov 05 '19 at 17:17

0 Answers0