GMP port to Power Macintosh and MacOS
Kent Boortz <firstname.lastname@example.org>
Copyright 2000, 2001, 2002 Free Software Foundation, Inc.
This file is part of the GNU MP Library.
The GNU MP Library is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation; either version 2.1 of the License, or (at your
option) any later version.
The GNU MP Library 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 Lesser General Public
License for more details.
You should have received a copy of the GNU Lesser General Public License
along with the GNU MP Library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
This is an unsupported port of GMP to Power Macintosh and MacOS. This
port is *not* for OS X which is a Unix derivative, that system can use
the normal configure and make described in the GMP manual.
This port will use the optimized 'mpn' assembler routines written for
32 bit PowerPC to gain speed. The BSD MP compatible library is not
built. The MacOS configuration uses the 'malloc-notreentrant' option
to optimize for speed.
The output is a library
Not all tests pass
We never run the 'io' test the source don't compile
If using Apple's compilers we never run the mpz t-mul, mpf t-add
and mpf t-sub because they don't compile with MrC 4.1
To compile into the library you need
Apple MPW (free)
MacPerl 5 for MPW
GMP build was tested with MPW Shell 3.5.
MacPerl is free, download and install the MPW tool version from
any CPAN mirror. There is a list of mirrors at
There is also a special site dedicated to MacPerl
You need the "Appl" and "Tool" archive, for example
APPLE MPW INSTALLATION
The MPW development system can be downloaded from
You need "StuffIt Expander" to unpack the source. You can download
"StuffIt Expander" for free from
This result is a PDF file that can be read with the free Acrobat Reader
From the MPW development environment you need at least
Put these into a folder and drag the whole folder to the "StuffIt
Expander" icon to unpack them.
Move "Scripts" folder down into the "MPW_Shell Folder".
Create a folder "Tools" inside the "MPW_Shell Folder" and move "Make",
"PPCAsm", "MrC", "PPCLink" and "GetFileName" down into the "Tools"
Create a folder "Interfaces&Libraries" at the same level as the
"MPW_Shell Folder". Put Put "RuntimeLibraries", "Libraries" into the
"Interfaces&Libraries" folder. Inside the "Interfaces&Libraries"
folder create a new folder "Interfaces" and put "CInlcudes" into it.
In summary, the manually moved files/folders should be located at
Follow the rest of the installation instructions in "About MPW etc.".
MACPERL MPW INSTALLATION
Drag these archives to the "StuffIt Expander" icon to unpack them.
The result is two installation programs. Run the "Mac_Perl_520r4_appl"
installer and let it install Perl into the default location, then run
the "Mac_Perl_520r4_tool" insaller.
To enable MPW to use MacPerl follow the instructions in the first
comment in the file "Install.MPW_Perl". For MacPerl 520r4 this is
- Double click on the "MPW Shell" icon to start MPW and change the
directory to the "MacPerl f" folder using the directory command or
the "Set Directory..." menu item.
- Execute the "Install.MPW_Perl" command, i.e. write the name of the
command at the end of the "Worksheet" window, select the command
text and hit the "Enter" key". This will create a configuration
file and open it.
- Execute the "Install.MPW_Perl" command again.
- Execute the text the script wrote to the "Worksheet" window, i.e.
drag select all the lines and hit the "Enter" key.
- You need to restart MPW to make Perl work.
The "macos" folder/directory should be inside the top directory in the
GMP source tree and should contain four files
README This file.
configure Create files and directories needed.
unix2mac Used to convert "configure" end-of-line chars.
Makefile.in Source for the final "Makefile".
Double click on the "MPW Shell" icon and set the directory using the
"Directory" menu to the "$GMP_SOURCE_DIR:macos:" folder/directory.
You run "configure" in a two step process
% perl unix2mac configure > configure.mac
% perl configure.mac
Then run "Make"
This will not execute the commands. It is like "make -n" on Unix, it
will display the commands to execute. You select the commands and
hit "enter" to actually execute the commands.
To test the code you execute the output from
% make check
If there is an error the test program will complain. Note that the
test programs can contain errors so a test failure doesn't always
mean that the library is broken.
To cleanup to the state before configure you execute the output from
% make clean
To remove the the resulting library as well you do
% make distclean
Bug reports can be sent to email@example.com. Unfortunately the
developers don't use this port and can offer only very general help.
Reports including any fixes or updates necessary would be welcomed.
There may be problems if the program you use for unpacking the source
use automatic conversion of end-of-line characters.
This port may be out of sync with minor GMP releases or patches.
The MacOS build is very different from the Unix build process and
for some changes in the Unix build the build process for MacOS has
to be changed manually.
The library uses stream I/O operations for some of the GMP functions
and maybe for some error messages. This means that to link this
library to form a normal Mac application you may get link problems,
i.e. a Mac normally has no console/shell to write to.
If you are unfamiliar with MPW note that the "return" key and the
"enter" key mean different things to MPW. The first just add a line
break, the second send the line your pointer is at or the selection
you have to the MPW command interpreter.
If you mount the GMP source from a Unix netatalk server don't move or
remove files from the Unix side while MPW is running. MPW cache
information about what the file system looks like and gets very
confused or crash.
Kent Boortz <firstname.lastname@example.org>