1

I am trying to install JPype into a Python virtual environment (running on Mountain Lion with Xcode and Command Line Tools installed; further system details below), but I keep winding up with a gcc error.

~: python setup.py install
running install
running build
running build_py
running build_ext
building '_jpype' extension
gcc -fno-strict-aliasing -fPIC -fno-common -dynamic -arch i386 -arch x86_64 -g -O2 -    DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -DMACOSX=1 -Isrc/native/common/include -    Isrc/native/python/include -        I/System/Library/Frameworks/JavaVM.framework/Versions/Current//Headers -I/System/Library/Frameworks/JavaVM.framework/Versions/Current//Headers/ -I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c     
src/native/common/jp_array.cpp -o build/temp.macosx-10.5-intel-2.7/src/native/common/jp_array.o
cc1plus: warning: command line option "-Wstrict-prototypes" is valid for Ada/C/ObjC but not for C++
src/native/common/jp_array.cpp: In member function ‘void JPArray::setRange(int, int, std::vector<HostRef*, std::allocator<HostRef*> >&)’:
src/native/common/jp_array.cpp:56: warning: comparison between signed and unsigned integer expressions
src/native/common/jp_array.cpp:68: warning: deprecated conversion from string constant to ‘char*’
src/native/common/jp_array.cpp: In member function ‘void JPArray::setItem(int, HostRef*)’:
src/native/common/jp_array.cpp:80: warning: deprecated conversion from string constant to ‘char*’
src/native/common/include/jp_utility.h: At global scope:
src/native/common/include/jp_utility.h: In instantiation of ‘std::basic_ostream<_CharT, _Traits>& std::operator<<(std::basic_ostream<_CharT, _Traits>&, const std::basic_string<_CharT, _Traits, _Alloc>&) [with _CharT = char, _Traits = std::char_traits<char>, _Alloc = std::allocator<char>]’:
src/native/common/include/jp_utility.h:38:   instantiated from here
src/native/common/include/jp_utility.h:38: error: explicit instantiation of ‘std::basic_ostream<_CharT, _Traits>& std::operator<<(std::basic_ostream<_CharT, _Traits>&, const std::basic_string<_CharT, _Traits, _Alloc>&) [with _CharT = char, _Traits = std::char_traits<char>, _Alloc = std::allocator<char>]’ but no definition available
src/native/common/include/jp_utility.h: In instantiation of ‘std::basic_ostream<_CharT, _Traits>& std::operator<<(std::basic_ostream<_CharT, _Traits>&, const std::basic_string<_CharT, _Traits, _Alloc>&) [with _CharT = char, _Traits = std::char_traits<char>, _Alloc = std::allocator<char>]’:
src/native/common/include/jp_utility.h:38:   instantiated from here
src/native/common/include/jp_utility.h:38: error: explicit instantiation of ‘std::basic_ostream<_CharT, _Traits>& std::operator<<(std::basic_ostream<_CharT, _Traits>&, const std::basic_string<_CharT, _Traits, _Alloc>&) [with _CharT = char, _Traits = std::char_traits<char>, _Alloc = std::allocator<char>]’ but no definition available
src/native/common/include/jp_utility.h: In instantiation of ‘std::basic_ostream<_CharT, _Traits>& std::operator<<(std::basic_ostream<_CharT, _Traits>&, const std::basic_string<_CharT, _Traits, _Alloc>&) [with _CharT = char, _Traits = std::char_traits<char>, _Alloc = std::allocator<char>]’:
src/native/common/include/jp_utility.h:38:   instantiated from here
src/native/common/include/jp_utility.h:38: error: explicit instantiation of ‘std::basic_ostream<_CharT, _Traits>& std::operator<<(std::basic_ostream<_CharT, _Traits>&, const std::basic_string<_CharT, _Traits, _Alloc>&) [with _CharT = char, _Traits = std::char_traits<char>, _Alloc = std::allocator<char>]’ but no definition available
cc1plus: warning: command line option "-Wstrict-prototypes" is valid for Ada/C/ObjC but not for C++
src/native/common/jp_array.cpp: In member function ‘void JPArray::setRange(int, int, std::vector<HostRef*, std::allocator<HostRef*> >&)’:
src/native/common/jp_array.cpp:56: warning: comparison between signed and unsigned integer expressions
src/native/common/jp_array.cpp:68: warning: deprecated conversion from string constant to ‘char*’
src/native/common/jp_array.cpp: In member function ‘void JPArray::setItem(int, HostRef*)’:
src/native/common/jp_array.cpp:80: warning: deprecated conversion from string constant to ‘char*’
src/native/common/include/jp_utility.h: At global scope:
src/native/common/include/jp_utility.h: In instantiation of ‘std::basic_ostream<_CharT, _Traits>& std::operator<<(std::basic_ostream<_CharT, _Traits>&, const std::basic_string<_CharT, _Traits, _Alloc>&) [with _CharT = char, _Traits = std::char_traits<char>, _Alloc = std::allocator<char>]’:
src/native/common/include/jp_utility.h:38:   instantiated from here
src/native/common/include/jp_utility.h:38: error: explicit instantiation of ‘std::basic_ostream<_CharT, _Traits>& std::operator<<(std::basic_ostream<_CharT, _Traits>&, const std::basic_string<_CharT, _Traits, _Alloc>&) [with _CharT = char, _Traits = std::char_traits<char>, _Alloc = std::allocator<char>]’ but no definition available
src/native/common/include/jp_utility.h: In instantiation of ‘std::basic_ostream<_CharT, _Traits>& std::operator<<(std::basic_ostream<_CharT, _Traits>&, const std::basic_string<_CharT, _Traits, _Alloc>&) [with _CharT = char, _Traits = std::char_traits<char>, _Alloc = std::allocator<char>]’:
src/native/common/include/jp_utility.h:38:   instantiated from here
src/native/common/include/jp_utility.h:38: error: explicit instantiation of ‘std::basic_ostream<_CharT, _Traits>& std::operator<<(std::basic_ostream<_CharT, _Traits>&, const std::basic_string<_CharT, _Traits, _Alloc>&) [with _CharT = char, _Traits = std::char_traits<char>, _Alloc = std::allocator<char>]’ but no definition available
src/native/common/include/jp_utility.h: In instantiation of ‘std::basic_ostream<_CharT, _Traits>& std::operator<<(std::basic_ostream<_CharT, _Traits>&, const std::basic_string<_CharT, _Traits, _Alloc>&) [with _CharT = char, _Traits = std::char_traits<char>, _Alloc = std::allocator<char>]’:
src/native/common/include/jp_utility.h:38:   instantiated from here
src/native/common/include/jp_utility.h:38: error: explicit instantiation of ‘std::basic_ostream<_CharT, _Traits>& std::operator<<(std::basic_ostream<_CharT, _Traits>&, const std::basic_string<_CharT, _Traits, _Alloc>&) [with _CharT = char, _Traits = std::char_traits<char>, _Alloc = std::allocator<char>]’ but no definition available
lipo: can't figure out the architecture type of: /var/folders/v_/cvy9b4hs2_ldpkx6dnxj2bnw0000gn/T//ccKkSzrC.out
error: command 'gcc' failed with exit status 1

