Newton in C++

A place to discuss everything related to Newton Dynamics.

Moderators: Sascha Willems, walaber

Re: Newton in C++

Postby lperkins2 » Wed Sep 12, 2018 2:23 am

So, can you post what changes you made to the cmake files to get that far? I still can't get cmake to run properly.
lperkins2
 
Posts: 39
Joined: Fri Jul 03, 2015 4:16 am

Re: Newton in C++

Postby Dave Gravel » Wed Sep 12, 2018 8:43 am

by lperkins2 » Wed Sep 12, 2018 1:23 am
So, can you post what changes you made to the cmake files to get that far? I still can't get cmake to run properly.

This video show step by step what I do to get it run with cmake.
It currently don't work right with cmake, It is just some first try.

https://www.youtube.com/watch?v=tZPrH278TJg


Hi Julio, I have success to build the lib by commenting out the union and struct parts.
I'm not sure if it can work right, I understand what happen but i'm not sure about all relations it have with newton code. I let's it to you to find the best solution for it.

I have success to get the lib build with cmake but I get only the static and i'm not able to use it.
I need to try with other options.

I have try with my old method, The one I have use for my android lib with only makefile.

Now I have success to get all newton lib and i'm able to use it.
It's not super simple but it work.

https://www.youtube.com/watch?v=7Z9qYfEE_y8
You search a nice physics solution, if you can read this message you're at the good place :wink:
OrionX3D Projects & Demos:
https://orionx3d.sytes.net
https://www.facebook.com/dave.gravel1
https://www.youtube.com/user/EvadLevarg/videos
User avatar
Dave Gravel
 
Posts: 800
Joined: Sat Apr 01, 2006 9:31 pm
Location: Quebec in Canada.

Re: Newton in C++

Postby Julio Jerez » Wed Sep 12, 2018 9:21 am

ok David I fixed class dgWorkGroupFloat, no longer uses a nameless union, instead is have function tha do the same work and is more cross platform, liek this

Code: Select all
   DG_INLINE dgInt32 GetInt(dgInt32 i) const
   {
      dgAssert (i >= 0);
      dgAssert(i < DG_WORK_GROUP_SIZE);
      const dgInt32* const ptr = m_low.m_i;
      return ptr[i];
   }

   DG_INLINE void SetInt(dgInt32 i, dgInt32 value)
   {
      dgAssert(i >= 0);
      dgAssert(i < DG_WORK_GROUP_SIZE);
      dgInt32* const ptr = m_low.m_i;
      ptr[i] = value;
   }



I also made the dll loader to work only on win32 for now, until we get a basic working version, and we figure out how to build and long plugin dll in Linux systems.
for now we just buidl them but they will not be loaded.
if you sync it should build now.

@ lperkins2
I think we need to wait until he resolve the compile issues, just because is compile it does no mean is will run right away, there are some portability issue like loading David dynamically link libraries, that I never wrote and has to be added or moment out.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Newton in C++

Postby Dave Gravel » Wed Sep 12, 2018 9:36 am

With the Tracker for now I have just comment out the #include <dTimeTracker.h> for bypass it.
I don't call the Tracker project in the makefile.

Maybe it can help for the plugin, the link is a bit old but it is surely something similar.
The part Listing 7. Main file Loadlib.cpp
I don't know so much about the HMODULE under linux.


With the last change I get this error.
../../dgPhysics/dgWorldDynamicsParallelSolver.h: In member function ‘dgFloat32& dgWorkGroupFloat::operator[](dgInt32)’:
../../dgPhysics/dgWorldDynamicsParallelSolver.h:84:32: error: ‘class dgVector’ has no member named ‘m_f’
dgFloat32* const ptr = m_low.m_f;
^~~
../../dgPhysics/dgWorldDynamicsParallelSolver.h: In member function ‘const dgFloat32& dgWorkGroupFloat::operator[](dgInt32) const’:
../../dgPhysics/dgWorldDynamicsParallelSolver.h:92:38: error: ‘const class dgVector’ has no member named ‘m_f’
const dgFloat32* const ptr = m_low.m_f;



