Hi team,icompiler/. -icompiler/stage2/build -Icompiler/stage2/build -icompiler/stage2/build/./autogen -Icompiler/stage2/build/./autogen -Icompiler/. -Icompiler/stage2/build/. -optP-DHAVE_INTERNAL_INTERPRETER -optP-DCAN_LOAD_DLL -optP-include -optPcompiler/stage2/
While preparing ghc 9.4.5 in Debian experimental, it fails to build with
OOM on mipsel [1].
The command that fails is:
$ "inplace/bin/ghc-stage1" -hisuf p_hi -osuf p_o -hcsuf p_hc -static -prof -H32m -O -lffi -optl-pthread -optc--param -optcggc-min-expand=5 -optc--param -optcggc-min-heapsize=4096 -Wall -this-unit-id ghc-9.4.5 -hide-all-packages -package-env - -i -
virtual memory exhausted: Cannot allocate memory
`gcc' failed in phase `C Compiler'. (Exit code: 1)
Building an unregisterised ghc compiler on 32-bit targets has trouble handling the Instances.hs file. This has been reported upstream here[2]. Until now, we have managed to workaround this by compiling this file
alone with O0 (as shown in the above command), but since version 9.4.5
even that doesn't work.
Is there anything else we can try to compile ghc 9.4.5 in mipsel, or
should we give up in supporting mipsel at all?
[1] https://buildd.debian.org/status/package.php?p=ghc&suite=experimental
[2] https://gitlab.haskell.org/ghc/ghc/-/issues/17048
[...]
I found two things helped or fixed the problem. First, I would build
with only one make job. That is, 'make -j 1'. 'make -j 3' or 'make -j
5' was sure to break the build.
Second, I would add a swap partition that provided enough space to run
the compiler. For a dev board with 512MB of RAM, I would setup a 2GB
swap partition. I would also set swappiness to 1 or 2 to keep things
in memory. zram would not help because even compressed, the compiler
needed a fair amount of space.
On Wed, Jul 26, 2023 at 01:02PM, Jeffrey Walton wrote:
[...]
I found two things helped or fixed the problem. First, I would build
with only one make job. That is, 'make -j 1'. 'make -j 3' or 'make -j
5' was sure to break the build.
Second, I would add a swap partition that provided enough space to run
the compiler. For a dev board with 512MB of RAM, I would setup a 2GB
swap partition. I would also set swappiness to 1 or 2 to keep things
in memory. zram would not help because even compressed, the compiler
needed a fair amount of space.
Thanks for the hints. Unfortunately none of them have worked so far. I
am trying to compile just this file and nothing else, and I am using a
host with 8G of RAM and 8G of Swap. The problem seems to be the fact
that mipsel is limited to only 2G RAM space for user processes.
Unfortunately I cannot see a way forward here, other than removing ghc
(and every Haskell program) from mipsel.
Break that source file up into two or three more manageable pieces.
If I am parsing the command line correctly, the source file is
Instances.hs and the output file is Instances.p_o. I would try to
create Instances_1.hs, Instances_2.hs and Instances_3.hs, and then let
the linker combine their object files later.
What I don't know is, is it possible to do that in Haskell. Some
languages are picky about things like that. C# and Java come to mind.
On Fri, Jul 28, 2023 at 05:09PM, Jeffrey Walton wrote:
Break that source file up into two or three more manageable pieces.
If I am parsing the command line correctly, the source file is
Instances.hs and the output file is Instances.p_o. I would try to
create Instances_1.hs, Instances_2.hs and Instances_3.hs, and then let
the linker combine their object files later.
What I don't know is, is it possible to do that in Haskell. Some
languages are picky about things like that. C# and Java come to mind.
This was suggested as a solution by upstream as well (see [1]) but they
found it was too difficult to do and ended up using to -O0 instead.
[1] https://gitlab.haskell.org/ghc/ghc/-/issues/18256
From Crypto++, I've found there's no material difference between -O1,-O2 or -O3. Crypto++ provides SSE/AVX/NEON/ASIMD/Altivec acceleration
On Fri, Jul 28, 2023 at 05:09PM, Jeffrey Walton wrote:
Break that source file up into two or three more manageable pieces.
If I am parsing the command line correctly, the source file is
Instances.hs and the output file is Instances.p_o. I would try to
create Instances_1.hs, Instances_2.hs and Instances_3.hs, and then let
the linker combine their object files later.
What I don't know is, is it possible to do that in Haskell. Some
languages are picky about things like that. C# and Java come to mind.
This was suggested as a solution by upstream as well (see [1]) but they
found it was too difficult to do and ended up using to -O0 instead.
[1] https://gitlab.haskell.org/ghc/ghc/-/issues/18256
The 18256 issue looks like it is a different complaint. 18256 tries to
speed up compile time. An OOM kill is a different problem.
Looking at the original command, the project is using -O, which is
-O2. Maybe you can drop it to -O1 -fno-inline.
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 465 |
Nodes: | 16 (2 / 14) |
Uptime: | 40:14:04 |
Calls: | 9,400 |
Files: | 13,570 |
Messages: | 6,098,683 |