Jump to content


Problem installing P4python

api p4api python rhel

  • Please log in to reply
2 replies to this topic

#1 Julian

Julian

    Newbie

  • Members
  • Pip
  • 2 posts

Posted 08 October 2014 - 02:16 PM

I am getting wierd errors

I don't know if I have done p4api right I just unzipped it (nothing else)

gcc -v
Using built-in specs.
Target: x86_64-redhat-linux
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-bootstrap --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-languages=c,c++,objc,obj-c++,java,fortran,ada --enable-java-awt=gtk --disable-dssi --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-1.5.0.0/jre --enable-libgcj-multifile --enable-java-maintainer-mode --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --disable-libjava-multilib --with-ppl --with-cloog --with-tune=generic --with-arch_32=i686 --build=x86_64-redhat-linux
Thread model: posix
gcc version 4.4.7 20120313 (Red Hat 4.4.7-4) (GCC)

python
Python 2.6.6 (r266:84292, Nov 21 2013, 10:50:32)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-4)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>>

python setup.py  build --apidir /usr/local/p4/p4api-2014.1.821990
API Release 2014.1
running build
running build_py
creating build
creating build/lib.linux-x86_64-2.6
copying P4.py -> build/lib.linux-x86_64-2.6
running build_ext
building 'P4API' extension
creating build/temp.linux-x86_64-2.6
gcc -pthread -fno-strict-aliasing -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -DID_OS="LINUX26X86_64" -DID_REL="2014.1" -DID_PATCH="925900" -DID_API="2014.1/821990" -DID_Y="2014" -DID_M="08" -DID_D="26" -I/usr/local/p4/p4api-2014.1.821990 -I/usr/local/p4/p4api-2014.1.821990/include/p4 -I/usr/include/python2.6 -c P4API.cpp -o build/temp.linux-x86_64-2.6/P4API.o -DOS_LINUX -DOS_LINUX26 -DOS_LINUXX86_64 -DOS_LINUX26X86_64
P4API.cpp:39:20: error: Python.h: No such file or directory
P4API.cpp:40:25: error: bytesobject.h: No such file or directory
P4API.cpp:41:26: error: structmember.h: No such file or directory
In file included from P4API.cpp:43:
python2to3.h:63: error: expected initializer before â*â token
python2to3.h:67: error: expected initializer before â*â token
python2to3.h:71: error: âIsStringâ declared as an âinlineâ variable
python2to3.h:71: error: âPyObjectâ was not declared in this scope
python2to3.h:71: error: âobjâ was not declared in this scope
python2to3.h:71: error: expected â,â or â;â before â{â token
python2to3.h:75: error: âGetPythonStringâ declared as an âinlineâ variable
python2to3.h:75: error: âPyObjectâ was not declared in this scope
python2to3.h:75: error: âobjâ was not declared in this scope
python2to3.h:75: error: expected â,â or â;â before â{â token
In file included from P4API.cpp:49:
SpecMgr.h:55: error: ISO C++ forbids declaration of âPyObjectâ with no type
SpecMgr.h:55: error: expected â;â before â*â token
SpecMgr.h:56: error: ISO C++ forbids declaration of âPyObjectâ with no type
SpecMgr.h:56: error: expected â;â before â*â token
SpecMgr.h:71: error: ISO C++ forbids declaration of âPyObjectâ with no type
SpecMgr.h:71: error: expected â;â before â*â token
SpecMgr.h:77: error: âPyObjectâ has not been declared
SpecMgr.h:84: error: ISO C++ forbids declaration of âPyObjectâ with no type
SpecMgr.h:84: error: expected â;â before â*â token
SpecMgr.h:85: error: ISO C++ forbids declaration of âPyObjectâ with no type
SpecMgr.h:85: error: expected â;â before â*â token
SpecMgr.h:93: error: ISO C++ forbids declaration of âPyObjectâ with no type
SpecMgr.h:93: error: expected â;â before â*â token
SpecMgr.h:100: error: ISO C++ forbids declaration of âPyObjectâ with no type
SpecMgr.h:100: error: expected â;â before â*â token
SpecMgr.h:105: error: âPyObjectâ has not been declared
SpecMgr.h:106: error: âPyObjectâ has not been declared
SpecMgr.h:107: error: ISO C++ forbids declaration of âPyObjectâ with no type
SpecMgr.h:107: error: expected â;â before â*â token
SpecMgr.h:108: error: ISO C++ forbids declaration of âPyObjectâ with no type
SpecMgr.h:108: error: expected â;â before â*â token
In file included from P4API.cpp:50:
P4Result.h:44: error: âPyObjectâ has not been declared
P4Result.h:45: error: âPyObjectâ has not been declared
P4Result.h:51: error: ISO C++ forbids declaration of âPyObjectâ with no type
P4Result.h:51: error: expected â;â before â*â token
P4Result.h:52: error: ISO C++ forbids declaration of âPyObjectâ with no type
P4Result.h:52: error: expected â;â before â*â token
P4Result.h:53: error: expected â;â before âPyObjectâ
P4Result.h:53: error: ISO C++ forbids declaration of âPyObjectâ with no type
P4Result.h:53: error: expected â;â before â*â token
P4Result.h:54: error: expected â;â before âPyObjectâ
P4Result.h:54: error: ISO C++ forbids declaration of âPyObjectâ with no type
P4Result.h:54: error: expected â;â before â*â token
P4Result.h:55: error: expected â;â before âPyObjectâ
P4Result.h:55: error: ISO C++ forbids declaration of âPyObjectâ with no type
P4Result.h:55: error: expected â;â before â*â token
P4Result.h:58: error: expected â;â before âvoidâ
P4Result.h:70: error: ISO C++ forbids declaration of âPyObjectâ with no type
P4Result.h:70: error: expected â;â before â*â token
P4Result.h:72: error: expected â;â before âprivateâ
P4Result.h:73: error: âPyObjectâ has not been declared
P4Result.h:74: error: âPyObjectâ has not been declared
P4Result.h:75: error: âPyObjectâ has not been declared
P4Result.h:77: error: ISO C++ forbids declaration of âPyObjectâ with no type
P4Result.h:77: error: expected â;â before â*â token
P4Result.h:78: error: ISO C++ forbids declaration of âPyObjectâ with no type
P4Result.h:78: error: expected â;â before â*â token
P4Result.h:79: error: ISO C++ forbids declaration of âPyObjectâ with no type
P4Result.h:79: error: expected â;â before â*â token
P4Result.h:80: error: ISO C++ forbids declaration of âPyObjectâ with no type
P4Result.h:80: error: expected â;â before â*â token
P4Result.h:81: error: ISO C++ forbids declaration of âPyObjectâ with no type
P4Result.h:81: error: expected â;â before â*â token
In file included from P4API.cpp:51:
PythonClientUser.h:71: error: ISO C++ forbids declaration of âPyObjectâ with no type
PythonClientUser.h:71: error: expected â;â before â*â token
PythonClientUser.h:72: error: ISO C++ forbids declaration of âPyObjectâ with no type
PythonClientUser.h:72: error: expected â;â before â*â token
PythonClientUser.h:74: error: expected â;â before âPyObjectâ
PythonClientUser.h:74: error: ISO C++ forbids declaration of âPyObjectâ with no type
PythonClientUser.h:74: error: expected â;â before â*â token
PythonClientUser.h:75: error: ISO C++ forbids declaration of âPyObjectâ with no type
PythonClientUser.h:75: error: expected â;â before â*â token
PythonClientUser.h:77: error: expected â;â before âPyObjectâ
PythonClientUser.h:77: error: ISO C++ forbids declaration of âPyObjectâ with no type
PythonClientUser.h:77: error: expected â;â before â*â token
PythonClientUser.h:78: error: ISO C++ forbids declaration of âPyObjectâ with no type
PythonClientUser.h:78: error: expected â;â before â*â token
PythonClientUser.h:80: error: expected â;â before âPyObjectâ
PythonClientUser.h:80: error: ISO C++ forbids declaration of âPyObjectâ with no type
PythonClientUser.h:80: error: expected â;â before â*â token
PythonClientUser.h:81: error: ISO C++ forbids declaration of âPyObjectâ with no type
PythonClientUser.h:81: error: expected â;â before â*â token
PythonClientUser.h:83: error: expected â;â before âvoidâ
PythonClientUser.h:98: error: ISO C++ forbids declaration of âPyObjectâ with no type
PythonClientUser.h:98: error: expected â;â before â*â token
PythonClientUser.h:99: error: ISO C++ forbids declaration of âPyObjectâ with no type
PythonClientUser.h:99: error: expected â;â before â*â token
PythonClientUser.h:100: error: âPyObjectâ has not been declared
PythonClientUser.h:102: error: âPyObjectâ has not been declared
PythonClientUser.h:108: error: ISO C++ forbids declaration of âPyObjectâ with no type
PythonClientUser.h:108: error: expected â;â before â*â token
PythonClientUser.h:109: error: ISO C++ forbids declaration of âPyObjectâ with no type
PythonClientUser.h:109: error: expected â;â before â*â token
PythonClientUser.h:110: error: ISO C++ forbids declaration of âPyObjectâ with no type
PythonClientUser.h:110: error: expected â;â before â*â token
PythonClientUser.h:111: error: ISO C++ forbids declaration of âPyObjectâ with no type
PythonClientUser.h:111: error: expected â;â before â*â token
In file included from P4API.cpp:52:
PythonClientAPI.h:53: error: âPyObjectâ has not been declared
PythonClientAPI.h:54: error: ISO C++ forbids declaration of âPyObjectâ with no type
PythonClientAPI.h:54: error: expected â;â before â*â token
PythonClientAPI.h:72: error: âobjgetterâ does not name a type
PythonClientAPI.h:116: error: ISO C++ forbids declaration of âPyObjectâ with no type
PythonClientAPI.h:116: error: expected â;â before â*â token
PythonClientAPI.h:153: error: ISO C++ forbids declaration of âPyObjectâ with no type
PythonClientAPI.h:153: error: expected â;â before â*â token
PythonClientAPI.h:154: error: ISO C++ forbids declaration of âPyObjectâ with no type
PythonClientAPI.h:154: error: expected â;â before â*â token
PythonClientAPI.h:155: error: ISO C++ forbids declaration of âPyObjectâ with no type
PythonClientAPI.h:155: error: expected â;â before â*â token
PythonClientAPI.h:157: error: ISO C++ forbids declaration of âPyObjectâ with no type
PythonClientAPI.h:157: error: expected â;â before â*â token
PythonClientAPI.h:158: error: ISO C++ forbids declaration of âPyObjectâ with no type
PythonClientAPI.h:158: error: expected â;â before â*â token
PythonClientAPI.h:159: error: ISO C++ forbids declaration of âPyObjectâ with no type
PythonClientAPI.h:159: error: expected â;â before â*â token
PythonClientAPI.h:161: error: ISO C++ forbids declaration of âPyObjectâ with no type
PythonClientAPI.h:161: error: expected â;â before â*â token
PythonClientAPI.h:163: error: ISO C++ forbids declaration of âPyObjectâ with no type
PythonClientAPI.h:163: error: expected â;â before â*â token
PythonClientAPI.h:166: error: ISO C++ forbids declaration of âPyObjectâ with no type
PythonClientAPI.h:166: error: expected â;â before â*â token
PythonClientAPI.h:167: error: âPyObjectâ has not been declared
PythonClientAPI.h:168: error: ISO C++ forbids declaration of âPyObjectâ with no type
PythonClientAPI.h:168: error: expected â;â before â*â token
PythonClientAPI.h:170: error: âPyObjectâ has not been declared
PythonClientAPI.h:171: error: ISO C++ forbids declaration of âPyObjectâ with no type
PythonClientAPI.h:171: error: expected â;â before â*â token
PythonClientAPI.h:174: error: âPyObjectâ has not been declared
PythonClientAPI.h:175: error: ISO C++ forbids declaration of âPyObjectâ with no type
PythonClientAPI.h:175: error: expected â;â before â*â token
PythonClientAPI.h:178: error: âPyObjectâ has not been declared
PythonClientAPI.h:179: error: ISO C++ forbids declaration of âPyObjectâ with no type
PythonClientAPI.h:179: error: expected â;â before â*â token
PythonClientAPI.h:182: error: ISO C++ forbids declaration of âPyObjectâ with no type
PythonClientAPI.h:182: error: expected â;â before â*â token
PythonClientAPI.h:183: error: expected â;â before âPyObjectâ
PythonClientAPI.h:183: error: ISO C++ forbids declaration of âPyObjectâ with no type
PythonClientAPI.h:183: error: expected â;â before â*â token
PythonClientAPI.h:184: error: expected â;â before âPyObjectâ
PythonClientAPI.h:184: error: ISO C++ forbids declaration of âPyObjectâ with no type
PythonClientAPI.h:184: error: expected â;â before â*â token
PythonClientAPI.h:185: error: expected â;â before âPyObjectâ
PythonClientAPI.h:185: error: ISO C++ forbids declaration of âPyObjectâ with no type
PythonClientAPI.h:185: error: expected â;â before â*â token
PythonClientAPI.h:195: error: expected â;â before âPyObjectâ
PythonClientAPI.h:195: error: ISO C++ forbids declaration of âPyObjectâ with no type
PythonClientAPI.h:195: error: expected â;â before â*â token
PythonClientAPI.h:198: error: ISO C++ forbids declaration of âPyObjectâ with no type
PythonClientAPI.h:198: error: expected â;â before â*â token
PythonClientAPI.h:199: error: ISO C++ forbids declaration of âPyObjectâ with no type
PythonClientAPI.h:199: error: expected â;â before â*â token
PythonClientAPI.h:200: error: ISO C++ forbids declaration of âPyObjectâ with no type
PythonClientAPI.h:200: error: expected â;â before â*â token
PythonClientAPI.h:203: error: ISO C++ forbids declaration of âPyObjectâ with no type
PythonClientAPI.h:203: error: expected â;â before â*â token
PythonClientAPI.h:204: error: ISO C++ forbids declaration of âPyObjectâ with no type
PythonClientAPI.h:204: error: expected â;â before â*â token
PythonClientAPI.h:227: error: âobjgetterâ does not name a type
PythonClientAPI.h:235: error: ISO C++ forbids declaration of âPyObjectâ with no type
PythonClientAPI.h:235: error: expected â;â before â*â token
In file included from P4API.cpp:53:
PythonMergeData.h:47: error: ISO C++ forbids declaration of âPyObjectâ with no type
PythonMergeData.h:47: error: expected â;â before â*â token
PythonMergeData.h:48: error: ISO C++ forbids declaration of âPyObjectâ with no type
PythonMergeData.h:48: error: expected â;â before â*â token
PythonMergeData.h:49: error: ISO C++ forbids declaration of âPyObjectâ with no type
PythonMergeData.h:49: error: expected â;â before â*â token
PythonMergeData.h:51: error: ISO C++ forbids declaration of âPyObjectâ with no type
PythonMergeData.h:51: error: expected â;â before â*â token
PythonMergeData.h:52: error: ISO C++ forbids declaration of âPyObjectâ with no type
PythonMergeData.h:52: error: expected â;â before â*â token
PythonMergeData.h:53: error: ISO C++ forbids declaration of âPyObjectâ with no type
PythonMergeData.h:53: error: expected â;â before â*â token
PythonMergeData.h:54: error: ISO C++ forbids declaration of âPyObjectâ with no type
PythonMergeData.h:54: error: expected â;â before â*â token
PythonMergeData.h:56: error: ISO C++ forbids declaration of âPyObjectâ with no type
PythonMergeData.h:56: error: expected â;â before â*â token
PythonMergeData.h:58: error: ISO C++ forbids declaration of âPyObjectâ with no type
PythonMergeData.h:58: error: expected â;â before â*â token
In file included from P4API.cpp:54:
PythonActionMergeData.h:36: error: âPyObjectâ has not been declared
PythonActionMergeData.h:41: error: ISO C++ forbids declaration of âPyObjectâ with no type
PythonActionMergeData.h:41: error: expected â;â before â*â token
PythonActionMergeData.h:42: error: ISO C++ forbids declaration of âPyObjectâ with no type
PythonActionMergeData.h:42: error: expected â;â before â*â token
PythonActionMergeData.h:43: error: ISO C++ forbids declaration of âPyObjectâ with no type
PythonActionMergeData.h:43: error: expected â;â before â*â token
PythonActionMergeData.h:44: error: ISO C++ forbids declaration of âPyObjectâ with no type
PythonActionMergeData.h:44: error: expected â;â before â*â token
PythonActionMergeData.h:46: error: ISO C++ forbids declaration of âPyObjectâ with no type
PythonActionMergeData.h:46: error: expected â;â before â*â token
PythonActionMergeData.h:47: error: ISO C++ forbids declaration of âPyObjectâ with no type
PythonActionMergeData.h:47: error: expected â;â before â*â token
PythonActionMergeData.h:56: error: ISO C++ forbids declaration of âPyObjectâ with no type
PythonActionMergeData.h:56: error: expected â;â before â*â token
In file included from P4API.cpp:55:
P4MapMaker.h:48: error: âPyObjectâ has not been declared
P4MapMaker.h:49: error: âPyObjectâ has not been declared
P4MapMaker.h:49: error: âPyObjectâ has not been declared
P4MapMaker.h:54: error: ISO C++ forbids declaration of âPyObjectâ with no type
P4MapMaker.h:54: error: expected â;â before â*â token
P4MapMaker.h:55: error: ISO C++ forbids declaration of âPyObjectâ with no type
P4MapMaker.h:55: error: expected â;â before â*â token
P4MapMaker.h:56: error: ISO C++ forbids declaration of âPyObjectâ with no type
P4MapMaker.h:56: error: expected â;â before â*â token
P4MapMaker.h:57: error: ISO C++ forbids declaration of âPyObjectâ with no type
P4MapMaker.h:57: error: expected â;â before â*â token
P4MapMaker.h:59: error: ISO C++ forbids declaration of âPyObjectâ with no type
P4MapMaker.h:59: error: expected â;â before â*â token
In file included from P4API.cpp:56:
PythonMessage.h:54: error: ISO C++ forbids declaration of âPyObjectâ with no type
PythonMessage.h:54: error: expected â;â before â*â token
PythonMessage.h:55: error: ISO C++ forbids declaration of âPyObjectâ with no type
PythonMessage.h:55: error: expected â;â before â*â token
PythonMessage.h:56: error: ISO C++ forbids declaration of âPyObjectâ with no type
PythonMessage.h:56: error: expected â;â before â*â token
PythonMessage.h:57: error: ISO C++ forbids declaration of âPyObjectâ with no type
PythonMessage.h:57: error: expected â;â before â*â token
PythonMessage.h:58: error: ISO C++ forbids declaration of âPyObjectâ with no type
PythonMessage.h:58: error: expected â;â before â*â token
PythonMessage.h:59: error: ISO C++ forbids declaration of âPyObjectâ with no type
PythonMessage.h:59: error: expected â;â before â*â token
In file included from P4API.cpp:57:
PythonTypes.h:48: error: âPyObject_HEADâ does not name a type
PythonTypes.h:54: error: âPyObject_HEADâ does not name a type
PythonTypes.h:60: error: âPyObject_HEADâ does not name a type
PythonTypes.h:66: error: âPyObject_HEADâ does not name a type
PythonTypes.h:72: error: âPyObject_HEADâ does not name a type
PythonTypes.h:76: error: âPyTypeObjectâ does not name a type
PythonTypes.h:77: error: âPyTypeObjectâ does not name a type
PythonTypes.h:78: error: âPyTypeObjectâ does not name a type
PythonTypes.h:79: error: expected initializer before â*â token
PythonTypes.h:80: error: expected initializer before â*â token
PythonTypes.h:81: error: expected initializer before â*â token
PythonTypes.h:82: error: âPyTypeObjectâ does not name a type
P4API.cpp:77: error: expected constructor, destructor, or type conversion before â*â token
P4API.cpp:78: error: expected constructor, destructor, or type conversion before â*â token
P4API.cpp:79: error: expected constructor, destructor, or type conversion before â*â token
P4API.cpp: In function âvoid P4Adapter_dealloc(P4Adapter*)â:
P4API.cpp:87: error: âstruct P4Adapterâ has no member named âclientAPIâ
P4API.cpp:88: error: âPy_TYPEâ was not declared in this scope
P4API.cpp:88: error: âPyObjectâ was not declared in this scope
P4API.cpp:88: error: expected primary-expression before â)â token
P4API.cpp: At global scope:
P4API.cpp:94: error: expected initializer before â*â token
P4API.cpp:68: warning: âidentâ defined but not used
P4API.cpp:85: warning: âvoid P4Adapter_dealloc(P4Adapter*)â defined but not used
error: command 'gcc' failed with exit status 1


Can anyone help me?

#2 P4Shimada

P4Shimada

    Advanced Member

  • Members
  • PipPipPip
  • 831 posts

Posted 10 October 2014 - 07:38 PM

Hi,

Thank you for sending your versions of gcc, python and p4python. Based on the error you are getting, it seems you have not installed the Python development package (python-dev).  On yum-enabled systems, you can do:

	yum install python-devel

to install Python development libraries.

Let me know if installing this package solves your P4Python build issue. Also, make sure your version of Python 2.6 is supported with P4Python 2014.1. Check the release notes for Python compatibility details:

(http://www.perforce....pythonnotes.txt)

  Python Release | P4Python Release
  ======================================
  2.3 or earlier | not supported
  2.4 | 2008.2 (unsupported)
  2.5 | 2007.3 up to 2009.2 (unsupported)
  2.6 | 2009.1 up to 2012.2
  2.7 | 2010.1 or later
  3.0 | 2010.1 up to 2012.3 (unsupported)
  3.1 | 2010.2 up to 2012.3 (unsupported)
  3.2 | 2011.1 up to 2012.3
  3.3 | 2012.3 or later

Thus python 2.6.6 may work with P4Python 2014.1 but this is not a configuration we have tested.

#3 daniel.duffell

daniel.duffell

    Newbie

  • Members
  • Pip
  • 1 posts

Posted 25 July 2018 - 09:19 AM

I'm having the same problem as above:

building 'P4API' extension
gcc -pthread -fno-strict-aliasing -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -DID_OS="LINUX26X86_64" -DID_REL="2017.2" -DID_PATCH="1615960" -DID_API="2018.1/1660568" -DID_Y="2018" -DID_M="02" -DID_D="02" -I../p4api-2018.1.1660568/ -I../p4api-2018.1.1660568/include/p4 -I/opt/rh/python27/root/usr/include/python2.7 -c P4API.cpp -o build/temp.linux-x86_64-2.7/P4API.o -DOS_LINUX -DOS_LINUX26 -DOS_LINUXX86_64 -DOS_LINUX26X86_64
P4API.cpp:39:20: error: Python.h: No such file or directory
...

Running: Python 2.7.13

I have the python development package installed already:

Package python-devel-2.6.6-66.el6_8.x86_64 already installed and latest version

Any suggestions appreciated





Also tagged with one or more of these keywords: api, p4api, python, rhel

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users