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
-- 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
The CMake errors indicate that the build process is failing because it cannot find the CMakeLists.txt files in the specified third-party subdirectories. Additionally, a patch application is failing because a required file is missing. This usually means that the source code for these third-party libraries is not present or has not been extracted correctly within the dorado-0.9.6 directory.
Here's a breakdown of the problem and potential solutions:
Root Cause:
The most likely cause is that the dorado-0.9.6 source distribution you're using doesn't include the source code for the third-party dependencies. These dependencies are probably expected to be downloaded and extracted during the build process, or they may have been included in the package, but the extract step failed/was incomplete.
Troubleshooting and Solutions:
Verify the Integrity of the Source Distribution:
Redownload: Download the dorado-0.9.6 source distribution again from the official source. A corrupted download could be the reason.
Check Archive: If you downloaded a .tar.gz, .zip, or similar archive, verify that the extraction process completed successfully. Use your operating system's archive manager or command-line tools (e.g., tar -xvzf dorado-0.9.6.tar.gz) to re-extract the files. Ensure there are no errors during extraction.
Check for a Build Script or Dependency Download Script:
Look for Instructions: The dorado-0.9.6 distribution should have a README, INSTALL, or similar documentation file. Carefully read it. It may contain instructions on how to download or install the required third-party dependencies.
Examine the CMake Files: Look at the CMakeLists.txt files, especially the top-level one. See if there are any custom commands or scripts defined that are intended to download and extract the third-party dependencies. Sometimes, CMake uses ExternalProject_Add to handle this. If you find such commands, try running them manually (following any specific instructions).
Git Submodules (If Applicable):
If the dorado project is a Git repository (and it's likely is), it might be using Git submodules to manage the third-party dependencies. If so, you need to initialize and update the submodules:
User
i downloaded the dorado-0.9.6-linux-x64.tar.gz and made unzip
Assistant
Okay, that clarifies things. Since you downloaded the pre-built dorado-0.9.6-linux-x64.tar.gz package, you should not be running CMake directly.
The dorado-0.9.6-linux-x64.tar.gz archive contains a pre-compiled binary executable of Dorado. It doesn't contain the source code and is not intended to be built from source.
Here's what you should do:
Extract the Archive: You've already done this, but ensure you extracted all the files:
bash
tar -xvzf dorado-0.9.6-linux-x64.tar.gz
Locate the Executable: Inside the extracted directory, you should find the dorado executable (or a bin directory containing it).
Make Executable (If Needed): If the executable doesn't have execute permissions, grant them:
bash
chmod +x <path_to_dorado_executable>
Add to Path (Optional): To run dorado from any directory, add its location to your PATH environment variable:
Temporarily:
bash
export PATH=$PATH:<path_to_dorado_directory>
Permanently: Edit your shell's configuration file (e.g., ~/.bashrc, ~/.zshrc) and add the export PATH line to it. Then, source the file:
bash
source ~/.bashrc # or source ~/.zshrc, etc.
Run Dorado: Now you should be able to run dorado from the command line:
bash
dorado --help # or dorado version
Why your original approach failed:
When you ran CMake, you were trying to build Dorado from source. However, you had the pre-built package, which doesn't contain the necessary source files for CMake to work. CMake was looking for the third-party libraries in the expected locations, but they weren't there because the pre-built package doesn't include the source.
In summary:
You don't need to run CMake when you have the pre-built binary.
Extract the archive, find the dorado executable, make it executable, and (optionally) add its directory to your PATH.
You can then run dorado directly.
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)
Assistant
This error message:
code
./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)
indicates that the Dorado executable and its dependencies were compiled against a newer version of the GNU C Library (glibc) than what is available on your system. Specifically, they require at least glibc 2.29, and your system has an older version. This is a common issue when running pre-built binaries on systems with older operating systems or library versions.
Here's a breakdown of the problem and potential solutions:
Understanding the Problem:
glibc: glibc is a fundamental library that provides essential functions for C programs. It's the foundation for many other libraries and applications on Linux.
Version Compatibility: Binaries compiled against a specific version of glibc (or any other library) usually require that version or a compatible later version to be present on the system where they are run.
Pre-built Binaries: The Dorado developers built the dorado-0.9.6-linux-x64 package on a system with glibc 2.29 (or later). Your system is running an older version.
Solutions (Ordered by Preference - Easiest to Hardest):
Use a Container (Recommended - Easiest and Most Reliable):
Docker or Singularity: The best solution is to run Dorado within a containerized environment like Docker or Singularity. These containers provide a self-contained environment with all the necessary libraries and dependencies. Dorado (and many other scientific software packages) often provide Docker images specifically to avoid these types of glibc compatibility issues.
Docker: If you have Docker installed:
Find the official Dorado Docker image (check the Dorado documentation or Docker Hub). It's likely something like ontresearch/dorado.
bash
git submodule init
git submodule update
Run these commands from the top-level directory of the dorado-0.9.6 source code.
Manual Dependency Installation (Less Recommended, but Possible):
If you absolutely cannot get the automated dependency handling to work, you could try manually downloading and extracting the dependencies. However, this is error-prone and requires careful attention to version compatibility.
Identify Versions: Inspect the CMakeLists.txt file in dorado/3rdparty/ for clues about the expected versions of argparse, catch2, spdlog, elzip, ont-minimap2, edlib, and date.
Download and Extract: Download the specified versions of each dependency from their respective websites or repositories.
Place in Correct Locations: Extract the downloaded source code for each dependency into the corresponding subdirectory within dorado/3rdparty/. For example:
HighFive Patch: The error about the HighFive patch failing suggests there's an issue with the HighFive library. If it's a dependency, ensure it's present and the patch is compatible.
Environment Variables:
Some build systems use environment variables to specify the location of dependencies. Check the dorado documentation to see if any such variables are required.
Example Scenario (Using Git Submodules):
Let's say the dorado-0.9.6 source was obtained via Git. You'd do the following:
bash
git clone <dorado_repository_url> dorado-0.9.6
cd dorado-0.9.6
git submodule init
git submodule update
mkdir build
cd build
cmake ..
make -j $(nproc)
Important Considerations:
Operating System: The exact steps might vary slightly depending on your operating system (Linux, macOS, Windows).
Compiler: Ensure you have a compatible C++ compiler installed (e.g., GCC, Clang) and that CMake can find it. You might need to set the CXX environment variable.
Dorado Documentation: The most important thing is to consult the official documentation for dorado-0.9.6. It should provide detailed instructions on how to build the software, including how to handle dependencies.
Permissions: Make sure you have read and write permissions to the directories where you are extracting and building the software.
Debugging Steps:
Start Simple: Try building the simplest possible configuration of dorado (if it has options). Disable any optional features that might require extra dependencies.
Verbose Output: Run CMake with the --debug-output flag to get more detailed information about what it's doing.
Check CMake Cache: The CMake cache might contain incorrect or stale information. Try deleting the CMakeCache.txt file in your build directory and re-running CMake.
By systematically checking these steps and consulting the dorado documentation, you should be able to resolve the build errors and successfully compile the software. Good luck!
Run the Docker image:
bash
docker run -it --rm -v <your_data_directory>:/data ontresearch/dorado --help
Replace <your_data_directory> with the actual path to the directory on your host system where your input data is located. The -v option mounts this directory into the container so Dorado can access your files. The --rm flag removes the container after you exit it. The -it option gives you an interactive terminal inside the container.
Singularity: If you have Singularity installed (more common on HPC clusters):
Find the Dorado Singularity image (usually a .sif file). You might need to build it from a Dockerfile or download it from a container registry.
Run the Singularity image:
bash
singularity exec <dorado_image>.sif dorado --help
Why containers are ideal: Containers isolate the application and its dependencies from the host system, ensuring that the correct glibc version and other libraries are available. This eliminates the compatibility issues.
Not Recommended for Beginners: Upgrading glibc is a complex and potentially risky operation. It can break your system if not done correctly. It usually requires root or administrator privileges.
Check Your Distribution's Documentation: Consult the documentation for your Linux distribution (e.g., CentOS, Ubuntu, Debian) on how to upgrade glibc. The process varies depending on the distribution and version. Do not attempt to upgrade glibc without carefully following the instructions for your specific system.
Possible Consequences: A failed glibc upgrade can render your system unbootable. Back up your data before attempting this.
Build Dorado from Source (Most Difficult, Requires a Build Environment):
If a pre-built binary doesn't work, build it yourself. You can try to download the source code and build it on your system. This ensures that the executable is linked against the glibc version available on your machine. This avoids compatibility issues.
Download the Dorado source code. (Not the prebuilt binary)
Build from the source using CMake.
Follow the instruction i wrote above.
Use a Different System (Simplest if Possible):
If possible, run Dorado on a system that already has a newer glibc version. This is the simplest solution if you have access to a more up-to-date Linux distribution.
How to Check Your glibc Version:
Run the following command in your terminal:
bash
ldd --version
The output will show the glibc version installed on your system. Look for the line that says "GNU C Library version ...".
Example (Using Docker):
Let's assume the Dorado Docker image is ontresearch/dorado:latest (check the official documentation to confirm the actual image name). And let's say your data is in /home/users/nus/jwh/data.
bash
docker run -it --rm -v /home/users/nus/jwh/data:/data ontresearch/dorado:latest dorado --help
Inside the Docker container, your /home/users/nus/jwh/data directory will be accessible as /data. So, you would use /data/your_input_file.fastq (or whatever the path is) when running Dorado commands inside the container.
Key Takeaway:
The easiest and safest solution is to use a container (Docker or Singularity) to run Dorado. This eliminates the glibc compatibility issues and provides a consistent and reproducible environment. Upgrading glibc directly is generally discouraged unless you are very comfortable with system administration and have a solid understanding of the risks involved. Building from source is another possibility, but it requires setting up a build environment.