slic3r / Slic3r

Open Source toolpath generator for 3D printers
https://slic3r.org/
GNU Affero General Public License v3.0
3.28k stars 1.29k forks source link

Compile failure #5098

Closed VanessaE closed 2 years ago

VanessaE commented 2 years ago

Describe the bug

I had to reinstall my OS today (for reasons unrelated to 3d printing), and when it came time to compile Slic3r, it made it to about 70%, then failed. I tried googling for the error (below), but came up empty. Nothing I found made any sense to me.

To reiterate, this is happening on a freshly-installed system.

The failure is shown below:

[ 70%] Building CXX object src/libslic3r/CMakeFiles/libslic3r.dir/SLA/Clustering.cpp.o
/home/vanessa/RepRap/Slic3r/src/libslic3r/SLA/IndexedMesh.cpp: In member function ‘Slic3r::sla::IndexedMesh::hit_result Slic3r::sla::IndexedMesh::query_ray_hit(const Vec3d&, const Vec3d&) const’:
/home/vanessa/RepRap/Slic3r/src/libslic3r/SLA/IndexedMesh.cpp:135:23: warning: ‘hit.igl::Hit::id’ may be used uninitialized in this function [-Wmaybe-uninitialized]
  135 |         ret.m_face_id = hit.id;
      |         ~~~~~~~~~~~~~~^~~~~~~~
[ 70%] Linking CXX static library liblibslic3r.a
[ 70%] Built target libslic3r
Scanning dependencies of target libslic3r_gui
[ 70%] Building CXX object src/slic3r/CMakeFiles/libslic3r_gui.dir/cmake_pch.hxx.gch
In file included from /usr/include/wx-3.1-unofficial/wx/platform.h:503,
                 from /usr/include/wx-3.1-unofficial/wx/defs.h:45,
                 from /usr/include/wx-3.1-unofficial/wx/event.h:14,
                 from /usr/include/wx-3.1-unofficial/wx/app.h:19,
                 from /home/vanessa/RepRap/Slic3r/src/slic3r/pchheader.hpp:95,
                 from /home/vanessa/RepRap/Slic3r/build/src/slic3r/CMakeFiles/libslic3r_gui.dir/cmake_pch.hxx:5,
                 from <command-line>:
/usr/include/wx-3.1-unofficial/wx/chkconf.h:1249:9: error: #error "wxUSE_WEBREQUEST must be defined, please read comment near the top of this file."
 1249 | #       error "wxUSE_WEBREQUEST must be defined, please read comment near the top of this file."
      |         ^~~~~
In file included from /usr/include/boost/smart_ptr/detail/sp_thread_sleep.hpp:22,
                 from /usr/include/boost/smart_ptr/detail/yield_k.hpp:23,
                 from /usr/include/boost/smart_ptr/detail/spinlock_gcc_atomic.hpp:14,
                 from /usr/include/boost/smart_ptr/detail/spinlock.hpp:42,
                 from /usr/include/boost/smart_ptr/detail/spinlock_pool.hpp:25,
                 from /usr/include/boost/smart_ptr/shared_ptr.hpp:29,
                 from /usr/include/boost/shared_ptr.hpp:17,
                 from /usr/include/boost/date_time/time_clock.hpp:17,
                 from /usr/include/boost/date_time/posix_time/posix_time_types.hpp:10,
                 from /usr/include/boost/asio/time_traits.hpp:23,
                 from /usr/include/boost/asio/detail/timer_queue_ptime.hpp:22,
                 from /usr/include/boost/asio/detail/deadline_timer_service.hpp:29,
                 from /usr/include/boost/asio/basic_deadline_timer.hpp:25,
                 from /usr/include/boost/asio.hpp:25,
                 from /home/vanessa/RepRap/Slic3r/src/slic3r/pchheader.hpp:64,
                 from /home/vanessa/RepRap/Slic3r/build/src/slic3r/CMakeFiles/libslic3r_gui.dir/cmake_pch.hxx:5,
                 from <command-line>:
