facebook / redex

A bytecode optimizer for Android apps
https://fbredex.com/
MIT License
6.02k stars 655 forks source link

double-conversion has installed, but configure error #15

Closed lovetuzitong closed 8 years ago

lovetuzitong commented 8 years ago

➜ redex git:(master) ✗ brew install double-conversion Warning: double-conversion-1.1.5 already installed // execute autoreconf -ivf && ./configure && make && make install ...msg... configure: error: Please install double-conversion

antani commented 8 years ago

Is double-conversion linked properly? I had to do:

brew link double-conversion --force
srisa commented 8 years ago

Facing the same issue. force linking it didn't help.

bertmaher commented 8 years ago

I should have a fix landing soon -- in the meantime try editing configure.ac to change:

AC_CHECK_LIB([double-conversion], [main], ...

into

AC_CHECK_LIB([double-conversion], [ceil], ...

That should appease configure. (I hope.)

mohamedmansour commented 8 years ago

@bertmaher that doesn't work either

checking for ceil in -ldouble-conversion... no
configure: error: Please install double-conversion

It seems the mac osx build is broken, even removing that check in double-conversion, glog is complaining. Maybe they added OS X last minute, will wait till they checkin the remaining source.

bertmaher commented 8 years ago

I'm not really sure what's going on here. Can you post the output of:

g++ -E -x c++ - -v < /dev/null
clang -Xlinker -v
mohamedmansour commented 8 years ago

Sorry I couldn't help much, but here is the output, seems my sdk is missing?


mmansour ~/Code/redex (master)
$ g++ -E -x c++ - -v < /dev/null
Apple LLVM version 7.3.0 (clang-703.0.29)
Target: x86_64-apple-darwin15.4.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang" -cc1 -triple x86_64-apple-macosx10.11.0 -Wdeprecated-objc-isa-usage -Werror=deprecated-objc-isa-usage -E -disable-free -disable-llvm-verifier -main-file-name - -mrelocation-model pic -pic-level 2 -mthread-model posix -mdisable-fp-elim -masm-verbose -munwind-tables -target-cpu core2 -target-linker-version 264.3.101 -v -dwarf-column-info -resource-dir /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/7.3.0 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk -stdlib=libc++ -fdeprecated-macro -fdebug-compilation-dir /Users/mmansour/Code/redex -ferror-limit 19 -fmessage-length 80 -stack-protector 1 -fblocks -fobjc-runtime=macosx-10.11.0 -fencode-extended-block-signature -fcxx-exceptions -fexceptions -fmax-type-align=16 -fdiagnostics-show-option -fcolor-diagnostics -o - -x c++ -
clang -cc1 version 7.3.0 (clang-703.0.29) default target x86_64-apple-darwin15.4.0
ignoring nonexistent directory "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/include/c++/v1"
ignoring nonexistent directory "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/local/include"
ignoring nonexistent directory "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/Library/Frameworks"
#include "..." search starts here:
#include <...> search starts here:
 /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1
 /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/7.3.0/include
 /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include
 /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/include
 /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/System/Library/Frameworks (framework directory)
End of search list.
# 1 "<stdin>"
# 1 "<built-in>" 1
# 1 "<built-in>" 3
# 336 "<built-in>" 3
# 1 "<command line>" 1
# 1 "<built-in>" 2
# 1 "<stdin>" 2

mmansour ~/Code/redex (master)
$ clang -Xlinker -v
@(#)PROGRAM:ld  PROJECT:ld64-264.3.101
configured to support archs: armv6 armv7 armv7s arm64 i386 x86_64 x86_64h armv6m armv7k armv7m armv7em (tvOS)
Library search paths:
    /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/lib
Framework search paths:
    /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/System/Library/Frameworks/
Undefined symbols for architecture x86_64:
  "_main", referenced from:
     implicit entry/start for main executable
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

mmansour ~/Code/redex (master)
mohamedmansour commented 8 years ago

I am compiling redex now in Ubuntu, and everything works there. So I have an alternate :)

bertmaher commented 8 years ago

I'm thinking the problem is that "Library search paths" doesn't include /usr/local/lib, which is where homebrew installs things, but I'm not quite sure how to convince clang to add that to the path (it was just there for me after installing Xcode)... will let you know if I come up with anything.

xiaomadada commented 8 years ago

@bertmaher echo $PATH /usr/local/bin:/usr/local/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin

checking for ceil in -ldouble-conversion... no configure: error: Please install double-conversion library

brew install double-conversion Warning: double-conversion-1.1.5 already installed

why?

jsdevjournal commented 8 years ago

same problem here

bertmaher commented 8 years ago

Can you try deleting the AC_CHECK_LIB([double-conversion], ... ) line from configure.ac?

sorab2142 commented 8 years ago

@bertmaher Deleting that line now gives the following error: configure: error: Please install google-glog library

bertmaher commented 8 years ago

Heh, how about if you delete the AC_LIB_CHECK([glog]) line after that? (You'll probably just hit the same error in the folly configure, but humor me)

jsdevjournal commented 8 years ago

after disable double-conversion and glog

now ...

configure: error: Please install google-gflags library

xiaomadada commented 8 years ago

@bertmaher checking for main in -lglog... no configure: error: Please install google-flog library ...... checking for main in -lgflags... no configure: error: Please install google-gflags library configure: error: ./configure failed for third-party/folly/folly ...... no way!

mohamedmansour commented 8 years ago

Same output as @xiaomadada

@bertmaher :) Deleting them relies ... Seems something missing, getting late here in bay area, maybe will help you tomorrow.


checking for main in -lgflags... no
configure: error: Please install google-gulags library
configure: error: ./configure failed for third-party/folly/folly
sorab2142 commented 8 years ago

same output as @xiaomadada checking for main in -lgflags... no configure: error: Please install google-gflags library configure: error: ./configure failed for third-party/folly/folly

shanenay commented 8 years ago

@mohamedmansour Most redex dev's mostly use OSX, so it wasn't a late-addition. Can't repro the issue locally after doing a brew update and then running through the brew installs on http://fbredex.com/.

@sorab2142 brew list gflags

sorab2142 commented 8 years ago

@shanenay output of brew list gflags is: usr/local/Cellar/gflags/2.1.2/bin/gflags_completions.sh /usr/local/Cellar/gflags/2.1.2/include/gflags/ (4 files) /usr/local/Cellar/gflags/2.1.2/lib/libgflags.2.1.2.dylib /usr/local/Cellar/gflags/2.1.2/lib/libgflags_nothreads.2.1.2.dylib /usr/local/Cellar/gflags/2.1.2/lib/cmake/ (4 files) /usr/local/Cellar/gflags/2.1.2/lib/ (4 other files)

shanenay commented 8 years ago

@sorab2142 g++ -E -x c++ - -v < /dev/null

We're thinking it could be an xtools issue. We're running older versions (6.0.1 for me yikes!, and Bert 7.0.1 IIRC). I'm doing some software updates so I can get up to 7.3.0 to see if I can repro it there.

bonnyfone commented 8 years ago

I had to set this line back inside configure.ac:

AC_CHECK_LIB([double-conversion], [main], ...

in order to reach the compile step.

maniramezan commented 8 years ago

@shanenay @sorab2142 as @bertmaher guessed it right, it's the issue with not having /usr/local/lib in the library search path. I ran xcode-select --install on terminal and after that everything worked and I could install redex. During installation I got another error which working through that now:

./../folly/io/async/ssl/OpenSSLPtrTypes.h:20:10: fatal error: 'openssl/evp.h' file not found

And I fixed that one with brew link --force openssl since I already had installed openssl through brew. Now I can run redex on Mac OSX

xiaomadada commented 8 years ago

@shanenay $ g++ -E -x c++ - -v < /dev/null Apple LLVM version 7.0.0 (clang-700.1.76) Target: x86_64-apple-darwin15.4.0 Thread model: posix "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang" -cc1 -triple x86_64-apple-macosx10.11.0 -Wdeprecated-objc-isa-usage -Werror=deprecated-objc-isa-usage -E -disable-free -disable-llvm-verifier -main-file-name - -mrelocation-model pic -pic-level 2 -mthread-model posix -mdisable-fp-elim -masm-verbose -munwind-tables -target-cpu core2 -target-linker-version 253.6 -v -dwarf-column-info -resource-dir /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/7.0.0 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk -stdlib=libc++ -fdeprecated-macro -fdebug-compilation-dir /Users/macminiserver/Documents/xmdd_android/redex -ferror-limit 19 -fmessage-length 80 -stack-protector 1 -mstackrealign -fblocks -fobjc-runtime=macosx-10.11.0 -fencode-extended-block-signature -fcxx-exceptions -fexceptions -fmax-type-align=16 -fdiagnostics-show-option -fcolor-diagnostics -o - -x c++ - clang -cc1 version 7.0.0 based upon LLVM 3.7.0svn default target x86_64-apple-darwin15.4.0 ignoring nonexistent directory "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/include/c++/v1" ignoring nonexistent directory "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/local/include" ignoring nonexistent directory "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/Library/Frameworks"

include "..." search starts here:

include <...> search starts here:

/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1 /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/7.0.0/include /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/include /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/System/Library/Frameworks (framework directory) End of search list.

1 ""

1 "" 1

1 "" 3

332 "" 3

1 "" 1

1 "" 2

1 "" 2

baiyulindeMac-mini:redex macminiserver$

benoitletondor commented 8 years ago

@maniramezan solution worked for me: xcode-select --install and brew link --force openssl. Thank you.

I also got this error: folly/portability/Malloc.h:28:12: error: unknown type name 'size_t'. I solved it by adding the #include <stddef.h> line into third-party/folly/folly/portability/Malloc.h.

sorab2142 commented 8 years ago

after xcode-select --install finished, attempting to compile now gives the following error:

In file included from ./../folly/io/async/AsyncTransport.h:26:
./../folly/io/async/ssl/OpenSSLPtrTypes.h:20:10: fatal error: 'openssl/evp.h'
      file not found
#include <openssl/evp.h>
         ^
xiaomadada commented 8 years ago

@benoitletondor I added #include <stddef.h> to /third_party/folly/folly/portability/Malloc.h; seems to do the trick. I suppose one ought to fix that in Folly itself, and not here.

herberthamaral commented 8 years ago

@xiaomadada didn't solve for me :(

marcosdiez commented 8 years ago

Just for the record, here ( Ubuntu ), I had this error fixed after typing

git revert 2a1b9609f48ebd64def6260e2018b3d476c2d9f0
benju69 commented 8 years ago

same issue here on mac :/

bertmaher commented 8 years ago

Could you please try compiling a test program with double-conversion? E.g.:

#include <stdio.h>
#include <double-conversion/double-conversion.h>

int main() {
  double_conversion::StringToDoubleConverter conv(0, 0.0, 0.0, "", "");
  int nchars;
  printf("%lf\n", conv.StringToDouble("3.14", 4, &nchars));
  return 0;
}

If this doesn't build OK with the command line:

g++ -ldouble-conversion test.cpp -o test && ./test

then the build environment isn't set up for command line builds anyways, and it's not a redex-specific problem.

bertmaher commented 8 years ago

@maniramezan: thanks! I had suspected that was the issue but didn't have a way to test. For those following along, the solution seems to be: xcode-select --install to get the command line tools set up.

I'll leave this issue open for a bit so others can find it.

stephanenicolas commented 8 years ago

Yep xcode-select --install did the trick @bertmaher , on 10.10.5 mac osx.

bertmaher commented 8 years ago

This is in the README now, thanks everybody who reported it!