As part of what I assume is good system hygiene, I've been trying to keep the installation in a virtual environment (~/virtualenvs/default/bin/python), but so far the only success I've had has been when I used sudo and the 2.6 system version of Python:

sudo /usr/bin/python2.6 setup.py install

Which produces packages:

running install
running build
running build_py
running build_ext
running install_lib
copying build/lib.macosx-10.8-intel-2.6/_jpype.so -> /Library/Python/2.6/site-packages
creating /Library/Python/2.6/site-packages/jpype
copying build/lib.macosx-10.8-intel-2.6/jpype/__init__.py -> /Library/Python/2.6/site-packages/jpype
copying build/lib.macosx-10.8-intel-2.6/jpype/_core.py -> /Library/Python/2.6/site-packages/jpype
copying build/lib.macosx-10.8-intel-2.6/jpype/_darwin.py -> /Library/Python/2.6/site-packages/jpype
copying build/lib.macosx-10.8-intel-2.6/jpype/_gui.py -> /Library/Python/2.6/site-packages/jpype
copying build/lib.macosx-10.8-intel-2.6/jpype/_jarray.py -> /Library/Python/2.6/site-packages/jpype
copying build/lib.macosx-10.8-intel-2.6/jpype/_jclass.py -> /Library/Python/2.6/site-packages/jpype
copying build/lib.macosx-10.8-intel-2.6/jpype/_jcollection.py -> /Library/Python/2.6/site-packages/jpype
copying build/lib.macosx-10.8-intel-2.6/jpype/_jexception.py -> /Library/Python/2.6/site-packages/jpype
copying build/lib.macosx-10.8-intel-2.6/jpype/_jobject.py -> /Library/Python/2.6/site-packages/jpype
copying build/lib.macosx-10.8-intel-2.6/jpype/_jpackage.py -> /Library/Python/2.6/site-packages/jpype
copying build/lib.macosx-10.8-intel-2.6/jpype/_jproxy.py -> /Library/Python/2.6/site-packages/jpype
copying build/lib.macosx-10.8-intel-2.6/jpype/_jwrapper.py -> /Library/Python/2.6/site-packages/jpype
copying build/lib.macosx-10.8-intel-2.6/jpype/_linux.py -> /Library/Python/2.6/site-packages/jpype
copying build/lib.macosx-10.8-intel-2.6/jpype/_properties.py -> /Library/Python/2.6/site-packages/jpype
copying build/lib.macosx-10.8-intel-2.6/jpype/_pykeywords.py -> /Library/Python/2.6/site-packages/jpype
copying build/lib.macosx-10.8-intel-2.6/jpype/_refdaemon.py -> /Library/Python/2.6/site-packages/jpype
copying build/lib.macosx-10.8-intel-2.6/jpype/_windows.py -> /Library/Python/2.6/site-packages/jpype
creating /Library/Python/2.6/site-packages/jpype/awt
copying build/lib.macosx-10.8-intel-2.6/jpype/awt/__init__.py -> /Library/Python/2.6/site-packages/jpype/awt
creating /Library/Python/2.6/site-packages/jpype/awt/event
copying build/lib.macosx-10.8-intel-2.6/jpype/awt/event/__init__.py -> /Library/Python/2.6/site-packages/jpype/awt/event
copying build/lib.macosx-10.8-intel-2.6/jpype/awt/event/WindowAdapter.py -> /Library/Python/2.6/site-packages/jpype/awt/event
copying build/lib.macosx-10.8-intel-2.6/jpype/findjvm.py -> /Library/Python/2.6/site-packages/jpype
copying build/lib.macosx-10.8-intel-2.6/jpype/JClassUtil.py -> /Library/Python/2.6/site-packages/jpype
copying build/lib.macosx-10.8-intel-2.6/jpype/nio.py -> /Library/Python/2.6/site-packages/jpype
copying build/lib.macosx-10.8-intel-2.6/jpype/reflect.py -> /Library/Python/2.6/site-packages/jpype
creating /Library/Python/2.6/site-packages/jpypex
copying build/lib.macosx-10.8-intel-2.6/jpypex/__init__.py -> /Library/Python/2.6/site-packages/jpypex
creating /Library/Python/2.6/site-packages/jpypex/swing
copying build/lib.macosx-10.8-intel-2.6/jpypex/swing/__init__.py -> /Library/Python/2.6/site-packages/jpypex/swing
copying build/lib.macosx-10.8-intel-2.6/jpypex/swing/AbstractAction.py -> /Library/Python/2.6/site-packages/jpypex/swing
copying build/lib.macosx-10.8-intel-2.6/jpypex/swing/pyutils.py -> /Library/Python/2.6/site-packages/jpypex/swing
byte-compiling /Library/Python/2.6/site-packages/jpype/__init__.py to __init__.pyc
byte-compiling /Library/Python/2.6/site-packages/jpype/_core.py to _core.pyc
byte-compiling /Library/Python/2.6/site-packages/jpype/_darwin.py to _darwin.pyc
byte-compiling /Library/Python/2.6/site-packages/jpype/_gui.py to _gui.pyc
byte-compiling /Library/Python/2.6/site-packages/jpype/_jarray.py to _jarray.pyc
byte-compiling /Library/Python/2.6/site-packages/jpype/_jclass.py to _jclass.pyc
byte-compiling /Library/Python/2.6/site-packages/jpype/_jcollection.py to _jcollection.pyc
byte-compiling /Library/Python/2.6/site-packages/jpype/_jexception.py to _jexception.pyc
byte-compiling /Library/Python/2.6/site-packages/jpype/_jobject.py to _jobject.pyc
byte-compiling /Library/Python/2.6/site-packages/jpype/_jpackage.py to _jpackage.pyc
byte-compiling /Library/Python/2.6/site-packages/jpype/_jproxy.py to _jproxy.pyc
byte-compiling /Library/Python/2.6/site-packages/jpype/_jwrapper.py to _jwrapper.pyc
byte-compiling /Library/Python/2.6/site-packages/jpype/_linux.py to _linux.pyc
byte-compiling /Library/Python/2.6/site-packages/jpype/_properties.py to _properties.pyc
byte-compiling /Library/Python/2.6/site-packages/jpype/_pykeywords.py to _pykeywords.pyc
byte-compiling /Library/Python/2.6/site-packages/jpype/_refdaemon.py to _refdaemon.pyc
byte-compiling /Library/Python/2.6/site-packages/jpype/_windows.py to _windows.pyc
byte-compiling /Library/Python/2.6/site-packages/jpype/awt/__init__.py to __init__.pyc
byte-compiling /Library/Python/2.6/site-packages/jpype/awt/event/__init__.py to __init__.pyc
byte-compiling /Library/Python/2.6/site-packages/jpype/awt/event/WindowAdapter.py to WindowAdapter.pyc
byte-compiling /Library/Python/2.6/site-packages/jpype/findjvm.py to findjvm.pyc
byte-compiling /Library/Python/2.6/site-packages/jpype/JClassUtil.py to JClassUtil.pyc
byte-compiling /Library/Python/2.6/site-packages/jpype/nio.py to nio.pyc
byte-compiling /Library/Python/2.6/site-packages/jpype/reflect.py to reflect.pyc
byte-compiling /Library/Python/2.6/site-packages/jpypex/__init__.py to __init__.pyc
byte-compiling /Library/Python/2.6/site-packages/jpypex/swing/__init__.py to __init__.pyc
byte-compiling /Library/Python/2.6/site-packages/jpypex/swing/AbstractAction.py to AbstractAction.pyc
byte-compiling /Library/Python/2.6/site-packages/jpypex/swing/pyutils.py to pyutils.pyc
running install_egg_info
Writing /Library/Python/2.6/site-packages/JPype-0.5.4.2-py2.6.egg-info

