-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Running Slic3r from git on OS X
This page contains instructions on how to run the latest Slic3r from git on Apple OS X. The instructions have been verified to work on OS X Lion (10.7) and OS X Mountain Lion (10.8). Please notice that following these instructions are not needed for running the binary releases of Slic3r for OS X available from slic3r.org.
The perl install via perlbrew instructions are what the OSX build server uses.
There are two ways to install the necessary command line tools (git, cc, ...) for installing Slic3r and its dependencies on OS X. Both require creating a free Apple ID.
One option is to install the full, graphical Xcode IDE (version 4.3 or later), which includes an option to install the necessary command line tools:
- Download and install Xcode from the Mac App Store
- Launch Xcode.app
- Open Preferences and install the Command Line Tools from the Downloads tab
Another option is to install the stand-alone Command Line Tools for Xcode:
- Download and install Command Line Tools for Xcode
- Install perlbrew:
\curl -L https://install.perlbrew.pl | bash
- Copy the
source
statement given to you by perlbrew's output to your ~/.bash_profile - Close and reopen the terminal.
- Copy the
- Compile Perl
- OSX 10.12 (MacOS Sierra or higher)
- Use the following command line setup: (paste into command line)
- OSX 10.12 (MacOS Sierra or higher)
PERLBREW_CONFIGURE_FLAGS='-de -Dccflags="-mmacosx-version-min=10.12 -fno-common -DPERL_DARWIN -fno-strict-aliasing -pipe -fstack-protector" \
-Dccdlflags="-mmacosx-version-min=10.12" \
-Dldflags="-mmacosx-version-min=10.12 -fstack-protector" \
-Dlddlflags="-mmacosx-version-min=10.12 -bundle -undefined dynamic_lookup -fstack-protector"' \
perlbrew install perl-blead --thread --64all -j 2 --as threaded-perl-blead --force
* OSX 10.7-10.11
* Install perl`perlbrew install perl-5.24.0 -Dusethreads -Duselargefiles -Dcccdlflags=-fPIC -Doptimize=-O2 --as threaded-perl-5.24.0`
* Switch to the built perl: `perlbrew switch <perl name>`
- Download Boost 1.59 from http://www.boost.org/users/history/version_1_59_0.html - use the unix download.
- Extract to
~/boost_1_59
.cd ~/boost_1_59
./bootstrap.sh
./b2 link=static runtime-link=static variant=release
- Wait.
- Run the following instructions:
git clone git://github.com/alexrj/Slic3r
cd Slic3r
BOOST_DIR=~/boost_1_59 SLIC3R_STATIC=1 perl Build.PL
perl Build.PL --gui
- Archive a copy of the local-lib directory to avoid having to rebuild Slic3r dependencies if the Slic3r directory gets deleted.
- Newer versions of OS X (Maverick) have perl 5.16 as default with which Slic3r is not supported.
The default can be changed with:
defaults write com.apple.versioner.perl Version 5.12
- Command Line Tools can be installed with: xcode-select --install
Your build may fail in the last step (building GUI) on El Capitan with message similar to this:
Building and testing Alien-wxWidgets-0.67 ... FAIL
! Installing Alien::wxWidgets failed. See /Users/yourname/.cpanm/work/1464795363.4904/build.log for details.
Retry with --force to force install it.
That means you should install wxMac first by running:
brew install wxmac
If you have homebrew installed, use brew install boost --universal
. Otherwise you can use MacPorts or any other method you know.
To instead install the Slic3r dependencies as root, execute the following steps:
git clone git://github.com/alexrj/Slic3r
cd Slic3r
sudo cpan local::lib
perl Build.PL
perl Build.PL --gui
An easy way to update only your locally installed modules is to parse the output of perldoc perllocal
and pass the names of the locally installed modules to cpanm -i
:
perldoc -t perllocal | grep Module | sed -e 's/^.* "Module" //' -e 's/-/::/g' | sort | uniq | xargs cpanm -i
- If you have installed perl via MacPorts and the build fails, try using the original OS X version of perl (/usr/bin/perl).
- If the build still fails, install the dependencies manually. This should fix issues with newer OS X versions.
- Consider using perlbrew https://perlbrew.pl/