Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/prusa3d/PrusaSlicer.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorVojtech Kral <vojtech@kral.hk>2019-01-07 18:28:57 +0300
committerVojtech Kral <vojtech@kral.hk>2019-01-07 19:25:12 +0300
commitf013972d8b2d794cfde39170259d76603b616c76 (patch)
tree6e5bc41ddea18b829d196c4b1c177c98f2da8bab /doc
parent00c9d1f1847e571097c2a79a9ce0de0e458dbc7d (diff)
doc: Add build tutorial for Unix/Linux
Diffstat (limited to 'doc')
-rw-r--r--doc/How to build - Linux et al.md66
1 files changed, 66 insertions, 0 deletions
diff --git a/doc/How to build - Linux et al.md b/doc/How to build - Linux et al.md
new file mode 100644
index 000000000..e665cd14c
--- /dev/null
+++ b/doc/How to build - Linux et al.md
@@ -0,0 +1,66 @@
+
+# Building Slic3r PE on UNIX/Linux
+
+Slic3r PE uses the CMake build system and requires several dependencies.
+The dependencies can be listed in `deps/deps-linux.cmake`, although they don't necessarily need to be as recent
+as the versions listed - generally versions available on conservative Linux distros such as Debian stable or CentOS should suffice.
+
+Perl is not required any more.
+
+In a typical situaction, one would open a command line, go to the Slic3r sources, create a directory called `build` or similar,
+`cd` into it and call:
+
+ cmake ..
+ make -jN
+
+where `N` is the number of CPU cores available.
+
+Additional CMake flags may be applicable as explained below.
+
+### Dependenciy resolution
+
+By default Slic3r looks for dependencies the default way CMake looks for them, ie. in default system locations.
+On Linux this will typically make Slic3r depend on dynamically loaded libraries from the system, however, Slic3r can be told
+to specifically look for static libraries with the `SLIC3R_STATIC` flag passed to cmake:
+
+ cmake .. -DSLIC3R_STATIC=1
+
+Additionally, Slic3r can be built in a static manner mostly independent of the system libraries with a dependencies bundle
+created using CMake script in the `deps` directory (these are not interconnected with the rest of the CMake scripts).
+
+Note: We say _mostly independent_ because it's still expected the system will provide some transitive dependencies, such as GTK for wxWidgets.
+
+To do this, go to the `deps` directory, create a `build` subdirectory (or the like) and use:
+
+ cmake .. -DDESTDIR=<target destdir>
+
+where the target destdir is a directory of your choosing where the dependencies will be installed.
+You can also omit the `DESTDIR` option to use the default, in that case the `destdir` will be created inside the `build` directory where `cmake` is run.
+
+To pass the destdir path to the top-level Slic3r CMake script, use the `CMAKE_PREFIX_PATH` option along with turning on `SLIC3R_STATIC`:
+
+ cmake .. -DSLIC3R_STATIC=1 -DCMAKE_PREFIX_PATH=<path to destdir>/usr/local
+
+Note that `/usr/local` needs to be appended to the destdir path and also the prefix path should be absolute.
+
+**Warning**: Once the dependency bundle is installed in a destdir, the destdir cannot be moved elsewhere.
+This is because wxWidgets hardcode the installation path.
+
+### Build variant
+
+By default Scli3r builds the release variant.
+To create a debug build, use the following CMake flag:
+
+ -DCMAKE_BUILD_TYPE=Debug
+
+### Installation
+
+In runtime, Slic3r needs a way to access its resource files. By default, it looks for a `resources` directory relative to its binary.
+
+If you instead wnat Slic3r installed in a structure according to the Filesystem Hierarchy Standard, use the `SLIC3R_FHS` flag
+
+ cmake .. -DSLIC3R_FHS=1
+
+This will make Slic3r look for a fixed-location `share/slic3r-prusa3d` directory instead (note that the location becomes hardcoded).
+
+You can then use the `make install` target to install Slic3r.