Skip to content
Snippets Groups Projects
Commit 5a358daa authored by Benjamin Steltner's avatar Benjamin Steltner
Browse files

Initial commit: lalsuite-v7.3

parents
No related branches found
No related tags found
No related merge requests found
00boot 0 → 100755
#!/bin/sh
## function to print error message and exit
fail () {
echo "!!! $0: $1" >&2
exit 1
}
## check script is being run from top-level source directory
test "$0" = "./00boot" || fail "must be run from top-level source directory"
## remove M4 cache files
rm -rf autom4te.cache/
rm -f aclocal.m4
# FIXME: autoreconf from Ubuntu 9.10 (and probably also from recent
# Debian versions) automatically run libtoolize with the --copy option
# therefore over writing the supplied libtool scripts with system
# version. This can lead to unexpected build failures therefore to work
# round this "feature" we set the LIBTOOLIZE enviroment variable to
# point to the the true executable which bypasses the running of
# libtoolize, this will not effect the vast majority of users and those
# it will effect will know how to run libtoolize, if required.
## run autoreconf
AUTORECONF=${AUTORECONF:-"autoreconf"}
echo "00boot: running ${AUTORECONF}"
LIBTOOLIZE=true ${AUTORECONF} || fail "${AUTORECONF} failed"
echo "
==================================================
00boot has been run successfully.
Now run './configure' with appropriate options
to configure LALSuite.
==================================================
"
# Contributing to LALSuite
This page outlines the recommended procedure for contributing changes to the LALSuite repository. Please read the introduction to [GitLab on git.ligo.org](https://wiki.ligo.org/Computing/GitLigoOrg) before you start.
## Reporting Issues
If you have ligo.org authentication, please report issues directly through gitlab.
Otherwise, you can use the service desk address
contact+lscsoft-lalsuite-1438-issue-@support.ligo.org
to send bug reports by e-mail.
In either case, please include as much detail as possible to reproduce the error, including information about your operating system and the version of each (relevant) component of LALSuite.
If possible, please include a brief, self-contained code example that demonstrates the problem.
Note that when an issue is marked as 'confidential',
currently this means that most internal users will also not be able to see it,
but only a small number of people with reporter, developer or maintainer status.
## Contributing code
All contributions to LALSuite code must be made using the fork and [merge request](https://git.ligo.org/help/user/project/merge_requests/index.md) [workflow](https://git.ligo.org/help/user/project/repository/forking_workflow.md), which must then be reviewed by one of the project maintainers.
If you wish to contribute new code, or changes to existing code, please follow this development workflow:
### Make a fork (copy) of LALSuite
**You only need to do this once**
1. Go to the [LALSuite repository home page](https://git.ligo.org/lscsoft/lalsuite)
2. Click on the *Fork* button, that should lead you [here](https://git.ligo.org/lscsoft/lalsuite/-/forks/new)
3. Select the namespace that you want to create the fork in, this will usually be your personal namespace
If you can't see the *Fork* button, make sure that you are logged in by checking for your account profile photo in the top right-hand corner of the screen.
### Clone your fork
Make sure that you have installed and configured [git-lfs](https://wiki.ligo.org/Computing/GitLFS#Install_the_git_LFS_client):
```bash
git lfs install
```
for the management of large files. This is required to successfully build and install your development fork.
Then, clone your fork with
```bash
git clone git@git.ligo.org:<namespace>/lalsuite.git
```
### Keeping your fork up to date
Link your clone to the main (`upstream`) repository so that you can `fetch` and `pull` changes, `merge` them with your clone, and `push` them to your fork. Do *not* make changes on your master branch.
1. Link your fork to the main repository:
```bash
cd lalsuite
git remote add upstream git@git.ligo.org:lscsoft/lalsuite.git
```
You need only do this step once.
2. Update your `master` branch to track changes from upstream:
```bash
git checkout master
git fetch upstream
git branch --set-upstream-to upstream/master
git pull
```
You only need to do this step once.
3. Fetch new changes from the `upstream` repository, merge them with your master branch, and push them to your fork on git.ligo.org:
```bash
git checkout master
git pull
git push origin master
```
4. You can see which remotes are configured using
```bash
git remote -v
```
If you have followed the instructions thus far, you should see four lines. Lines one and two begin with `origin` and reference your fork on git.ligo.org with both `fetch` and `push` methods. Lines three and four begin with `upstream` and refer to the main repository on git.ligo.org with both `fetch` and `push` methods.
### Making changes
All changes should be developed on a feature branch in order to keep them separate from other work, thus simplifying the review and merge once the work is complete. The workflow is:
1. Create a new feature branch configured to track the `master` branch:
```bash
git checkout master
git pull
git checkout -b my-new-feature upstream/master
```
This command creates the new branch `my-new-feature`, sets up tracking the `upstream` repository, and checks out the new branch. There are other ways to do these steps, but this is a good habit since it will allow you to `fetch` and `merge` changes from `upstream/master` directly onto the branch.
2. Develop the changes you would like to introduce, using `git commit` to finalise a specific change.
Ideally commit small units of change often, rather than creating one large commit at the end, this will simplify review and make modifying any changes easier.
Commit messages should be clear, identifying which code was changed, and why.
Common practice is to use a short summary line (<50 characters), followed by a blank line, then more information in longer lines.
2. Push your changes to the remote copy of your fork on https://git.ligo.org.
The first `push` of any new feature branch will require the `-u/--set-upstream` option to `push` to create a link between your new branch and the `origin` remote:
```bash
git push --set-upstream origin my-new-feature
```
Subsequenct pushes can be made with just:
```bash
git push
```
3. Keep your feature branch up to date with the `upstream` repository by doing:
```bash
git checkout master
git pull
git checkout my-new-feature
git rebase upstream/master
git push -f origin my-new-feature
```
This works if you created your branch with the `checkout` command above. If you forgot to add the `upstream/master` starting point, then you will need to dig deeper into git commands to get changes and merge them into your feature branch.
If there are conflicts between `upstream` changes and your changes, you will need to resolve them before pushing everything to your fork.
### Open a merge request
When you feel that your work is finished, you should create a merge request to propose that your changes be merged into the main (`upstream`) repository.
After you have pushed your new feature branch to `origin`, you should find a new button on the [LALSuite repository home page](https://git.ligo.org/lscsoft/lalsuite/) inviting you to create a merge request out of your newly pushed branch. (If the button does not exist, you can initiate a merge request by going to the `Merge Requests` tab on your fork website on git.ligo.org and clicking `New merge request`)
You should click the button, and proceed to fill in the title and description boxes on the merge request page.
It is recommended that you check the box to `Remove source branch when merge request is accepted`; this will result in the branch being automatically removed from your fork when the merge request is accepted.
Once the request has been opened, one of the maintainers will assign someone to review the change. There may be suggestions and/or discussion with the reviewer. These interactions are intended to make the resulting changes better. The reviewer will merge your request.
Once the changes are merged into the upstream repository, you should remove the development branch from your clone using
```bash
git branch -d my-new-feature
```
A feature branch should *not* be repurposed for further development as this can result in problems merging upstream changes.
### Speeding up the continuous integration pipeline
The Gitlab-CI (continuous integration) pipeline runs for all changes to ensure that the software still builds and passes all of the tests.
The full pipeline (and even more so the nightly pipeline) takes a long time to carefully go through all of the package builds, but for minor changes to documentation or infrastructure this can be a waste of time and resources.
Sections of the CI pipeline can be skipped by adding special key text to your commit messages as follows:
| Commit message text | Action |
| -------------------- | --------------------------------------------- |
| `[skip compiler]` | Skip compiler test jobs |
| `[skip conda]` | Skip Conda build jobs (and their dependents) |
| `[skip coverage]` | Skip coverage jobs |
| `[skip debian]` | Skip Debian build jobs (and their dependents) |
| `[skip docs]` | Skip documentation jobs |
| `[skip integration]` | Skip integration test jobs |
| `[skip lint]` | Skip lint jobs |
| `[skip platform]` | Skip platform test jobs |
| `[skip rhel]` | Skip RHEL build jobs (and their dependents) |
| `[skip wheels]` | Skip Python wheel build jobs test jobs |
**It is important that this feature is not abused, please do not skip any jobs when making library changes.**
## More Information
More information regarding the usage of GitLab can be found in the main GitLab [documentation](https://git.ligo.org/help/).
COPYING 0 → 100644
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Lesser General Public License instead.) You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
rights.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) year name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, the commands you use may
be called something other than `show w' and `show c'; they could even be
mouse-clicks or menu items--whatever suits your program.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
`Gnomovision' (which makes passes at compilers) written by James Hacker.
<signature of Ty Coon>, 1 April 1989
Ty Coon, President of Vice
This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License.
BUILT_SOURCES =
sysconf_DATA =
MOSTLYCLEANFILES =
EXTRA_DIST =
include $(top_srcdir)/gnuscripts/lalsuite_top.am
ACLOCAL_AMFLAGS = -I gnuscripts
SUBDIRS = @subdirs@ wheel
.PHONY: wheel
wheel:
$(MAKE) -C wheel wheel
# Override automake's default rule for rebuilding aclocal.m4, to ensure that
# ./configure is successfully recreated after certain build system changes which
# require other autotools (e.g. autoheader) to be re-run. See Redmine issue #728.
$(lalsuite_package_configure_deps):
$(ACLOCAL_M4): $(am__aclocal_m4_deps) $(lalsuite_package_configure_deps)
$(am__cd) $(srcdir) && $(SHELL) ./00boot
# Override automake's default rule for rebuilding ./config.status, to ensure that
# all changes to the top-level configuration (especially to environment variables it
# exports) are propagated to the library-level configurations. See Redmine issue #728.
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
$(SHELL) $(top_srcdir)/configure $(ac_configure_args)
.PHONY: cscopelist-subdirs
cscopelist-am: cscopelist-subdirs
cscopelist-subdirs:
for subdir in @subdirs@; do \
sed "s|^|$${subdir}/|" $${subdir}/cscope.files >> $(top_builddir)/cscope.files; \
done
user_environment = \
`for dir in @subdirs@; do printf 'source %s; ' "$(sysconfdir)/$${dir}-user-env"; done` \
$(END_OF_LIST)
BUILT_SOURCES += $(PACKAGE)rc
sysconf_DATA += $(PACKAGE)rc
MOSTLYCLEANFILES += $(PACKAGE)rc
$(PACKAGE)rc: Makefile
$(AM_V_GEN)echo "# source this file to access $(PACKAGE_NAME) from Bourne or C shells" >$@; \
echo "expr \"X\$$0\" : '^X.*csh' >/dev/null && source $(sysconfdir)/$(PACKAGE)-user-env.csh || . $(sysconfdir)/$(PACKAGE)-user-env.sh" >>$@
if DOXYGEN
html-local: Makefile $(CONFIG_CLEAN_FILES)
$(AM_V_at)set -e; \
echo "$(subdir)/Makefile: Doxygen documentation was built successfully!"; \
echo "$(subdir)/Makefile: $(PACKAGE_NAME) main page is at file://$(abs_builddir)/index.html"
install-html-local: html-local
$(AM_V_at)set -e; \
echo " $(MKDIR_P) '$(DESTDIR)$(htmldir)'"; \
$(MKDIR_P) "$(DESTDIR)$(htmldir)"; \
echo " $(INSTALL_DATA) index.html '$(DESTDIR)$(htmldir)/index.html'"; \
$(SED) -e 's|\(lal[a-z]*\)/doxygen/out|../\1|g' index.html > $@.tmp; \
$(INSTALL_DATA) $@.tmp "$(DESTDIR)$(htmldir)/index.html"; \
rm -f $@.tmp; \
echo "$(subdir)/Makefile: Doxygen documentation was installed successfully!"; \
echo "$(subdir)/Makefile: installed $(PACKAGE_NAME) main page is at file://$(DESTDIR)$(htmldir)/index.html"
uninstall-local:
-rm -rf "$(DESTDIR)$(htmldir)/"
endif
README.md 0 → 100644
# LALSuite
This is the main LALSuite development repository.
If you would like to just use a released version,
see [here](https://computing.docs.ligo.org/conda/)
for IGWN conda environments including LALSuite,
or the project pages
on [conda-forge](https://anaconda.org/conda-forge/lalsuite)
and on [PyPI](https://pypi.org/project/lalsuite/).
## Acknowledgment
We request that any academic report, publication, or other academic
disclosure of results derived from the use of this software acknowledge
the use of the software by an appropriate acknowledgment or citation.
The whole LALSuite software suite can be cited with the DOI
[10.7935/GT1W-FZ16][doi]. An example BibTeX entry could look like this:
@misc{lalsuite,
author = "{LIGO Scientific Collaboration}",
title = "{LIGO} {A}lgorithm {L}ibrary - {LALS}uite",
howpublished = "free software (GPL)",
doi = "10.7935/GT1W-FZ16",
year = "2018"
}
In addition, some codes contained in this package may be directly based
on one or several scientific papers, which should be cited when using
those specific codes; some of these can be discovered through the
documentation.
## Cloning the Repository
We now utilize [Git LFS][gitlfs] for the managament of large files and
as such `git-lfs` needs to be installed and configured to correctly
clone this repository. After installing `git-lfs` it can be configured
using:
$ git lfs install
This only needs to be done once for each machine you access the
repository. It can then be cloned using:
$ git clone git@git.ligo.org:lscsoft/lalsuite.git
## Building from Source
The recommended way to build LALSuite from source is in a `conda` environment.
[A recipe file](conda/environment.yml) is available with all main dependencies.
This can serve as the base for custom recipes,
or be used directly via:
$ conda env create -f conda/environment.yml
Pulling in dependencies may take a while depending on your internet connection.
After the environment setup succeeded, you can activate it with:
$ conda activate lalsuite-dev
You can then build the suite by executing, in order:
1. `./00boot` (once at first time)
2. `./configure` with appropriate options (see `./configure --help`)
3. `make`
After pulling updates or making your own changes,
you will usually only need to call `make` again,
as reconfiguration and re-running `00boot` should be handled automatically if needed.
If you prefer managing dependencies yourself without conda,
see [here](https://wiki.ligo.org/Computing/LALSuite#Dependencies).
## Contributing to LALSuite
The [guide to contributing to LALSuite][contributing] explains how to
report issues and contribute fixes or new features using the fork and
pull workflow. Please read and follow these directions.
## Nightly Documentation
The [LALSuite Doxygen documentation][nightlydocs] is built under
GitLab-CI every night.
## Notes on Ancient History
LALSuite was transferred to `git.ligo.org` in December 2017. Older
history has been imported, though commit hashes were rewritten during
the [Git LFS][gitlfs] conversion. Please note:
1. The `Original:` commit IDs quoted in each commit message can be used
to compare with the [archived reference repo][oldlalsuite], old issue
discussions on the [Redmine tracker][oldredmine], review wiki pages
etc.
1. Commits before December 2017 may also include references to issues
(`#number`). These refer to the corresponding [Redmine
issue][oldredmine] (LVC-authorized access only), and any clickable
link the internal GitLab web interface produces for those old commits
will therefore be spurious.
## For More Information
Please visit the [LALSuite project page][project].
[doi]: https://doi.org/10.7935/GT1W-FZ16
[gitlfs]: https://wiki.ligo.org/Computing/GitLFS#Install_the_git_LFS_client
[contributing]: https://git.ligo.org/lscsoft/lalsuite/blob/master/CONTRIBUTING.md
[nightlydocs]: https://lscsoft.docs.ligo.org/lalsuite
[oldlalsuite]: https://git.ligo.org/lscsoft/lalsuite-archive
[oldredmine]: https://bugs.ligo.org/redmine/projects/lalsuite
[project]: https://wiki.ligo.org/Computing/LALSuite
# How to create a LALSuite release
The document attempts to describe the workflow for creating a release of
a subpackage of LALSuite.
Note that only authorised persons will be able to push directly to the
relevant release branch.
The workflow is (roughly) as follows:
1. cherry-pick/merge everything required onto the release branch
(e.g. `o3b-release`) via a Merge Request; please use the `-x` and `--gpg-sign`
option to `git-cherry-pick`
1. for each subpackage (e.g. `lal`):
1. update the following for the release:
- `/lal/configure.ac` (package and library version numbers, and
upstream LALSuite dependencies -- carefully read the instructions on
how to change the library version number)
- `/lal/debian/control.in` (changelog entry)
- `/lal/lalsimulation.spec.in` (changelog entry)
1. commit the resulting changes onto the release branch
(one file at a time, if you like)
1. tag `lal-vX.Y.Z` on the release branch
```console
git tag --annotate --sign lal-vX.Y.Z
```
1. generate the release tarball
```console
git checkout lal-vX.Y.Z
./00boot
./configure --enable-swig
make dist -C lal
git checkout <release-branch>
```
1. update the following for the top-level `lalsuite` release:
- `/configure.ac` (lalsuite version number)
1. commit the resulting changes onto the release branch
1. tag `lalsuite-vX.Y` on the release branch
```
git tag --annotate --sign lalsuite-vX.Y
```
1. push the new references up to the repository
```console
git push upstream lal-vX.Y.Z # (repeat as required for each subpackage)
git push upstream lalsuite-vX.Y
```
1. upload the release tarballs to <http://software.ligo.org/lscsoft/source/>
1. [open an SCCB ticket](https://sccb.docs.ligo.org/requests/)
1. merge the release branch onto `master` via a Merge Request
- use a local branch on your fork to merge the two branches
- update the package versions in `/configure.ac` and all
`/<subpackage>/configure.ac` files for released subpackages to
`X.Y.Z.1` to indicate that they are back in development mode
name: lalsuite-dev
channels:
- conda-forge
dependencies:
- astropy >=1.1.1
- autoconf
- automake
- bc
- cfitsio
- doxygen
- fftw
- freezegun
- c-compiler
- gsl
- h5py
- hdf5
- healpy
- help2man >=1.37
- ldas-tools-framecpp
- libframel
- ligo-gracedb
- ligo-segments
- lscsoft-glue >=2.0.0
- make
- matplotlib-base
- metaio
- mpmath >=1.0.0
- numpy
- openmpi
- pillow
- pkg-config >=0.18.0
- pytest
- python
#- python-ligo-lw <-- depends upon python-lal
- scipy >=0.9.0
- six
- swig >=3.0.10
- texlive-core
- zlib
#!/bin/bash
set -ex
# install from python build directory
_pybuilddir="_build${PY_VER}"
cd ${_pybuilddir}
# install binaries
make -j ${CPU_COUNT} V=1 VERBOSE=1 install -C bin
# install system configuration files
make -j ${CPU_COUNT} V=1 VERBOSE=1 install-sysconfDATA
#!/bin/bash
set -ex
cd _build
# install library and headers
make -j ${CPU_COUNT} V=1 VERBOSE=1 -C lib install
# install SWIG binding definitions and headers
make -j ${CPU_COUNT} V=1 VERBOSE=1 -C swig install-data
# install pkg-config
make -j ${CPU_COUNT} V=1 VERBOSE=1 install-pkgconfigDATA
# -- create activate/deactivate scripts
# strip out the 'lib' package name prefix
LALSUITE_NAME=${PKG_NAME#"lib"}
LALSUITE_NAME_UPPER=$(echo ${LALSUITE_NAME} | awk '{ print toupper($0) }')
# activate.sh
ACTIVATE_SH="${PREFIX}/etc/conda/activate.d/activate-${PKG_NAME}.sh"
mkdir -p $(dirname ${ACTIVATE_SH})
cat > ${ACTIVATE_SH} << EOF
#!/bin/bash
# preserve user setting
if [ ! -z "\"{${LALSUITE_NAME_UPPER}_DATADIR+x}" ]; then
export CONDA_BACKUP_${LALSUITE_NAME_UPPER}_DATADIR="\${${LALSUITE_NAME_UPPER}_DATADIR}"
fi
export ${LALSUITE_NAME_UPPER}_DATADIR="\${CONDA_PREFIX}/share/${LALSUITE_NAME}"
EOF
# deactivate.sh
DEACTIVATE_SH="${PREFIX}/etc/conda/deactivate.d/deactivate-${PKG_NAME}.sh"
mkdir -p $(dirname ${DEACTIVATE_SH})
cat > ${DEACTIVATE_SH} << EOF
#!/bin/bash
# reinstate backup from outside the environment
if [ ! -z "\${CONDA_BACKUP_LAL_DATADIR}" ]; then
export ${LALSUITE_NAME_UPPER}_DATADIR="\${CONDA_BACKUP_${LALSUITE_NAME_UPPER}_DATADIR}"
unset CONDA_BACKUP_${LALSUITE_NAME_UPPER}_DATADIR
# no backup, just unset
else
unset ${LALSUITE_NAME_UPPER}_DATADIR
fi
EOF
AC_PREREQ([2.63])
AC_INIT([LALSuite],[7.3],[lal-discuss@ligo.org])
AC_CONFIG_SRCDIR([configure.ac])
AC_CONFIG_AUX_DIR([gnuscripts])
AC_CONFIG_MACRO_DIR([gnuscripts])
AC_PREFIX_DEFAULT(["`pwd`/_inst"])
AC_CONFIG_FILES([Makefile wheel/Makefile wheel/setup.py])
AM_INIT_AUTOMAKE([ \
1.11 \
foreign \
subdir-objects \
color-tests \
parallel-tests \
tar-pax \
dist-xz \
no-dist-gzip \
])
LALSUITE_DISTCHECK_CONFIGURE_FLAGS
# use silent build rules
AM_SILENT_RULES([yes])
# check for programs
AC_PROG_AWK
AC_PROG_SED
LALSUITE_ENABLE_NIGHTLY
LALSUITE_CHECK_PYTHON([3.5])
# provide LAL library enable/disable options
LALSUITE_ENABLE_ALL_LAL
lal=true
LALSUITE_ENABLE_LALFRAME
LALSUITE_ENABLE_LALMETAIO
LALSUITE_ENABLE_LALSIMULATION
LALSUITE_ENABLE_LALBURST
LALSUITE_ENABLE_LALINSPIRAL
LALSUITE_ENABLE_LALPULSAR
LALSUITE_ENABLE_LALINFERENCE
LALSUITE_ENABLE_LALAPPS
# configure Doxygen top-level page
LALSUITE_ENABLE_DOXYGEN
LALSUITE_ENABLE_MODULE([DOXYGEN])
AS_IF([test "x${doxygen}" = xtrue],[
AC_CONFIG_FILES([index.html:gnuscripts/lalsuite_index.html.in])
AC_SUBST([DOXYGEN_PACKAGE_LINKS],[])
AM_SUBST_NOTMAKE([DOXYGEN_PACKAGE_LINKS])
AC_SUBST([DOXYGEN_LAST_PACKAGE],[])
AM_SUBST_NOTMAKE([DOXYGEN_LAST_PACKAGE])
])
AC_DEFUN([lalsuite_config_doxygen],[
m4_pushdef([lowercase],m4_translit([[$1]], [A-Z], [a-z]))
AS_IF([test "x${doxygen}" = xtrue],[
DOXYGEN_PACKAGE_LINKS="${DOXYGEN_PACKAGE_LINKS}"' <a target="docframe" href="lowercase/doxygen/out/index.html">$1</a>'
DOXYGEN_LAST_PACKAGE="lowercase/doxygen/out/index.html"
])
m4_popdef([lowercase])
])
# directories of top-level build and source
lalsuite_abs_top_builddir="`pwd`"
lalsuite_abs_top_srcdir='$(abs_top_srcdir)/..'
# configure a lalsuite package
AC_DEFUN([lalsuite_config_subdir],[
m4_pushdef([lowercase],m4_translit([[$1]], [A-Z], [a-z]))
m4_pushdef([uppercase],m4_translit([[$1]], [a-z], [A-Z]))
# if $1 is enabled
AS_IF([test "x${lowercase}" = xtrue],[
# re-run top-level ./00boot if any package-level ./configure.ac have changed
# - this is needed to pick up e.g. any new inter-package dependencies
lalsuite_package_configure_deps="${lalsuite_package_configure_deps} "'$(top_srcdir)/lowercase/configure.ac'
# export precious environment variables
uppercase[]_LIBS="${lalsuite_abs_top_builddir}/lowercase/lib/lib[]lowercase.la"
uppercase[]_CFLAGS="-I${lalsuite_abs_top_builddir}/lowercase/include"
uppercase[]_DATA_PATH="${lalsuite_abs_top_srcdir}/lowercase/lib:${lalsuite_abs_top_srcdir}/lowercase/test"
uppercase[]_OCTAVE_PATH="${lalsuite_abs_top_builddir}/lowercase/octave"
uppercase[]_PYTHON_PATH="${lalsuite_abs_top_builddir}/lowercase/python"
uppercase[]_HTMLDIR="${htmldir}/../lowercase"
export uppercase[]_LIBS uppercase[]_CFLAGS uppercase[]_HTMLDIR
export uppercase[]_DATA_PATH uppercase[]_OCTAVE_PATH uppercase[]_PYTHON_PATH
# configure Doxygen top-level page
lalsuite_config_doxygen([$1])
# configure $1
AC_CONFIG_SUBDIRS(lowercase)
# set enable string
uppercase[]_ENABLE_VAL=ENABLED
],[
# set disable string
uppercase[]_ENABLE_VAL=DISABLED
])
m4_popdef([lowercase])
m4_popdef([uppercase])
])
# lal and lalsupport are always configured
lalsuite_config_doxygen([LAL])
AC_CONFIG_SUBDIRS(lal)
lalsuite_package_configure_deps='$(top_srcdir)/lal/configure.ac'
LAL_LIBS="${lalsuite_abs_top_builddir}/lal/lib/liblal.la"
LAL_CFLAGS="-I${lalsuite_abs_top_builddir}/lal/include"
LAL_DATA_PATH="${lalsuite_abs_top_srcdir}/lal/test"
LAL_OCTAVE_PATH="${lalsuite_abs_top_builddir}/lal/octave"
LAL_PYTHON_PATH="${lalsuite_abs_top_builddir}/lal/python"
LAL_HTMLDIR="${htmldir}/../lal"
LALSUPPORT_LIBS="${lalsuite_abs_top_builddir}/lal/lib/support/liblalsupport.la"
LALSUPPORT_CFLAGS="-I${lalsuite_abs_top_builddir}/lal/include"
LALSUPPORT_DATA_PATH="${LAL_DATA_PATH}"
LALSUPPORT_OCTAVE_PATH="${LAL_OCTAVE_PATH}"
LALSUPPORT_PYTHON_PATH="${LAL_PYTHON_PATH}"
LALSUPPORT_HTMLDIR="${htmldir}/../lal"
LALSUITE_BUILD="true"
export LALSUITE_BUILD
export LAL_LIBS LAL_CFLAGS LAL_DATA_PATH LAL_OCTAVE_PATH LAL_PYTHON_PATH LAL_HTMLDIR
export LALSUPPORT_LIBS LALSUPPORT_CFLAGS LALSUPPORT_DATA_PATH LALSUPPORT_OCTAVE_PATH LALSUPPORT_PYTHON_PATH LALSUPPORT_HTMLDIR
# configure optional packages
lalsuite_config_subdir([LALFrame])
lalsuite_config_subdir([LALMetaIO])
lalsuite_config_subdir([LALSimulation])
lalsuite_config_subdir([LALBurst])
lalsuite_config_subdir([LALInspiral])
lalsuite_config_subdir([LALPulsar])
lalsuite_config_subdir([LALInference])
# optionally configure lalapps
AS_IF([test "x$lalapps" = xtrue],[
lalsuite_package_configure_deps="${lalsuite_package_configure_deps} "'$(top_srcdir)/lalapps/configure.ac'
lalsuite_config_doxygen([LALApps])
AC_CONFIG_SUBDIRS(lalapps)
LALAPPS_ENABLE_VAL=ENABLED
],[
LALAPPS_ENABLE_VAL=DISABLED
])
AC_SUBST([ac_configure_args])
AC_SUBST([lalsuite_package_configure_deps])
AC_OUTPUT
AC_MSG_NOTICE([
==================================================
LALSuite has now been successfully configured:
* LALFrame library support is $LALFRAME_ENABLE_VAL
* LALMetaIO library support is $LALMETAIO_ENABLE_VAL
* LALSimulation library support is $LALSIMULATION_ENABLE_VAL
* LALBurst library support is $LALBURST_ENABLE_VAL
* LALInspiral library support is $LALINSPIRAL_ENABLE_VAL
* LALPulsar library support is $LALPULSAR_ENABLE_VAL
* LALInference library support is $LALINFERENCE_ENABLE_VAL
* LALApps library support is $LALAPPS_ENABLE_VAL
* Doxygen documentation is $DOXYGEN_ENABLE_VAL
and will be installed under the directory:
${prefix}
Now run 'make' to build LALSuite,
and run 'make install' to install LALSuite.
==================================================
])
#!/bin/sh
# use entrypoint structure so that we can do more at startup in the future, such as ligo-proxy-init
#if ! grid-proxy-info -exists -valid 1:0 2>/dev/null; then
# read -p "Enter your LIGO.ORG username: " username && echo $username | xargs -n 1 ligo-proxy-init
#fi
exec "$@"
# LALSuite Doxygen documentation
Online HTML documentation for the LALSuite C libraries and Pure-python extras
is generated using [Doxygen](http://www.doxygen.nl/).
This directory (`/doxygen/`) contains the common files that are shared between
the doxygen builds for all of the LALSuite subpackages.
The build is controlled by the automake file `/gnuscripts/lalsuite_doxygen.am`,
customisations for each subpackage can be added in
`<package>/doxygen/Makefile.am`.
# check_tags.py - check Doxygen tags
__author__ = 'Karl Wette <karl.wette@ligo.org>'
__copyright__ = 'Copyright (C) 2015 Karl Wette'
import sys
from xml.etree.cElementTree import ElementTree
# print error message and exit
def fail(msg):
sys.stderr.write('%s: %s\n' % (sys.argv[0], msg))
sys.exit(1)
# get input arguments
tagfile, = sys.argv[1:]
# parse tag file
tree = ElementTree()
try:
tree.parse(tagfile)
except:
fail("could not parse XML input from '%s'" % tagfile)
# find duplicate documentation anchors
anchors = dict()
for elem in tree.iter('docanchor'):
if not elem.text in anchors:
anchors[elem.text] = []
anchors[elem.text].append(elem)
dup_anchors = dict((anchor, elems) for anchor, elems in anchors.items() if len(elems) > 1)
# remove duplicate documentation anchors, preferring namespace and group anchors to other kinds
parent_map = dict((elem, parent_elem) for parent_elem in tree.iter() for elem in parent_elem)
for anchor in dup_anchors:
elem_rank = dict()
for elem in dup_anchors[anchor]:
parent_elem = elem
while parent_elem in parent_map:
parent_elem = parent_map[parent_elem]
if parent_elem.tag == "compound":
parent_elem_kind = parent_elem.get("kind", "")
if parent_elem_kind == "namespace":
elem_rank[elem] = 0
elif parent_elem_kind == "group":
elem_rank[elem] = 1
else:
elem_rank[elem] = 10
dup_anchors[anchor].sort(key=lambda elem: elem_rank[elem])
dup_anchors[anchor].pop(0)
for elem in dup_anchors[anchor]:
parent_map[elem].remove(elem)
# write tag file
tree.write(tagfile, encoding="UTF-8", xml_declaration=True)
This diff is collapsed.
#!/bin/bash
filename=`expr "X$1" : "^X.*/\([^/]*\)"`
case "${filename}" in
SWIG*.i)
# Filter SWIG interface files
@SED@ -n -f @abs_srcdir@/filter_swig.sed "$1"
;;
*.py)
# Filter Python source files
@PYTHON@ @abs_srcdir@/filter_py.py "$1"
;;
*)
# Output all other files unfiltered
cat "$1"
;;
esac
from __future__ import print_function
__applicationName__ = "doxypy"
__blurb__ = """
doxypy is an input filter for Doxygen. It preprocesses python
files so that docstrings of classes and functions are reformatted
into Doxygen-conform documentation blocks.
"""
__doc__ = __blurb__ + \
"""
In order to make Doxygen preprocess files through doxypy, simply
add the following lines to your Doxyfile:
FILTER_SOURCE_FILES = YES
INPUT_FILTER = "python /path/to/doxypy.py"
"""
__version__ = "0.4.2"
__date__ = "14th October 2009"
__website__ = "http://code.foosel.org/doxypy"
__author__ = (
"Philippe 'demod' Neumann (doxypy at demod dot org)",
"Gina 'foosel' Haeussge (gina at foosel dot net)"
)
__licenseName__ = "GPL v2"
__license__ = """This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
"""
import sys
import re
from optparse import OptionParser, OptionGroup
class FSM(object):
"""Implements a finite state machine.
Transitions are given as 4-tuples, consisting of an origin state, a target
state, a condition for the transition (given as a reference to a function
which gets called with a given piece of input) and a pointer to a function
to be called upon the execution of the given transition.
"""
"""
@var transitions holds the transitions
@var current_state holds the current state
@var current_input holds the current input
@var current_transition hold the currently active transition
"""
def __init__(self, start_state=None, transitions=[]):
self.transitions = transitions
self.current_state = start_state
self.current_input = None
self.current_transition = None
def setStartState(self, state):
self.current_state = state
def addTransition(self, from_state, to_state, condition, callback):
self.transitions.append([from_state, to_state, condition, callback])
def makeTransition(self, input):
"""Makes a transition based on the given input.
@param input input to parse by the FSM
"""
for transition in self.transitions:
[from_state, to_state, condition, callback] = transition
if from_state == self.current_state:
match = condition(input)
if match:
self.current_state = to_state
self.current_input = input
self.current_transition = transition
if options.debug:
print("# FSM: executing (%s -> %s) for line '%s'" % (from_state, to_state, input), file=sys.stderr)
callback(match)
return
class Doxypy(object):
def __init__(self):
string_prefixes = "[uU]?[rR]?"
self.start_single_comment_re = re.compile("^\s*%s(''')" % string_prefixes)
self.end_single_comment_re = re.compile("(''')\s*$")
self.start_double_comment_re = re.compile("^\s*%s(\"\"\")" % string_prefixes)
self.end_double_comment_re = re.compile("(\"\"\")\s*$")
self.single_comment_re = re.compile("^\s*%s(''').*(''')\s*$" % string_prefixes)
self.double_comment_re = re.compile("^\s*%s(\"\"\").*(\"\"\")\s*$" % string_prefixes)
self.defclass_re = re.compile("^(\s*)(def .+:|class .+:)")
self.empty_re = re.compile("^\s*$")
self.hashline_re = re.compile("^\s*#.*$")
self.importline_re = re.compile("^\s*(import |from .+ import)")
self.multiline_defclass_start_re = re.compile("^(\s*)(def|class)(\s.*)?$")
self.multiline_defclass_end_re = re.compile(":\s*$")
## Transition list format
# ["FROM", "TO", condition, action]
transitions = [
### FILEHEAD
# single line comments
["FILEHEAD", "FILEHEAD", self.single_comment_re.search, self.appendCommentLine],
["FILEHEAD", "FILEHEAD", self.double_comment_re.search, self.appendCommentLine],
# multiline comments
["FILEHEAD", "FILEHEAD_COMMENT_SINGLE", self.start_single_comment_re.search, self.appendCommentLine],
["FILEHEAD_COMMENT_SINGLE", "FILEHEAD", self.end_single_comment_re.search, self.appendCommentLine],
["FILEHEAD_COMMENT_SINGLE", "FILEHEAD_COMMENT_SINGLE", self.catchall, self.appendCommentLine],
["FILEHEAD", "FILEHEAD_COMMENT_DOUBLE", self.start_double_comment_re.search, self.appendCommentLine],
["FILEHEAD_COMMENT_DOUBLE", "FILEHEAD", self.end_double_comment_re.search, self.appendCommentLine],
["FILEHEAD_COMMENT_DOUBLE", "FILEHEAD_COMMENT_DOUBLE", self.catchall, self.appendCommentLine],
# other lines
["FILEHEAD", "FILEHEAD", self.empty_re.search, self.appendFileheadLine],
["FILEHEAD", "FILEHEAD", self.hashline_re.search, self.appendFileheadLine],
["FILEHEAD", "FILEHEAD", self.importline_re.search, self.appendFileheadLine],
["FILEHEAD", "DEFCLASS", self.defclass_re.search, self.resetCommentSearch],
["FILEHEAD", "DEFCLASS_MULTI", self.multiline_defclass_start_re.search, self.resetCommentSearch],
["FILEHEAD", "DEFCLASS_BODY", self.catchall, self.appendFileheadLine],
### DEFCLASS
# single line comments
["DEFCLASS", "DEFCLASS_BODY", self.single_comment_re.search, self.appendCommentLine],
["DEFCLASS", "DEFCLASS_BODY", self.double_comment_re.search, self.appendCommentLine],
# multiline comments
["DEFCLASS", "COMMENT_SINGLE", self.start_single_comment_re.search, self.appendCommentLine],
["COMMENT_SINGLE", "DEFCLASS_BODY", self.end_single_comment_re.search, self.appendCommentLine],
["COMMENT_SINGLE", "COMMENT_SINGLE", self.catchall, self.appendCommentLine],
["DEFCLASS", "COMMENT_DOUBLE", self.start_double_comment_re.search, self.appendCommentLine],
["COMMENT_DOUBLE", "DEFCLASS_BODY", self.end_double_comment_re.search, self.appendCommentLine],
["COMMENT_DOUBLE", "COMMENT_DOUBLE", self.catchall, self.appendCommentLine],
# other lines
["DEFCLASS", "DEFCLASS", self.empty_re.search, self.appendDefclassLine],
["DEFCLASS", "DEFCLASS", self.defclass_re.search, self.resetCommentSearch],
["DEFCLASS", "DEFCLASS_MULTI", self.multiline_defclass_start_re.search, self.resetCommentSearch],
["DEFCLASS", "DEFCLASS_BODY", self.catchall, self.stopCommentSearch],
### DEFCLASS_BODY
["DEFCLASS_BODY", "DEFCLASS", self.defclass_re.search, self.startCommentSearch],
["DEFCLASS_BODY", "DEFCLASS_MULTI", self.multiline_defclass_start_re.search, self.startCommentSearch],
["DEFCLASS_BODY", "DEFCLASS_BODY", self.catchall, self.appendNormalLine],
### DEFCLASS_MULTI
["DEFCLASS_MULTI", "DEFCLASS", self.multiline_defclass_end_re.search, self.appendDefclassLine],
["DEFCLASS_MULTI", "DEFCLASS_MULTI", self.catchall, self.appendDefclassLine],
]
self.fsm = FSM("FILEHEAD", transitions)
self.outstream = sys.stdout
self.output = []
self.comment = []
self.filehead = []
self.defclass = []
self.indent = ""
def __closeComment(self):
"""Appends any open comment block and triggering block to the output."""
if options.autobrief:
if len(self.comment) == 1 \
or (len(self.comment) > 2 and self.comment[1].strip() == ''):
self.comment[0] = self.__docstringSummaryToBrief(self.comment[0])
if self.comment:
block = self.makeCommentBlock()
self.output.extend(block)
if self.defclass:
self.output.extend(self.defclass)
def __docstringSummaryToBrief(self, line):
"""Adds \\brief to the docstrings summary line.
A \\brief is prepended, provided no other doxygen command is at the
start of the line.
"""
stripped = line.strip()
if stripped and not stripped[0] in ('@', '\\'):
return "\\brief " + line
else:
return line
def __flushBuffer(self):
"""Flushes the current outputbuffer to the outstream."""
if self.output:
try:
if options.debug:
print("# OUTPUT: ", self.output, file=sys.stderr)
print("\n".join(self.output), file=self.outstream)
self.outstream.flush()
except IOError:
# Fix for FS#33. Catches "broken pipe" when doxygen closes
# stdout prematurely upon usage of INPUT_FILTER, INLINE_SOURCES
# and FILTER_SOURCE_FILES.
pass
self.output = []
def catchall(self, input):
"""The catchall-condition, always returns true."""
return True
def resetCommentSearch(self, match):
"""Restarts a new comment search for a different triggering line.
Closes the current commentblock and starts a new comment search.
"""
if options.debug:
print("# CALLBACK: resetCommentSearch", file=sys.stderr)
self.__closeComment()
self.startCommentSearch(match)
def startCommentSearch(self, match):
"""Starts a new comment search.
Saves the triggering line, resets the current comment and saves
the current indentation.
"""
if options.debug:
print("# CALLBACK: startCommentSearch", file=sys.stderr)
self.defclass = [self.fsm.current_input]
self.comment = []
self.indent = match.group(1)
def stopCommentSearch(self, match):
"""Stops a comment search.
Closes the current commentblock, resets the triggering line and
appends the current line to the output.
"""
if options.debug:
print("# CALLBACK: stopCommentSearch", file=sys.stderr)
self.__closeComment()
self.defclass = []
self.output.append(self.fsm.current_input)
def appendFileheadLine(self, match):
"""Appends a line in the FILEHEAD state.
Closes the open comment block, resets it and appends the current line.
"""
if options.debug:
print("# CALLBACK: appendFileheadLine", file=sys.stderr)
self.__closeComment()
self.comment = []
self.output.append(self.fsm.current_input)
def appendCommentLine(self, match):
"""Appends a comment line.
The comment delimiter is removed from multiline start and ends as
well as singleline comments.
"""
if options.debug:
print("# CALLBACK: appendCommentLine", file=sys.stderr)
(from_state, to_state, condition, callback) = self.fsm.current_transition
# single line comment
if (from_state == "DEFCLASS" and to_state == "DEFCLASS_BODY") \
or (from_state == "FILEHEAD" and to_state == "FILEHEAD"):
# remove comment delimiter from begin and end of the line
activeCommentDelim = match.group(1)
line = self.fsm.current_input
self.comment.append(line[line.find(activeCommentDelim)+len(activeCommentDelim):line.rfind(activeCommentDelim)])
if (to_state == "DEFCLASS_BODY"):
self.__closeComment()
self.defclass = []
# multiline start
elif from_state == "DEFCLASS" or from_state == "FILEHEAD":
# remove comment delimiter from begin of the line
activeCommentDelim = match.group(1)
line = self.fsm.current_input
self.common_indent = " "*line.find(activeCommentDelim)
self.comment.append(line[line.find(activeCommentDelim)+len(activeCommentDelim):])
# multiline end
elif to_state == "DEFCLASS_BODY" or to_state == "FILEHEAD":
# remove comment delimiter from end of the line
activeCommentDelim = match.group(1)
line = self.fsm.current_input
self.comment.append(line[0:line.rfind(activeCommentDelim)])
if (to_state == "DEFCLASS_BODY"):
self.__closeComment()
self.defclass = []
# in multiline comment
else:
# just append the comment line
line = self.fsm.current_input[len(self.common_indent):]
self.comment.append(line)
def appendNormalLine(self, match):
"""Appends a line to the output."""
if options.debug:
print("# CALLBACK: appendNormalLine", file=sys.stderr)
self.output.append(self.fsm.current_input)
def appendDefclassLine(self, match):
"""Appends a line to the triggering block."""
if options.debug:
print("# CALLBACK: appendDefclassLine", file=sys.stderr)
self.defclass.append(self.fsm.current_input)
def makeCommentBlock(self):
"""Indents the current comment block with respect to the current
indentation level.
@returns a list of indented comment lines
"""
commentLines = self.comment
l = [self.indent + "## " + commentLines[0]]
for line in commentLines[1:]:
l.append(self.indent + "# " + line)
return l
def parse(self, input):
"""Parses a python file given as input string and returns the doxygen-
compatible representation.
@param input the python code to parse
@returns the modified python code
"""
lines = input.split("\n")
for line in lines:
self.fsm.makeTransition(line)
if self.fsm.current_state == "DEFCLASS":
self.__closeComment()
return "\n".join(self.output)
def parseFile(self, filename):
"""Parses a python file given as input string and returns the doxygen-
compatible representation.
@param input the python code to parse
@returns the modified python code
"""
f = open(filename, 'r')
for line in f:
self.parseLine(line.rstrip('\r\n'))
if self.fsm.current_state == "DEFCLASS":
self.__closeComment()
self.__flushBuffer()
f.close()
def parseLine(self, line):
"""Parse one line of python and flush the resulting output to the
outstream.
@param line the python code line to parse
"""
self.fsm.makeTransition(line)
self.__flushBuffer()
def optParse():
"""Parses commandline options."""
parser = OptionParser(prog=__applicationName__, version="%prog " + __version__)
parser.set_usage("%prog [options] filename")
parser.add_option("--autobrief",
action="store_true", dest="autobrief",
help="use the docstring summary line as \\brief description"
)
parser.add_option("--debug",
action="store_true", dest="debug",
help="enable debug output on stderr"
)
## parse options
global options
(options, filename) = parser.parse_args()
if not filename:
print("No filename given.", file=sys.stderr)
sys.exit(-1)
return filename[0]
def main():
"""Starts the parser on the file given by the filename as the first
argument on the commandline.
"""
filename = optParse()
fsm = Doxypy()
fsm.parseFile(filename)
if __name__ == "__main__":
main()
# Remove initial copyright block
1 {
# Start loop
: loop1
# Skip commented lines
\|^//| {
n
b loop1
}
}
# For any non-comment lines
\|^ *[^ /]| {
# Start Doxygen \verbatim block
i /// \\code
# Start loop
: loop2
# Skip empty lines
\|^$| {
n
b loop2
}
# End Doxygen \code block at next comment line
\|^ *//| {
i /// \\endcode
i ///
b end2
}
# Comment out and print line in \code block
s|^|/// |
p
# Read next line and continue loop
n
b loop2
# End loop
: end2
}
# Remove Emacs local variables
\|^// Local Variables:$| {
# Start loop
: loop3
# Skip rest of file
n
b loop3
}
# Remove any leading spaces from comments
s|^ *//|//|
# Escape percent signs
s|%|\\%|g
# Comment any empty lines
s|^$|///|
# Ensure line is a Doxygen comment
s|^///*|///|
# Print line
p
# install_regex.py - build regex for installing Doxygen documentation
__author__ = 'Karl Wette <karl.wette@ligo.org>'
__copyright__ = 'Copyright (C) 2015 Karl Wette'
import os
import sys
# print error message and exit
def fail(msg):
sys.stderr.write('%s: %s\n' % (sys.argv[0], msg))
sys.exit(1)
# get input arguments
install_dir, install_dirmap = sys.argv[1:]
# print install regex, built from install directory map
# - make 'to_dir' relative to install_dir to ensure
# Doxygen documentation does not contain absolute paths
# and hence is relocatable
for elem in install_dirmap.split():
(from_dir, to_dir) = elem.split(':')
if len(from_dir) == 0:
fail('from-directory in install directory map is empty')
if len(to_dir) == 0:
fail('to-directory in install directory map is empty')
print('s|%s|%s|g' % (from_dir, os.path.relpath(to_dir, install_dir)))
print("p")
<doxygenlayout version="1.0">
<!-- Generated by doxygen 1.8.1.2 -->
<!-- Navigation index tabs for HTML output -->
<navindex>
<tab type="mainpage" visible="yes" title=""/>
<tab type="modules" visible="yes" title="Documentation" intro=""/>
<tab type="filelist" visible="yes" title="File List" intro=""/>
<tab type="namespacelist" visible="yes" title="Namespace List" intro=""/>
<tab type="classlist" visible="yes" title="Data Structure List" intro=""/>
<tab type="examples" visible="yes" title="Example List" intro=""/>
<tab type="pages" visible="yes" title="" intro=""/>
</navindex>
<!-- Layout definition for a class page -->
<class>
<briefdescription visible="no"/>
<detaileddescription title=""/>
<includes visible="$SHOW_INCLUDE_FILES"/>
<inheritancegraph visible="$CLASS_GRAPH"/>
<collaborationgraph visible="$COLLABORATION_GRAPH"/>
<allmemberslink visible="yes"/>
<memberdecl>
<nestedclasses visible="yes" title=""/>
<publictypes title=""/>
<publicslots title=""/>
<signals title=""/>
<publicmethods title=""/>
<publicstaticmethods title=""/>
<publicattributes title=""/>
<publicstaticattributes title=""/>
<protectedtypes title=""/>
<protectedslots title=""/>
<protectedmethods title=""/>
<protectedstaticmethods title=""/>
<protectedattributes title=""/>
<protectedstaticattributes title=""/>
<packagetypes title=""/>
<packagemethods title=""/>
<packagestaticmethods title=""/>
<packageattributes title=""/>
<packagestaticattributes title=""/>
<properties title=""/>
<events title=""/>
<privatetypes title=""/>
<privateslots title=""/>
<privatemethods title=""/>
<privatestaticmethods title=""/>
<privateattributes title=""/>
<privatestaticattributes title=""/>
<friends title=""/>
<related title="" subtitle=""/>
<membergroups visible="yes"/>
</memberdecl>
<memberdef>
<inlineclasses title=""/>
<typedefs title=""/>
<enums title=""/>
<constructors title=""/>
<functions title=""/>
<related title=""/>
<variables title=""/>
<properties title=""/>
<events title=""/>
</memberdef>
<usedfiles visible="$SHOW_USED_FILES"/>
<authorsection visible="yes"/>
</class>
<!-- Layout definition for a namespace page -->
<namespace>
<briefdescription visible="yes"/>
<memberdecl>
<nestednamespaces visible="yes" title=""/>
<classes visible="yes" title=""/>
<typedefs title=""/>
<enums title=""/>
<functions title=""/>
<variables title=""/>
<membergroups visible="yes"/>
</memberdecl>
<detaileddescription title=""/>
<memberdef>
<inlineclasses title=""/>
<typedefs title=""/>
<enums title=""/>
<functions title=""/>
<variables title=""/>
</memberdef>
<authorsection visible="yes"/>
</namespace>
<!-- Layout definition for a file page -->
<file>
<briefdescription visible="yes"/>
<memberdecl>
<functions title="Prototypes"/>
</memberdecl>
<detaileddescription title=""/>
<includes visible="$SHOW_INCLUDE_FILES"/>
<includegraph visible="$INCLUDE_GRAPH"/>
<includedbygraph visible="$INCLUDED_BY_GRAPH"/>
<sourcelink visible="yes"/>
<memberdecl>
<classes visible="yes" title=""/>
<namespaces visible="yes" title=""/>
<defines title=""/>
<typedefs title=""/>
<enums title=""/>
<variables title=""/>
<membergroups visible="yes"/>
</memberdecl>
<memberdef>
<inlineclasses title=""/>
<defines title=""/>
<typedefs title=""/>
<enums title=""/>
<functions title=""/>
<variables title=""/>
</memberdef>
<authorsection/>
</file>
<!-- Layout definition for a group page -->
<group>
<briefdescription visible="no"/>
<detaileddescription title=""/>
<groupgraph visible="$GROUP_GRAPHS"/>
<memberdecl>
<nestedgroups visible="yes" title=""/>
<functions title="Prototypes"/>
<classes visible="yes" title=""/>
<namespaces visible="yes" title=""/>
<dirs visible="yes" title=""/>
<typedefs title=""/>
<enums title=""/>
<enumvalues title=""/>
<defines title=""/>
<files visible="yes" title=""/>
<variables title=""/>
<signals title=""/>
<publicslots title=""/>
<protectedslots title=""/>
<privateslots title=""/>
<events title=""/>
<properties title=""/>
<friends title=""/>
<membergroups visible="yes"/>
</memberdecl>
<memberdef>
<pagedocs/>
<functions title=""/>
<typedefs title=""/>
<enums title=""/>
<enumvalues title=""/>
<defines title=""/>
<variables title=""/>
<signals title=""/>
<publicslots title=""/>
<protectedslots title=""/>
<privateslots title=""/>
<events title=""/>
<properties title=""/>
<friends title=""/>
</memberdef>
<authorsection visible="yes"/>
</group>
<!-- Layout definition for a directory page -->
<directory>
<briefdescription visible="yes"/>
<directorygraph visible="yes"/>
<memberdecl>
<dirs visible="yes"/>
<files visible="yes"/>
</memberdecl>
<detaileddescription title=""/>
</directory>
</doxygenlayout>
MathJax.Hub.Config({
TeX: {
// Enable automatic equation numbering
equationNumbers: {
autoNumber: "AMS"
}
}
});
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment