Code::Blocks Forums

User forums => Using Code::Blocks => Topic started by: gib on September 08, 2010, 05:11:43 am

Title: Making compiler setting stick in Mac OS X
Post by: gib on September 08, 2010, 05:11:43 am
I have got CB working with gfortran on a Mac OS X machine.  In the usual way, I created a compiler entry for gfortran by copying the GCC C compiler then setting the installation directory (/usr/local/gfortran) and changing the executable names.  With this I was able to build a .dylib, and an executable that links to it.  I've encountered a small problem, which is that CB doesn't seem to remember some things between invocations.  For example, there are never any "Recent projects", and the settings for gfortran are lost, making it necessary to reenter the info each time.  It's as if some config file is not being written, or not found.
Title: Re: Making compiler setting stick in Mac OS X
Post by: stahta01 on September 09, 2010, 01:34:45 am
Just change the Compiler Settings and then exit out of Code::Blocks.
IIRC, The compiler settings are save on Code::Blocks exit.
If code::blocks crashes the settings are not saved most of the time.

afb is the main Mac Person on the board; I am a MS Windows user who knows some Linux.

Tim S.
Title: Re: Making compiler setting stick in Mac OS X
Post by: gib on September 09, 2010, 02:33:26 am
Yes, I change the settings and exit (without crashing), restart C::B and gfortran is gone from the compiler list.  I'm also using C::B with gfortran on W7 and Linux with no problems - there seems to be a Mac-specific issue.
Title: Re: Making compiler setting stick in Mac OS X
Post by: afb on September 09, 2010, 08:38:45 am
The settings should be saved to ~/Library/Application\ Support/CodeBlocks/default.conf

There should be a crash report or a warning dialog, if this config file cannot be saved on quit.
Title: Re: Making compiler setting stick in Mac OS X
Post by: gib on September 09, 2010, 10:56:28 am
The settings should be saved to ~/Library/Application\ Support/CodeBlocks/default.conf

There should be a crash report or a warning dialog, if this config file cannot be saved on quit.

Thanks.  I'll check this when I get back onto that machine again.
Title: Re: Making compiler setting stick in Mac OS X
Post by: gib on September 10, 2010, 02:12:18 am
The settings should be saved to ~/Library/Application\ Support/CodeBlocks/default.conf

There should be a crash report or a warning dialog, if this config file cannot be saved on quit.

I am now back on the Mac.  I see that when I open the save workspace (ABM.workspace) I have indeed managed to save the gfortran settings.  I don't know how or when I achieved this.  ...

I have now spent some time experimenting with changing compiler settings (e.g. editing the Toolchain executables), and trying to save the changes.  I think I now know how to get repeatable behaviour.

The first thing that seems unavoidable is that C::B always crashes on exit if a workspace or project has been opened ("CodeBlocks quit unexpectedly").  I've tried all combinations that I can see in terms of saving files, saving projects, saving everything, closing all files, before exiting, but these don't make any difference.  What does make a difference is Close project, or Close workspace.  Either of these causes an immediate crash.  As you point out, on a crash the default.conf file is not written.

The only way that I've found to get any changes written to default.conf is to start C::B, make changes to Settings, then quit without opening any project.  In this case the pop-up message "The perspective has changed.  Do you want to save it?" appears, and answering 'Yes' does update default.conf, since the program exits successfully.  This is a good thing to know.   :)

One consequence of the combined effect of these two behaviours is that there is never any history available - no Recent files or Recent projects (except for default.workspace).  This is just a minor inconvenience.

My only question at this point regards the crash reports.  Is there any point in sending this to someone who works on the Mac port, or would it just be repeating what's already known?

Cheers
Gib
Title: Re: Making compiler setting stick in Mac OS X
Post by: afb on September 12, 2010, 11:01:16 pm
The first thing that seems unavoidable is that C::B always crashes on exit if a workspace or project has been opened ("CodeBlocks quit unexpectedly").  I've tried all combinations that I can see in terms of saving files, saving projects, saving everything, closing all files, before exiting, but these don't make any difference.  What does make a difference is Close project, or Close workspace.  Either of these causes an immediate crash.  As you point out, on a crash the default.conf file is not written.

That is rather different from it not saving when exiting without crashing, though.

Quote
My only question at this point regards the crash reports.  Is there any point in sending this to someone who works on the Mac port, or would it just be repeating what's already known?

https://developer.berlios.de/bugs/?func=detailbug&bug_id=17203&group_id=5358

That "someone" would still need to make a debugging build of wxWidgets and Code::Blocks in order to reproduce and fix the issue, though. But reproducing is easy enough, multi-threaded debugging usually is not.

i.e. a gdb backtrace from a debug build is much more usable than a Crash Report
Title: Re: Making compiler setting stick in Mac OS X
Post by: gib on September 12, 2010, 11:48:26 pm
As far as I have seen the .conf file is always saved when a clean exit is made.

Regarding the debug build, I will try to look into it.