Since copying and pasting the site-packages created in this process into my virtual environment doesn't seem to work, I'm looking for a solution that lets me use the virtual environment and the ActiveState Python I'm using on my computer but doesn't produce a gcc error.

I have also consulted and tried the recommendations from the following stackoverflow post to no avail:

How to install JPype on OS X Lion to use with Neo4j? (this one directly addresses my problem, but doesn't seem to solve it in Mountain Lion)

I've also made sure I'm using the newest JPype setup file, which should be Mountain Lion compatible:

https://github.com/originell/jpype/blob/142cea8ac3924187bcde9057bab62cce15354e37/setup.py

However, after trying the various solutions currently available online, including reinstalling Xcode and using

export CC=/usr/bin/g++ 

to try to force the usage of a different compiler, nothing has worked so far.

**Python Details:**
ActivePython 2.7.2.5 (ActiveState Software Inc.) based on
Python 2.7.2 (default, Jun 24 2011, 12:20:15) 
[GCC 4.2.1 (Apple Inc. build 5664)] on darwin

**Java Details:**
java version "1.6.0_35"
Java(TM) SE Runtime Environment (build 1.6.0_35-b10-428-11M3811)
Java HotSpot(TM) 64-Bit Server VM (build 20.10-b01-428, mixed mode)
Community
  • 1
  • 1

0 Answers0