Code: Select all
   DG_INLINE dgFloat32& operator[] (dgInt32 i)
   {
      dgAssert(i >= 0);
      dgAssert(i < DG_WORK_GROUP_SIZE);
      dgFloat32* const ptr = m_low.m_f;
      return ptr[i];
   }
You search a nice physics solution, if you can read this message you're at the good place :wink:
OrionX3D Projects & Demos:
https://orionx3d.sytes.net
https://www.facebook.com/dave.gravel1
https://www.youtube.com/user/EvadLevarg/videos
User avatar
Dave Gravel
 
Posts: 800
Joined: Sat Apr 01, 2006 9:31 pm
Location: Quebec in Canada.

Re: Newton in C++

Postby Dave Gravel » Wed Sep 12, 2018 10:31 am

Ok Julio at line 629 in dgVector.h just add dgFloat32 m_f[4]; and it seen to work now.

Edit:
About the plugin the UnloadPlugins() need a #ifdef check.
#ifdef _MSC_VER
#endif

With this I can compile.
It is only a basic demo but it seen to work good here.

Demo executable:
https://sites.google.com/site/evadlevar ... uxDemo.zip
You surely need to use chmod +x NewtonTest
and run with ./NewtonTest
If you get a error try
chmod -R 555 libNewton.so or chmod -R 777 libNewton.so
You search a nice physics solution, if you can read this message you're at the good place :wink:
OrionX3D Projects & Demos:
https://orionx3d.sytes.net
https://www.facebook.com/dave.gravel1
https://www.youtube.com/user/EvadLevarg/videos
User avatar
Dave Gravel
 
Posts: 800
Joined: Sat Apr 01, 2006 9:31 pm
Location: Quebec in Canada.

Re: Newton in C++

Postby Julio Jerez » Wed Sep 12, 2018 11:40 am

oh because you are building the scalar version, for now.
I fix the dgWorkGroupFloat class please try again,

after we get it running we nee to see if the see work because the paraller solve count one that, or wioll be very slow. actually I never try the paraller solve with scalar, I will later.

yes for linux we can leave the profiler library out, is not really needed.

Please sync and try again,
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Newton in C++

Postby Dave Gravel » Wed Sep 12, 2018 2:57 pm

Yes Julio it seen to work ok now.
Maybe it is better to add a #ifdef check in dgTypes at #include <dTimeTracker.h>

I get it work but only with the Makefile directly and I have set all projects manually.
I do some more tests about cmake and my config, and I prepare a zip with all of what you need to get it work ok.
After you can see what is the best to use.

Yes I use scalar vector, Linux don't seen to like without it.

This is what looking the error without use scalar vector.
/usr/lib/gcc/x86_64-linux-gnu/7/include/pmmintrin.h: In member function ‘dgVector dgVector::AddHorizontal() const’:
/usr/lib/gcc/x86_64-linux-gnu/7/include/pmmintrin.h:56:1: error: inlining failed in call to always_inline ‘__m128 _mm_hadd_ps(__m128, __m128)’: target specific option mismatch
_mm_hadd_ps (__m128 __X, __m128 __Y)
^~~~~~~~~~~
You search a nice physics solution, if you can read this message you're at the good place :wink:
OrionX3D Projects & Demos:
https://orionx3d.sytes.net
https://www.facebook.com/dave.gravel1
https://www.youtube.com/user/EvadLevarg/videos
User avatar
Dave Gravel
 
Posts: 800
Joined: Sat Apr 01, 2006 9:31 pm
Location: Quebec in Canada.

Re: Newton in C++

Postby Dave Gravel » Fri Sep 14, 2018 3:23 am

This is what I get for now.

https://www.youtube.com/watch?v=5abTT5BH5YM


