From e44319a3e6c852c86090e3c840a209af20ee9656 Mon Sep 17 00:00:00 2001 From: Drew Risinger Date: Mon, 12 Apr 2021 11:41:37 -0400 Subject: [PATCH] python3Packages.cvxpy: add openmp multithreading --- pkgs/development/python-modules/cvxpy/default.nix | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pkgs/development/python-modules/cvxpy/default.nix b/pkgs/development/python-modules/cvxpy/default.nix index fab4ee0fc274..1d060c41bb21 100644 --- a/pkgs/development/python-modules/cvxpy/default.nix +++ b/pkgs/development/python-modules/cvxpy/default.nix @@ -9,6 +9,7 @@ , osqp , scipy , scs +, useOpenmp ? true # Check inputs , pytestCheckHook }: @@ -34,6 +35,12 @@ buildPythonPackage rec { scs ]; + # Required flags from https://github.com/cvxgrp/cvxpy/releases/tag/v1.1.11 + preBuild = lib.optional useOpenmp '' + export CFLAGS="-fopenmp" + export LDFLAGS="-lgomp" + ''; + checkInputs = [ pytestCheckHook ]; pytestFlagsArray = [ "./cvxpy" ]; # Disable the slowest benchmarking tests, cuts test time in half