pygccxml KeyError

classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

pygccxml KeyError

Davidson, Josh

Hopefully, there’s enough information in the traceback, but if not I can try to sanitize an example.  I’m on rev 1856.

 

INFO gccxml cmd: ""C:\MinGW\bin\gccxml.exe"  -DBOOST_NO_RVALUE_REFERENCES -D__mode__(x)=   -I"." -I"C:\Users\davidsj2\workspace\SimulationInterface\src\C++\model_io\storage" -I"C:\Users\davidsj2\workspace\SimulationInterface\src\C++" -I"C:\Users\davidsj2\workspace\SimulationInterface\src\C++\model_io\storage" -I"c:\Python26\include" -I"C:\Users\davidsj2\workspace\SimulationInterface\src\C++\model_io\storage"   "C:\Users\davidsj2\workspace\SimulationInterface\src\C++\model_io\storage\SpaceWireStore.hpp" -fxml="c:\users\davidsj2\appdata\local\temp\tmpnxyjfn.xml""

INFO GCCXML version - 0.9( 1.135 )

['C:\\Users\\davidsj2\\workspace\\SimulationInterface', 'c:\\Python26\\lib\\site-packages\\setuptools-0.6c11-py2.6.egg', 'c:\\Python26\\lib\\site-packages\\rpyc-3.2.0-py2.6.egg', 'c:\\Python26\\lib\\site-packages\\construct-2.06-py2.6.egg', 'c:\\Python26\\lib\\site-packages\\winpexpect-1.5-py2.6.egg', 'c:\\Python26\\lib\\site-packages\\pyreadline-1.7.1.dev_r0-py2.6.egg', 'C:\\Users\\davidsj2\\workspace\\SimCommon\\src', 'C:\\Windows\\system32\\python26.zip', 'c:\\Python26\\DLLs', 'c:\\Python26\\lib', 'c:\\Python26\\lib\\plat-win', 'c:\\Python26\\lib\\lib-tk', 'c:\\Python26', 'c:\\Python26\\lib\\site-packages', 'c:\\Python26\\lib\\site-packages\\win32', 'c:\\Python26\\lib\\site-packages\\win32\\lib', 'c:\\Python26\\lib\\site-packages\\Pythonwin']

Traceback (most recent call last):

  File "setup.py", line 27, in <module>

    extensions = [b.getExtension() for b in bindings]

  File "C:\Users\davidsj2\workspace\SimCommon\src\sim\build\bindings.py", line 287, in getExtension

    self._generate()

  File "C:\Users\davidsj2\workspace\SimCommon\src\sim\build\bindings.py", line 223, in _generate

    cflags=cflags)

  File "c:\Python26\lib\site-packages\pyplusplus\module_builder\boost_python_builder.py", line 95, in __init__

    , indexing_suite_version)

  File "c:\Python26\lib\site-packages\pyplusplus\module_builder\boost_python_builder.py", line 138, in __parse_declarations

    decls = reader.read_files( files, compilation_mode )

  File "c:\Python26\lib\site-packages\pygccxml\parser\project_reader.py", line 217, in read_files

    return self.__parse_file_by_file(files)

  File "c:\Python26\lib\site-packages\pygccxml\parser\project_reader.py", line 272, in __parse_file_by_file

    leaved_classes = self._join_class_hierarchy( answer )

  File "c:\Python26\lib\site-packages\pygccxml\parser\project_reader.py", line 445, in _join_class_hierarchy

    leaved_derived = leaved_classes[ create_key( derived_info.related_class ) ]

KeyError: (('c:/mingw64-i686-20110207/lib/gcc/../../x86_64-w64-mingw32/include/boost/intrusive/options.hpp', 209), ('::', 'boost', 'intrusive', 'constant_time_size<true>', 'pack<boost::intrusive::base_hook<boost::intrusive::detail::default_set_hook>::pack<boost::intrusive::none> >'))

 


_______________________________________________
Cplusplus-sig mailing list
[hidden email]
http://mail.python.org/mailman/listinfo/cplusplus-sig
Reply | Threaded
Open this post in threaded view
|

Re: pygccxml KeyError

Roman Yakovenko
On Sat, Dec 17, 2011 at 2:23 AM, Davidson, Josh <[hidden email]> wrote:
> Hopefully, there’s enough information in the traceback, but if not I can try
> to sanitize an example.  I’m on rev 1856.

