Including Newmat patch to Castalia

11 views
Skip to first unread message

Sarang Deshpande

unread,
Nov 1, 2009, 2:47:54 AM11/1/09
to castalia-...@googlegroups.com
Hi all,

I wanted to use matrix functionalities in Castalia. The Newmat makes matrix initialization and manipulation very easy (just like what we have in Matlab).
e.g.
Matrix A(10,10);              // Creates matrix of 10x10
A(3,6) = 49;                     // Assigns value to A[3][6]
A.t();                                // Gives transpose
A.i();                                // Gives inverse

But for that I need to include it's header files, like

#include "newmat.h" and 3-4 more header files. (These header files I have included in my Castalia program)

But
I have to compile program written for Newmat like,
g++ -Xlinker -zmuldefs -o MyNewmatFirstProg MyNewmatFirstProg.cpp ../newmat/*.o

i.e. I have to compile my program with newmat/*.o files
And,
I have to include 2 arguments while compiling my program -Xlinker and -zmuldefs

I want to merge this to Castalia so that in my Castalia program I can use Newmat functionality.

I have tried to add this arguments and newmat/*.o files in makemake.config file but still it is giving me error when I do ./makemake and make.

Can anybody please tell me where exactly I have to include these things so that I can use Newmat?

Thank you.

--
Regards,
Sarang Deshpande,
(M.S.) IIT Madras,
Chennai.

Sarang Deshpande

unread,
Nov 2, 2009, 11:16:24 AM11/2/09
to castalia-...@googlegroups.com
Can anybody please tell me where I have to include these things so that I can use Newmat?

Thank you.

Sarang Deshpande

unread,
Nov 3, 2009, 8:52:36 AM11/3/09
to castalia-...@googlegroups.com

Hi all,

I got the solution of above problem.

$(wildcard pathto/newmat/*.o) add this line to /bin/Makefile on line number 19.
i.e.
EXTRA_OBJS = $(wildcard pathto/newmat/*.o)

AND
-Xlinker and -zmuldefs add this into a file named /config/omnetpp.config on line number 21.
i.e.
LDFLAGS = -Xlinker -zmuldefs

Then don't do ./makemake otherwise it will reset /bin/Makefile
do make, and now you can use newmat functionality in your program i.e. .cc file.

Thank you.
Reply all
Reply to author
Forward
0 new messages