'make' command missing from OS X - macos

The make command is missing on my mac, running OS X version 10.6 (Snow Leopard). What should I do to install make?

You'll need to install the OS X developer tools from the Mac OS X installation discs.
EDIT: Directions here.

You need to install XCode, which comes along with make. You can download the latest XCode for free (if you're on Lion or Mountain Lion) from the Mac App store.

Update
It seems the link in the selected answer is a better solution, in that you don't have to add it to your path, it installs it in /usr/bin. I was originally thrown off by this as the answer mentions installation disks, which do not exist anymore (and are not needed here).
Original Post
make went missing on my installation of OSX Lion, even with XCode installed.
What I discovered was that, it was not in /usr/bin, but was in /Developer/usr/bin, which is not in $PATH environment variable by default. This is most likely a result of the XCode install.
You have a few options:
install it to one of the directories that is in your path
make a symbolic link to point to the Developer bin directory (for example, from /usr/bin)
modify your path to include the Developer directory (what I did) - see below
Add the developer bin to your path:
Somewhere in ~/.bashrc place the following code:
export PATH=$PATH:/Developer/usr/bin
#Remove Duplicates:
PATH=`perl -e '#A=split(/:/,$ENV{PATH});%H=map {$A[$#A-$_]=>$#A-$_} (0..$#A);#A=join(":",sort{$H{$a} <=> $H{$b} }keys %H);print "#A"'`
export PATH
Line 1: add /Developer/usr/bin to the end of the current path so it has low priority
Line 3: because we're adjusting path, we want to remove duplicates (in case you source more than once). Duplicates aren't really problematic, but this should cause the same directory to not be searched more than once, which may make it faster.
Line 4: Make it available to your environment
Note:
If you're using a different shell (for instance csh), you'll have to adjust the script above and make the changes in that corresponding resource file (~/.cshrc).
To apply changes you'll have to source ~/.bashrc or reopen your terminal.

Related

How does installers set PATH variable on Mac OSX?

I'm wondering how PATH variable is set by Mac Installers on Mac OSX.
For example:
Look at golang Mac OSX Installer. From the link https://golang.org/doc/install:
Mac OS X package installer
Download the package file, open it, and follow the prompts to install
the Go tools. The package installs the Go distribution to
/usr/local/go.
The package should put the /usr/local/go/bin directory in your PATH
environment variable. You may need to restart any open Terminal
sessions for the change to take effect.
So, the I can see /usr/local/go/bin in $PATH but it's not being set in .profile, .bashrc or launchd.conf.
Can anybody please help me to understand?
There are a couple methods of setting environment variables in Mac OS X (lots of discussion here). In the case the Go package, it is adding a file in /etc/paths.d named go that contains /usr/local/go/bin. Here's an answer to another question explaining that a utility called path_helper is being launched and it's inspecting the /etc/paths.d directory.
You can verify this yourself by using an application called Pacifist to inspect the contents of the Go package and looking at the files it's installing.

After upgrade to OSX 10.8.2 "latex: command not found"

I've been using the vim-latex suite on my mac (10.7.?) for months with no problem. Over the weekend, I upgraded the OS to 10.8.2, and now my tex files fail to compile. The compile command
\ll
produces no errors within vim, but no pdf-file gets produced. If I drop to the command line in a terminal, the following command
latex document.tex
produces
-bash: latex: command not found
Similarly, for pdflatex. I'm not sure if this is a path error, or if latex for 10.8.2 needs to be reinstalled. I'm not sure how to proceed in either case.
I had the same problem and typing:
export PATH=/usr/texbin:$PATH
seems to work fine in a shell. Although it no longer works if I open a new shell, this is a faster solution to re-downloading and re-installing the huge MacTeX program.
This happened to me after upgrading to OS X El Capitan. I found the latex executables in /usr/local/texlive/2014/bin/x86_64-darwin. So, I just added this to my .bashrc
export PATH="$PATH:/usr/local/texlive/2014/bin/x86_64-darwin"
No need to reinstall.
On OS X, the standard way for third party installers to add a directory to the path is to put a file under /etc/paths.d. TeXLive does this as part of the installation, but the OS upgrade probably blew it away.
You should be able to just create a new file under that directory containing just one line, the path the directory containing the TeX executables.
When setting the path via #petew's answer, /usr/local/texlive/2014/bin/x86_64-darwin may not be the correct version. On my system /usr/local/texlive/2021/bin/universal-darwin was what was needed. Make sure to check your texlive binaries to see what file you downloaded.

install Xcode in /usr

I have a makefile project that I would like to port to Xcode.
I was following the instructions on:
https://developer.apple.com/library/mac/#documentation/Porting/Conceptual/PortingUnix/preparing/preparing.html
The document lists as important to install Xcode in the default "/usr" folder.
But the installer gives no such option.
And it installs the folder Devolopper in the "/" folder.
Is it safe to just move the whole content of "Developper" to "/usr" or should that be done during installation?
If so, how?
TFA says
If you are using makefiles for compilation, you should install Xcode in the default location (/usr). If you do not, you may have to do extra work to get your scripts to run the compiler, linker, and so on in a nonstandard location.
I'm guessing that the specific path is out of date, but the overall advice of installing Xcode in the standard place is sound. I recommend you use the Xcode installer, which puts make and gcc in the proper places and not worry about /usr in particular.
You certainly do NOT need to move /Developer to /usr. The docs must be talking about /usr/llvm-gcc-4.2/ folder and others which will be created when Xcode is installed into /Developer. You don't need to do anything special for that.
When Xcode tools are installed to the default location (/Developer), the installer creates aliases for developer tools in /usr locations automatically. Install and everything will just work: make, gcc, ld and everything else will appear in $PATH. In short, just install and that will be it.
I don't know why the doc says it that way, it must be mistake or misunderstanding.

Uninstalling OSX-AVR from Mac OS X 10.7.2

Does anyone know how to completely remove OSX-AVR from Mac OS X? I need newer support for avr-gcc, so I am going to install CrossPack for AVR, but I do not want any collisions from having multiple avr-gccs in my system. I have not found any documentation about uninstalling OSX-AVR, so I do not know how to get rid of everything.
Thanks,
Took me a while to find this but sometimes you have to install to uninstall, from the readme that popups after you install (located locally at /usr/local/CrossPack-AVR/manual/installation.html):
sudo /usr/local/CrossPack-AVR/uninstall
Have you checked whether there is a bom file for this installation. It might be in /Library/Receipts or ~/Library/Receipts. This file (you can view its content with lsbom) contains a list of all files belonging to an installation.
But I'm not sure whether OSX-AVR writes one.
The which command will tell you in what directory your program is installed, and then you can move that file into the trash.
sudo mv `which <yourProgramName>` ~/.Trash/
I used this to uninstall AVRDUDE from my crosspack installation and it worked fine. Someone has commented that this will not get rid of any extra files that may have been installed in other directories which is true but hopefully those files would be overwritten upon reinstall. This worked fine in my case.
brew remove avrdude worked for me (mac os x 10.11.4).

ImageMagick - How to Build a 32-bit Mac version for MAMP?

This is a pretty straight-forward question: I have an older INTEL Mac (32-bit) and I need to build a 32-bit version of ImageMagick.
I've seen some people playing around with options during the binary install, but I can't seem to find any reliable information about how to do this!
NOTE: ImageMagick gives out a 64-bit version of the binaries for Mac OS X on their webpage, but I'm not sure if this can be hacked into a 32-bit version during compiling?
THANK YOU - I'm really stuck on this!
The problem was ImageMagick's un-intuitive webpage that made it a little hard to figure out how to proceed - I finally found the binaries on their page and installed following these directions:
Intro:
If you have an older INTEL MacBook - it might have a 32-bit processor. This is how to compile ImageMagick (Mac OS X version) as a 32-bit program using the ImageMagick binary files - NOT USING MACPORTS!.
To find out what processor you have, i.e. 32-bit or 64-bit, look here:
http://support.apple.com/kb/ht3696
To install via MACPORTS look here:
http://xentek.net/articles/442/installing-imagemagick-and-imagick-via-macports/
My Computer:
This worked on my first-generation INTEL Macbook (you know - the white one with a Due Core processor).
OS:
I'm running OS X 10.6.4 (Snow Leopard)
INSTALL STEPS:
1. The trick is to ignore ImageMagick's pre-packed MAC OS X install package because it's compiled in a 64-bit version - we want a 32-bit version instead!
So, we need to get the UNIX binaries here: http://www.imagemagick.org/script/install-source.php#unix
Following the page's instructions, we download a file called ImageMagick.tar.gz. The ImageMagick group seemingly updates this link to point to the latest version.
The file is a compressed TAR file with the extension tar.gz. If you're using MAMP (like I am) then you might want to create a new file called "ImageMagick" (without the quotation marks "") in this folder: /Applications/MAMP/bin/. Normally we would install ImageMagick into this folder - however, because we're working from the binaries, a standard ./configure / make / make install pattern will simply default install ImageMagick into whatever path you have set up on your computer. In my case, my default path is the USR/LOCAL folder.
NOTE: if somebody wants to write here how to instead direct the ./configure options so that ImageMagick will install into a MAMP folder (or other folder) instead of the default path, that would be really helpful!
Well, back to the MAMP 32-bit install:
Place your recently-downloaded binary copy of ImageMagick in a new folder. I use a folder called SRC to keep all these intermediate copies of files in a place that I can later delete/clean when they are not necessary.
Next, expand the compressed file by opening your TERMINAL (look for the program in the "Utilities" folder).
With TERMINAL open, type the following:
cd path/to/the/ImageMagick/file #navigate to the folder where the file is saved
tar xvfz ImageMagick.tar.gz #expand the tar ball file
You should now see in the ImageMagick folder a new folder that you just expanded, called (for example) "ImageMagick-6.6.3" (NOTE: later versions of ImageMagick might have a different version number written at the end of this). Right now the folder would be called ImageMagick-6.6.3-2 ...
Move one level up into that folder.
To do so, type the following into TERMINAL:
cd ImageMagick-6.6.3-2 #replace the version number
Now you're going to run a standard .configure / make / make install pattern - your compiler/system should automatically configure the build to your 32-bit environment!
In terminal, you should be in the ImageMagick-6.6.3 file folder. Once there, run these commands:
sudo ./configure #I use SUDO here just in case your file permissions are messed up...
make #go get a cup of coffee
make install #go get another cup ...
HINT: text after the "#" is just my comments - just ignore the # and also the text on that line following the hash...
Make sure the "./configure" "MAKE" and "MAKE INSTALL" commands finish without errors - they should run just fine!
Then, you can run the standard ImageMagick test using your TERMINAL program:
Type this out to run the tests:
convert logo: logo.gif
identify logo.gif
display logo.gif
Wholla! You should see the ImageMagick logo pop up - meaning that ImageMagick is now installed on your 32-bit MAC OS X computer!
thx for this! to point configure to a different installation directory the syntax is:
./configure --prefix=NEW_PREFIX
where NEW_PREFIX should be set to the path of your mamp installation directory.

Resources