Skip to content

Instantly share code, notes, and snippets.

@fujin
Last active July 22, 2019 08:38
Show Gist options
  • Save fujin/78e3ebda0f6c39d23ce1bb2a904db83c to your computer and use it in GitHub Desktop.
Save fujin/78e3ebda0f6c39d23ce1bb2a904db83c to your computer and use it in GitHub Desktop.
PrusaSlicer build steps (macOS - 11/06/2019)
#!/usr/bin/env bash
# For `nproc`
brew install coreutils
# this is 2019_U6, but the cmake script doesn't find it - specify TBB_LIBRARIES_RELEASE as an arg to cmake, with `-D`
brew install tbb
# The BOOST_REQUIRED_VERSION in PrusaSlicer is 1.64, but that is quite old,
# and has been removed from the homebrew-core formula repo.
# I took the old 1.64 formula from here: https://github.com/Homebrew/homebrew-core/blob/3df9cdfc25f796ec8d3ffd0a0a12476cf6d413d5/Formula/boost.rb
# and put it on a Gist to streamline the install process.
#
# Be sure to read the homebrew formula if you are concerned.
brew install https://gist.github.com/fujin/8f791d879901586b683fff655655425a/raw/fc63d3df397f9340f06a358a8644cff0ba108637/boost.rb
# the version 3.0.4 is too old, so remove the old one, and install from Git repository HEAD (compile - takes 11min.)
brew uninstall wxwidgets && \
brew install wxwidgets --HEAD
#!/usr/bin/env bash
mkdir build
cd build
# Fetch some non-brew deps, build them, point cmake at TBB, and an macOS specific compiler flag requirement.
# If you want to build a DEBUG build, specify -DTBB_LIBRARIES_DEBUG.
# Note that COMPILE_FLAGS is not used for the actual build; but one of the tests cmake performs.
cmake .. -DTBB_LIBRARIES_RELEASE=/usr/local/Cellar/tbb/2019_U6/lib/libtbb.dylib -DCMAKE_PREFIX_PATH="${PWD}/../deps/build/destdir/usr/local" -DCOMPILE_FLAGS="-fdeclspec"
# Build/download deps etc, non-parallel.
time make
# Alternatively, for parallel compilation
# time make -j $(nproc)
@domesticatedviking
Copy link

You should not need to give execute permissions (+x) or ./ if run with bash foo.sh, but that way is also fine :-)

Apologies, I could have sworn that there was no "bash" on that line. And the part about permissions not being required when invoking .sh scripts that way? Yeah, I didn't know that. Thanks!

@kenjichanhkg
Copy link

I had to change code in BonjourDialog.cpp to get it compiled, I got this error
PrusaSlicer/src/slic3r/GUI/BonjourDialog.cpp:111:15: error: no matching constructor for initialization of 'wxTimerEvent'
wxTimerEvent evt_dummy;

I have to change
wxTimerEvent evt_dummy;
to
wxTimerEvent evt_dummy(*timer);

any idea, why?

@kenjichanhkg
Copy link

also, my TBB is 2019_U8, not 2019_U6

@kenjichanhkg
Copy link

and the GL view is not working
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment