How to develop at best with QuantLib on Ubuntu

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

How to develop at best with QuantLib on Ubuntu

Paolo Tenconi
Hello,
I just switched to Ubuntu, QuantLib/Swig compilation  was fine, now as I'm going to add some new classes (for structured products), I'd like to ask people in the list suggestions regarding the best way to develop with QuantLib. I haven't managed large projects using makefiles under Linux until now, I've very basic questions, I hope someone could help me

HOW TO DEVELOP/TEST NEW CLASSES
Is it best creating a new C++ project containing my new classes/main or is it better directly embed new classes in QuantLib and create a new C++ project restricted to testing? (It's a matter of development speed)

HOW TO COMPILE/EXTEND QUANTLIB
Is it fine adding my files in a new directory in experimental folder?
Which are the shell commands for adding my classes to QuantLib without recompiling the entire library? Should I modify the makefile?

TRACING
As I come from Matlab (good interaction, nice debugger) I'd like to mantain as much as possible a fast coding style with trial/error checking. Is there a way to trace/print a whole vector (of quotes, dates...)?

DEVELOPMENT TOOLS
Which editor is best for C++ coding? I installed Eclipse and Emacs but I didn't configure any of them yet


Excuse me for such long questions, many thanks to everyone for any suggestion.
Paolo




------------------------------------------------------------------------------
Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
MVPs and experts. ON SALE this month only -- learn more at:
http://p.sf.net/sfu/learnmore_122712
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users
Reply | Threaded
Open this post in threaded view
|

Re: How to develop at best with QuantLib on Ubuntu

Michael Barrow-2
Hi Paolo, just giving my 2 cents on this.

New classes:

If you are compiling using an IDE it would make sense to create your own isolated project and folder structure. Most IDE's let you drill to the guts of your includes quite easily.

Compile/extend quantlib

Partial compilation depends on your tool chain. You mention eclipse, I believe this will do the job. But re-compilation of quantlib C++ projects is slowed in my experience by the mass of header includes when using eclipse (maybe I need to set up pch).

Tracing

Going to eclipse from Matlab will be relatively painless. Toggle breakpoints in eclipse, set the perspective to 'debug' and run. You'll see everything in the debug editor you would in Matlab minus the array editor. If you want to print structures you can check out existing << overloads or manually iterate over them.

Which editor?

I'm wrestling with eclipses code completion and didn't try emacs. In honesty I would go for visual studio if you have a spare win box.

Best regards,

Mike

On 27 Dec 2012, at 11:29, Paolo Tenconi <[hidden email]> wrote:

> Hello,
> I just switched to Ubuntu, QuantLib/Swig compilation  was fine, now as I'm going to add some new classes (for structured products), I'd like to ask people in the list suggestions regarding the best way to develop with QuantLib. I haven't managed large projects using makefiles under Linux until now, I've very basic questions, I hope someone could help me
>
> HOW TO DEVELOP/TEST NEW CLASSES
> Is it best creating a new C++ project containing my new classes/main or is it better directly embed new classes in QuantLib and create a new C++ project restricted to testing? (It's a matter of development speed)
>
> HOW TO COMPILE/EXTEND QUANTLIB
> Is it fine adding my files in a new directory in experimental folder?
> Which are the shell commands for adding my classes to QuantLib without recompiling the entire library? Should I modify the makefile?
>
> TRACING
> As I come from Matlab (good interaction, nice debugger) I'd like to mantain as much as possible a fast coding style with trial/error checking. Is there a way to trace/print a whole vector (of quotes, dates...)?
>
> DEVELOPMENT TOOLS
> Which editor is best for C++ coding? I installed Eclipse and Emacs but I didn't configure any of them yet
>
>
> Excuse me for such long questions, many thanks to everyone for any suggestion.
> Paolo
>
>
>
> ------------------------------------------------------------------------------
> Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
> MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
> with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
> MVPs and experts. ON SALE this month only -- learn more at:
> http://p.sf.net/sfu/learnmore_122712
> _______________________________________________
> QuantLib-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/quantlib-users

------------------------------------------------------------------------------
Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
MVPs and experts. ON SALE this month only -- learn more at:
http://p.sf.net/sfu/learnmore_122712
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users
Reply | Threaded
Open this post in threaded view
|

Re: How to develop at best with QuantLib on Ubuntu

Luigi Ballabio
In reply to this post by Paolo Tenconi
Hi Paolo,
    my two cents.

On Thu, Dec 27, 2012 at 12:29 PM, Paolo Tenconi <[hidden email]> wrote:

> I just switched to Ubuntu, QuantLib/Swig compilation  was fine, now as I'm
> going to add some new classes (for structured products), I'd like to ask
> people in the list suggestions regarding the best way to develop with
> QuantLib. I haven't managed large projects using makefiles under Linux until
> now, I've very basic questions, I hope someone could help me
>
> HOW TO DEVELOP/TEST NEW CLASSES
> Is it best creating a new C++ project containing my new classes/main or is
> it better directly embed new classes in QuantLib and create a new C++
> project restricted to testing? (It's a matter of development speed)

I'm not sure it's just a matter of development speed.  For instance,
keeping your files separate from the library might simplify version
control (you do use version control, right?) If it's a separate
project for your job, this would also make it clear what files belong
to who.  And if you have a main, you probably want it out of the
library.

Instead, if you want to contribute some of your files eventually, it
would be more convenient to put them in the library. In that case, you
might use version control by cloning the library on github (a mirror
is at <https://github.com/lballabio/quantlib>).


> HOW TO COMPILE/EXTEND QUANTLIB
> Is it fine adding my files in a new directory in experimental folder?
> Which are the shell commands for adding my classes to QuantLib without
> recompiling the entire library? Should I modify the makefile?

The experimental folder is fine.  You'll have to add your files (hpp
and cpp) to the corresponding lists in the Makefile.am found in that
folder.  When you run 'make', it will pick up the changes and
recompile only the needed files.


> TRACING
> As I come from Matlab (good interaction, nice debugger) I'd like to mantain
> as much as possible a fast coding style with trial/error checking. Is there
> a way to trace/print a whole vector (of quotes, dates...)?

Not that I know, but it should be easy enough for you to write a
function that does that.


> DEVELOPMENT TOOLS
> Which editor is best for C++ coding? I installed Eclipse and Emacs but I
> didn't configure any of them yet

What, are you trying to cause a holy war here? :)
I'm using Emacs, but that's me...

Luigi

------------------------------------------------------------------------------
Master HTML5, CSS3, ASP.NET, MVC, AJAX, Knockout.js, Web API and
much more. Get web development skills now with LearnDevNow -
350+ hours of step-by-step video tutorials by Microsoft MVPs and experts.
SALE $99.99 this month only -- learn more at:
http://p.sf.net/sfu/learnmore_122812
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users