Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compiling error for missing header files #129

Open
lye2 opened this issue Oct 13, 2023 · 4 comments
Open

Compiling error for missing header files #129

lye2 opened this issue Oct 13, 2023 · 4 comments

Comments

@lye2
Copy link

lye2 commented Oct 13, 2023

I am trying to build a docker image with the Dockerfile provided. But I am getting some errors for header files during the compiling process.

FastqReader.cpp:1:10: fatal error: SeqLib/FastqReader.h: No such file or directory
#include "SeqLib/FastqReader.h"
^~~~~~~~~~~~~~~~~~~~~~
BFC.cpp:33:10: fatal error: SeqLib/BFC.h: No such file or directory
#include "SeqLib/BFC.h"
^~~~~~~~~~~~~~
compilation terminated.
compilation terminated.
ReadFilter.cpp:1:10: fatal error: SeqLib/ReadFilter.h: No such file or directory
#include "SeqLib/ReadFilter.h"
^~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make[2]: *** [libseqlib_a-BFC.o] Error 1
make[2]: *** Waiting for unfinished jobs....
SeqPlot.cpp:1:10: fatal error: SeqLib/SeqPlot.h: No such file or directory
#include "SeqLib/SeqPlot.h"
^~~~~~~~~~~~~~~~~~
compilation terminated.
Makefile:435: recipe for target 'libseqlib_a-BFC.o' failed
Makefile:449: recipe for target 'libseqlib_a-ReadFilter.o' failed
make[2]: *** [libseqlib_a-ReadFilter.o] Error 1
Makefile:421: recipe for target 'libseqlib_a-FastqReader.o' failed
make[2]: *** [libseqlib_a-FastqReader.o] Error 1
Makefile:463: recipe for target 'libseqlib_a-SeqPlot.o' failed
make[2]: *** [libseqlib_a-SeqPlot.o] Error 1
ssw_cpp.cpp:1:10: fatal error: SeqLib/ssw_cpp.h: No such file or directory
#include "SeqLib/ssw_cpp.h"
^~~~~~~~~~~~~~~~~~
compilation terminated.
RefGenome.cpp:1:10: fatal error: SeqLib/RefGenome.h: No such file or directory
#include "SeqLib/RefGenome.h"
^~~~~~~~~~~~~~~~~~~~
compilation terminated.
GenomicRegion.cpp:1:10: fatal error: SeqLib/GenomicRegion.h: No such file or directory
#include "SeqLib/GenomicRegion.h"
^~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Makefile:477: recipe for target 'libseqlib_a-ssw_cpp.o' failed
make[2]: *** [libseqlib_a-ssw_cpp.o] Error 1
Makefile:505: recipe for target 'libseqlib_a-RefGenome.o' failed
make[2]: *** [libseqlib_a-RefGenome.o] Error 1
Makefile:491: recipe for target 'libseqlib_a-GenomicRegion.o' failed
make[2]: *** [libseqlib_a-GenomicRegion.o] Error 1
ssw.c:44:10: fatal error: SeqLib/ssw.h: No such file or directory
#include "SeqLib/ssw.h"
^~~~~~~~~~~~~~
compilation terminated.
make[2]: *** [libseqlib_a-ssw.o] Error 1
Makefile:393: recipe for target 'libseqlib_a-ssw.o' failed
make[2]: Leaving directory '/svaba/SeqLib/src'
Makefile:358: recipe for target 'all-recursive' failed
make[1]: Leaving directory '/svaba'
make[1]: *** [all-recursive] Error 1
Makefile:299: recipe for target 'all' failed
make: *** [all] Error 2
The command '/bin/sh -c cd svaba && ./configure && make -j$(nproc) && make -j$(nproc) install' returned a non-zero code: 2

@walaj
Copy link
Owner

walaj commented Oct 13, 2023 via email

@lye2
Copy link
Author

lye2 commented Oct 13, 2023

Here is the line above the error:
g++ -DHAVE_CONFIG_H -I. -I../.. -I../htslib -Wno-sign-compare -g -Wall -Wextra -Wno-unknown-pragmas -std=c++11 -D_GLIBCXX_USE_CXX11_ABI=0 -g -O2 -MT libseqlib_a-FastqReader.o -MD -MP -MF .deps/libseqlib_a-FastqReader.Tpo -c -o libseqlib_a-FastqReader.o test -f 'FastqReader.cpp' || echo './'FastqReader.cpp

@walaj
Copy link
Owner

walaj commented Oct 13, 2023

I've been working on getting away from autotools and using cmake, I think time to implement now for this. I just updated the master branch to now use cmake. The issue is that the build now should point to a system htslib. Can you try this Dockerfile? I tested most of it, but it won't compile on apple silicon right now due to some dependencies in fermi-lite that haven't been updated yet

# Start with an Ubuntu image
FROM ubuntu:20.04

# Avoid prompts with tzdata (timezones)
ENV DEBIAN_FRONTEND=noninteractive

# Install dependencies for htslib and svaba
RUN apt update && apt install -y \
    autoconf \
    automake \
    make \
    gcc \
    g++ \
    git \
    perl \
    zlib1g-dev \
    libbz2-dev \
    liblzma-dev \
    libcurl4-gnutls-dev \
    libssl-dev \
    cmake \
    && rm -rf /var/lib/apt/lists/*

# Clone and install htslib
WORKDIR /opt
RUN git clone --recursive https://github.com/samtools/htslib.git && \
    cd htslib && \
    autoheader && \
    autoconf && \
    ./configure && \
    make && \
    make install

# Ensure shared libraries are noticed
RUN ldconfig

# Clone svaba
WORKDIR /opt
RUN git clone --recursive https://github.com/walaj/svaba.git && cd svaba && mkdir build

# Compile svaba with htslib
WORKDIR /opt/svaba/build
RUN cmake .. \
    -DHTSLIB_INCLUDE_DIR=/usr/local/include \
    -DHTSLIB_LIBRARY=/usr/local/lib/libhts.so && make

ENV PATH "$PATH:/svaba/build"

@lye2
Copy link
Author

lye2 commented Oct 13, 2023

This worked for me. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants