Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't build in Mac OS Snow Leopard #49

Closed
GoogleCodeExporter opened this issue May 2, 2015 · 16 comments
Closed

Can't build in Mac OS Snow Leopard #49

GoogleCodeExporter opened this issue May 2, 2015 · 16 comments

Comments

@GoogleCodeExporter
Copy link

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
Copy link
Author

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

  • Changed state: Accepted

@GoogleCodeExporter
Copy link
Author

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
Copy link
Author

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
Copy link
Author

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
Copy link
Author

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
Copy link
Author

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

  • Changed state: WontFix

@GoogleCodeExporter
Copy link
Author

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
Copy link
Author

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

  • Changed state: Accepted

@GoogleCodeExporter
Copy link
Author

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
Copy link
Author

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
Copy link
Author

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
Copy link
Author

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
Copy link
Author

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
Copy link
Author

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
Copy link
Author

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
Copy link
Author

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

  • Changed state: Duplicate
  • Added labels: OpSys-OSX

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant