簡體   English   中英

無法在macOS High Sierra上構建和安裝Valgrind

[英]Unable to build and install Valgrind on macOS High Sierra

我無法在macOS High Sierra上安裝Valgrind。 它不是通過brew 我試過3.10 make install后,我收到以下消息:

configure: error: Valgrind works on Darwin 10.x, 11.x, 12.x, 13.x and 14.x (Mac OS X 10.6/7/8/9/10)

Homebrew說:

valgrind: This formula either does not compile or function as expected on macOS
versions newer than Sierra due to an upstream incompatibility.
Error: An unsatisfied requirement failed this build.

我有這樣的問題。 所以,我找到了解決方案。 您應該通過此代碼brew install --HEAD valgrind

我已經創建了一個valgrind 3.13.0的端口來處理macOS High Sierra(10.13.x)。 你可以在這里得到它: https//github.com/padiakalpesh/valgrind_3.13_high_sierra

獲取源后,從源目錄中運行以下命令:

./configure
make
sudo make install

我有這個工作在2018年7月,供參考:

https://gist.github.com/AlessandroMinali/d8316d6cc650c97027433644c2ff31ee

編輯./configure

- 5468: applellvm-5.1|applellvm-6.*|applellvm-7.*|applellvm-8.*)
+ 5468: applellvm-5.1|applellvm-6.*|applellvm-7.*|applellvm-8.*|applellvm-9.*)


- 5879:          16.*)
+ 5879:          17.*)

./autogen.sh
./configure
make
make install

創建文件〜/ .valgrind.supp

# false positive for any executable (it seems)
# macOS 10.12.6
# valgrind 3.13.0
{
    libtrace initialization false positive
    Memcheck:Param
    msg->desc.port.name
    fun:mach_msg_trap
    fun:mach_msg
    fun:task_set_special_port
    fun:_os_trace_create_debug_control_port
    fun:_libtrace_init
}

創建文件〜/ .valgrindrc

--suppressions=$HOME/.valgrind.supp

故障排除

  • 如果無法讀取suppresion文件復制並粘貼$ HOME的內容
  • 如果它抱怨鏗鏘聲版本,請首先編輯
  • 如果它抱怨達爾文版本,請進行第二次編輯

brew安裝Valgrind在最新的macOS上安裝時存在一些兼容性問題,但是有一個解決方法可以解決這個問題。 當您嘗試使用brew安裝它時,您必須收到此錯誤消息。

$ brew install valgrind valgrind:由於上游不兼容,此公式要么不能在比High Sierra更新的macOS版本上按預期編譯或運行。 錯誤:未滿足的要求未通過此構建。

-------------------------------------------------- - - - - - - - - -解 - - - - - - - - - - - - - - - - ------------------------------

Step1:$ brew編輯valgrind

第2步:在文件中找到這一行 - >(url“ https://sourceware.org/git/valgrind.git ”)

Step3:用 - >替換它(url“git://sourceware.org/git/valgrind.git”)

Step4:$ brew更新

Step5:$ brew install --HEAD valgrind

並做了!

如果它仍然不起作用,請告訴我。 謝謝!!

Valgrind是一個相當敏感的軟件,需要更新macOS的每個主要版本。

截至2018年2月,沒有發布的Valgrind版本支持macOS High Sierra(10.13)。 您需要使用Valgrind的開發版本,或使用替代工具。 (Apple的Instruments可能具有您正在尋找的一些功能。)

我定期在macOS上構建Valgrind的git head版本。 如果您安裝了xcode,那么除了遵循此處的說明之外,沒有更多的內容。

我稍后會使用我的構建腳本進行更新。

作為替代方案,您可能需要考慮使用clang消毒劑。 這可以在xcode中啟用,或使用-fsanitize = X選項啟用(其中X是地址,未定義,線程,內存和其他一些選項)。

使用brew install --HEAD valgrind也對我brew install --HEAD valgrind ,但一定要知道拉HEAD版本和構建/安裝需要一段時間。

但是,不需要進行其他更改。

MacPorts版本於2018年9月開始為我工作!

該命令,為了完整起見(完成非常快 - 顯然,預建):

sudo port install valgrind-devel

版:

$ valgrind --version
valgrind-3.14.0.GIT

以下使用最新的Valgrind版本3.14.0(2018年10月9日)在macOS 10.13.6上工作。

VERSION="3.14.0"
wget -O - http://www.valgrind.org/downloads/valgrind-"$VERSION".tar.bz2 | tar xjf -
cd valgrind-"$VERSION"
# use --prefix=/path/to if you want it installed somewhere in particular
./configure
make
# may need sudo
make install
# test all is working
valgrind ls -l

這些說明來自Valgrind發布tar球內的README

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM