ResistancePlatform / resistance-miner

Resistance Miner
Other
13 stars 7 forks source link

./configure: line 5444: syntax error near unexpected token `,' `LIBCURL_CHECK_CONFIG(, 7.15.2, ,' #7

Closed adrelanos closed 5 years ago

adrelanos commented 5 years ago

Happening on Debian buster.

./configure: line 5444: syntax error near unexpected token `,'
./configure: line 5444: `LIBCURL_CHECK_CONFIG(, 7.15.2, ,'
dpkg -l | grep libcurl
ii  libcurl3-gnutls:amd64                         7.64.0-4                             amd64        easy-to-use client-side URL transfer library (GnuTLS flavour)
ii  libcurl4:amd64                                7.64.0-4                             amd64        easy-to-use client-side URL transfer library (OpenSSL flavour)
ii  python-pycurl                                 7.43.0.2-0.1                         amd64        Python bindings to libcurl
ii  python3-pycurl                                7.43.0.2-0.1                         amd64        Python bindings to libcurl (Python 3)

Required for packaging change requests ( https://github.com/ResistancePlatform/resistance-miner/pull/6 ) by @solardiz.

solardiz commented 5 years ago

Looks like you need to install libcurl4-dev or such. Indeed, it's not great that configure fails with a syntax error rather than with a user-friendly error - a fix for this would be appreciated.

solardiz commented 5 years ago

I also recall seeing an error like this when I had misconfigured pkg-config on a system. But regardless, you do appear to be missing the curl development library package, and need to install it.

solardiz commented 5 years ago

Indeed, it's not great that configure fails with a syntax error rather than with a user-friendly error - a fix for this would be appreciated.

I've just checked what cpuminer-multi and cpuminer-opt (other forks of pooler's cpuminer) do here. And they simply comment out the LIBCURL_CHECK_CONFIG line in configure.ac. (They also add some logic for the user to be able to specify a custom libcurl location.) I guess the reason is this line is only able to check the curl version, but fails in a user-unfriendly fashion (like we see here) when curl development library subpackage is not installed at all. So maybe we should do the same, and let the build fail later when it tries to include libcurl headers.

solardiz commented 5 years ago

Alternatively, we could add logic to check whether curl development library is installed and bail out if not before reaching the version check.

solardiz commented 5 years ago

I also found that the curl project itself offers a set of m4 macros we could use to detect curl and its version, but that file is lengthy and overly complicated for our needs, I think.

adrelanos commented 5 years ago

Solar Designer:

Looks like you need to install libcurl4-dev or such.

sudo apt install libcurl4-dev

Reading package lists... Done Building dependency tree Reading state information... Done Package libcurl4-dev is a virtual package provided by: libcurl4-openssl-dev 7.64.0-4 libcurl4-nss-dev 7.64.0-4 libcurl4-gnutls-dev 7.64.0-4 You should explicitly select one to install.

Which one preferred?

adrelanos commented 5 years ago

I tried all of them one by one and always get the same error.

solardiz commented 5 years ago

I've just test-built the miner on Ubuntu 18.04.2 installing missing packages as necessary. I was able to reproduce the issue reported here until I installed not only libcurl4-openssl-dev, but also libssl-dev, and re-ran ./autogen.sh. My guess is that maybe libcurl4-openssl-dev should have a dependency on libssl-dev, but is missing it (a minor Debian bug if so).

Overall, to build the miner on Debian-alike, need something like this:

apt-get install build-essential pkg-config libcurl4-openssl-dev libssl-dev
solardiz commented 5 years ago

As an option, we could commit a pre-generated configure to this repo, which should reduce the number of dependencies and result in better error reporting when libcurl isn't (fully) present.

adrelanos commented 5 years ago

Building works for me now. No errors.

solardiz commented 5 years ago

Building works for me now. No errors.

Great. I think we need to double-check that libssl-dev is needed. Maybe you simply forgot to re-run ./autogen.sh after installing libcurl4-openssl-dev before?

adrelanos commented 5 years ago

I think we need to double-check that libssl-dev is needed.

Removed. Works for me.

solardiz commented 5 years ago

I've also confirmed that libssl-dev isn't actually needed to build on a fresh install of Ubuntu 18.04.2.

I'll close this issue as it isn't actionable anymore. We know what missing dependencies cause this reporting, and improving the error reporting or whatever would be a separate task/issue.

solardiz commented 5 years ago

I've reworked the libcurl detection logic in the current code. When trying to build with libcurl missing, the build will now fail at make. That's not ideal, but at least it's not some weird syntax error, and the dependency on pkg-config should be gone.