Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do you compile a Pharo VM without an image?

I have already cloned the VM and installed all dependencies for my platform. Now I am a bit confused because a couple of guides suggests that Pharo image should be started to generate the C sources translated from Slang.

"Unix"
PharoVMBuilder buildUnix32.
"OSX"
PharoVMBuilder buildMacOSX32.
"Windows"
PharoVMBuilder buildWin32.

But how you generate a VM when you cannot start a VM in your platform? This sounds like chicken and egg problem.

This means is not possible to build a VM if you cannot start an image in that platform?

like image 504
user1000565 Avatar asked Mar 16 '14 06:03

user1000565


2 Answers

If you download pre-generated sources from the CI server as suggested by Esteban, you don't need the pharo-vm sources cloned from any repository. Just uncompress in a new folder and build from there.

Assuming you have your new sources in c:\phs, open directories.cmake and rename the hardcoded path as follows:

set(topDir "c:/phs/")
set(buildDir "c:/phs/build")
set(thirdpartyDir "${buildDir}/thirdparty")
set(platformsDir "c:/phs/platforms")
set(srcDir "c:/phs/src")
set(srcPluginsDir "${srcDir}/plugins")
set(srcVMDir "${srcDir}/vm")
set(platformName "win32")
set(targetPlatform ${platformsDir}/${platformName})
set(crossDir "${platformsDir}/Cross")
set(platformVMDir "${targetPlatform}/vm")
set(outputDir "c:/phs/results")

As you could not start a VM, I suppose you need to change at least the compilation flags used to generate the sources in the CI server. They are in c:\phs\build\CMakeLists.txt specially the following flags:

  • -march=... (your processor architecture, search for Safe Cflags)
  • Removing -g0 which suppress debug options
  • Remove -O2 (optimizations)
  • Remove -DNDEBUG
  • Modify -DDEBUGVM=0 to -DDEBUGVM=1

and finally start the build script

cd /c/phs/build
bash build.sh
like image 117
Hernán Avatar answered Nov 20 '22 02:11

Hernán


You need to pre-generate the sources outside or take pre-generated sources from other place.

Let's assume you want to compile a kind of unix, you can download pre-generated sources from here:

https://ci.inria.fr/pharo/view/3.0-VM/job/PharoSVM/Architecture=32,Slave=vm-builder-linux/lastSuccessfulBuild/artifact/sources.tar.gz (for a stack vm)

https://ci.inria.fr/pharo/view/3.0-VM/job/PharoVM/Architecture=32,Slave=vm-builder-linux/lastSuccessfulBuild/artifact/sources.tar.gz (for a cog vm)

like image 32
EstebanLM Avatar answered Nov 20 '22 02:11

EstebanLM