我正在尝试使用性能分析选项编译我的一个可执行文件。我在我的cabal文件中添加了-prof
选项。这样做后,我会收到一条消息,内容如下:
Could not find module ‘Package-X’
Perhaps you haven't installed the profiling libraries for package ‘package-x’?
Use -v to see a list of the files searched for.
我该怎么做呢?我尝试使用cabal install --only-dependency --reinstall
命令,但是返回了以下响应:
All the requested packages are already installed:
Use --reinstall if you want to reinstall anyway.
我已经使用了 --reinstall
,应该怎么办?我还尝试了 cabal configure --enable-profiling-libraries
等操作...
cabal install --reinstall world
做了一些事情。但我仍然无法让我的可执行文件启用分析。如果我在 cabal 文件中添加-prof
,它会抱怨不需要。如果我删除+RTS -p
,则会抱怨二进制文件未使用分析支持编译... - mb14.cabal/config
文件中添加了library-profiling: True
?这似乎是安装带有性能分析库的真正技巧。 - bheklilrcabal configure --enable-library-profiling
可以解决问题。然而,我的问题可能是我正在使用不同的沙盒源……我正在尝试重新编译它们。 - mb14.cabal/config
文件中将library-profiling
设置为True
就可以解决问题了。但是我不得不删除沙盒(cabal sandbox delete; cabal sandbox init; cabal sandbox install
),这样会重新安装所有东西(正常+分析库)。我本来希望避免重新安装正常的库。 - mb14