marylinh / pyv8

Automatically exported from code.google.com/p/pyv8
0 stars 0 forks source link

Can't build in Mac OS Snow Leopard #49

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Malic:pyv8-read-only Malic$ python setup.py install
running install
running build
running build_py
running build_ext
building '_PyV8' extension
gcc -arch ppc -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk 
-fno-strict-aliasing -
fno-common -dynamic -DNDEBUG -g -O3 -DBOOST_PYTHON_STATIC_LIB -
DV8_NATIVE_REGEXP -DENABLE_DISASSEMBLER -DENABLE_LOGGING_AND_PROFILING -
DENABLE_DEBUGGER_SUPPORT -DV8_TARGET_ARCH_IA32 -
I/users/malic/code/python/v8/include -I/users/malic/code/python/v8 -
I/users/malic/code/python/v8/src -I/opt/local/include -
I/Library/Frameworks/Python.framework/Versions/2.6/include/python2.6 -c 
src/Exception.cpp 
-o build/temp.macosx-10.3-fat-2.6/src/Exception.o
In file included from src/Exception.cpp:1:
src/Exception.h:3:19: error: cassert: No such file or directory
src/Exception.h:4:21: error: stdexcept: No such file or directory
src/Exception.h:18:17: error: cmath: No such file or directory
src/Exception.h:23:28: error: boost/python.hpp: No such file or directory
src/Exception.cpp:3:19: error: sstream: No such file or directory
In file included from /users/malic/code/python/v8/src/v8.h:56,
                 from src/Exception.cpp:15:
/users/malic/code/python/v8/src/globals.h:53:2: error: #error Host architecture 
was not 
detected as supported by v8
/users/malic/code/python/v8/src/globals.h:58:2: error: #error Target 
architecture ia32 is only 
supported on ia32 host
In file included from /users/malic/code/python/v8/src/platform.h:96,
                 from /users/malic/code/python/v8/src/log.h:31,
                 from /users/malic/code/python/v8/src/spaces.h:32,
                 from /users/malic/code/python/v8/src/v8.h:64,
                 from src/Exception.cpp:15:
/Developer/SDKs/MacOSX10.4u.sdk/usr/include/stdarg.h:4:25: error: stdarg.h: No 
such file or 
directory
In file included from /users/malic/code/python/v8/src/conversions-inl.h:32,
                 from /users/malic/code/python/v8/src/objects-inl.h:40,
                 from /users/malic/code/python/v8/src/v8.h:66,
                 from src/Exception.cpp:15:
/Developer/SDKs/MacOSX10.4u.sdk/usr/include/float.h:8:24: error: float.h: No 
such file or 
directory
In file included from src/Exception.cpp:1:
src/Exception.h:19: error: ‘std::isnan’ has not been declared
src/Exception.h:24: error: ‘boost’ has not been declared
src/Exception.h:24: error: ‘python’ is not a namespace-name
src/Exception.h:24: error: expected namespace-name before ‘;’ token
In file included from src/Exception.cpp:1:
src/Exception.h:38: error: ‘PyGILState_STATE’ does not name a type
src/Exception.h:50: error: expected ‘;’ before ‘(’ token
src/Exception.h:51: error: ‘PyObject’ has not been declared
src/Exception.h:51: error: ‘py’ has not been declared
src/Exception.h:51: error: expected ‘,’ or ‘...’ before ‘*’ token
src/Exception.h:55: error: expected class-name before ‘{’ token
and bunch of other errors

gcc --version
i686-apple-darwin10-gcc-4.2.1 (GCC) 4.2.1 (Apple Inc. build 5657)

Original issue reported on code.google.com by overbom...@gmail.com on 2 May 2010 at 4:01

GoogleCodeExporter commented 9 years ago

Original comment by flier...@gmail.com on 3 May 2010 at 11:29

GoogleCodeExporter commented 9 years ago
I've having the same problem.   Any advice would be great. 

daniel-yaminss-macbook-pro:pyv8-read-only dyamins$ python setup.py install
running install
running build
running build_py
creating build
creating build/lib.macosx-10.5-intel-2.6
copying PyV8.py -> build/lib.macosx-10.5-intel-2.6
running build_ext
building '_PyV8' extension
creating build/temp.macosx-10.5-intel-2.6
creating build/temp.macosx-10.5-intel-2.6/src
/usr/bin/gcc-4.0 -arch i386 -arch x86_64 -isysroot / -fno-strict-aliasing 
-fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes 
-DBOOST_PYTHON_STATIC_LIB -DV8_NATIVE_REGEXP -DENABLE_DISASSEMBLER 
-DENABLE_LOGGING_AND_PROFILING -DENABLE_DEBUGGER_SUPPORT -DV8_TARGET_ARCH_IA32 
-I/Users/dyamins/v8/include -I/Users/dyamins/v8 -I/Users/dyamins/v8/src 
-I/opt/local/include 
-I/opt/local/Library/Frameworks/Python.framework/Versions/2.6/include/python2.6 
-c src/Exception.cpp -o build/temp.macosx-10.5-intel-2.6/src/Exception.o
cc1plus: warning: command line option "-Wstrict-prototypes" is valid for C/ObjC 
but not for C++cc1plus: warning: command line option "-Wstrict-prototypes" is 
valid for C/ObjC but not for C++

In file included from /Users/dyamins/v8/src/v8.h:56,
                 from src/Exception.cpp:15:
/Users/dyamins/v8/src/globals.h:82:2: error: #error Target architecture ia32 is 
only supported on ia32 host
src/Exception.cpp: In static member function ‘static void 
ExceptionTranslator::Construct(PyObject*, 
boost::python::converter::rvalue_from_python_stage1_data*)’:
src/Exception.cpp:262: warning: unused variable ‘cpp_err’
src/Exception.cpp: In static member function ‘static void 
ExceptionTranslator::Construct(PyObject*, 
boost::python::converter::rvalue_from_python_stage1_data*)’:
src/Exception.cpp:262: warning: unused variable ‘cpp_err’
lipo: can't figure out the architecture type of: 
/var/folders/bg/bgz2csGfGV8iJu5gTN+tdU+++TI/-Tmp-//ccpbLMZP.out
error: command '/usr/bin/gcc-4.0' failed with exit status 1

Original comment by dyam...@gmail.com on 15 Jun 2010 at 2:39

GoogleCodeExporter commented 9 years ago
Sorry, I haven't MAC OS X environment, But I think I could try to find one and 
fix it, thanks

Original comment by flier...@gmail.com on 15 Jun 2010 at 2:47

GoogleCodeExporter commented 9 years ago
But do you have any sense of why it's happening?   Normally I get such errors 
when some library wasn't compiled 64-bit.  

Btw, I'm using OSX 10.5, Leopard (not Snow Leopard 10.6)

Original comment by dyam...@gmail.com on 15 Jun 2010 at 3:46

GoogleCodeExporter commented 9 years ago
Did you build v8 with x64 mode? Google v8 support ia32, x64 and mips 
architecture.

export CCFLAGS=-fPIC
scons arch=x64

I found the following error in your log

/Users/dyamins/v8/src/globals.h:82:2: error: #error Target architecture ia32 is 
only supported on ia32 host

Original comment by flier...@gmail.com on 15 Jun 2010 at 3:52

GoogleCodeExporter commented 9 years ago
Hi dyamins, 

  How about your build? Was it caused by the x64 mode?

Original comment by flier...@gmail.com on 17 Jun 2010 at 11:18

GoogleCodeExporter commented 9 years ago
Yes, I did use those flags when I built v8. 

When I built it in regular mode, the resulting binary (e.g. libv8.a) was 
broken, due to some 64-bit architecture issue.  However, when I built it in 
debug mode ("scons arch=x64 debug=true"), the resulting binary (libv8_g.a) 
works fine -- independently of pyv8.   I wrote to the v8 list but did not get a 
satisfactory answer.  

I then deleted the original binary, and tried to rebuild pyv8, hoping the new 
binary  file would work, but it didnt -- I got the same problem. 

Original comment by dyam...@gmail.com on 25 Jun 2010 at 2:55

GoogleCodeExporter commented 9 years ago
Could you check the following document? Chrome also need V8 on Mac OS X

http://code.google.com/p/chromium/wiki/MacBuildInstructions

I think I must find a OS X to reproduce it :S

Original comment by flier...@gmail.com on 25 Jun 2010 at 3:01

GoogleCodeExporter commented 9 years ago
I had a look at that link, but I'm not sure what you wanted me to do with it :) 

Yeah, I think you're probably right, you'll probably have to just try it 
yourself ...   thanks for the help tho! (I have it working on my ubuntu box, no 
problem, so ...)

Original comment by dyam...@gmail.com on 25 Jun 2010 at 4:18

GoogleCodeExporter commented 9 years ago
This appears to be because Apple's GCC supports multiple -arch targets on one 
invocation. python-config --cflags returns:

-I/System/Library/Frameworks/Python.framework/Versions/2.6/include/python2.6 
-I/System/Library/Frameworks/Python.framework/Versions/2.6/include/python2.6 
-fno-strict-aliasing -fno-common -dynamic -DNDEBUG -g -fwrapv -Os -Wall 
-Wstrict-prototypes -DENABLE_DTRACE -arch i386 -arch ppc -arch x86_64

Note that all three Mac architectures are present.

These flags confuse V8's architecture detection when passed 
-DV8_TARGET_ARCH_X64 as gcc first compiles in i386 mode, then ppc, then x86_64. 
I don't know what the solution is.

Original comment by alecatho...@gmail.com on 25 Jul 2010 at 8:46

GoogleCodeExporter commented 9 years ago
I've found a solution.

export ARCHFLAGS='-arch x86_64'  # (or whatever arch you want)

This will force compilation for a specific architecture. setup.py still needs 
some minor hacking to buid cleanly.

Original comment by alecatho...@gmail.com on 22 Aug 2010 at 4:44

GoogleCodeExporter commented 9 years ago
That's sounds great, could you contribute a patch to the setup.py and 
HowToBuild wiki? 

Thanks

Original comment by flier...@gmail.com on 22 Aug 2010 at 4:48

GoogleCodeExporter commented 9 years ago
I will, definitely.

What revisions of V8 and PyV8 will currently work together? I can't build 
either PyV8 0.9 or head against current V8 head. 

Original comment by alecatho...@gmail.com on 23 Aug 2010 at 12:16

GoogleCodeExporter commented 9 years ago
It caused by v8 which changed the method signature of IndexedPropertyQuery

from 

typedef Handle<Boolean> (*IndexedPropertyQuery)(uint32_t index,
                                                const AccessorInfo& info);

to 

typedef Handle<Integer> (*IndexedPropertyQuery)(uint32_t index,
                                                const AccessorInfo& info);

Please try to use PyV8 from SVN trunk after r272

http://code.google.com/p/pyv8/source/detail?r=272

Original comment by flier...@gmail.com on 23 Aug 2010 at 1:35

GoogleCodeExporter commented 9 years ago
Okay, it's all working! I've attached the patch to 
http://code.google.com/p/pyv8/issues/detail?id=57

Original comment by alecatho...@gmail.com on 23 Aug 2010 at 2:54

GoogleCodeExporter commented 9 years ago
Alec has submitted a patch for Snow Leopard in issues #57, just merge those 
issues

Original comment by flier...@gmail.com on 9 Sep 2010 at 6:12