Stack setup fails with package installation errors - haskell

I'm trying to get stack running for the first time, but running stack setup in an example project (from stack new helloworld new-template) fails with the following output (I skipped the beginning, which I think was normal):
Installing library in
/home/ajl/.stack/programs/x86_64-linux/ghc-7.10.2/lib/ghc7.10.2/ghc_JzwEp1oQ8kA7NFNTGk1ho5 "/home/ajl/.stack/programs/x86_64-linux/ghc-7.10.2/lib/ghc-7.10.2/bin/ghc-pkg" --force --global-package-db "/home/ajl/.stack/programs/x86_64-linux/ghc-7.10.2/lib/ghc-7.10.2/package.conf.d" update rts/dist/package.conf.install
Reading package info from "rts/dist/package.conf.install" ... done.
: Warning: Unrecognized field 420 on line 420
(Skipped unrecognized field for every line 419 down to 1)
: Warning: Unrecognized field 1 on line 1
: missing id field
: invalid package identifier:
: invalid package key:
make[1]: *** [install_packages] Error 1
make: *** [install] Error 2
Installing GHC ...%
I'm on Ubuntu 14.04, running stack 1.0.2. Not sure if it's relevant but I have ghc 7.10.1 with Cabal 1.23.0.0 installed on the system already, which work fine.
I have tried changing the resolver to older LTS versions with older ghc versions. I also tried deleting ~/.stack. Not sure what else to try given the unhelpfulness of the errors.

I figured it out. The GHC build uses grep to make packages.conf.install. I have GREP_OPTIONS=--color=auto -n set in my zsh config. The -n was putting line numbers in front of everything, which was causing the errors.
The reason I couldn't find packages.conf.install anywhere before is because it is made on the fly during GHC make. And stack does that in /tmp.

Related

Cygwin -- installing `tcl-devel` packages does not provide header files

I have some makefile that is used to compile a program. During compilation I get an error:
In file included from kernel/driver.cc:20:
./kernel/yosys.h:81:12: fatal error: tcl.h: No such file or directory
81 | # include <tcl.h>
| ^~~~~~~
compilation terminated.
make: *** [Makefile:696: kernel/driver.o] Error 1
Then I rerun Cygwin setup application and install new package tcl-devel. I restart the Cygwin terminal and try again. The same error pops up. I don't understand! Why aren't headers found?
My tcl and tcl-devel are both of version 8.6.11-1.

Can't compile QT 5.5.1 on Amazon Centos: Project ERROR: Unknown module(s) in QT: quick

