Building prusa slicer from source on linux
 
Notifications
Clear all

Building prusa slicer from source on linux  

  RSS
mmiscool
(@mmiscool-2)
Member
Building prusa slicer from source on linux

Hello,

I was hoping that some one might be able to link me to a docker file that can be used to successfully compile prusaslicer from source for ubuntu x86-64. 

 

Some small projects I am involved withhttps://serialterminal.com https://maker.cloud/jsketcher/

Napsal : 14/03/2024 2:03 am
mmiscool
(@mmiscool-2)
Member
Topic starter answered:
RE: Building prusa slicer from source on linux

I managed to figure it out.
Cobbled this together using information from the following locations. 
https://github.com/prusa3d/PrusaSlicer/issues/9079
https://github.com/prusa3d/PrusaSlicer/blob/master/doc/How%20to%20build%20-%20Linux%20et%20al.md

 

Commands to run.

docker build -t prusaslicer:v1 .
docker run --name prusaslicer_container prusaslicer:v1
docker cp prusaslicer_container:/opt/PrusaSlicer/build ./

 

 

dockerfile

FROM ubuntu:20.04
RUN apt update
ARG DEBIAN_FRONTEND=noninteractive
RUN apt install  -y \
git \
build-essential \
autoconf \
cmake \
locales \
libdbus-1-dev \
libglu1-mesa-dev \
libgtk-3-dev

# Install locales and set the locale to en_US.UTF-8
RUN echo "en_US.UTF-8 UTF-8" > /etc/locale.gen \
    && locale-gen en_US.UTF-8 \
    && update-locale LANG=en_US.UTF-8

# Set environment variables for the locale
ENV LC_ALL=en_US.UTF-8 \
    LANG=en_US.UTF-8 \
    LANGUAGE=en_US.UTF-8



ENV OPT_DIR /opt
ENV PRUSA_SRC ${OPT_DIR}/PrusaSlicer
ENV PRUSA_BUILD ${PRUSA_SRC}/build
ENV PRUSA_DEPS ${PRUSA_SRC}/deps
ENV PRUSA_DEPS_BUILD ${PRUSA_DEPS}/build
ENV CMAKE_PREFIX ${PRUSA_DEPS_BUILD}/usr/local
ENV PRUSA_CMAKE_PREFIX=${PRUSA_DEPS_BUILD}/destdir/usr/local/
ENV PRUSA_GIT= https://github.com/prusa3d/PrusaSlicer.git 

# Set default git branch to main
RUN git config --global init.defaultBranch main
RUN git clone ${PRUSA_GIT} ${PRUSA_SRC}

WORKDIR ${PRUSA_DEPS_BUILD}
WORKDIR ${PRUSA_SRC}
RUN git fetch origin --depth=1 || :
RUN git reset --hard FETCH_HEAD || :

########################
#
# Pursa dependencies
#

WORKDIR ${PRUSA_DEPS_BUILD}
RUN cmake ${PRUSA_DEPS} \
	-DDEP_WX_GTK3=ON
RUN make

########################
#
# Build prusa slicer.

WORKDIR ${PRUSA_BUILD}
RUN cmake .. \
	-DSLIC3R_STATIC=1 \
	-DSLIC3R_GTK=3 \
	-DSLIC3R_PCH=OFF \
	-DSLIC3R_WX_STABLE=ON \
	-DSLIC3R_GUI=no \
	-DCMAKE_PREFIX_PATH=${PRUSA_CMAKE_PREFIX}

RUN make -j 4 && make install

Some small projects I am involved withhttps://serialterminal.com https://maker.cloud/jsketcher/

Napsal : 14/03/2024 4:50 am
_KaszpiR_
(@_kaszpir_)
Honorable Member
RE: Building prusa slicer from source on linux

I don't have one, but I know that it works under Ubuntu 22.04 so you can use it as a base. Anything else is from the repos.

See my GitHub and printables.com for some 3d stuff that you may like.

Napsal : 14/03/2024 6:46 am
Share: