Valgrind on macOS Ventura 13.0 - valgrind

I'm having troubles installing Valgrind on the macOS Ventura (13.0) through the Homebrew. In the terminal I have tried following.
$ brew install valgrind
After Homebrew's autoupdate, I got the following message:
valgrind: Linux is required for this software.
Error: An unsatisfied requirement failed this build.
Is there a way I can install Valgrind?
I wanted to run Valgrind for debugging c

Valgrind is not supported on macOS 13.0.
The last officially supported version is 10.13. There is no support at all for Apple silicon.
Some support up to 11.0 is available here https://github.com/LouisBrunner/valgrind-macos
Nobody is actively working on Valgrind macOS. Apple makes zero contributions. I do occasionally make some changes, but that's just at the level of checking that the old code still builds.
Your best bet, if your software is portable to other OSes, is to test it on FreeBSD or Linux.

You can use the built in MacOS command leaks:
$ leaks <your program>
For usage details see:
$ man leaks

Related

Redis Source Code Compile Failed on macOS Mojave

The Redis 5.0 source code has failed to compile on macOS Mojave.
The MAKE log can be found here: https://gist.github.com/eliu/c56bffc0f3dc5f6a826949af5b4483b2
I know Redis can be installed via brew, but I need to know the way to compile the source code on macOS. Please help.
I solved it myself. Fix it when removing the following packages installed via Homebrew:
brew uninstall binutils openvpn bash gcc rocker

gst-browser fails to start

I have just installed gst-browser (VisualGST) through the Canonical Ubuntu repositories, so I tried to start VisualGST by running gst-browser on the command line. However, I am immediately greeted with an error:
a Smalltalk Stream:2: Abandon
a Smalltalk Stream:2: Error occurred while not in byte code interpreter!!
/usr/lib/libgst.so.7(+0x74c97)[0x7fb5fa5d1c97]
/lib/x86_64-linux-gnu/libc.so.6(+0x3ef20)[0x7fb5fa1aaf20]
/lib/x86_64-linux-gnu/libc.so.6(gsignal+0xc7)[0x7fb5fa1aae97]
/lib/x86_64-linux-gnu/libc.so.6(abort+0x141)[0x7fb5fa1ac801]
/usr/lib/libgst.so.7(+0x2c6a6)[0x7fb5fa5896a6]
/usr/lib/x86_64-linux-gnu/libsigsegv.so.2(+0xe3c)[0x7fb5f9f68e3c]
/lib/x86_64-linux-gnu/libc.so.6(+0x3ef20)[0x7fb5fa1aaf20]
/usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0(g_type_check_is_value_type+0x23)[0x7fb5d4e374f3]
/usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0(+0x20785e)[0x7fb5d551185e]
/usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0(gtk_list_store_new+0xa4)[0x7fb5d5436d94]
[1] 14556 abort (core dumped) gst-browser
What is the cause and meaning of the error, and how can I start VisualGST properly?
GNU Smalltalk version: 3.2.5
EDIT:
This appears to be a known issue. There's a bug report from 2012 on Launchpad: Smalltalk browser does not launch.
This appears to to be "known" issue. As I previously guessed the issue was in libraries link(age).
You can solve your issue either by installing - libgtk2.0-dev.
You can find the whole conversation here. Here is an excerpt:
Digging a bit further, I found that the module "gst-gtk-3.2.92.so" is
linked against "libgtk-x11-2.0.so", which is (now?) only provided by
package: gtk2-devel.
Your second option is to compile it from source. On Fedora 27 (again from the discussion and link above):
I'm on Fedora 27 and after a fresh install this gave me a working build:
sudo dnf install gcc git automake bison flex libtool libtool-ltdl-devel libffi-devel libsigsegv-devel cairo-devel gtk2-devel texinfo
git clone git://git.sv.gnu.org/smalltalk.git
cd smalltalk
autoreconf -vi ./configure make
sudo make install
-----------------------
For future referece you can find testing gst-browser gist.

Xcode version must be specified to use an Apple CROSSTOOL

