Repository: conan-io/conan-center-index

Issue:
[package] dlib/19.21: OpenBLAS not available as transitive dependency, defaulting to built-in BLAS
<!-- 
  Please don't forget to update the issue title.
  Include all applicable information to help us reproduce your problem.
-->

### Package and Environment Details (include every applicable attribute)
  * Package Name/Version: **dlib/19.21**
  * Operating System+version: **Linux Ubuntu 21.10**
  * Compiler+version: **GCC 9**
  * Docker image: **N/A (bare metal)**
  * Conan version: **conan 1.44.1**
  * Python version: **Python 3.9.4**


### Conan profile (output of `conan profile show default` or `conan profile show <profile>` if custom profile is in use)
```
[settings]
os=Linux
os_build=Linux
arch=x86_64
arch_build=x86_64
compiler=gcc
compiler.version=9
compiler.libcxx=libstdc++11
build_type=Release
[options]
[conf]
[build_requires]
[env]

```


### Steps to reproduce (Include if Applicable)
Install the dlib dependency by forcing a rebuild or by setting some non-standard options like these:
```
[options]
dlib:shared=False
dlib:with_sse4=False
dlib:with_avx=False
```

During build, OpenBLAS will not be used as dependency even if added as a project direct dependency.
An option to declare the optional OpenBLAS dependency should be added

### Logs (Include/Attach if Applicable)
<details><summary>Click to expand log</summary>

```
*****************************************************************************
 *** No BLAS library found so using dlib's built in BLAS.  However, if you ***
 *** install an optimized BLAS such as OpenBLAS or the Intel MKL your code ***
 *** will run faster.  On Ubuntu you can install OpenBLAS by executing:    ***
 ***    sudo apt-get install libopenblas-dev liblapack-dev                 ***
 *** Or you can easily install OpenBLAS from source by downloading the     ***
 *** source tar file from http://www.openblas.net/, extracting it, and      ***
 *** running:                                                              ***
 ***    make; sudo make install                                            ***
 ****************************************************************************
```

</details>



Discussion:

Resolving patch:
diff --git a/recipes/dlib/all/conanfile.py b/recipes/dlib/all/conanfile.py
--- a/recipes/dlib/all/conanfile.py
+++ b/recipes/dlib/all/conanfile.py
@@ -23,7 +23,8 @@ class DlibConan(ConanFile):
         "with_png": [True, False],
         "with_sse2": [True, False, "auto"],
         "with_sse4": [True, False, "auto"],
-        "with_avx": [True, False, "auto"]
+        "with_avx": [True, False, "auto"],
+        "with_openblas": [True, False],
     }
     default_options = {
         "shared": False,
@@ -33,7 +34,9 @@ class DlibConan(ConanFile):
         "with_png": True,
         "with_sse2": "auto",
         "with_sse4": "auto",
-        "with_avx": "auto"
+        "with_avx": "auto",
+        "with_openblas": True,
+
     }
 
     _cmake = None
@@ -67,6 +70,8 @@ def requirements(self):
             self.requires("libjpeg/9d")
         if self.options.with_png:
             self.requires("libpng/1.6.37")
+        if self.options.with_openblas:
+            self.requires("openblas/0.3.17")
 
     def source(self):
         tools.get(**self.conan_data["sources"][self.version])


Test patch: