Last active
August 29, 2015 14:11
-
-
Save zmoazeni/b68c66f5e15654948946 to your computer and use it in GitHub Desktop.
Following instructions from https://www.haskell.org/pipermail/haskell-cafe/2014-October/116469.html and https://gist.github.com/adinapoli/d4c33a9d1ea85bcaebdf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
∴ cd /tmp/ | |
∴ mkdir testing-hashtables | |
∴ cd testing-hashtables/ | |
∴ cabal sandbox init | |
Writing a default package environment file to | |
/private/tmp/testing-hashtables/cabal.sandbox.config | |
Creating a new sandbox at /private/tmp/testing-hashtables/.cabal-sandbox | |
∴ cabal install hashtables | |
Resolving dependencies... | |
Notice: installing into a sandbox located at | |
/private/tmp/testing-hashtables/.cabal-sandbox | |
Configuring primitive-0.5.4.0... | |
Configuring text-1.2.0.2... | |
Building text-1.2.0.2... | |
Building primitive-0.5.4.0... | |
Installed primitive-0.5.4.0 | |
Configuring vector-0.10.12.2... | |
Building vector-0.10.12.2... | |
Installed vector-0.10.12.2 | |
Installed text-1.2.0.2 | |
Configuring hashable-1.2.2.0... | |
Building hashable-1.2.2.0... | |
Installed hashable-1.2.2.0 | |
Configuring hashtables-1.2.0.0... | |
Building hashtables-1.2.0.0... | |
Installed hashtables-1.2.0.0 | |
∴ cabal exec -- ghc -v PlayingWithHashtables.hs | |
Glasgow Haskell Compiler, Version 7.8.3, stage 2 booted by GHC version 7.8.3 | |
Using binary package database: /usr/local/Cellar/ghc/7.8.3/lib/ghc-7.8.3/package.conf.d/package.cache | |
Using binary package database: /private/tmp/testing-hashtables/.cabal-sandbox/x86_64-osx-ghc-7.8.3-packages.conf.d/package.cache | |
wired-in package ghc-prim mapped to ghc-prim-0.3.1.0-954cb57749cf319beafdc89b3415422c | |
wired-in package integer-gmp mapped to integer-gmp-0.5.1.0-d42e6a7874a019e6a0d1c7305ebc83c4 | |
wired-in package base mapped to base-4.7.0.1-c64d224738ec7af4085e89ca9c12c37b | |
wired-in package rts mapped to builtin_rts | |
wired-in package template-haskell mapped to template-haskell-2.9.0.0-310613e57f38a482326cc4ba2989009e | |
wired-in package dph-seq not found. | |
wired-in package dph-par not found. | |
Hsc static flags: | |
wired-in package ghc-prim mapped to ghc-prim-0.3.1.0-954cb57749cf319beafdc89b3415422c | |
wired-in package integer-gmp mapped to integer-gmp-0.5.1.0-d42e6a7874a019e6a0d1c7305ebc83c4 | |
wired-in package base mapped to base-4.7.0.1-c64d224738ec7af4085e89ca9c12c37b | |
wired-in package rts mapped to builtin_rts | |
wired-in package template-haskell mapped to template-haskell-2.9.0.0-310613e57f38a482326cc4ba2989009e | |
wired-in package dph-seq not found. | |
wired-in package dph-par not found. | |
*** Chasing dependencies: | |
Chasing modules from: *PlayingWithHashtables.hs | |
Stable obj: [Main] | |
Stable BCO: [] | |
Ready for upsweep | |
[NONREC | |
ModSummary { | |
ms_hs_date = 2014-12-12 01:27:02 UTC | |
ms_mod = main:Main, | |
ms_textual_imps = [import (implicit) Prelude, | |
import qualified Data.HashTable.ST.Basic as B, | |
import qualified Data.HashTable.IO as H] | |
ms_srcimps = [] | |
}] | |
*** Deleting temp files: | |
Deleting: | |
compile: input file PlayingWithHashtables.hs | |
Created temporary directory: /var/folders/6z/dh8wd6f13f7b97zwsskd2f500000gn/T/ghc39965_0 | |
*** Checking old interface for main:Main: | |
[1 of 1] Skipping Main ( PlayingWithHashtables.hs, PlayingWithHashtables.o ) | |
Upsweep completely successful. | |
*** Deleting temp files: | |
Deleting: /var/folders/6z/dh8wd6f13f7b97zwsskd2f500000gn/T/ghc39965_0/ghc39965_1.s | |
Warning: deleting non-existent /var/folders/6z/dh8wd6f13f7b97zwsskd2f500000gn/T/ghc39965_0/ghc39965_1.s | |
link: linkables are ... | |
LinkableM (2014-12-12 01:27:20 UTC) main:Main | |
[DotO PlayingWithHashtables.o] | |
Linking PlayingWithHashtables ... | |
*** C Compiler: | |
clang -B/usr/local/lib -m64 -fno-stack-protector -DTABLES_NEXT_TO_CODE -c /var/folders/6z/dh8wd6f13f7b97zwsskd2f500000gn/T/ghc39965_0/ghc39965_2.c -o /var/folders/6z/dh8wd6f13f7b97zwsskd2f500000gn/T/ghc39965_0/ghc39965_3.o -I/usr/local/Cellar/ghc/7.8.3/lib/ghc-7.8.3/include | |
*** Linker: | |
clang -B/usr/local/lib -m64 -fno-stack-protector -DTABLES_NEXT_TO_CODE -L/usr/local/lib -m64 -o PlayingWithHashtables -Wl,-no_compact_unwind PlayingWithHashtables.o -L/private/tmp/testing-hashtables/.cabal-sandbox/lib/x86_64-osx-ghc-7.8.3/hashtables-1.2.0.0 -L/private/tmp/testing-hashtables/.cabal-sandbox/lib/x86_64-osx-ghc-7.8.3/vector-0.10.12.2 -L/private/tmp/testing-hashtables/.cabal-sandbox/lib/x86_64-osx-ghc-7.8.3/primitive-0.5.4.0 -L/private/tmp/testing-hashtables/.cabal-sandbox/lib/x86_64-osx-ghc-7.8.3/hashable-1.2.2.0 -L/private/tmp/testing-hashtables/.cabal-sandbox/lib/x86_64-osx-ghc-7.8.3/text-1.2.0.2 -L/usr/local/Cellar/ghc/7.8.3/lib/ghc-7.8.3/bytestring-0.10.4.0 -L/usr/local/Cellar/ghc/7.8.3/lib/ghc-7.8.3/deepseq-1.3.0.2 -L/usr/local/Cellar/ghc/7.8.3/lib/ghc-7.8.3/array-0.5.0.0 -L/usr/local/Cellar/ghc/7.8.3/lib/ghc-7.8.3/base-4.7.0.1 -L/usr/local/Cellar/ghc/7.8.3/lib/ghc-7.8.3/integer-gmp-0.5.1.0 -L/usr/local/Cellar/ghc/7.8.3/lib/ghc-7.8.3/ghc-prim-0.3.1.0 -L/usr/local/Cellar/ghc/7.8.3/lib/ghc-7.8.3/rts-1.0 /var/folders/6z/dh8wd6f13f7b97zwsskd2f500000gn/T/ghc39965_0/ghc39965_3.o -Wl,-u,_ghczmprim_GHCziTypes_Izh_static_info -Wl,-u,_ghczmprim_GHCziTypes_Czh_static_info -Wl,-u,_ghczmprim_GHCziTypes_Fzh_static_info -Wl,-u,_ghczmprim_GHCziTypes_Dzh_static_info -Wl,-u,_base_GHCziPtr_Ptr_static_info -Wl,-u,_ghczmprim_GHCziTypes_Wzh_static_info -Wl,-u,_base_GHCziInt_I8zh_static_info -Wl,-u,_base_GHCziInt_I16zh_static_info -Wl,-u,_base_GHCziInt_I32zh_static_info -Wl,-u,_base_GHCziInt_I64zh_static_info -Wl,-u,_base_GHCziWord_W8zh_static_info -Wl,-u,_base_GHCziWord_W16zh_static_info -Wl,-u,_base_GHCziWord_W32zh_static_info -Wl,-u,_base_GHCziWord_W64zh_static_info -Wl,-u,_base_GHCziStable_StablePtr_static_info -Wl,-u,_ghczmprim_GHCziTypes_Izh_con_info -Wl,-u,_ghczmprim_GHCziTypes_Czh_con_info -Wl,-u,_ghczmprim_GHCziTypes_Fzh_con_info -Wl,-u,_ghczmprim_GHCziTypes_Dzh_con_info -Wl,-u,_base_GHCziPtr_Ptr_con_info -Wl,-u,_base_GHCziPtr_FunPtr_con_info -Wl,-u,_base_GHCziStable_StablePtr_con_info -Wl,-u,_ghczmprim_GHCziTypes_False_closure -Wl,-u,_ghczmprim_GHCziTypes_True_closure -Wl,-u,_base_GHCziPack_unpackCString_closure -Wl,-u,_base_GHCziIOziException_stackOverflow_closure -Wl,-u,_base_GHCziIOziException_heapOverflow_closure -Wl,-u,_base_ControlziExceptionziBase_nonTermination_closure -Wl,-u,_base_GHCziIOziException_blockedIndefinitelyOnMVar_closure -Wl,-u,_base_GHCziIOziException_blockedIndefinitelyOnSTM_closure -Wl,-u,_base_ControlziExceptionziBase_nestedAtomically_closure -Wl,-u,_base_GHCziWeak_runFinalizzerBatch_closure -Wl,-u,_base_GHCziTopHandler_flushStdHandles_closure -Wl,-u,_base_GHCziTopHandler_runIO_closure -Wl,-u,_base_GHCziTopHandler_runNonIO_closure -Wl,-u,_base_GHCziConcziIO_ensureIOManagerIsRunning_closure -Wl,-u,_base_GHCziConcziIO_ioManagerCapabilitiesChanged_closure -Wl,-u,_base_GHCziConcziSync_runSparks_closure -Wl,-u,_base_GHCziConcziSignal_runHandlers_closure -Wl,-search_paths_first -lHShashtables-1.2.0.0 -lHSvector-0.10.12.2 -lHSprimitive-0.5.4.0 -lHShashable-1.2.2.0 -lHStext-1.2.0.2 -lHSbytestring-0.10.4.0 -lHSdeepseq-1.3.0.2 -lHSarray-0.5.0.0 -lHSbase-4.7.0.1 -lHSinteger-gmp-0.5.1.0 -lHSghc-prim-0.3.1.0 -lHSrts -lCffi -liconv -lgmp -lm -ldl | |
Undefined symbols for architecture x86_64: | |
"_line_mask", referenced from: | |
_line_search in libHShashtables-1.2.0.0.a(default.o) | |
"_line_mask_2", referenced from: | |
_line_search_2 in libHShashtables-1.2.0.0.a(default.o) | |
"_line_mask_3", referenced from: | |
_line_search_3 in libHShashtables-1.2.0.0.a(default.o) | |
ld: symbol(s) not found for architecture x86_64 | |
clang: error: linker command failed with exit code 1 (use -v to see invocation) | |
*** Deleting temp files: | |
Deleting: /var/folders/6z/dh8wd6f13f7b97zwsskd2f500000gn/T/ghc39965_0/ghc39965_3.o /var/folders/6z/dh8wd6f13f7b97zwsskd2f500000gn/T/ghc39965_0/ghc39965_2.c | |
*** Deleting temp dirs: | |
Deleting: /var/folders/6z/dh8wd6f13f7b97zwsskd2f500000gn/T/ghc39965_0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Main where | |
import qualified Data.HashTable.IO as H | |
import qualified Data.HashTable.ST.Basic as B | |
type BasicHashTable k v = H.IOHashTable (B.HashTable) k v | |
foo :: IO (BasicHashTable Int Int) | |
foo = do | |
ht <- H.new | |
H.insert ht 1 1 | |
return ht | |
main = do | |
hash <- foo | |
output <- H.lookup hash 1 | |
print output |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment