Skip to content

Commit

Permalink
Merge in 1.3.1 changes
Browse files Browse the repository at this point in the history
  • Loading branch information
benmwebb committed Dec 1, 2021
2 parents b1427b5 + 1f9442a commit e451271
Show file tree
Hide file tree
Showing 14 changed files with 166 additions and 22 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ jobs:
make -j 2
export LD_PRELOAD=/lib/x86_64-linux-gnu/libSegFault.so
ctest -j 2 --output-on-failure -L ${{ matrix.tests }}
- name: Upload coverage to codecov
- name: Combine coverage
run: |
cd build
(cd coverage && coverage combine && mv .coverage ..)
bash <(curl -s https://codecov.io/bash)
cd build/coverage
coverage combine && mv .coverage ../..
- uses: codecov/codecov-action@v1
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
# exclude patterns (uncomment them if you want to use them):
# *.[oa]
# *~
.DS_Store
*.os
*.o
*~
Expand Down
6 changes: 6 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
Change Log {#changelog}
==========

# 1.3.1 - 2021-12-01 # {#changelog_1_3_1}
- Various build fixes for newer versions of gcc and clang.
- Build fixes for Fedora 33 or later.
- Add support for Python 3.10.
- Minor documentation improvements.

# 1.3 - 2021-04-21 # {#changelog_1_3}
- All RMF binaries now support the --version flag, and the RMF library itself
is versioned.
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# RMF #

[![Build Status](https://github.com/salilab/rmf/workflows/build/badge.svg?branch=develop)](https://github.com/salilab/rmf/actions?query=workflow%3Abuild)
[![conda package](https://img.shields.io/conda/vn/conda-forge/rmf.svg)](https://anaconda.org/conda-forge/rmf)
[![codecov](https://codecov.io/gh/salilab/rmf/branch/develop/graph/badge.svg)](https://codecov.io/gh/salilab/rmf)
[![Code Climate](https://codeclimate.com/github/salilab/rmf/badges/gpa.svg)](https://codeclimate.com/github/salilab/rmf)
[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.4701672.svg)](https://doi.org/10.5281/zenodo.4701672)
Expand Down
44 changes: 44 additions & 0 deletions cmake_modules/FindRMF.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
#[=======================================================================[.rst:
FindRMF
-------
Try to find RMF
Result Variables
^^^^^^^^^^^^^^^^
This module defines the following variables:
``RMF_FOUND``
system has RMF
``RMF_INCLUDE_PATH``
the RMF include directory
``RMF_SWIG_PATH``
the directory containing SWIG (.i) files for RMF
``RMF_LIBRARY``
Link this to use RMF
``RMF_VERSION_STRING``
the version of RMF found
#]=======================================================================]


find_path(RMF_INCLUDE_PATH RMF.h PATH_SUFFIXES include)
find_path(RMF_SWIG_PATH RMF.i PATH_SUFFIXES share/RMF/swig)
if (NOT RMF_LIBRARY)
find_library(RMF_LIBRARY NAMES RMF PATH_SUFFIXES lib)
endif()

if (RMF_INCLUDE_PATH AND EXISTS "${RMF_INCLUDE_PATH}/RMF/config.h")
file(STRINGS "${RMF_INCLUDE_PATH}/RMF/config.h" RMF_MAJOR_H REGEX "#define RMF_VERSION_MAJOR +([0-9]+)")
file(STRINGS "${RMF_INCLUDE_PATH}/RMF/config.h" RMF_MINOR_H REGEX "#define RMF_VERSION_MINOR +([0-9]+)")
string(REGEX REPLACE " *#define RMF_VERSION_MAJOR +([0-9]+) *" "\\1" RMF_VERSION_MAJOR "${RMF_MAJOR_H}")
string(REGEX REPLACE " *#define RMF_VERSION_MINOR +([0-9]+) *" "\\1" RMF_VERSION_MINOR "${RMF_MINOR_H}")
set(RMF_VERSION_STRING "${RMF_VERSION_MAJOR}.${RMF_VERSION_MINOR}")
endif()

include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(RMF
REQUIRED_VARS RMF_LIBRARY RMF_INCLUDE_PATH RMF_SWIG_PATH
VERSION_VAR RMF_VERSION_STRING)
13 changes: 10 additions & 3 deletions cmake_modules/IMPFindC++11.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,16 @@ if(IMP_CXX11)
set(IMP_CXX11_FLAGS "--std=c++0x" CACHE INTERNAL "" FORCE)
endif()
elseif("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
# Modern clang uses C++14 by default; don't force older C++11
if(APPLE AND DARWIN_VERSION GREATER 18)
message(STATUS "Using clang C++11 (or later) support")
execute_process(COMMAND ${CMAKE_CXX_COMPILER} --version
OUTPUT_VARIABLE CLANG_VERSION)
if(CLANG_VERSION MATCHES "clang version ([0-9.]+)")
set(CLANG_VERSION ${CMAKE_MATCH_1})
endif()
message(STATUS "clang version: ${CLANG_VERSION}")
# Modern clang (6 or later) uses C++14 by default; don't force older C++11
if(CLANG_VERSION VERSION_GREATER 6.0)
message(STATUS "Enabling clang C++17 support")
set(IMP_CXX11_FLAGS "--std=c++17" CACHE INTERNAL "" FORCE)
# c++11's std::move (which boost/CGAL use) doesn't work until
# OS X 10.9 (Darwin version 13)
elseif(APPLE AND DARWIN_VERSION LESS 13)
Expand Down
4 changes: 2 additions & 2 deletions doc/Developers.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ This page documents various internal aspects of how the RMF library works and is

# Developer tools # {#dev_tools}

RMF uses the [Salilab developer tools](http://www.github.com/salilab/developer_tools) to provide basic developer tools in a way that is shared with [IMP](http://integrativemodeling.org). This is included as a subrepository. Read the docs of that repository for more information.
RMF uses the [Salilab developer tools](https://github.com/salilab/developer_tools) to provide basic developer tools in a way that is shared with [IMP](https://integrativemodeling.org). This is included as a subrepository. Read the docs of that repository for more information.

# CMake tools # {#cmake_tools}

RMF uses [Salilab cmake modules](http://www.github.com/salilab/cmake_modules) to provide some extensions to [CMake](http://cmake.org). This is included as a subrepository.
RMF uses [Salilab cmake modules](https://github.com/salilab/cmake_modules) to provide some extensions to [CMake](https://cmake.org). This is included as a subrepository.

# Decorators # {#makedecorators}

Expand Down
4 changes: 2 additions & 2 deletions doc/FileFormat.md
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ nodes.

When adding data to an %RMF file that is just to be used for internal
consumption, one should create a new category. For example,
[IMP](http://www.integrativemodeling.org) defines an ''imp'' category
[IMP](https://integrativemodeling.org) defines an ''imp'' category
when arbitrary particle data are stored.

If, instead, the data is likely to be a general interest, it probably
Expand All @@ -183,7 +183,7 @@ methods are supported: files with suffix `.rmf` and `.rmfz` and buffers
in memory.

The current format stores the structure in an [Avro Object
Container](http://avro.apache.org/docs/1.7.5/spec.html#Object+Container+Files). If
Container](https://avro.apache.org/docs/1.7.5/spec.html#Object+Container+Files). If
the `.rmfz` suffix is used, the contents are compressed. The structure
is stored as a series of records, each containing either a frame or
static data (there can be multiple static data frames - they are
Expand Down
69 changes: 69 additions & 0 deletions doc/Installation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
Installation {#installation}
============

# Binary installation # {#binary}

The simplest way to obtain RMF is by using a pre-built binary, either
standalone or as part of [IMP](https://integrativemodeling.org).

Standalone: if you are using [Anaconda Python](https://www.anaconda.com/), install with

conda install -c conda-forge rmf

IMP: Download an IMP binary (which includes RMF) from the
[IMP download page](https://integrativemodeling.org/download.html).

# Source code installation # {#source}

## Prerequisites {#installation_prereqs}

In order to build from source, you will need:

- [CMake](https://cmake.org) (2.8.12 or later; 3.14 or later is recommended)
- [Boost](https://www.boost.org) (1.53 or later; Boost.Iostreams must be built
with its [zlib filter enabled](https://www.boost.org/doc/libs/1_67_0/libs/iostreams/doc/installation.html))
- [Python](https://www.python.org) (2.7 or later, or any version of Python 3)
- [SWIG](http://www.swig.org) (1.3.40 or later; 2.0.4 or later is needed
if you want to use Python 3)

If you want to be able to read older format RMF files, you will also need:

- [HDF5](https://support.hdfgroup.org/HDF5/) (1.8 or later; 1.10 or 1.12
should also work)

## Download {#installation_download}

- Use [git](https://git-scm.com/) to get the code
directly from our [GitHub repository](https://github.com/salilab/rmf)
with something like:

git clone -b main https://github.com/salilab/rmf.git

(the `main` branch tracks the most recent stable
release; alternatively you can use `develop` to get the most recent code).

## Compilation {#installation_compilation}

Make a separate directory to keep the compiled version of RMF in (it's tidier
to keep this separate from the source code, and if you need to later you can
just delete this directory without affecting the source). Set up the build
with CMake, then finally compile it, with something like:

mkdir build
cd build
cmake <path to RMF source> -DCMAKE_BUILD_TYPE=Release
make -j8

## Testing {#installation_testing}
Once the compilation is complete, you can optionally run the test suite.
Test are run using `ctest`. A good start is to run `ctest --output-on-failure`.

Tests are labeled with the cost of the test, so to run just the cheap tests,
use `ctest -L CHEAP`.

## Installation {#installation_install}

Once everything is compiled (and optionally tested) you can install RMF
by simply running `make install`. If you opted to install in a non-standard
location, it is up to you to set up your environment variables so that RMF
can be found (you may need to set `PATH`, `PYTHONPATH`, and `LD_LIBRARY_PATH`).
5 changes: 3 additions & 2 deletions doc/Main.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@ and score data.

The RMF source code is available [on github](https://github.com/salilab/rmf/).
It can be built standalone, although it is generally used as part of
[IMP](http://integrativemodeling.org).
[IMP](https://integrativemodeling.org).

See
- [Installation](\ref installation) for information on obtaining and installing RMF.
- [RMF viewers](\ref viewing) for more information about viewing RMF files,
- [RMF file format](\ref format) for more information about the files,
- [RMF Library](\ref library) for more information about using the library.
Expand All @@ -24,4 +25,4 @@ Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0
https://www.apache.org/licenses/LICENSE-2.0
16 changes: 14 additions & 2 deletions include/RMF/compiler_macros.h
Original file line number Diff line number Diff line change
Expand Up @@ -159,15 +159,27 @@
#define RMF_GCC_PROTOTYPES
#endif

// Warn about missing RMF_OVERRIDE on virtual methods if gcc is new enough
#if __GNUC__ > 5 || (__GNUC__ == 5 && __GNUC_MINOR__ >= 1)
#ifdef RMF_SWIG_WRAPPER
#define RMF_GCC_OVERRIDE
#else
#define RMF_GCC_OVERRIDE \
RMF_GCC_PRAGMA(diagnostic warning "-Wsuggest-override")
#endif
#else
#define RMF_GCC_OVERRIDE
#endif

#define RMF_COMPILER_WARNINGS \
RMF_GCC_PRAGMA(diagnostic warning "-Wall") \
RMF_GCC_PRAGMA(diagnostic warning "-Wextra") \
RMF_GCC_PRAGMA(diagnostic warning "-Winit-self") \
RMF_GCC_PRAGMA(diagnostic warning "-Wcast-align") \
RMF_GCC_PRAGMA(diagnostic warning "-Woverloaded-virtual") \
RMF_GCC_PRAGMA(diagnostic ignored "-Wconversion") \
RMF_GCC_PRAGMA(diagnostic warning \
"-Wundef") RMF_GCC_PROTOTYPES RMF_GCC_CXX0X_COMPAT
RMF_GCC_PRAGMA(diagnostic warning "-Wundef") \
RMF_GCC_PROTOTYPES RMF_GCC_CXX0X_COMPAT RMF_GCC_OVERRIDE

#elif defined(_MSC_VER)
#define RMF_COMPILER_WARNINGS \
Expand Down
2 changes: 1 addition & 1 deletion include/RMF/exceptions.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class RMFEXPORT Exception : public virtual std::exception,
public:
RMF_CXX11_DEFAULT_COPY_CONSTRUCTOR(Exception);
Exception();
const char* what() const RMF_NOEXCEPT;
const char* what() const RMF_NOEXCEPT RMF_OVERRIDE;
virtual ~Exception() RMF_NOEXCEPT;
};

Expand Down
6 changes: 3 additions & 3 deletions include/RMF/internal/SharedDataData.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ struct KeyData : public RMF_LARGE_UNORDERED_MAP<NodeID, typename Traits::Type> {
KeyData() {}
};

// boost flat_map::operator[] segfaults on Fedora 32; use std::map instead
// boost flat_map::operator[] segfaults on Fedora 32+; use std::map instead
template <class Traits>
#if __GNUC__ == 10 && __GNUC_MINOR__ == 0
#if __GNUC__ >= 10
struct TypeData : std::map<ID<Traits>, KeyData<Traits> > {
typedef std::map<ID<Traits>, KeyData<Traits> > P;
#else
Expand All @@ -44,7 +44,7 @@ struct TypeData : RMF_SMALL_UNORDERED_MAP<ID<Traits>, KeyData<Traits> > {
P::operator=(o);
return *this;
}
void swap(TypeData<Traits>& o) { std::swap<P>(*this, o); }
void swap(TypeData<Traits>& o) { P::swap(o); }
};

#define RMF_SHARED_DATA_TYPE_PARENT(Traits, UCName) , public TypeData<Traits>
Expand Down
9 changes: 6 additions & 3 deletions tools/dev_tools/cleanup_code.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@
except ImportError:
from Queue import Queue # python2
from threading import Thread
import distutils.spawn
try:
from shutil import which # python3.3 or later
except ImportError:
from distutils.spawn import find_executable as which

sys.path.append(os.path.split(sys.argv[0]))
import python_tools
Expand Down Expand Up @@ -60,13 +63,13 @@
if options.clang_format == "auto":
options.clang_format = None
for name in ["clang-format-3.4", "clang-format"]:
if distutils.spawn.find_executable(name):
if which(name):
options.clang_format = name
break
if options.autopep8 == "auto":
options.autopep8 = None
for name in ["autopep8"]:
if distutils.spawn.find_executable(name):
if which(name):
options.autopep8 = name
break

Expand Down

0 comments on commit e451271

Please sign in to comment.