From fd2376f3e635065219c514a5b778f6763783b780 Mon Sep 17 00:00:00 2001 From: Ivan Sovic Date: Fri, 22 Mar 2019 23:04:29 -0700 Subject: [PATCH 01/14] Added the Meson build support to Racon. Also, a very simple Makefile is added here which just wraps the one-liner usage. --- .gitignore | 3 ++ Makefile | 20 +++++++ meson.build | 117 +++++++++++++++++++++++++++++++++++++++++ src/meson.build | 21 ++++++++ src/version.hpp.in | 22 ++++++++ subprojects/gtest.wrap | 10 ++++ subprojects/zlib.wrap | 10 ++++ test/meson.build | 20 +++++++ vendor/meson.build | 35 ++++++++++++ 9 files changed, 258 insertions(+) create mode 100644 Makefile create mode 100644 meson.build create mode 100644 src/meson.build create mode 100644 src/version.hpp.in create mode 100644 subprojects/gtest.wrap create mode 100644 subprojects/zlib.wrap create mode 100644 test/meson.build create mode 100644 vendor/meson.build diff --git a/.gitignore b/.gitignore index f9d0a24..595c557 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,5 @@ # Compiled Object files build +subprojects +!subprojects/*.wrap + diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..b6ee82b --- /dev/null +++ b/Makefile @@ -0,0 +1,20 @@ +.PHONY: all clean release debug debug-gcc6 dist modules + +all: release + +clean: + rm -rf build + +release: + @echo "[Invoking Meson]" + @mkdir -p build && cd build && meson --buildtype=release -Dc_args=-O3 && ninja + +debug: + @echo "[Invoking Meson]" + @mkdir -p build-debug && cd build-debug && (meson --buildtype=debugoptimized -Db_sanitize=address) && ninja + +dist: release + cd build && ninja-dist + +modules: + git submodule update --init diff --git a/meson.build b/meson.build new file mode 100644 index 0000000..b2698cd --- /dev/null +++ b/meson.build @@ -0,0 +1,117 @@ +project( + 'Racon', + 'cpp', + version : '1.3.3', + default_options : [ + 'buildtype=release', + 'warning_level=3', + 'cpp_std=c++11'], + license : 'MIT', + meson_version : '>= 0.49') + +cpp = meson.get_compiler('cpp') + +############ +# CXXFLAGS # +############ + +racon_warning_flags = [] +racon_cpp_flags = [] + +################ +# Dependencies # +################ + +# Threads. +racon_thread_dep = dependency('threads', required : true) + +# Zlib. +racon_zlib_dep = dependency('zlib', required: true, version : '>= 1.2.11', fallback : ['zlib', 'zlib_dep']) + +# Google test. +gtest_dep = dependency('gtest', main : true, required : false) +if not gtest_dep.found() + gtest_proj = subproject('gtest') + gtest_inc = gtest_proj.get_variable('gtest_incdir') + gtest_lib = static_library('gtest', gtest_proj.get_variable('gtest_libsources'), + gtest_proj.get_variable('gtest_mainsources'), + include_directories : gtest_inc) + + gtest_dep = declare_dependency(include_directories : gtest_inc, + link_with : gtest_lib, dependencies: racon_thread_dep) +endif + +####################### +# Configuring headers # +####################### +racon_version_commit = 'unknown' +git_command = find_program('git', required: false) +if git_command.found() + git_run = run_command('git', ['log', '-1', '--pretty=%h']) + if git_run.returncode() == 0 + racon_version_commit = git_run.stdout().strip() + endif +endif + +racon_version_h_config = configuration_data() +racon_version = meson.project_version() +racon_version_split = meson.project_version().split('.') +racon_version_h_config.set('RACON_VERSION_MAJOR', racon_version_split[0]) +racon_version_h_config.set('RACON_VERSION_MINOR', racon_version_split[1]) +racon_version_h_config.set('RACON_VERSION_PATCH', racon_version_split[2]) +racon_version_h_config.set('RACON_VERSION_COMMIT', racon_version_commit) + +racon_version_h = configure_file( + input : files('src/version.hpp.in'), + output : 'version.hpp', + configuration : racon_version_h_config) + +########### +# Headers # +########### + +racon_include_directories = [include_directories('src')] + +###################### +# Sources + codebase # +###################### + +subdir('vendor') +subdir('src') +subdir('test') + +all_sources = racon_cpp_sources + vendor_cpp_sources + +###################### +# The Racon exe. # +###################### + +racon_dep = declare_dependency( + include_directories: vendor_include_directories + racon_include_directories, + link_with: [racon_lib, vendor_lib], + dependencies: [racon_thread_dep, racon_zlib_dep], + version: meson.project_version(), + compile_args: racon_warning_flags + racon_cpp_flags) + +if not meson.is_subproject() + racon_bin = executable( + 'racon', + ['src/main.cpp'], + dependencies : [racon_thread_dep, racon_zlib_dep], + include_directories : vendor_include_directories + racon_include_directories, + link_with : [racon_lib], + cpp_args : [racon_warning_flags, racon_cpp_flags]) + + ###################### + # Tests # + ###################### + if gtest_dep.found() + tests_bin = executable( + 'racon-test', + [], + dependencies : [racon_thread_dep, racon_zlib_dep, gtest_dep], + include_directories : vendor_include_directories + racon_include_directories + racon_test_include_directories, + link_with : [racon_lib, vendor_lib, racon_test_lib], + cpp_args : [racon_warning_flags, racon_cpp_flags]) + endif +endif diff --git a/src/meson.build b/src/meson.build new file mode 100644 index 0000000..121a901 --- /dev/null +++ b/src/meson.build @@ -0,0 +1,21 @@ +racon_cpp_sources = files([ + 'overlap.cpp', + 'polisher.cpp', + 'sequence.cpp', + 'window.cpp' +]) + +racon_extra_flags = [] + +racon_lib_install = (not meson.is_subproject()) or (get_option('default_library') == 'shared') + +racon_lib = library( + 'racon', + racon_cpp_sources, + soversion : 0, + version : meson.project_version(), + install : racon_lib_install, + link_with : vendor_lib, + dependencies : [racon_thread_dep, racon_zlib_dep], + include_directories : racon_include_directories + vendor_include_directories, + cpp_args : [racon_extra_flags, racon_warning_flags, racon_cpp_flags]) diff --git a/src/version.hpp.in b/src/version.hpp.in new file mode 100644 index 0000000..b5fc570 --- /dev/null +++ b/src/version.hpp.in @@ -0,0 +1,22 @@ +/*! + * @file version.hpp + * + * @brief Version information for the entire project. + */ + +#pragma once + +#include + +static const int32_t RACON_VERSION_MAJOR = @RACON_VERSION_MAJOR@; +static const int32_t RACON_VERSION_MINOR = @RACON_VERSION_MINOR@; +static const int32_t RACON_VERSION_PATCH = @RACON_VERSION_PATCH@; +static const std::string RACON_VERSION_COMMIT("@RACON_VERSION_COMMIT@"); + +static const std::string RACON_VERSION_STRING = + std::to_string(RACON_VERSION_MAJOR) + "." + + std::to_string(RACON_VERSION_MINOR) + "." + + std::to_string(RACON_VERSION_PATCH) + "-" + + RACON_VERSION_COMMIT; + +static const std::string COMPILE_DATE = (std::string(__DATE__) + std::string(" at ") + std::string(__TIME__)); diff --git a/subprojects/gtest.wrap b/subprojects/gtest.wrap new file mode 100644 index 0000000..773a713 --- /dev/null +++ b/subprojects/gtest.wrap @@ -0,0 +1,10 @@ +[wrap-file] +directory = googletest-release-1.8.0 + +source_url = https://github.com/google/googletest/archive/release-1.8.0.zip +source_filename = gtest-1.8.0.zip +source_hash = f3ed3b58511efd272eb074a3a6d6fb79d7c2e6a0e374323d1e6bcbcc1ef141bf + +patch_url = https://wrapdb.mesonbuild.com/v1/projects/gtest/1.8.0/5/get_zip +patch_filename = gtest-1.8.0-5-wrap.zip +patch_hash = 7eeaede4aa2610a403313b74e04baf91ccfbaef03203d8f56312e22df1834ec5 diff --git a/subprojects/zlib.wrap b/subprojects/zlib.wrap new file mode 100644 index 0000000..97de00e --- /dev/null +++ b/subprojects/zlib.wrap @@ -0,0 +1,10 @@ +[wrap-file] +directory = zlib-1.2.11 + +source_url = http://zlib.net/fossils/zlib-1.2.11.tar.gz +source_filename = zlib-1.2.11.tar.gz +source_hash = c3e5e9fdd5004dcb542feda5ee4f0ff0744628baf8ed2dd5d66f8ca1197cb1a1 + +patch_url = https://wrapdb.mesonbuild.com/v1/projects/zlib/1.2.11/3/get_zip +patch_filename = zlib-1.2.11-3-wrap.zip +patch_hash = f07dc491ab3d05daf00632a0591e2ae61b470615b5b73bcf9b3f061fff65cff0 diff --git a/test/meson.build b/test/meson.build new file mode 100644 index 0000000..02b99ec --- /dev/null +++ b/test/meson.build @@ -0,0 +1,20 @@ +racon_test_cpp_sources = files([ + 'racon_test.cpp' +]) + +racon_test_include_directories = [] + +racon_test_extra_flags = [] + +racon_test_lib_install = (not meson.is_subproject()) or (get_option('default_library') == 'shared') + +racon_test_lib = library( + 'racon_test', + vendor_cpp_sources, + soversion : 0, + version : meson.project_version(), + install : racon_test_lib_install, + link_with : [vendor_lib, racon_lib], + dependencies : [racon_thread_dep, racon_zlib_dep], + include_directories : vendor_include_directories + racon_include_directories + racon_test_include_directories, + cpp_args : [racon_test_extra_flags, racon_warning_flags, racon_cpp_flags]) diff --git a/vendor/meson.build b/vendor/meson.build new file mode 100644 index 0000000..c639a4c --- /dev/null +++ b/vendor/meson.build @@ -0,0 +1,35 @@ +vendor_cpp_sources = files([ + 'edlib/edlib/src/edlib.cpp', + 'rampler/src/sampler.cpp', + 'rampler/src/sequence.cpp', + 'spoa/src/alignment_engine.cpp', + 'spoa/src/graph.cpp', + 'spoa/src/sequence.cpp', + 'spoa/src/simd_alignment_engine.cpp', + 'spoa/src/sisd_alignment_engine.cpp', + 'thread_pool/src/thread_pool.cpp' +]) + +vendor_include_directories = [ + include_directories('bioparser/include'), + include_directories('edlib/edlib/include'), + include_directories('logger/include'), + include_directories('rampler/src'), + include_directories('spoa/include'), + include_directories('thread_pool/include') + ] + +vendor_extra_flags = [] + +vendor_lib_install = (not meson.is_subproject()) or (get_option('default_library') == 'shared') + +vendor_lib = library( + 'vendor', + vendor_cpp_sources, + soversion : 0, + version : meson.project_version(), + install : vendor_lib_install, + link_with : [], + dependencies : [racon_thread_dep, racon_zlib_dep], + include_directories : vendor_include_directories, + cpp_args : [vendor_extra_flags, racon_warning_flags, racon_cpp_flags]) From 18e53aa077d50273873e24f20910f996c669b08f Mon Sep 17 00:00:00 2001 From: Ivan Sovic Date: Sat, 23 Mar 2019 22:52:57 -0700 Subject: [PATCH 02/14] Updated the Makefile with a rule to run the CMake build (cmake), and renamed the rule to run Meson to 'meson'. Those two generate different build directories, and the CMake build still defaults to 'build' for legacy purposes. --- Makefile | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index b6ee82b..975e3fb 100644 --- a/Makefile +++ b/Makefile @@ -1,13 +1,17 @@ -.PHONY: all clean release debug debug-gcc6 dist modules +.PHONY: all clean meson cmake debug dist modules -all: release +all: meson clean: - rm -rf build + rm -rf build build-meson -release: +meson: @echo "[Invoking Meson]" - @mkdir -p build && cd build && meson --buildtype=release -Dc_args=-O3 && ninja + @mkdir -p build-meson && cd build-meson && meson --buildtype=release -Dc_args=-O3 && ninja + +cmake: + @echo "[Invoking CMake]" + @mkdir -p build && cd build && cmake -DCMAKE_BUILD_TYPE=Release .. && make debug: @echo "[Invoking Meson]" From 48f33781ff0fc956116333a42b755439984f8f18 Mon Sep 17 00:00:00 2001 From: Ivan Sovic Date: Sat, 23 Mar 2019 22:53:34 -0700 Subject: [PATCH 03/14] Updated the CMakeLists.txt to configure the version.hpp.in file. --- CMakeLists.txt | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index ee77217..3751f01 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,22 @@ cmake_minimum_required(VERSION 3.2) project(racon) +# The version number. +set (RACON_VERSION_MAJOR 1) +set (RACON_VERSION_MINOR 3) +set (RACON_VERSION_PATCH 3) +# Get the commit ID. +execute_process( + COMMAND git log -1 --pretty=%h + WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} + OUTPUT_VARIABLE RACON_VERSION_COMMIT + OUTPUT_STRIP_TRAILING_WHITESPACE +) +# Configure the version file. +configure_file("${PROJECT_SOURCE_DIR}/src/version.hpp.in" "${PROJECT_BINARY_DIR}/generated/version.hpp") +# Add the include directory for the generated file. +include_directories(${PROJECT_BINARY_DIR}/generated) + set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/lib) set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/lib) set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/bin) From 6f83c67af466edb8986aefb5bb46721d2b833a4a Mon Sep 17 00:00:00 2001 From: Ivan Sovic Date: Sat, 23 Mar 2019 22:54:47 -0700 Subject: [PATCH 04/14] The version is no longer stored in the src/main.cpp. Instead, it's configured from version.hpp.in, and now also includes commit ID, which is important for reproducibility. --- src/main.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main.cpp b/src/main.cpp index 1868ba7..cae4d66 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -9,7 +9,9 @@ #include "sequence.hpp" #include "polisher.hpp" -static const char* version = "v1.3.3"; +#include + +static const char* version = RACON_VERSION_STRING.c_str(); static struct option options[] = { {"include-unpolished", no_argument, 0, 'u'}, From ca83e2eaffac51c6c0825f2041ec9cd76e1295ed Mon Sep 17 00:00:00 2001 From: Ivan Sovic Date: Sat, 23 Mar 2019 23:17:41 -0700 Subject: [PATCH 05/14] Updated the README.md. --- README.md | 37 +++++++++++++++++++++++++++++++++++-- 1 file changed, 35 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 1586003..d74b1af 100644 --- a/README.md +++ b/README.md @@ -19,10 +19,15 @@ A **wrapper script** is also available to enable easier usage to the end-user fo ## Dependencies 1. gcc 4.8+ or clang 3.4+ -2. cmake 3.2+ +2. cmake 3.2+ or meson 0.49+ ## Installation -To install Racon run the following commands: +There are two alternative build options which can be used to compile Racon: +1. CMake, and +2. Meson. + +### CMake +To compile Racon using CMake, run the following commands: ```bash git clone --recursive https://github.com/isovic/racon.git racon @@ -43,6 +48,34 @@ To build unit tests add `-Dracon_build_tests=ON` while running `cmake`. After in To build the wrapper script add `-Dracon_build_wrapper=ON` while running `cmake`. After installation, an executable named `racon_wrapper` (python script) will be created in `build/bin`. +### Meson +To compile Racon using Meson, run the following commands: +```bash +git clone --recursive https://github.com/isovic/racon.git racon +cd racon +mkdir build +cd build +meson --buildtype=release -Dc_args=-O3 +ninja +``` + +After successful installation, an executable named `racon` will appear in `build/`. +Tests are built automatically when Meson build is instantiated. + +### Wrapping the builds using a Makefile +Alternatively, to achieve the same, we provide Makefile shorthands. +To run the above commands and build the project using CMake, simply type: +``` +make cmake +``` + +For the Meson build version, analogously write: +``` +make meson +``` + +(Note: CMake build directory will be `build`, and Meson will be built in `build-meson` to make the two build types distinct.) + ## Usage Usage of `racon` is as following: From 17b3342a464a6b0b1528815abd8a8009fe6dc8a7 Mon Sep 17 00:00:00 2001 From: Ivan Sovic Date: Sat, 23 Mar 2019 23:18:01 -0700 Subject: [PATCH 06/14] Version bump to v1.3.4. --- CMakeLists.txt | 2 +- meson.build | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3751f01..c4d1dfe 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -4,7 +4,7 @@ project(racon) # The version number. set (RACON_VERSION_MAJOR 1) set (RACON_VERSION_MINOR 3) -set (RACON_VERSION_PATCH 3) +set (RACON_VERSION_PATCH 4) # Get the commit ID. execute_process( COMMAND git log -1 --pretty=%h diff --git a/meson.build b/meson.build index b2698cd..25ac5f2 100644 --- a/meson.build +++ b/meson.build @@ -1,7 +1,7 @@ project( 'Racon', 'cpp', - version : '1.3.3', + version : '1.3.4', default_options : [ 'buildtype=release', 'warning_level=3', From bddef928fc14147dd91f69b3c0744db76ce15b84 Mon Sep 17 00:00:00 2001 From: Christopher Dunn Date: Fri, 29 Mar 2019 07:22:35 -0700 Subject: [PATCH 07/14] meson 0.48 is ok --- meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meson.build b/meson.build index 25ac5f2..fc969f6 100644 --- a/meson.build +++ b/meson.build @@ -7,7 +7,7 @@ project( 'warning_level=3', 'cpp_std=c++11'], license : 'MIT', - meson_version : '>= 0.49') + meson_version : '>= 0.48') cpp = meson.get_compiler('cpp') From fc2a901c1b865554a7d7bf37ea9cde7af58ab8c0 Mon Sep 17 00:00:00 2001 From: Christopher Dunn Date: Fri, 29 Mar 2019 07:23:28 -0700 Subject: [PATCH 08/14] added rule -- rebuild --- Makefile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Makefile b/Makefile index 975e3fb..f2dc6d7 100644 --- a/Makefile +++ b/Makefile @@ -9,6 +9,9 @@ meson: @echo "[Invoking Meson]" @mkdir -p build-meson && cd build-meson && meson --buildtype=release -Dc_args=-O3 && ninja +rebuild: + ninja -C build-meson + cmake: @echo "[Invoking CMake]" @mkdir -p build && cd build && cmake -DCMAKE_BUILD_TYPE=Release .. && make From b0a47c2db1035142017eba34b4e718717ffe0cb6 Mon Sep 17 00:00:00 2001 From: Ivan Sovic Date: Fri, 29 Mar 2019 16:26:44 +0100 Subject: [PATCH 09/14] Updated the Makefile. Git modules are now fetched automatically. --- Makefile | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index f2dc6d7..301ba7c 100644 --- a/Makefile +++ b/Makefile @@ -5,18 +5,19 @@ all: meson clean: rm -rf build build-meson -meson: +meson: modules @echo "[Invoking Meson]" @mkdir -p build-meson && cd build-meson && meson --buildtype=release -Dc_args=-O3 && ninja -rebuild: - ninja -C build-meson +rebuild: modules + @echo "[Running Ninja only]" + @ninja -C build-meson -cmake: +cmake: modules @echo "[Invoking CMake]" @mkdir -p build && cd build && cmake -DCMAKE_BUILD_TYPE=Release .. && make -debug: +debug: modules @echo "[Invoking Meson]" @mkdir -p build-debug && cd build-debug && (meson --buildtype=debugoptimized -Db_sanitize=address) && ninja @@ -24,4 +25,5 @@ dist: release cd build && ninja-dist modules: - git submodule update --init + @echo "[Fetching submodules]" + @git submodule update --init From d744d4a63b8dae6a09af62104cffb8d718295c1b Mon Sep 17 00:00:00 2001 From: Christopher Dunn Date: Fri, 29 Mar 2019 09:25:39 -0700 Subject: [PATCH 10/14] install racon executable --- meson.build | 1 + 1 file changed, 1 insertion(+) diff --git a/meson.build b/meson.build index fc969f6..53d171d 100644 --- a/meson.build +++ b/meson.build @@ -97,6 +97,7 @@ if not meson.is_subproject() racon_bin = executable( 'racon', ['src/main.cpp'], + install : true, dependencies : [racon_thread_dep, racon_zlib_dep], include_directories : vendor_include_directories + racon_include_directories, link_with : [racon_lib], From ca6208e2d6d4092f09fe54f1dcdd6a8f422f04d1 Mon Sep 17 00:00:00 2001 From: Ivan Sovic Date: Fri, 29 Mar 2019 16:17:53 +0100 Subject: [PATCH 11/14] Updated the meson.build and test/meson.build. Working on building the tests correctly. --- meson.build | 10 +++++----- test/meson.build | 31 +++++++++++++++++++------------ 2 files changed, 24 insertions(+), 17 deletions(-) diff --git a/meson.build b/meson.build index 53d171d..3f7ab0e 100644 --- a/meson.build +++ b/meson.build @@ -70,7 +70,7 @@ racon_version_h = configure_file( # Headers # ########### -racon_include_directories = [include_directories('src')] +racon_include_directories = [include_directories('src'),] ###################### # Sources + codebase # @@ -108,11 +108,11 @@ if not meson.is_subproject() ###################### if gtest_dep.found() tests_bin = executable( - 'racon-test', - [], + 'racon_test', + racon_test_cpp_sources, dependencies : [racon_thread_dep, racon_zlib_dep, gtest_dep], include_directories : vendor_include_directories + racon_include_directories + racon_test_include_directories, - link_with : [racon_lib, vendor_lib, racon_test_lib], - cpp_args : [racon_warning_flags, racon_cpp_flags]) + link_with : [racon_lib, vendor_lib], + cpp_args : [racon_warning_flags, racon_cpp_flags, racon_test_extra_flags]) endif endif diff --git a/test/meson.build b/test/meson.build index 02b99ec..8a3c290 100644 --- a/test/meson.build +++ b/test/meson.build @@ -2,19 +2,26 @@ racon_test_cpp_sources = files([ 'racon_test.cpp' ]) -racon_test_include_directories = [] +racon_test_include_directories = [include_directories('.')] racon_test_extra_flags = [] -racon_test_lib_install = (not meson.is_subproject()) or (get_option('default_library') == 'shared') +racon_test_config_h_vars = configuration_data() +racon_test_config_h_vars.set('racon_test_data_path', meson.source_root() + '/test/data/') +racon_test_config_h = configure_file( + input : files('racon_test_config.h.in'), + output : 'racon_test_config.h', + configuration : racon_test_config_h_vars) -racon_test_lib = library( - 'racon_test', - vendor_cpp_sources, - soversion : 0, - version : meson.project_version(), - install : racon_test_lib_install, - link_with : [vendor_lib, racon_lib], - dependencies : [racon_thread_dep, racon_zlib_dep], - include_directories : vendor_include_directories + racon_include_directories + racon_test_include_directories, - cpp_args : [racon_test_extra_flags, racon_warning_flags, racon_cpp_flags]) +# racon_test_lib_install = (not meson.is_subproject()) or (get_option('default_library') == 'shared') + +# racon_test_lib = library( +# 'racon_test', +# racon_test_cpp_sources, +# soversion : 0, +# version : meson.project_version(), +# install : racon_test_lib_install, +# link_with : [vendor_lib, racon_lib], +# dependencies : [racon_thread_dep, racon_zlib_dep], +# include_directories : vendor_include_directories + racon_include_directories + racon_test_include_directories, +# cpp_args : [racon_test_extra_flags, racon_warning_flags, racon_cpp_flags]) From 8cb30c0f56a096c397a2d3f2f3b1d5a880c787e7 Mon Sep 17 00:00:00 2001 From: Ivan Sovic Date: Fri, 29 Mar 2019 16:18:05 +0100 Subject: [PATCH 12/14] Updated the includes in test/racon_test.cpp. --- test/racon_test.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/test/racon_test.cpp b/test/racon_test.cpp index 057bfb4..f26efd9 100644 --- a/test/racon_test.cpp +++ b/test/racon_test.cpp @@ -4,14 +4,14 @@ * @brief Racon unit test source file */ -#include "racon_test_config.h" +#include -#include "sequence.hpp" -#include "polisher.hpp" +#include +#include -#include "edlib.h" -#include "bioparser/bioparser.hpp" -#include "gtest/gtest.h" +#include +#include +#include uint32_t calculateEditDistance(const std::string& query, const std::string& target) { From f1b36d6055912316e289f6656a94b714aa22df62 Mon Sep 17 00:00:00 2001 From: Ivan Sovic Date: Fri, 29 Mar 2019 20:22:00 +0100 Subject: [PATCH 13/14] Updated the meson.build files to build the tests properly. --- meson.build | 4 ++-- test/meson.build | 13 ------------- 2 files changed, 2 insertions(+), 15 deletions(-) diff --git a/meson.build b/meson.build index 3f7ab0e..20b2b1e 100644 --- a/meson.build +++ b/meson.build @@ -70,7 +70,7 @@ racon_version_h = configure_file( # Headers # ########### -racon_include_directories = [include_directories('src'),] +racon_include_directories = [include_directories('src'), include_directories('test')] ###################### # Sources + codebase # @@ -111,7 +111,7 @@ if not meson.is_subproject() 'racon_test', racon_test_cpp_sources, dependencies : [racon_thread_dep, racon_zlib_dep, gtest_dep], - include_directories : vendor_include_directories + racon_include_directories + racon_test_include_directories, + include_directories : racon_include_directories + vendor_include_directories + racon_test_include_directories, link_with : [racon_lib, vendor_lib], cpp_args : [racon_warning_flags, racon_cpp_flags, racon_test_extra_flags]) endif diff --git a/test/meson.build b/test/meson.build index 8a3c290..86d7c7b 100644 --- a/test/meson.build +++ b/test/meson.build @@ -12,16 +12,3 @@ racon_test_config_h = configure_file( input : files('racon_test_config.h.in'), output : 'racon_test_config.h', configuration : racon_test_config_h_vars) - -# racon_test_lib_install = (not meson.is_subproject()) or (get_option('default_library') == 'shared') - -# racon_test_lib = library( -# 'racon_test', -# racon_test_cpp_sources, -# soversion : 0, -# version : meson.project_version(), -# install : racon_test_lib_install, -# link_with : [vendor_lib, racon_lib], -# dependencies : [racon_thread_dep, racon_zlib_dep], -# include_directories : vendor_include_directories + racon_include_directories + racon_test_include_directories, -# cpp_args : [racon_test_extra_flags, racon_warning_flags, racon_cpp_flags]) From 98655108dc8439f146b2456160febb2ae34436c7 Mon Sep 17 00:00:00 2001 From: Ivan Sovic Date: Fri, 29 Mar 2019 20:22:30 +0100 Subject: [PATCH 14/14] The 'make cmake' rule now builds the tests too. --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 301ba7c..bdae427 100644 --- a/Makefile +++ b/Makefile @@ -15,7 +15,7 @@ rebuild: modules cmake: modules @echo "[Invoking CMake]" - @mkdir -p build && cd build && cmake -DCMAKE_BUILD_TYPE=Release .. && make + @mkdir -p build && cd build && cmake -DCMAKE_BUILD_TYPE=Release -Dracon_build_tests=ON .. && make debug: modules @echo "[Invoking Meson]"