Author Topic: TDM's unofficial GCC 4.2.0 for MinGW (now with OpenMP, Fortran and Obj-C)  (Read 139949 times)

Offline Biplab

  • Developer
  • Lives here!
  • *****
  • Posts: 1874
    • Biplab's Blog
Re: Unofficial GCC 4.2.0 for MinGW available
« Reply #30 on: May 20, 2007, 12:31:58 pm »
Maybe a radio button would help here "Use actual wxW" and "Use different wxW".

That would be lot confusing to new users.

The way you've setup the Global variable basically restricts your choice. It's OK if you're happy with the configuration. The only missing is the include directory of setup.h which remains inside H:\wxWidgets-2.8.4\lib\gcc_lib\msw or H:\wxWidgets-2.8.4\lib\gcc_lib\mswd or similar directory depending upon your configuration.
Be a part of the solution, not a part of the problem.

Offline patlecat

  • Multiple posting newcomer
  • *
  • Posts: 62
Re: Unofficial GCC 4.2.0 for MinGW available
« Reply #31 on: May 20, 2007, 12:41:28 pm »
Setup.h is in include/wx/msw which I had defined already (s. above). I added the mswu and mswud directory to the linker path. But I still get the same errors.

Offline Biplab

  • Developer
  • Lives here!
  • *****
  • Posts: 1874
    • Biplab's Blog
Re: Unofficial GCC 4.2.0 for MinGW available
« Reply #32 on: May 20, 2007, 12:49:02 pm »
Setup.h is in include/wx/msw which I had defined already (s. above).

Every time you compile wx a new setup.h file is created which reflects the build configuration. That setup.h file is necessary for proper compilation. So you've to point towards the created setup.h file, not the default one.

I added the mswu and mswud directory to the linker path. But I still get the same errors.

The directories shall be added to Compiler, not to linker.

To avoid hijacking this thread, please start a new thread if you still face problem.
Be a part of the solution, not a part of the problem.

Offline TDragon

  • Lives here!
  • ****
  • Posts: 943
    • TDM-GCC
Re: Unofficial GCC 4.2.0 for MinGW available
« Reply #33 on: May 20, 2007, 08:32:55 pm »
@snija, an update on libgomp:
Configuring fails with the error "Pthreads are required to build libgomp". After poking around in the main GCC configure script, I see that compilation of libgomp is automatically disabled on non-POSIX systems for this reason. MinGW32 programs are expected to use Win32 threads directly, though I expect there are pthreads ports for MinGW available. Feel free to build libgomp yourself with one of these ports; or, if you find an easy method of having libgomp use Win32 threads, I'll try it.

Cheers,
John E. / TDM
https://jmeubank.github.io/tdm-gcc/ - TDM-GCC compiler suite for Windows (GCC 9.2.0 2020-03-08, 32/64-bit, no extra DLLs)

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7582
    • My Best Post
Re: Unofficial GCC 4.2.0 for MinGW available
« Reply #34 on: May 21, 2007, 05:44:38 am »
As usual, I have tested this build by compiling wxWidgets and Code::Blocks, and everything works great!

FYI: Your new 4.2.0 (3.4.5 works perfectly) has problems building wxWidgets 2.9.x CVS-Head; It has 4 or 5 minor compile errors that are easy to fix. If anybody wants the work-around patches to wxWidgets PM me; and I will upload them or post them. Note, the wx developers fixes this type issues in a completely different way. (The bugs are all related to the wxString redesign, I only know enough to patch them by adding casts to variables; they fix them by editing an function somewhere to do it all automatically.)

Please DO NOT bug the wx developers with this; wait till an official minGW 4.2.0 release is done.

Tim S
« Last Edit: May 21, 2007, 06:57:20 am by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline snija

  • Multiple posting newcomer
  • *
  • Posts: 20
