Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changes for macOS sim build #3

Merged
merged 7 commits into from
Aug 4, 2020

Conversation

thinkyhead
Copy link

@thinkyhead thinkyhead commented Jul 28, 2020

To get to the point of a macOS build I had to do the following things:

  • Install gcc10 and create symbolic links for cc, gcc, and g++ inside of /opt/local/bin so PlatformIO would find and use the gcc-mp-10 compiler.

  • Install some libraries with sudo port install gcc10 glew glm libsdl2 freetype.

  • Add a env:simulator_macos target with some extra paths.

  • Make sure the VSCode Terminal was using bash so it got my .profile with /opt/local/bin on the front of the $PATH

    • I had set VSCode to use zsh for the shell but since I never really set that up reverting to bash was in order.
  • Set "terminal.integrated.inheritEnv": true so system paths were not added by VSCode to the front of $PATH.

  • For the benefit of "Auto Build Marlin" env: prefix can be substituted with lin:, mac:, win:, or uni:.

@thinkyhead thinkyhead force-pushed the bf2_simulated_fun_PR branch 3 times, most recently from 7787846 to ee01f8d Compare July 30, 2020 06:49
@rhapsodyv
Copy link

I could get the simulator working on macOS 🥳

I fixed the U8glib too, without modifying it, using a section macro bellow.

Using this PR: platformio/platformio-core#3570

Plus this env:

[env:simulator_macos]
platform    = ${env:simulator_unix_debug.platform}
extends     = env:simulator_unix_debug
lib_ignore  = Adafruit NeoPixel
build_flags = ${env:simulator_unix_debug.build_flags}
  -D"'section(name)='"
  -I/opt/local/include
  -I/opt/local/include/freetype2
  -L/opt/local/lib
  -g -O0
  -lSDL2
  -D_THREAD_SAFE
  -Wl,-framework,OpenGl
  -Wl,-framework,CoreFoundation

@thinkyhead thinkyhead force-pushed the bf2_simulated_fun_PR branch 3 times, most recently from 92687e6 to 159eb55 Compare August 2, 2020 03:49
@thinkyhead
Copy link
Author

Thanks for the extra assistance and general guidance about the likely causes of my build woes. The bad link to g++ was really throwing me off there.

Now that the build is working well I can mess around with the sim and perhaps help make it look fancy. In particular I want to try and make a fixed camera that can see the whole print volume, and have the mouse-drag just rotate the "printer" in place. And add a speed throttle. Then I want to see about simple importers for STL, DXF, and other basic formats, so it can import models for rendering.

Hopefully I won't get too distracted by other Marlin issues….

@p3p
Copy link
Owner

p3p commented Aug 2, 2020

Thanks for the assistance with getting build functional on macOS and of course if there are any features you would like to implement go ahead, but there will be major changes and refactoring before this is a PR for Marlin, probably even moving all the simulator code and assets to an external library, so formatting changes and copyright notices probably wont be merged a this time. (I'm aware the code is a mess an understand your desire to tidy up though ;) I don't usually share things quite so early in the dev cycle)

Loading models and improving the renderer are in the works but I'm still mostly focused on making sure the simulation works correctly and has useful output, time scaling should already be available in the current build in realtime mode, and I'l be pushing the ability to switch between realtime and ISRstep timing mode later today.

@thinkyhead
Copy link
Author

understand your desire to tidy up

I'm happy to do a quick diff / apply on this to reduce it just to the platformio.ini changes….

@thinkyhead thinkyhead force-pushed the bf2_simulated_fun_PR branch 6 times, most recently from 9147adf to 55987de Compare August 3, 2020 22:22
@p3p p3p merged commit 6f3dfc8 into p3p:pr_linux_cleanup Aug 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants