Buiding a windows DLL using tdm-MinGW

A place to discuss everything related to Newton Dynamics.

Moderators: Sascha Willems, walaber

Re: Buiding a windows DLL using tdm-MinGW

Postby Julio Jerez » Mon Aug 24, 2009 1:22 pm

martinsm wrote:I have no idea. Only thin that seems reasonable for me, that somewhere there optimizations are not enabled.
Try adding -ffast-math compilation flag, but that will affect only non FPU calculations, not SSE.

Ha good Idea I did not test with teh option -ffast-math, the speed up a saw was due to floats operations so maybe this is part of that for 4.4.1
I am almost sure the code is buid in debug mode because tehr is zero diffrentc between O0 and O2 options.

martinsm wrote:static libraries are made just by archiving all object files:

but that generates an .a file do I just rename it to .lib?
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Buiding a windows DLL using tdm-MinGW

Postby martinsm » Mon Aug 24, 2009 1:29 pm

Do you want to compile with GCC and from it make static .lib file that can be used with MSVC? That is impossible. Because GCC uses different format for object files than MSVC.
With GCC you can make static lib only that can be used with GCC.
martinsm
 
Posts: 86
Joined: Mon Dec 19, 2005 3:15 pm
Location: Latvia

Re: Buiding a windows DLL using tdm-MinGW

Postby Julio Jerez » Mon Aug 24, 2009 1:37 pm

martinsm wrote:Do you want to compile with GCC and from it make static .lib file that can be used with MSVC? That is impossible. Because GCC uses different format for object files than MSVC.
With GCC you can make static lib only that can be used with GCC.

That was my impression too, plus even if it works it is unlikely it will link with VS because of all of the external library dependecies of the run time.
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Buiding a windows DLL using tdm-MinGW

Postby agi_shi » Mon Aug 24, 2009 2:47 pm

martinsm wrote:Do you want to compile with GCC and from it make static .lib file that can be used with MSVC? That is impossible. Because GCC uses different format for object files than MSVC.
With GCC you can make static lib only that can be used with GCC.

That is incorrect, it should work just fine as long as the names are not mangled, which means using extern "C" (which is what the Newton interface does).
agi_shi
 
Posts: 263
Joined: Fri Aug 17, 2007 6:54 pm

Re: Buiding a windows DLL using tdm-MinGW

Postby martinsm » Mon Aug 24, 2009 2:59 pm

Ok, I stand corrected. I just tried, and it really works :)
I remember that I have tried it some very long time ago, and I could not get it work... maybe I was doing something wrong then.
martinsm
 
Posts: 86
Joined: Mon Dec 19, 2005 3:15 pm
Location: Latvia

Re: Buiding a windows DLL using tdm-MinGW

Postby thedmd » Mon Aug 24, 2009 3:01 pm

Julio Jerez wrote:how do I make the .lib, I have not found any information, on that?
The .a file can not be use like .lib files.


You cannot convert .a file to VS .lib file directly. Please use a lib tool in VS to do such thing:
Code: Select all
lib /DEF:newton.def /out:newton.lib /machine:x86

Above line will generate missing .lib file, execute it in same directory where newton.dll is. You can generate a .dll in any way you want (VS, GCC, Delphi, ASM and so on). There exists only one requirement, it must export a functions listed in .def file.
thedmd
 

Re: Buiding a windows DLL using tdm-MinGW

Postby Julio Jerez » Mon Aug 24, 2009 3:05 pm

thedmd wrote:You cannot convert .a file to VS .lib file directly. Please use a lib tool in VS to do such thing:
Code: Select all
lib /DEF:newton.def /out:newton.lib /machine:x86

Above line will generate missing .lib file, execute it in same directory where newton.dll is. You can generate a .dll in any way you want (VS, GCC, Delphi, ASM and so on). There exists only one requirement, it must export a functions listed in .def file.


Hajaa I think that is the solution. I will try tonigh and if I will add the DLL and the LIB to the SDK in a separate folder.
I am hopping the the ffloat-fastmath do sometjhong better tah what I am seeing.
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Buiding a windows DLL using tdm-MinGW

Postby Julio Jerez » Mon Aug 24, 2009 3:18 pm

In a side note, let us not loose track of what is happening, we did have a big performance boots in the windows build with 2.08
when I run the tower test in my machine at work, (a 3.2 gh dell quad core ceon) the test scene taked less than 6 milisicunds more
than twice as fast than I get at home in my quad core 2.4 HGz pention

This is still the faster version of Newton yet by a significan margin.
It is just that the Linux version seems to be even faster which is a nice thing since the Linux build has alwayd lagged behind the PC build but a bunch.
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Buiding a windows DLL using tdm-MinGW

Postby thedmd » Mon Aug 24, 2009 3:22 pm

Julio Jerez wrote:Hajaa I think that is the solution. I will try tonigh and if I will add the DLL and the LIB to the SDK in a separate folder.
I am hopping the the ffloat-fastmath do sometjhong better tah what I am seeing.


That's good news. I'm looking forward to test this special build of Newton. : )
thedmd
 

Re: Buiding a windows DLL using tdm-MinGW

Postby Julio Jerez » Mon Aug 24, 2009 9:12 pm

No the option -ffast-math did not do anything better, an dI din find GCC 4.3.1 in teh MingW folder.

Not The option are these
    gcc -c -Wall -Wno-strict-aliasing -D_MINGW_32_VER -m32 -O2 -ffast-math -mtune=pentium4 -march=pentium2 -msse -D_NEWTON_BUILD_DLL -Idg -Iphysics -o dg/dg.o dg/dg.cpp
    gcc -c -Wall -Wno-strict-aliasing -D_MINGW_32_VER -m32 -O2 -ffast-math -mtune=pentium4 -march=pentium2 -msse -D_NEWTON_BUILD_DLL -Idg -Iphysics -o dg/dgRef.o dg/dgRef.cpp
    ...

I am going to sleep on this, and focus on a feature I was planning before, Maybe later we find what it is, but for now It is better to spend time on thing that are more useful.
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Buiding a windows DLL using tdm-MinGW

Postby Marc » Mon Aug 24, 2009 9:24 pm

Just a note: I'm not entirely sure what the differences are, but unless newton is written completly in c only I guess you should use g++ instead of gcc. Afaik gcc is supposed to compile c code and g++ for c++ code. http://www.google.de/search?q=gcc+vs.+g%2B%2B&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:en-US:official&client=firefox-a
Millenium Project Enterprises - Hobbyist Gamedev Group http://www.mpe-online.org
Walkover is now on Steam => http://store.steampowered.com/app/348700/
User avatar
Marc
 
Posts: 281
Joined: Sun Mar 14, 2004 4:07 pm
Location: Germany

Re: Buiding a windows DLL using tdm-MinGW

Postby aqnuep » Fri Oct 02, 2009 7:43 am

Julio Jerez wrote:Why it is the GDB do not have a visual Interface?

GDB does have a visual interface btw.
Use the -w command line option to enable it.
Of course it's far from debuggers integrated in current IDEs, but it knows all the stuff you'll need.
aqnuep
 
Posts: 97
Joined: Sat Dec 22, 2007 4:14 pm

Previous

Return to General Discussion

Who is online

Users browsing this forum: No registered users and 0 guests

cron