PRSice
PRSice copied to clipboard
[BUG] `sys/sysctl.h` is deprecated in glibc-2.3.2
Describe the bug
Dear @choishingwan.
The deprecated sys/sysctl.h
is used in a few places across the PRSice codes, preventing compilation of the project.
Error Log
Compilation error running make
:
...
43.57 -- Found ZLIB: /usr/lib/aarch64-linux-gnu/libz.so (found version "1.2.11")
43.57 -- Looking for C++ include pthread.h
43.64 -- Looking for C++ include pthread.h - found
43.64 -- Performing Test CMAKE_HAVE_LIBC_PTHREAD
43.73 -- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
43.73 -- Found Threads: TRUE
43.73 -- Configuring done
43.74 -- Generating done
43.75 -- Build files have been written to: /tmp/PRSice-2.3.5/build
43.78 [ 4%] Building CXX object src/CMakeFiles/bgen.dir/bgen_lib.cpp.o
43.96 In file included from /tmp/PRSice-2.3.5/inc/memoryread.hpp:4,
43.96 from /tmp/PRSice-2.3.5/lib/bgen_lib.hpp:10,
43.96 from /tmp/PRSice-2.3.5/src/bgen_lib.cpp:7:
43.96 /tmp/PRSice-2.3.5/inc/misc.hpp:51:10: fatal error: sys/sysctl.h: No such file or directory
43.96 51 | #include <sys/sysctl.h>
43.96 | ^~~~~~~~~~~~~~
43.96 compilation terminated.
43.96 make[2]: *** [src/CMakeFiles/bgen.dir/build.make:76: src/CMakeFiles/bgen.dir/bgen_lib.cpp.o] Error 1
43.96 make[1]: *** [CMakeFiles/Makefile2:112: src/CMakeFiles/bgen.dir/all] Error 2
43.96 make: *** [Makefile:91: all] Error 2
To Reproduce
Try build the following Dockerfile
(some work in progress virtual machine, based on Ubuntu jammy (22.04LTS):
# R container
FROM rocker/r-ver:4.3.1
ENV TZ=Europe
ENV DEBIAN_FRONTEND noninteractive
WORKDIR /tmp/
# some system dependencies
RUN apt-get update && apt-get install -y --no-install-recommends apt-utils=2.4.10 && \
apt-get update && apt-get install -y --no-install-recommends ca-certificates=20230311ubuntu0.22.04.1 && \
update-ca-certificates
RUN apt-get update && apt-get install -y --no-install-recommends \
unzip=6.0-26ubuntu3.1 \
wget=1.21.2-2ubuntu1 \
curl=7.81.0-1ubuntu1.13 \
node-shasum=1.0.2-3 \
libatlas-base-dev=3.10.3-12ubuntu1 \
libgslcblas0=2.7.1+dfsg-3 \
cmake=3.22.1-1ubuntu1.22.04.1 \
zlib1g-dev \
&& \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
# install PRSice-2
RUN wget --no-check-certificate https://github.com/choishingwan/PRSice/archive/refs/tags/2.3.5.zip && \
unzip 2.3.5.zip && \
cd PRSice-2.3.5 && \
mkdir build && \
cd build && \
cmake ../ && \
make && \
cp PRSice/bin/PRSice /bin/ && \
cd /tmp && \
rm -rf 2.3.5.zip PRSice-2.3.5
RUN rm -rf /tmp/*
WORKDIR /
issuing: docker build -t prsice2 -f Dockerfile .