MyroC Installation and Comments for Mac OS X
Materials to Support a C-based Course with Scribbler 2 Robots
This page organizes instructions and notes for the installation of version the MyroC package on Mac OS X.
|eSpeak (external package)||libjpeg (external package)||openGL (part of Mac OS X)||eSpeakPackage.2.0
In what follows, all commands are assumed to be executed in a terminal window.
A user has wide latitude regarding directories for downloading and processing files. For simplicity, the user might consider creating a "MyroC" directory (perhaps within the user's home directory) for work related to the MyroC download and installation.
Several of the following steps utilize the sudo command, run in a terminal window. The sudo command allows a user to run certain, authorized commands (e.g., system commands) without having general administrative privileges.
For example, one step in the installation of the eSpeak speech synthesizer requires a copy of the speak program to be placed in the /usr/local/bin directory. Once the speak program has been downloaded, a natural command might be
cp speak /usr/local/bin
However, the /usr/local/bin directory is owned by the system administrator for the computer (sometimes called "root"), and a normal user cannot make changes in this directory. Thus, the user would type
sudo cp speak /usr/local/bin
With this command, the system will ask for your password for authentication. If you type your password correctly, and if you are authorized for this command, then the system will perform the desired work, and the speak program will be copied as you wished.
To install eSpeak
Download eSpeak OSX zip file from eSpeak
If the Downloads package appears with a .zip extension (e.g., espeak-1.45.04-OSX.zip), unzip the OSX zip file:
Move to the unzipped espeak directory, and review the available files, including the license and ReadMe files.
cd espeak-1.45.04 ls
more License.txt more ReadMe
Within the espeak directory in a terminal window, copy the speak program to /usr/local/bin.
sudo cp speak /usr/local/bin
Copy the speak-data directory (and its contents) to a known/required location.
The espeak package requires the speak-data directory to be located in either /usr/share or in the user's home directory. However, although Mac OS X Yosemite release (Mac OS X 10.10) and prior releases allow installation of user files in /usr/share, this is not allowed in the Mac OS X El Capitan (Mac OS X 10.11) for security reasons.
Installation on Mac OS X Yosemite release (Mac OS X 10.10) and prior releases:
Copy the speak-data directory (and its contents) to /usr/share
Note: this location is required by the speak program — since speak is a binary executable, changing this location is difficult or impossible
sudo cp -R espeak-data /usr/share
Installation on Mac OS X El Capitan (Mac OS X 10.11)
Users are not allowed to copy files to /usr/share, yielding the following awkwardness.
sudo mkdir /usr/local/share
sudo cp -R espeak-data /usr/local/share
cd # move to user's home directory ln -s /usr/local/share/espeak-data espeak-data
Check that espeak is properly installed by typing the following lines into a terminal window:
speak << ! this is a test !
Download the jpeg source from www.ijg.org to /usr/local/src:
cd /usr/local sudo mkdir src cd src
In a browser, go to http://www.ijg.org, home for the Independent JPEG Group, to verify the current stable version of the jpeg library. At this writing, the current version is release 9a, and that version is used in the following instructions. (When later releases become available, you will need to make the corresponding adjustments in what follows.)
Download compressed jpeg source code:
sudo curl --remote-name http://www.ijg.org/files/jpegsrc.v9a.tar.gz
Extract and decompress the downloaded file, creating a new subdirectory
Still working within directory /usr/local/src:
sudo tar -xzvf jpegsrc.v9a.tar.gz
Compile and install libjpeg from new jpeg-9a subdirectory
cd jpeg-9a sudo ./configure sudo make sudo make install
Since OpenGL is used widely as the underlying environment for Mac OS X, this package already should be available within the Macintosh environment.
Since it is already installed as part of Mac OS X, a user need do nothing to complete this step.
As noted in the General Comments near the top of this page, the following procedures assume the user has established a base directory for the downloading and installation of the eSpeak and MyroC packages. For example, the user might create a base directory, perhaps called "MyroC".
In a terminal window, move to the created base directory, with a command such as:
cd # since earlier commands reference various directories, go home first cd MyroC # base directory for MyroC installation
Download the compressed archive file, MyroC.3.1b.tgz to your created base directory
Although the original file, MyroC.3.1b.tgz, is a compressed archive file, the Mac environment may or may not decompress the file automatically during download.
tar -xzvf MyroC.3.1b.tgz
tar -xvf MyroC.3.1b.tar
Following this extraction, the following files and directories should be found in a new MyroC.3.1b subdirectory.
The use of eSpeak is quite different on Linux and Mac platforms. Thus, as noted above, the decompression and extraction process creates two subdirectories for the eSpeakPackage:
Assuming a Mac environment, move from the main base directory to the new MyroC.3.1 subdirectory, and the mac-based eSpeak directory. Then list the contents of the eSpeak subdirectory:
cd MyroC.3.1 cd eSpeakPackage-mac.2.0 ls
The listing includes the following files:
Designate Makefile-mac as the relevant framework for compiling and running eSpeak on a Macintosh computer. This is accomplished by creating a symbolic link within the eSpeak directory:
ln -s Makefile-mac Makefile
After this command has been issued, use the ls -l command to check that a new Makefile entry appears in the subdirectory, and that it points to makefile-mac:
Compile the eSpeakPackage
sudo make install/eSpeak
sudo mkdir /usr/local/include
After compiling the eSpeakPackage (step 5), both programs eSpeakTest.c and eSpeakExample1.c can be compiled and run:
make eSpeakTest ./eSpeakTest make eSpeakExample1 ./eSpeakExample1
Note that eSpeakExample2.c will not compile correctly until the MyroC package already is installed; other programs should compile without trouble.
Installation of the eSpeakPackage required downloading and decompressing the archive file MyroC.3.1b.tgz. From the created base directory (e.g., "MyroC"), move to the MyroC.3.1 release subdirectory, and then its subrelease MyroC.3.1b subdirectory:
Move to the MyroC.3.1b subdirectory:
cd # since earlier commands reference various directories, go home first cd MyroC # base directory for MyroC installation cd MyroC.3.1 # the release subdirectory cd MyroC.3.1b # the subrelease subdirectory
As with the eSpeak installation, designate Makefile-mac as the relevant framework for compiling and installing the MyroC package:
ln -s Makefile-mac Makefile
Compile and install the MyroC package in system directories:
sudo make install/MyroC
Several test programs are available in the test-programs subdirectory of the base directory.
Preliminary Step: Using MyroC with Scribbler 2 robots requires setting up Bluetooth so the workstation/laptop and robot(s) are properly paired. See Bluetooth Setup for Macintosh Workstations/Laptops for details — before trying to run test programs.
Compiling MyroC programs requires use of numerous compilation flags, compiling normally uses a Makefile. As with installation, compilation flags must be tailored to the Macintosh environment.
Move to the MyroC.3.1 directory that you created earlier (not MyroC.3.1b), and then move to its test-programs subdirectory.
From the MyroC.3.1 directory, move to the test-programs subdirectory.
In the test-programs subdirectory, designate Makefile-mac as the relevant framework for compiling MyroC programs:
ln -s Makefile-mac Makefile
Test programs can be compiled with a simple make command. For example, running the spirit-song.c program utilizes these steps:
make spirit-song ./spirit-song
Note: If this step generates errors that rBeep and other MyroC functions are "Undefined symbols" or that there is a "clang: error", double check that the "ln -s" command above has been issued, and a new file (called Makefile) is present in the same directory as your program. See also the notes after Step 4 below.
To compile programs in any other user directory (except eSpeak and MyroC.3.1b), copy the Makefile-mac file to the user directory — using the name Makefile.
Notes: Compiling and installing both the eSpeakPackage and MyroC require different commands from compiling and running user programs (once these packages have been installed). Thus, the Makefile-mac files in the eSpeak and MyroC subdirectories are different from the Makefile-mac file in the test-programs subdirectory. Be sure to utilize the Makefile-mac in the test-programs subdirectory as the appropriate Makefile for user programs utilizing either the eSpeakPackage or MyroC.
created 17 October 2015
revised 19 October 2015
revised 23 February 2016
|For more information, please contact Henry M. Walker at email@example.com.|