brew install gdb with python 3 does not build - gdb

I am unable to build gdb 8.2 in mac osx mojave 10.14.3 (with gcc 8.2) using python3.7.
python3 was installed using brew install python3 and is in the PATH.
Using brew edit gdb,
I have changed --with-python=/usr to /path/to/python3
Also, added ENV['CFLAGS']='-I/path/to/python3/include', ENV['CC']='gcc', ENV['CXX']='g++'.
I keep getting missing < Python.h > and < frameobject.h > related error even after including CFLAGS.
How can I fix this? Thanks for any help.

I know this is an old question. But I just ran into the same Problem and couldn't find a solution.
Have a look at the homebrew-core repository on GitHub. The commit bb8b6616e51672c8011435000476b24fa242a066 removed the --with-python option for some reason.
Revert that commit, change gdb version and all works fine.

Related

otool is referencing an old version of libffi

I'm trying to compile an R package (which compiles in Linux) on Mac OS 10.15.7.
I'm getting a weird problem right at the end of the installation, related to llvm-objdump-mp-7.0 referencing /opt/local/bin/libffi.7.dylib.
The problem seems to be with my Xcode/homebrew toolsets somehow being out of sync.
I can generate the problem with
$otool --version
llvm-otool(1): Apple Inc. version cctools-921
dyld: Library not loaded: /opt/local/lib/libffi.7.dylib
Referenced from: /opt/local/libexec/llvm-7.0/lib/libLLVM.dylib
Reason: image not found
fatal error: otool: fatal error in /opt/local/bin/llvm-objdump-mp-7.0
However,
$ ls /opt/local/lib/libffi*
/opt/local/lib/libffi.8.dylib /opt/local/lib/libffi.dylib
/opt/local/lib/libffi.a
I've run brew update followed by brew upgrade and brew reinstall libffi and brew reinstall llvm
I've upgraded my Xcode to 12.4, as well as installing the command line tools.
What am I missing?
I must have previously installed an older version of llvm which put its commands in /usr/local/bin, which then masked the system version of /usr/bin/otool.
The current llvm formula puts the updated tools in /usr/local/opt/llvm/bin so as to not mask the Xcode versions. However, the older versions were still living in /usr/local/bin.
The following commands seemed to fix me.
sudo rm /opt/local/bin/otool
sudo rm /opt/local/bin/llvm-otool
sudo rm /opt/local/bin/*-mp-7.0
otools is now properly finding the Xcode version, so I'm up and running again.

Strange Output from cask command

Today I installed cask via homebrew on my M1 Mac Mini, and wanted to check the version of cask that I had installed. I was not fully sure of the command to complete this, so I tried
cask --version
This gave me a long readout where there were several processes of compiling things in my directory. This may be a dumb question but did I do something that I was not intending to?
cask --version, as part of Homebrew/brew, was deprecated in Oct. 2018
Now, only brew --version should be enough.

Is there a way to install Valgrind on Catalina?

Is there a way to install Valgrind on Catalina and have it run properly? If so, I would very much appreciate a step-by-step process.
I tried installing Valgrind with https://github.com/sowson/valgrind
but when I tested out helloWorld.cpp on the terminal, the console returned errors I should not have gotten.
I'm not sure if I committed an error on my part in the installation process of this version of Valgrind or if Valgrind itself is simply incompatible with Catalina OS.
I have also tried installing Valgrind via Homebrew, but I've had issues with that as well (github.com/Homebrew/homebrew-core/issues/36683).
Currently, no. The repo you link has an issue raised about Catalina compatibility. As you also show, the brew package has its own problems as well. Official valgrind only supports 10.12.
You'll just have to wait, or containerize it. Although if you containerize valgrind, you would likely need a compatible build container as well.
Ok. I've found a way to use Valgrind on Catalina. Here's a link to my guide for how https://github.com/john-yohan-park/Valgrind_Catalina
Works amazingly!! see https://github.com/LouisBrunner/valgrind-macos/issues/5.
Not Homebrew, you need to compile it from source, but it's not so difficult.
1. git clone https://github.com/LouisBrunner/valgrind-macos.git
2. cd valgrind
3. sudo ./autogen.sh
4. sudo ./configure --prefix=/where/you/want/it/installed --enable-only64bit
5. copy the [contents][1] to ./coregrind/m_mach/mach_basics.c
6. sudo make
7. sudo make install
enjoy!
This is how I just did it on Catalina 10.15.5:
brew remove valgrind # remove previous attempts at installing it (if any)
brew tap LouisBrunner/valgrind
brew install --HEAD LouisBrunner/valgrind/valgrind
Source: https://github.com/LouisBrunner/valgrind-macos

The tools required to build C++ code for R were not found

OS: Ubuntu 14.04
g++: g++ (Ubuntu 4.8.4-2ubuntu1~14.04) 4.8.4
R version: 3.2.0 (2015-04-16) -- "Full of Ingredients"
Rcpp: 0.11.6
Today I apt-get dist-upgrade my system, and the g++ was also been upgraded.
Then when I am trying to use "Rcpp" package in R, the code is the simplest test code >>evalCpp("1+1") . An error as follows occurred:
Error in frameTypes(env) : not a proper evaluation environment
Calls: ::: ... tryCatch -> tryCatchList -> tryCatchOne -> <Anonymous>
Execution halted
Error in sourceCpp(code = code, env = env, rebuild = rebuild,showOutput = showOutput, :
Error 1 occurred building shared library.
WARNING: The tools required to build C++ code for R were not found.
Please install GNU development tools including a C++ compiler.
I have did google for it. The following links are all about Mac OSX:
Error when with Xcode 5.0 and Rcpp (Command Line Tools ARE installed)
g++ errors when trying to compile c++11 with Rcpp
From the answers and comments, I can not tell what is the real problem.
Appreciate your help!
UPDATE: I finally solved this problem by reinstalling all the R related deb packages. And one thing we should keep in mind is that I also did what #Dirk suggested first apt-get build-dep r-base-dev. I can not confirm which one is the key step.
You need
sudo apt-get build-dep r-base
to install the all the build dependencies for R itself.
But we even built an explicitly helper package r-base-dev so in most cases (and in your use case of Rcpp) you just need
sudo apt-get install r-base-dev
There is something wrong/missing in your system configuration. First of all, I doubt that you are really running Ubuntu 14.04 (after the dist-upgrade) because the the other versions that you listed wouldn't be available (unless you have pulled them in from a non-default repository). You might also consider running a full-upgrade to try to straighten out your configuration.
You might gain some insights by running with showOutput=1...
library(Rcpp)
evalCpp("1+1",showOutput=1,rebuild=1)
...but actually, it looks like the problem is related specifically to a parameter called env (Error in frameTypes(env) : not a proper evaluation environment) which is likely evaluated prior-to attempting to compile.
For what it is worth, I was able to run this without r-base-dev installed, but maybe installing r-base-dev will pull in the correct, and updated, versions of what you need. I would be inclined to just reinstall all R-related packages.

Compiler Not Found

I am getting this error when i tried to compile my program
-bash: g++: command not found
Also I have only been getting this error after I formatted my Mac Book Pro
This error came after I did this
g++ functions.cpp
Please help me.
Thank You
Here is a cleanest solution than installing XCode just for Gcc.
STEP 1 > install this:
[HomeBrew Web Site] (http://brew.sh/)
All the informations concerning the installation and the utility of such a program are on the site itself.
It's a package manager, but for Mac. It's like apt-get or yaourt, if you ever used Ubuntu or Arch Linux.
STEP 2 > Go to the Terminal application and type :
$> homebrew search gcc
Then choose from the version you want, and type again in Terminal:
$> homebrew install [choosen version]
Gcc is now installed.