Building under Linux

A place to discuss everything related to Newton Dynamics.

Moderators: Sascha Willems, walaber

Building under Linux

Postby shybovycha » Mon Jun 17, 2013 4:50 pm

Greetings!

I'm trying to build two latest releases of core_300 under my Ubuntu laptop. None of my tries succeeded :(

Latest errors I got were:

Code: Select all
errorist@errorist-laptop:~/newton-dynamics-3.08/build$ make
Scanning dependencies of target Newton
[  0%] Building CXX object CMakeFiles/Newton.dir/coreLibrary_300/source/newton/Newton.cpp.o
In file included from /home/errorist/newton-dynamics-3.08/coreLibrary_300/source/core/dgPlane.h:26:0,
                 from /home/errorist/newton-dynamics-3.08/coreLibrary_300/source/core/dg.h:38,
                 from /home/errorist/newton-dynamics-3.08/coreLibrary_300/source/newton/NewtonStdAfx.h:31,
                 from /home/errorist/newton-dynamics-3.08/coreLibrary_300/source/newton/Newton.cpp:22:
/home/errorist/newton-dynamics-3.08/coreLibrary_300/source/core/dgVector.h:494:27: error: ‘__m128’ does not name a type
/home/errorist/newton-dynamics-3.08/coreLibrary_300/source/core/dgVector.h:494:34: error: ISO C++ forbids declaration of ‘type’ with no type [-fpermissive]
/home/errorist/newton-dynamics-3.08/coreLibrary_300/source/core/dgVector.h:809:3: error: ‘__m128’ does not name a type
/home/errorist/newton-dynamics-3.08/coreLibrary_300/source/core/dgVector.h: In constructor ‘dgVector::dgVector(int)’:
/home/errorist/newton-dynamics-3.08/coreLibrary_300/source/core/dgVector.h:495:4: error: class ‘dgVector’ does not have any field named ‘m_type’
/home/errorist/newton-dynamics-3.08/coreLibrary_300/source/core/dgVector.h: In constructor ‘dgVector::dgVector(dgFloat32)’:
/home/errorist/newton-dynamics-3.08/coreLibrary_300/source/core/dgVector.h:500:5: error: class ‘dgVector’ does not have any field named ‘m_type’
/home/errorist/newton-dynamics-3.08/coreLibrary_300/source/core/dgVector.h:500:25: error: ‘_mm_set_ps1’ was not declared in this scope
/home/errorist/newton-dynamics-3.08/coreLibrary_300/source/core/dgVector.h: In constructor ‘dgVector::dgVector(const dgFloat32*)’:
/home/errorist/newton-dynamics-3.08/coreLibrary_300/source/core/dgVector.h:505:4: error: class ‘dgVector’ does not have any field named ‘m_type’
/home/errorist/newton-dynamics-3.08/coreLibrary_300/source/core/dgVector.h:505:28: error: ‘_mm_loadu_ps’ was not declared in this scope
/home/errorist/newton-dynamics-3.08/coreLibrary_300/source/core/dgVector.h:507:3: error: ‘m_type’ was not declared in this scope
/home/errorist/newton-dynamics-3.08/coreLibrary_300/source/core/dgVector.h:507:46: error: ‘class dgVector’ has no member named ‘m_type’
/home/errorist/newton-dynamics-3.08/coreLibrary_300/source/core/dgVector.h:507:52: error: ‘_mm_and_ps’ was not declared in this scope
/home/errorist/newton-dynamics-3.08/coreLibrary_300/source/core/dgVector.h: In copy constructor ‘dgVector::dgVector(const dgVector&)’:
/home/errorist/newton-dynamics-3.08/coreLibrary_300/source/core/dgVector.h:511:4: error: class ‘dgVector’ does not have any field named ‘m_type’
/home/errorist/newton-dynamics-3.08/coreLibrary_300/source/core/dgVector.h:511:16: error: ‘const class dgVector’ has no member named ‘m_type’
.......


Fixed that with:

  • added #define DG_BUILD_SIMD_CODE to coreLibrary_300/source/core/dgTypes.h
  • added -msse3 instead of -msse2 to coreLibrary_300/projects/posix_64/makefile

Then the new error appeared:

Code: Select all
errorist@errorist-laptop:~/newton-dynamics-3.08/coreLibrary_300/projects/posix64$ make
gcc -c -Wall -Wno-strict-aliasing -DDG_SCALAR_VECTOR_CLASS -D_POSIX_VER -D_POSIX_VER_64 -O2 -fpic -g -msse -msse3 -mfpmath=sse -ffloat-store -ffast-math -freciprocal-math -funsafe-math-optimizations -fsingle-precision-constant -I../../source/core -I../../source/physics -I../../source/meshUtil -I../../source/openCL -I../../source/ai/  -o ../../source/physics/dgDynamicBody.o ../../source/physics/dgDynamicBody.cpp
../../source/physics/dgDynamicBody.cpp: In member function ‘virtual bool dgDynamicBody::IsInEquilibrium() const’:
../../source/physics/dgDynamicBody.cpp:145:57: error: no match for ‘operator<’ in ‘dgTemplateVector<T>::DotProduct4(const dgTemplateVector<T>&) const [with T = float; dgTemplateVector<T> = dgTemplateVector<float>]((*(const dgTemplateVector<float>*)(& forceError.dgVector::<anonymous>))) < dgDynamicBody::m_equilibriumError2’
../../source/physics/dgDynamicBody.cpp:145:120: error: no match for ‘operator<’ in ‘dgTemplateVector<T>::DotProduct4(const dgTemplateVector<T>&) const [with T = float; dgTemplateVector<T> = dgTemplateVector<float>]((*(const dgTemplateVector<float>*)(& torqueError.dgVector::<anonymous>))) < dgDynamicBody::m_equilibriumError2’
../../source/physics/dgDynamicBody.cpp:148:85: error: no match for ‘operator<’ in ‘dgTemplateVector<T>::CompProduct4(const dgTemplateVector<T>&) const [with T = float]((*(const dgTemplateVector<float>*)(& dgTemplateVector<T>::DotProduct4(const dgTemplateVector<T>&) const [with T = float; dgTemplateVector<T> = dgTemplateVector<float>]((* &((const dgDynamicBody*)this)->dgDynamicBody::<anonymous>.dgBody::m_netForce.dgVector::<anonymous>))))) < dgDynamicBody::m_equilibriumError2’
../../source/physics/dgDynamicBody.cpp:148:175: error: no match for ‘operator<’ in ‘dgTemplateVector<T>::CompProduct4(const dgTemplateVector<T>&) const [with T = float]((*(const dgTemplateVector<float>*)(& dgTemplateVector<T>::DotProduct4(const dgTemplateVector<T>&) const [with T = float; dgTemplateVector<T> = dgTemplateVector<float>]((* &((const dgDynamicBody*)this)->dgDynamicBody::<anonymous>.dgBody::m_netTorque.dgVector::<anonymous>))))) < dgDynamicBody::m_equilibriumError2’
../../source/physics/dgDynamicBody.cpp:150:53: error: no match for ‘operator<’ in ‘dgTemplateVector<T>::DotProduct4(const dgTemplateVector<T>&) const [with T = float; dgTemplateVector<T> = dgTemplateVector<float>]((* &((const dgDynamicBody*)this)->dgDynamicBody::<anonymous>.dgBody::m_veloc.dgVector::<anonymous>)) < dgDynamicBody::m_equilibriumError2’
../../source/physics/dgDynamicBody.cpp:150:108: error: no match for ‘operator<’ in ‘dgTemplateVector<T>::DotProduct4(const dgTemplateVector<T>&) const [with T = float; dgTemplateVector<T> = dgTemplateVector<float>]((* &((const dgDynamicBody*)this)->dgDynamicBody::<anonymous>.dgBody::m_omega.dgVector::<anonymous>)) < dgDynamicBody::m_equilibriumError2’
make: *** [../../source/physics/dgDynamicBody.o] Помилка 1


And because i do not know the source architecture, i am afraid i could not fix that bug...

Can you help, Julio?
Image
User avatar
shybovycha
 
Posts: 52
Joined: Fri Oct 23, 2009 6:15 am
Location: Poland

Re: Building under Linux

Postby Julio Jerez » Mon Jun 17, 2013 10:08 pm

Ha yes I clean up some legacy files form the engine and I have not updated the Linux build. I will fix it that week.
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Building under Linux

Postby shybovycha » Tue Jun 18, 2013 6:34 am

Shall wait for it impationtly :)
Image
User avatar
shybovycha
 
Posts: 52
Joined: Fri Oct 23, 2009 6:15 am
Location: Poland

Re: Building under Linux

Postby Julio Jerez » Mon Jun 24, 2013 11:27 am

Ok I fix the make file and also the defined, and the core engine builds now.

