Author | Message |
---|---|
ahnman341
Posts: 22
|
Posted 19:47 Mar 17, 2015 |
Do we need to compile a .o object from mbarrier.h to use barriers in .cpp files? Or does #include "mbarrier.h" within testmb.cpp suffice?
So far, I've tried >g++ -o testmb testmb.cpp util.o and I get a long error message. What do I type into the command line to run testmb.cpp?
Last edited by ahnman341 at
20:42 Mar 17, 2015.
|
se1k1h1mawar1
Posts: 121
|
Posted 20:02 Mar 17, 2015 |
I don't think you need to compile a .o object from mbarrier.h to use barriers in .cpp files.
To compile it, I just typed in "g++ testmb.cpp util.o" to run it. Thanks,
Last edited by se1k1h1mawar1 at
20:11 Mar 17, 2015.
|
ahnman341
Posts: 22
|
Posted 20:37 Mar 17, 2015 |
So to clarify, we need to modify the original file testmb.cpp on Dr. Pamula's site??
I have modified testmb.cpp to include: #include "utility.h" extern "C"{ .. .. } but I'm still getting the same compilation error
Also, in testmb.cpp, the original code for Barrierinit() is: b->Barrierinit(6); //Initialize the barrier to
You changed this to b[0]->Barrierinit(6); ???
|
ahnman341
Posts: 22
|
Posted 20:47 Mar 17, 2015 |
I think it would be helpful if you gave me a step-by-step on how you got testmb.cpp to run on mars.
What I have done: 1. Download and upload via FTP to mars account the following: testmb.cpp mbarrier.h 2. try to compile testmb.cpp by: >g++ -o testmb testmb.cpp util.o
Thanks |
se1k1h1mawar1
Posts: 121
|
Posted 20:53 Mar 17, 2015 |
I also included "#include "mbarrier.h". Below is the testmb.cpp I have, and below that is the output I get.: ---------------- #include <math.h>^M ^M
------------------------------------- 1 arriving at first barrier
Please let me know if I'm misunderstainding something. Thanks, Last edited by se1k1h1mawar1 at
20:54 Mar 17, 2015.
|
ahnman341
Posts: 22
|
Posted 21:13 Mar 17, 2015 |
OMG i got it to work.
<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3 <3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3 <3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3
<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3
<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3
|
se1k1h1mawar1
Posts: 121
|
Posted 21:22 Mar 17, 2015 |
Congratulations! |