21

I am using a Mac running OS X 10.8.3. I am trying to compile cgminer 3.0.0. On my first run of ./configure I got the message:

checking for LIBCURL... no
checking for LIBCURL... no
configure: error: Missing required libcurl dev >= 7.18.2

So I installed the latest version of libcurl using homebrew:

brew install curl

That seemed to do the trick. I got this message:

downloaded: /Library/Caches/Homebrew/curl-7.30.0.tar.gz
==> ./configure --prefix=/usr/local/Cellar/curl/7.30.0
==> make install
==> Caveats
This formula is keg-only: so it was not symlinked into /usr/local.

Mac OS X already provides this software and installing another version in
parallel can cause all kinds of trouble.

The libcurl provided by Leopard is too old for CouchDB to use.

Generally there are no consequences of this for you. If you build your
own software and it requires this formula, you'll need to add to your
build variables:

    LDFLAGS:  -L/usr/local/opt/curl/lib
    CPPFLAGS: -I/usr/local/opt/curl/include

==> Summary
/usr/local/Cellar/curl/7.30.0: 75 files, 2.0M, built in 61 seconds

Okay, so it's installed but not symlinked into /usr/local, that's fine with me. I tried this:

export LDFLAGS=-L/usr/local/opt/curl/lib
export CPPFLAGS=-I/usr/local/opt/curl/include
./configure

But I got the same message: configure: error: Missing required libcurl dev >= 7.18.2

So I tried this:

env LDFLAGS=-L/usr/local/opt/curl/lib CPPFLAGS=-I/usr/local/opt/curl/include ./configure

I'm still getting the "missing required libcurl" message. Any ideas?

Ben Harold
  • 6,242
  • 6
  • 47
  • 71
  • 1
    Did you try putting the values of the environment variables in quotes? – jepugs Apr 26 '13 at 22:54
  • @jepugs Just tried both methods listed above using single and double quotes. Same result. – Ben Harold Apr 26 '13 at 22:58
  • Sometimes configure files redefine the flag variables locally. If you're feeling adventurous you could open up the configure file and edit it to set the variables yourself. Look for the lines that start with something like `LDFLAGS=` and `CPPFLAGS=` and add your arguments there. – jepugs Apr 26 '13 at 23:01
  • One more thing: try starting with a clean source tree and setting the environment variables before you run configure the first time. – jepugs Apr 26 '13 at 23:08
  • I searched for `LDFLAGS=` and `CPPFLAGS=` but the only code I found that appeared to even be capable of changing them were `CPPFLAGS="-I$CGMINER_SDK/include $CPPFLAGS"` and `LDFLAGS="-L$CGMINER_SDK/lib/$target $LDFLAGS"`. Neither of these appear to overwrite the variables. I tried hard-coding them into the configure script, but that didn't work either. I'm not sure exactly what you mean by "start with a clean source tree", but I closed and re-opened Terminal and tried again with the same results. – Ben Harold Apr 26 '13 at 23:11
  • I mean delete the directory with the source code in it and uncompress a fresh copy. Running configure modifies files in the source directory, and sometimes these files don't get reset properly when you run configure again. – jepugs Apr 26 '13 at 23:14
  • I'm not sure if this applies to Mac OS X, but this error message on other unix-like systems usually has to do with an outdated ld shared library cache. You can try `sudo ldconfig` if there is such a command. If none of these work, then I would suggest either finding a binary distribution or using another OS ;). Mac OS X can be finicky. – jepugs Apr 26 '13 at 23:18
  • The solution here seems to work: http://stackoverflow.com/questions/16247276/how-can-i-fix-undefined-symbols-for-architecture-x86-64-in-this-instance – Jamil Elie Bou Kheir Nov 15 '13 at 20:26

1 Answers1

45

After some more thorough investigation, I determined that the configure file for cgminer does not pay attention to LDFLAGS or CPPFLAGS when testing for libcurl. Instead, it checks for LIBCURL_CFLAGS and LIBCURL_LIBS. So, I tried:

export LIBCURL_CFLAGS=-I/usr/local/opt/curl/include
export LIBCURL_LIBS=-L/usr/local/opt/curl/lib
./configure

and I got:

checking for LIBCURL... yes

And the rest of the configuration went off without a hitch. SUCCESS!

Ben Harold
  • 6,242
  • 6
  • 47
  • 71