Hello Shachar,
You are getting warnings and errors from ld. I have not seen these
particular errors before, so I am guessing your Linux installation uses a
different version of ld than ours. We may have to play with linker
options a bit to find a set of options that will make ld do the right
thing on your system.
First, some questions and commands to run so we can get more information
about your environment.
What Linux distribution are you using?
Can you send us the output of:
/usr/bin/ld -V
Next, open up makefile.defs. Find the following line:
GCC_SIMICS_LFLAGS=-shared -export-dynamic -Wl,--whole-archive
Change it to read:
GCC_SIMICS_LFLAGS=-v -shared -export-dynamic -Wl,--whole-archive
This will make gcc print out the exact command line it is passing to the
linker. Please send us that output.
Finally, I have a few suggestions on things to try to see if they
eliminate the problems you are seeing. Please try each of these things
and let us know if they have any effect.
To resolve the linker warnings, try the following:
Open makefile.defs and find the line that reads:
BOOST_LIBRARIES=-lboost_date_time -lboost_regex -lboost_serialization -lz
Change it to read (all on one line):
BOOST_LIBRARIES=-Wl,--no-whole-archive -lboost_date_time -lboost_regex
-lboost_serialization -lz
This may eliminate the linker warnings you are seeing (symbol defined in
discarded section).
The undefined symbol you are seeing suggest that you are linking to the
C/C++ standard library statically. Flexus needs to be dynamically linked.
To force dynamic linking, try the following:
Open up makefile.defs. Find the following line:
GCC_SIMICS_LFLAGS=-shared -export-dynamic -Wl,--whole-archive
Change it to read (all on one line):
GCC_SIMICS_LFLAGS=-Wl,-Bdynamic -shared -export-dynamic
-Wl,--whole-archive
If adding this flag does not fix the undefined symbol errors, please send
us the output of make again.
Best Regards,
-Tom Wenisch
Computer Architecture Lab
Carnegie Mellon University
On Fri, 15 Jul 2005, Shachar Gang wrote:
> Hi,
>
> I downloaded the flexus version 1.0.2 and followed the Getting-started
> guide.
>
> When trying to run "make CMPFlex" I encountered a linking problem.
> This is the output on my screen:
>
<snip output of make>
>
>
> Can anyone help me?
>
> Thanks,
> Shachar Gang
>
From twenisch at ece.cmu.edu Fri Jul 15 19:12:03 2005
From: twenisch at ece.cmu.edu (Thomas Wenisch)
List-Post: [email protected]
Date: Fri Jul 15 19:11:43 2005
Subject: [Simflex] Instructions for getting started with Flexus on x86
In-Reply-To:
<pine.lnx.4.53l-ece.cmu.edu.0507141308460.28...@dalmore.ece.cmu.edu>
References: <[email protected]>
<pine.lnx.4.53l-ece.cmu.edu.0507141308460.28...@dalmore.ece.cmu.edu>
Message-ID: <[email protected]>
On Thu, 14 Jul 2005, Thomas Wenisch wrote:
> Hi Gilles,
>
> We do not have a test program and documentation created for x86. However,
> I will put together instructions on how to run Flexus with any x86
> application you already have available (or, if all else fails, some
> standard Unix utility). I will send it to you later this afternoon.
Begin by following the Flexus Getting Started Guide up to the "Building
simulators" step as usual. Be sure to use Flexus 1.0.2, as earlier
versions do not support x86.
To build a uniprocessor simulator for x86:
make UniFlex-x86
If you need CMP simulation, you will need to change SUPPORTS_X86 to true
in simulators/CMPFlex/Makefile.CMPFlex. Note that I have not tested CMP
simulation on x86, but I am unaware of any reason it would not work.
The "interactive" script that we distribute with our sparc test
application automates the steps neccessary to load a benchmark and Flexus
into simics. I will walk you through the steps that the script carries
out, but I suggest you look at flexus-test-app/interactive to understand
what it is doing and use it as a starting point for your own scripts for
x86 benchmarks that you set up.
First, you need to create or obtain a Simics checkpoint that is positioned
at the point where you want to start simulating with Flexus (e.g., at the
start of a benchmark or at a SimPoint). You can obtain disk images for a
number of Linux distributions from Virtutech's download page
(www.simics.net). Use the instructions that Virtutech provides to install
benchmarks into the simulated machine and create Simics checkpoints.
Once you have a checkpoint that runs properly without Flexus, you can try
running from the checkpoint with Flexus. Build UniFlex-x86 as described
above. The result of the build is a shared library file called
simulators/UniFlex/libflexus_UniFlex_x86_iface_gcc.so. This file is a
plug-in module that can be loaded into Simics. Simics looks for plug-in
modules in simics/x86-linux/lib. You must copy
libflexus_UniFlex_x86_iface_gcc.so to that directory. (The interactive
script uses a slightly more clever solution - it creates a copy of the
simics directory structure in a temporary directory. This avoids a number
of problems associated with writing to Simics lib directory).
Next, start Simics and load the checkpoint for your test application.
Simics should automatically find the flexus module in its lib directory.
To confirm this, issue the simics command "list-modules". You should see
the module "flexus-UniFlex-x86-iface-gcc" in the list of modules. Load
the module with "load-module flexus-UniFlex-x86-iface-gcc". Flexus should
load, and you should see a bunch of output.
At this point, you can issue Flexus commands to change the simulator
configuration, or go ahead and start the simulation. All Flexus commands
start with "flexus." and have brief descriptions that hopefully will help
you determine what they do (we are working on documenting all of these).
Of particular interest are "flexus.print-configuration" and "flexus.set",
which you can use to modify the simulated machine configuration. We
generally create Simics command files that configure the simulator (take a
look at the scripts in flexus-test-app/config for ideas on how to do
this).
Once you start the simulation with "run", the UniFlex in-order timing
model will control the progress of time in Simics. A clock cycle in
Flexus will correspond to precisely two cycles in Simics. You can stop
the simulation at any time with CTRL-C, or programmatically in a variety
of ways (e.g., flexus.set-stop-cycle. Also, take a look at the
capabilities of the MagicBreak component).
Flexus collects a variety of statistics in an in-memory stats database.
There are a variety of commands that can manipulate the database (e.g.,
print out stats) within Simics, and the database can also be saved to disk
and manipulated with the stat-manager tool. To get you started, you can
print every stat that is collected over the entire simulation with the
command "flexus.print-measurement all"
The above procedure should get you as far with x86 as the Getting Started
Guide will get you with Sparc. Once you get this far, I am sure you will
have more questions, which I will do my best to answer.
Please keep sending questions to me (or the SimFlex list). Questions are
a good motivator for us to get documentation written.
Best Regards,
-Tom Wenisch
Computer Architecture Lab
Carnegie Mellon University