Newton in C++

A place to discuss everything related to Newton Dynamics.

Moderators: Sascha Willems, walaber

Re: Newton in C++

Postby Dave Gravel » Tue Sep 18, 2018 3:01 pm

The player vmware is free for no commercial use.
Here I use ubuntu 18.04.1 LTS

https://my.vmware.com/en/web/vmware/fre ... layer/14_0
wmware create the user linux when you prepare the virtual machine.
when you finish the install the user is already set.

I don't know if it can cause problems with what you can use about license.
You search a nice physics solution, if you can read this message you're at the good place :wink:
OrionX3D Projects & Demos:
https://www.facebook.com/dave.gravel1
http://orionx3d.googlepages.com/
https://www.youtube.com/user/EvadLevarg/videos
User avatar
Dave Gravel
 
Posts: 690
Joined: Sat Apr 01, 2006 9:31 pm
Location: Quebec in Canada.

Re: Newton in C++

Postby Slick » Wed Sep 19, 2018 5:07 am

I have also used virtualbox that works quite well. You can share folders with Windows etc.
Slick
 
Posts: 266
Joined: Sat Feb 07, 2004 7:24 pm
Location: Los Angeles

Re: Newton in C++

Postby lperkins2 » Sun Sep 30, 2018 9:03 pm