Edited:
Sorry it is not the cmake version like supposed.
I have get all libs compiled with cmake but only in static mode.
All libs that is normally a dll under windows need to become a .so to get it work right under linux.
I don't have success to get the .so from cmake, I have test some flags but I get only the static...
I don't give up for my tests and try to get cmake work correctly.
I have make a quick bash script tool in waitting a better solution maybe it can help to get the cmake work. The cmake linux seen to use unix makefiles too.
If I get a better solution with cmake I back with the infos about the way to go.
If someone really need to test linux and don't get it work, You can try with my script tool in waitting a other solution. My method use bash script for execute makefiles.
In my zip you can find the last git sdk for compile, but you can update the sdk too if you need.
If you update the sdk in coming with the zip, Read the NewtonModification.txt inside help folder.

Have good times under Linux :P

Download link version test (debug | release) 64bits only :
http://www.mediafire.com/file/8qggzej7j ... _09_14.zip

Edited2:
I have get the .so lib from cmake now.
I need to do some tests to see if the lib work ok.
I back later with the updated file for use cmake.

Edited3:
Good news I have get it working with cmake and I can compile and run my demo test too.
Other good news I don't need to set all extra flags for get it working.
I going to add my modification to all CMakeLists.txt that need it, I prepare a other zip with cmake working when I finish.
You search a nice physics solution, if you can read this message you're at the good place :wink:
OrionX3D Projects & Demos:
https://orionx3d.sytes.net
https://www.facebook.com/dave.gravel1
https://www.youtube.com/user/EvadLevarg/videos
User avatar
Dave Gravel
 
Posts: 800
Joined: Sat Apr 01, 2006 9:31 pm
Location: Quebec in Canada.

Re: Newton in C++

Postby Dave Gravel » Sat Sep 15, 2018 7:30 am

Finally I have get it working with CMake.

It is very very easy to use now.

My modifications is not supposed to interfering with the newton sdk behaviour.
You can use the CMake tool, or use commands line with my modified CMake files.

Personally I prefer use my little script tool v2, I can save a lot of times.
Now the script tool is all in one.
You can compile the newton libs in fast mode, release mode, debug mode, plus a basic demo.

DOWNLOAD LINK:
https://sites.google.com/site/orionx3d/ ... h_Menu.zip

It is my final version about this tool.
Have fun!

Video:
https://www.youtube.com/watch?v=xDy2pdVUal0
You search a nice physics solution, if you can read this message you're at the good place :wink:
OrionX3D Projects & Demos:
https://orionx3d.sytes.net
https://www.facebook.com/dave.gravel1
https://www.youtube.com/user/EvadLevarg/videos
User avatar
Dave Gravel
 
Posts: 800
Joined: Sat Apr 01, 2006 9:31 pm
Location: Quebec in Canada.

Re: Newton in C++

Postby Julio Jerez » Sat Sep 15, 2018 12:32 pm

Slick wrote:I am not an expert but it looks like a files and folder permission problem. In file browser right click on a few files and check permissions. You may want to use command line chmod to change if needed.


ah I when to teh persmission and you where right all file and folder where read only, and Chnegd to read and right and now is cmake can ready it.

David I giot you zip file and I am using to merge it and see if I can get a working build.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Newton in C++

Postby Julio Jerez » Sat Sep 15, 2018 12:43 pm

Oh I see what the problem wit ethe repository is, is the github client that mak ethe file write protected.

I click pull and all file are now again write protected, what GitHub client you guys use. I installed one the was in ubuntu called Git-cola but it does seem very good.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Newton in C++

Postby Dave Gravel » Sat Sep 15, 2018 12:43 pm

Let's me know if you success.
Try the last one with cmake version, I think it is the best one.
The first version use many no needed flags, and don't use cmake.
My first version is based on my old method for android lib, but linux do not need all this flags.

This zip is the good one:
https://sites.google.com/site/orionx3d/ ... h_Menu.zip

Edited:
I don't use github when I do tests.
You can see how I get newton in my last video at the begin.

