-
How do I check which shell I'm using?"
To check your login shell, type the following command in a terminal:
echo $SHELL
-
How do I change my login shell?"
To change your shell on the CS machines, use the
ypchsh command.
You will be prompted for your password and the path to the new shell.
For the path, type /bin/tcsh
and press Enter.
After making this change, you will need to
logout and back in again.
-
When running my program, I get the message
"VisualSysInit(C): fail to
load visual system!"
This message is displayed by the
ThreadMentor
libraries when the visualization program cannot be loaded.
This usually means that you did not add the visualization system to
your execution path.
If your shell is bsh or bash, add the following to
.profile (in your home
directory)
export PATH=/local/eit-linux/apps/ThreadMentor/bin:$PATH
If your shell is csh or tcsh, or a variant, then include the following
line in the .cshrc file
(in your home directory):
setenv PATH /local/eit-linux/apps/ThreadMentor/bin:${PATH}
Note: tcsh seems to work best
in most cases and is the recommended shell.
-
When running my program, I get message
"Gtk-WARNING **: cannot open
display and no visualization"
This occurs because the visualization system uses Gtk and X to display
the windows, but the host you are on cannot contact an X server. This
usually occurs when you are using SSH or are running your Linux
workstation in text mode (no Gnome/KDE/Fluxbox/etc.). If you are
connecting to wopr.csl.mtu.edu,
you'll need to link with the NoVisual libraries, since X forwarding has
been disabled. If you need to use visualization, either come in to the
CS labs and use a Linux workstation, or install Visual Studio.NET 2005
and ThreadMentor
on your home PC. See here
and here for more details.
-
What is
LD_LIBRARY_PATH? Do I need to modify it?
This environment variable identifies directories to search
(before the standard Linux paths) when shared libraries
(i.e., lib*.so)
need to be loaded by a program.
ThreadMentor
itself is a static library, not a shared library, so you do not
need to modify LD_LIBRARY_PATH
for
ThreadMentor to work.
Adding the ThreadMentor
path to this environment variable may actually result in a small performance
decrease when using other applications, since a directory will
be searched when it doesn't need to be.
For more information about shared libraries, read this
this
page from the Linux Documentation Project.
-
My program does not compile on my Linux64 home machine but works fine
on CS Lab machines.
What is going on here?
(Contributed by Parker Young)
Most modern versions of popular Linux distributions have configured the C++ compiler in GCC to enable creating Position Independent Executables by default.
While the CS Lab Machines and Servers don't have this enabled,
it does pose a problem for those trying to use
ThreadMentor on their
home machines, which might have a newer version of GCC than the ones provided by
MTU IT. It seems that ThreadMentor
was not compiled with Position Independent Code, which produces linking errors
like these:
c++ -o prog3 thread.o thread-main.o /opt/ThreadMentor/NoVisual/libthreadclass.a -lpthread
/usr/sbin/ld: /opt/ThreadMentor/NoVisual/libthreadclass.a(ThreadClass.o): relocation R_X86_64_32 against `.bss' can not be used when making a PIE object; recompile with -fPIC
/usr/sbin/ld: /opt/ThreadMentor/NoVisual/libthreadclass.a(ThreadIdMapTable.o): relocation R_X86_64_32 against symbol `_ZTI12MutexProblem' can not be used when making a PIE object; recompile with -fPIC
/usr/sbin/ld: /opt/ThreadMentor/NoVisual/libthreadclass.a(ThreadClassException.o): relocation R_X86_64_32 against `.bss' can not be used when making a PIE object; recompile with -fPIC
/usr/sbin/ld: final link failed: nonrepresentable section on output
collect2: error: ld returned 1 exit status
make: *** [Makefile.local:17: noVisual] Error 1
If -no-pie is added to the
FLAGS section of the
ThreadMentor
Makefile, then the linker
creates the executable successfully.
Obviously, you should always test your code on the CS Lab Machines as well,
but for those wishing to work on this at home and are using the Linux64 version
of ThreadMentor with a newer
version of GCC, this might be an error they encounter, and the output from the linker is less than helpful.
Note that the Makefile has already
had flag -no-pie added.
Remove it when you submit your program.
-
How can I compile and test my ThreadMentor programs at home
using Windows?
The best way to compile and test at home is using Microsoft Visual
Studio.NET 2005. This is available to all CS majors via MSDNAA (email
csmaint@mtu.edu
to request an account, and include your name, email
address, and expected graduation date). Nonmajors should contact their
department computing lab administrator to determine whether their
department has an MSDNAA agreement. (If MSDNAA access is not available,
Microsoft Visual C++ 2005 Express Edition, which is a free download, will
work too)
When installing Visual Studio, if you want to save disk space, you can
deselect the other languages such as C#, J#, and Visual Basic. You don't
need to install Crystal Reports or SQL Server either.
After installing Visual Studio, unzip the
ThreadMentor
distribution for VSNet2005 (see the
common directory) to a directory of your choice.
In the instructions below, the
ThreadMentor directory
is c:\threadmentor.
REMEMBER:
The Visual C++ version of
ThreadMentor is
provided for your convenience. Because the grader will run your program on
the CS lab machines, be sure to thoroughly test your program in the lab
before submitting it.
|
-
How do I set up a Visual Studio 2005 project to
work with ThreadMentor?
When creating a new project, follow these steps:
- From the File
menu, selectNew,
then Project.
- From the list of templates, select
Win32 Console Application.
- Under Application Settings,
check Empty Project,
then click Finish.
- Add your source files to the project.
Before compiling, select Options
from the Project menu.
Set the following options under
Configuration Properties.
Note: you will need to have a C++
source file in your project already for some of these options to be
visible.
- Category: C/C++ / General
Option: Additional Include Directories
Value: c:\threadmentor\include
- Category: C/C++ / Preprocessor
Option: Preprocessor Definitions
Value: WIN32;_CONSOLE;VC_NET;WIN32_THREAD
- Category: C/C++ / Code Generation
Option: Runtime Library
Value: Multithreaded (/MT)
- Category: Linker / General
Option: Additional Library Directories
Value: c:\threadmentor\release\threadclass.visual
or c:\threadmentor\release\threadclass.novisual
(depending on whether you want the visualization system)
- Category: Linker / Input
Option: Additional Dependencies
Value: ThreadClass.lib
- Category: Debugging
Option: Environment
Value: PATH=C:\ThreadMentor\release\visualwin
- Category: Debugging
Option: Command Arguments
Value: (Any command-line arguments needed to run your program)