Hi Marcel,

It’s an interesting problem. I would note that it’s much easier for us to read 
and process if you just put questions etc in the body of your email rather than 
as an attachment.

To answer your questions:
a. How do I use inline::Cpp to call the CppAdaptive() function, without having 
to re-compile each time the script runs?
(There was something mentioned about modules in the Inline:Cpp documentation, 
but I am new to perl as well as inline::cpp, so very practical advice would be 
much appreciated!)
If you write your program as a simple script, to be run repeatedly by the same 
user, this “just works” – the Inline::C family cache the precompiled C and then 
DLL in a directory called “_Inline”. If you wanted to make an installable 
module, you would want to look at the very clever “Inline::Module”.
b. On a Linux machine, how do I figure out where to place the non-standard C++ 
libraries, e.g. dlib/matrix in my case? (My survey software uploads all survey 
files, including Perl scripts, automatically.. but it does not automatically 
include user-written C++ modules)
This depends on whether dlib/matrix is part of the survey software, in which 
case your Perl environment may just be able to find the library without further 
effort, or possibly with a configuration option. Generally you will need to 
supply extra configuration info to the Inline framework. More information is 
available at https://metacpan.org/pod/Inline::C::Cookbook – while this is for 
Inline::C, it will generally be applicable to Inline::CPP.

Best regards,
Ed

From: M.F. Jonker<mailto:m.jon...@bmg.eur.nl>
Sent: Saturday, May 27, 2017 3:55 PM
To: inline@perl.org<mailto:inline@perl.org>
Subject: Inline:Cpp to speed up adaptive questionnaire

Dear all,

After a kind recommendation by David Oswald, I'm emailing the inline community 
with a few questions about a specific Inline:Cpp implementation. The background 
of my questions is that I'm working on an academic project in which we want to 
adaptively create survey questions based on respondents' previous answers (that 
is, similar to an IQ-test, we don't want to ask simple questions to people who 
answered all previous questions correctly, and vise versa).

Our survey system, which is hosted on a linux server, allows Perl-scripts to be 
run before each new question, yet the computationally intensive adaptive 
calculations crucially depend on pre-compiled C++ code for computational 
performance. Having read throught the inline::CPP documentation, I hoped that I 
could ask you a few short questions. I've placed them in the attached pdf and 
REALLY hope you can point me in the right direction!

Many thanks,
Dr. Marcel Jonker
Erasmus University Rotterdam,
The Netherlands

Reply via email to