Thread: Re: [q-lang-users] Request to know about using Q in C++ programs
Brought to you by:
agraef
From: Borse, G. <gan...@cr...> - 2007-10-24 03:21:19
|
Hi, Thanks for your guidance. It is great this does not create a new process for interpreter. Since, I want to embed the Q interpreter in my C++ application, is it sufficient to use only the "libqint" library for this? Or do I need to get all dependencies to link this library & use at run time with my program? Other problem is that, I am not able to install RPMs "q-7.8-5su101.i586.rpm" & "q-7.8-5.src.rpm" on my Linux OS because I do NOT have root privileges. While installing SRC RPM I got an error: error: cannot create %sourcedir /usr/src/redhat/SOURCES I have only Red Hat Linux 3 (Taroon Updt1) & no SUSE. Can I have binaries for Red Hat Linux also in tar.gz format? Please guide/ help. Many thanks for your time & guidance. Warm Regards Ganesh ------------------------------------------------------------------------------------------------------------- Message: 8 Date: Tue, 23 Oct 2007 10:38:02 -0400 From: John Cowan <co...@cc...> Subject: Re: [q-lang-users] Request to know about using Q in C++ programs To: "Discuss the Q language." <q-l...@li...> Message-ID: <200...@me...> Content-Type: text/plain; charset=us-ascii Borse, Ganesh scripsit: > In the topic "C.4 Embedding Q in C/C++ Applications " on web page "http://q-lang.sourceforge.net/qdoc/qdoc_15.html#SEC187 <http://q-lang.sourceforge.net/qdoc/qdoc_15.html#SEC187> <http://q-lang.sourceforge.net/qdoc/qdoc_15.html#SEC187 <http://q-lang.sourceforge.net/qdoc/qdoc_15.html#SEC187> > ", it mentioned > that before calling any eval functions from Q library, we need to do qexecv() or qexecl(). > > Does this mean that we create / fork a process from the parent C/ C++ program & then the script gets loaded into that new process? Not at all. qexecv() and qexecl() cause the Q interpreter to load a script to be run by the interpreter in the current process. They do not cause an underlying execv() or execl(), but are only generally analogous to them (start new script, pass arguments). -- Even the best of friends cannot John Cowan attend each others' funeral. co...@cc... --Kehlog Albran, The Profit http://www.ccil.org/~cowan <http://www.ccil.org/~cowan> > _____________________________________________ > From: Borse, Ganesh > Sent: 23 October 2007 20:42 > To: 'q-l...@li...' > Subject: Request to know about using Q in C++ programs > > Dear Sir, > I am impressed with the great feature of dynamic expression evaluation provided by Q language. > > I would like to use this for a C++ application which takes dynamic expressions like queries from database > > However, I want to do this in the same process & not over the other process. > > In the topic "C.4 Embedding Q in C/C++ Applications " on web page "http://q-lang.sourceforge.net/qdoc/qdoc_15.html#SEC187 <http://q-lang.sourceforge.net/qdoc/qdoc_15.html#SEC187> ", it mentioned that before calling any eval functions from Q library, we need to do qexecv() or qexecl(). > > Does this mean that we create / fork a process from the parent C/ C++ program & then the script gets loaded into that new process? > Please advise. > > Many thanks for your help. > > Warm Regards, > Ganesh ============================================================================== Please access the attached hyperlink for an important electronic communications disclaimer: http://www.credit-suisse.com/legal/en/disclaimer_email_ib.html ============================================================================== |
From: kruhft <kr...@gm...> - 2007-10-24 05:44:06
|
On 10/23/07, Borse, Ganesh <gan...@cr...> wrote: > While installing SRC RPM I got an error: error: cannot create %sourcedir > /usr/src/redhat/SOURCES > I have only Red Hat Linux 3 (Taroon Updt1) & no SUSE. Can I have binaries > for Red Hat Linux also in tar.gz format? You can always try rpm2targz: http://www.fship.com/demos/rpm2targz -- burton samograd http://metashell.org kr...@gm... |
From: John C. <co...@cc...> - 2007-10-24 12:37:17
|
Borse, Ganesh scripsit: > Since, I want to embed the Q interpreter in my C++ application, is it > sufficient to use only the "libqint" library for this? Or do I need > to get all dependencies to link this library & use at run time with > my program? The Linux linker is smart enough to pull in all the dependencies, usually, but for the record they are -lq and -lgmp. On other operating systems YMMV; Cygwin requires explicit -lq -lgmp -liconv. > Other problem is that, I am not able to install RPMs > "q-7.8-5su101.i586.rpm" & "q-7.8-5.src.rpm" on my Linux OS because I > do NOT have root privileges. While installing SRC RPM I got an error: > error: cannot create %sourcedir /usr/src/redhat/SOURCES I have only > Red Hat Linux 3 (Taroon Updt1) & no SUSE. Can I have binaries for Red > Hat Linux also in tar.gz format? I recommend building from source in that case. It's very easy: * unpack the tarball $ ./configure --prefix=some/directory $ make $ make install -- John Cowan co...@cc... At times of peril or dubitation, http://www.ccil.org/~cowan Perform swift circular ambulation, With loud and high-pitched ululation. |
From: Albert G. <Dr....@t-...> - 2007-10-24 15:21:30
|
John Cowan wrote: > I recommend building from source in that case. It's very easy: Right. Just remember to also set your path to the bin directory. Of course, if you build from the source, you also need some development packages (GNU C library and libgmp should be all that is needed for a basic install) on your system. Also check Fedora (the community-based RedHat version). Since FC6 they have a Q RPM package, too, maybe you can convince your sysadmin to install that on your machine. (It's an older Q version, though.) Albert -- Dr. Albert Gr"af Dept. of Music-Informatics, University of Mainz, Germany Email: Dr....@t-..., ag...@mu... WWW: http://www.musikinformatik.uni-mainz.de/ag |