More or less. Sorry for late response, I was pretty busy.

>   File "c:\Python26\lib\site-packages\pygccxml\parser\project_reader.py",
> line 445, in _join_class_hierarchy


You are using project_reader_t class to parse a set of C++ files. This
method is not reliable and pretty slow. I suggest you to use
"source_reader_t" class.

Please read the project documentation, it explains how to start using it.


Regards,
Roman
_______________________________________________
Cplusplus-sig mailing list
[hidden email]
http://mail.python.org/mailman/listinfo/cplusplus-sig
Reply | Threaded
Open this post in threaded view
|

Re: EXTERNAL: Re: pygccxml KeyError

Davidson, Josh
Short of modifying the distribution, I don't see any way within Py++ to change the type of reader.  It seems to be hardcoded to project_reader_t:

    def __parse_declarations( self, files, gccxml_config, compilation_mode, cache, indexing_suite_version ):
        if None is gccxml_config:
            gccxml_config = parser.config_t()
        if None is compilation_mode:
            compilation_mode = parser.COMPILATION_MODE.FILE_BY_FILE
        start_time = time.clock()
        self.logger.debug( 'parsing files - started' )
        reader = parser.project_reader_t( gccxml_config, cache, decl_wrappers.dwfactory_t() )

-----Original Message-----
From: cplusplus-sig-bounces+josh.davidson=[hidden email] [mailto:cplusplus-sig-bounces+josh.davidson=[hidden email]] On Behalf Of Roman Yakovenko
Sent: Monday, December 19, 2011 12:37 PM
To: Development of Python/C++ integration
Subject: EXTERNAL: Re: [C++-sig] pygccxml KeyError

On Sat, Dec 17, 2011 at 2:23 AM, Davidson, Josh <[hidden email]> wrote:
> Hopefully, there's enough information in the traceback, but if not I
> can try to sanitize an example.  I'm on rev 1856.

More or less. Sorry for late response, I was pretty busy.

>   File
> "c:\Python26\lib\site-packages\pygccxml\parser\project_reader.py",
> line 445, in _join_class_hierarchy


You are using project_reader_t class to parse a set of C++ files. This method is not reliable and pretty slow. I suggest you to use "source_reader_t" class.

Please read the project documentation, it explains how to start using it.


Regards,
Roman
_______________________________________________
Cplusplus-sig mailing list
[hidden email]
http://mail.python.org/mailman/listinfo/cplusplus-sig
_______________________________________________
Cplusplus-sig mailing list
[hidden email]
http://mail.python.org/mailman/listinfo/cplusplus-sig
Reply | Threaded
Open this post in threaded view
|

Re: EXTERNAL: Re: pygccxml KeyError

Davidson, Josh
In reply to this post by Roman Yakovenko
May have been a bit too quick to respond.  Looks like setting the compilation mode can be used to have the project_reader_t use a source_reader_t.  Sorry about that.

-----Original Message-----
From: Davidson, Josh
Sent: Monday, December 19, 2011 1:00 PM
To: 'Development of Python/C++ integration'
Subject: RE: EXTERNAL: Re: [C++-sig] pygccxml KeyError

Short of modifying the distribution, I don't see any way within Py++ to change the type of reader.  It seems to be hardcoded to project_reader_t:

    def __parse_declarations( self, files, gccxml_config, compilation_mode, cache, indexing_suite_version ):
        if None is gccxml_config:
            gccxml_config = parser.config_t()
        if None is compilation_mode:
            compilation_mode = parser.COMPILATION_MODE.FILE_BY_FILE
        start_time = time.clock()
        self.logger.debug( 'parsing files - started' )
        reader = parser.project_reader_t( gccxml_config, cache, decl_wrappers.dwfactory_t() )

-----Original Message-----
From: cplusplus-sig-bounces+josh.davidson=[hidden email] [mailto:cplusplus-sig-bounces+josh.davidson=[hidden email]] On Behalf Of Roman Yakovenko
Sent: Monday, December 19, 2011 12:37 PM
To: Development of Python/C++ integration
Subject: EXTERNAL: Re: [C++-sig] pygccxml KeyError

On Sat, Dec 17, 2011 at 2:23 AM, Davidson, Josh <[hidden email]> wrote:
> Hopefully, there's enough information in the traceback, but if not I
> can try to sanitize an example.  I'm on rev 1856.

More or less. Sorry for late response, I was pretty busy.

>   File
> "c:\Python26\lib\site-packages\pygccxml\parser\project_reader.py",
> line 445, in _join_class_hierarchy


You are using project_reader_t class to parse a set of C++ files. This method is not reliable and pretty slow. I suggest you to use "source_reader_t" class.

Please read the project documentation, it explains how to start using it.


Regards,
Roman
_______________________________________________
Cplusplus-sig mailing list
[hidden email]
http://mail.python.org/mailman/listinfo/cplusplus-sig
_______________________________________________
Cplusplus-sig mailing list
[hidden email]
http://mail.python.org/mailman/listinfo/cplusplus-sig
Reply | Threaded
Open this post in threaded view
|

Re: EXTERNAL: Re: pygccxml KeyError

Davidson, Josh
In reply to this post by Roman Yakovenko
Actually, it is using a source_reader_t by default.  __parse_declarations invokes __parse_file_by_file, which uses a source_reader_t (line 236) to parse each file.  It then bombs out after parsing all of the files when it calls _join_class_hierarchy.

I continue to have this issue with various combinations of classes.  In other words, I have headers that work fine with parsed in isolation, but when I try to build a module containing both, I get the KeyError.

-----Original Message-----
From: Davidson, Josh
Sent: Monday, December 19, 2011 1:07 PM
To: 'Development of Python/C++ integration'
Subject: RE: EXTERNAL: Re: [C++-sig] pygccxml KeyError

May have been a bit too quick to respond.  Looks like setting the compilation mode can be used to have the project_reader_t use a source_reader_t.  Sorry about that.

-----Original Message-----
From: Davidson, Josh
Sent: Monday, December 19, 2011 1:00 PM
To: 'Development of Python/C++ integration'
Subject: RE: EXTERNAL: Re: [C++-sig] pygccxml KeyError

Short of modifying the distribution, I don't see any way within Py++ to change the type of reader.  It seems to be hardcoded to project_reader_t:

    def __parse_declarations( self, files, gccxml_config, compilation_mode, cache, indexing_suite_version ):
        if None is gccxml_config:
            gccxml_config = parser.config_t()
        if None is compilation_mode:
            compilation_mode = parser.COMPILATION_MODE.FILE_BY_FILE
        start_time = time.clock()
        self.logger.debug( 'parsing files - started' )
        reader = parser.project_reader_t( gccxml_config, cache, decl_wrappers.dwfactory_t() )

-----Original Message-----
From: cplusplus-sig-bounces+josh.davidson=[hidden email] [mailto:cplusplus-sig-bounces+josh.davidson=[hidden email]] On Behalf Of Roman Yakovenko
Sent: Monday, December 19, 2011 12:37 PM
To: Development of Python/C++ integration
Subject: EXTERNAL: Re: [C++-sig] pygccxml KeyError

On Sat, Dec 17, 2011 at 2:23 AM, Davidson, Josh <[hidden email]> wrote:
> Hopefully, there's enough information in the traceback, but if not I
> can try to sanitize an example.  I'm on rev 1856.

More or less. Sorry for late response, I was pretty busy.

>   File
> "c:\Python26\lib\site-packages\pygccxml\parser\project_reader.py",
> line 445, in _join_class_hierarchy


You are using project_reader_t class to parse a set of C++ files. This method is not reliable and pretty slow. I suggest you to use "source_reader_t" class.

Please read the project documentation, it explains how to start using it.


Regards,
Roman
_______________________________________________
Cplusplus-sig mailing list
[hidden email]
http://mail.python.org/mailman/listinfo/cplusplus-sig
_______________________________________________
Cplusplus-sig mailing list
[hidden email]
http://mail.python.org/mailman/listinfo/cplusplus-sig
Reply | Threaded
Open this post in threaded view
|

Re: EXTERNAL: Re: pygccxml KeyError

Roman Yakovenko
On Mon, Dec 19, 2011 at 10:24 PM, Davidson, Josh <[hidden email]> wrote:
> Actually, it is using a source_reader_t by default.  __parse_declarations invokes __parse_file_by_file, which uses a source_reader_t (line 236) to parse each file.  It then bombs out after parsing all of the files when it calls _join_class_hierarchy.
>
> I continue to have this issue with various combinations of classes.  In other words, I have headers that work fine with parsed in isolation, but when I try to build a module containing both, I get the KeyError.

