Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[openblas] Expose additional options #855

Merged
merged 3 commits into from
Mar 2, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions recipes/openblas/all/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,16 @@ class OpenBLAS(ConanFile):
options = {
"shared": [True, False],
"fPIC": [True, False],
"build_lapack": [True, False]
"build_lapack": [True, False],
"use_thread": [True, False],
"dynamic_arch": [True, False],
}
default_options = {
"shared": False,
"fPIC": True,
"build_lapack": False
"build_lapack": False,
"use_thread": True,
"dynamic_arch": False
}
exports_sources = ["CMakeLists.txt"]
generators = "cmake"
Expand All @@ -46,6 +50,12 @@ def _configure_cmake(self):

cmake.definitions["NOFORTRAN"] = not self.options.build_lapack
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While you're modifying this recipe, can you add caching to cmake to avoid reconfiguration for package after build?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it would be great.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've updated the script to avoid unnecessary re-configuration.

While making the update, I noticed an inconsistency in the CMake build helper parameter naming: configure takes a build_folder parameter, but install takes a build_dir parameter.

Copy link
Contributor

@madebr madebr Feb 24, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

build() has also a build_dir argument. I guess it is to override build_folder, given as an argument to configure().
Not that the build_dir argument of configure is deprecated

cmake.definitions["BUILD_WITHOUT_LAPACK"] = not self.options.build_lapack
cmake.definitions["DYNAMIC_ARCH"] = self.options.dynamic_arch
cmake.definitions["USE_THREAD"] = self.options.use_thread
pleroux0 marked this conversation as resolved.
Show resolved Hide resolved

if not self.options.use_thread:
# Required for safe concurrent calls to OpenBLAS routines
cmake.definitions["USE_LOCKING"] = True

if self.settings.compiler == "Visual Studio" and not self.options.shared:
cmake.definitions["MSVC_STATIC_CRT"] = True
Expand Down