MyroC Installation and Comments for Linux
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 Linux.
|eSpeak (external package)||libjpeg (external package)||openGL (external package)||eSpeakPackage.2.0
Installation of MyroC and related packages typically involves two directories, and a user has considerable latitude regarding which directories to use in this process.
Conceptually, the reference directory, mentioned above, might reasonably be designated as /usr or /usr/local.
In my experience, working between these two worlds is challenging, as the owner of one directory is not the same as the owner of the other. For this reason, it is suggested that the reference directory (e.g., MyroC) be placed within the installer's directory structure. In this setting, all files can be compiled and installed with a consistent owner, and system references to these files can be accomplished in a reasonable way using sudo
In what follows, all commands are assumed to be executed in a terminal window.
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.
The installation instructions that follow assume that various standard Linux packages have already been installed. The system administrator of one Linux system has remarked that the following packages should be installed before further work proceeds.
To install eSpeak
Download eSpeak the Linux source zip file from eSpeak
Move the espeak package to your designated working directory (e.g., MyroC-materials).
The following instructions assume you have moved to the designated working directory (e.g., MyroC-materials).
If the espeak package appears with a .zip extension (e.g., espeak-1.48.04-source.zip), unzip the Linux zip file with the command
Move to the unzipped espeak directory, and review the available files, including the license and ReadMe files.
cd espeak-1.48.04 ls
more License.txt more ReadMe
Compile and install espeak — likely using the supplied Makefile(s).
AUDIO = pulseaudio
If this command yields a "permission denied" error, try the sudo version:
sudo make install
With this installation, several files will be placed in designated locations.
Update the computer's cache for loading materials with the command:
Check that all materials are place correctly can be tedious and time consuming. However, a simple test that the binary files (separate from the header file and shared libraries) are appropirate installed can be done by typing the following lines into a terminal window:
espeak << ! this is a test !
Download and install the jpeg source from www.ijg.org
Download and install the openGL source from www.opengl.org
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-materials".
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-materials # 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 Linux 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.
As noted above, two versions of the eSpeakPackage are available for a Linux environment. Since a natural approach to processing utilizes the eSpeak API, it is suggested that you first try installing the eSpeakPackage in
If use of that package yields a program that seems to hang when used, repeat the installation process using subdirection
The following directions relate to eSpeakPackage-linux.2.0
Move from the main base directory to the new MyroC.3.1 subdirectory, and the linux-based eSpeak directory. Then list the contents of the eSpeak subdirectory:
cd MyroC.3.1 cd eSpeakPackage-linux.2.0 ls
The listing includes the following files:
Designate Makefile-linux as the relevant framework for compiling and running eSpeak on a Linux computer. This is accomplished by creating a symbolic link within the eSpeak directory:
ln -s Makefile-linux 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-linux:
Compile the eSpeakPackage
When trying to install the eSpeakPackage, file/directory permission issues can arise when some materials need to be created in a user's MyroC-materials directory and other materials are to be placed in system directories, such as /usr/local/bin. Unfortunately, using both a user's directories and system directories can be extremely time consuming and frustrating, so it is recommended that all materials be installed in a user's directory (e.g., /home/hewalker/MyroC).
Edit the Makefile, so the target for installation identifies the desired directory within the user's account.
Report the location of the relevant files to the Linux operating system; create a local.conf file to designate where shared libraries are located:
If file local.conf was already present, add the above line to this
Note that you may need to use a sudo command with an editor to create and/or modify this file.
The above instructions likely handle software installation. However, workstations often are set up with their audio muted. If running test programs yields long pauses when printed output appears, but no sound, check the audio settings.
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.
As noted above, if the installation in
does not seem to work, try a similar process with the alternative implementation in
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-linux as the relevant framework for compiling and installing the MyroC package:
ln -s Makefile-linux Makefile
Compile and install the MyroC package in system directories:
As with the eSpeakPackage installation, report the relevant files to the Linux operating system (see Step 9 in the eSpeakPackage installation above).
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 Linux 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 Linux 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-linux as the relevant framework for compiling MyroC programs:
ln -s Makefile-linux 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-linux 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-linux files in the eSpeak and MyroC subdirectories are different from the Makefile-linux file in the test-programs subdirectory. Be sure to utilize the Makefile-linux 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
revised for alternate Linux environments 22 January 2017
|For more information, please contact Henry M. Walker at email@example.com.|