Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
Plumed AlphaFold
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Martin Kurečka
Plumed AlphaFold
Commits
1419b2cd
There was an error fetching the commit references. Please try again later.
Commit
1419b2cd
authored
7 years ago
by
Giovanni Bussi
Browse files
Options
Downloads
Patches
Plain Diff
fixed documentation
parent
971a5078
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
developer-doc/plmdIntro.md
+30
-5
30 additions, 5 deletions
developer-doc/plmdIntro.md
with
30 additions
and
5 deletions
developer-doc/plmdIntro.md
+
30
−
5
View file @
1419b2cd
...
...
@@ -462,8 +462,8 @@ of code that uses the boost graph library:
#endif
\e
ndverbatim
Here the ifdef __PLUMED_HAS_BOOST_GRAPH ensures that this part of the code is only compiled when the
-D__PLUMED_HAS_BOOST_GRAPH flag is set at compile time.
Here the
`#
ifdef __PLUMED_HAS_BOOST_GRAPH
`
ensures that this part of the code is only compiled when the
`
-D__PLUMED_HAS_BOOST_GRAPH
`
flag is set at compile time.
This example is a bit of a special case as the particular PLMD::Action I took this example from both when the
library is available and when it is not. Obviously, if your PLMD::Action does not work without the library
...
...
@@ -476,12 +476,14 @@ with your new functionality and the link to the external library available. To
file configure.ac in the plumed2 directory. The first edit you need to make to this file should read as follows:
\v
erbatim
PLUMED_CONFIG_ENABLE([library_name],[
library_name],[
search for library_name],[no])
PLUMED_CONFIG_ENABLE([library_name],[search for library_name],[no])
\e
ndverbatim
Add this in the part of the file where there are similar names. This command allows users to enable the package
using --enable-library_name when they run the configure command. Obviously, library_name here should be replaced
with the name of the particular library you are using.
using
`--enable-library_name`
when they run the configure command. Obviously, library_name here should be replaced
with the name of the particular library you are using. A shell variable named
`library_name`
will be set
to
`true`
if the library has been requested. The last argument says that, by default, the library is not requested.
If you replace it with a
`[yes]`
, then you will be able to use
`--disable--library_name`
to disable the library.
The second edit you need to make to the configure.ac file is as follows:
...
...
@@ -503,6 +505,29 @@ you can use the exit funciton here, which should work even if you are using temp
directive that appears around your library calling code and that we discussed earlier. The last argument meanwhile is the name of the library -
the part that appears after the -l. In the example above the code would thus try and link -llibrary_name.
Notice that in the for C++ libraries sometimes one has to check something more complicated than the presence of a single function.
In this case you can use a more advanced version of the command which allows you to write a short test. Look at this example:
\v
erbatim
if test $boost_serialization == true ; then
PLUMED_CHECK_CXX_PACKAGE([boost serialization],[
#include <fstream>
#include <boost/archive/text_oarchive.hpp>
int main() {
std::ofstream ofs("filename");
boost::archive::text_oarchive oa(ofs);
return 0;
}
], [
__
PLUMED_HAS_BOOST_SERIALIZATION],[boost_serialization boost_serialization-mt])
fi
\e
ndverbatim
The first argument here (
`[boost serialization]`
) is just used in the configure log. The second argument is a
complete C++ program that should compile and link. The last arguments are similar to those of the
`PLUMED_CHECK_PACKAGE`
macro.
Notice that for both macros (
`PLUMED_CHECK_PACKAGE`
and
`PLUMED_CHECK_CXX_PACKAGE`
) you can omit the final library, which
means that the function should be found without adding any extra
`-l`
option. In addition, you can put multiple libraries.
In this case, autoconf will scan them to find the appropriate one.
Once you have made these edits issue the command:
\v
erbatim
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment