how to specify path to usr/lib of a specific machine in makefile?
I am using some libraries installed at my local machi开发者_JAVA百科ne in directory /usr/lib/. I want to run my program on another machine where the same libraries are installed but other version. How can I specify the path that the program runs on another machine but the libraries are used from my computer ?
Thanks
Secure shell does not provide a service for finding binaries and libraries on the originating machine and running them on the remote machine (or indeed the other way 'round).
You will need to deploy the executable.
I'd suggest:
- Compile on you home machine, linking the desired libraries statically. The static link is critical. You may need to read your compiler documentation to make this happen.
- Copy the resulting binary to the remote machine (perhaps using
scp
). - Ssh to the remote machine and invoke the statically linked binaries.
- ???
- Profit.
Of course, this will only work if the two machines share a processor architecture and common executable format. That means, that linux-to-linux will work, and linux-to-some-other-unixy-OS might work (try a.out executable format), and linux-to-windows certainly won't work.
well for that to be possible, your machine should be connected to a network which should be connected to all other machines.. and in your script, where you specify where to get the libraries from say /usr/lib....instead give your IP ADDRESS first and append the /Machintosh HD/usr/lib...i.e if your ip address is 192.168.2.4, then instead of giving /usr/lib, give
//192.168.2.7/Machintosh HD/usr/lib/codeorlibraryfile
if ur not connected to a network, this wont work other wise i dont see a reason this not working... check the "//" i m not sure in start if "\" will come or "//"..
hope this helps
精彩评论