Skip to content

Commit

Permalink
Revert "Merge branch 'master' into stable"
Browse files Browse the repository at this point in the history
This reverts commit 0bb225b, reversing
changes made to 7fe4265.
  • Loading branch information
bubnikv committed Jan 4, 2018
1 parent 0bb225b commit b93d265
Show file tree
Hide file tree
Showing 204 changed files with 3,879 additions and 24,718 deletions.
2 changes: 0 additions & 2 deletions Build.PL
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ my %prereqs = qw(
Devel::CheckLib 0
ExtUtils::MakeMaker 6.80
ExtUtils::ParseXS 3.22
ExtUtils::XSpp 0
ExtUtils::Typemaps 0
File::Basename 0
File::Spec 0
Getopt::Long 0
Expand Down
661 changes: 0 additions & 661 deletions LICENSE

This file was deleted.

2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,6 @@ The author of the Silk icon set is Mark James.
--gui Forces the GUI launch instead of command line slicing (if you
supply a model file, it will be loaded into the plater)
--no-plater Disable the plater tab
--no-gui Forces the command line slicing instead of gui.
This takes precedence over --gui if both are present.
--autosave <file> Automatically export current configuration to the specified file

Output options:
Expand Down
51 changes: 4 additions & 47 deletions doc/How_to_build_Slic3r.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
How to build Slic3r on Mac OS X 10.9 Maveric
How to build Slic3r on Mac OS X 10.7 Lion 64bit
---------------------------------------------
Vojtech Bubnik, 2017-12-12
Vojtech Bubnik, 2016-04-26


1) Install Mac OS X 10.7 Lion 64 bit with X Code
Expand Down Expand Up @@ -55,41 +55,25 @@ brew install boost --universal
Install dylibbundler tool. The dylibbundler tool serves to collect dependent dynamic libraries and fix their linkage. Execute
brew install dylibbundler

Install cmake
brew install cmake

3) Install perl
---------------

We don't want to distribute perl pre-installed on the Mac OS box. First, the system perl installation is not correct on some Mac OS versions, second it is not rellocatable. To compile a 64bit rellocatable perl, we use the perlbrew distribution. The perlbrew distribution installs into a user home directory and it allows switching between multiple versions of perl.
http://perlbrew.pl/

First install perlbrew
curl -L http://install.perlbrew.pl | bash
\curl -L http://install.perlbrew.pl | bash
Then compile the newest perl with the rellocatable @INC path and with multithreading enabled, execute following line:
perlbrew install --threads -Duserelocatableinc --switch perl-5.26.1
perlbrew install --threads -Duserelocatableinc --switch perl-5.22.0
The --switch parameter switches the active perl to the currently compiled one.
Available perl versions could be listed by calling
perlbrew available
Switch to the newly compiled perl
perl5/perlbrew/bin/perlbrew switch perl-5.26.1
Install cpanm
perlbrew install-cpanm

Initialize CPAN, install PAR and PAR::Packer modules
execute cpan command, from the cpan prompt, run
install App::cpanminus
install ExtUtils::CppGuess
install ExtUtils::Typemaps
install ExtUtils::Typemaps::Basic
install PAR
install PAR::Packer
install Module::Build
install Module::Pluggable
install Module::Runtime
install Moo
install Test::Pod
install Test::Pod::Coverage
quit

4) Download and install Slic3r
Expand All @@ -108,21 +92,6 @@ to have the model sliced.
5) Download and compile the GUI libraries needed to execute Slic3r in GUI mode
------------------------------------------------------------------------------

Building the Perl Alien-Wx containing a wxWidgets library:
We use wxWidgets-3.0.3.
patch wxWidgets-3.0.3//src/osx/cocoa/textctrl.mm , see https://github.com/prusa3d/Slic3r/issues/600
perl -I. Build.PL --wxWidgets-extraflags="--with-osx_cocoa --with-macosx-version-min=10.9 --with-macosx-sdk=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk --with-libjpeg=builtin --with-libpng=builtin --with-regex=builtin --with-libtiff=builtin --with-zlib=builtin --with-expat=builtin --with-opengl"
perl -I. Build
perl -I. Build test
perl -I. Build

Building the Perl Wx package:
cpan install Wx

Building the Perl OpenGL package:
OpenGL needs to be patched to support MSAA, see the Windows patch.


For the current Slic3r 1.2.30 code base, set the environment variable SLIC3R_STATIC to link a static version of the boost library:
export SLIC3R_STATIC=1

