Newton DLL builds

A place to discuss everything related to Newton Dynamics.

Moderators: Sascha Willems, walaber

Newton DLL builds

Postby JernejL » Wed Jan 10, 2018 11:42 am

I'm wondering if anybody else is interested in regular dll updates of newton dlls, this is only important for people who make stuff like external bindings to languages outside c++ world.

I know delphi developers might be interested, and i have already built a fully automated header converter which will produce pascal (delphi, fpc/lazarus) bindings automatically, but you still need dlls to go with that.

So, i can regularly build the msvc 2013 version of library as dlls for all windows platforms and targets and update a thread, as far as i know, there are no other ways to get dlls today than to compile it yourself, if they are availible somewhere, please let me know.

I'd love to have a GCC windows dll too for comparison, i see some work was done to get mingw to work, and there is a makefile for parts but not the main library as .dll release ( http://www.newtondynamics.com/forum/vie ... 3&start=30 ) - if there is interest in this, i will try to get it working.

Maybe at one point i can even fullly automate building dll releases..
Help improving the Newton Game Dynamics WIKI
User avatar
JernejL
 
Posts: 1578
Joined: Mon Dec 06, 2004 2:00 pm
Location: Slovenia

Re: Newton DLL builds

Postby Corpsman » Mon May 11, 2020 2:37 am

This post ist quite old, but yes i would be interested.

In my wildest dreams there would be a archive where you could download the newest and all stable old releases.

I in Person often need

newton.dll (32 and 64-Bit Version)
libnewton.so (64-Bit Version)

And as beeing a FPC Developer i often do not have the capabilities to compile that versions by myself (especially for the Windows plattform)

So could you give a location where at least the neweset version is available ?
--
You want to Know more about me and my projects visit http://www.Corpsman.de
I use Newton in Balanced2
Corpsman
 
Posts: 38
Joined: Mon May 01, 2006 11:42 am

Re: Newton DLL builds

Postby JernejL » Mon May 11, 2020 5:10 am

Some experimental builds are here:

https://github.com/JernejL/NewtonBinaries

I was stuck at getting linux building environment, so that is still completely missing..

Edit: updated files to today's build.

Edit2: i can now run this on demand, just notify me when you need a new build.
Once i can replace my HTPC where this runs on, i will enable automation (currently building newton makes unacceptable amout of noise fan).

Pascal header is also availible in the repository and is automaticly updated / generated.

You have a choice of dynamic linking dll calls directly and a header that lets you dynamicly load newton (giving you a chance to check version, integrity, etc.. ):

https://github.com/JernejL/NewtonBinari ... newton.pas
https://github.com/JernejL/NewtonBinari ... ynamic.pas

If you need any fixes in header for linux version, let me know, i'll correct it.
Help improving the Newton Game Dynamics WIKI
User avatar
JernejL
 
Posts: 1578
Joined: Mon Dec 06, 2004 2:00 pm
Location: Slovenia

Re: Newton DLL builds

Postby Corpsman » Mon May 11, 2020 7:33 am

wow, thanks that was faster than i expected.

so now its my turn to get a up to date Linux version so that all my variants are at the same state.

And thanks for the pascal header too, that is brilliant.
--
You want to Know more about me and my projects visit http://www.Corpsman.de
I use Newton in Balanced2
Corpsman
 
Posts: 38
Joined: Mon May 01, 2006 11:42 am

Re: Newton DLL builds

Postby JernejL » Mon May 11, 2020 7:51 am

You're welcome :)

The pascal header also updates and converts structures automaticly :)

Let me know if it needs any changes for linux or if anything doesn't match your header.
I hope to eventually get linux builds automated and added to automated building too.

My header conversion process is fully automatic and could also output headers other languages, for example for go or c# - if anyone wants to come in touch and explain how to make it, i can provide output support for additional languages.
Help improving the Newton Game Dynamics WIKI
User avatar
JernejL
 
Posts: 1578
Joined: Mon Dec 06, 2004 2:00 pm
Location: Slovenia

Re: Newton DLL builds

Postby Corpsman » Mon May 11, 2020 9:24 am

OK, here are my first results:

1. Both static and dynamic version depend on a file

"{$i compiler.inc}"
this is not in the repository (or i did not find it)

2. Your export is only usable under Windows
const
newtondll = 'Newton.dll';

should be something like:

