title: Why rust is failing to build command for openssl-sys v0.9.60 even after local installation?
body: <p>I'm facing the error <code>failed to run custom build command for openssl-sys v0.9.60</code> while trying to build my rust program. Here are the <code>main.rs</code> and the <code>Cargo.toml</code> files.</p>
  <p>main.rs</p>
  <pre class="lang-rust prettyprint-override"><code>extern crate reqwest;
  
  fn main() {
      let mut resp = reqwest::get(&quot;http://www.governo.mg.gov.br/Institucional/Equipe&quot;).unwrap();
      assert!(resp.status().is_success());
  }
  </code></pre>
  <p>Cargo.toml</p>
  <pre><code>[package]
  name = &quot;get_sct&quot;
  version = &quot;0.1.0&quot;
  authors = [&quot;myname &lt;myemail&gt;&quot;]
  edition = &quot;2018&quot;
  
  # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
  
  [dependencies]
  reqwest = &quot;0.10.10&quot;
  </code></pre>
  <p>I installed <strong>openssl</strong> locally (as suggested in this <a href="https://stackoverflow.com/questions/57182594/error-failed-to-run-custom-build-command-for-openssl-v0-9-24">question</a>), using:</p>
  <pre class="lang-sh prettyprint-override"><code>git clone git://git.openssl.org/openssl.git
  cd openssl
  ./config --openssldir=/usr/local/ssl
  make
  make test
  sudo make install
  </code></pre>
  <p>Finally, I ran <code>export OPENSSL_DIR=&quot;/usr/local/ssl&quot;</code></p>
  <p>I noted I already had a anaconda instalation of <strong>openssl</strong> which was in my default path. To change the default path of <strong>openssl</strong> to the github instalation I ran <code>chmod -x MYPATH/anaconda3/bin/openssl</code> and now <code>which openssl</code> returns <code>/usr/local/bin/openssl</code>.</p>
  <p>I also have <strong>pkg-config</strong> installed (as suggested in this <a href="https://stackoverflow.com/questions/43364214/why-doesnt-the-rust-crate-openssl-sys-compile">question</a>). Running <code>which pkg-config</code> returns <code>/usr/bin/pkg-config</code></p>
  <p>However, when I run <code>cargo run</code> again the program print the same error message. Here is the entire error message:</p>
  <pre><code>&gt; cargo run
     Compiling openssl-sys v0.9.60
     Compiling tokio v0.2.24
     Compiling pin-project-internal v0.4.27
     Compiling pin-project-internal v1.0.2
     Compiling mime_guess v2.0.3
     Compiling url v2.2.0
  error: failed to run custom build command for `openssl-sys v0.9.60`
  
  Caused by:
    process didn't exit successfully: `/PACKAGEPATH/target/debug/build/openssl-sys-db18d493257de4f7/build-script-main` (exit code: 101)
    --- stdout
    cargo:rustc-cfg=const_fn
    cargo:rerun-if-env-changed=X86_64_UNKNOWN_LINUX_GNU_OPENSSL_LIB_DIR
    X86_64_UNKNOWN_LINUX_GNU_OPENSSL_LIB_DIR unset
    cargo:rerun-if-env-changed=OPENSSL_LIB_DIR
    OPENSSL_LIB_DIR unset
    cargo:rerun-if-env-changed=X86_64_UNKNOWN_LINUX_GNU_OPENSSL_INCLUDE_DIR
    X86_64_UNKNOWN_LINUX_GNU_OPENSSL_INCLUDE_DIR unset
    cargo:rerun-if-env-changed=OPENSSL_INCLUDE_DIR
    OPENSSL_INCLUDE_DIR unset
    cargo:rerun-if-env-changed=X86_64_UNKNOWN_LINUX_GNU_OPENSSL_DIR
    X86_64_UNKNOWN_LINUX_GNU_OPENSSL_DIR unset
    cargo:rerun-if-env-changed=OPENSSL_DIR
    OPENSSL_DIR = /usr/local/ssl
  
    --- stderr
    thread 'main' panicked at 'OpenSSL library directory does not exist: /usr/local/ssl/lib', /home/lucas/.cargo/registry/src/github.com-1ecc6299db9ec823/openssl-sys-0.9.60/build/main.rs:66:9
    note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
  warning: build failed, waiting for other jobs to finish...
  error: build faile
  </code></pre>
  <p>It looks like that rust is searching for ssl in <code>/usr/local/ssl/lib</code>. In fact, there is a <code>/usr/local/ssl</code> folder in my PC, but there is no <code>lib</code> there.</p>
  <p>What am I doing wrong here? How can make my local installation of openssl work with rust correctly?</p>