/usr/include/boost/bind.hpp:36:1: note: ‘#pragma message: The practice of declaring the Bind placeholders (_1, _2, ...) in the global namespace is deprecated. Please use <boost/bind/bind.hpp> + using namespace boost::placeholders, or define BOOST_BIND_GLOBAL_PLACEHOLDERS to retain the current behavior.’
   36 | BOOST_PRAGMA_MESSAGE(
      | ^~~~~~~~~~~~~~~~~~~~
make[2]: *** [src/slic3r/CMakeFiles/libslic3r_gui.dir/build.make:83: src/slic3r/CMakeFiles/libslic3r_gui.dir/cmake_pch.hxx.gch] Error 1
make[1]: *** [CMakeFiles/Makefile2:1360: src/slic3r/CMakeFiles/libslic3r_gui.dir/all] Error 2
make: *** [Makefile:171: all] Error 2

This is using Wx 3.1.4 from Codelite's repository, since Debian still only supplies 3.0.x (they still have no plans to update, because 3.1.x is development/unstable). I installed 3.1.4 thusly:

echo "deb https://repos.codelite.org/wx3.1.5/debian/ buster libs" \
>> /etc/apt/sources.list
apt-key adv --fetch-keys https://repos.codelite.org/CodeLite.asc
apt-get update

apt -y install \
  libwxbase3.1-0-unofficial3 libwxbase3.1unofficial3-dev \
  libwxgtk3.1-0-unofficial3 libwxgtk3.1unofficial3-dev wx3.1-headers \
  wx-common libwxgtk-media3.1-0-unofficial3 libwxgtk-media3.1unofficial3-dev \
  libwxgtk-webview3.1-0-unofficial3 libwxgtk-webview3.1unofficial3-dev \
  libwxbase3.1-0-unofficial3-dbg libwxgtk3.1-0-unofficial3-dbg \
  libwxgtk-webview3.1-0-unofficial3-dbg libwxgtk-media3.1-0-unofficial3-dbg \
  wx3.1-i18n wx3.1-examples

Desktop:

SuperSlicer (master branch) and PrusaSlicer (master branch) also fail to compile, with the same error as above, which makes sense since they all share a common codebase (more or less).

All three were deleted entirely and re-cloned from scratch before trying to build, just to make sure there weren't any "leftovers" from before my reinstall that might be mucking things up.

I suspect the problem is actually in Codelite's packages, but I can't be sure.

Also, although I only gave it a cursory look, the official SuperSlicer 2.3.56.8 Appimage runs fine (since there do not appear to be any Slic3r "merill-merge" Appimages available).

supermerill commented 2 years ago

I have no problem building it with the BuildLinux.sh script on ubuntu 20.04.

./BuildLinux.sh -dsi
lordofhyphens commented 2 years ago

Did you move the source without clearing the build directory or cache?

On Sat, Aug 21, 2021, 9:53 AM Vanessa Dannenberg @.***> wrote:

Not here. When I re-clone and try to use that script, it dies almost immediately, because other scripts it calls aren't where it expects:

@.:~/RepRap/Slic3r$ ./BuildLinux.sh FOUND_GTK2=ii libgtk2.0-dev:amd64 2.24.33-2 amd64 development files for the GTK library) [1/9] Updating submodules... ~/RepRap/Slic3r/resources/profiles ~/RepRap/Slic3r Submodule 'resources/profiles' (https://github.com/slic3r/slic3r-profiles.git) registered for path './' Submodule 'src/ArcWelderLib' (https://github.com/FormerLurker/ArcWelderLib.git) registered for path '../../src/ArcWelderLib' Cloning into '/home/vanessa/RepRap/Slic3r/resources/profiles'... Cloning into '/home/vanessa/RepRap/Slic3r/src/ArcWelderLib'... Submodule path './': checked out '118aa919c16837eb2ff6ba97e2934fa4144ef806' Submodule path '../../src/ArcWelderLib': checked out 'fe18f18b4c005a2c4e4b69a5866d0d065bde82aa' ~/RepRap/Slic3r [2/9] Changing date in version... done chmod: cannot access '/home/vanessa/RepRap/Slic3r/build/src/BuildLinuxImage.sh': No such file or directory [9/9] Generating Linux app... ~/RepRap/Slic3r/build ~/RepRap/Slic3r ./BuildLinux.sh: line 150: /home/vanessa/RepRap/Slic3r/build/src/BuildLinuxImage.sh: No such file or directory done @.:~/RepRap/Slic3r$ find ./ |grep -i build |grep -i image ./src/platform/osx/BuildMacOSImage.sh.in ./src/platform/unix/build_appimage.sh.in ./src/platform/unix/BuildLinuxImage.sh.in

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/slic3r/Slic3r/issues/5098#issuecomment-903128384, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAHYCSHOHHUKYZPW5IVKE3T564W7ANCNFSM5CRRFBAA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&utm_campaign=notification-email .

VanessaE commented 2 years ago

Ignore that last comment, I missed the -dsi switch. When I run the command properly :stuck_out_tongue: it.... works!

./BuildLinux.sh -dsi built Slic3r without a single complaint, and it seems to run just fine.

But..that raises the question, why does that work, but my usual build script shown below does not?

#!/bin/bash

# make sure Slic3r repo is on the `merill-merge` branch

#export CFLAGS="-DDEBUG_SERIAL"

cd /home/vanessa/RepRap/Slic3r
make clean
rm -rf build

mkdir build
cd build
cmake .. -DSLIC3R_BUILD_TESTS=OFF -DSLIC3R_GTK=3
make  -j8

As an aside, that problem with the window auto-raising itself all the time seems to have sorted itself out. I assume that's because the official build script employs its own Wx-related options, which mine does not.

Oh and to answer your question, @lordofhyphens (even though it's not valid now), I did not move it. I literally deleted the project, re-cloned and built.

It's a personal policy of mine that if I do have to move a project, and it fails to compile after being moved, to just delete, clone to the new location, and build again. Saves me a lot of headaches. :stuck_out_tongue:

supermerill commented 2 years ago

But..that raises the question, why does that work, but my usual build script shown below does not?

Imo: Your build script doesn't build the deps. So it has to find them in your computer, and if they are not found or they have an incompatible version, the build will fail.