const
{$ifdef Windows}
newtondll = 'Newton.dll';
{Else}
newtondll = 'libnewton.so';
{$endif}
i now test clone and compile ...

[Edit]
Ok the last time i successfully compiled newton it has been hosted via SVN so this a long time ago.
i cloned it to a folder and run "cmake ." to create the make files and this is what i got:

corpsman@corpsman /sda5/sda5/Temp/newton-dynamics-master $ cmake .
-- The C compiler identification is GNU 5.4.0
-- The CXX compiler identification is GNU 5.4.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - 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
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Check size of void*
-- Check size of void* - done
NEWTON_BUILD_SANDBOX_DEMOS is ON
NEWTON_BUILD_CORE_ONLY is OFF
dgCore
CMake Error at sdk/dgCore/CMakeLists.txt:20 (source_group):
source_group Unknown argument
"/sda5/sda5/Temp/newton-dynamics-master/sdk/dgCore/". Perhaps the FILES
keyword is missing.



newton
dgPhysics
dMath
dScene
dModel
dNewton
dVehicle
CMake Error at sdk/dVehicle/CMakeLists.txt:32 (source_group):
source_group Unknown argument
"/sda5/sda5/Temp/newton-dynamics-master/sdk/dVehicle/". Perhaps the FILES
keyword is missing.



dAnimation
dContainers
CMake Error at sdk/dContainers/CMakeLists.txt:20 (source_group):
source_group Unknown argument
"/sda5/sda5/Temp/newton-dynamics-master/sdk/dContainers/". Perhaps the
FILES keyword is missing.



dCustomJoints
CMake Error at sdk/dCustomJoints/CMakeLists.txt:20 (source_group):
source_group Unknown argument
"/sda5/sda5/Temp/newton-dynamics-master/sdk/dCustomJoints/". Perhaps the
FILES keyword is missing.



tinyxml
imgui
glatter
dgNewtonAvx
dgNewtonReferenceGPU
BUILDING DEMOS.
demosSandbox
CMake Error at applications/demosSandbox/CMakeLists.txt:27 (source_group):
source_group Unknown argument
"/sda5/sda5/Temp/newton-dynamics-master/applications/demosSandbox/".
Perhaps the FILES keyword is missing.



CMake Error at CMakeLists.txt:194 (find_package):
By not providing "Findglfw3.cmake" in CMAKE_MODULE_PATH this project has
asked CMake to find a package configuration file provided by "glfw3", but
CMake did not find one.

Could not find a package configuration file provided by "glfw3" with any of
the following names:

glfw3Config.cmake
glfw3-config.cmake

Add the installation prefix of "glfw3" to CMAKE_PREFIX_PATH or set
"glfw3_DIR" to a directory containing one of the above files. If "glfw3"
provides a separate development package or SDK, be sure it has been
installed.


-- Configuring incomplete, errors occurred!
See also "/sda5/sda5/Temp/newton-dynamics-master/CMakeFiles/CMakeOutput.log".
corpsman@corpsman /sda5/sda5/Temp/newton-dynamics-master $



Well i give it a try and try to fix it, but as i am not really got in C nore in make this would be hard...
--
You want to Know more about me and my projects visit http://www.Corpsman.de
I use Newton in Balanced2
Corpsman
 
Posts: 38
Joined: Mon May 01, 2006 11:42 am

Re: Newton DLL builds

Postby JernejL » Mon May 11, 2020 3:42 pm

compiler.inc was meant to be custom compiler include, if you used one in your peoject, it's not mandatory to have one.

I've corrected what you said regarding newton.so, we will need to extend this later if we add more platforms.

I also assume that newton_dynamic.pas will also not work on unix at all, this will need to be fixed at one point as well, but for now i will try to start including linux builds, i will need to re-apply my cmake patches and have julio include my fixes again - i was able to compile arm versions too, i got it to compile on raspberry pi - i hope to do that again soon, as newton on raspberry pi with lazarus & freepascal could be a good solution for robotics.
Help improving the Newton Game Dynamics WIKI
User avatar
JernejL
 
Posts: 1578
Joined: Mon Dec 06, 2004 2:00 pm
Location: Slovenia

Re: Newton DLL builds

Postby Corpsman » Tue May 12, 2020 3:08 am

We are getting progress ;) here are my results:

i wrote a little programm (see attechment) and tested it on

Windows 10- 32-Bit (linked dynamic / static) (your precompiled relaese Single Newton 3.15)
Windows 10- 64-Bit (linked dynamic / static) (your precompiled relaese Single Newton 3.15)

I do not have a Linux 32-Bit Compiler at the moment
Linux Mint 18.3 64-Bit (linked dynamic / static) (my precompiled ? Single Newton 3.14)

Changes i did:
newton.pas:
- added: {$MODE objfpc}{$H+}
- newtondll = 'libNewton.so'; // Linux is case sensitive and the Name has to match perfect
- Pretty printing

newton_dynamic:
-rewritten as the FPC Type checker did not accept your code
=> Use this as template to generate the fully functional file

-\
-/ Static and dynamic linking is possible on both operating systems.

Static linking is nearly complete
dynamic linking needs some extra work and needs to be tested with 3.15
compile using cmake . under linux does not work
Attachments
Demo.zip
Source i created, without .dll /.so files
(16.24 KiB) Downloaded 488 times
--
You want to Know more about me and my projects visit http://www.Corpsman.de
I use Newton in Balanced2
Corpsman
 
Posts: 38
Joined: Mon May 01, 2006 11:42 am

Re: Newton DLL builds

Postby JernejL » Tue May 12, 2020 4:24 am

i will include the changes regarding name and compiler directive in next commit.

I think that the way dynamic loading code is generated might be incompatible with fpc but works in delphi mode, i use this in freepascal with my game, so it does work - what errors do you get there?
Help improving the Newton Game Dynamics WIKI
User avatar
JernejL
 
Posts: 1578
Joined: Mon Dec 06, 2004 2:00 pm
Location: Slovenia

Re: Newton DLL builds

Postby Corpsman » Tue May 12, 2020 5:00 am

Well that was a good hint, now i can run the dynamic version too (only tested in Windows)

As following the changes i did:

Change Filename or filename declaration:
unit Newton_dynamic;

Compilemode:
{$MODE Delphi}

Other uses to be plattform indepand:
uses dynlibs;

var
NewtonLibrary: TLibHandle;

And thats it.

This leaves only the part where to get the precompiled Linux libNewton.so

[Edit]
All the errors that held the dynamic version from compiling in FPC mode are type mismatches. The FPC Mode is much more restrictive.

All Error messages look like this:

newton_dynamic.pas(1595,42) Error: Incompatible types: got "Pointer" expected "<procedure variable type of function:LongInt;CDecl>"
--
You want to Know more about me and my projects visit http://www.Corpsman.de
I use Newton in Balanced2
Corpsman
 
Posts: 38
Joined: Mon May 01, 2006 11:42 am

Re: Newton DLL builds

Postby JernejL » Tue May 12, 2020 6:39 am

Corpsman wrote:Well that was a good hint, now i can run the dynamic version too (only tested in Windows)

As following the changes i did:

Change Filename or filename declaration:
unit Newton_dynamic;

Compilemode:
{$MODE Delphi}

Other uses to be plattform indepand:
uses dynlibs;

var
NewtonLibrary: TLibHandle;

And thats it.

This leaves only the part where to get the precompiled Linux libNewton.so

[Edit]
All the errors that held the dynamic version from compiling in FPC mode are type mismatches. The FPC Mode is much more restrictive.

All Error messages look like this:

newton_dynamic.pas(1595,42) Error: Incompatible types: got "Pointer" expected "<procedure variable type of function:LongInt;CDecl>"


Yeah all those getprocaddr pointers would need to be cast into specific types, i have changed the hader generator according to your response, it now generates mode delphi and uses dynlib - please see if it's OK.

I will try to get my linux builds sorted out - i need to update cmake files where julio overwrote some of my changes.
Help improving the Newton Game Dynamics WIKI
User avatar
JernejL
 
Posts: 1578
Joined: Mon Dec 06, 2004 2:00 pm
Location: Slovenia

Re: Newton DLL builds

Postby JernejL » Tue May 12, 2020 7:07 am

I test built a linux amd64 .so, try if this works for you:

https://github.com/JernejL/NewtonBinari ... er/Linux64

It's a shared library compiled on debian / ubuntu server and it links to 2 other .so files - i commited all those. I hope to change this to link libdgPhysics and libdgCore staticly, but this is what i need to correct cmakefiles in the future.