Can you create a single header file, which includes all others?

HTH
_______________________________________________
Cplusplus-sig mailing list
[hidden email]
http://mail.python.org/mailman/listinfo/cplusplus-sig
Reply | Threaded
Open this post in threaded view
|

Re: EXTERNAL: Re: pygccxml KeyError

Davidson, Josh
Including everything into a single header does work, so it looks like there is a problem with the joining process.  Well, it builds anyways.  I still get compilation error W1050 telling me that I didn't specify a call policies (I did and they show up in the generated code).

These are the Py++ settings I'm using for this minimal example:

        mb.code_creator.add_include("model_io/storage/SharedMemoryBuilder.hpp")
        mb.code_creator.add_include("boost/interprocess/managed_shared_memory.hpp")
        mb.code_creator.add_include("string")

        mb.class_("SpaceWireStore").member_functions(lambda decl: decl.name.startswith("getUrgent")).call_policies = \
            call_policies.return_value_policy(call_policies.reference_existing_object)
        mb.class_("SpaceWireStore").member_functions(lambda decl: decl.name.startswith("getNormal")).call_policies = \
            call_policies.return_value_policy(call_policies.reference_existing_object)    

Here are the 4 header files that when used together will reproduce the issue: SharedMemoryDeleter.hpp, SharedMemoryBuilder.hpp, DiscreteStore.hpp, & SpaceWireStore.hpp

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#ifndef SHAREDMEMORYDELETER_HPP_
#define SHAREDMEMORYDELETER_HPP_

#include <string>
class SharedMemoryDeleter {
public:
    SharedMemoryDeleter(const std::string& name);
    ~SharedMemoryDeleter();
protected:
    std::string mName;
};

#endif /* SHAREDMEMORYDELETER_HPP_ */
---------------------------------------------------------------------------------------------------------------------

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#ifndef SHAREDMEMORYBUILDER_HPP_
#define SHAREDMEMORYBUILDER_HPP_

#include <iosfwd>
#include <boost/interprocess/interprocess_fwd.hpp>
#include <boost/shared_ptr.hpp>

#include "SharedMemoryDeleter.hpp"

class SharedMemoryBuilder {
public:
    SharedMemoryBuilder(const std::string& name, size_t num_bytes);
    virtual ~SharedMemoryBuilder();
    boost::shared_ptr<boost::interprocess::managed_shared_memory> getSegment();
protected:
    SharedMemoryDeleter mDeleter;
    boost::shared_ptr<boost::interprocess::managed_shared_memory> mSegment;
};

#endif /* SHAREDMEMORYBUILDER_HPP_ */
---------------------------------------------------------------------------------------------------------------------

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#ifndef SHAREDMEMORYBUILDER_HPP_
#define SHAREDMEMORYBUILDER_HPP_

#include <iosfwd>
#include <boost/interprocess/interprocess_fwd.hpp>
#include <boost/shared_ptr.hpp>

#include "SharedMemoryDeleter.hpp"

class SharedMemoryBuilder {
public:
    SharedMemoryBuilder(const std::string& name, size_t num_bytes);
    virtual ~SharedMemoryBuilder();
    boost::shared_ptr<boost::interprocess::managed_shared_memory> getSegment();
protected:
    SharedMemoryDeleter mDeleter;
    boost::shared_ptr<boost::interprocess::managed_shared_memory> mSegment;
};

#endif /* SHAREDMEMORYBUILDER_HPP_ */
---------------------------------------------------------------------------------------------------------------------

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#ifndef DISCRETESTORE_HPP_
#define DISCRETESTORE_HPP_

#include <stdint.h>

#include <boost/interprocess/managed_shared_memory.hpp>
#include <boost/interprocess/offset_ptr.hpp>
#include <boost/interprocess/containers/list.hpp>

#include <boost/interprocess/allocators/allocator.hpp>

class DiscreteStore {
public:

    enum {
        NUM_BUFFERS = 4
    };
    DiscreteStore();
    ~DiscreteStore();
    void frameTransition();
    bool getSimicsInput();
    void setSimicsOutput(bool isHigh);
    bool getSimInput();
    void setSimOutput(bool isHigh);

protected:
    bool mIsHigh[NUM_BUFFERS];
    size_t mSimicsInIndex;
    size_t mSimicsOutIndex;
    size_t mSimInIndex;
    size_t mSimOutIndex;
};

