What is the current state of the simulator?

I ave been spoilt with FemtoIDE but now need to try the simulator but a quick look at the posts in this category and the deprecated repo (https://github.com/pokitto/PokittoSim) have left me guessing what I need to do.

I have a Mac and would love to continue working on it.

I like FemtoIDE as well and see it has a simulator function but when I try ti start the code I get an error ‘Project has no darwin pipeline’

The simulator works in Femto under Linux and Windows :wink: I use it all the time.

You might know it already but here is the catch: The “Simulator” menu is not needed for building and running the simulator. It is actually “Simulator debug”, and needed only for debugging.

For building and running the Simulator, you need to select your OS from the selection list at the end of the menu bar (“Linux” for me). Then you can normally select from the “Build” menu: “Build & Run”.

Ps. Do not ask what “Build(debug)” does in the “Build” menu in this case…:wink:

Thanks @Hanski for the quick reply.

I only have the ‘Pokitto’ and ‘Darwin’ under that menu on my Mac.

When I select Darwin, I get the ‘Project has no darwin pipeline’ error.

Maybe another Mac user may be able to chip in? Or @FManga??

There isn’t a solid config yet for compiling in sim mode on mac. Using a virtual box I’ve been able to get it working. Will have to dig up the details on how I got it to work.

I’m actually using Xcode to build the simulator version on macOS. I had to make a clanky project to do so.

  • You need to install Xcode of course. It takes a lot of times, depending on your connexion.
  • To the contrary of FemtoIDE, every time you add a cpp file you’ll have to add it to the Xcode project as well.
    • That means every relevant file of the Pokitto Core/Libs/Sim will have to be included as compilation units.
  • It needs the SDL2 framework somewhere so it can be compiled with. I used a symbolic link to do so
  • The logs will be polluted a bit by errors from misuses of SDL2 / cocoa.

On the bright side:

  • Xcode’s autocompletion for C++ is excellent (handles template with ease)
  • Debugger support is great as well
  • Xcode support compilation dependencies, which means the following:
    • it won’t recompile the whole pokitto lib if you modified on of its files
    • changing my_Settings.h will recompile every relevant file

The compilation time seems to be the same once you’ve compiled the Pokitto Lib on FemtoIDE.

It’s definitely far from being the everything-works-out-of-the-box way like FemtoIDE. I’m still glad I did it tho.
Possibly the Xcode project can be shared - I duplicated ARIAT’s one for Miaou’s project - but you’ll need to change names, remove useless/non-existing files and add the relevant ones :stuck_out_tongue:

That would be excellent … please have a look for me.

I am open to using XCode. I already have an older version on my machine so I guess I can update it and try. If you could share the project, that might help me.

Check that you can update your Xcode to version 11.5 first !

I can’t share my project without sharing all my sources. Let me make a minimal working example first (will be ready in less than a hour).
Meanwhile you can do the following:

  • Get SDL2.framework from the SDL website (there should be a download specific for Xcode)
  • Make sure you get a local repository of the Pokitto lib (you can also locate the one in FemtoIDE, but it’s inside the app and not very convenient)
  • Make sure you’ve updated Xcode to 11.5

I’ve finished a minimal example (a simple white target with 2 lines)
PokittoApp.zip (85.3 KB)

SDL2 Framework

  • Install the SDL2 by using the .dmg file from here: https://libsdl.org/download-2.0.php
  • Have a look inside the folder containing the Xcode project, and ThirdParty inside it.
  • (Note - Ignore the readme.txt inside - it’s wrong).
  • There is a symbolic link named SDL2.framework in ThirdParty.
  • You must make it point at the SDL2.framework which was installed by the dmg file.

Xcode project configuration

Let’s have a look at things you’ll have to change in the Xcode project:

  • Click on 1
  • Make sure the right side panel is open - if not, use the rightmost button at the topright (see yellow arrows pointing at what must be Blue).
  • Click on 2 - and locate your Pokitto Lib folder. It MUST contains the POKITTO_CORE, POKITTO_SIM, etc folders!

Note: the structure I used is a src/bin subfolders in the main femtoide project. You can use the same trick than for adjusting the PokittoLib to point Xcode at the right src folder of your choice (Identity&Type, Location)!

Last check

At this point if I’m not mistaken, no file in the project (expect the not-yet-built product) should be missing.

  • A missing file in Xcode is signaled by red text.

Try compiling!
If you’re seeing a couple of errors in the pokitto lib AND it’s not linker ones, congratulations, it’s almost working!

  • I just made a pull request to fix a last issue.

Last notes

  • It’s strongly advised you’re keeping the Xcode project outside of your source like I did. It tends to be quite polluting.
  • Removing a file from Xcode project will ask you to Remove its Reference (only from the Xcode project) or to Move it to the Trash (Both reference & the file).
  • When adding a folder/files from outside of the project, uncheck “Copy items if needed” to make sure you’re only referencing files. Do select “Create groups” or the file won’t be added properly.
  • If a file isn’t compiling, make sure it’s checked in the “Target Membership” in the right panel!
    • they’re usually added to the target when you add them tho.

Voilà !

Excellent, thank you @carbonacat … I will try this over the weekend. I have upgraded to XCode version 12 - hope this isn’t an issue!

1 Like

it should be OK this way!

Tell me if you’re stuff

@carbonacat I didn’t get a chance to look at this last weekend. Will try again soon!