Skip to content

Commit

Permalink
VSEARCH 2.29.3: Avoid alignment bug with g++ -O3 on x86_64
Browse files Browse the repository at this point in the history
  • Loading branch information
torognes committed Feb 3, 2025
1 parent 04a4b4e commit bbd17a0
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 15 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ RUN apk add --no-cache \
libstdc++ zlib-dev bzip2-dev \
autoconf automake make g++ && \
./autogen.sh && \
./configure CFLAGS="-O3" CXXFLAGS="-O3" && \
./configure CFLAGS="-O2" CXXFLAGS="-O2" && \
make clean && \
make && \
make install && \
Expand Down
22 changes: 12 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ Most of the nucleotide based commands and options in USEARCH version 7 are suppo

## Getting Help

If you can't find an answer in the [VSEARCH documentation](https://github.com/torognes/vsearch/releases/download/v2.29.2/vsearch_manual.pdf), please visit the [VSEARCH Web Forum](https://groups.google.com/forum/#!forum/vsearch-forum) to post a question or start a discussion.
If you can't find an answer in the [VSEARCH documentation](https://github.com/torognes/vsearch/releases/download/v2.29.3/vsearch_manual.pdf), please visit the [VSEARCH Web Forum](https://groups.google.com/forum/#!forum/vsearch-forum) to post a question or start a discussion.

## Example