Late I will try the rest of all other project, I has a lot of problem build wxWidget on my old laptop. I do no know why, but not mater what I try It always failed

but now I have a new Asus n56D laptop, an dI only have Linux installed on it. So I expect that I sopudl be able to build all project without any problems.
I will try that tonight, before I release newton 3.09

I am calling Newton 3.09 the eight wonder for the world. This thing is running at about 10 or faster time faster than some other open source and commercial engine.
and it is doing that while being more accurate, more stable and more reliable. It is truly remarkable.
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Building under Linux

Postby shybovycha » Tue Jun 25, 2013 1:26 pm

Damn, you rule, dude! :D

The man of the Word! Now i finally done waiting for my Android smartphone so i shall try building Newton under Linux in an hour or so. And i am writing this post from my Asus N56VZ :D

Newton 3.09, huh? Let's see what is it =)

Under Win8 i faced some strange behaviour - i am not sure if it's a CharacterController (CC) bug or is it a Sensor feature... Here's a video.

I am wondering if i would be now able to write a tutorial series based on Newton and Irrlicht :)
Image
User avatar
shybovycha
 
Posts: 52
Joined: Fri Oct 23, 2009 6:15 am
Location: Poland

Re: Building under Linux

Postby Julio Jerez » Tue Jun 25, 2013 2:16 pm

No that should not happens. The controller should be perfert at all time. no expections.
I have being doig soem hiy level optimization to teh collsion system, and the bug might sleep out.
I will check it out tonight.
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Building under Linux

Postby Julio Jerez » Wed Jun 26, 2013 2:25 pm

Al right I fixed that bug now.
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Building under Linux

Postby shybovycha » Wed Jun 26, 2013 3:35 pm

Great!

Can't wait for a new version!
Image
User avatar
shybovycha
 
Posts: 52
Joined: Fri Oct 23, 2009 6:15 am
Location: Poland

Re: Building under Linux

Postby Julio Jerez » Wed Jun 26, 2013 5:15 pm

if you sync to source control, you can get it righ away.

also you'd mentioned that you want to make a Irrlithch tutorial.

How far are you on that, I was thonking to make a serisu of mini wraper for soem of eth open source Game engines that are out there.
I know that there are few laotomng aoprudn but most of then are eieth too old or to simpel and dop no exploit what the engine can really do.

If you want maybe we cna work together on thsio wraper and when it is more or less stabel you can asume reponsability or you cna giev to soem one on teh irrlith community to maintained.

I am really sick and tired of ready the great deal of misinformation that floats around unchallenged over forums related to game developement when it comes to the newton engine in comparison to other libraries.

The only time I have actually integrated newton to Game Studio for the intruduction of the engine to the public back in 2003.
other than that I have only provided recomendation and let people dot the way the want to do it,
but that has not always works to expose the best of the engine.
That is going to change now. I will amek thse wapers as a promotion campaing.
People has not idea hwo powerful and sofisticated the newton engine really is and I am commited to demostrates that this time around.

what I will do is that I will make a stand alone wrapers that can be integrated eassy on many engines. and I will start with Irrlith this weekend.
let me know if you wna to be part of this mini project.
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Game Engine Wrappers

Postby shybovycha » Thu Jun 27, 2013 2:28 pm

Sure i want!

I've been using OGRE, Irrlicht and DarkBasic/BlitzBasic more or less seriously. So my solution for any physics engine wrapper was simply creating a structure to handle the 3D model and its physics equivalent relation (e. g. placing the 3d mesh accordingly to its body position and rotation) and creating a bunch of body construction methods (e. g. methods that will build body shape for terrain or triangular mesh).

Since Newton supports trimesh to trimesh collision handling (and it's truly GREAT FEATURE - PhysX can't do it that simply whilst Bullet could, but not so smoothly and fast), we shall not need methods to construct bodies from primitives (e. g. representing complex concave mesh as a set of convex primitives like sphere, cube or so).

And since i've been working with people having much knowledge last two years (don't take much on our speciality, Web development - usually, programmers know much more than their job speciality), i've learned some UI and architecture tips and tricks, hehe :D

So it is better to create a factory, taking engine' mesh as an input and providing an NewtonianEntity object containing mesh and its Newtonian body. Could not call it just Entity because OGRE has taken this name to its core.

As far as i remember, i did some examples or tutorials for OGRE/Irrlicht and Newton 2.x a few years ago. If i got my monitor from repairing next week - i could take a look towards those. But i think it's better to create a set of a new ones.

