Skip to content

KMC compilation error when compiling from source #45

@Sawwave

Description

@Sawwave

When compiling cuttlefish from source, the included kmc_core seems to have compilation errors due to an incorrect #include.

Specifically, the following errors are generated.


In file included from kmc_core/mem_disk_file.cpp:12:
kmc_core/critical_error_handler.h: In member function ‘void CCriticalErrorHandler::HandleCriticalError(const std::string&)’:
kmc_core/critical_error_handler.h:77:28: error: ‘runtime_error’ is not a member of ‘std’
77 |                 throw std::runtime_error(msg);
|                            ^~~~~~~~~~~~~
kmc_core/critical_error_handler.h:7:1: note: ‘std::runtime_error’ is defined in header ‘<stdexcept>’; this is probably fixable by adding ‘#include <stdexcept>’
6 | #include <condition_variable>
+++ |+#include <stdexcept>
7 |
In file included from kmc_core/queues.h:25,
from kmc_core/params.h:16,
from kmc_core/bkb_writer.h:14,
from kmc_core/bkb_writer.cpp:11:
kmc_core/critical_error_handler.h: In member function ‘void CCriticalErrorHandler::HandleCriticalError(const std::string&)’:
kmc_core/critical_error_handler.h:77:28: error: ‘runtime_error’ is not a member of ‘std’
77 |                 throw std::runtime_error(msg);
|                            ^~~~~~~~~~~~~
kmc_core/critical_error_handler.h:7:1: note: ‘std::runtime_error’ is defined in header ‘<stdexcept>’; this is probably fixable by adding ‘#include <stdexcept>’
6 | #include <condition_variable>
+++ |+#include <stdexcept>
7 |
make[3]: *** [Makefile:118: kmc_core/mem_disk_file.o] Error 1
make[3]: *** Waiting for unfinished jobs....
In file included from kmc_core/queues.h:25,
from kmc_core/params.h:16,
from kmc_core/bkb_reader.h:15,
from kmc_core/bkb_reader.cpp:11:
kmc_core/critical_error_handler.h: In member function ‘void CCriticalErrorHandler::HandleCriticalError(const std::string&)’:
kmc_core/critical_error_handler.h:77:28: error: ‘runtime_error’ is not a member of ‘std’
77 |                 throw std::runtime_error(msg);
|                            ^~~~~~~~~~~~~
kmc_core/critical_error_handler.h:7:1: note: ‘std::runtime_error’ is defined in header ‘<stdexcept>’; this is probably fixable by adding ‘#include <stdexcept>’
6 | #include <condition_variable>
+++ |+#include <stdexcept>
7 |
make[3]: *** [Makefile:118: kmc_core/bkb_writer.o] Error 1
make[3]: *** [Makefile:118: kmc_core/bkb_reader.o] Error 1
make[2]: *** [CMakeFiles/prj_kmc.dir/build.make:86: prj_kmc-prefix/src/prj_kmc-stamp/prj_kmc-build] Error 2
make[1]: *** [CMakeFiles/Makefile2:104: CMakeFiles/prj_kmc.dir/all] Error 2
make: *** [Makefile:136: all] Error 2

Is the wrong KMC version being downloaded with curl in the cmake build? Currently, the cmake file specifies the following for KMC:


# Prepare the `kmc` library — required by the Cuttlefish algorithm implementation.
# NOTE: do something more intelligent below than the -j4
message("Build system will fetch and install KMC3")
ExternalProject_Add(prj_kmc
    DOWNLOAD_DIR        ${CMAKE_SOURCE_DIR}/external
    DOWNLOAD_COMMAND    curl -k -L  /KMC/archive/refs/tags/v3.2.1.tar.gz -o KMC-3.2.1.tar.gz &&
                        tar -xzf KMC-3.2.1.tar.gz &&
                        rm KMC-3.2.1.tar.gz
    PATCH_COMMAND       patch --strip 1 < ${CMAKE_SOURCE_DIR}/patches/kmc_patch.diff
    SOURCE_DIR          ${CMAKE_SOURCE_DIR}/external/KMC-3.2.1
    BUILD_IN_SOURCE     TRUE
    INSTALL_DIR         ${CMAKE_SOURCE_DIR}/external/
    CONFIGURE_COMMAND   ""
    BUILD_COMMAND       make -j4 CC=${CMAKE_CXX_COMPILER} simde && make -j4 CC=${CMAKE_CXX_COMPILER} kmc
    INSTALL_COMMAND     cp bin/libkmc_core.a ${EXT_LIB} &&
                        cp include/kmc_runner.h ${EXT_INCLUDE}
)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions