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

Could NOT find Threads (missing: Threads_FOUND) #118

Closed
skhaz opened this issue Dec 5, 2022 · 1 comment
Closed

Could NOT find Threads (missing: Threads_FOUND) #118

skhaz opened this issue Dec 5, 2022 · 1 comment

Comments

@skhaz
Copy link

skhaz commented Dec 5, 2022

I am trying to compile ECT on arm64 using Docker

I have installed all dependencies (I guess, because it works on x86_64)

RUN apt-get update && apt-get install -y autoconf build-essential cmake pkg-config nasm wget

However, when I run cmake ., it can not found libpthread

Full output=> ERROR [builder 10/13] RUN cd src && cmake . && make -j$(nproc)                                                     0.7s
------
 > [builder 10/13] RUN cd src && cmake . && make -j$(nproc):
#0 0.397 -- The CXX compiler identification is GNU 12.2.0
#0 0.487 -- The C compiler identification is GNU 12.2.0
#0 0.496 -- Detecting CXX compiler ABI info
#0 0.569 -- Detecting CXX compiler ABI info - done
#0 0.574 -- Check for working CXX compiler: /usr/bin/c++ - skipped
#0 0.574 -- Detecting CXX compile features
#0 0.575 -- Detecting CXX compile features - done
#0 0.577 -- Detecting C compiler ABI info
#0 0.631 -- Detecting C compiler ABI info - done
#0 0.637 -- Check for working C compiler: /usr/bin/cc - skipped
#0 0.637 -- Detecting C compile features
#0 0.637 -- Detecting C compile features - done
#0 0.644 -- Performing Test CMAKE_HAVE_LIBC_PTHREAD
#0 0.664 -- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
#0 0.664 -- Looking for pthread_create in pthreads
#0 0.683 -- Looking for pthread_create in pthreads - not found
#0 0.683 -- Looking for pthread_create in pthread
#0 0.702 -- Looking for pthread_create in pthread - not found
#0 0.702 -- Check if compiler accepts -pthread
#0 0.722 -- Check if compiler accepts -pthread - no
#0 0.723 CMake Error at /usr/share/cmake-3.25/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
#0 0.723   Could NOT find Threads (missing: Threads_FOUND)
#0 0.723 Call Stack (most recent call first):
#0 0.723   /usr/share/cmake-3.25/Modules/FindPackageHandleStandardArgs.cmake:600 (_FPHSA_FAILURE_MESSAGE)
#0 0.723   /usr/share/cmake-3.25/Modules/FindThreads.cmake:228 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
#0 0.723   zopfli/CMakeLists.txt:35 (find_package)
#0 0.723 
#0 0.723 
#0 0.723 -- Configuring incomplete, errors occurred!
#0 0.723 See also "/opt/ect/src/CMakeFiles/CMakeOutput.log".
#0 0.723 See also "/opt/ect/src/CMakeFiles/CMakeError.log".

Any ideas?

Full Dockerfile

FROM debian:bookworm AS builder
RUN apt-get update && apt-get install -y autoconf build-essential cmake libstdc++-12-dev pkg-config nasm wget

ARG ECT_HASH=8b2511e2ceecd633af00646ec9fe16c90528cee9
WORKDIR /opt/ect
RUN wget -qO- github.com/fhanau/Efficient-Compression-Tool/archive/"$ECT_HASH".tar.gz | tar zx --strip-components=1
RUN wget -qO- github.com/glennrp/libpng/archive/07b8803110da160b158ebfef872627da6c85cbdf.tar.gz | tar zx --strip-components=1 -C src/libpng
RUN wget -qO- github.com/mozilla/mozjpeg/archive/cf6facaedb8f8ded44e6c41b0db8a721d329ff22.tar.gz | tar zx --strip-components=1 -C src/mozjpeg
RUN cd src && cmake . && make -j$(nproc)
docker buildx build --platform=linux/arm64 --tag ect
@fhanau
Copy link
Owner

fhanau commented Dec 5, 2022

Hello Rodrigo,
it looks like this may be a cmake related issue. First, make sure that pthread is installed. Based on what I have seen on other projects, adding set(THREADS_PREFER_PTHREAD_FLAG ON) before find_package(Threads REQUIRED) in src/zopfli/CMakeLists.txt might do the trick. Otherwise, you can try the suggestions in alicevision/geogram/issues/2. Let me know if these suggestions get it to work!

@skhaz skhaz closed this as completed Dec 24, 2022
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