Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
e7696cb
docs: define C++23 migration and optimization roadmap
Alexander-Mitrofanov Aug 15, 2026
af0444b
build: require strict C++23
Alexander-Mitrofanov Aug 15, 2026
1054a32
test: update Catch for C++23
Alexander-Mitrofanov Aug 15, 2026
fcb1ebb
fix: make public code C++23 portable
Alexander-Mitrofanov Aug 15, 2026
99a129c
build: repair installed pkg-config metadata
Alexander-Mitrofanov Aug 15, 2026
ed0d2df
ci: test GCC 14 and Apple Clang C++23
Alexander-Mitrofanov Aug 15, 2026
33917f8
ci: quote C++ branch workflow filter
Alexander-Mitrofanov Aug 15, 2026
240f886
ci: rely on pull request branch filter
Alexander-Mitrofanov Aug 15, 2026
4604869
ci: install Autotools on macOS
Alexander-Mitrofanov Aug 15, 2026
c4369cb
ci: sanitize ViennaRNA GNU linker flag on macOS
Alexander-Mitrofanov Aug 15, 2026
d26c94f
build: export dependency header paths
Alexander-Mitrofanov Aug 15, 2026
9dd8809
ci: retain dependency runtime paths for consumer
Alexander-Mitrofanov Aug 15, 2026
1529156
test: add exhaustive exact predictor oracle
Alexander-Mitrofanov Aug 15, 2026
4648a3b
test: add exhaustive seeded predictor oracle
Alexander-Mitrofanov Aug 15, 2026
8014edb
docs: finalize C++23 migration evidence
Alexander-Mitrofanov Aug 15, 2026
9a0ba92
ci: validate C++23 optimization branches
Alexander-Mitrofanov Aug 15, 2026
3c8fbae
ci: quote C++23 branch filter
Alexander-Mitrofanov Aug 15, 2026
1b80b7a
ci: escape C++23 branch glob
Alexander-Mitrofanov Aug 15, 2026
4c4970f
build: enforce the used C++23 library surface
Alexander-Mitrofanov Aug 26, 2026
0adda43
modernize: use C++23 facilities in core paths
Alexander-Mitrofanov Aug 26, 2026
a7c48d4
docs: record substantive C++23 modernization
Alexander-Mitrofanov Aug 26, 2026
e20f798
Revise ChangeLog for IntaRNA updates and bug fixes
martin-raden Sep 21, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
147 changes: 108 additions & 39 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,53 +2,122 @@ name: C/C++ CI

on:
push:
branches: [ master ]
branches: [master, refactoring, 'refactor-to-c\+\+23']
pull_request:
branches: [ master ]

branches: [master, refactoring, 'refactor-to-c\+\+23']

defaults:
run:
shell: bash -el {0}


jobs:
build:

