OVP Forums - A community of assistance, help, questions, and answers.
  FAQFAQ    SearchSearch      RegisterRegister  ProfileProfile    Log in to check your private messagesLog in to check your private messages    Log inLog in
HelloWorld UsingICM make platform

 
Post new topic   Reply to topic    Open Virtual Platforms Forum Index -> First time - readme
View previous topic :: View next topic  
Author Message
MarcMurphy



Joined: 13 Aug 2018
Posts: 4

PostPosted: Sat Aug 18, 2018 8:16 am    Post subject: HelloWorld UsingICM make platform Reply with quote

First time trying the HelloWorld. Application builds. I believe the platform needs to be built. I don't know make, but I think (somehow) the Makefile was incomplete as downloaded. Here's the entire content of the Makefile in the platform folder:

IMPERAS_HOME := $(shell getpath.exe "$(IMPERAS_HOME)")

NOVLNV?=1
SRC=platform.c
include $(IMPERAS_HOME)/ImperasLib/buildutils/Makefile.platform

Here's the output from example.sh:

$ example.sh
make: Entering directory `/c/Imperas/Examples/HelloWorld/usingicm/application'
Compiling application.c
Linking application.OR1K.elf
rm application.o
make: Leaving directory `/c/Imperas/Examples/HelloWorld/usingicm/application'
make: Entering directory `/c/Imperas/Examples/HelloWorld/usingicm/platform'
# Host Depending obj/Windows32/platform.d
make: gcc: Command not found
# Host Compiling Platform obj/Windows32/platform.o
make: gcc: Command not found
make: *** [obj/Windows32/platform.o] Error 127
make: Leaving directory `/c/Imperas/Examples/HelloWorld/usingicm/platform'
./example.sh: line 18: platform/platform.Windows32.exe: No such file or directory



If the platform Makefile I have is complete, can someone post the content of that file?
Back to top
View user's profile Send private message
MarcMurphy



Joined: 13 Aug 2018
Posts: 4

PostPosted: Sat Aug 18, 2018 8:55 am    Post subject: Reply with quote

Oops! Now I see the include for the Makefile in the buildutils.
Apparently gcc was not defined because IMPERAS_ARCH was Windows32 (Makefile.include in \Imperasl\bin says ifeq ($(IMPERAS_ARCH), Windows32) HOST_PREFIX= endif). So I set IMPERAS_ARCH=Windows64 and got the following from the platform make:

mbmur@DESKTOP-EO25R6K /c/Imperas/Examples/HelloWorld/usingicm/platform
$ make
# Host Depending obj/Windows64/platform.d
# Host Compiling Platform obj/Windows64/platform.o
# Host Linking Platform platform.Windows64.exe
c:/mingw_toolchains/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/4.4.7/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lRuntimeLoader
collect2: ld returned 1 exit status
make: *** [platform.Windows64.exe] Error 1
Back to top
View user's profile Send private message
DuncGrah
OVP Technologist
OVP Technologist


Joined: 27 Feb 2008
Posts: 1639
Location: United Kingdom

PostPosted: Mon Aug 20, 2018 7:09 am    Post subject: Reply with quote

Hi,

When you install on a Windows host the environment should be setup for you, so you should not need to be setting IMPERAS_ARCH. The fact that you think you need to indicates a possible installation or setup issue.

When you installed did you find the document "Installation and getting Started"?

Can you perform the installation checks suggested in section 8 "Getting Started"?

What host and operating system have you installed on?
Back to top
View user's profile Send private message Visit poster's website
MarcMurphy



Joined: 13 Aug 2018
Posts: 4

PostPosted: Mon Aug 20, 2018 7:43 am    Post subject: Reply with quote

Hi,

I was using the Installation and getting Started doc. I'm running Windows 10. I attempted to run the example.sh in the HelloWorld (usingICM?) path. When IMPERAS_ARCH is set to Windows32 (as it is set by the installation) the application builds and produces the ELF file. However, the platform does not build. The platform make file cannot find GCC

make: gcc: Command not found

I noticed in the makefile for the platform that HOST_PREFIX is not set to anything when IMPERAS_ARCH is Windows32. In the file Makefile.include in \Imperasl\bin there's a conditional like this:

ifeq ($(IMPERAS_ARCH), Windows32) HOST_PREFIX= endif).

So in desperation I set IMPERAS_ARCH=Windows64 because in Makefile.include it does set HOST_PREFIX. I believe this compiles the platform, but the ld.exe (linker or loader?) fails because it can't find a library -lruntimeloader(?).


Why would Makefile.include not set HOST_PREFIX for Windows32?
I will go through the Section 8 Getting Started.
Back to top
View user's profile Send private message
DuncGrah
OVP Technologist
OVP Technologist


Joined: 27 Feb 2008
Posts: 1639
Location: United Kingdom

PostPosted: Mon Aug 20, 2018 8:15 am    Post subject: Reply with quote

Ok, I understand what you are saying but it is fine that the HOST_PREFIX is not set, this is used to generate the correct GCC variable that will be used later in the Makefiles.

The IMPERAS_ARCH must be set correctly for the host installation used e.g. Windows32 for a Windows 32-bit host installation otherwise you will find all sorts of other problems later ;-)

Have you installed the MINGW host cross compiler as referenced in the Installation Guide (section 6.2.2 Installation of MinGW 32-bit and 64-bit Toolchains) and available from the OVP website
Back to top
View user's profile Send private message Visit poster's website
MarcMurphy



Joined: 13 Aug 2018
Posts: 4

PostPosted: Mon Aug 20, 2018 8:30 am    Post subject: Reply with quote

Yes, I installed MINGW into it's own folder c:\minGW_Toolchains. I recall that I chose mingw-w64-bin_i686-mingw_20111031_sezero.zip. Maybe I should have chosen the zip file for 32bit? Or both?

I don't have my installation in front of me at the moment. I was working at home. I assume the toolchains have compilers/linkers that target various processors. What should the 32 vs 64 bit correspond to? My PC has a Windows 10 64bit OS.

Thank you for your continued assistance.
Back to top
View user's profile Send private message
DuncGrah
OVP Technologist
OVP Technologist


Joined: 27 Feb 2008
Posts: 1639
Location: United Kingdom

PostPosted: Mon Aug 20, 2018 8:46 am    Post subject: Reply with quote

These zip files both contain host compilers/linkers and target the x86 processor of the host machine.

For a Windows 32-bit host host mingw-w32-bin_i686-mingw_20111031_sezero.zip should be installed.

For a Windows 64-bit host host mingw-w64-bin_i686-mingw_20111031_sezero.zip should be installed and the Windows-32 bit can also be installed should you want to build and run as 32-bit host executable.

You must also make sure you add the bin directories to your PATH variable so that the GCC exe can be found.

If you are wanting to Cross Compile applications to target other processors e.g. ARM, MIPS, RISCV that will be used in a virtual platform simulation you need to download and install separate cross compilers for each target processor.

NOTE: Your machine is a 64-bit host BUT OVP (currently) only provides 32-bit installations so you are restricted to 32-bit host executable.
The Imperas professional products provide 64-bit host installations.
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Open Virtual Platforms Forum Index -> First time - readme All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Information regarding OVP © 2008-2022 Imperas Software