#endif /* DISCRETESTORE_HPP_ */
---------------------------------------------------------------------------------------------------------------------
-----Original Message-----
From: cplusplus-sig-bounces+josh.davidson=[hidden email] [mailto:cplusplus-sig-bounces+josh.davidson=[hidden email]] On Behalf Of Roman Yakovenko
Sent: Monday, December 19, 2011 1:35 PM
To: Development of Python/C++ integration
Subject: Re: [C++-sig] EXTERNAL: Re: pygccxml KeyError

On Mon, Dec 19, 2011 at 10:24 PM, Davidson, Josh <[hidden email]> wrote:
> Actually, it is using a source_reader_t by default.  __parse_declarations invokes __parse_file_by_file, which uses a source_reader_t (line 236) to parse each file.  It then bombs out after parsing all of the files when it calls _join_class_hierarchy.
>
> I continue to have this issue with various combinations of classes.  In other words, I have headers that work fine with parsed in isolation, but when I try to build a module containing both, I get the KeyError.

Can you create a single header file, which includes all others?

HTH
_______________________________________________
Cplusplus-sig mailing list
[hidden email]
http://mail.python.org/mailman/listinfo/cplusplus-sig
_______________________________________________
Cplusplus-sig mailing list
[hidden email]
http://mail.python.org/mailman/listinfo/cplusplus-sig
Reply | Threaded
Open this post in threaded view
|

Re: EXTERNAL: Re: pygccxml KeyError

Davidson, Josh
In reply to this post by Roman Yakovenko
I did run into a couple subtle problems with this approach.  Depending on where I put the header file, Py++ doesn't generate pypp.hpp/pypp.cpp files that actually register the data structures.  Everything shows up in the exposed_decl.pypp.txt file, but there are no Py++ generated source files to actually get compiled into the extension.   Just where the file can be placed and where it can't is quite puzzling.  Initially, I wanted to build the fake header as a string using file_configuration_t and CONTENT_TYPE.TEXT as my files argument to module builder, but that didn't work.  I then created a real fake header in the filesystem, and it initially didn't work either.  After much trial and error, I found that it would work if placed in certain directories.


This is all that is in the header that I'm generating:
#include "LoggerInterface.h"
#include "LogWriter.h"
#include "SchedulerInterface.h"
#include "SimLoggerInterface.h"
#include "ThreadInterface.h"
#include "TimeInterface.h"

Here is a quick summary of some directories I've tried (source code for bindings is in: C:\Users\davidsj2\workspace\SimExternalInterfaces\src\C++\SimInterfaces\SimExecInterfaces)

C:\ - Outlier.  Spit out additional warnings and the build failed
C:\temp - FAIL
C:\Users - PASS
<user> - PASS
<user>\hello - FAIL
<user>\workspace - PASS
<user>\workspace\test - FAIL
<user>\workspace\SimExternalInterfaces - PASS
<user>\workspace\SimExternalInterfaces\build - FAIL
And many more

It seems like in order to work, the parent hierarchy of the fake header has to be an ancestor of the source directory.  As you'll note above, any time I branched away from the path leading to the source files, I ran into a problem.  Adding the parent directory for the fake header to the include_paths, does not resolve the problem.  I believe the string based approach also fails because py++ ends up creating a temporary file in a directory that is not an ancestor of the source.

Below, I'm including the build output for a build where the fake header is in a functioning directory, a non-functioning directory, and where it's included as in in-memory string using file_configuration_t.

-------------------------------------- CORRECT OUTPUT WITH FAKE HEADER IN SOURCE DIRECTORY ----------------------------------
INFO Parsing source file "C:\Users\davidsj2\workspace\SimExternalInterfaces\src\C++\SimInterfaces\SimExecInterfaces\executivefake.hpp" ...
INFO gccxml cmd: ""C:\MinGW\bin\gccxml.exe"  -DBOOST_NO_RVALUE_REFERENCES -D__mode__(x)= -DMS_WIN64   -I"." -I"C:\Users\davidsj2\workspace\SimExternalInterfaces\src\C++\SimInterfaces\SimExecInterfaces" -I"C:\Users\davidsj2\workspace\SimExternalInterfaces\src\C++\SimInterfaces\SimExecInterfaces" -I"c:\Python26\include" -I"C:\Users\davidsj2\workspace\SimExternalInterfaces\src\C++\SimInterfaces\SimExecInterfaces" -I"C:\Users\davidsj2\workspace\SimExternalInterfaces\build\win64\sim\external"   "C:\Users\davidsj2\workspace\SimExternalInterfaces\src\C++\SimInterfaces\SimExecInterfaces\executivefake.hpp" -fxml="c:\users\davidsj2\appdata\local\temp\tmpimmd0m.xml""
INFO GCCXML version - 0.9( 1.135 )