Expand All @@ -52,16 +52,18 @@ In the example below, VSEARCH will identify sequences in the file database.fsa t
**Source distribution** To download the source distribution from a [release](https://github.com/torognes/vsearch/releases) and build the executable and the documentation, use the following commands:

```
wget https://github.com/torognes/vsearch/archive/v2.29.2.tar.gz
tar xzf v2.29.2.tar.gz
cd vsearch-2.29.2
wget https://github.com/torognes/vsearch/archive/v2.29.3.tar.gz
tar xzf v2.29.3.tar.gz
cd vsearch-2.29.3
./autogen.sh
./configure CFLAGS="-O3" CXXFLAGS="-O3"
./configure CFLAGS="-O2" CXXFLAGS="-O2"
make ARFLAGS="cr"
sudo make install
```

You may customize the installation directory using the `--prefix=DIR` option to `configure`. If the compression libraries [zlib](https://www.zlib.net) and/or [bzip2](https://www.sourceware.org/bzip2/) are installed on the system, they will be detected automatically and support for compressed files will be included in vsearch (see section **Dependencies** below). Support for compressed files may be disabled using the `--disable-zlib` and `--disable-bzip2` options to `configure`. A PDF version of the manual will be created from the `vsearch.1` manual file if `ps2pdf` is available, unless disabled using the `--disable-pdfman` option to `configure`. It is recommended to run configure with the options `CFLAGS="-O3"` and `CXXFLAGS="-O3"`. Other options may also be applied to `configure`, please run `configure -h` to see them all. GNU autoconf (version 2.63 or later), automake and the GCC C++ (`g++`) compiler is required to build vsearch. Version 3.82 or later of `make` may be required on Linux, while version 3.81 is sufficient on macOS.
You may customize the installation directory using the `--prefix=DIR` option to `configure`. If the compression libraries [zlib](https://www.zlib.net) and/or [bzip2](https://www.sourceware.org/bzip2/) are installed on the system, they will be detected automatically and support for compressed files will be included in vsearch (see section **Dependencies** below). Support for compressed files may be disabled using the `--disable-zlib` and `--disable-bzip2` options to `configure`. A PDF version of the manual will be created from the `vsearch.1` manual file if `ps2pdf` is available, unless disabled using the `--disable-pdfman` option to `configure`. It is recommended to run configure with the options `CFLAGS="-O2"` and `CXXFLAGS="-O2"`. Other options may also be applied to `configure`, please run `configure -h` to see them all. GNU autoconf (version 2.63 or later), automake and the GCC C++ (`g++`) compiler is required to build vsearch. Version 3.82 or later of `make` may be required on Linux, while version 3.81 is sufficient on macOS.

Warning: Compiling the `align_simd.cc` file on x86_64 systems with the GNU C++ compiler version 9 or later with the `-O3` optimization option results in incorrect code that may cause bad alignments in some circumstances. We are investigating this issue further, but for now we recommend compiling with the `-O2` flag.

To build VSEARCH on Debian and similar Linux distributions (Ubuntu etc) you'll need the following packages: autoconf, automake, g++, ghostscript, groff, libbz2-dev, make, zlib1g-dev. Include libsimde-dev to build on riscv64 or mips64el.

Expand All @@ -73,7 +75,7 @@ Instead of downloading the source distribution as a compressed archive, you coul
git clone https://github.com/torognes/vsearch.git
cd vsearch
./autogen.sh
./configure CFLAGS="-O3" CXXFLAGS="-O3"
./configure CFLAGS="-O2" CXXFLAGS="-O2"
make ARFLAGS="cr"
sudo make install
```
Expand All @@ -89,7 +91,7 @@ wget https://github.com/torognes/vsearch/releases/download/v{VERSION}/vsearch-{V
tar xzf vsearch-{VERSION}-{OS}-{ARCH}.tar.gz
```

Replace `{VERSION}` with the VSEARCH version number (e.g. `2.29.2`), `{OS}` with the target operating system (`linux` or `macos`), and `{ARCH}` with the architecture (`x86_64`, `aarch64`, `ppc64le`, `riscv64`, or `mips64el`). You could add `-static` after `{ARCH}` to get a statically compiled version for Linux (except x86_64). The name of the binary for the RHEL 7 and CentOS 7 Linux distributions ends in `-ubi7`.
Replace `{VERSION}` with the VSEARCH version number (e.g. `2.29.3`), `{OS}` with the target operating system (`linux` or `macos`), and `{ARCH}` with the architecture (`x86_64`, `aarch64`, `ppc64le`, `riscv64`, or `mips64el`). You could add `-static` after `{ARCH}` to get a statically compiled version for Linux (except x86_64). The name of the binary for the RHEL 7 and CentOS 7 Linux distributions ends in `-ubi7`.

Or, if you are using Windows, download and extract (unzip) the contents of this file:

Expand All @@ -113,7 +115,7 @@ and `zlib1.dll` files required for reading compressed input
files. These DLL's have been obtained for mingw-w64 from the MSYS2
platform.

**Documentation:** The VSEARCH user's manual is available in the `man` folder in the form of a [man page](https://github.com/torognes/vsearch/blob/master/man/vsearch.1). A pdf version ([vsearch_manual.pdf](https://github.com/torognes/vsearch/releases/download/v2.29.2/vsearch_manual.pdf)) will be generated by `make`. To install the manpage manually, copy the `vsearch.1` file or a create a symbolic link to `vsearch.1` in a folder included in your `$MANPATH`. The manual in both formats is also available with the binary distribution. The manual in PDF form ([vsearch_manual.pdf](https://github.com/torognes/vsearch/releases/download/v2.29.2/vsearch_manual.pdf)) is also attached to the latest [release](https://github.com/torognes/vsearch/releases).
**Documentation:** The VSEARCH user's manual is available in the `man` folder in the form of a [man page](https://github.com/torognes/vsearch/blob/master/man/vsearch.1). A pdf version ([vsearch_manual.pdf](https://github.com/torognes/vsearch/releases/download/v2.29.3/vsearch_manual.pdf)) will be generated by `make`. To install the manpage manually, copy the `vsearch.1` file or a create a symbolic link to `vsearch.1` in a folder included in your `$MANPATH`. The manual in both formats is also available with the binary distribution. The manual in PDF form ([vsearch_manual.pdf](https://github.com/torognes/vsearch/releases/download/v2.29.3/vsearch_manual.pdf)) is also attached to the latest [release](https://github.com/torognes/vsearch/releases).


## Packages, plugins, and wrappers
Expand Down Expand Up @@ -157,7 +159,7 @@ Compiling VSEARCH requires either GCC (`g++`) or `clang`, `make` and the autotoo

VSEARCH will automatically check whether these libraries are available and load them dynamically.

On Windows these libraries are called `zlib1.dll` and `libbz2.dll`. These DLL's are included with the released distribution of vsearch 2.29.2 and later.
On Windows these libraries are called `zlib1.dll` and `libbz2.dll`. These DLL's are included with the released distribution of vsearch 2.29.3 and later.

To create the PDF file with the manual the ps2pdf tool is required. It is part of the `ghostscript` package.

Expand Down
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Process this file with autoconf to produce a configure script.

AC_PREREQ([2.63])
AC_INIT([vsearch], [2.29.2], [[email protected]], [vsearch], [https://github.com/torognes/vsearch])
AC_INIT([vsearch], [2.29.3], [[email protected]], [vsearch], [https://github.com/torognes/vsearch])
AC_CANONICAL_TARGET
AM_INIT_AUTOMAKE([subdir-objects])
AC_LANG([C++])
Expand Down
2 changes: 1 addition & 1 deletion dockerfiles/Dockerfile.debian
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ RUN apt-get -y install \
make \
zlib1g-dev
RUN ./autogen.sh
RUN ./configure CFLAGS="-O3" CXXFLAGS="-O3"
RUN ./configure CFLAGS="-O2" CXXFLAGS="-O2"
RUN make clean
RUN make ARFLAGS="cr"
RUN make install
Expand Down
2 changes: 1 addition & 1 deletion dockerfiles/Dockerfile.fedora
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ RUN yum -y install \
make \
zlib-devel
RUN ./autogen.sh
RUN ./configure CFLAGS="-O3" CXXFLAGS="-O3"
RUN ./configure CFLAGS="-O2" CXXFLAGS="-O2"
RUN make clean
RUN make ARFLAGS="cr"
RUN make install
Expand Down
12 changes: 11 additions & 1 deletion man/vsearch.1
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.\" import www macros (URL, TAG, MTO)
.mso www.tmac
.\" ============================================================================
.TH vsearch 1 "December 20, 2024" "version 2.29.2" "USER COMMANDS"
.TH vsearch 1 "February 3, 2025" "version 2.29.3" "USER COMMANDS"
.\" ============================================================================
.SH NAME
vsearch \(em a versatile open-source tool for microbiome analysis,
Expand Down Expand Up @@ -4998,6 +4998,16 @@ documentation.
.BR v2.29.2\~ "released December 20th, 2024"
Fix a segmentation fault during clustering when the set of clusters is empty.
Initial documentation in markdown format available on GitHub Pages.
.TP
.BR v2.29.3\~ "released February 3rd, 2025"
This version is released in order to mitigate a bug that occurs when
compiling the `align_simd.cc` file on x86_64 systems with the GNU C++
compiler version 9 or later with the `-O3` optimization option. It
results in incorrect code that may cause bad alignments in some
circumstances. We are investigating this issue further, but for now we
recommend compiling with the `-O2` flag. The README.md file and the
Dockerfiles have been updated to reflect this. The binaries released
with this version will include this fix.
.\" ============================================================================
.\" TODO:
.\"
Expand Down

0 comments on commit bbd17a0

Please sign in to comment.