Author Topic: Making compiler setting stick in Mac OS X  (Read 9396 times)

Offline gib

  • Multiple posting newcomer
  • *
  • Posts: 42
Making compiler setting stick in Mac OS X
« 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.

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7582
    • My Best Post
Re: Making compiler setting stick in Mac OS X
« Reply #1 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.
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 gib

  • Multiple posting newcomer
  • *
  • Posts: 42
Re: Making compiler setting stick in Mac OS X
« Reply #2 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.

Offline afb

  • Developer
  • Lives here!
  • *****
  • Posts: 884
Re: Making compiler setting stick in Mac OS X
« Reply #3 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.

Offline gib

  • Multiple posting newcomer
  • *
  • Posts: 42
Re: Making compiler setting stick in Mac OS X
« Reply #4 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.

Offline gib

  • Multiple posting newcomer
  • *
  • Posts: 42
Re: Making compiler setting stick in Mac OS X
« Reply #5 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

Offline afb

  • Developer
  • Lives here!
  • *****
  • Posts: 884
Re: Making compiler setting stick in Mac OS X
« Reply #6 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

Offline gib

  • Multiple posting newcomer
  • *
  • Posts: 42
Re: Making compiler setting stick in Mac OS X
« Reply #7 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.