DTUAqua / hpc_setup

0 stars 3 forks source link

qpdf? #4

Closed mebrooks closed 3 years ago

mebrooks commented 3 years ago

Sorry to bother you with this, but I hit another roadblock trying to get glmmTMB ready for CRAN. One warning I get is

 WARNING
‘qpdf’ is needed for checks on size reduction of PDFs

So I'm trying to install qpdf, but documentation says it requires a C++ compiler that supports C++-14. I cloned qpdf from github and got an error about the compiler (below). Do you have any suggestions for how to fix this warning for the glmmTMB checks?

n-62-29-2(molbr) $ cd qpdf/
~/qpdf
n-62-29-2(molbr) $ ./configure
checking for autoconf... 1
checking for autoheader... 1
checking for aclocal... 1
checking for sha256sum... 1
configure.ac: OK
aclocal.m4: OK
libqpdf/qpdf/qpdf-config.h.in: OK
m4/ax_cxx_compile_stdcxx.m4: OK
m4/ax_random_device.m4: OK
m4/libtool.m4: OK
m4/ltoptions.m4: OK
m4/ltsugar.m4: OK
m4/ltversion.m4: OK
m4/lt~obsolete.m4: OK
m4/pkg.m4: OK
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking for gcc option to accept ISO C99... -std=gnu99
checking for g++... g++
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking whether g++ supports C++14 features with ... no
checking whether g++ supports C++14 features with -std=c++14... no
checking whether g++ supports C++14 features with +std=c++14... no
checking whether g++ supports C++14 features with -h std=c++14... no
checking whether g++ supports C++14 features with ... (cached) no
checking whether g++ supports C++14 features with -std=c++1y... no
checking whether g++ supports C++14 features with +std=c++1y... no
checking whether g++ supports C++14 features with -h std=c++1y... no
configure: error: *** A compiler with support for C++14 language features is required.
mebrooks commented 3 years ago

Should I ask the cluster admins?

kaskr commented 3 years ago

@mebrooks Just saw your question. I would try loading the compiler before installing:

module load gcc/ (hit tab and selct a version)

Edit: module load gcc/9.2.0 is the one I currently use to build R - it supports all relevant C++ features.

mebrooks commented 3 years ago

Thanks! That got me past the ./configure step, but now I'm stuck on the make install step.

./mkinstalldirs -m 0755 /usr/local/lib/pkgconfig
mkdir -m 0755 -p -- /usr/local/lib/pkgconfig
mkdir: cannot create directory ‘/usr/local/lib/pkgconfig’: Permission denied
make: *** [install-libs] Error 1

Do you have an idea how to solve that one? I tried going into usr/local/lib and making it, but got the same error.

n-62-29-1(molbr) $ mkdir pkgconfig
mkdir: cannot create directory ‘pkgconfig’: Permission denied
/usr/local/lib
kaskr commented 3 years ago

@mebrooks You don't have permission to install to the system - and you don't have to. After make skip the make install step. Then locate the binaries and add them to your path.

Edit: 'binary' - I guess you only need qpdf...

mebrooks commented 3 years ago

Thanks! That fixed it! For future reference (in case anyone else has a similar problem), my solution was to edit .bashrc by typing nano ~/.bashrc

Then adding these lines to the middle section between if and fi

  export qpdf_home=~/qpdf/qpdf/build/
  export PATH=$qpdf_home:$PATH