I try to build tensorflow-serving using bazel but I've encountered some errors during the building
ERROR:/private/var/tmp/_bazel_Kakadu/3f0c35881c95d2c43f04614911c03a57/external/local_config_cc/BUILD:49:5: in apple_cc_toolchain rule #local_config_cc//:cc-compiler-darwin_x86_64: Xcode version must be specified to use an Apple CROSSTOOL.
ERROR: Analysis of target '//tensorflow_serving/sources/storage_path:file_system_storage_path_source_proto' failed; build aborted.
I've already tried to use bazel clean and bazel clean --expunge but it didn't help and still Bazel doesn't see my xcode (I suppose) but it's completely installed. I even reinstalled it to make sure that all works fine but the error didn't disappeared
My Bazel version is
Build label: 0.5.2-homebrew
Build target: bazel-out/darwin_x86_64-opt/bin/src/main/java/com/google/devtools/build/lib/bazel/BazelServer_deploy.jar
Build time: Thu Jul 13 12:29:40 2017 (1499948980)
Build timestamp: 1499948980
Build timestamp as int: 1499948980
KakaduDevs-Mac-mini:serving Kakadu$
OS is MacOS Sierra version 10.12.5
What should I do to specify Xcode version in bazel to avoid this error? It seems that the error is common but I haven't found how I can make the bazel build.
P.S I'm trying to install tensorflow-serving the way it's explained here.
https://tensorflow.github.io/serving/setup
bazel clean --expunge
sudo xcode-select -s /Applications/Xcode.app/Contents/Developer
sudo xcodebuild -license
bazel clean --expunge
bazel build --config=opt //tensorflow/tools/pip_package:build_pip_package
Had the same problem, and since I am using a beta version of XCode, I had to find the installation in /Downloads/Xcode-beta.app instead.
Incidentally, the solution for me was to open XCode, go to Preferences, and select the Locations tab. The Command Line Tools drop-down was blank, and I had to press it and select a version (Xcode 9.0 in my case). I then ran bazel clean --expunge and repeated the build process without getting the error. Hope this helps someone.
It looks like xcode_configure isn't properly identifying that you have xcode installed. This can sometimes happen if you install xcode but have not yet fully opened it (it may ask you to agree to Terms and Conditions before being fully functional). If this is the problem, you'll need to bazel clean --expunge again after that...
If this doesn't help, you can get some debug information to identify what's gone wrong, by invoking (after a failed build):
cat $(bazel info output_base)/external/local_config_xcode/BUILD
This should contain some comments pertaining to failures in finding your installed xcodes.
For me it was a licensing issue for xcodebuild. After running
bazel clean --expunge
I've tried to run again bazel and I've got the instruction to run
sudo xcodebuild -license.
I have executed, accepted the license terms, run again
bazel clean --expunge
and everything has started to work again.
Hopefully it solves some of the cases.
In order to build objc, Bazel requires that you specify an xcode version - this is usually done automatically by xcode_configure. If that's not working, you can manually specify the xcode version on the command line using the --xcode_version flag.

How can I resolve a conflict between Homebrew and MacPorts or Fink?

I was running through an npm tutorial and I needed to install Homebrew. However, after getting one error (cannot install node using available compilers), I ran brew install gcc. Well, that took forever, but it ultimately didn't work because apparently I have either MacPorts or Fink installed.
To be honest, I am not sure when I installed either MacPorts or Fink. I don't remember hearing them before or using them, and I'm not sure what they're used for. Has anyone run into this error before, or have any advice on what to do next? Below are the errors and the links I got in terminal. Thanks!
make[2]: *** [configure-stage2-target-libstdc++-v3] Error 1
make[1]: *** [stage2-bubble] Error 2
make: *** [bootstrap] Error 2
Warning: It appears you have MacPorts or Fink installed.
Software installed with other package managers causes known problems for
Homebrew. If a formula fails to build, uninstall MacPorts/Fink and try again.
READ THIS: https://git.io/brew-troubleshooting
These open issues may also help:
`gcc`: Force DWARF-2 Debugging Data under Pre-Mavericks https://github.com/Homebrew/homebrew/pull/46111
freeimage: patches for gcc 5.0 https://github.com/Homebrew/homebrew/pull/44612
yap: don't use GCC 5, which breaks https://github.com/Homebrew/homebrew/pull/45977
gcc can't find compatible ISL https://github.com/Homebrew/homebrew/issues/44444
How Do I Specify and Use Homebrew gcc-4.8 in a Formula Instead of OS X Bundled gcc? https://github.com/Homebrew/homebrew/issues/46169
isl 0.15, cloog 0.18.4, gcc compatibility patch https://github.com/Homebrew/homebrew/pull/44486
gcc causes false alarms in C++ stdlib check https://github.com/Homebrew/homebrew/issues/45218
apple-gcc42 takes priority over modern gcc https://github.com/Homebrew/homebrew/issues/41055
gcc 4.9.2 fails to produce debugging information https://github.com/Homebrew/homebrew/issues/34976
Object files deleted during build of gcc needed by gdb https://github.com/Homebrew/homebrew/issues/35734
MacOS.(gcc|clang|llvm)_version can return nil https://github.com/Homebrew/homebrew/issues/18781
MacPorts and Fink are package managers for OS X, like Homebrew. As the message says Homebrew doesn’t work well with these two, so you should either stay with MacPorts or Fink, or uninstall them and use Homebrew.
Outside of that, you can check Homebrew’s troubleshooting guide to learn how to fix common issues.

