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

Questions regarding compilation. #1

Open
aindilis opened this issue Mar 11, 2014 · 0 comments
Open

Questions regarding compilation. #1

aindilis opened this issue Mar 11, 2014 · 0 comments

Comments

@aindilis
Copy link

To whom it may concern,

I am working on a Perl interface for Flora-2. Given that I'm not familiar enough with C++ or SWIG, I decided to write an Inline::Python wrapper for ReasonablePython. I was wondering if this project is still going?

When I try to compile it on amd64, I get some errors. After tweaking with the location of the XSB .h files,


platform = 'i686-pc-linux-gnu-deb'

platform = 'x86_64-unknown-linux-gnu'


I get a lot of conflicting type errors regarding ptoc_int and ctop_int and other such wrapper functions.


In file included from rp/xsb_swig/swig_xsb_wrap.c:2346:0:
rp/xsb_swig/swig_xsb.h:48:13: error: conflicting types for ‘ptoc_int’
extern int ptoc_int(int);
^
In file included from rp/xsb_swig/swig_xsb.h:25:0,
from rp/xsb_swig/swig_xsb_wrap.c:2346:
/var/lib/xsb/emu/cinterf.h:219:39: note: previous declaration of ‘ptoc_int’ was here
DllExport extern prolog_int call_conv ptoc_int(CTXTdeclc reg_num);
^
In file included from rp/xsb_swig/swig_xsb_wrap.c:2346:0:
rp/xsb_swig/swig_xsb.h:58:15: error: conflicting types for ‘ctop_int’


So at first I tried to remove the "conflicting" definitions by removing the "extern ..." declarations in xsb_swig.{c,h}. Then it compiles, but when loading it with interface, it segfaults.


andrewdo@ai:/var/lib/myfrdcsa/sandbox/reasonablepy-20140309/reasonablepy-20140309$ python
Python 2.7.6 (default, Feb 26 2014, 00:34:35)
[GCC 4.8.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.

import sys
sys.path.append("/var/lib/myfrdcsa/sandbox/reasonablepy-20140309/reasonablepy-20140309")
sys.path.append("/var/lib/myfrdcsa/sandbox/reasonablepy-20140309/reasonablepy-20140309/build/lib.linux-x86_64-2.7/rp/xsb_swig/")

from rp import *
f = interface.Flora2();
Segmentation fault


I also tried "correcting" the extern declarations to the ones from the latest xsb swig, but that also compiles then segfaults.

Best Regards,
Andrew Dougherty

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

No branches or pull requests

1 participant