Code: Select all
ldd libnewton.so
        linux-vdso.so.1 (0x00007fff92dd8000)
        libdgPhysics.so => /var/www/Newton/newton-dynamics-automation/build/lib/libdgPhysics.so (0x00007fd7983de000)
        libdgCore.so => /var/www/Newton/newton-dynamics-automation/build/lib/libdgCore.so (0x00007fd798181000)
        libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007fd797df8000)
        libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007fd797a5a000)
        libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007fd797842000)
        libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fd797451000)
        /lib64/ld-linux-x86-64.so.2 (0x00007fd798921000)



Apparently correct name is lower case libnewton.so - i will correct this in header at later time.

Try if this works for you.
Help improving the Newton Game Dynamics WIKI
User avatar
JernejL
 
Posts: 1578
Joined: Mon Dec 06, 2004 2:00 pm
Location: Slovenia

Re: Newton DLL builds

Postby Corpsman » Tue May 12, 2020 7:37 am

OK, i downloaded the 3 .so files. Made them executable (chmod +x)

running the dynamic version of the program, i get a crash

copied the 3.so files into (/usr/lib)

tried to compile it static linked and get the following error message:

Compile Project, Target: project1: Exit code 1, Errors: 5, Hints: 1
unit1.pas(30,51) Hint: Parameter "CanClose" not used
Error: //usr/lib/libdgCore.so: undefined reference to `std::thread::_State::~_State()@GLIBCXX_3.4.22'
Error: //usr/lib/libdgCore.so: undefined reference to `std::thread::_M_start_thread(std::unique_ptr<std::thread::_State, std::default_delete<std::thread::_State> >, void (*)())@GLIBCXX_3.4.22'
Error: //usr/lib/libdgPhysics.so: undefined reference to `powf@GLIBC_2.27'
Error: //usr/lib/libdgCore.so: undefined reference to `typeinfo for std::thread::_State@GLIBCXX_3.4.22'
project1.lpr(19,1) Error: Error while linking


and thats the point where i do not know what to do next...

