gpt4 book ai didi

haskell - `getNumberOfProcessors` 与 cabal-install 停止联动的多重定义

转载 作者:行者123 更新时间:2023-12-01 05:11:06 24 4
gpt4 key购买 nike

我正在尝试将 cabal 1.20 安装在 beaglebone black rev c(带有 debian wheezy arm)上。它在 cabal install cabal-install 后期失败了和:

[75 of 76] Compiling Distribution.Client.Sandbox ( Distribution/Client/Sandbox.hs, dist/build/cabal/cabal-tmp/Distribution/Client/Sandbox.o )
[76 of 76] Compiling Main ( Main.hs, dist/build/cabal/cabal-tmp/Main.o )
Linking dist/build/cabal/cabal ...
/usr/lib/ghc/libHSrts.a(OSThreads.o): In function `getNumberOfProcessors':
(.text+0x8): multiple definition of `getNumberOfProcessors'
dist/build/cabal/cabal-tmp/cbits/getnumcores.o:getnumcores.c:(.text+0x0): first defined here
collect2: ld returned 1 exit status
cabal: Error: some packages failed to install:
cabal-install-1.20.0.3 failed during the building phase. The exception was:
ExitFailure 1

在 haskell 运行时库周围闲逛,我看到 getNumberOfProcesses已经定义(这将解释碰撞):
root@doghouse:/# nm /usr/lib/ghc/libHSrts.a  | grep -B 3 Processors
nm: Disassembler.o: no symbols
nm: FrontPanel.o: no symbols
nm: LdvProfile.o: no symbols
U getAllocations
U getFullProgArgv
U getGCStats
U getNumberOfProcessors
nm: OldARMAtomic.o: no symbols
nm: Papi.o: no symbols
nm: Profiling.o: no symbols
nm: RetainerProfile.o: no symbols
nm: RetainerSet.o: no symbols
nm: RtsDllMain.o: no symbols
nm: Trace.o: no symbols
nm: 0Hash.o: no symbols
nm: 0Unpack.o: no symbols
nm: Dist.o: no symbols
nm: Global.o: no symbols
nm: GranSim.o: no symbols
nm: HLComms.o: no symbols
nm: LLComms.o: no symbols
nm: Pack.o: no symbols
nm: ParInit.o: no symbols
nm: ParTicky.o: no symbols
nm: Parallel.o: no symbols
nm: ParallelDebug.o: no symbols
nm: RBH.o: no symbols
nm: Sanity.o: no symbols
nm: EventLog.o: no symbols
--

OSThreads.o:
00000000 T forkOS_createThread
00000008 T getNumberOfProcessors

最佳答案

我在运行 Raspbian 的 Raspberry Pi 上遇到了类似的问题。

为了解决这个问题,我修补了 cabal-install.cabal添加 -DHAS_GET_NUMBER_OF_PROCESSORScc-optionsmentioned here .

关于haskell - `getNumberOfProcessors` 与 cabal-install 停止联动的多重定义,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24847576/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com