lorenzo-rovigatti / oxDNA

A new version of the code to simulate the oxDNA/oxRNA models, now equipped with Python bindings
https://dna.physics.ox.ac.uk/
GNU General Public License v3.0
43 stars 28 forks source link

[BUG] CMake sets fixed path to libcommon.so in build directory / name complicates system-wide installation #33

Closed cgevans closed 2 years ago

cgevans commented 2 years ago

In trying to install oxDNA system-wide on a few computers (one Debian, one ArchLinux),

When linking, cmake sets a fixed, absolute RPATH to the build/src/ directory, wherever that is at the time of building, in the oxDNA executables. As a result, they will not be able to find libcommon.so (or libcommon-debug.so) if the build directory is later moved, or is inaccessible to the user (eg, if it's in another user's home directory). The RPATH could simply be removed, and libcommon.so placed in a directory on the system's library path, but in that case, the name of the library is not well-suited to a system library directory like /usr/lib.

Would you consider changing the name of libcommon.so to something like liboxdna_common.so? I've experimented with doing this on my AUR package for oxdna, and it seems to work. I'd be happy to create a PR for this if it would be helpful.

I expect that most users are not doing system-wide installations of oxDNA, and this is why cmake is not set up to install everything itself; an alternative here would be to set that up, but just renaming the library seems to be enough to let me package everything simply without changing the build process.