Skip to content

Commit

Permalink
suitesparse-spqr: proper CUDA support
Browse files Browse the repository at this point in the history
CUDA dependency handling is provided by CHOLMOD package.
  • Loading branch information
valgur committed May 6, 2024
1 parent 050852f commit 8979961
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions recipes/suitesparse-spqr/all/conanfile.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import os

from conan import ConanFile
from conan.errors import ConanInvalidConfiguration
from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout
from conan.tools.env import VirtualBuildEnv
from conan.tools.files import get, rm, rmdir, copy
Expand Down Expand Up @@ -47,6 +48,10 @@ def requirements(self):
self.requires("suitesparse-config/7.7.0", transitive_headers=True, transitive_libs=True)
self.requires("suitesparse-cholmod/5.2.1", transitive_headers=True, transitive_libs=True)

def validate(self):
if self.options.cuda and not self.dependencies["suitesparse-cholmod"].options.cuda:
raise ConanInvalidConfiguration("suitesparse-spqr/*:cuda=True option requires suitesparse-cholmod/*:cuda=True")

def build_requirements(self):
self.tool_requires("cmake/[>=3.22 <4]")

Expand All @@ -58,6 +63,7 @@ def generate(self):
venv.generate()

tc = CMakeToolchain(self)
tc.variables["CMAKE_VERBOSE_MAKEFILE"] = True
tc.variables["BUILD_SHARED_LIBS"] = self.options.shared
tc.variables["BUILD_STATIC_LIBS"] = not self.options.shared
tc.variables["SUITESPARSE_USE_OPENMP"] = True
Expand Down

0 comments on commit 8979961

Please sign in to comment.