Re: Unofficial GCC 4.2.0 for MinGW available
« Reply #35 on: May 21, 2007, 03:32:10 pm »
That`s not true, for people stick to science computation(like gfortran) and target to dual core and quad core cpu , it`s the most easiest way to utilize the resource you have.
Another important feature in the coming version is auto-vectorize .

Soultaker

  • Guest
Re: Unofficial GCC 4.2.0 for MinGW available
« Reply #36 on: May 29, 2007, 10:52:08 pm »
I tried to use this build, but unfortunately it's missing OpenMP support, which was the specific reason why I wanted to use GCC 4.2 under Windows. OpenMP is an important feature, in my opinion, especially since GCC I believe is the first free compiler to offer it on Windows. (Microsoft Visual C/C++ compiler has OpenMP support, but the free version does not include the necessary libraries.)

20-40 has posted a more complete build of GCC 4.2 here: GCC4.2; it has working OpenMP support (although I didn't test it extensively, the basics seem to work just fine). It's a lot older, but are there any other issues? Is there a reason to prefer your packages over this one, or vice versa?

Something else: I saw you needed a mirror, so I put the files on my S3 site:
Feel free to link to these on your website.

Soultaker

  • Guest
Re: Unofficial GCC 4.2.0 for MinGW available
« Reply #37 on: May 30, 2007, 12:47:36 am »
Ah, in retrospect, that seems to be the one that I actually ended up using, not the older release.

So I guess it's just as recent as TDragon's, but with OpenMP support. I'll stick with that one then. Thanks!

Offline Grom

  • Almost regular
  • **
  • Posts: 206
Re: Unofficial GCC 4.2.0 for MinGW available
« Reply #38 on: June 21, 2007, 11:47:03 pm »
Recently I tested OpenMP in "MinGW" gcc 4.2.0. On dual core Xeone under WinXP I've got slower code, compare to non parallel version :shock:. With 2005 studio I've got 30% faster code. Probably threading was not don in efficient way...
gcc+winXP+suse.

Offline Grom

  • Almost regular
  • **
  • Posts: 206
Re: Unofficial GCC 4.2.0 for MinGW available
« Reply #39 on: June 27, 2007, 09:30:38 pm »
I've combined gcc 4.2.0 from two distributions. One of them had one piece of omp another one had second piece. After that I parallelized the main loop in my program. VC++ gave 30% on two CPUs, gcc nothing with full load of both CPUs. Seems to be the problem is the speed of switching between one CPU usage and 2 CPUs usage. Looks like behind omp was implemented a thread model with new delete for every one parallel subblock.
gcc+winXP+suse.

Offline patlecat

  • Multiple posting newcomer
  • *
  • Posts: 62
Re: Unofficial GCC 4.2.0 for MinGW available
« Reply #40 on: June 28, 2007, 04:55:13 pm »
@TDragon: I installed ur newest update on GCC4.2 (V2.7), I copied it over my working version (V1.7) but when I tried to compile anything from out of DialogBlocks, it gave me several errors. "File not found" etc. on the String.h file in wxWidgets (V2.8.4).

Reverting back to V1.7 helped and things went smooth again.


What might be the matter? And what exactly did u change, what are the effects of it? :?:

Offline TDragon

  • Lives here!
  • ****
  • Posts: 943
    • TDM-GCC
Re: Unofficial GCC 4.2.0 for MinGW available
« Reply #41 on: June 28, 2007, 05:16:47 pm »
And what exactly did u change, what are the effects of it? :?:
Apparently more that I changed had noticeable effects than I expected. :P

I'll do some comparisons, but in the meantime it would help if you could provide an example of something that doesn't work, along with the specific error messages produced.

Edit:
I haven't turned up anything that would seem to cause an error like that, so I eagerly await further details.
« Last Edit: June 28, 2007, 05:35:35 pm by TDragon »
https://jmeubank.github.io/tdm-gcc/ - TDM-GCC compiler suite for Windows (GCC 9.2.0 2020-03-08, 32/64-bit, no extra DLLs)

Offline dwmcqueen

  • Multiple posting newcomer
  • *
  • Posts: 56
Re: Unofficial GCC 4.2.0 for MinGW available
« Reply #42 on: June 28, 2007, 06:49:17 pm »
Just to clarify - if I am looking for the most stable version of GCC 4.2 - which one should I grab at this point?

Offline patlecat

  • Multiple posting newcomer
  • *
  • Posts: 62
Re: Unofficial GCC 4.2.0 for MinGW available
« Reply #43 on: June 28, 2007, 06:56:54 pm »
ok I reinstalled the not-working version for you. And this is the output from DialogBlock:

Code
----------------------- Configuration: MinGW Release -----------------------
In directory: H:\myProjects2\MarkThyBooks
mingw32-make.exe -f makefile.gcc CONFIG=release clean all
if exist MinGWRelease\*.o del MinGWRelease\*.o
if exist MinGWRelease\*.res del MinGWRelease\*.res
if exist MinGWRelease\MarkThyBooks.exe del MinGWRelease\MarkThyBooks.exe
g++.exe -c -o MinGWRelease/markthybooksapp.o -fno-rtti -fno-pcc-struct-return -fstrict-aliasing -Wall -D__WXMSW__ -D__GNUWIN32__ -D__WIN95__ -DUNICODE   -O -Wall -I"H:/wxWidgets-2.8.4/include" -I"H:/wxWidgets-2.8.4/contrib/include" -I"H:/wxWidgets-2.8.4/lib/gcc_lib/mswu" markthybooksapp.cpp
*** In file included from H:/wxWidgets-2.8.4/include/wx/memory.h:16,
***                  from H:/wxWidgets-2.8.4/include/wx/object.h:20,
***                  from H:/wxWidgets-2.8.4/include/wx/wx.h:16,
***                  from markthybooksapp.cpp:24:
*** H:/wxWidgets-2.8.4/include/wx/string.h:176:18: error: string: No such file or directory
*** In file included from H:/wxWidgets-2.8.4/include/wx/memory.h:16,
***                  from H:/wxWidgets-2.8.4/include/wx/object.h:20,
***                  from H:/wxWidgets-2.8.4/include/wx/wx.h:16,
***                  from markthybooksapp.cpp:24:
*** H:/wxWidgets-2.8.4/include/wx/string.h:181: error: 'wstring' in namespace 'std' does not name a type
*** H:/wxWidgets-2.8.4/include/wx/string.h:714: error: expected ',' or '...' before '&' token
*** H:/wxWidgets-2.8.4/include/wx/string.h:714: error: ISO C++ forbids declaration of 'wxStdString' with no type
*** H:/wxWidgets-2.8.4/include/wx/string.h:714: error: 'wxString::wxString(int)' cannot be overloaded
*** H:/wxWidgets-2.8.4/include/wx/string.h:682: error: with 'wxString::wxString(int)'
*** H:/wxWidgets-2.8.4/include/wx/string.h: In constructor 'wxString::wxString(int)':
*** H:/wxWidgets-2.8.4/include/wx/string.h:715: error: 's' was not declared in this scope
*** In file included from H:/wxWidgets-2.8.4/include/wx/wx.h:21,
***                  from markthybooksapp.cpp:24:
*** H:/wxWidgets-2.8.4/include/wx/hashmap.h: In member function 'wxLongToLongHashMap_wxImplementation_HashTable::Node** wxLongToLongHashMap_wxImplementation_HashTable::GetNodePtr(const long int&) const':
*** H:/wxWidgets-2.8.4/include/wx/hashmap.h:714: warning: dereferencing type-punned pointer will break strict-aliasing rules
*** In file included from H:/wxWidgets-2.8.4/include/wx/event.h:18,
***                  from H:/wxWidgets-2.8.4/include/wx/wx.h:25,
***                  from markthybooksapp.cpp:24:
*** H:/wxWidgets-2.8.4/include/wx/clntdata.h: In member function 'wxShadowObjectMethods_wxImplementation_HashTable::Node** wxShadowObjectMethods_wxImplementation_HashTable::GetNodePtr(const wxString&) const':
*** H:/wxWidgets-2.8.4/include/wx/clntdata.h:20: warning: dereferencing type-punned pointer will break strict-aliasing rules
*** H:/wxWidgets-2.8.4/include/wx/clntdata.h: In member function 'wxShadowObjectFields_wxImplementation_HashTable::Node** wxShadowObjectFields_wxImplementation_HashTable::GetNodePtr(const wxString&) const':
*** H:/wxWidgets-2.8.4/include/wx/clntdata.h:25: warning: dereferencing type-punned pointer will break strict-aliasing rules
*** In file included from H:/wxWidgets-2.8.4/include/wx/event.h:21,
***                  from H:/wxWidgets-2.8.4/include/wx/wx.h:25,
***                  from markthybooksapp.cpp:24:
*** H:/wxWidgets-2.8.4/include/wx/gdicmn.h: In member function 'wxStringToColourHashMap_wxImplementation_HashTable::Node** wxStringToColourHashMap_wxImplementation_HashTable::GetNodePtr(const wxString&) const':
*** H:/wxWidgets-2.8.4/include/wx/gdicmn.h:544: warning: dereferencing type-punned pointer will break strict-aliasing rules
*** In file included from H:/wxWidgets-2.8.4/include/wx/wx.h:45,
***                  from markthybooksapp.cpp:24:
*** H:/wxWidgets-2.8.4/include/wx/image.h: In member function 'wxImageHistogramBase_wxImplementation_HashTable::Node** wxImageHistogramBase_wxImplementation_HashTable::GetNodePtr(const long unsigned int&) const':
*** H:/wxWidgets-2.8.4/include/wx/image.h:136: warning: dereferencing type-punned pointer will break strict-aliasing rules
*** mingw32-make.exe: *** [MinGWRelease/markthybooksapp.o] Error 1
Done.

8 errors, 5 warnings

Offline TDragon

  • Lives here!
  • ****
  • Posts: 943
    • TDM-GCC
Re: Unofficial GCC 4.2.0 for MinGW available
« Reply #44 on: June 28, 2007, 07:50:36 pm »
dwmcqueen:
As far as I'm concerned, the most recent version I posted (gcc-4.2.0-tdm-2.7z) is as stable as the first. I applied no additional patches to the GCC source (or performed any other chages); the only difference between the first release and the second was some different command-line parameters during the build, to create (hopefully) faster compiler executables. So I would say you should use the second release (gcc-4.2.0-tdm-2.7z). Additionally...

patlecat:
I'm unable to reproduce the problem, and have never encountered a similar one. I recommend you check your Windows environment variables to make sure that no strange GCC-related ones are messing things up -- all you should have is "H:\MinGW\bin" (or wherever you chose to put it) in your PATH variable -- and completely clean out your MinGW directory, reinstalling from scratch. As always, install my GCC 4.2.0 package last and overwrite any duplicated files.

In case you're interested, here is the source I used to try to duplicate it:
Code
#include <wx/wx.h>

int main()
{
return 0;
}
... and here is the command line:
Code
g++.exe -c -o test.o -fno-rtti -fno-pcc-struct-return -fstrict-aliasing -Wall -D__WXMSW__ -D__GNUWIN32__ -D__WIN95__ -DUNICODE -O -Wall -I"G:\Libraries\wxMSW-2.8.4\include" -I"G:\Libraries\wxMSW-2.8.4\lib\gcc_dll\mswu" test.cpp

Cheers,
John E. / TDM
https://jmeubank.github.io/tdm-gcc/ - TDM-GCC compiler suite for Windows (GCC 9.2.0 2020-03-08, 32/64-bit, no extra DLLs)