Learning Objective:
In this short guide you will learn how to set up SeqAn and how to compile a small example to test whether everything works.
| Difficulty | Easy |
|---|---|
| Duration | 30 Minutes |
| Prerequisite tutorials | No prerequisites |
| Recommended reading |
Requirements:
SeqAn3 requires a compiler with full C++20 support or GCC >= 7. Current versions of LLVM/Clang and VisualStudio/MSVC are not supported. We will briefly explain how to install GCC-7 on some popular operating systems, but we recommend using the latest version of GCC available. For more information refer to your operating system's documentation.
Ubuntu >= 18.04
Ubuntu < 18.04
MacOS using Homebrew
MacOS using MacPorts
Linux using conda
This will put GCC-7 in a separate environment called gcc7 which can be activated via conda activate gcc7 and deactivated via conda deactivate gcc7.
/usr/lib/x86_64-linux-gnu/libstdc++.so.6: version 'CXXABI_1.3.11' not found, you have to set the LD_LIBRARY_PATH: /home/user/miniconda3/ is the path to your conda installation. g++ --version should print the desired version. If not, you may have to use, for example, g++-7 --version or even specify the full path to your executable.Similarly you need to install cmake and git, e.g. apt install cmake git.
For this project, we recommend following directory layout:
To set these directories up you can follow this script (note the --recurse-submodules when cloning SeqAn3):
The output of the command tree -L 2 should now look like this:
To test whether everything works, we will now compile and run a small example.
First we create the file hello_world.cpp in the source directory with the following contents:
To compile it we first create a CMakeLists.txt file in the source directory:
The directories should now look like this:
Now we can switch to the directory build and run:
The output should be Hello world.
-DCMAKE_CXX_COMPILER=, for example: ... could not understand flag m .... In this case you can try to export the Path: If you create a new cpp file and want to compile it, you need to add another add_executable and target_link_libraries directive to you CMakeLists.txt. For example, after adding another_program.cpp your CMakeLists.txt may look like this: