CMake Error at dorado/3rdparty/CMakeLists.txt:28 (addsubdirectory): The source directory…
- User
CMake Error at dorado/3rdparty/CMakeLists.txt:28 (add_subdirectory): The source directory
/home/users/nus/jwh/bin/dorado-0.9.6/dorado/3rdparty/argparsedoes not contain a CMakeLists.txt file.
CMake Error at dorado/3rdparty/CMakeLists.txt:31 (add_subdirectory): The source directory
/home/users/nus/jwh/bin/dorado-0.9.6/dorado/3rdparty/catch2does not contain a CMakeLists.txt file.
CMake Error at dorado/3rdparty/CMakeLists.txt:34 (add_subdirectory): The source directory
/home/users/nus/jwh/bin/dorado-0.9.6/dorado/3rdparty/spdlogdoes not contain a CMakeLists.txt file.
CMake Error at dorado/3rdparty/CMakeLists.txt:36 (target_compile_definitions): Cannot specify compile definitions for target "spdlog" which is not built by this project.
CMake Error at dorado/3rdparty/CMakeLists.txt:43 (add_subdirectory): The source directory
/home/users/nus/jwh/bin/dorado-0.9.6/dorado/3rdparty/elzipdoes not contain a CMakeLists.txt file.
CMake Error at dorado/3rdparty/CMakeLists.txt:47 (add_subdirectory): The source directory
/home/users/nus/jwh/bin/dorado-0.9.6/dorado/3rdparty/ont-minimap2does not contain a CMakeLists.txt file.
-- build minimap2 exe: OFF -- build minimap2 lib: CMake Error at dorado/3rdparty/CMakeLists.txt:59 (add_subdirectory): The source directory
/home/users/nus/jwh/bin/dorado-0.9.6/dorado/3rdparty/edlibdoes not contain a CMakeLists.txt file.
CMake Error at dorado/3rdparty/CMakeLists.txt:65 (add_subdirectory): The source directory
/home/users/nus/jwh/bin/dorado-0.9.6/dorado/3rdparty/datedoes not contain a CMakeLists.txt file.
-- Applying patch /home/users/nus/jwh/bin/dorado-0.9.6/dorado/3rdparty/patches/HighFive.patch error: include/highfive/bits/h5_wrapper.hpp: No such file or directory CMake Error at dorado/3rdparty/CMakeLists.txt:20 (message): Failed to apply patch /home/users/nus/jwh/bin/dorado-0.9.6/dorado/3rdparty/patches/HighFive.patch Call Stack (most recent call first): dorado/3rdparty/CMakeLists.txt:68 (apply_3rdparty_patch)
-- Configuring incomplete, errors occurred!
Assistant
Excellent! This is a very common and classic set of errors when building a C++ project that uses Git submodules for its dependencies.
The Core Problem
The root cause of all these errors is the same: the third-party libraries (dependencies) have not been downloaded.
The
doradoproject uses Git submodules to manage its dependencies likeargparse,spdlog,HighFive, etc. A Git submodule is essentially a pointer to a specific commit in another repository. When you clone the maindoradorepository, by default, you only get the main project's files, not the code for the submodules. The directories (dorado/3rdparty/argparse, etc.) are created, but they remain empty.The CMake build system then tries to enter these directories (
add_subdirectory) and finds they are empty, leading to thedoes not contain a CMakeLists.txt fileerror. All the subsequent errors, like the failure to create thespdlogtarget or apply theHighFivepatch, are direct consequences of the initial failure to find the source code.The Solution
You need to tell Git to download and initialize these submodules.
There are two ways to do this, depending on your situation.
Option 1: If you have already cloned the repository
This is most likely your current situation.
-
Navigate to the project's root directory:
cd /home/users/nus/jwh/bin/dorado-0.9.6 -
Initialize and update the submodules: Run the following command. The
--recursiveflag is important as it handles submodules within other submodules.git submodule update --init --recursiveYou will see output as Git clones each of the required dependency repositories into the
dorado/3rdpartydirectory.
Option 2: If you are cloning the repository from scratch
For future reference, you can clone the repository and its submodules all in one step by using the
--recursiveflag withgit clone:git clone --recursive <URL_to_dorado_repository>
Step-by-Step Guide to Fix Your Build
-
Initialize Submodules: Open your terminal, go to the project directory, and run the command:
cd /home/users/nus/jwh/bin/dorado-0.9.6 git submodule update --init --recursive -
Clean Your Build Directory: It's good practice to start the CMake configuration fresh to avoid any cached errors. If you have a build directory, remove it.
# Assuming your build directory is named 'build' rm -rf build # Or remove the CMake cache files directly from the source directory if you built there rm -f CMakeCache.txt rm -rf CMakeFiles/ -
Re-run CMake: Now, run your CMake command again. The build process should now find the
CMakeLists.txtfiles inside the populated submodule directories and proceed correctly.# Example cmake command, adjust as needed cmake -S . -B build [your-other-cmake-options]After this, you can proceed with the build (
cmake --build build).
How This Fixes Each Error
add_subdirectory ... does not contain a CMakeLists.txt file: After runninggit submodule update, directories likedorado/3rdparty/argparsewill be filled with the source code for theargparselibrary, which includes its ownCMakeLists.txt.Cannot specify compile definitions for target "spdlog": This happened because thespdlogtarget was never created due to the first error. Now thatadd_subdirectory(spdlog)will succeed, the target will exist, and this command will work.Failed to apply patch HighFive.patch: The patch failed because the file it was trying to modify (include/highfive/bits/h5_wrapper.hpp) did not exist. Once theHighFivesubmodule is downloaded, the file will be present, and the patch will apply successfully.
-
- User
i downloaded the dorado-0.9.6-linux-x64.tar.gz and made unzip
Assistant
Ah, thank you for the clarification! That is a critical piece of information and explains everything.
My previous answer assumed you were building from a Git repository clone. Since you downloaded a
.tar.gzrelease archive, the situation is different, but the root cause is the same.The New Core Problem
The
dorado-0.9.6-linux-x64.tar.gzarchive you downloaded is what's called a source code release. Unfortunately, it appears the creators of this archive made a common mistake: they packaged the maindoradosource code but did not include the source code for the third-party dependencies.The empty directories (
3rdparty/argparse,3rdparty/spdlog, etc.) are present, but the code that should be inside them is missing. This is why CMake gives you the exact same errors as if you had done agit clonewithout fetching the submodules.You have two main paths forward. The first one is much, much easier and is highly recommended.
Option 1: Check for the Pre-Compiled Binary (The Easiest Solution)
The name of the file you downloaded,
dorado-0.9.6-linux-x64.tar.gz, strongly suggests that it already contains the compiled, ready-to-use program. You probably don't need to build anything at all!-
Go into the unzipped directory:
cd dorado-0.9.6-linux-x64 -
Look for a
bindirectory:ls -FYou will likely see a directory named
bin/. -
Check the contents of the
bindirectory:ls -F bin/You should see an executable file named
dorado. -
Run it! You can test it by asking for the help message:
./bin/dorado --help
If this works, you are done! You don't need to compile or run CMake. The program is ready to use. The source code was included for reference, but the primary purpose of that download is the pre-compiled binary.
Option 2: Build from Source the Correct Way (If You Must Compile)
If Option 1 doesn't work (e.g., the
bindirectory is missing or the executable doesn't run on your system for some reason) and you absolutely need to compile it yourself, you cannot use the incomplete source from the.tar.gzfile.You must download the complete source code from the official Git repository. This will ensure you get all the dependencies.
-
First, delete the incomplete directory you have:
# Go to the parent directory first cd .. rm -rf dorado-0.9.6-linux-x64 -
Clone the official repository with the
--recursiveflag. This is the crucial step. We will also specify thev0.9.6tag to get the exact version you want.git clone --recursive https://github.com/nanoporetech/dorado.git -b v0.9.6This command does two things:
git clone ...: Downloads the maindoradoproject source.--recursive: Automatically finds and downloads all the third-party dependencies into the3rdpartydirectory.
-
Now, you can build it:
cd dorado # Go into the newly cloned directory mkdir build && cd build # Create and enter a build directory cmake .. # Configure the build make -j4 # Compile the code (use e.g. 4 cores)
Summary
Your Goal What to do I just want to run Dorado. (Most likely you) Use Option 1. Check the bin/folder in the archive you downloaded. The program is likely already built.I need to compile my own version of Dorado. Use Option 2. Delete the old folder and re-download using git clone --recursive.-
- User
what to do next.. (ont_env) [jwh@asp2a-login-nus01 bin]$ ./dorado --help ./dorado: /lib64/libm.so.6: version
GLIBC_2.29' not found (required by ./dorado) ./dorado: /lib64/libm.so.6: versionGLIBC_2.29' not found (required by /home/users/nus/jwh/bin/dorado-0.9.6-linux-x64/bin/../lib/libdorado_torch_lib.so) ./dorado: /lib64/libm.so.6: version `GLIBC_2.29' not found (required by /home/users/nus/jwh/bin/dorado-0.9.6-linux-x64/bin/../lib/../lib/libdorado_cudnn_lib.so) Assistant
This is a very common issue when running pre-compiled software on High-Performance Computing (HPC) clusters or older Linux distributions.
The Problem: GLIBC Version Mismatch
The error message
version 'GLIBC_2.29' not foundtells you everything you need to know.-
What is GLIBC?
GLIBC(GNU C Library) is a fundamental library on Linux systems. Almost every program depends on it for basic functions like opening files, memory management, math operations (libm.so.6), etc. -
The Mismatch: The
doradobinary you downloaded was compiled on a newer Linux system that hadGLIBCversion 2.29 or higher. Your system (asp2a-login-nus01) has an older version ofGLIBC. -
Why it Fails: The
doradoprogram is asking for specific functions from GLIBC that are only available in version 2.29 and newer. Your system's older GLIBC doesn't have them, so the program cannot start.
You cannot easily upgrade the system's GLIBC. It's a core system component, and changing it would likely break the entire operating system. This is especially true on a shared HPC cluster where you do not have administrator (
root) privileges.The Solution: Compile from Source
You have hit the exact scenario where compiling from source is no longer optional—it's necessary.
You must compile
doradoon your specific system (asp2a-login-nus01). This process will link the newdoradobinary against the version of GLIBC that is available on your machine, resolving the incompatibility.Here is the step-by-step plan, combining our previous discussions.
Step-by-Step Guide to Compile Dorado on Your System
You are currently in the
dorado-0.9.6-linux-x64/bindirectory. Let's start from a clean slate.Step 1: Go to a suitable working directory and clean up the old download.
# Go back to your main software directory cd ~/bin/ # Remove the old, non-working directory completely rm -rf dorado-0.9.6-linux-x64Step 2: Clone the correct version of the source code from GitHub.
This is the most important step. We will use
gitto download the source code and all its dependencies.# Clone the v0.9.6 tag and recursively fetch all dependencies (submodules) git clone --recursive https://github.com/nanoporetech/dorado.git -b v0.9.6This will create a new directory named
dorado. Wait for it to finish. It will download several gigabytes of data because it also includes the model files.Step 3: Prepare the build environment.
HPC systems often use environment modules to manage compilers and libraries. You will likely need a modern C++ compiler.
doradorequires a C++17 compliant compiler (like GCC 8+ or Clang 6+). You may also need to load acmakemodule.# Check available compilers module avail gcc # Load a modern GCC, for example, version 9.3.0 (adjust if needed) module load gcc/9.3.0 # Load CMake if it's not already available module load cmakeIf you are unsure which modules to load, consult your HPC's documentation or contact their support staff.
Step 4: Configure the build with CMake.
Now, we will follow the standard CMake build process.
# Enter the newly cloned source code directory cd dorado # Create a separate directory for the build files (this is best practice) mkdir build cd build # Run CMake to configure the project. It will find your compiler and libraries. # The '..' points CMake to the source directory, which is one level up. cmake ..This step might take a few minutes as it checks for all dependencies and sets up the build system. If it fails, the error message will be your next clue (it's often a missing library or tool).
Step 5: Compile the code.
Once CMake finishes successfully, you can compile the program using
make.# Use 'make' to build. The '-j' flag specifies the number of parallel jobs (cores) to use. # Using 8 cores is a reasonable start. Don't use too many on a login node. make -j8This will take a significant amount of time (possibly 30 minutes to over an hour, depending on the system). You will see a lot of compilation output.
Step 6: Run your newly compiled Dorado.
If the
makecommand completes without errors, the newdoradoexecutable will be in thebuild/bin/directory.# The executable is now located here ls -F bin/ # Test it! This should now work without any GLIBC errors. ./bin/dorado --helpYou have now successfully built a version of
doradothat is tailored to your system's environment.-
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.