Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove windows from CI #8

Merged
merged 5 commits into from
Dec 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 1 addition & 2 deletions .github/workflows/ci-cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-24.04, macos-13, macos-14, windows-2022]
os: [ubuntu-24.04, macos-13, macos-14]
env:
# Indicates the location of the vcpkg as a Git submodule of the project repository.
# Not using "VCPKG_ROOT" because a variable with the same name is defined in the VS's
Expand Down Expand Up @@ -105,7 +105,6 @@ jobs:
- name: run benchmarks
run: |
./builds/ninja-multi-vcpkg/Release/fastplong_benchmarks
if: runner.os != 'Windows'

- name: run tests
run: |
Expand Down
55 changes: 34 additions & 21 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,21 @@ find_package(benchmark CONFIG REQUIRED)
find_package(libdeflate CONFIG REQUIRED)

if (MSVC)
find_package(unofficial-isal CONFIG REQUIRED)
set(
FASTPLONG_LIBS
hwy::hwy
unofficial::isal::isal
$<IF:$<TARGET_EXISTS:libdeflate::libdeflate_shared>,libdeflate::libdeflate_shared,libdeflate::libdeflate_static>
)
find_package(unofficial-isal CONFIG REQUIRED)
set(
FASTPLONG_LIBS
hwy::hwy
unofficial::isal::isal
$<IF:$<TARGET_EXISTS:libdeflate::libdeflate_shared>,libdeflate::libdeflate_shared,libdeflate::libdeflate_static>
)
else()
set(
FASTPLONG_LIBS
hwy::hwy
$<IF:$<TARGET_EXISTS:libdeflate::libdeflate_shared>,libdeflate::libdeflate_shared,libdeflate::libdeflate_static>
-lisal
)
set(
FASTPLONG_LIBS
hwy::hwy
$<IF:$<TARGET_EXISTS:libdeflate::libdeflate_shared>,libdeflate::libdeflate_shared,libdeflate::libdeflate_static>
-lisal
-lpthread
)
endif()

if (CMAKE_CXX_COMPILER_ARCHITECTURE_ID MATCHES "x86_64")
Expand Down Expand Up @@ -74,48 +75,60 @@ set(
test/sequence_test.cpp
)
include_directories(
# intel mac install location
/usr/local/include
# arm64 mac install location
/opt/homebrew/include
)
link_directories(
# intel mac install location
/usr/local/lib
# arm64 mac install location
/opt/homebrew/lib
)

add_library(fastplong_core ${FASTPLONG_SOURCES})
target_link_libraries(
fastplong_core PRIVATE
${FASTPLONG_LIBS}
)

if (NOT MSVC)
# benchmark target
add_executable(fastplong_benchmarks)
target_sources(
fastplong_benchmarks PRIVATE
add_executable(fastplong_benchmarks
benchmarks/sequence_benchmark.cpp
test/globals.cpp
${FASTPLONG_SOURCES}
)
target_link_libraries(
fastplong_benchmarks PRIVATE
${FASTPLONG_LIBS}
fastplong_core
benchmark::benchmark
benchmark::benchmark_main
)
endif()
# main target
add_executable(fastplong src/main.cpp ${FASTPLONG_SOURCES})
add_executable(fastplong src/main.cpp)
target_link_libraries(
fastplong PUBLIC
fastplong_core
${FASTPLONG_LIBS}
)
# tests target
enable_testing()
find_package(GTest CONFIG REQUIRED)
add_executable(fastplong_tests ${FASTPLONG_SOURCES} ${FASTPLONG_TEST_SOURCES})
add_executable(fastplong_tests ${FASTPLONG_TEST_SOURCES})
target_link_libraries(
fastplong_tests PRIVATE
${FASTPLONG_LIBS}
fastplong_core
GTest::gtest
GTest::gtest_main
-lpthread
)
add_test(fastplong_tests fastplong_tests)
add_test(fastplong_tests fastplong_tests)

install(TARGETS fastplong
CONFIGURATIONS Release
RUNTIME
DESTINATION bin
)
6 changes: 0 additions & 6 deletions CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,6 @@
"displayName": "Build (Release)",
"description": "Build with Ninja/vcpkg (Release)",
"configuration": "Release"
},
{
"name": "ninja-vcpkg",
"configurePreset": "ninja-multi-vcpkg",
"displayName": "Build",
"description": "Build with Ninja/vcpkg"
}
],
"testPresets": [
Expand Down
20 changes: 10 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,15 @@ else
endef
endif

CMAKE_FLAGS := -DCMAKE_BUILD_TYPE=$(CMAKE_BUILD_TYPE)
# Extra CMake flags which extend the default set
CMAKE_EXTRA_FLAGS := -DCMAKE_TOOLCHAIN_FILE=vcpkg/scripts/buildsystems/vcpkg.cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=ON
build: builds/ninja-multi-vcpkg/build.ninja
cmake --build --preset ninja-vcpkg-release

all: build
clean:
cmake --build --preset ninja-vcpkg-release --target clean

build: builds/.ran-cmake
cmake --build --preset ninja-vcpkg-release
install: build
cmake --install builds/ninja-multi-vcpkg
@echo "Installed."

test: build
./builds/ninja-multi-vcpkg/Release/fastplong_tests
Expand All @@ -38,13 +39,12 @@ format:
find src -name "*.h" | xargs clang-format -i

lint: builds/.ran-cmake
python3 scripts/run-clang-tidy.py -p builds/ninja-multi-vcpkg
run-clang-tidy -p builds/ninja-multi-vcpkg

vcpkg/.vcpkg-root:
git submodule update --init --recursive

builds/.ran-cmake: vcpkg/.vcpkg-root
$(CMAKE) -B builds/ninja-multi-vcpkg -G "Ninja Multi-Config" $(CMAKE_FLAGS) $(CMAKE_EXTRA_FLAGS) -S .
$(TOUCH) $@
builds/ninja-multi-vcpkg/build.ninja: vcpkg/.vcpkg-root CMakeLists.txt CMakePresets.json
$(CMAKE) --preset "ninja-multi-vcpkg"

.PHONY: lint build test format benchmark
29 changes: 18 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
[![install with conda](
https://anaconda.org/bioconda/fastplong/badges/version.svg)](https://anaconda.org/bioconda/fastplong)
# fastplong
Ultrafast preprocessing and quality control for long reads (Nanopore, PacBio, Cyclone, etc.).
If you're searching for tools to preprocess short reads (Illumina, MGI, etc.), please use [fastp](https://github.com/OpenGene/fastp)
Ultrafast preprocessing and quality control for long reads (Nanopore, PacBio, Cyclone, etc.).
If you're searching for tools to preprocess short reads (Illumina, MGI, etc.), please use [fastp](https://github.com/OpenGene/fastp)

- [simple usage](#simple-usage)
- [examples of report](#examples-of-report)
- [get fastplong](#get-fastplong)
- [install with Bioconda](#install-with-bioconda)
- [download the latest prebuilt binary for Linux users](#download-the-latest-prebuilt-binary-for-linux-users)
- [or compile from source](#or-compile-from-source)
- [Step 1: install isa-l](#step-1-install-isa-l)
- [step 2: install libdeflate](#step-2-install-libdeflate)
- [Step 1: install build tools](#step-1-install-build-tools)
- [Step 2: install isa-l](#step-2-install-isa-l)
- [Step 3: download and build fastplong](#step-3-download-and-build-fastplong)
- [input and output](#input-and-output)
- [output to STDOUT](#output-to-stdout)
Expand All @@ -37,7 +37,7 @@ If you're searching for tools to preprocess short reads (Illumina, MGI, etc.), p
```
fastplong -i in.fq -o out.fq
```
Both input and output can be gzip compressed. By default, the HTML report is saved to `fastplong.html` (can be specified with `-h` option), and the JSON report is saved to `fastplong.json` (can be specified with `-j` option).
Both input and output can be gzip compressed. By default, the HTML report is saved to `fastplong.html` (can be specified with `-h` option), and the JSON report is saved to `fastplong.json` (can be specified with `-j` option).

# examples of report
`fastplong` creates reports in both HTML and JSON format.
Expand All @@ -64,15 +64,22 @@ mv fastplong.0.2.2 fastplong
chmod a+x ./fastplong
```
## or compile from source
`fastplong` depends on `libdeflate` and `isa-l` for fast decompression and compression of zipped data.
`fastplong` depends on `ninja-build` and `cmake` for building, and `isa-l` for fast decompression and compression of zipped data.

### Step 1: install isa-l
### Step 1: install build tools
To build `fastplong` you will need some build tools.
```bash
sudo apt update && sudo apt install cmake make g++ gdb ninja-build curl zip unzip tar pkg-config
```
On Mac OSX
```bash
brew install ninja cmake make gdb zip unzip pkg-config
```

### Step 2: install isa-l
It's recommended that to install it using your package manager, for example `apt install libisal-dev` on ubuntu, or `brew install isa-l` on Mac. Otherwise you can compile it from source. Please be noted that `isa-l` is not compatible with gcc 4.8 or older versions. See https://github.com/intel/isa-l
`autoconf`, `automake`, `libtools`, `nasm (>=2.11.01)` and `yasm (>=1.2.0)` are required to build isa-l.

### step 2: install libdeflate
It's recommended that to install it using your package manager, for example `apt install libdeflate-dev` on ubuntu, or `brew install libdeflate` on Mac. Otherwise you can compile it from source. See https://github.com/ebiggers/libdeflate

### Step 3: download and build fastplong
```shell
# get source (you can also use browser to download from master or releases)
Expand Down Expand Up @@ -186,7 +193,7 @@ Specify `--split_by_lines` to limit the lines of each file. The last files may h
usage: fastplong -i <in> -o <out> [options...]
fastplong: ultra-fast FASTQ preprocessing and quality control for long reads
version 0.0.1
usage: ./fastplong [options] ...
usage: ./fastplong [options] ...
options:
-i, --in read input file name (string [=])
-o, --out read output file name (string [=])
Expand Down