I have not started writing tutorials yet - but it's a bit familiar for me, so it would not take long ;) We are having four days-off (but only three left) here, in Ukraine now so i should get that job at least started (i'm doing some freelance job now :P ). I shall let you know on my progress in these few days.

Thank you for your great job!
Image
User avatar
shybovycha
 
Posts: 52
Joined: Fri Oct 23, 2009 6:15 am
Location: Poland

Re: Building under Linux

Postby Julio Jerez » Thu Jun 27, 2013 4:51 pm

Oh you have expericne with all those game engien, that very good.
I will be making the base wraper class and I will use Irrlith as the test case.
we can probable make and SVN project in google source, this weekend. and I will add teh beginng.

then when I have a basics going I will email you so tha you befome a member. and when we have somethpg to show we can post on teh Irrlicth forum.

for ther record newton does not supports mesh-mesh collision. It may seems like that but that's the convex decompsition tool,
it is that good.
In fact that tool is now the tool used by 3DxMax, adn soem high end engine
http://www.ultimategametools.com/produc ... lider/help

Ther are some more even more famous, but I can not say onless the say first.

anyway let su start thsio mini project thsi weekend, I get back to you monday.
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Building under Linux

Postby shybovycha » Sun Jun 30, 2013 10:59 am

I have two news:

1. i started newton tutorials. here is the draft: http://markable.in/file/5a63614a-e16c-11e2-8bc9-984be164924a/

