Compiling sourcecode (any precompiled libs needed?)
I just got a copy of "Numerical Recipes in C++" this morning. I'm aware that there is also additionally a cdrom available with the source code in digital form on it.
But do I need the cdrom in order to compile the source code? I noticed that I have to include some headers in my source (nr.h, ...) which are in the appendices of the book (more than 20 pages).
Can I compile the examples if I type the header files manually into my machine or do these headers depend on some precompiled libraries? (just to make it clear, I'm aware that I need a proper C/C++ compiler ;-))
Sorry for this obviously rather stupid question, but beeing rather new to C++ I couldn't figure that out yet by just studying the code.
Best regards
Roem
Saul Teukolsky
10-24-2003, 01:07 PM
Hi Roem,
Here's the minimum you would need to do. Consider the example on p. 2 of the text. You would need nr.h from Appendix A, but in the list of function headers you would only need the recipes you actually call, in this case avevar. Since avevar doesn't call any other recipes, that's all you need. Then you need nrutil.h and nrtypes.h from Appendix B. Again, much of what's in those files is not used in this example and could be omitted. You could discover what you need by trial and error. Generally, you need the common vector and matrix type declarations, and the definition of the nrvec and nrmat classes.
It's obviously a lot easier to get the CDROM or even simpler to get the downloadable source from www.nr.com.
Good luck!
Saul Teukolsky
Hi Saul,
thanks for your answer!
I already keyed big parts of the header files into my machine and it seems to work fine that way. At least I was able to compile the first example with g++ (3.2) successfully.
Thanks again.
Best Regards
Roem
enmora
06-16-2004, 06:00 PM
[QUOTE]Originally posted by Roem
[B]Hi Saul,
thanks for your answer!
I already keyed big parts of the header files into my machine and it seems to work fine that way. At least I was able to compile the first example with g++ (3.2) successfully.
Thanks again.
Appreciate Roem:
Please, tell me how you did it, I'm working with g++ 3.3.1 in Mandrake Linux 9.2 and I can not to do the first example in page 2 of the NR C++ book.
May you give your source code (*.cpp) and tell me how you ran in you console?
I'll be gladded with you for ever and ever.
Best regards
Enrique (enmora@inaoep.mx)
enmora
06-23-2004, 09:05 PM
Thanks a very lot to ROEM, today (23/11/2004) I had been successfully compiled any routine for NR books, adviced for ROEM.
I will leave this thread
siddharth
06-04-2005, 05:05 PM
hi guys,
i registered to this forum today.
i ordered for the source code.
I would really appreciate if anyone can tell me the steps of how to install the software which i wud get through email and also how to include a particualr code from NR to already existing code of mine.
waiting for the replies.
thanks a lot.
sid.