How does stack determine which ghc to use? - ghc

My in-path ghc version is 8.4.4, as show by running $ ghc -- version.
$ ghc --version
The Glorious Glasgow Haskell Compilation System, version 8.4.4.
Somehow, however, my stack is using a different version, as shown by running $ stack ghc -- --version.
$ stack ghc -- --version
The Glorious Glasgow Haskell Compilation System, version 8.0.2.
I have no idea where the 8.0.2 of ghc is even installed on my system. How is this possible, and how can I update the version of ghc my stack uses?

I believe it references a resolver (which in turn references a GHC version). This could be a local stack.yaml file or the global one at ~/.stack/global-project/stack.yaml.

Related

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 do I run my Qt application on another linux machine?

I compiled a Qt application on a linux machine using Qt 5.6.2. It runs perfectly on that machine.
I copied the binaries on another 64bit machine. I used aptitude search libqt5 to find what Qt libraries should I install. I installed libqt5core5a and libqt5network5 packages. But when I run my program, I get this error:
darker2:~/workspace (master) $ ./server
./server: /usr/lib/x86_64-linux-gnu/libQt5Network.so.5: no version information available (required by ./server)
./server: /usr/lib/x86_64-linux-gnu/libQt5Core.so.5: no version information available (required by ./server)
./server: /usr/lib/x86_64-linux-gnu/libQt5Core.so.5: no version information available (required by ./server)
./server: relocation error: ./server: symbol qt_version_tag, version Qt_5.6 not defined in file libQt5Core.so.5 with link time reference
I suppose the problem here really is that the version does not match exactly. So, how do I install the very exact version that I used to compile my program? Note that I am very limited with disk space on the target virtual machine. I need to only install whatever is necessary.
The more universal solution, the better, for the sake of future readers.
You need to deploy the application, for this purpose I use the utility
cqtdeployer
You can install from github releases
or
from snapstore
sudo snap install cqtdeployer
You can use as follows:
cqtdeployer -bin myApp -qmake path/to/my/qmake -qmlDir path/to/my/qml/files/dir
And Run application with sh script
If you'll use the version from snap then make sure that you have all the permissions.

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

Ada fails with "Compiler not installed on this system" in Linux Mint

I've had some difficulty trying to obtain a working Ada compiler.
I had been attempting to install avr-ada on a Windows system. I've asked questions and been provided some good suggestions, but not quite there yet.
I've since tried to install and use GNAT on a Mint Linux system, but I keep getting stuck.
I've downloaded and installed gcc-4.8.0.
Installed ok.
I then want to build the GNAT Ada compiler, but the manual is not exactly useful.
Every time I try to find installation instruction for GNAT, I find nothing of immediate use.
For example the details I have found state:
"Building the Ada compiler has special requirements, see below"
But do not appear to have any content for how do build the Ada compiler anywhere.
Any ideas?
You could try your hand at my Slackware guide.
Just install VirtualBox on your Windows box and give Slackware a whirl in a VM. Actually if you don't want/need all the AdaCore stuff, Slackware comes with FSF GNAT out of the box. You don't really have to do anyting except call gnatmake to build your stuff.
But honestly, it's not that complicated to get GNAT GPL and the AdaCore projects up and running on Slackware.
For Debian (if you don't want to use the default Debian Ada packages) you could try the makefile done by Kim Rostgaard Christensen.
As I understand it, Mint is based on Ubuntu, which is based on Debian - so you should be able to install the package gnat; it'll probably be GCC 4.6.
I'm not sure whether you need 4.8.0? If so, or of course if you can't install gnat, you'll need to build it (or to wait until it reaches Debian/Ubuntu/Mint, which could be a while). GCC 4.6 (with Ada support) should be OK for this, or you could install AdaCore's Libre version. I know that GNAT GPL 2012 will build GCC 4.8.0 on Mac OS X; I wrote up building GCC from SVN using GNAT GPL 2011 here, and building GCC 4.8.0 here.

compiling programs in scientific linux (pcre)

I'm currently trying to install gtk3 on scientific linux (It is not available on official repositories)
I'm well used to yum, apt, pacman etc but i'm a little lost here when it's about compiling ...
to install gtk3, i need glib, to install glib, i need pcre 8.32.
I thus downloaded the tarball from their site.
Once 'untarred', i followed what is written on that link :
http://www.linuxfromscratch.org/blfs/view/svn/general/pcre.html
but once i've made './configure' with its options, 'make', and then 'make install' glib doesn't configure any better... it says my version is still the old version
configure: error: Package requirements (libpcre >= 8.13) were not met:
Requested 'libpcre >= 8.13' but version of libpcre is 7.8
The files seems to be well compiled but not 'moved correctly to the right place' ...
Did i miss something ?
By the way moving to another distro is not an option :P

Resources