2. i cloned Newton SDK from SVN but i was not able to make it under Ubuntu :(

First it said

/usr/lib/gcc/x86_64-linux-gnu/4.7/include/pmmintrin.h:32:3: error: #error "SSE3 instruction set not enabled"


but after i added this line to CMakeLists.txt

Code: Select all
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -msse3")


i got the message

/home/errorist/newton-dynamics-read-only/coreLibrary_300/source/openCL/dgOpencl.cpp:25:19: fatal error: CL\cl.h: No such file or directory


How do i disable OpenCL requirement? I have just two options at my CMake-gui: CMAKE_BUILD_TYPE and CMAKE_INSTALL_PREFIX.
Image
User avatar
shybovycha
 
Posts: 52
Joined: Fri Oct 23, 2009 6:15 am
Location: Poland

Re: Building under Linux

Postby Julio Jerez » Sat Jul 06, 2013 10:37 am

Ok I have the linux 64 Ubuntu going now.

on the Irrlitch wrapper I will ask you to wait a few day, see if you first can get Linux going.

Then for the wrapper we are going to use the dNewton Class, which is a library for support of Cpp base engines.

to get the ball rolling I already started the Ogre and Irrlicth wrappers, and is going well so far, I started with Ogre first, but the Irrlicht is very easy
this are the links

http://code.google.com/p/ogrenewton/
http://code.google.com/p/irrnewton/

I have not commited the code to irrlicht yet, I will do it soon,
maybe you can take a look at the ogre wrapper so that you get an idea how the dNewton class works.
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Building under Linux

Postby shybovycha » Sat Jul 06, 2013 1:31 pm

I took a look over the OGRE wrapper sources and I got confused only in one place - the OgreNewtonBody class. From my point of view, it's overwhelmed with constructor arguments. Doesn't it better to use some kind of Builder or Factory pattern (sorry, i'm not too strong with them) - when user shall call something like this:

Code: Select all
myNewtonWorld->createBody(mass, collision, node);


and the body provided will be already attached to the myNewtonWorld instance and its position will be taken from OGRE' SceneNode instance?


Now, i checked out a brand new copy from Newton SVN repository and i still can not get one compiled. Here what i done:

  1. cd newton-dynamics-read-only
  2. mkdir build
  3. cd build
  4. cmake-gui ..
  5. pressed configure
  6. pressed generate
  7. make

Here is CMake log:

The C compiler identification is GNU 4.7.2
The CXX compiler identification is GNU 4.7.2
Check for working C compiler: /usr/bin/gcc
Check for working C compiler: /usr/bin/gcc -- works
Detecting C compiler ABI info
Detecting C compiler ABI info - done
Check for working CXX compiler: /usr/bin/c++
Check for working CXX compiler: /usr/bin/c++ -- works
Detecting CXX compiler ABI info
Detecting CXX compiler ABI info - done
Found TinyXML: /usr/include
Configuring done
Generating done


And here is Make log:

newton-dynamics-read-only/build$ make
Scanning dependencies of target Newton
[ 0%] Building CXX object CMakeFiles/Newton.dir/coreLibrary_300/source/newton/Newton.cpp.o
In file included from /home/errorist/projects/forks/newton/newton-dynamics-read-only/coreLibrary_300/source/core/dgTypes.h:133:0,
from /home/errorist/projects/forks/newton/newton-dynamics-read-only/coreLibrary_300/source/core/dg.h:25,
from /home/errorist/projects/forks/newton/newton-dynamics-read-only/coreLibrary_300/source/newton/NewtonStdAfx.h:31,
from /home/errorist/projects/forks/newton/newton-dynamics-read-only/coreLibrary_300/source/newton/Newton.cpp:22:
/usr/lib/gcc/x86_64-linux-gnu/4.7/include/pmmintrin.h:32:3: error: #error "SSE3 instruction set not enabled"
In file included from /home/errorist/projects/forks/newton/newton-dynamics-read-only/coreLibrary_300/source/core/dgPlane.h:26:0,
from /home/errorist/projects/forks/newton/newton-dynamics-read-only/coreLibrary_300/source/core/dg.h:38,
from /home/errorist/projects/forks/newton/newton-dynamics-read-only/coreLibrary_300/source/newton/NewtonStdAfx.h:31,
from /home/errorist/projects/forks/newton/newton-dynamics-read-only/coreLibrary_300/source/newton/Newton.cpp:22:
/home/errorist/projects/forks/newton/newton-dynamics-read-only/coreLibrary_300/source/core/dgVector.h: In member function ‘dgVector dgVector::AddHorizontal() const’:
/home/errorist/projects/forks/newton/newton-dynamics-read-only/coreLibrary_300/source/core/dgVector.h:776:44: error: ‘_mm_hadd_ps’ was not declared in this scope
In file included from /home/errorist/projects/forks/newton/newton-dynamics-read-only/coreLibrary_300/source/core/dg.h:61:0,
from /home/errorist/projects/forks/newton/newton-dynamics-read-only/coreLibrary_300/source/newton/NewtonStdAfx.h:31,
from /home/errorist/projects/forks/newton/newton-dynamics-read-only/coreLibrary_300/source/newton/Newton.cpp:22:
/home/errorist/projects/forks/newton/newton-dynamics-read-only/coreLibrary_300/source/core/dgAABBPolygonSoup.h: In constructor ‘dgAABBPolygonSoup::dgNode::dgNode()’:
/home/errorist/projects/forks/newton/newton-dynamics-read-only/coreLibrary_300/source/core/dgAABBPolygonSoup.h:99:17: warning: passing NULL to non-pointer argument 1 of ‘dgAABBPolygonSoup::dgNode::dgLeafNodePtr::dgLeafNodePtr(dgUnsigned32)’ [-Wconversion-null]
/home/errorist/projects/forks/newton/newton-dynamics-read-only/coreLibrary_300/source/core/dgAABBPolygonSoup.h:99:17: warning: passing NULL to non-pointer argument 1 of ‘dgAABBPolygonSoup::dgNode::dgLeafNodePtr::dgLeafNodePtr(dgUnsigned32)’ [-Wconversion-null]
make[2]: *** [CMakeFiles/Newton.dir/coreLibrary_300/source/newton/Newton.cpp.o] Помилка 1
make[1]: *** [CMakeFiles/Newton.dir/all] Помилка 2
make: *** [all] Помилка 2
Image
User avatar
shybovycha
 
Posts: 52
Joined: Fri Oct 23, 2009 6:15 am
Location: Poland

Re: Building under Linux

Postby Julio Jerez » Sat Jul 06, 2013 2:16 pm

what do you mean too many parameters, this is what the constructor looks like

OgreNewtonBody (OgreNewtonWorld* const dWorld, Real mass, const dNewtonCollision* const collision, SceneNode* const node, const Matrix4& location);
those are essential to make a rigid body, and the scene node is the use date for the ogre engine.
we can away add more construcors to the OgreNetwyonBody Class, there will probable be more.

I want to make the wrapper pure object oriented in Cpp, adding factories automatically make it a close system where the end user can only make objects on the type the factories that are provided unless they make there only factories.
I know people like Factories, but factories are not and object oriented concept, they are more application specific than for general purpose low level libraries,
state away form stuff like Factories and singleton.

what does the make log mean.
are you rung the Cmake file that si in the SVN arfchive?
I have not touched that I simple run the make file, I see if I can fix that CMake files.
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Next

Return to General Discussion

Who is online

Users browsing this forum: No registered users and 1 guest