Re: Powerloom API

Hans Chalupsky <[email protected]> Tue, 11 Dec 2007 14:46:20 -0800
Newsgroups gmane.comp.ai.powerloom
Message-ID <[email protected]>
Andrea,

to be able to call PowerLoom and STELLA functions in your code,
include the file powerloom-system.hh which will include all other
necessary files (the file lives in powerloom/native/cpp/powerloom/).
Use -Ipowerloom/native/cpp in your C++ compilation (adjust the path to
your installation directory) so that it will find all the include files.

Then there are two ways to interface your C++ code with PowerLoom:

(1) Have PowerLoom be the main application shell and add your own
extensions to it.  To do that you'd have to edit main.c in
powerloom/native/cpp/powerloom/ to include/call your code and edit the
Makefile in the same directory to link with your extension
files/libraries.

(2) Treat PowerLoom as a library and link it with your C++
application.  To do that first build the C++ version of PowerLoom (see
the manual - basically type `make' in the
powerloom/native/cpp/powerloom directory) which will build the various
PowerLoom libraries such as stella.so, logic.so, etc.  Then link your
C++ application with the libraries built (look at the final link step
when `make'ing PowerLoom which will show you which of these libraries
you'll need to link with your application; use the switch
-Lpowerloom/native/cpp/lib to tell the compiler where all the
libraries live).

Hope that does the trick.  All of this assumes a Unix-based
environment such as Linux or MinGW/Cygwin under Windows.

Hans

>>>>> Thomas Russ <[email protected]> writes:

> On Dec 10, 2007, at 6:43 AM, Rera wrote:

>> Be patient with me, I'm an absolute beginners in programming (with C 
>> ++).
>> What I need to load in my own code to use PowerLoom C++ functions?
>> Which files have I to include?

> Well, if you are an absolute beginner with C++, then I would  
> recommend that you use the Java version of PowerLoom and do your  
> programming in Java.  The interfacing methods and general programming  
> will be a lot easier.

> The PowerLoom developers do not develop directly in C++.  When we use  
> C++, we do it through the use of our Stella language instead, so that  
> makes things a bit tricky to describe the method manually, since I  
> don't actually do anything that way.

> A basic outline would be that you will need to make sure that you  
> have the proper pathways set up for include files as well as  
> libraries.  Note also that PowerLoom depends on use of the Boehm GC  
> code for C++ (included with the Stella component).  For some idea of  
> what those would need to look like, you can examine the Makefile that  
> comes in the PowerLoom distribution.  It is quite complicated, but if  
> you want to do your development in C++ you will need to be able to  
> understand things along that line.  Since we don't actually develop  
> using the C++ translation of our code, we don't have any instructions  
> on how to set up an IDE to work with the code.

> Some of the flags and settings are OS-specific.  Look for them in the  
> Makefile.  As a starter, you can run make in the native/cpp/powerloom  
> directory and examine the form of the compiler calls.  You will need  
> to mimic that when creating the code that you will want to run.

> Sorry I can't be of more help, but we just don't have instructions  
> for what you want to do.

> That's why I suggest going with Java.  The setup is much simpler with  
> only the need to include the PowerLoom.jar file in the classpath.



> _______________________________________________
> powerloom-forum mailing list
> [email protected]
> http://mailman.isi.edu/mailman/listinfo/powerloom-forum