runs-on: ubuntu-latest
name: Build and test (${{ matrix.name }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- name: GCC 14 release
os: ubuntu-24.04
compiler: gcc
configure_debug: --disable-debug
- name: GCC 14 debug
os: ubuntu-24.04
compiler: gcc
configure_debug: --enable-debug
- name: Apple Clang release
os: macos-15
compiler: apple-clang
configure_debug: --disable-debug

steps:
- name: Check out sources
uses: actions/checkout@v4

- name: Set up conda environment
uses: conda-incubator/setup-miniconda@v4
with:
miniconda-version: latest
environment-file: conda-build-env.yml
activate-environment: intarna-build-env

- name: Install and select GCC 14
if: matrix.compiler == 'gcc'
run: |
sudo apt-get update
sudo apt-get install --yes gcc-14 g++-14
echo "CC=gcc-14" >> "$GITHUB_ENV"
echo "CXX=g++-14" >> "$GITHUB_ENV"
echo "LDFLAGS=-L${CONDA_PREFIX}/lib -Wl,-rpath,${CONDA_PREFIX}/lib" >> "$GITHUB_ENV"

- name: Verify GCC 14
if: matrix.compiler == 'gcc'
run: |
"$CC" --version
"$CXX" --version
test "$("$CC" -dumpfullversion | cut -d. -f1)" = 14
test "$("$CXX" -dumpfullversion | cut -d. -f1)" = 14

- name: Set up Apple Clang with OpenMP
if: matrix.compiler == 'apple-clang'
run: |
brew install libomp
libomp_prefix="$(brew --prefix libomp)"
echo "CC=/usr/bin/clang" >> "$GITHUB_ENV"
echo "CXX=/usr/bin/clang++" >> "$GITHUB_ENV"
echo "CPPFLAGS=-I${libomp_prefix}/include" >> "$GITHUB_ENV"
echo "CXXFLAGS=-Xpreprocessor -fopenmp" >> "$GITHUB_ENV"
echo "LDFLAGS=-L${libomp_prefix}/lib -Wl,-rpath,${libomp_prefix}/lib -L${CONDA_PREFIX}/lib -Wl,-rpath,${CONDA_PREFIX}/lib" >> "$GITHUB_ENV"
echo "LIBS=-lomp" >> "$GITHUB_ENV"
vrna_libs="$(pkg-config --libs RNAlib2)"
vrna_libs="${vrna_libs//-Wl,-fno-lto/}"
echo "VRNA_LIBS=${vrna_libs}" >> "$GITHUB_ENV"

- name: Verify Apple Clang
if: matrix.compiler == 'apple-clang'
run: |
"$CC" --version
"$CXX" --version
"$CXX" --version | grep -q "Apple clang"

- name: Bootstrap and configure
run: |
bash autotools-init.sh
./configure \
--prefix="$RUNNER_TEMP/intarna-install" \
--with-vrna="$CONDA_PREFIX" \
--with-boost="$CONDA_PREFIX" \
--with-boost-libdir="$CONDA_PREFIX/lib" \
--with-zlib="$CONDA_PREFIX" \
${{ matrix.configure_debug }}
grep -Eq '^CXX = .* -std=c\+\+23([[:space:]]|$)' Makefile
grep -q '^#define INTARNA_MULITHREADING 1' src/config.h

- name: Build, install, and run full test suite
run: |
make -j 2
make install
make tests -j 2
"$RUNNER_TEMP/intarna-install/bin/IntaRNA" -h

- name: Compile every installed public header independently
run: |
header_probe="$RUNNER_TEMP/intarna-header-probe.cpp"
for header in "$RUNNER_TEMP/intarna-install/include/IntaRNA/"*.h; do
printf '#include <IntaRNA/%s>\nint main() { return 0; }\n' "$(basename "$header")" > "$header_probe"
"$CXX" -std=c++23 ${CPPFLAGS:-} ${CXXFLAGS:-} \
-I"$RUNNER_TEMP/intarna-install/include" \
-I"$CONDA_PREFIX/include" \
-fsyntax-only "$header_probe"
done

- name: Check out sources from github
uses: actions/checkout@v2

- name: Setup conda environment
uses: conda-incubator/setup-miniconda@v2
with:
miniconda-version: "latest"
environment-file: conda-build-env.yml
activate-environment: conda-build-env

- name: Build and test IntaRNA
run: |
##### start IntaRNA build #####
pwd
# generate autotools's files
bash autotools-init.sh
# run configure (without boost checks)
ENVPREFIX=`conda info --base`/envs/conda-build-env
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ENVPREFIX/lib
./configure \
--prefix=$HOME/IntaRNA \
--with-vrna=$ENVPREFIX \
--with-boost=$ENVPREFIX \
--with-boost-libdir=$ENVPREFIX/lib \
--with-zlib=$ENVPREFIX
# compile documentation
# - make doxygen-doc
# compile, test and install IntaRNA
make -j 2 && make install
make tests -j 2
##### check IntaRNA build #####
# run installed IntaRNA with help output
$HOME/IntaRNA/bin/IntaRNA -h
- name: Compile and link an installed pkg-config consumer
run: |
consumer="$RUNNER_TEMP/intarna-consumer.cpp"
printf '#include <IntaRNA/RnaSequence.h>\nint main() { IntaRNA::RnaSequence rna("test", "ACGU"); return rna.size() == 4 ? 0 : 1; }\n' > "$consumer"
export PKG_CONFIG_PATH="$RUNNER_TEMP/intarna-install/lib/pkgconfig"
"$CXX" -std=c++23 ${CPPFLAGS:-} ${CXXFLAGS:-} "$consumer" \
${LDFLAGS:-} $(pkg-config --cflags --libs IntaRNA) \
-o "$RUNNER_TEMP/intarna-consumer"
"$RUNNER_TEMP/intarna-consumer"
24 changes: 24 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@

# IntaRNA

- C++23 required; build and installation checks with GCC 14 and Apple Clang
- reduce temporary allocations and fix cleanup on error paths
- avoid repeated partition-map lookups in exact ensemble prediction
- add exhaustive interaction and seed oracles for short-sequence tests
- BUGFIX : heuristic cell initialization and noLP ensemble recurrences
- BUGFIX : ensemble filtering and seed-extension partition reset
- BUGFIX : target accessibility limits and seed-free outMinPu filtering
Expand All @@ -30,6 +34,26 @@
################################################################################
################################################################################

260919 Alexander Mitrofanov
* configure.ac / m4 / .github/workflows/build.yml :
* C++23 requirement, library checks and GCC 14 / Apple Clang builds
* IntaRNA.pc.in :
* fix installed include and library flags
* IntaRNA/AccessibilityVrna / InteractionEnergyVrna :
* C++ string constraints, avoid sequence copies and ensure cleanup on errors
* bin/IntaRNA :
* automatic cleanup of accessibility, energy, output and predictor objects
* IntaRNA/OutputHandlerCsv / OutputHandlerEnsemble / OutputHandlerText :
* use stream views to avoid temporary string copies
* IntaRNA/PredictorMfeEns :
* updateZ() : single lookup for partition insertion and accumulation
* IntaRNA/RnaSequence :
* use string::contains() for alphabet and ambiguity checks
* tests :
+ exhaustive interaction and seed oracles for short-sequence tests
+ ViennaRNA constraint and repeated partition update tests
* update Catch to 2.13.10

260919 Alexander Mitrofanov
* IntaRNA/PredictorMfe2dHeuristic :
* IntaRNA/PredictorMfe2dHeuristicSeed :
Expand Down
20 changes: 10 additions & 10 deletions IntaRNA.pc.in
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
prefix=@PREFIX_PATH@
exec_prefix=${prefix}/bin
libdir=${prefix}/lib
includedir=${prefix}/include
Name: IntaRNA
Description: RNA-RNA interaction prediction C++ library
Version: @VERSION@
Libs: @LIBS@
Cflags:
prefix=@prefix@
exec_prefix=${prefix}
libdir=${prefix}/lib
includedir=${prefix}/include

Name: IntaRNA
Description: RNA-RNA interaction prediction C++ library
Version: @VERSION@
Libs: -L${libdir} -lIntaRNA @LIBS@
Cflags: -I${includedir} @BOOST_CPPFLAGS@ @VRNA_CFLAGS@
72 changes: 26 additions & 46 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ you with an encapsulated IntaRNA installation.
If you are going to compile IntaRNA from source, ensure you meet the following
dependencies:

- compiler supporting C++11 standard and OpenMP
- compiler supporting C++23 and OpenMP (GCC 14 or Apple Clang)
- [boost C++ library](http://www.boost.org/) version >= 1.50.0
(ensure the following libraries are installed for development (not just runtime libraries!); or install all e.g. in Ubuntu via package `libboost-all-dev`)
- libboost_regex
Expand Down Expand Up @@ -312,57 +312,34 @@ directory to your [`Path` System variable](http://www.computerhope.com/issues/ch
<br /><br />
<a name="instosx" />

## OS X installation with homebrew (thanks to Lars Barquist)
## macOS installation with Homebrew

If you do not want to or can use the pre-compiled binaries for OS X available from
[bioconda](https://anaconda.org/bioconda/intarna), you can compile `IntaRNA`
locally.
The [Bioconda package](https://anaconda.org/bioconda/intarna) is the simplest
installation route. To build locally with the system Apple Clang compiler,
install the dependencies and the OpenMP runtime:

The following wraps up how to build `IntaRNA-2.0.2` under OS X (Sierra 10.12.4) using homebrew.

First, install homebrew! :)

```[bash]
brew install gcc --without-multilib
```

`--without-multilib` is necessary for OpenMP multithreading support -- note
OS X default `gcc`/`clang` doesn't support OpenMP, so we need to install standard
`gcc`/`g++`

```[bash]
brew install boost --cc=gcc-6
```

`--cc=gcc-6` is necessary to build `boost` with standard `gcc`, rather than the
default bottle which appears to have been built with the system `clang`.
Brew installs `gcc`/`g++` as `/usr/local/bin/gcc-VERSION` by default to avoid
clashing with the system's `gcc`/`clang`. `6` is the current version as of
writing, but may change.

```[bash]
brew install viennarna
brew install doxygen
```

Download and extract the IntaRNA source code package (e.g. `intaRNA-2.0.2.tar.gz`) from the [release page](https://github.com/BackofenLab/IntaRNA/releases/latest).

```[bash]
./configure CC=gcc-6 CXX=g++-6
```bash
brew install autoconf automake boost libtool libomp pkg-config viennarna
```

This sets up makefiles to use standard `gcc`/`g++` from brew, which will
need an update to the appropriate compiler version if not still `6`.
You might also want to
set `--prefix=INSTALLPATH` if you dont want to install IntaRNA globally.
Apple Clang needs the Homebrew `libomp` headers, library and preprocessing flag.
The following keeps the normal optimized, multithreaded build:


```[bash]
make
make tests
```bash
LIBOMP_PREFIX="$(brew --prefix libomp)"
CPPFLAGS="-I${LIBOMP_PREFIX}/include" \
CXXFLAGS="-Xpreprocessor -fopenmp" \
LDFLAGS="-L${LIBOMP_PREFIX}/lib -Wl,-rpath,${LIBOMP_PREFIX}/lib" \
LIBS="-lomp" \
./configure CC=clang CXX=clang++
make -j2
make tests -j2
make install
```

Use `--prefix=INSTALLPATH` with `./configure` when a system-wide installation
is not desired.


[![up](doc/figures/icon-up.28.png) back to overview](#overview)

Expand Down Expand Up @@ -2209,6 +2186,11 @@ processed using doxygen to generate html/pdf versions.
When IntaRNA is build while `pkg-config` is present, according pkg-config
information is generated and installed too.

IntaRNA's public headers require C++23. External consumers must therefore
select `-std=c++23` (or a newer standard) in their own build; the installed
pkg-config metadata supplies IntaRNA and dependency flags but deliberately
does not override the consuming project's language mode.

## Mandatory `Easylogging++` initalization !

Since IntaRNA makes heavy use of the `Easylogging++` library, you have to add (and adapt)
Expand Down Expand Up @@ -2255,5 +2237,3 @@ flags are used within the IntaRNA configuration:
[![up](doc/figures/icon-up.38.png)](https://www.freepik.com/free-vector/colored-arrows_794372.htm)
Designed by Freepik



9 changes: 4 additions & 5 deletions conda-build-env.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

name: intarna-build-env

channels:
Expand All @@ -7,10 +6,10 @@ channels:
- defaults

dependencies:
- gcc_linux-64
- gxx_linux-64
- autoconf
- automake
- libtool
- pkgconfig
- zlib
- boost-cpp
- boost-cpp
- viennarna>=2.4.14

Loading
Loading