INFO: file "named_tuple.py" - updated( 0.007568 seconds )


INFO: file "LogWriter.pypp.hpp" - updated( 0.007633 seconds )


INFO: file "LogWriter.pypp.cpp" - updated( 0.007400 seconds )


INFO: file "SchedulerInterface.pypp.hpp" - updated( 0.008093 seconds )


INFO: file "SchedulerInterface.pypp.cpp" - updated( 0.007427 seconds )


INFO: file "SimLoggerInterface.pypp.hpp" - updated( 0.008928 seconds )


INFO: file "SimLoggerInterface.pypp.cpp" - updated( 0.008304 seconds )


INFO: file "ThreadInterface.pypp.hpp" - updated( 0.007347 seconds )


INFO: file "ThreadInterface.pypp.cpp" - updated( 0.009345 seconds )


INFO: file "TimeInterface.pypp.hpp" - updated( 0.008310 seconds )


INFO: file "TimeInterface.pypp.cpp" - updated( 0.009422 seconds )


INFO: file "executive_enumerations.pypp.hpp" - updated( 0.008549 seconds )


INFO: file "executive_enumerations.pypp.cpp" - updated( 0.009992 seconds )


INFO: file "executive.main.cpp" - updated( 0.009686 seconds

-------------------------------------- INCORRECT OUTPUT WITH FAKE HEADER IN A DIFFERENT DIR ----------------------------------
python setup.py bdist_egg --plat-name=win64 build_ext --compiler=mingw32 build --build-platlib=build\win64
INFO Parsing source file "C:\Users\davidsj2\hello\executivefake.hpp" ...
INFO gccxml cmd: ""C:\MinGW\bin\gccxml.exe"  -DBOOST_NO_RVALUE_REFERENCES -D__mode__(x)= -DMS_WIN64   -I"." -I"C:\Users\davidsj2\workspace\SimExternalInterfaces\src\C++\SimInterfaces\SimExecInterfaces" -I"C:\Users\davidsj2\workspace\SimExternalInterfaces\src\C++\SimInterfaces\SimExecInterfaces" -I"c:\Python26\include" -I"C:\Users\davidsj2\workspace\SimExternalInterfaces\src\C++\SimInterfaces\SimExecInterfaces"   "C:\Users\davidsj2\hello\executivefake.hpp" -fxml="c:\users\davidsj2\appdata\local\temp\tmppbg0jc.xml""
INFO GCCXML version - 0.9( 1.135 )


INFO: file "named_tuple.py" - updated( 0.007635 seconds )


INFO: file "executive.main.cpp" - updated( 0.050896 seconds )

-------------------------------------- INCORRECT OUTPUT WITH FAKE HEADER AS A STRING ----------------------------------

python setup.py bdist_egg --plat-name=win64 build_ext --compiler=mingw32 build --build-platlib=build\win64
INFO gccxml cmd: ""C:\MinGW\bin\gccxml.exe"  -DBOOST_NO_RVALUE_REFERENCES -D__mode__(x)= -DMS_WIN64   -I"." -I"C:\Users\davidsj2\workspace\SimExternalInterfaces\src\C++\SimInterfaces\SimExecInterfaces" -I"C:\Users\davidsj2\workspace\SimExternalInterfaces\src\C++\SimInterfaces\SimExecInterfaces" -I"c:\Python26\include" -I"C:\Users\davidsj2\workspace\SimExternalInterfaces\src\C++\SimInterfaces\SimExecInterfaces"   "c:\users\davidsj2\appdata\local\temp\tmpe3ooz9.h" -fxml="c:\users\davidsj2\appdata\local\temp\tmptogx_j.xml""
INFO GCCXML version - 0.9( 1.135 )


INFO: file "named_tuple.py" - updated( 0.003908 seconds )


INFO: file "executive.main.cpp" - updated( 0.008799 seconds )

-----Original Message-----
From: cplusplus-sig-bounces+josh.davidson=[hidden email] [mailto:cplusplus-sig-bounces+josh.davidson=[hidden email]] On Behalf Of Roman Yakovenko
Sent: Monday, December 19, 2011 1:35 PM
To: Development of Python/C++ integration
Subject: Re: [C++-sig] EXTERNAL: Re: pygccxml KeyError

On Mon, Dec 19, 2011 at 10:24 PM, Davidson, Josh <[hidden email]> wrote:
> Actually, it is using a source_reader_t by default.  __parse_declarations invokes __parse_file_by_file, which uses a source_reader_t (line 236) to parse each file.  It then bombs out after parsing all of the files when it calls _join_class_hierarchy.
>
> I continue to have this issue with various combinations of classes.  In other words, I have headers that work fine with parsed in isolation, but when I try to build a module containing both, I get the KeyError.

Can you create a single header file, which includes all others?

HTH
_______________________________________________
Cplusplus-sig mailing list
[hidden email]
http://mail.python.org/mailman/listinfo/cplusplus-sig
_______________________________________________
Cplusplus-sig mailing list
[hidden email]
http://mail.python.org/mailman/listinfo/cplusplus-sig
Reply | Threaded
Open this post in threaded view
|

Re: EXTERNAL: Re: pygccxml KeyError

Roman Yakovenko
On Wed, Dec 21, 2011 at 2:44 AM, Davidson, Josh <[hidden email]> wrote:
> I did run into a couple subtle problems with this approach.  Depending on where I put the header file, Py++ doesn't generate pypp.hpp/pypp.cpp files that actually register the data structures.  Everything shows up in the exposed_decl.pypp.txt file, but there are no Py++ generated source files to actually get compiled into the extension.   Just where the file can be placed and where it can't is quite puzzling.  Initially, I wanted to build the fake header as a string using file_configuration_t and CONTENT_TYPE.TEXT as my files argument to module builder, but that didn't work.  I then created a real fake header in the filesystem, and it initially didn't work either.  After much trial and error, I found that it would work if placed in certain directories.

This is a long standing issue with Py++. It can't be solved without
breaking backward compatibility to the existing code. You will have to
use "include/exclude" functionality to select the desired set of to be
exported declarations.

Roman
_______________________________________________
Cplusplus-sig mailing list
[hidden email]
http://mail.python.org/mailman/listinfo/cplusplus-sig
Reply | Threaded
Open this post in threaded view
|

Re: EXTERNAL: Re: pygccxml KeyError

Davidson, Josh
Roman,

Is this a difficult issue to fix?  If not, could it be fixed in a branch release?  Having to manually include/exclude every declaration adds a bit of overhead and the current erroneous behavior goes against the documentation: docs-Mar-17-2011/docs-Mar-17-2011/pyplusplus/documentation/tutorials/module_builder/module_builder.html#declarations-customization

Thanks,
Josh

-----Original Message-----
From: cplusplus-sig-bounces+josh.davidson=[hidden email] [mailto:cplusplus-sig-bounces+josh.davidson=[hidden email]] On Behalf Of Roman Yakovenko
Sent: Thursday, December 22, 2011 12:32 AM
To: Development of Python/C++ integration
Subject: Re: [C++-sig] EXTERNAL: Re: pygccxml KeyError

On Wed, Dec 21, 2011 at 2:44 AM, Davidson, Josh <[hidden email]> wrote:
> I did run into a couple subtle problems with this approach.  Depending on where I put the header file, Py++ doesn't generate pypp.hpp/pypp.cpp files that actually register the data structures.  Everything shows up in the exposed_decl.pypp.txt file, but there are no Py++ generated source files to actually get compiled into the extension.   Just where the file can be placed and where it can't is quite puzzling.  Initially, I wanted to build the fake header as a string using file_configuration_t and CONTENT_TYPE.TEXT as my files argument to module builder, but that didn't work.  I then created a real fake header in the filesystem, and it initially didn't work either.  After much trial and error, I found that it would work if placed in certain directories.

This is a long standing issue with Py++. It can't be solved without breaking backward compatibility to the existing code. You will have to use "include/exclude" functionality to select the desired set of to be exported declarations.

Roman
_______________________________________________
Cplusplus-sig mailing list
[hidden email]
http://mail.python.org/mailman/listinfo/cplusplus-sig
_______________________________________________
Cplusplus-sig mailing list
[hidden email]
http://mail.python.org/mailman/listinfo/cplusplus-sig