Configure script/cmake problems

Development directions, tasks, and features being actively implemented or pursued by the development team.
Post Reply
strook
ISO Party Member
ISO Party Member
Posts: 461
Joined: Fri Sep 03, 2010 12:10 pm

Configure script/cmake problems

Post by strook »

I'm on the Code and i Need the boost::thread Library to Be included; but i have no Information about generating configure scripts and the cmake Script seems to Be broken, it didn't Run since there were obviously some Not solved dependencies.
Before i sit again the whole morning in Front of the Computer and fix and tweak cmake/configure scripts, plz can you Tell me how to include the thread lib into vs? Is the cmake Script sane?
How could i disable some dependencies ( concerning ffmpeg) of the cmake Script? Or include the Lib into the configure Script which Runs on my machine?
plz visit my vegastrike project branch here

plz support VegaOgre by donating to it!

My systems: Mac mini 1, 4gig RAM;
i5 Quad Core 2400, 300mbit WLAN, 1,3Tbyte HD, 60 GB SSD,
nvidia geforce 8400gs 512MB, 6gig RAM with Ubuntu 11.4,
win7 and hackintosh installed
breese
Bounty Hunter
Bounty Hunter
Posts: 152
Joined: Thu Sep 02, 2010 8:00 pm

Re: Configure script/cmake problems

Post by breese »

strook wrote:I'm on the Code and i Need the boost::thread Library to Be included; but i have no Information about generating configure scripts and the cmake Script seems to Be broken, it didn't Run since there were obviously some Not solved dependencies.
I cannot give you an authorative answer, but I have added all my files to Makefile.am. That seems to work. Search for "-lboost_python" in the file.

What do you need boost::thread for?

I do not know what the official line on concurrency is, but I can tell you that it is very difficult to add threading into a program that was single-threaded from the beginning. In fact,it is very difficult to get threading right even from the beginning, unless you constrain yourself to a few well-known threading patterns like active objects or monitors, and the boost::thread primitive are a tad too low level. The intensive used of global variables in VS opens up for all kinds of threading errors that are going to be hard to find.
strook
ISO Party Member
ISO Party Member
Posts: 461
Joined: Fri Sep 03, 2010 12:10 pm

Re: Configure script/cmake problems

Post by strook »

i had cmake configure problems. after spending half of the day by solving the dependencies on my suse machine from packman, configuring works, since i added in the cmake-gui "-pthread -lboost_thread-mt" in the linker flags.

i need the thread lib to start a thread that calls after a given sleep time the next step of the mesh animation.
plz visit my vegastrike project branch here

plz support VegaOgre by donating to it!

My systems: Mac mini 1, 4gig RAM;
i5 Quad Core 2400, 300mbit WLAN, 1,3Tbyte HD, 60 GB SSD,
nvidia geforce 8400gs 512MB, 6gig RAM with Ubuntu 11.4,
win7 and hackintosh installed
breese
Bounty Hunter
Bounty Hunter
Posts: 152
Joined: Thu Sep 02, 2010 8:00 pm

Re: Configure script/cmake problems

Post by breese »

strook wrote:i need the thread lib to start a thread that calls after a given sleep time the next step of the mesh animation.
This should be hooked into the game loop.

There is already an animation system in place (see the Animation and AnimationTexture classes). I am not familiar with it, but if you cannot use it, then I suggest that you hook your own mesh animation system into GameStarSystem::Draw(), where the other animation systems are called from.

The sleep time is easily handled by simply returning if the sleep time has not transpired.
strook
ISO Party Member
ISO Party Member
Posts: 461
Joined: Fri Sep 03, 2010 12:10 pm

Re: Configure script/cmake problems

Post by strook »

I had this solution already and it didn't work. Maybe I did some error, but using threads wouldn't generate a huge overhead that a static func would do by calling all updateframe methots of all meshes. You needed to place them into a vector that grows and grows because the position in the vector had to be stored inside the animation data. Deleting elements of the vector would shuffle up the remaining ones.
And after all the animation wasn't running and depends how often the draw func is called. I mean at 100fps there is more overhead as with 30 fps.
The thread variant generates a func which never exits (as long there is no interrupt signal sent)
and can simply exited and recalled with different arguments from the object it belongs to.
This means you call simply for example:
mymesh->pMeshAnimation->SetFramesPerSecond(fps);
which resets data and you must restart the animation thread by:
mymesh->pMeshAnimation->StartAnimation(times,animationnumber);
again to restart the thread with a different animation/arguments.
This is already set up I'm debugging it right now and I had a course about LWTs (liteweightthreads)
at university.
I lock a mutex when modifying the vertexlist of the thread, the local thread data isn't modified from outside.
Libs are linked successfully, I think there should klauss generate modified cmake and configure script to include it correctly. You needn't include additional libs since they are included in the dependencies, they just have to be activated.
I just have some debugging probs which are solveable.
Maybe tomorrow it is working.
plz visit my vegastrike project branch here

plz support VegaOgre by donating to it!

My systems: Mac mini 1, 4gig RAM;
i5 Quad Core 2400, 300mbit WLAN, 1,3Tbyte HD, 60 GB SSD,
nvidia geforce 8400gs 512MB, 6gig RAM with Ubuntu 11.4,
win7 and hackintosh installed
breese
Bounty Hunter
Bounty Hunter
Posts: 152
Joined: Thu Sep 02, 2010 8:00 pm

Re: Configure script/cmake problems

Post by breese »

I am not concerned about performance, but about thread-safety.

Wouldn't something like this work? (based on your previously posted patch, but with some functions added)

Code: Select all

void Mesh::UpdateFrame()
{
    if (aniVars)
    {
        double currentTime = aniVars->curTime() + GetElapsedTime();
        aniVars->setTime(currenTime);
        if (currentTime >= aniVars->GetAnimationTime())
        {
            aniVars->AnimationStep(vlist);

            double deltaTime = 1.0 / aniVars->GetFramesPerSecond();
            aniVars->SetAnimationTime(aniVars->curTime() + deltaTime);
        }
    }
}
This is the idiom that I have used for adding animations to the radar.
strook
ISO Party Member
ISO Party Member
Posts: 461
Joined: Fri Sep 03, 2010 12:10 pm

Re: Configure script/cmake problems

Post by strook »

Today in the morning, I got so far that the threads were running well. Just with the destruction of the threads went something wrong.
StopAnimation was called from a null pointer.
I can't inspect the code now, but the snippets I posted are totally deprecated.
Multithreading like I did is simple. The thread(a function) runs with local data it gets by it's arguments. If there is interthreadcommunication is needed , maybe cause it wants to access not local pointer data or wants to write some results, use boost::mutex. A mutex is a critical section (created in local brackets {} that is executed in one step as there were only one task in the whole process.
My time is rather limited in the moment else I had it done already. The whole multithread mechanism will be encapsulated by the class. So it will be user friendly.
plz visit my vegastrike project branch here

plz support VegaOgre by donating to it!

My systems: Mac mini 1, 4gig RAM;
i5 Quad Core 2400, 300mbit WLAN, 1,3Tbyte HD, 60 GB SSD,
nvidia geforce 8400gs 512MB, 6gig RAM with Ubuntu 11.4,
win7 and hackintosh installed
Post Reply