Skip to content

Instantly share code, notes, and snippets.

{-# LANGUAGE MagicHash #-}
{-# LANGUAGE UnboxedTuples #-}
{-# OPTIONS_GHC -feager-blackholing #-}
module Spark
( spark,
sparkST,
sparkList,
)
where
-Wimplicit
-include
rts/include/ghcversion.h
-Irts/include
-I_build/stage1/rts/build
-I_build/stage1/rts/build/include
-Irts/include
-I_build/stage1/rts/build
-Irts
-I_build/stage1/rts/build
diff --git a/Makefile b/Makefile
index 18d664f..6e59274 100644
--- a/Makefile
+++ b/Makefile
@@ -51,8 +51,8 @@ default: build
@echo "Use -fdebug-prefix-map=$(ROOT_DIR)=wasisdk://v$(VERSION)"
check:
- CC="clang --sysroot=$(BUILD_PREFIX)/share/wasi-sysroot -fno-strict-aliasing -msimd128 -mnontrapping-fptoint -msign-ext -mbulk-memory -mmutable-globals -mmultivalue -mreference-types -Xclang -target-abi -Xclang experimental-mv" \
- CXX="clang++ --sysroot=$(BUILD_PREFIX)/share/wasi-sysroot -fno-exceptions -fno-exceptions -fno-strict-aliasing -msimd128 -mnontrapping-fptoint -msign-ext -mbulk-memory -mmutable-globals -mmultivalue -mreference-types -Xclang -target-abi -Xclang experimental-mv" \
#!/bin/sh
git update-ref -d refs/notes/perf
git notes prune
rmdir .git/logs/refs/notes
allow-newer:
all:Cabal,
all:Cabal-syntax,
all:array,
all:base,
all:binary,
all:bytestring,
all:containers,
all:deepseq,
all:directory,
#!/usr/bin/env bash
set -euo pipefail
apt update
apt install -y automake build-essential curl git gnupg libffi-dev libncurses-dev libgmp-dev python3 libdw-dev
curl -f -L --retry 5 https://apt.llvm.org/llvm-snapshot.gpg.key | gpg --dearmor -o /usr/share/keyrings/llvm-snapshot.gpg
echo "deb [signed-by=/usr/share/keyrings/llvm-snapshot.gpg] https://apt.llvm.org/bullseye llvm-toolchain-bullseye main" >> /etc/apt/sources.list.d/llvm-toolchain.list
echo "deb [signed-by=/usr/share/keyrings/llvm-snapshot.gpg] https://apt.llvm.org/bullseye llvm-toolchain-bullseye-18 main" >> /etc/apt/sources.list.d/llvm-toolchain.list

How to instrument ghc with ghc-debug

Assuming you already know what ghc-debug is about, and want to use it to debug the ghc program itself.

Prepare a ghc-debug checkout

A recent ghc-debug checkout is required, since it contains important fixes not release on Hackage yet.

Apply the following patch:

Wrong exit code for T24171()(expected 0 , actual 2 )
Stderr run ( T24171 ):
main: internal error: LDV_recordDead: Failed to find counter for closure 0x42004fd028
(GHC version 9.9.20240111 for x86_64_unknown_linux)
Please report this as a GHC bug: https://www.haskell.org/ghc/reportabug
gmake[1]: *** [Makefile:8: build_and_run] Aborted (core dumped)
gmake: *** [Makefile:5: clean_build_and_run] Error 2
*** unexpected failure for T24171(normal)
@TerrorJack
TerrorJack / normcore-llm.md
Created August 30, 2023 14:42 — forked from veekaybee/normcore-llm.md
Normcore LLM Reads
#!/usr/bin/env bash
set -euo pipefail
export CC="ccache clang"
export CXX="ccache clang++"
export AR=llvm-ar
./configure --enable-lto --experimental-enable-pointer-compression --fully-static --ninja
ninja -C out/Release -v