-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Replace perls Wx dependency with C++ code #162
Comments
That's a great idea. Please provide a pull request. Now, jokes aside. It is quite a lot of work and there is no immediate benefit to the users of the official builds. The Perl is stable and the Perl wxWidgets are stable as well. There are currently more pressing issues, which have effect on the print quality, print time, usability etc. |
As I am a professional developer, I know that it is a lot of work. |
@alexrj just proposed couple of toppics for Google Summer of Code. One of these topics is the C++ port of the wxWidgets UI. I know @alexrj and @lordofhyphens did some initial experiments confirming, that you can merry the Perl and C++ wxWidgets together, allowing to port the UI piece by piece. I think you develop on OSX. I will be more than happy to help you getting your development environment up and running. Me personally, I ended up compiling the complete Perl and all dependencies using Visual Studio, so I am able to debug comfortably. It took me a working week or so to do that and it takes now about 4 hours to repeat the process. You should be able to do the same on OSX in about the same time frame (4 hours with my assistance). I am actually slowly reducing the number of Perl dependencies. For example, the recent commits removed the Perl Expat XML parser dependencies, last fall I removed the Perl Math::PlanarCurve or whatever it was (I happily forgot the name since it is gone). I think to lower the entry barrier, it would be sufficient to document the setup process well for now. I agree it would be better to have everything in C++, but it is not my priority. |
@bubnikv : If you would help me getting my development environment (mainly Perl) up and running, I would be happy to help with C++ migration. I will try another build this afternoon and report about the (eventual) failures occurring. |
@bubnikv: When I try to compile Slic3r on my iMac, it includes this file: /System/Library/Perl/5.18/darwin-thread-multi-2level/CORE/perl.h. The perl version used to compile is 5.24 (retrieved with perlbrew). Can you tell me, how you got it working on your build machine for the dmg images? |
slic3r/Slic3r#3717
I have been working on one of the small, but technically interesting bits.
I feel the rest of the UI is a straightforward port.
My primary dev environment is Linux.
|
My best guess is that you are not running perl from the perlbrew. What does
it tell you if you execute
perl -V
?
…On Wed, Mar 1, 2017 at 3:40 PM, freiser77 ***@***.***> wrote:
@bubnikv <https://github.com/bubnikv>: When I try to compile Slic3r on my
iMac, it includes this file: /System/Library/Perl/5.18/
darwin-thread-multi-2level/CORE/perl.h. The perl version used to compile
is 5.24 (retrieved with perlbrew). Can you tell me, how you got it working
on your build machine for the dmg images?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#162 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AFj5I6BbYm2vigCizBkMxmcPpY_pImDqks5rhYN3gaJpZM4MPUD->
.
|
Summary of my perl5 (revision 5 version 24 subversion 0) configuration: Platform: Characteristics of this binary (from libperl): |
You seem to have the PERL5LIB set correctly, but you are executing the
system perl. You need to update your PATH to point to the perlbrew's perl
first.
…On Wed, Mar 1, 2017 at 3:49 PM, freiser77 ***@***.***> wrote:
Summary of my perl5 (revision 5 version 24 subversion 0) configuration:
Platform:
osname=darwin, osvers=16.1.0, archname=darwin-thread-multi-2level
uname='darwin sierravm.local 16.1.0 darwin kernel version 16.1.0: thu oct
13 21:26:57 pdt 2016; root:xnu-3789.21.3~60release_x86_64 x86_64 '
config_args='-des -Dprefix=/usr/local/Cellar/perl/5.24.0_1
-Dprivlib=/usr/local/Cellar/perl/5.24.0_1/lib/perl5/5.24.0
-Dsitelib=/usr/local/Cellar/perl/5.24.0_1/lib/perl5/site_perl/5.24.0
-Dotherlibdirs=/usr/local/lib/perl5/site_perl/5.24.0
-Dperlpath=/usr/local/opt/perl/bin/perl -Dstartperl=#!/usr/local/opt/perl/bin/perl
-Dman1dir=/usr/local/Cellar/perl/5.24.0_1/share/man/man1
-Dman3dir=/usr/local/Cellar/perl/5.24.0_1/share/man/man3 -Duseshrplib
-Duselargefiles -Dusethreads'
hint=recommended, useposix=true, d_sigaction=define
useithreads=define, usemultiplicity=define
use64bitint=define, use64bitall=define, uselongdouble=undef
usemymalloc=n, bincompat5005=undef
Compiler:
cc='cc', ccflags ='-fno-common -DPERL_DARWIN -mmacosx-version-min=10.12
-fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include
-DPERL_USE_SAFE_PUTENV',
optimize='-O3',
cppflags='-fno-common -DPERL_DARWIN -mmacosx-version-min=10.12
-fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include'
ccversion='', gccversion='4.2.1 Compatible Apple LLVM 8.0.0
(clang-800.0.42.1)', gccosandvers=''
intsize=4, longsize=8, ptrsize=8, doublesize=8, byteorder=12345678,
doublekind=3
d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16,
longdblkind=3
ivtype='long', ivsize=8, nvtype='double', nvsize=8, Off_t='off_t',
lseeksize=8
alignbytes=8, prototype=define
Linker and Libraries:
ld='cc', ldflags =' -mmacosx-version-min=10.12 -fstack-protector-strong
-L/usr/local/lib'
libpth=/usr/local/lib /usr/include/libxml2 /Applications/Xcode.app/
Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/8.0.0/lib
/Applications/Xcode.app/Contents/Developer/Toolchains/
XcodeDefault.xctoolchain/usr/lib /Applications/Xcode.app/
Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/usr/lib
/usr/lib
libs=-lpthread -ldbm -ldl -lm -lutil -lc
perllibs=-lpthread -ldl -lm -lutil -lc
libc=, so=dylib, useshrplib=true, libperl=libperl.dylib
gnulibc_version=''
Dynamic Linking:
dlsrc=dl_dlopen.xs, dlext=bundle, d_dlsymun=undef, ccdlflags=' '
cccdlflags=' ', lddlflags=' -mmacosx-version-min=10.12 -bundle -undefined
dynamic_lookup -L/usr/local/lib -fstack-protector-strong'
Characteristics of this binary (from libperl):
Compile-time options: HAS_TIMES MULTIPLICITY PERLIO_LAYERS
PERL_COPY_ON_WRITE PERL_DONT_CREATE_GVSV
PERL_HASH_FUNC_ONE_AT_A_TIME_HARD
PERL_IMPLICIT_CONTEXT PERL_MALLOC_WRAP
PERL_PRESERVE_IVUV PERL_USE_SAFE_PUTENV
USE_64_BIT_ALL USE_64_BIT_INT USE_ITHREADS
USE_LARGE_FILES USE_LOCALE USE_LOCALE_COLLATE
USE_LOCALE_CTYPE USE_LOCALE_NUMERIC USE_LOCALE_TIME
USE_PERLIO USE_PERL_ATOF USE_REENTRANT_API
Built under darwin
Compiled at Nov 12 2016 16:10:25
%ENV:
PERL5LIB="/Volumes/LaCie/florian/perl5/lib/perl5"
PERL_LOCAL_LIB_ROOT="/Volumes/LaCie/florian/perl5"
PERL_MB_OPT="--install_base "/Volumes/LaCie/florian/perl5""
PERL_MM_OPT="INSTALL_BASE=/Volumes/LaCie/florian/perl5"
@inc <https://github.com/INC>:
/Volumes/LaCie/florian/perl5/lib/perl5/5.24.0/darwin-thread-multi-2level
/Volumes/LaCie/florian/perl5/lib/perl5/5.24.0
/Volumes/LaCie/florian/perl5/lib/perl5/darwin-thread-multi-2level
/Volumes/LaCie/florian/perl5/lib/perl5
/usr/local/Cellar/perl/5.24.0_1/lib/perl5/site_perl/5.24.0/
darwin-thread-multi-2level
/usr/local/Cellar/perl/5.24.0_1/lib/perl5/site_perl/5.24.0
/usr/local/Cellar/perl/5.24.0_1/lib/perl5/5.24.0/darwin-
thread-multi-2level
/usr/local/Cellar/perl/5.24.0_1/lib/perl5/5.24.0
/usr/local/lib/perl5/site_perl/5.24.0
.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#162 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AFj5I8CtITn3Tp9fKHoFNj0Tzw0hMlm6ks5rhYWQgaJpZM4MPUD->
.
|
You don't have the PERLBREW_XXX environment variables shown in your printout and your @inc differs significantly. If you check mine, they all point to the perlbrew directory. |
Did you add at the end of yours |
I've reinstall perl with perlbrew and reactivated perlbrew. Now perl -V shows the following
But the error is still the same:
|
For some reason your Build.PL is pulling wrong includes.
If you change xs/Build.PL and add at line 17
my @cflags = qw(....... -M)
This will instruct clang or gcc to display, which file includes which.
…On Wed, Mar 1, 2017 at 4:54 PM, freiser77 ***@***.***> wrote:
I've reinstall perl with perlbrew and reactivated perlbrew. Now perl -V
shows the following
Summary of my perl5 (revision 5 version 25 subversion 10) configuration:
Platform:
osname=darwin
osvers=16.4.0
archname=darwin-2level
uname='darwin florians-imac.local 16.4.0 darwin kernel version 16.4.0: thu dec 22 22:53:21 pst 2016; root:xnu-3789.41.3~3release_x86_64 x86_64 '
config_args='-de -Dprefix=/Volumes/LaCie/florian/perl5/perlbrew/perls/perl-5.25.10 -Dusedevel -Aeval:scriptdir=/Volumes/LaCie/florian/perl5/perlbrew/perls/perl-5.25.10/bin'
hint=recommended
useposix=true
d_sigaction=define
useithreads=undef
usemultiplicity=undef
use64bitint=define
use64bitall=define
uselongdouble=undef
usemymalloc=n
bincompat5005=undef
Compiler:
cc='cc'
ccflags ='-fno-common -DPERL_DARWIN -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include'
optimize='-O3'
cppflags='-fno-common -DPERL_DARWIN -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include'
ccversion=''
gccversion='4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.42.1)'
gccosandvers=''
intsize=4
longsize=8
ptrsize=8
doublesize=8
byteorder=12345678
doublekind=3
d_longlong=define
longlongsize=8
d_longdbl=define
longdblsize=16
longdblkind=3
ivtype='long'
ivsize=8
nvtype='double'
nvsize=8
Off_t='off_t'
lseeksize=8
alignbytes=8
prototype=define
Linker and Libraries:
ld='env MACOSX_DEPLOYMENT_TARGET=10.3 cc'
ldflags =' -fstack-protector-strong -L/usr/local/lib'
libpth=/usr/local/lib /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/8.0.0/lib /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib /usr/lib
libs=-lpthread -ldbm -ldl -lm -lutil -lc
perllibs=-lpthread -ldl -lm -lutil -lc
libc=
so=dylib
useshrplib=false
libperl=libperl.a
gnulibc_version=''
Dynamic Linking:
dlsrc=dl_dlopen.xs
dlext=bundle
d_dlsymun=undef
ccdlflags=' '
cccdlflags=' '
lddlflags=' -bundle -undefined dynamic_lookup -L/usr/local/lib -fstack-protector-strong'
Characteristics of this binary (from libperl):
Compile-time options:
HAS_TIMES
PERLIO_LAYERS
PERL_COPY_ON_WRITE
PERL_DONT_CREATE_GVSV
PERL_MALLOC_WRAP
PERL_OP_PARENT
PERL_PRESERVE_IVUV
PERL_USE_DEVEL
USE_64_BIT_ALL
USE_64_BIT_INT
USE_LARGE_FILES
USE_LOCALE
USE_LOCALE_COLLATE
USE_LOCALE_CTYPE
USE_LOCALE_NUMERIC
USE_LOCALE_TIME
USE_PERLIO
USE_PERL_ATOF
Locally applied patches:
Devel::PatchPerl 1.38
Built under darwin
Compiled at Mar 1 2017 16:31:40
%ENV:
PERL5LIB="/Volumes/LaCie/florian/perl5/lib/perl5"
PERLBREW_BASHRC_VERSION="0.78"
PERLBREW_HOME="/Volumes/LaCie/florian/.perlbrew"
PERLBREW_MANPATH="/Volumes/LaCie/florian/perl5/perlbrew/perls/perl-5.25.10/man"
PERLBREW_PATH="/Volumes/LaCie/florian/perl5/perlbrew/bin:/Volumes/LaCie/florian/perl5/perlbrew/perls/perl-5.25.10/bin"
PERLBREW_PERL="perl-5.25.10"
PERLBREW_ROOT="/Volumes/LaCie/florian/perl5/perlbrew"
PERLBREW_VERSION="0.78"
PERL_LOCAL_LIB_ROOT="/Volumes/LaCie/florian/perl5"
PERL_MB_OPT="--install_base "/Volumes/LaCie/florian/perl5""
PERL_MM_OPT="INSTALL_BASE=/Volumes/LaCie/florian/perl5"
@inc:
/Volumes/LaCie/florian/perl5/lib/perl5
/Volumes/LaCie/florian/perl5/perlbrew/perls/perl-5.25.10/lib/site_perl/5.25.10/darwin-2level
/Volumes/LaCie/florian/perl5/perlbrew/perls/perl-5.25.10/lib/site_perl/5.25.10
/Volumes/LaCie/florian/perl5/perlbrew/perls/perl-5.25.10/lib/5.25.10/darwin-2level
/Volumes/LaCie/florian/perl5/perlbrew/perls/perl-5.25.10/lib/5.25.10
.
But the error is still the same:
In file included from /System/Library/Perl/5.18/darwin-thread-multi-2level/CORE/perl.h:3476:
/System/Library/Perl/5.18/darwin-thread-multi-2level/CORE/pad.h:323:17: error: invalid suffix on literal; C++11 requires a space
between literal and identifier [-Wreserved-user-defined-literal]
"Pad 0x%"UVxf"[0x%"UVxf"] set_cur depth=%d\n", \
^
/System/Library/Perl/5.18/darwin-thread-multi-2level/CORE/pad.h:323:27: error: invalid suffix on literal; C++11 requires a space
between literal and identifier [-Wreserved-user-defined-literal]
"Pad 0x%"UVxf"[0x%"UVxf"] set_cur depth=%d\n", \
^
/System/Library/Perl/5.18/darwin-thread-multi-2level/CORE/pad.h:341:17: error: invalid suffix on literal; C++11 requires a space
between literal and identifier [-Wreserved-user-defined-literal]
"Pad 0x%"UVxf"[0x%"UVxf"] save_local\n", \
^
/System/Library/Perl/5.18/darwin-thread-multi-2level/CORE/pad.h:341:27: error: invalid suffix on literal; C++11 requires a space
between literal and identifier [-Wreserved-user-defined-literal]
"Pad 0x%"UVxf"[0x%"UVxf"] save_local\n", \
^
/System/Library/Perl/5.18/darwin-thread-multi-2level/CORE/pad.h:349:17: error: invalid suffix on literal; C++11 requires a space
between literal and identifier [-Wreserved-user-defined-literal]
"Pad 0x%"UVxf"[0x%"UVxf"] restore_local\n", \
^
/System/Library/Perl/5.18/darwin-thread-multi-2level/CORE/pad.h:349:27: error: invalid suffix on literal; C++11 requires a space
between literal and identifier [-Wreserved-user-defined-literal]
"Pad 0x%"UVxf"[0x%"UVxf"] restore_local\n", \
^
In file included from src/libslic3r/utils.cpp:66:
In file included from src/xsinit.h:39:
/System/Library/Perl/5.18/darwin-thread-multi-2level/CORE/perl.h:4257:37: error: invalid suffix on literal; C++11 requires a space
between literal and identifier [-Wreserved-user-defined-literal]
INIT("Use of uninitialized value%"SVf"%s%s");
^
/System/Library/Perl/5.18/darwin-thread-multi-2level/CORE/perl.h:4277:75: error: invalid suffix on literal; C++11 requires a space
between literal and identifier [-Wreserved-user-defined-literal]
INIT("Modification of non-creatable hash value attempted, subscript \"%"SVf"\"");
^
8 errors generated.
error building src/libslic3r/utils.o from 'src/libslic3r/utils.cpp' at /System/Library/Perl/5.18/ExtUtils/CBuilder/Base.pm line 177.
FAIL
! Installing ./xs failed. See /Volumes/LaCie/florian/.cpanm/work/1488382660.75657/build.log for details. Retry with --force to force install it.
The XS/C++ code failed to compile, aborting
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#162 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AFj5I82dkSSEjv9P3kRECgafwNDSDo9Hks5rhZS4gaJpZM4MPUD->
.
|
The last lines with the -M option set:
|
Frankly I don't fully understand the Perl build process, but it goes like
this. The Perl interpreter running knows it's @inc containing the search
paths of the Perl modules. One of the Perl modules is Config_heavy.pm,
which contains all the C compiler and linker switches to build Perl itself
and it's extension modules. The Config_heavy.pm is created during the Perl
compilation and installation process.
Now your slic3r Build.pm seems to be pulling a wrong Config_heavy.pm,
likely from the system path. I am not sure, but maybe something gets cached
somewhere re in the slicer directory from the times you ran build.pl with
the wrong perl. Would you please purge slicer directory and try to fetch
and compile slicer from scratch? Before running build.pm please verify that
you have the correct Perl in your search path and that the @inc returned by
Perl -V points to the perlbrew folder only.
…On Mar 1, 2017 8:21 PM, "freiser77" ***@***.***> wrote:
The last lines with the -M option set:
Building and testing Slic3r-XS-0.01 ... Building Slic3r-XS
Processing XS typemap files...
Generating main XS file...
cc -I/System/Library/Perl/5.18/darwin-thread-multi-2level/CORE -arch x86_64 -arch i386 -g -pipe -fno-common -DPERL_DARWIN -fno-strict-aliasing -fstack-protector -xc++ -Isrc/libslic3r -Isrc/glew/include -I/usr/local/include -I/usr/include -D_GLIBCXX_USE_C99 -DHAS_BOOL -DNOGDI -DSLIC3RXS -DBOOST_ASIO_DISABLE_KQUEUE -DGLEW_STATIC -M -std=c++11 -DBOOST_LOG_DYN_LINK -DBOOST_LIBS -DNDEBUG -Isrc -Ibuildtmp -c -arch x86_64 -arch i386 -g -pipe -fno-common -DPERL_DARWIN -fno-strict-aliasing -fstack-protector -Os -o src/poly2tri/sweep/advancing_front.o src/poly2tri/sweep/advancing_front.cc
clang: error: cannot use 'dependencies' output with multiple -arch options
error building src/poly2tri/sweep/advancing_front.o from 'src/poly2tri/sweep/advancing_front.cc' at /System/Library/Perl/5.18/ExtUtils/CBuilder/Base.pm line 177.
FAIL
! Installing ./xs failed. See /Volumes/LaCie/florian/.cpanm/work/1488395923.78684/build.log for details. Retry with --force to force install it.
The XS/C++ code failed to compile, aborting
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#162 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AFj5I4tLJQ6Lfz_5Ia9QS_OgVa7_iuzgks5rhcUvgaJpZM4MPUD->
.
|
@freiser77, that GUI porting work was already started in the "xsgui" branch of the main repository. We set-up the infrastructure for the double linking (Perl/C++) which is good for the transition because both bindings can coexist, and you can see how we ported some GUI parts. @lordofhyphens is actively working on porting the most difficult bit which is the OptionsGroup code which uses the dynamic features of Perl and doesn't translate straight to C++. I strongly advice you contribute to the "xsgui" branch of the main repository so that we join efforts and work on the same codebase, otherwise we'll be duplicating the work. Forks like prusa3d can pull the changes when we finish our work. Thank you :) |
This is a snippet from our build script to get compile parameters for the windows slic3r.exe
|
This is the output of the script (stored it in test.sh in the Slic3r directory)
|
I found out, that cpanm was running with the perl delivered by OSX. After I've installed it again with cpan running under perlbrews perl, the build of the command-line version runs okay. |
Great, good to hear it.
I would be thankful, if you could please document your findings, so we
could sum it up in a wiki page.
…On Mon, Mar 6, 2017 at 10:07 AM, freiser77 ***@***.***> wrote:
I found out, that cpanm was running with the perl delivered by OSX. After
I've installed it again with cpan running under perlbrews perl, the build
of the command-line version runs okay.
However when I try to build it with perl Build.PL --gui it again causes
an error. I will post it this evening.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#162 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AFj5IxKVxny0DZ3IuR3_Zvr_uIKa3tHiks5ri8zRgaJpZM4MPUD->
.
|
I am about to write up my work in getting the OSX 10.9 server going over on
the main wiki.
The package script will be available too (currently in branch osx-package).
|
@lordofhyphens: If you need it: The way I found out, that under which version cpanm is running is:
If there is any other perl than reasonable listed, then do |
As @alexrj is seemingly working on a C++ port of the GUI, I am closing this issue for now. Let's wait on what he will come up with. I am eager to accept these changes. |
As the Wx library from perl is creating constant headache (for example when trying to compile from source): Please replace perls Wx dependency with C++ frontend logic.
The text was updated successfully, but these errors were encountered: