Page 1 of 2

Codelite 5.4 and MinGW4.8

Posted: Tue Jan 14, 2014 4:30 pm
by ColinTaylor
Windows 8
Previous installation : Codelite 5.3 + MinGW 4.7 + wxWidgets3.0
Tested installation : Codelite 5.4 + MinGW 4.8 + wxWidgets3.0, installed from "codelite-5.4-mingw4.8.1.exe"

This may be of interest if you write any performance intensive apps. After several rounds of tests I'm convinced this is actually a MinGW 4.8 issue and not a Codelite issue.

Having rebuilt my main workspace after upgrading to Codelite 5.4 + MinGW 4.8, I've done some performance tests of a few of my apps (i.e. not Codelite ;)) and found that the apps are consistently and repeatedly showing 15% to 25% performance degredation. No source code changes, and no complier or linker options changes were made.

I've since repeated all tests using a hybrid (Codelite 5.4 with MinGw 4.7) and the keys apps now perform as they previously did.

My question is : are there any likely problems anyone can see using Codelite 5.4 with MinGw 4.7.1?

Thanks, Colin

Re: Codelite 5.4 and MinGW4.8

Posted: Tue Jan 14, 2014 4:39 pm
by eranif
ColinTaylor wrote:My question is : are there any likely problems anyone can see using Codelite 5.4 with MinGw 4.7.1?
You can use it with any version of MinGW you want - there should be 0 problems (assuming your code can compile)
The main difference is that MinGW4.8.1 is more C++11 aware while 4.7.1 is partially supporting it

Eran

Re: Codelite 5.4 and MinGW4.8

Posted: Tue Jan 14, 2014 4:45 pm
by ColinTaylor
Thanks, Eran

Re: Codelite 5.4 and MinGW4.8

Posted: Wed Jan 15, 2014 12:29 pm
by ColinTaylor
Is it possible to define my setup so that some projects use MinGW4.7 and others use 4.8?

Looking at http://codelite.org/forum/viewtopic.php ... ngw#p10905, it appears this should be possible, but I can't quite work out what the steps are to setup a project to use a specific version of MinGW.

Any help appreciated :-)

Re: Codelite 5.4 and MinGW4.8

Posted: Wed Jan 15, 2014 12:57 pm
by eranif
Have you tried setting an environment variable per project which alters the PATH per project? (it is applied before the build starts and removed once the 'make' process is launched)

Project Settings->Common Settings -> Environment

Code: Select all

PATH=\Path\To\MinGW-4.x\bin;$PATH
This should get applied before the build start

Eran

Re: Codelite 5.4 and MinGW4.8

Posted: Wed Jan 15, 2014 1:05 pm
by ColinTaylor
Thanks for the prompt response - I'll try it. :)

Re: Codelite 5.4 and MinGW4.8

Posted: Wed Jan 15, 2014 4:54 pm
by ColinTaylor
No luck so far on this, almost certainly down to the way I'm trying to set things up...

What I want is to define a _default_ config (Codelite 5.4 + MinGW4.8.1) that will apply to all projects _except_ on a small number of projects where I want to use Codelite 5.4 + MinGW4.7.1

There are about 100 projects where the default settings will be fine and about 6 projects where I need the better performance given by MinGW 4.7.1

I set the _default_ config (Codelite 5.4 + MinGW4.8.1) in "Codelite -> Settings -> Environment variables" (added PATH=\Path\To\MinGW-4.8.1\bin;$PATH)

I set the "per project" exceptions by adding (as per Eran's suggestion) to "Project -> Settings -> Common Settings -> Environment" (added PATH=\Path\To\MinGW-4.7.1\bin;$PATH).

Having tried the above, all projects are still getting built using 4.8.1.

My guess is that my way of trying to achieve what I want has resulted in $PATH containing both "\Path\To\MinGW-4.8.1\bin" and "\Path\To\MinGW-4.7.1\bin"

I'm stuck and not sure what to try next :(

Re: Codelite 5.4 and MinGW4.8

Posted: Wed Jan 15, 2014 5:19 pm
by eranif
ColinTaylor wrote:My guess is that my way of trying to achieve what I want has resulted in $PATH containing both "\Path\To\MinGW-4.8.1\bin" and "\Path\To\MinGW-4.7.1\bin"
You could add a simple "Pre Build" event that executes:

Code: Select all

which g++
and see the output (which is installed by codelite)

You can also define a new compiler and use that instead
The problem is that you will probably want to copy the settings of the current "gnu gcc" and there is no way to achieve this... (you can copy the XML manually - build_settings.xml)
In the newly defined compiler, replace the tools with full path (g++ --> /path/to/mingw481/bin/g++.exe) OR use the PATH environment variable field

Eran

Re: Codelite 5.4 and MinGW4.8

Posted: Wed Jan 15, 2014 6:03 pm
by ColinTaylor
Thanks for continuing to make suggestions, and the

Code: Select all

which g++
command is very useful to know.

One thing I've noticed which I couldn't explain ...

If I add "PATH=E:\Dev\MinGW-4.7.1\bin;$PATH" to Project -> Settings -> Common Settings -> Environment", then the correct MinGW (4.7.1) is used;

OTOH if I add "PATH=$MINGW.4.7.1;$PATH" to Project -> Settings -> Common Settings -> Environment" (where "$MINGW.4.7.1" is a env variable set outside Codelite), then the incorrect MinGW (4.8.1) is used.

It sounds like defining a new compiler is the way to proceed. I've a couple of immediate questions. Codelite defines a couple of compilers gnu g++ and gnu gcc, and I've no idea what the difference between them is. Your suggestion is to copy the settings from "gnu gcc" but as all my projects use "gnu g++" I'd be tempted to copy the gnu g++ settings, would that be correct?

Thanks again,
Colin

Re: Codelite 5.4 and MinGW4.8

Posted: Wed Jan 15, 2014 6:12 pm
by eranif
The difference is minor... I suggest that you use the g++ one

BTW: Are you using trunk version? or can you compile a new version of codelite?
I am currently improving the "New" compiler button to also allow copying settings from an existing compiler

Eran