You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#include <seqan3/argument_parser/all.hpp> // includes all necessary headers
#include <seqan3/core/debug_stream.hpp> // our custom output stream
#include <seqan3/std/filesystem> // use std::filesystem::path
#include <seqan3/io/sequence_file/all.hpp> // FASTA support
#include <seqan3/io/alignment_file/all.hpp> // SAM/BAM support
using namespace seqan3;
struct cmd_arguments
{
std::filesystem::path alignment_file_path{};
std::filesystem::path reference_file_path{};
};
void initialize_argument_parser(argument_parser & parser, cmd_arguments & args)
{
parser.info.author = "foo";
parser.info.short_description = "foo";
parser.info.version = "0.0.1";
parser.add_positional_option(args.alignment_file_path, "Read alignments in SAM or BAM format.",
input_file_validator{{"sam", "bam"}} );
parser.add_positional_option(args.reference_file_path, "Reference genome in FASTA format",
input_file_validator{{"fa", "fasta"}} );
}
int main(int argc, char ** argv)
{
argument_parser myparser{"detectBreakends", argc, argv}; // initialise myparser
cmd_arguments args{};
initialize_argument_parser(myparser, args);
try
{
myparser.parse(); // trigger command line parsing
}
catch (parser_invalid_argument const & ext) // catch user errors
{
debug_stream << "[Error] " << ext.what() << "\n"; // customise your error message
return -1;
}
// run_program(args.alignment_file_path, args.reference_file_path);
return 0;
}
Expected behaviour
I would expect the program to compile successfully with:
mkdir build
cd build
cmake ../src
make
Actual behaviour
>make
Scanning dependencies of target main
[ 50%] Building CXX object CMakeFiles/main.dir/main.cpp.o
[100%] Linking CXX executable main
/usr/lib/gcc/x86_64-pc-linux-gnu/7.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: CMakeFiles/main.dir/main.cpp.o: undefined reference to symbol 'pthread_create@@GLIBC_2.2.5'
/usr/lib/gcc/x86_64-pc-linux-gnu/7.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: /lib/libpthread.so.0: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
make[2]: *** [CMakeFiles/main.dir/build.make:86: main] Error 1
make[1]: *** [CMakeFiles/Makefile2:73: CMakeFiles/main.dir/all] Error 2
make: *** [Makefile:84: all] Error 2
I found that add -lpthread to the linker flags solves this issue. But I wondered why it is necessary to do this manually if I only use the seqan argument parser and not much more. Any idea?
Cheers
David
The text was updated successfully, but these errors were encountered:
eldariont
added
bug
faulty or wrong behaviour of code
question
a user question how to do certain things
and removed
bug
faulty or wrong behaviour of code
labels
Jul 23, 2019
Platform
Description
How to repeat the problem
I'm writing an application based on seqan3. This is how my project directory looks like:
CMakeLists.txt:
main.cpp:
Expected behaviour
I would expect the program to compile successfully with:
Actual behaviour
I found that add -lpthread to the linker flags solves this issue. But I wondered why it is necessary to do this manually if I only use the seqan argument parser and not much more. Any idea?
Cheers
David
The text was updated successfully, but these errors were encountered: