Cargo shows an error compiling "qml v0.0.9" - qt

I tried to compile a sample Rust program which uses QML and got the following error:
error: failed to run custom build command for `qml v0.0.9`
process didn't exit successfully: `/home/olaf/SourceCode/rust_projects/sousa/target/debug/build/qml-cf7d687f9f68bd13/build-script-build` (exit code: 101)
--- stderr
thread 'main' panicked at 'Cannot build qrc resource:
-- The C compiler identification is GNU 5.4.0
-- The CXX compiler identification is GNU 5.4.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found Doxygen: /usr/bin/doxygen (found version \"1.8.11\")
-- Configuring incomplete, errors occurred!
See also \"/home/olaf/SourceCode/rust_projects/sousa/target/debug/build/qml-29ff7d8391813cc4/out/DOtherSide/build/CMakeFiles/CMakeOutput.log\"."
"Klone nach \'DOtherSide\' ...
CMake Error at /usr/lib/x86_64-linux-gnu/cmake/Qt5Core/Qt5CoreConfig.cmake:27 (message):
The imported target \"Qt5::Core\" references the file
\"/usr/lib/x86_64-linux-gnu/libQt5Core.so.5.5.1\"
but this file does not exist. Possible reasons include:
* The file was deleted, renamed, or moved to another location.
* An install or uninstall procedure did not complete successfully.
* The installation package was faulty and contained
\"/usr/lib/x86_64-linux-gnu/cmake/Qt5Core/Qt5CoreConfig.cmake\"
but not all the files it references.
Call Stack (most recent call first):
/usr/lib/x86_64-linux-gnu/cmake/Qt5Core/Qt5CoreConfig.cmake:43 (_qt5_Core_check_file_exists)
/usr/lib/x86_64-linux-gnu/cmake/Qt5Core/Qt5CoreConfig.cmake:134 (_populate_Core_target_properties)
lib/CMakeLists.txt:10 (find_package)
"', /home/olaf/.cargo/registry/src/github.com-1ecc6299db9ec823/qml-0.0.9/build.rs:32:8
note: Run with `RUST_BACKTRACE=1` for a backtrace.
Edit:
I have installed Qt 5.8, 5.9.1 and 5.9.3 but they are installed at my home folder ~/Qt and I think Cargo is looking somewhere else /usr/lib/...
How do I tell Cargo where to look for Qt?
Or do I have to install a specific package of Qt under /usr/lib/...?

As you can see in the error, the issue is that the file /usr/lib/x86_64-linux-gnu/libQt5Core.so.5.5.1 (which a Qt dynamic library) does not exist, which means that you need to install this version of Qt on your machine.
If you're on Ubuntu or an Ubuntu-derived distro, you can follow the instructions here to install it.

Related

Failed installing OpenCV using RStudio

I tried installing OpenCV using Rstudio (R version 3.6.3). I installed both Rtools and CMake and added them to the PATH. I received following error:
-- The CXX compiler identification is unknown
-- The C compiler identification is unknown
CMake Error at CMakeLists.txt:106 (enable_language):
The CMAKE_CXX_COMPILER:
c:/Rtools/mingw32/bin/g++.exe
is not a full path to an existing compiler tool.
Please help.

Error when installing MultiNest for MPI - missing Fortran libraries

I am trying to install MultiNest and PyMultiNest on Ubutnu 16.04. I have OpenMPI installed and can successfully run programs with it. However, during the installation of MultiNest, I get this:
kevin#kevin-VirtualBox:~/MultiNest/build$ cmake ..
-- A library with BLAS API found.
-- A library with LAPACK API found.
-- Detected gfortran, adding -ffree-line-length-none compiler flag.
CMake Warning at /usr/share/cmake-3.5/Modules/FindMPI.cmake:406 (message):
Unable to find MPI library mpi_mpifh
Call Stack (most recent call first):
/usr/share/cmake-3.5/Modules/FindMPI.cmake:596 (interrogate_mpi_compiler)
src/CMakeLists.txt:86 (FIND_PACKAGE)
-- Could NOT find MPI_Fortran (missing: MPI_Fortran_LIBRARIES)
-- MPI not found, only non-MPI MultiNest libraries will be built.
-- Configuring done
-- Generating done
-- Build files have been written to: /home/kevin/MultiNest/build
Any guidance on how to fix this?
When I installed 'libopenmpi-dev', the cmake process seemed to finish properly.

How to build the shiny-server from source on Debian?

I am trying to launch an shiny server on company's Debian machine. Based on the wiki: https://github.com/rstudio/shiny-server/wiki/Building-Shiny-Server-from-Source, I choose to "build the server from source" since Debian is not a supported distribution.
I was following the instruction step by step. However, I had an error when I tried to run:
$ cmake -DCMAKE_INSTALL_PREFIX=/usr/local -DPYTHON="$PYTHON" ../
-- The C compiler identification is GNU 4.9.2
-- The CXX compiler identification is GNU 4.9.2
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
CMake Error at external/pandoc/CMakeLists.txt:14 (file):
file DOWNLOAD HASH mismatch
for file: [/home/mli/shiny_server/shiny-server/tmp/external/pandoc/pandoc-1.12.3.zip]
expected hash: [1541304bf51d86e361b7d930f899ac1c]
actual hash: [d41d8cd98f00b204e9800998ecf8427e]
status: [7;"Couldn't connect to server"]
The detail of the error listed as:
mkdir: cannot create directory ‘/home/mli/shiny_server/shiny-server/tmp/external/pandoc/pandoc-1.12.3.zip’: File exists
End-of-central-directory signature not found. Either this file is not
a zipfile, or it constitutes one disk of a multi-part archive. In the
latter case the central directory and zipfile comment will be found on
the last disk(s) of this archive.
I have been searching a solution for a couple days but nothing is really working for me yet. It would be very nice if anyone could help me on this..
As an alternative, I have also downloaded the "shiny-server-1.3.0.403-amd64.deb" and installed it with "$ sudo gdebi". It successfully installed with a small error message:
Reading package lists... Done
Building dependency tree
Reading state information... Done
Building data structures... Done
Building data structures... Done
Shiny Server
Shiny Server is a server program from RStudio, Inc. that makes Shiny applications available over the web. Shiny is a web application framework for the R statistical computation language.
Do you want to install the software package? [y/N]:y
Selecting previously unselected package shiny-server.
(Reading database ... 49759 files and directories currently installed.)
Preparing to unpack shiny-server-1.3.0.403-amd64.deb ...
Unpacking shiny-server (1.3.0.403) ...
Setting up shiny-server (1.3.0.403) ...
User shiny already exists
grep: /etc/init/shiny-server.conf: No such file or directory
Adding LANG to /etc/init.d/shiny-server, setting to en_US.UTF-8
However, I can't initiate the server by:
$ sudo start shiny-server
Nothing happened after I ran the "start" command. Also, my Debian version is below:
Distributor ID: Debian
Description: Debian GNU/Linux 8.4 (jessie)
Release: 8.4
Codename: jessie

QT on Cygwin -- IPC Errors

I've downloaded the source for QT 5.6.0 and I'm attempting to compile/install it on a Cygwin installation for Windows.
The Cygwin build already has Qt4 and Qt3 libraries installed. Trying to upgrade so I can install the latest QtCreator suite.
Here is my Cygwin version via uname -a:
CYGWIN_NT-10.0 J_Mick-Windoze 2.5.1(0.297/5/3) 2016-04-21 22:14 x86_64 Cygwin
When I try to compile QT 5.6.1 via running ./configure -platform cygwin-g++ -prefix $PWD/qtbase -opensource -nomake tests I get the following error:
Running configuration tests (phase 1)...
Done running configuration tests.
Creating qmake...
.In file included from /home/JasonMick/Install_Stuff/qt-everywhere-opensource-src-5.6.0/qtbase/include/QtCore/5.6.0/QtCore/private/qcore_unix_p.h:1:0,
from /home/JasonMick/Install_Stuff/qt-everywhere-opensource-src-5.6.0/qtbase/src/corelib/global/qglobal.cpp:90:
/home/JasonMick/Install_Stuff/qt-everywhere-opensource-src-5.6.0/qtbase/src/corelib/kernel/qcore_unix_p.h: In function ‘key_t qt_safe_ftok(const QByteArray&, int)’:
/home/JasonMick/Install_Stuff/qt-everywhere-opensource-src-5.6.0/qtbase/src/corelib/kernel/qcore_unix_p.h:333:12: error: ‘::ftok’ has not been declared
return ::ftok(filename.constData(), qHash(filename, proj_id));
^
make: *** [qglobal.o] Error 1
Now clearly there is support for cygwin in the QT project as grepping inside configure I see the platform:
PLATFORM=cygwin-g++
...is defined. Doing some reading I read that ftok is a part of the IPC group of shared memory functions. One link regarding a similar error with a different app suggested linking in -lcygwin. I successfully added this to the L_FLAGS variable in the configure file, but it's still giving the same error, even when I specify the Cygwin as the platform via the -platform flag.
I would appreciate any advice as to how to get rid of this issue -- which I believe is attributable to some sort of missing IPC library error.

compiling armadillo with Rtools/MinGW

I'm trying in vain to compile the armadillo linear algebra library for windows. Using the armadillo-4.200.0 source, I have Rtools-3.1 installed and in the path, msys from MinGW installed.
Because my ultimate goal is to use Rcpp and RcppArmadillo, my thought is that I need to use the same compiler for making armadillo as will be used to compile my Rcpp/RcppArmadillo files. Unfortunately, when trying to compile armadillo:
$ ./configure
[...snip...]
-- The CXX compiler identification is unknown
-- Check for working CXX compiler: cl
CMake Warning at CMakeLists.txt:3 (PROJECT):
To use the NMake generator, cmake must be run from a shell that can use the
compiler cl from the command line. This environment does not contain
INCLUDE, LIB, or LIBPATH, and these must be set for the cl compiler to
work.
CMake Error: your CXX compiler: "cl" was not found. Please set CMAKE_CXX_COMPILER to a valid compiler path or name.
[...snip...]
(I tried setting CMAKE_CXX_COMPILER to my Rtools gcc.exe with no luck.)
I believe that it is looking for the visual C compiler, though the docs imply that it can be done solely with the mingw or cygwin compiler environments.
Either:
Is there a problem with compiling the armadillo library and subsequent Rcpp code with different versions of the compiler? (Rtools-3.1 has gcc version 4.6.3, MinGW has gcc version 4.8.1.)
Is there a clean method for compiling armadillo with just the Rtools collection?
(Win7 x64, R-3.1.0, cygwin gcc 4.8.2, rtools 3.1 with gcc 4.6.3.)
RcppArmadillo ships its own copy of Armadillo to avoid exactly this problem. As RcppArmadillpo is used from R, it can rely on R (and R's configuration) to get LAPACK, BLAS, etc pp. We don't need to run configure to use Armadillo from R, and so we don't do.
RcppArmadillo installs the usual R CMD INSTALL ... way; this is tested before every release and has worked reliably.
As you say "your ultimate goal is to use Rcpp and RcppArmadillo", you are in fact done at the R CMD INSTALL .... You can replicate the step from source, and test the package -- all that should "just work".
The other thing to keep in mind is what the "Writing R Extensions" and "R Installation and Administration" manuals have to say about your compiler. As far is R is concerned, your g++ 4.8.* does not exist. Only the Rtools version matters, or you get into non-standard land real quick.

Resources