I am trying to compile QT 5.5.1 on Amazon AMI 2015.09, which looks la lot like Centos 6.5.
I keep getting this error:
Project ERROR: Unknown module(s) in QT: quick
However, there is no quick module that I can find, and no obvious way to enable to disable it from looking at the ./configure script.
My procedure:
I downloaded qt-everywhere-opensource-src-5.5.1.tar.gz
I unpacked it.
I ran ./configure
Confirmed that I want the opensource license and agreed to the LGPL.
Ran gmake -j4 (but I get the same behavior with gmake.
Interestingly, make distclean gives me this error:
Project ERROR: Unknown module(s) in QT: quick-private
Here are all of the errors sent to STDERR:
Checking for openal... Checking for bluez... no
Checking for bluez_le... no
Checking for btapi10_2_1... no
/home/ec2-user/qt-everywhere-opensource-src-5.5.1/qtmultimedia/qtmultimedia.pro:28: Variable GST_VERSION is not defined.
Checking for resourcepolicy... no
Checking for gpu_vivante... no
Checking for libbb2... no
no
Project MESSAGE: Unsupported Bluetooth platform, will not build a working QtBluetooth library.
Project MESSAGE: Either no Qt D-Bus found or no BlueZ headers.
qbluetoothdevicediscoveryagent_p.h:0: Note: No relevant classes found. No output generated.
qbluetoothservicediscoveryagent_p.h:0: Note: No relevant classes found. No output generated.
qbluetoothserver_p.h:0: Note: No relevant classes found. No output generated.
qbluetoothlocaldevice_p.h:0: Note: No relevant classes found. No output generated.
Checking for assimp... no
Project ERROR: Unknown module(s) in QT: quick
gmake[4]: *** [sub-textureandlight-make_first] Error 3
gmake[3]: *** [sub-canvas3d-make_first] Error 2
gmake[2]: *** [sub-canvas3d-make_first] Error 2
gmake[1]: *** [sub-examples-make_first] Error 2
gmake: *** [module-qtcanvas3d-make_first] Error 2
gmake: *** Waiting for unfinished jobs....
At another poster's suggestion I tried ./configure -skip qtquick but that didn't work:
$ ./configure -skip qtquick
+ cd qtbase
+ /home/ec2-user/qt-everywhere-opensource-src-5.5.1/qtbase/configure -top-level -skip qtquick
Attempting to skip non-existent module qtquick.
$
this is what I think will solve your problems:
You have use `make confclean' instead of making distclean for deleting the previous configuration.
Configure in verbose mode — more information will be provided, sorry, I don't remember exact flag, if I'm not mistaken, it's -v.
If you don't need quick, add -skip qtquick to the configure.

Yesod build error because of the duplicate definition for symbol "hsprimitive_memcpy"

I followed "Yesod quick start guide" to install Yesod in Windows 10.
But, when I issued the stack build command, it failed.
Environment
Windows 10 (64bits)
stack-0.1.5 (for Windows10 64bits)
Haskell Platform 7.10.2-a (from HaskellPlatform-7.10.2-a-x86_64-setup.exe)
alex-3.1.4.log
GHC runtime linker: fatal error: I found a duplicate definition for symbol
hsprimitive_memcpy
whilst processing object file
C:\Users\xxxxx\AppData\Roaming\stack\snapshots\x86_64-windows\lts-3.8\7.10.2\lib\x86_64-windows-ghc-7.10.2\primitive-0.6.1.0-5Jnw7oEuYtM9dmKXelGXVb\HSprimitive-0.6.1.0-5Jnw7oEuYtM9dmKXelGXVb.o
This could be caused by:
* Loading two different object files which export the same symbol
* Specifying the same object file twice on the GHCi command line
* An incorrect `package.conf' entry, causing some object to be
loaded twice.
ghc: panic! (the 'impossible' happened)
(GHC version 7.10.2 for x86_64-unknown-mingw32):
loadObj "C:\\Users\\xxxxx\\AppData\\Roaming\\stack\\snapshots\\x86_64-windows\\lts-3.8\\7.10.2\\lib\\x86_64-windows-ghc-7.10.2\\primitive-0.6.1.0-5Jnw7oEuYtM9dmKXelGXVb\\HSprimitive-0.6.1.0-5Jnw7oEuYtM9dmKXelGXVb.o": failed
It seems that the cause of the error were the duplicated GHC installation.
Thanks for #Reid comment, I realized that I installed Haskel Platform from exe file before and I also installed GHC through stack by folloing the guide.
I unisatlled GHC of Haskel Platform and executed 'stack setup' command.
Then, I executed 'stack build' command and it seemed worked.
I still have problems with the 'stack build' command, but I solved this issue.

build octave package from source

I want to install octaviz package in octave software.
From the documentation there is stated:
-You'll need octave 2.1.53 or later and VTK CVS to build octaviz. To compile octaviz, run ccmake . in the root directory of the source tree, then make and finally make install.
I first ran ccmake ., and it completed successfully after I installed some libs that I was missing.
But, the I ran "make" and it exits with the following errors:
>> make
[ 1%] Built target vtkWrapOctave
[ 1%] Building CXX object Common/CMakeFiles/octaviz.dir/octaviz.o
/home/user12345/octave/octaviz/Common/octaviz.cc:31:24: fatal error: octave/oct.h: No such file or directory
#include <octave/oct.h>
^
compilation terminated.
make[2]: *** [Common/CMakeFiles/octaviz.dir/octaviz.o] Error 1
make[1]: *** [Common/CMakeFiles/octaviz.dir/all] Error 2
make: *** [all] Error 2
Any idea what I am missing here?
You are missing the octave/oct.h header. This usually means that you don't have Octave installed. If you do have it installed, maybe you are missing the header files and shared libraries (if you are using Linux, did you install octave's -dev or -devel packaqes?) If you have them installed, you must have ran the configure script incorrectly. Either specify the correct options or set the CXX_FLAGS. If you don't know about compiler flags you probably should not change them and instead figure out how to install the octave libraries correctly.

GHC not generating dyn_hi

I'm working on a Linux machine with GHC 7.8.2 and cabal 1.20.0.1.
I'm trying to install semigroups and whenever I do, I get the dreaded error message about missing dyn_hi files.
/home/me/.cabal/lib/x86_64-linux-ghc-7.8.2/semigroups-0.14
setup-Simple-Cabal-1.18.1.3-x86_64-linux-ghc-7.8.2: Error: Could not find
module: Data.Semigroup with any suffix: ["dyn_hi"] in the search path:
["dist/build"]
cabal: Error: some packages failed to install:
semigroups-0.14 failed during the final install step. The exception was:
I've tried following the advice given here and here. I've removed .cabal/config, .ghc, added shared : True and followed each step.But after multiple repetitions of these instructions I'm still getting the same errors.
Is there any other way to diagnose and fix these errors?

Resources