I'm not sure if my files is ok for add in github.
If no the most important it show how to get cmake working with newton + linux.
You can use or do what you like with my modification.

I use many unix flag for separate things in the CMakefile.
Maybe the mac users need similar flags to get it work too.

I'm not sure about how many windows stuff the sandbox demo use.
I can setup the project correctly for build, but it seen to use windows.h and maybe more.

I have make a quick script tool for help and save time.
The script is not a obligation to use for get it working.

Normally just by adding my CMakefiles you can setup the rest manually with cmake.
CMake-gui currently is not so important for newton sdk because most options need to become disabled.

I have get it working ok, but i'm not sure for all parts I have do my possible with what I understand.
More I play with it more I see how to go but with virtual system i'm a lot limited for test 3d stuff.
I start to think to re-install linux for real on my drive for 3d parts.
Some good old memory have comeback about linux by using it again :twisted: ...

The most important for me is to show how I have get it work and help other users.
You can see my modifications in all CMakefile.
Maybe my method is not the most clean, but it work good.
I have test many stuff before get it work hehe, In many case you can get it compile ok but the lib don't work or get segmentation fault.
The way I have find from my tests seen stable on any mode release or debug.
In the final I have success to finish with only some CMakefile modifications.
If you or any users have questions about it I can try my best for help.
I have write final version, but i'm open to comeback on it later if it need update.
Maybe if I install no virtual linux later I can continue with more 3d demos.
You search a nice physics solution, if you can read this message you're at the good place :wink:
OrionX3D Projects & Demos:
https://orionx3d.sytes.net
https://www.facebook.com/dave.gravel1
https://www.youtube.com/user/EvadLevarg/videos
User avatar
Dave Gravel
 
Posts: 800
Joined: Sat Apr 01, 2006 9:31 pm
Location: Quebec in Canada.

Re: Newton in C++

Postby Julio Jerez » Tue Sep 18, 2018 1:28 pm

Microsoft announced Unbuntu 18.04
which they say fixed a bunch of bugs.
one is that the windows now can be resized it,
the current version the windows frame is fix at a resolution that seem to be 800 x 600.

I hope they got the file accest problem. because this has not work for my,
It seem all file are protected.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Newton in C++

Postby Dave Gravel » Tue Sep 18, 2018 1:55 pm

Maybe the access problem come from the application, Here at the begin I have use the windows 10 hyper system without access file problem. Or your user have low permission in the system.
The only problem I get with windows virtual machine is the window size, It is a bit slower too from my test and I think for share files with windows you need to share it like on a network.
I use VMware because it run faster for me and the windows resize work ok and it can interact with windows directly for exemple the copy past. I can use SVGA too with LLVM plus mesa,glu,glut,glew,glfw3, It's not for big 3d stuff but old gl command work good. Virtualbox is not bad too, but here the application freeze if I resize 2 or 3 times.
You search a nice physics solution, if you can read this message you're at the good place :wink:
OrionX3D Projects & Demos:
https://orionx3d.sytes.net
https://www.facebook.com/dave.gravel1
https://www.youtube.com/user/EvadLevarg/videos
User avatar
Dave Gravel
 
Posts: 800
Joined: Sat Apr 01, 2006 9:31 pm
Location: Quebec in Canada.

Re: Newton in C++

Postby Julio Jerez » Tue Sep 18, 2018 2:42 pm

vmware, is that free?
I would not mind using it, but when I was searching for virtual machine to run ubuntu, I did not find any reference to vmware.
I like the idea of file sharing, because I believe the problem is with the github clients, some how the make they file protected.
if the new 18.04 ubuntu allows for file sharing then I can do it without source control, but this version does not allows file sharing either, it does not even allows allows for mode clipboard, so is very limiting.

anyway I see if the new 18.04 is better and I can read a share file, if not I look for alternatives.
maybe I can use an usb drive.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

PreviousNext

Return to General Discussion

Who is online

Users browsing this forum: No registered users and 12 guests

cron