i also run the ldd command. looks ok to me:
corpsman@corpsman ~/Desktop $ ldd libnewton.so
./libnewton.so: /lib/x86_64-linux-gnu/libm.so.6: version `GLIBC_2.27' not found (required by libdgPhysics.so)
./libnewton.so: /usr/lib/x86_64-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.22' not found (required by libdgCore.so)
linux-vdso.so.1 => (0x00007ffd78ba6000)
libdgPhysics.so (0x00007f90c55a9000)
libdgCore.so (0x00007f90c534c000)
libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f90c4fca000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f90c4cc1000)
libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f90c4aab000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f90c46e1000)
/lib64/ld-linux-x86-64.so.2 (0x00007f90c5aec000)

--
You want to Know more about me and my projects visit http://www.Corpsman.de
I use Newton in Balanced2
Corpsman
 
Posts: 38
Joined: Mon May 01, 2006 11:42 am

Re: Newton DLL builds

Postby JernejL » Tue May 12, 2020 7:43 am

What flavour of linux do you use? compiling on linux is not difficult, i could set up a small guide if you wanted to try:

Code: Select all
sudo apt-get --assume-yes install binutils-arm-linux-gnueabi
sudo apt-get --assume-yes install build-essential
sudo apt-get --assume-yes install cmake
sudo apt-get --assume-yes install debootstrap
sudo apt-get --assume-yes install device-tree-compiler
sudo apt-get --assume-yes install g++-aarch64-linux-gnu
sudo apt-get --assume-yes install g++-arm-linux-gnueabihf
sudo apt-get --assume-yes install gcc-aarch64-linux-gnu
sudo apt-get --assume-yes install gcc-arm-linux-gnueabi
sudo apt-get --assume-yes install gcc-arm-linux-gnueabihf
sudo apt-get --assume-yes install gcc-g++
sudo apt-get --assume-yes install git
sudo apt-get --assume-yes install libc6-armel-cross
sudo apt-get --assume-yes install libc6-dev-armel-cross
sudo apt-get --assume-yes install libfreetype6-dev
sudo apt-get --assume-yes install libgl1-mesa-dev
sudo apt-get --assume-yes install libglew-dev
sudo apt-get --assume-yes install libglfw3-dev
sudo apt-get --assume-yes install libglu1-mesa-dev
sudo apt-get --assume-yes install libncurses5-dev
sudo apt-get --assume-yes install libopenal-dev
sudo apt-get --assume-yes install libsdl1.2debian
sudo apt-get --assume-yes install libsdl1.2-dev
sudo apt-get --assume-yes install libsdl-image1.2
sudo apt-get --assume-yes install libsdl-image1.2-dev
sudo apt-get --assume-yes install libtinyxml-dev
sudo apt-get --assume-yes install libwxgtk3.0-dev
sudo apt-get --assume-yes install u-boot-tools

compile:

git pull trunk in some directory, i use /var/www/Newton/newton-dynamics-automation/build/

clean cache:
rm /var/www/Newton/newton-dynamics-automation/build/CMakeCache.txt

cd /var/www/Newton/newton-dynamics-automation/build

cmake -DNEWTON_DEMOS_SANDBOX=OFF -DNEWTON_BUILD_SHARED_LIBS=OFF .. && make



Output .so files will be in /var/www/Newton/newton-dynamics-automation/build/lib
Help improving the Newton Game Dynamics WIKI
User avatar
JernejL
 
Posts: 1578
Joined: Mon Dec 06, 2004 2:00 pm
Location: Slovenia

Re: Newton DLL builds

Postby Corpsman » Tue May 12, 2020 8:27 am

At first i tried to compile it by myself but unfortunatunelly on "https://github.com/MADEAPPS/newton-dynamics/"

there is only:
There are Unix makefiles in the project folders mentioned above, but it is highly recommended to use CMake instead.

That was not enough for me to do the trick..

i installed all the packages you qouted except:
sudo apt-get --assume-yes install gcc-g++

as this is not in my package manager available

I am Using Linux Mint Mate 18.3

i used the following commands:


i navigated into that folder created a build subfolder and than i run the cmake command, with this results:

corpsman@corpsman /sda5/sda5/Temp/newton/newton-dynamics/build $ cmake -DNEWTON_DEMOS_SANDBOX=OFF -DNEWTON_BUILD_SHARED_LIBS=ON .. && make
NEWTON_BUILD_SANDBOX_DEMOS is ON
NEWTON_BUILD_CORE_ONLY is OFF
dgCore
CMake Error at sdk/dgCore/CMakeLists.txt:20 (source_group):
source_group Unknown argument
"/sda5/sda5/Temp/newton/newton-dynamics/sdk/dgCore/". Perhaps the FILES
keyword is missing.



newton
dgPhysics
dMath
dScene
dModel
dNewton
dVehicle
CMake Error at sdk/dVehicle/CMakeLists.txt:32 (source_group):
source_group Unknown argument
"/sda5/sda5/Temp/newton/newton-dynamics/sdk/dVehicle/". Perhaps the FILES
keyword is missing.



dAnimation
dContainers
CMake Error at sdk/dContainers/CMakeLists.txt:20 (source_group):
source_group Unknown argument
"/sda5/sda5/Temp/newton/newton-dynamics/sdk/dContainers/". Perhaps the
FILES keyword is missing.



dCustomJoints
CMake Error at sdk/dCustomJoints/CMakeLists.txt:20 (source_group):
source_group Unknown argument
"/sda5/sda5/Temp/newton/newton-dynamics/sdk/dCustomJoints/". Perhaps the
FILES keyword is missing.



tinyxml
imgui
glatter
dgNewtonAvx
dgNewtonReferenceGPU
BUILDING DEMOS.
demosSandbox
CMake Error at applications/demosSandbox/CMakeLists.txt:27 (source_group):
source_group Unknown argument
"/sda5/sda5/Temp/newton/newton-dynamics/applications/demosSandbox/".
Perhaps the FILES keyword is missing.



Found GLFW library
Found OpenAL library
Found OpenGL library
-- Configuring incomplete, errors occurred!
See also "/sda5/sda5/Temp/newton/newton-dynamics/CMakeFiles/CMakeOutput.log".
corpsman@corpsman /sda5/sda5/Temp/newton/newton-dynamics/build $



so it seems that my arguments are not recognized as i am only want to build the shared lib and there are still some errors i do not understand.
--
You want to Know more about me and my projects visit http://www.Corpsman.de
I use Newton in Balanced2
Corpsman
 
Posts: 38
Joined: Mon May 01, 2006 11:42 am

Next

Return to General Discussion

Who is online

Users browsing this forum: No registered users and 22 guests