Closed GiovanniBussi closed 1 month ago
In the latest version (dfe0657) I changed the behavior of plumed mklib
so that the makefile-way of working should be explicitly enabled with a -n
flag (by analogy with mv -n
). In this way:
plumed mklib file.cpp
works as it was working on v2.9, that is it overwrites file.so
. This is safer, when there are multiple versions of plumed installed on a system, since it is sufficient to call plumed mklib
without the need to previously remove the file.so
fileLOAD FILE=file.cpp
calls plumed mklib -n -o file.2.10-dev.so file.cpp
, which does not overwrite existing libraries (-n
), so as to work in multithread contexts, but add a version suffix.
Description
The
plumed mklib
script in v2.10 works as a makefile, so that if a .so is already present it is not recompiled. This is necessary for thread safety. This however causes a problem in the plumed nest where the .so file produced by v2.9 is not regenerated when using master. One possible solution is to encode the version name in the .so file.With this PR, when using
A
.so
file will be generated with namefile.2.10-dev.so
.Notice that the change is apparent only when using
LOAD
, and not when usingplumed mklib
directly. In other words:will still generate a file named
file.so
.I did it in this way, which is completely transparent to users. Indeed, the
.so
file created byLOAD
is a temporary that is never explicitly mentioned by the user. However, it would also be possible to encode the version directly in every use ofplumed mklib
, which I think is what python does when compiling extensions. This would however create problems if someone uses scripts such as:Target release
I would like my code to appear in release v2.10