Skip to content
TheChatArchiveThe Chat Archive
Geminigemini-2.5-pro· GoogleHugging Face LMArena Human Preference 140K

CMake Error at dorado/3rdparty/CMakeLists.txt:28 (addsubdirectory): The source directory…

From a Chatbot Arena battleThe same person sent this prompt to two anonymous models at once. Compare it with Geminigemini-2.0-flash-001’s answer.
  1. 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/argparse
    

    does 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/catch2
    

    does 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/spdlog
    

    does 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/elzip
    

    does 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-minimap2
    

    does 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/edlib
    

    does 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/date
    

    does 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!

  2. Gemini 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 dorado project uses Git submodules to manage its dependencies like argparse, spdlog, HighFive, etc. A Git submodule is essentially a pointer to a specific commit in another repository. When you clone the main dorado repository, 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 the does not contain a CMakeLists.txt file error. All the subsequent errors, like the failure to create the spdlog target or apply the HighFive patch, 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.

    1. Navigate to the project's root directory:

      cd /home/users/nus/jwh/bin/dorado-0.9.6
      
    2. Initialize and update the submodules: Run the following command. The --recursive flag is important as it handles submodules within other submodules.

      git submodule update --init --recursive
      

      You will see output as Git clones each of the required dependency repositories into the dorado/3rdparty directory.


    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 --recursive flag with git clone:

    git clone --recursive <URL_to_dorado_repository>
    

    Step-by-Step Guide to Fix Your Build

    1. 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
      
    2. 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/
      
    3. Re-run CMake: Now, run your CMake command again. The build process should now find the CMakeLists.txt files 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 running git submodule update, directories like dorado/3rdparty/argparse will be filled with the source code for the argparse library, which includes its own CMakeLists.txt.
    • Cannot specify compile definitions for target "spdlog": This happened because the spdlog target was never created due to the first error. Now that add_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 the HighFive submodule is downloaded, the file will be present, and the patch will apply successfully.
  3. User

    i downloaded the dorado-0.9.6-linux-x64.tar.gz and made unzip

  4. Gemini 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.gz release archive, the situation is different, but the root cause is the same.

    The New Core Problem

    The dorado-0.9.6-linux-x64.tar.gz archive 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 main dorado source 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 a git clone without 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!

    1. Go into the unzipped directory:

      cd dorado-0.9.6-linux-x64
      
    2. Look for a bin directory:

      ls -F
      

      You will likely see a directory named bin/.

    3. Check the contents of the bin directory:

      ls -F bin/
      

      You should see an executable file named dorado.

    4. 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 bin directory 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.gz file.

    You must download the complete source code from the official Git repository. This will ensure you get all the dependencies.

    1. First, delete the incomplete directory you have:

      # Go to the parent directory first
      cd .. 
      rm -rf dorado-0.9.6-linux-x64
      
    2. Clone the official repository with the --recursive flag. This is the crucial step. We will also specify the v0.9.6 tag to get the exact version you want.

      git clone --recursive https://github.com/nanoporetech/dorado.git -b v0.9.6
      

      This command does two things:

      • git clone ...: Downloads the main dorado project source.
      • --recursive: Automatically finds and downloads all the third-party dependencies into the 3rdparty directory.
    3. 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 GoalWhat 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.
  5. 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: version GLIBC_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)

  6. Gemini 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 found tells you everything you need to know.

    1. 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.

    2. The Mismatch: The dorado binary you downloaded was compiled on a newer Linux system that had GLIBC version 2.29 or higher. Your system (asp2a-login-nus01) has an older version of GLIBC.

    3. Why it Fails: The dorado program 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 dorado on your specific system (asp2a-login-nus01). This process will link the new dorado binary 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/bin directory. 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-x64
    

    Step 2: Clone the correct version of the source code from GitHub.

    This is the most important step. We will use git to 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.6
    

    This 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. dorado requires a C++17 compliant compiler (like GCC 8+ or Clang 6+). You may also need to load a cmake module.

    # 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 cmake
    

    If 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 -j8
    

    This 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 make command completes without errors, the new dorado executable will be in the build/bin/ directory.

    # The executable is now located here
    ls -F bin/
    
    # Test it! This should now work without any GLIBC errors.
    ./bin/dorado --help
    

    You have now successfully built a version of dorado that is tailored to your system's environment.

Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.