-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
18 changed files
with
147 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
2.11.0 | ||
2.11.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
Building modules out of tree {#outoftree} | ||
============================ | ||
|
||
Normally to build an %IMP module it is placed in the `modules` subdirectory | ||
together with the rest of the %IMP source code and then all of %IMP is | ||
built, as per the [installation instructions](@ref installation_source). | ||
However, this makes builing a module an expensive process (as the build | ||
system needs to check whether any part of %IMP has changed, not just the | ||
module itself) and it is awkward to build a module against multiple | ||
versions of %IMP, for example against both the latest stable release and | ||
a more recent nightly build. | ||
|
||
An alternative is to build one or more %IMP modules 'out of tree', treating | ||
them as their own [CMake](https://cmake.org/) projects in their own | ||
directories, and pointing them to existing %IMP installation(s) using | ||
%IMP's [existing CMake configuration](@ref uselibrary). | ||
|
||
## Module layout | ||
|
||
Out of tree modules can be maintained in one of two ways: | ||
|
||
1. A top-level `modules` directory containing a number of subdirectories, | ||
one per module; the name of each subdirectory is the name of the module. | ||
This mimics the way %IMP itself maintains multiple modules. | ||
2. All of a single module's files can be placed in the top-level directory, | ||
as is done for the [PMI](https://github.com/salilab/pmi/) module. This | ||
has the advantage that the module can also be cloned directly into | ||
%IMP's `modules` directory and built 'in tree', as well. | ||
|
||
## CMake configuration | ||
|
||
Place the [FindIMP.cmake](https://github.com/salilab/pmi/blob/develop/tools/FindIMP.cmake) | ||
file into a suitable directory, say a `tools` subdirectory. This file will help | ||
CMake to find the %IMP installation, as [described earlier](@ref uselibrary). | ||
|
||
Make a top-level `CMakeLists.txt` file. This file | ||
- Adds the `tools` directory to the CMake search path, so that CMake can | ||
find %IMP; | ||
- Finds the %IMP package; | ||
- Uses the `imp_build_module` CMake macro, provided in %IMP's CMake | ||
configuration, to build the module; | ||
- For the single module case, detect an 'in tree' build and fall back to | ||
using %IMP's own CMake scripts. | ||
|
||
A suitable `CMakeLists.txt` can be found in the | ||
[PMI repository](https://github.com/salilab/pmi/blob/develop/CMakeLists.txt) - | ||
all that needs to be changed is `CMAKE_MODULE_PATH` (if `FindIMP.cmake` was | ||
not put in the `tools` directory) and the second argument to | ||
`imp_build_module`, which is the module name. (If multiple modules are | ||
being built under the `modules` directory, this second argument should | ||
be omitted - the module names will match those of the subdirectories.) | ||
|
||
## Building | ||
|
||
The module can now be built like any other CMake project - i.e. make a | ||
build directory, and run CMake in that build directory, giving it the | ||
path to the module source code. (You may need to set the `IMP_DIR` variable | ||
to help CMake find %IMP.) | ||
|
||
## Testing and running | ||
|
||
After a successful build, the build directory will contain a | ||
`setup_environment.sh` script. This can be used just like that in %IMP | ||
itself. It will add both the out of tree module(s) and %IMP to the search | ||
path so that the module can be tested or used. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
from __future__ import print_function | ||
import IMP | ||
import IMP.test | ||
import IMP.atom | ||
|
||
|
||
class Tests(IMP.test.TestCase): | ||
|
||
def test_mass(self): | ||
"""Check Mass decorator""" | ||
m = IMP.Model() | ||
p1 = IMP.Particle(m) | ||
p2 = IMP.Particle(m) | ||
# Set up using mass value | ||
m1 = IMP.atom.Mass.setup_particle(p1, 1.0) | ||
self.assertAlmostEqual(m1.get_mass(), 1.0, delta=1e-4) | ||
m1.set_mass(2.0) | ||
self.assertAlmostEqual(m1.get_mass(), 2.0, delta=1e-4) | ||
# Set up using other particle | ||
m2 = IMP.atom.Mass.setup_particle(p2, m1) | ||
self.assertAlmostEqual(m2.get_mass(), 2.0, delta=1e-4) | ||
|
||
|
||
if __name__ == '__main__': | ||
IMP.test.main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -487,6 +487,9 @@ find ${RPM_BUILD_ROOT}%{_prefix}/share/IMP/tools -name '*.py' -exec perl -pi -e | |
%endif | ||
|
||
%changelog | ||
* Thu Jul 18 2019 Ben Webb <[email protected]> 2.11.1-1 | ||
- 2.11.1 release. | ||
|
||
* Tue Jun 25 2019 Ben Webb <[email protected]> 2.11.0-1 | ||
- 2.11.0 release. | ||
|
||
|