![]() |
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 3.33.3b of the MyroC package on Linux.
| General Comments | Preliminaries | External Packages | eSpeakPackage.3.0
(within MyroC.3.33.3b) | MyroC.3.33.3b |
Notes:
This section includes for general background—before one starts the actual installation process. Overall, these notes fall into three categories: needed directories, permissions with the sudo command, and the use of the apt package manager.
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 or /usr/local/share.
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.
During installation, several 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.
cp speak /usr/local/bin
sudo cp speak /usr/local/bin
As noted above, this guide relies on the usage of the apt package manager for the installation of some programs.
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.
libbluetooth
libbluetooth-dev
MyroC depends upon several third-party packages:
Fortunately, each of these packages can be installed easily using the apt package manager.
Type the following line in a terminal window so that the apt package manager has up-to-date information on what is already installed on your machine.
sudo apt update
Install the needed packages by entering the following line in a terminal window.
sudo apt install libbluetooth3 libbluetooth-dev libxmu-dev libxmu-headers libxi-dev libpulse-dev libespeak-dev libjpeg-dev libopengl-dev
Note: If you enjoy typing long lines, then you are free to type this yourself in a terminal window. For others, a copy-and-paste of this line would work nicely.
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 "MyroCPackage".
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 MyroCPackage # base directory for MyroC installation
Download the compressed archive file, MyroC.3.33.3b.tgz to your created base directory
Although the original file, MyroC.3.33.3b.tgz, is a compressed archive file, the Linux environment may or may not decompress the file automatically during download.
tar -xzvf MyroC.3.33.3b.tgz
tar -xvf MyroC.3.33.3b.tar
Following this extraction, the following files and directories should be found in a new MyroC.3.33.3b subdirectory.
All materials for the eSpeakPackage are (not surprisingly) located in
the eSpeak directory.
Move from the general MyroCPackage directory to its
eSpeak subdirectory.:
cd eSpeak
The internal algorithms and code for the eSpeakPackage are quite different on Linux, Mac OS X, and Windows 10. Thus, the downloading and decompression process for the MyroCPackage creates four subdirectories for the eSpeakPackage:
On Linux, the natural approach is to use the eSpeak API to utilize various functions directly within a C program. The eSpeakPackage using this API is collected in subdirectory:
To install the eSpeakPackage for Linux, move to the eSpeakPackage-linux.3.0 directory.
cd
cd MyroCPackage
cd eSpeak
cd eSpeakPackage-linux.3.0
The listing includes the following files:
Designate Makefile-linux-implementation 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-implementation 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-implemetation:
ls -l
Note: If this link command ln -s generates a "file exists"
error, then a current Makefile link exists, but it may be
designating a Makefile for Mac OS X or Windows, rather than Linux. In
this case, remove the earlier link and create a new link:
rm Makefile
ln -s Makefile-mac Makefile
Installation of the eSpeakPackge requires primary decisions.
Within Linux, it is common for programs installed by the user to be
placed in subdirectories or /usr/local. In particular,
/usr/local/include is a commonly-used directory of header
files.
/usr/local/bin is a commonly-used directory for
locally-installed programs.
/usr/local/lib is a commonly-used directory for code
libraries.
Check the beginning of the
file Makefile-linux-implementation, so that the
base directory for this installation is correct.
/usr/local/ and its subdirectories,
then Makefile-linux-implementation likely may be used
without change.
Makefile-linux-implementation to reflect
the desired directories.
Typically, a personal laptop is owned by one person, and that person is the only one who can log onto the machine. However, for machines in labs or machines on which several people have accounts, one person could be using the machine while another logs in remotely. In this context, an awkward situation could arise if the remote user logged in to the computer and used the eSpeakPackage to "talk" to a logged in user.
Due to these two environments, the eSpeakPackage has two compilation/installation options.
make computer=shared install/espeak
make install/espeak
If the above command produces a permissions error, use sudo
with the above command:
sudo make computer=shared install/espeak
or
sudo make install/espeak
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
eSpeakPackage-linux.3.0
does not seem to work, try a similar process with the alternative implementation in
eSpeakPackage-linux.3.0-alt
Installation of the eSpeakPackage required downloading and decompressing the archive file MyroC.3.33.3b.tgz. From the created base directory (e.g., "MyroC"), move to the MyroC.3.3 release subdirectory, and then its subrelease MyroC.3.33.3b subdirectory:
Move to the MyroC.3.33.3b subdirectory:
cd # since earlier commands reference various directories, go home first cd MyroC # base directory for MyroC installation cd MyroC.3.3 # the release subdirectory cd MyroC.3.33.3b # 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
Note: As with eSpeak, if If this link command ln
-s generates a "file exists" error, then remove the earlier
link and create a new link:
rm Makefile
ln -s Makefile-linux Makefile
The beginning of file Makefile-linux contains
an INSTALLPATH variable that designates where the
MyroC material should be placed. Pragmatically, this location
depends upon the system involved.
/home/walker/MyroC
/usr/local
Edit Makefile-linux as needed to designate the
desired directory for this installaton.
Compile and install the MyroC package in system directories:
make install/MyroC
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.
Unfortunately, the specific libraries required for graphics and infrastructure vary substantially from one Linux environment to another. For this reason, this MyroC.3.3a package contains two distinct Makefiles for compiling application programs.
Whatever flags are needed, compiling is based on files in the test-programs subdirectory of MyroC.3.3.
Move to the MyroC.3.3 directory that you created earlier (not MyroC.3.33.3b), and then move to its test-programs subdirectory.
From the MyroC.3.3 directory, move to the test-programs subdirectory.
cd test-programs
In the test-programs subdirectory, designate the proper Makefile version as the relevant framework for compiling MyroC programs.
ln -s Makefile-linux-mathlan Makefile
ln -s Makefile-linux-pc Makefile
If neither of these Makefile versions work in the following steps, you will need to determine what libraries contain the relevant functions (see the program header files) as well as the locations of the directories that contain those libraries.
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.33.3b), copy the appropriate Makefile-linux version 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, 26 February 2021 |
|
| For more information, please contact Henry M. Walker at walker@cs.grinnell.edu. |