2 # This file is part of the GROMACS molecular simulation package.
4 # Copyright (c) 2015,2016, by the GROMACS development team, led by
5 # Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
6 # and including many others, as listed in the AUTHORS file in the
7 # top-level source directory and at http://www.gromacs.org.
9 # GROMACS is free software; you can redistribute it and/or
10 # modify it under the terms of the GNU Lesser General Public License
11 # as published by the Free Software Foundation; either version 2.1
12 # of the License, or (at your option) any later version.
14 # GROMACS is distributed in the hope that it will be useful,
15 # but WITHOUT ANY WARRANTY; without even the implied warranty of
16 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 # Lesser General Public License for more details.
19 # You should have received a copy of the GNU Lesser General Public
20 # License along with GROMACS; if not, see
21 # http://www.gnu.org/licenses, or write to the Free Software Foundation,
22 # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
24 # If you want to redistribute modifications to GROMACS, please
25 # consider that scientific software is very special. Version
26 # control is crucial - bugs must be traceable. We will be happy to
27 # consider code for inclusion in the official distribution, but
28 # derived work must not be called official GROMACS. Details are found
29 # in the README & COPYING files - if they are missing, get the
30 # official version at http://www.gromacs.org.
32 # To help us fund GROMACS development, we humbly ask that you cite
33 # the research papers on the package. Check out http://www.gromacs.org.
38 build_out_of_source
= True
41 'source-md5': Option
.string
44 def do_build(context
):
46 'GMX_BUILD_HELP': 'ON',
47 'GMX_BUILD_MANUAL': 'ON',
48 'SOURCE_MD5SUM': context
.opts
.source_md5
,
49 'CMAKE_BUILD_TYPE': 'Debug',
54 release
= (context
.job_type
== JobType
.RELEASE
)
56 cmake_opts
['GMX_BUILD_TARBALL'] = 'ON'
57 elif context
.job_type
== JobType
.GERRIT
:
58 cmake_opts
['GMX_COMPACT_DOXYGEN'] = 'ON'
59 cmake_opts
.update(context
.get_doc_cmake_options(
60 doxygen_version
='1.8.5', sphinx_version
='1.4'))
61 context
.run_cmake(cmake_opts
);
62 context
.build_target(target
='gmx', parallel
=True,
63 continue_on_failure
=True)
65 context
.build_target(target
='manual', parallel
=False,
66 target_descr
='PDF manual', continue_on_failure
=True)
67 logfile
= os
.path
.join(context
.workspace
.build_dir
, 'docs/manual/gromacs.log')
68 if os
.path
.isfile(logfile
):
69 with
open(logfile
, 'r') as f
:
71 if re
.search(r
'LaTeX Warning: Reference .* on page .* undefined', manual_log
):
72 context
.mark_unstable('undefined references in PDF manual')
73 context
.publish_logs([logfile
])
75 # check-source is not necessary for a release build, and building these
76 # separately causes many of the Doxygen targets to get built twice if run
79 context
.build_target(target
='doxygen-all', parallel
=False,
80 target_descr
='Doxygen documentation', continue_on_failure
=True)
81 context
.build_target(target
='check-source', parallel
=False,
82 failure_string
='check-source failed to run', continue_on_failure
=True)
84 for target
in ('check-source', 'doxygen-xml', 'doxygen-user',
85 'doxygen-lib', 'doxygen-full'):
86 logfile
= os
.path
.join(context
.workspace
.build_dir
,
87 'docs/doxygen/{0}.log'.format(target
))
88 if os
.path
.isfile(logfile
) and os
.stat(logfile
).st_size
> 0:
89 context
.mark_unstable('{0} produced warnings'.format(target
))
91 context
.publish_logs(logs
, category
='doxygen')
95 context
.build_target(target
='sphinx-input', parallel
=False,
96 failure_string
='Generating Sphinx input failed',
97 continue_on_failure
=True)
98 context
.build_target(target
='sphinx-programs', parallel
=False,
99 failure_string
='Running gmx help -export rst failed',
100 continue_on_failure
=True)
104 sphinx_targets
= [ ('webpage-sphinx', 'html', 'HTML') ]
106 sphinx_targets
.extend((
107 ('man', 'man', 'man page'),
108 ('install-guide', 'install', 'install-guide')
111 for target
, log
, descr
in sphinx_targets
:
112 context
.build_target(target
=target
, parallel
=False,
113 failure_string
='Sphinx: {0} generation failed'.format(descr
),
114 continue_on_failure
=True)
115 logfile
= os
.path
.join(context
.workspace
.build_dir
,
116 'docs/sphinx-{0}.log'.format(log
))
117 if os
.path
.isfile(logfile
) and os
.stat(logfile
).st_size
> 0:
118 context
.mark_unstable('Sphinx: {0} generation produced warnings'.format(descr
))
120 context
.publish_logs(logs
, category
='sphinx')
124 context
.build_target(target
='webpage', parallel
=False)
128 ignore_urls
= ['html-full', 'html-user', 'html-lib', '.tar.gz', '_sources']
129 cmd
= ['linkchecker', 'docs/html/index.html', '-f',
130 context
.workspace
.get_project_dir(Project
.GROMACS
) + '/docs/linkcheckerrc']
131 for url
in ignore_urls
:
132 cmd
.extend(['--ignore-url', url
])
133 # TODO: Actually check the linkchecker results
134 context
.run_cmd(cmd
, ignore_failure
=True)
137 version_info
= context
.read_cmake_variable_file('VersionInfo.cmake')
138 version
= version_info
['GMX_VERSION_STRING']
139 package_name
= 'website-' + version
140 context
.make_archive(package_name
, root_dir
='docs/html', prefix
=package_name
)