I try to use the Graphalyze library, installed by the standard way cabal install graphalyze. When I import any modules from this package, I face with a trouble.
My project normally loading into WinGHCi, but when I try to use any function, I see:
Loading package bktrees-0.3.1 ... linking ... done.
Loading package filepath-1.3.0.0 ... linking ... done.
Loading package old-time-1.1.0.0 ... linking ... done.
Loading package directory-1.1.0.2 ... linking ... done.
Loading package colour-2.3.3 ... linking ... done.
Loading package dlist-0.5 ... linking ... done.
Loading package polyparse-1.8 ... linking ... done.
Loading package process-1.1.0.1 ... linking ... done.
Loading package temporary-1.1.2.4 ... linking ... done.
Loading package wl-pprint-text-1.1.0.0 ... linking ... done.
Loading package graphviz-2999.16.0.0 ... linking ... done.
Loading package network-2.3.1.0 ... linking ... done.
Loading package HTTP-4000.2.5 ... linking ... done.
Loading package base64-bytestring-1.0.0.1 ... linking ... done.
Loading package blaze-builder-0.3.1.1 ... linking ... done.
Loading package blaze-markup-0.5.1.5 ... linking ... done.
Loading package blaze-html-0.5.1.3 ... linking ... done.
Loading package List-0.5.1 ... linking ... done.
Loading package extensible-exceptions-0.1.1.4 ... linking ... done.
Loading package utf8-string-0.3.7 ... linking ... done.
Loading package hexpat-0.20.3 ... linking ... done.
Loading package syb-0.3.7 ... linking ... done.
Loading package hs-bibutils-5.0 ... linking ... done.
Loading package pretty-1.1.1.0 ... linking ... done.
Loading package json-0.7 ... linking ... done.
Loading package pandoc-types-1.10 ... linking ... done.
Loading package citeproc-hs-0.3.8 ... linking ... done.
Loading package data-default-class-0.0.1 ... linking ... done.
Loading package data-default-instances-base-0.0.1 ... linking ... done.
Loading package data-default-instances-containers-0.0.1 ... linking ... done.
Loading package data-default-instances-dlist-0.0.1 ... linking ... done.
Loading package data-default-instances-old-locale-0.0.1 ... linking ... done.
Loading package data-default-0.5.3 ... linking ... done.
Loading package regex-base-0.93.2 ... linking ... done.
Loading package regex-pcre-builtin-0.94.4.7.8.31 ... linking ... ghc: unable to load package `regex-pcre-builtin-0.94.4.7.8.31'
If I try again without reloading, I see only one string, but on differ library!:
Loading package bktrees-0.3.1 ... linking ... ghc: unable to load package `bktrees-0.3.1'
What is the problem?
I use WinGHCi 1.0.6 and ghc version 7.4.2, in ghci i have the same problem.
Upd: runghc results `HSregex-pcre-builtin-0.94.4.7.8.31.o: unknown symbol __imp__pcre _compile'
Related
I’m trying to build a project in a cabal sandbox that depends on happstack-server, but this package fails to build. Here is the content of .cabal-sandbox/logs/happstack-server-7.4.6.1.log:
Building happstack-server-7.4.6.1...
Preprocessing library happstack-server-7.4.6.1...
[ 1 of 38] Compiling Happstack.Server.Internal.LazyLiner ( src/Happstack/Server/Internal/LazyLiner.hs, dist/dist-sandbox-925bc8f2/build/Happstack/Server/Internal/LazyLiner.o )
[ 2 of 38] Compiling Happstack.Server.Internal.SocketTH ( src/Happstack/Server/Internal/SocketTH.hs, dist/dist-sandbox-925bc8f2/build/Happstack/Server/Internal/SocketTH.o )
Loading package ghc-prim ... linking ... done.
Loading package integer-gmp ... linking ... done.
Loading package base ... linking ... done.
Loading package array-0.5.0.0 ... linking ... done.
Loading package deepseq-1.3.0.2 ... linking ... done.
Loading package bytestring-0.10.4.0 ... linking ... done.
Loading package zlib-0.6.1.1 ... linking ... done.
Loading package xhtml-3000.2.1 ... linking ... done.
Loading package utf8-string-0.3.8 ... linking ... done.
Loading package old-locale-1.0.0.6 ... linking ... done.
Loading package old-time-1.1.0.2 ... linking ... done.
Loading package time-1.4.2 ... linking ... done.
Loading package time-compat-0.1.0.3 ... linking ... done.
Loading package stm-2.4.4.1 ... linking ... done.
Loading package threads-0.5.1.3 ... linking ... done.
Loading package containers-0.5.5.1 ... linking ... done.
Loading package binary-0.8.2.1 ... linking ... done.
Loading package text-1.2.2.0 ... linking ... done.
Loading package system-filepath-0.4.13.4 ... linking ... done.
Loading package syb-0.6 ... linking ... done.
Loading package unix-2.7.0.1 ... linking ... done.
Loading package network-2.6.2.1 ... linking ... done.
Loading package sendfile-0.7.9 ... linking ... done.
Loading package transformers-0.3.0.0 ... linking ... done.
Loading package mtl-2.1.3.1 ... linking ... done.
Loading package parsec-3.1.9 ... linking ... done.
Loading package network-uri-2.6.0.3 ... linking ... done.
Loading package transformers-compat-0.5.1.4 ... linking ... done.
Loading package transformers-base-0.4.4 ... linking ... done.
Loading package monad-control-1.0.0.5 ... linking ... done.
Loading package html-1.0.1.2 ... linking ... done.
Loading package filepath-1.3.0.2 ... linking ... done.
Loading package directory-1.2.1.0 ... linking ... done.
Loading package process-1.2.0.0 ... linking ... done.
Loading package hslogger-1.2.9 ... linking ... done.
Loading package extensible-exceptions-0.1.1.4 ... linking ... done.
Loading package pretty-1.1.1.1 ... linking ... done.
Loading package template-haskell ... linking ... done.
Loading package exceptions-0.8.2.1 ... linking ... done.
Loading package blaze-builder-0.4.0.1 ... linking ... done.
Loading package blaze-markup-0.7.0.3 ... linking ... done.
Loading package blaze-html-0.8.1.1 ... linking ... done.
Loading package base64-bytestring-1.0.0.1 ... linking ... done.
ByteCodeLink.lookupCE
During interactive linking, GHCi couldn't find the following symbol:
templatezmhaskell_LanguageziHaskellziTHziSyntax_zdfMonadQzuzdczgzgze_closure
This may be due to you not asking GHCi to load extra object files,
archives or DLLs needed by your current session. Restart GHCi, specifying
the missing library using the -L/path/to/object/dir and -lmissinglibname
flags, or simply by naming the relevant files on the GHCi command line.
Alternatively, this link failure might indicate a bug in GHCi.
If you suspect the latter, please send a bug report to:
glasgow-haskell-bugs#haskell.org
How can I fix this?
▶ ghc --version
The Glorious Glasgow Haskell Compilation System, version 7.8.4
▶ cabal --version
cabal-install version 1.18.1.0
using version 1.18.1.5 of the Cabal library
The problem was due to an older version of template-haskell installed by my OS package manager. This version was taken into account even though I work in a sandbox. I solved the issue by using cabal install --shadow-installed-packages.
Is anyone successfully using hmatrix-0.16.0.4 on OSX 10.9?
I get the following error:
Prelude> import Numeric.LinearAlgebra
Prelude Numeric.LinearAlgebra> let m = (3><4) [1..] :: Matrix Double
Loading package array-0.4.0.1 ... linking ... done.
Loading package deepseq-1.3.0.1 ... linking ... done.
Loading package primitive-0.5.0.1 ... linking ... done.
Loading package vector-0.10.0.1 ... linking ... done.
Loading package bytestring-0.10.0.2 ... linking ... done.
Loading package containers-0.5.0.0 ... linking ... done.
Loading package binary-0.5.1.1 ... linking ... done.
Loading package old-locale-1.0.0.5 ... linking ... done.
Loading package time-1.4.0.1 ... linking ... done.
Loading package random-1.0.1.1 ... linking ... done.
Loading package split-0.2.2 ... linking ... done.
Loading package storable-complex-0.2.1 ... linking ... done.
Loading package hmatrix-0.16.0.4 ... linking ... <interactive>:
lookupSymbol failed in relocateSection (relocate external)
/Users/tba/.cabal/lib/x86_64-osx-ghc-7.6.3/hmatrix-0.16.0.4/libHShmatrix-0.16.0.4.a: unknown symbol `___ieee_divdc3'
ghc: unable to load package `hmatrix-0.16.0.4'
I installed using brew install gsl && cabal install hmatrix.
My ghc version is 7.6.3.
I suspect it should be built with gcc (instead of clang) -- how can I change this?
(GitHub ticket)
I fixed the issue by installing ghc 7.8. It's unfortunate that homebrew's "haskell-platform" is so out of date.
So basically i fire up the gchi import the graphics library and then go and do this.
Prelude Graphics.Gnuplot.Simple> plotList [] [(1, 1), (2, 2), (3, 3)]
Loading package transformers-0.3.0.0 ... linking ... done.
Loading package mtl-2.1.2 ... linking ... done.
Loading package array-0.4.0.1 ... linking ... done.
Loading package deepseq-1.3.0.1 ... linking ... done.
Loading package filepath-1.3.0.1 ... linking ... done.
Loading package old-locale-1.0.0.5 ... linking ... done.
Loading package time-1.4.0.1 ... linking ... done.
Loading package bytestring-0.10.0.2 ... linking ... done.
Loading package unix-2.6.0.1 ... linking ... done.
Loading package directory-1.2.0.1 ... linking ... done.
Loading package process-1.1.0.2 ... linking ... done.
Loading package containers-0.5.0.0 ... linking ... done.
Loading package data-accessor-0.2.2.6 ... linking ... done.
Loading package data-accessor-transformers-0.2.1.6 ... linking ... done.
Loading package exceptions-0.6.1 ... linking ... done.
Loading package temporary-1.2.0.3 ... linking ... done.
Loading package utility-ht-0.0.10 ... linking ... done.
Loading package gnuplot-0.5.2.2 ... linking ... done.
All this stuff happens, but no image is shown? Do i have to do some sort of main function call to display or how would i go about actually seeing a picture. Thanks for the advice.
Make sure you have the gnuplot binary installed, and not only the Haskell gnuplot package from hackage. The latter doesn't really check whether you have the necessary binary installed. Depending on your platform, it simply invokes a shell command or uses a pipe and doesn't look for the return type, therefore you don't even get an error.
You can check whether you have gnuplot installed via
$ gnuplot --version
If this doesn't give you a version, you either have yet to install gnuplot, or gnuplot isn't in your path.
Does this look familiar to anyone?
[1 of 1] Compiling Main ( Main.hs, Main.o )
Loading package ghc-prim ... linking ... done.
Loading package integer-gmp ... linking ... done.
Loading package base ... linking ... done.
Loading package array-0.5.0.0 ... linking ... done.
Loading package deepseq-1.3.0.2 ... linking ... done.
Loading package old-locale-1.0.0.6 ... linking ... done.
Loading package time-1.4.2 ... linking ... done.
Loading package containers-0.5.5.1 ... linking ... done.
Loading package bytestring-0.10.4.0 ... linking ... done.
Loading package text-1.1.0.1 ... linking ... done.
Loading package path-pieces-0.1.3.1 ... linking ... done.
Loading package pretty-1.1.1.1 ... linking ... done.
Loading package template-haskell ... linking ... done.
Loading package primitive-0.5.2.1 ... linking ... done.
Loading package vector-0.10.9.1 ... linking ... done.
Loading package yesod-routes-1.2.0.6 ... linking ... done.
Loading package old-time-1.1.0.2 ... linking ... done.
Loading package transformers-0.3.0.0 ... linking ... done.
Loading package filepath-1.3.0.2 ... linking ... done.
Loading package unix-2.7.0.1 ... linking ... done.
Loading package directory-1.2.1.0 ... linking ... done.
Loading package process-1.2.0.0 ... linking ... done.
Loading package hashable-1.2.1.0 ... linking ... done.
Loading package scientific-0.2.0.2 ... linking ... done.
Loading package attoparsec-0.11.2.1 ... linking ... done.
Loading package dlist-0.7.0.1 ... linking ... done.
Loading package mtl-2.1.3.1 ... linking ... done.
Loading package syb-0.4.1 ... linking ... done.
Loading package unordered-containers-0.2.4.0 ... linking ... done.
Loading package aeson-0.7.0.3 ... linking ... done.
Loading package exceptions-0.5 ... linking ... done.
Loading package base-unicode-symbols-0.2.2.4 ... linking ... done.
Loading package transformers-base-0.4.1 ... linking ... done.
Loading package monad-control-0.3.2.3 ... linking ... done.
Loading package lifted-base-0.2.2.1 ... linking ... done.
Loading package mmorph-1.0.2 ... linking ... done.
Loading package resourcet-1.1.2 ... linking ... done.
Loading package nats-0.1.3 ... linking ... done.
Loading package semigroups-0.13.0.1 ... linking ... done.
Loading package void-0.6.1 ... linking ... done.
Loading package conduit-1.1.1 ... linking ... done.
Loading package attoparsec-conduit-1.1.0 ... linking ... done.
Loading package blaze-builder-0.3.3.2 ... linking ... done.
Loading package blaze-markup-0.6.1.0 ... linking ... done.
Loading package blaze-html-0.7.0.1 ... linking ... done.
Loading package case-insensitive-1.2.0.0 ... linking ... done.
Loading package cereal-0.4.0.1 ... linking ... done.
Loading package base64-bytestring-1.0.0.1 ... linking ... done.
Loading package byteable-0.1.1 ... linking ... done.
Loading package securemem-0.1.3 ... linking ... done.
Loading package crypto-cipher-types-0.0.9 ... linking ... done.
Loading package cipher-aes-0.2.7 ... linking ... done.
Loading package crypto-random-0.0.7 ... linking ... done.
Loading package random-1.0.1.1 ... linking ... done.
Loading package cprng-aes-0.5.2 ... linking ... done.
Loading package entropy-0.2.2.4 ... linking ... done.
Loading package tagged-0.7.2 ... linking ... done.
Loading package crypto-api-0.13 ... linking ... done.
Loading package skein-1.0.9 ... linking ... done.
Loading package clientsession-0.9.0.3 ... linking ... done.
Loading package parsec-3.1.5 ... linking ... done.
Loading package network-2.5.0.0 ... linking ... done.
Loading package zlib-0.5.4.1 ... linking ... done.
Loading package streaming-commons-0.1.2 ... linking ... done.
Loading package conduit-extra-1.1.0.2 ... linking ... done.
Loading package data-default-class-0.0.1 ... linking ... done.
Loading package data-default-instances-base-0.0.1 ... linking ... done.
Loading package data-default-instances-containers-0.0.1 ... linking ... done.
Loading package data-default-instances-dlist-0.0.1 ... linking ... done.
Loading package data-default-instances-old-locale-0.0.1 ... linking ... done.
Loading package data-default-0.5.3 ... linking ... done.
Loading package cookie-0.4.1.1 ... linking ... done.
Loading package fast-logger-2.1.5 ... linking ... done.
Loading package system-filepath-0.4.10 ... linking ... done.
Loading package system-fileio-0.3.12 ... linking ... done.
Loading package shakespeare-2.0.0.3 ... linking ... done.
Loading package hamlet-1.2.0 ... linking ... done.
Loading package http-types-0.8.4 ... linking ... done.
Loading package monad-loops-0.4.2 ... linking ... done.
Loading package stm-2.4.3 ... linking ... done.
Loading package stm-chans-3.0.0.2 ... linking ... done.
Loading package monad-logger-0.3.6 ... linking ... done.
Loading package safe-0.3.4 ... linking ... done.
Loading package shakespeare-css-1.1.0 ... linking ... done.
Loading package shakespeare-i18n-1.1.0 ... linking ... done.
Loading package shakespeare-js-1.3.0 ... linking ... done.
Loading package unix-compat-0.4.1.1 ... linking ... done.
Loading package vault-0.3.0.3 ... linking ... done.
Loading package wai-2.1.0.2 ... linking ... done.
Loading package ansi-terminal-0.6.1.1 ... linking ... done.
Loading package blaze-builder-conduit-1.1.0 ... linking ... done.
Loading package stringsearch-0.3.6.5 ... linking ... done.
Loading package byteorder-1.0.4 ... linking ... done.
Loading package unix-time-0.2.2 ... linking ... done.
Loading package wai-logger-2.1.1 ... linking ... done.
Loading package word8-0.0.4 ... linking ... done.
Loading package zlib-conduit-1.1.0 ... linking ... done.
Loading package wai-extra-2.1.1.1 ... linking ... done.
Loading package http-date-0.0.4 ... linking ... done.
Loading package network-conduit-1.1.0 ... linking ... done.
Loading package simple-sendfile-0.2.14 ... linking ... done.
Loading package warp-2.1.5 ... linking ... done.
Loading package yesod-core-1.2.15 ... linking ... done.
Linking bin/Main ...
Quite a bunch of lines only for the package loads, which are usually of close to no interest. GHC will not print this if I pass the -v0 verbosity flag, but it won't print much else either, then... is there a way to turn off (or shorten) only the list of package-loads, without changing anything else? Preferrably both in ghc and ghci.
The only way to control this is via the -v0 flag, which as you notice also makes it quiet for other messages.
GHC 7.10 and higher no longer show those "Loading package foo ... linking ... done." lines, see https://ghc.haskell.org/trac/ghc/ticket/7863.
Use ghci -v2 to get them back.
I installed my first Haskell package with cabal:
$ cabal install regex-pcre
Could someone post a simple example using pcre regexes so I can figure out what I am supposed to import?
Okay, I figured it out. The module you need is Text.Regex.PCRE. For POSIX regexes, it's Text.Regex.Posix. Here is an example:
ghci>:m +Text.Regex.PCRE
ghci>"heeeee" =~ "hee|he*" :: [[String]]
Loading package array-0.4.0.0 ... linking ... done.
Loading package bytestring-0.9.2.1 ... linking ... done.
Loading package deepseq-1.3.0.0 ... linking ... done.
Loading package containers-0.4.2.1 ... linking ... done.
Loading package transformers-0.3.0.0 ... linking ... done.
Loading package mtl-2.1.2 ... linking ... done.
Loading package regex-base-0.93.2 ... linking ... done.
Loading package regex-pcre-0.94.4 ... linking ... done.
[["hee"]]
ghci>:m -Text.Regex.PCRE
ghci>:m +Text.Regex.Posix
ghci>"heeeee" =~ "hee|he*" :: [[String]]
Loading package regex-posix-0.95.2 ... linking ... done.
[["heeeee"]]