Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: NixOS/nixpkgs
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: dffbac03fd2c
Choose a base ref
...
head repository: NixOS/nixpkgs
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 32992a68cfe5
Choose a head ref
  • 2 commits
  • 2 files changed
  • 2 contributors

Commits on Apr 1, 2020

  1. curaLulzbot: Fix build breakage around OpenMP compatibility

    (cherry picked from commit 68d14b3)
    charles-dyfis-net committed Apr 1, 2020
    Copy the full SHA
    a7f8187 View commit details
  2. Merge pull request #83991 from charles-dyfis-net/curaengine-fix-openm…

    …p-compat-backport20.03
    
    [20.03] curaLulzbot: Fix build breakage around OpenMP compatibility
    Mic92 authored Apr 1, 2020

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    32992a6 View commit details
Showing with 49 additions and 0 deletions.
  1. +47 −0 pkgs/applications/misc/cura/lulzbot/curaengine-openmp-compat.patch
  2. +2 −0 pkgs/applications/misc/cura/lulzbot/curaengine.nix
47 changes: 47 additions & 0 deletions pkgs/applications/misc/cura/lulzbot/curaengine-openmp-compat.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# Notes by Charles Duffy <charles@dyfis.net> --
#
# - The new version of OpenMP does not allow outside variables to be referenced
# *at all* without an explicit declaration of how they're supposed to be
# handled. Thus, this was an outright build failure beforehand. The new
# pragmas copy the initial value from the outer scope into each parallel
# thread. Since these variables are all constant within the loops, this is
# clearly correct. (Not sure it's *optimal*, but quite sure it isn't
# *wrong*).
# - Upstream has been contacted -- I'm a Lulzbot customer with an active
# support contract and sent them the patch. That said, they're in the middle
# of some major corporate churn (sold themselves out of near-bankruptcy to an
# out-of-state business entity formed as a holding company; moved to that
# state; have been slowly restaffing after), so a response may take a while.
# - The patch is purely my own work.

--- curaengine/src/support.cpp.orig 2020-03-28 10:38:01.953912363 -0500
+++ curaengine/src/support.cpp 2020-03-28 10:45:28.999791908 -0500
@@ -854,7 +854,7 @@
const double tan_angle = tan(angle) - 0.01; // the XY-component of the supportAngle
xy_disallowed_per_layer[0] = storage.getLayerOutlines(0, false).offset(xy_distance);
// for all other layers (of non support meshes) compute the overhang area and possibly use that when calculating the support disallowed area
- #pragma omp parallel for default(none) shared(xy_disallowed_per_layer, storage, mesh) schedule(dynamic)
+ #pragma omp parallel for default(none) firstprivate(layer_count, is_support_mesh_place_holder, use_xy_distance_overhang, z_distance_top, tan_angle, xy_distance, xy_distance_overhang) shared(xy_disallowed_per_layer, storage, mesh) schedule(dynamic)
for (unsigned int layer_idx = 1; layer_idx < layer_count; layer_idx++)
{
Polygons outlines = storage.getLayerOutlines(layer_idx, false);
@@ -1054,7 +1054,7 @@
const int max_checking_layer_idx = std::min(static_cast<int>(storage.support.supportLayers.size())
, static_cast<int>(layer_count - (layer_z_distance_top - 1)));
const size_t max_checking_idx_size_t = std::max(0, max_checking_layer_idx);
-#pragma omp parallel for default(none) shared(support_areas, storage) schedule(dynamic)
+#pragma omp parallel for default(none) firstprivate(max_checking_idx_size_t, layer_z_distance_top) shared(support_areas, storage) schedule(dynamic)
for (size_t layer_idx = 0; layer_idx < max_checking_idx_size_t; layer_idx++)
{
support_areas[layer_idx] = support_areas[layer_idx].difference(storage.getLayerOutlines(layer_idx + layer_z_distance_top - 1, false));
--- curaengine/src/layerPart.cpp.orig 2020-03-28 10:36:40.381023651 -0500
+++ curaengine/src/layerPart.cpp 2020-03-28 10:39:54.584140465 -0500
@@ -49,7 +49,7 @@
{
const auto total_layers = slicer->layers.size();
assert(mesh.layers.size() == total_layers);
-#pragma omp parallel for default(none) shared(mesh, slicer) schedule(dynamic)
+#pragma omp parallel for default(none) firstprivate(total_layers) shared(mesh, slicer) schedule(dynamic)
for (unsigned int layer_nr = 0; layer_nr < total_layers; layer_nr++)
{
SliceLayer& layer_storage = mesh.layers[layer_nr];
2 changes: 2 additions & 0 deletions pkgs/applications/misc/cura/lulzbot/curaengine.nix
Original file line number Diff line number Diff line change
@@ -10,6 +10,8 @@ stdenv.mkDerivation rec {
sha256 = "0wdkvg1hmqp1gaym804lw09x4ngf5ffasd861jhflpy7djbmkfn8";
};

patches = [ ./curaengine-openmp-compat.patch ];

nativeBuildInputs = [ cmake ];
buildInputs = [ libarcusLulzbot stb protobuf ];