So I just got around to trying your (Dave's) build system, and I got it to work. It's a little odd that it outputs the libraries in newton/linux/newton/ instead of the cmake build directory ($project/build is pretty common), but it otherwise ran without issue. Thanks a bunch Dave for getting that working.

That said, this brings me back to the original purpose of this thread. sdk/dgNewton/Newton.h provides a C style header, implemented in sdk/dgNewton/Newton.cpp. sdk/dNewton/dNewton.h is a C++ header, but it's implementation just wraps the Newton.h C header into C++, it isn't actually interacting more tightly with newton. It looks like sdk/dgNewton/Newton.h is the only public API for newton, with the C++ version (dNewton) provided for convenience but not actually a separate API.

I suppose for the moment I'll go ahead under the assumption that this is the full extent of the public facing (and hopefully stable) API, and revisit accessing the true implementation of the C++ classes if I hit something that cannot be solved via the public API.
lperkins2
 
Posts: 37
Joined: Fri Jul 03, 2015 4:16 am

Re: Newton in C++

Postby Julio Jerez » Sun Sep 30, 2018 10:21 pm

lperkins2 wrote:It looks like sdk/dgNewton/Newton.h is the only public API for newton, with the C++ version (dNewton) provided for convenience but not actually a separate API.


this is correct, the newton core is wrapped by one header and one c file.
all of the other stuff are wrapper that use those two files.
kind of like wind32

Internally Newton is heavy C++, but non of the stuff is exposed,
some people use soem of the funtionality directly, but there is not real gain from doing that.
having the C interface keep the interface clean and eassy to use, since ther are only C function.
Julio Jerez
Moderator
Moderator
 
Posts: 10954
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Newton in C++

Postby lperkins2 » Mon Oct 01, 2018 12:04 am

That's fair enough. Unfortunately, that complicates automatic binding generation, since the C API uses dumb pointers (float* et cetera) for things which internally have known dimensions (dgMatrix*). I may take the time to make a slightly smarter/more type aware header file, as that's probably faster than trying to figure out array dimensions automagically everywhere.
lperkins2
 
Posts: 37
Joined: Fri Jul 03, 2015 4:16 am

Re: Newton in C++

Postby Dave Gravel » Mon Oct 01, 2018 1:10 pm

Sorry for the path libs.
I have try many method from many newtonsdk folder before get it working, It is why I use this simple path for my tests.

You can take a look in the CMakeLists.txt files for all lib you need.
Exemple in folder .dgCore/ if you open the CMakeLists.txt you can find :
Code: Select all
add_custom_command(
        TARGET ${projectName} POST_BUILD
        COMMAND ${CMAKE_COMMAND} -E copy
                ${CMAKE_SOURCE_DIR}/sdk/dgCore/libdgCore.a
                ${CMAKE_SOURCE_DIR}/linux/newton/libdgCore.a)
else()
if (CMAKE_BUILD_TYPE STREQUAL "Debug")
add_custom_command(
        TARGET ${projectName} POST_BUILD
        COMMAND ${CMAKE_COMMAND} -E copy
                ${CMAKE_SOURCE_DIR}/sdk/dgCore/libdgCore_d.a
                ${CMAKE_SOURCE_DIR}/linux/newton/libdgCore_d.a)
endif ()


Just to use your path and do the same modification for all lib you need.
You search a nice physics solution, if you can read this message you're at the good place :wink:
OrionX3D Projects & Demos:
https://www.facebook.com/dave.gravel1
http://orionx3d.googlepages.com/
https://www.youtube.com/user/EvadLevarg/videos
User avatar
Dave Gravel
 
Posts: 690
Joined: Sat Apr 01, 2006 9:31 pm
Location: Quebec in Canada.

Re: Newton in C++

Postby Julio Jerez » Mon Oct 01, 2018 2:15 pm

when you guys get a stable Linux cmake,
please let me know, so that I can merge with the one is the depo
Julio Jerez
Moderator
Moderator
 
Posts: 10954
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Newton in C++

Postby lperkins2 » Mon Oct 01, 2018 3:56 pm

Dave Gravel wrote:Sorry for the path libs.
I have try many method from many newtonsdk folder before get it working, It is why I use this simple path for my tests.

You can take a look in the CMakeLists.txt files for all lib you need.
Exemple in folder .dgCore/ if you open the CMakeLists.txt you can find :
Code: Select all
add_custom_command(
        TARGET ${projectName} POST_BUILD
        COMMAND ${CMAKE_COMMAND} -E copy
                ${CMAKE_SOURCE_DIR}/sdk/dgCore/libdgCore.a
                ${CMAKE_SOURCE_DIR}/linux/newton/libdgCore.a)
else()
if (CMAKE_BUILD_TYPE STREQUAL "Debug")
add_custom_command(
        TARGET ${projectName} POST_BUILD
        COMMAND ${CMAKE_COMMAND} -E copy
                ${CMAKE_SOURCE_DIR}/sdk/dgCore/libdgCore_d.a
                ${CMAKE_SOURCE_DIR}/linux/newton/libdgCore_d.a)
endif ()


Just to use your path and do the same modification for all lib you need.


That makes perfect sense. To get it to build properly out of tree, CMAKE_SOURCE_DIR should be CMAKE_BINARY_DIR . Then the cmake process won't clutter the source tree with build artifacts. If you run cmake in the root of the source tree, the behaviour will be exactly the same as it is now.

Code: Select all
$ git clone https://github.com/MADEAPPS/newton-dynamics/
$ mkdir newton-build
$ cd newton-build
$ cmake ../newton-dynamics
$ make

Will generate all the output in newton-build. (Obviously, with the cmake files replaced with working ones).

In-tree builds are semi-frowned upon in linux, having them work is fine (though many projects will fail to build in-tree), but requiring them is unexpected (the default is usually to arrange the source tree vs build tree similarly to above).
lperkins2
 
Posts: 37
Joined: Fri Jul 03, 2015 4:16 am

Re: Newton in C++

Postby Slick » Thu Oct 25, 2018 2:58 pm

I just updated to the latest. Is it possible that the .pdb files are not being copied to the same folder as the .lib files? I didn't rerun cmake because I already have a working solution. I build install after the solution builds. I feel like the .pdb files used to be in with the .lib files.
Slick
 
Posts: 266
Joined: Sat Feb 07, 2004 7:24 pm
Location: Los Angeles

Re: Newton in C++

Postby lperkins2 » Mon Nov 12, 2018 10:41 pm

So this is related to the above issue. The lib files are being specifically copied over, nothing else is. The rest are in the build tree, which is the same as the source tree, so the missing files will be in sdk/<subproject>/...
lperkins2
 
Posts: 37
Joined: Fri Jul 03, 2015 4:16 am

Previous

Return to General Discussion

Who is online

Users browsing this forum: No registered users and 4 guests