Missing gcc-4.0 error on pip install twisted in virtual env

I'm trying to use Scrapy inside a virtualenv, which requires installation of twisted as well. I did pip install Scrapy with no problems, but when I try pip install twisted, I'm getting the following error multiple times in the output:
unable to execute gcc-4.0: No such file or directory
error: command 'gcc-4.0' failed with exit status 1
I previously had a similar problem when trying to install python packages on my actual system, which is why I started using virtualenv in the first place. Is this an issue of the python version installed on my environment? This is what I currently have:
Django - 1.5 - active
Python - 2.7.3 - active development (/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload)
Scrapy - 0.16.4 - active
pip - 1.2.1 - active
setuptools - 0.6c11 - active
wsgiref - 0.1.2 - active development (/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7)
yolk - 0.4.3 - active
To check which version of gcc I have I typed gcc at the command line and got
i686-apple-darwin11-llvm-gcc-4.2: no input files
I tried export CC=gcc-4.2 before running pip install twisted, and I got:
llvm-gcc-4.2: error trying to exec '/usr/bin/../llvm-gcc-4.2/bin/powerpc-apple-darwin11-llvm-gcc-4.2': execvp: No such file or directory
lipo: can't figure out the architecture type of: /var/folders/s8/d0f65gc93nbchdk52g2cg5f80000gn/T//ccWQa7cJ.out
error: command 'gcc-4.2' failed with exit status 255
It sort of looks to me like it's looking for powerpc-apple-darwin11-llvm-gcc-4.2, and what I have above is i686-apple-darwin11-llvm-gcc-4.2--are these different and therefore causing the problem?
To give more background info, I installed Python 2.7 from a Python.org installer a long time ago before upgrading from Snow Leopard straight to Mountain Lion. If I simply type in python at the command line I get
Python 2.7.3 (v2.7.3:70274d53c1dd, Apr 9 2012, 20:32:06)
[GCC 4.0.1 (Apple Inc. build 5493)] on darwin
So I'm guessing that means I'm using Apple's Python? And it's built with gcc-4.0.1? So if that's the case, shouldn't I not need to do the export CC=gcc-4.2? Or do I need to do that AND switch to the Python.org version of Python? (And if the latter, how do I do that?)
Update: I tried this solution for switching Python versions but it didn't work.
Update: I managed to switch Python versions (outside of my virtualenv) using the sudo port select --set python python27 command, but this didn't solve the problem even though I'm now showing:
Python 2.7.3 (default, Nov 17 2012, 19:54:34)
[GCC 4.2.1 Compatible Apple Clang 4.1 ((tags/Apple/clang-421.11.66))] on darwin
when I type python at the commmand line.
Update: I also found this solution to a question that seemed to have almost the exact same issues as I'm having, but I'm already upgraded to XCode 4.6 and definitely have the Command Line Tools installed as described in the aforementioned solution (Preferences>Downloads tab>Install Command Line Tools). I do also have XCode 3.2.6 installed, however--any chance that's causing my problems?
Have you tried CC="$(type -p clang)" pip install twisted? You don't necessarily need to use gcc to compile Twisted's extensions; selecting clang instead might clear up whatever weird problem seems to be infesting your gcc installation.
If that doesn't work, I would suggest un-installing any Python.org versions of Python and then possibly re-installing both the OS and Xcode, since it looks like something might have corrupted your system Python install. I have no idea how references to powerpc stuff have persisted into Mountain Lion, since Lion removed support for ppc.