Expand Down Expand Up @@ -302,15 +271,3 @@ Debugging the C++ code works fine using the latest Eclipse for C++ and the gdb o
It is yet a bit more complicated. The Strawberry MINGW is compiled for a different C++ exception passing model (SJLJ) than the other MINGWs, so one cannot simply combine MINGWs on Windows. For an unknown reason the nice debugger of the QT Creator hangs when debugging the C++ compiled by the Strawberry MINGW. Mabe it is because of the different exception passing models.

And to disable optimization of the C/C++ code, one has to manually modify Config_heavy.pl in the Perl central installation. The SLIC3R_DEBUG environment variable did not override all the -O2 and -O3 flags that the perl build adds the gcc execution line.

----------------------------------------------------------------------

Building boost.

One may save compilation time by compiling just what Slic3r needs.
./bootstrap.sh --with-libraries=system,filesystem,thread,log,locale,regex
The -fPIC flag is required on Linux to make the static libraries rellocatable,
so they could be embedded into a shared library.
It is important to disable boost.locale.icu=off when compiling the static boost library.
./bjam -a link=static variant=release threading=multi boost.locale.icu=off --with-locale cxxflags=-fPIC cflags=-fPIC
To install on Linux to /usr/local/..., run the line above with the additional install keyword and with sudo.
31 changes: 17 additions & 14 deletions lib/Slic3r.pm
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,25 @@ sub debugf {
our $loglevel = 0;

# load threads before Moo as required by it
our $have_threads;
BEGIN {
# Test, whether the perl was compiled with ithreads support and ithreads actually work.
use Config;
$have_threads = $Config{useithreads} && eval "use threads; use threads::shared; use Thread::Queue; 1";
warn "threads.pm >= 1.96 is required, please update\n" if $have_threads && $threads::VERSION < 1.96;

### temporarily disable threads if using the broken Moo version
use Moo;
my $have_threads = $Config{useithreads} && eval "use threads; use threads::shared; use Thread::Queue; 1";
die "Slic3r Prusa Edition requires working Perl threads.\n" if ! $have_threads;
die "threads.pm >= 1.96 is required, please update\n" if $threads::VERSION < 1.96;
die "Perl threading is broken with this Moo version: " . $Moo::VERSION . "\n" if $Moo::VERSION == 1.003000;
$have_threads = 0 if $Moo::VERSION == 1.003000;

# Disable multi threading completely by an environment value.
# This is useful for debugging as the Perl debugger does not work
# in multi-threaded context at all.
# A good interactive perl debugger is the ActiveState Komodo IDE
# or the EPIC http://www.epic-ide.org/
$have_threads = 0 if (defined($ENV{'SLIC3R_SINGLETHREADED'}) && $ENV{'SLIC3R_SINGLETHREADED'} == 1);
print "Threading disabled\n" if !$have_threads;

$debug = 1 if (defined($ENV{'SLIC3R_DEBUGOUT'}) && $ENV{'SLIC3R_DEBUGOUT'} == 1);
print "Debugging output enabled\n" if $debug;
}
Expand All @@ -39,10 +50,8 @@ warn "Running Slic3r under Perl 5.16 is neither supported nor recommended\n"
if $^V == v5.16;

use FindBin;

# Let the XS module know where the GUI resources reside.
set_resources_dir(decode_path($FindBin::Bin) . (($^O eq 'darwin') ? '/../Resources' : '/resources'));
set_var_dir(resources_dir() . "/icons");
# Path to the images.
our $var = sub { decode_path($FindBin::Bin) . "/var/" . $_[0] };

use Moo 1.003001;

Expand Down Expand Up @@ -80,10 +89,6 @@ my $paused = 0;
$Slic3r::loglevel = (defined($ENV{'SLIC3R_LOGLEVEL'}) && $ENV{'SLIC3R_LOGLEVEL'} =~ /^[1-9]/) ? $ENV{'SLIC3R_LOGLEVEL'} : 0;
set_logging_level($Slic3r::loglevel);

# Let the palceholder parser evaluate one expression to initialize its local static macro_processor
# class instance in a thread safe manner.
Slic3r::GCode::PlaceholderParser->new->evaluate_boolean_expression('1==1');

sub spawn_thread {
my ($cb) = @_;
@_ = ();
Expand Down Expand Up @@ -158,8 +163,6 @@ sub thread_cleanup {
*Slic3r::Surface::Collection::DESTROY = sub {};
*Slic3r::Print::SupportMaterial2::DESTROY = sub {};
*Slic3r::TriangleMesh::DESTROY = sub {};
*Slic3r::GUI::AppConfig::DESTROY = sub {};
*Slic3r::GUI::PresetBundle::DESTROY = sub {};
return undef; # this prevents a "Scalars leaked" warning
}

Expand Down
Loading

0 comments on commit b93d265

Please sign in to comment.