I'm trying to update the version of make on my mac but am running into issues. The minimum project dependency is 4.1 but my version seems to be 3.81. I've updated Xcode to the latest version and installed the command line tools but it still seems to be the older version.
Has anyone run into this issue or know of a way to resolve it?
Here is what I did, and it works on my MacOS:
Step1: Install homebrew (installation command comes from https://brew.sh/):
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
Step2: Use homebrew to install make
brew install make --with-default-names
just incase it doesn't work, try this:
brew install homebrew/dupes/make --with-default-names
Step3: You need to change the default command to use correct make instead of the default one from your MacBook or Mac.
For example, if you type
make --version
You will see:
GNU Make 3.81
Copyright (C) 2006 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.
This program built for i386-apple-darwin11.3.0
Which is the default path for default version.
So, now, in your .bash_profile (which should be under your home dir /Users/your_name), add the following line:
export PATH="/usr/local/bin:$PATH"
Note: If you see the following message when you installed make:
GNU "make" has been installed as "gmake". If you need to use it as "make", you can add a "gnubin" directory to your PATH from
your bashrc like:
PATH="/usr/local/opt/make/libexec/gnubin:$PATH"
then instead run,
export PATH="/usr/local/opt/make/libexec/gnubin:$PATH"
Then source your .bash_profile. Now try to check your version:
make --version
It should show:
GNU Make 4.2.1
Built for x86_64-apple-darwin16.5.0
Copyright (C) 1988-2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Cheers.
Firstly, the current version:
$ make --version
GNU Make 3.81
Copyright (C) 2006 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.
This program built for i386-apple-darwin11.3.0
Steps to install/configure:
brew install make
export PATH="/usr/local/opt/make/libexec/gnubin:$PATH"
Result:
$ make -v
GNU Make 4.3
Built for x86_64-apple-darwin19.6.0
Copyright (C) 1988-2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
If you choose the homebrew method, you should use brew info make after brew install make succeeds. Then you will see a text like this:
If you need to use it as "make", you can add a "gnubin" directory
to your PATH from your bashrc like:
PATH="/opt/homebrew/opt/make/libexec/gnubin:$PATH"
So, add this path in your .bash_profile,The detailed steps as:
open ~/.bash_profile
Add line: export PATH="/opt/homebrew/opt/make/libexec/gnubin:$PATH"(the path you just got)
⌘ S
source ~/.bash_profile
I attempted a fix by a different approach, namely downloading the newer version of GNU Make I want to upgrade into compile that from source downloaded from the official GNU link, instead of using homebrew. Then, on my mac, I added a path to my bash shell:
export PATH=/usr/local/bin
to the ".bashrc" file in my $HOME directory.
Then reset my Terminal. And, it worked. There seems to be some issue with the homebrew download because the formula automatically links the "gmake" installation to the wrong bin, or more accurately missing the bin in the /usr/local/Cellar/etc./path. So I reckon that's probably why it does not work as of now. Hope maybe someone will fix that soon.
Related
I am using macOS Monterey (12.4).
I used ssh -X username#asasd.de for login.
Modules that are already loaded in system.
Module list:
intel-oneapi-compilers/2022.0.1-gcc-11.2.0
openmpi/4.1.2-intel-2021.5.0
netcdf-c/4.8.1-openmpi-4.1.2-intel-2021.5.0
netcdf-fortran/4.5.3-openmpi-4.1.2-intel-2021.5.0
intel-oneapi-mkl/2022.0.1-gcc-11.2.0
ncview/2.1.8-gcc-11.2.0
hdf5/1.12.1-threadsafe-intel-2021.5.0
After running a model in a /work/ directory I generate a file "file.cdf" there.
I want to open it with ncview.
So I did : $ ncview file.cdf and I am getting this error.
Ncview 2.1.8 David W. Pierce 8 March 2017
http://meteora.ucsd.edu:80/~pierce/ncview_home_page.html
Copyright (C) 1993 through 2015, David W. Pierce
Ncview comes with ABSOLUTELY NO WARRANTY; for details type `ncview -w'.
This is free software licensed under the Gnu General Public License version 3; type `ncview -c' for redistribution details.
Note: could not open file /home/.ncviewrc for reading
Error: Can't open display:
I am a win10 user. Using ubuntu 20.04 version. loaded ncview package via "sudo apt install ncview" command. 2.1.8+ds-3build2 version seems loaded but facing with the same error:
Ncview 2.1.8 David W. Pierce 8 March 2017
http://meteora.ucsd.edu:80/~pierce/ncview_home_page.html
Copyright (C) 1993 through 2015, David W. Pierce
Ncview comes with ABSOLUTELY NO WARRANTY; for details type ncview -w'. This is free software licensed under the Gnu General Public License version 3; type ncview -c' for redistribution details.
Note: could not open file /home/cahit/.ncviewrc for reading
Error: Can't open display:
Any suggestios for this situation ?
For Mac users:
I was also facing the same issue. It was solved for me after installing Xquartz on my local machine. https://www.xquartz.org/
I hope it works for you.
I also face the same problem,
Ncview 2.1.8 David W. Pierce 8 March 2017
http://meteora.ucsd.edu:80/~pierce/ncview_home_page.html
Copyright (C) 1993 through 2015, David W. Pierce
Ncview comes with ABSOLUTELY NO WARRANTY; for details type ncview -w'. This is free software licensed under the Gnu General Public License version 3; type ncview -c' for redistribution details.
Note: could not open file /home/user/.ncviewrc for reading
Error: Can't open display: :0.0
if someone resolved this issue please share.
I am looking for a cloud builder with gnu make. The Google cloud builders listed here do not mention any.
As far as I can tell it is not documented but I found out that you can use the go image for this:
$ docker run -it --entrypoint make gcr.io/cloud-builders/go:debian --version
GNU Make 4.1
Built for x86_64-pc-linux-gnu
Copyright (C) 1988-2014 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
My macos is Mojave, 10.14.4, and Xcode has been fully updated. I completed the task this morning. Additionally, after I downloaded Xcode through App Store, a popup announced
Install additional required components? Xcode requires additional components to support running and
debugging. Choose install to add required components.
and I fully complied. Finally I was able to open Xcode and the version is
Xcode 10.2.1 (10E1001)
For extra measure, I rebooted the computer. But fink still will not function; see below.
> fink install jhead
Password:
Use 'fink reinstall fink' to switch distributions
from 10.13 to 10.14.
'install' operation not permitted.
> fink reinstall fink
Use 'fink reinstall fink' to switch distributions
from 10.13 to 10.14.
Information about 11530 packages read in 2 seconds.
Failed:
The Xcode Command Line Tools need to be (re)installed.
Execute 'sudo xcode-select --install' to obtain them.
Or you can get them via direct download from developer.apple.com
(free registration required) if you don't want to install Xcode.app.
> sudo xcode-select --install
xcode-select: error: command line tools are already installed, use "Software Update" to install updates
> fink -V
Package manager version: 0.43.1
Distribution version: selfupdate-git Fri May 10 17:37:58 2019, 10.13, x86_64
Trees: local/main stable/main
Copyright (c) 2001 Christoph Pfisterer
Copyright (c) 2001-2016 The Fink Package Manager Team
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
>
How do I get fink to work?
Thanks to Alexander Hansen, Ph.D., Fink User Liaison, on fink-beginners#lists.sourceforge.net:
fink 0.43.1 won’t work on Mojave, period. We really can’t make a fink release work on OS versions that are newer, so we
encourage people to update fink before updating the OS.
You can download a fink version that will work from https://sourceforge.net/projects/fink/files/fink/0.44.1/fink_0.44.1-131_darwin-x86_64.deb/download , then from a terminal windowuse “sudo dpkg -i $HOME/Downloads/fink_0.44.1-131_darwin-x86_64.deb” to update it (replace $HOME/Downloads) with your actual download location.
This did the trick and I was subsequently able to install jhead.
I installed GDB 7.8.1 and GCC 4.9 through Homebrew.
When I open a core file generated by a GCC-compiled (gcc-4.9 -g xxx.c -o xxx) program, it reports:
→ gdb ./list_test /cores/core.1176
GNU gdb (GDB) 7.8.1
Copyright (C) 2014 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-apple-darwin14.0.0".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from ./list_test...
warning: `/var/folders/r1/3sx4x5k1557g_v5by83k4hg00000gn/T//cchuMtAU.o': can't open to read symbols: No such file or directory.
(no debugging symbols found)...done.
"/cores/core.1176": no core file handler recognizes format
I googled and found someone suggested to use LLDB instead of GDB.
Is is possible to use GDB to debug the core file? And is it because GDB does not support the binary format on Yosemite?
Based on the long GDB developers' discussion thread on this issue, it seems Apple did not merge their changes back to the official GNU mainline, and instead chose to publish the modified source code on their own site. As a result, the Homebrew GDB install (which uses the stock GDB sources) can't load OS X core files.
At this point, I see three choices:
Give in and learn LLDB. There's a GDB to LLDB cheat sheet to help.
Install Apple's custom GDB from MacPorts. I've long forsaken MacPorts, so I can't test it, but if you have MacPorts installed, try the following:
$ sudo port install gdb-apple
$ codesign -s <your_GDB_cert_id> /opt/local/bin/gdb-apple
$ /opt/local/bin/gdb-apple ./list_test /cores/core.1176
Translate MacPorts' GDB patches and build spec into a Homebrew formula. It's theoretically possible, but I don't have the time to do it myself.
Personally, I've opted to just learn LLDB. Apple has moved permanently to LLVM, so it's probably just a matter of time before the old patched GDB stops working with the latest-and-greatest Xcode tools.
I am a new Mac user and wonder how to install the latest version of GDB (> 7.1). I prefer to use Homebrew, but I could not find GDB listed.
brew install gdb
Error: No available formula for gdb
What is the best way to do it?
When installed Xcode, it may have installed an older version. Currently,
$ which gdb
/usr/bin/gdb
$ gdb --version
GNU gdb 6.3.50-20050815 (Apple version gdb-1705) (Fri Jul 1 10:50:06 UTC 2011)
Copyright 2004 Free Software Foundation, Inc.
But I need version > 7.1
System version,
Model Name: MacBook Air
System Version: Mac OS X 10.7.1 (11B2118)
Homebrew does not provide gcc and the associated development tool formulas over concerns that custom/non-system compilers could break builds. Two possibilities for easiness:
Use http://www.macports.org/
Look here https://github.com/mxcl/homebrew/wiki/Custom-GCC-and-cross-compilers
This is probably the command for you:
brew install https://raw.github.com/Homebrew/homebrew-dupes/master/gdb.rb
Some new users may find themselves in the same situation given the Mac OS X v10.9 (Mavericks) upgrade.
Solution
Install the development tools and Xcode
Then install Homebrew
Then do:
brew install homebrew/dupes/gdb
You will notice that some applications will not allow you to use the newly added GDB.
This is because it is not signed by Apple any more.
To side step this issue: Follow this; thanks to #andre
I've had some people hit me up on IRC for more detailed instructions for this. I made a post on my site. You can find it here.
This does not directly answer the given question, but if you're like me, what you really want is a simple way to run (something very much like) gdb.
Apple now uses Clang as its compiler, and it turns out that the clang debugger, lldb, is installed along with the other command-line tools. It appears that lldb is designed with a user interface that mimics gdb very closely.
So, the answer to your question may in fact be:
just use lldb!