Adventures of installing gcc on OSX mountain lion using xcode

Got a bit lost trying to install gcc on a new mac today. Xcode had already been installed using the mac download center or possibly the apple developer website. Somehow this had resulted in the installation of version from 2008. The suggestions at Stackoverflow/ How to use/install gcc on Mac OS X 10.8 / Xcode 4.4 were very useful except it took a while to work out we had an older version of xcode (we had version 3.1.2 – I thought older versions had gcc bundled?). I think this mistake is pretty easy to make because it is so odd that we managed to get the older xcode using the updates from apples website or the download center.

I think this might result from searching for gcc rather than searching for xcode. The string gcc is no longer in the blurb describing the xcode package, but it used to be in 2008.

Older version of xcode without option to install gcc

I believe this is the method recomended by apple to get gcc on your mac. To download xcode you have to register using an email address, either on the software center / itunes or on the developer website (probably just as easy to use). I think it is possible to get gcc without xcode, but I don’t know if tools like fink, portmap and homebrew allow/expect this or not.

Macports package managament for mac

Mac OSX users might be interested to try macports or fink as method for installing open source software.

Fink

Fink is based on the debian package management system (dpkg) for source packages and pre-compiled binaries and there is a gui available fink-commander. The main fink website is unavailable at the moment but there are mirrors available for installation of packages.

If you upgrade your mac system it is recommended to produce a list of the packages you have installed using fink, remove fink and then install the appropriate version for your new release of OSX.

Macports

Macports provides a system for compiling, installing, and managing open source software, allowing you to compile binaries for distribution on to multiple machines (distribution of binaries is possible but I don’t know if Macports.org do this).

Migration requires installation of the new version of xcode and macports as explained on the link.

configure unknown/unrecognised external monitor

How to configure settings for unknown monitor?
When I have unknown monitor connected, how can I increase resolution to match device connected?

When monitor correctly communicates with the graphics card and system the modes supported will correctly appear and monitor will correctly be configured. In current linux distros hardware settings for x-server are by default done without use of configuration file. After attaching a new monitor we can configure it automatically just by switching to terminal and back to graphics terminal to softly restart the xserver e.g. (Ctrl-Alt-F1), (Ctrl-Alt-F8). A better way it probably to use the monitor preferences command in the start menu (Found in gnome start menu under System>Preferences>Monitors). However if supported modes are not found then there is a useful command line tool we can use to add the supported mode to xserver.

In my case after attaching “gateway” monitor to my lenovo t410 laptop by VGA shaped port only the following resolutions were available. If software configuration is not possible then a hardware solution is to select 1:1 video scaling in menu of the monitor to prevent smearing of pixels.

Available resolutions for unknown monitor:
1024×768
800×600
848×480
640×480

I found following example::

$ xrandr
Screen 0: minimum 320 x 200, current 1368 x 768, maximum 8192 x 8192
VGA1 connected 1368×768+0+0 (normal left inverted right x axis y axis) 0mm x 0mm
1368x768_60.00 59.9*+
1024×768 60.0
1024x768_60.00 59.9
800×600 60.3 56.2
848×480 60.0
640×480 59.9
1280x800_60.00 59.8

$ cvt 1440 900
$ xrandr –newmode “1440x900_60.00″ 106.50 1440 1528 1672 1904 900 903 909 934 -hsync +vsync
$ xrandr –addmode VGA1 1440x900_60.00

I issued following commands to add support of my monitor::

We want to add a mode to support the resolution of external monitor which in this case is 1680×1050. If we issue “cvt” command we will be informed of the correct “modeline” options we need to issue with “xrandr”.

>cvt 1680 1050

# 1680×1050 59.95 Hz (CVT 1.76MA) hsync: 65.29 kHz; pclk: 146.25 MHz
Modeline “1680x1050_60.00″ 146.25 1680 1784 1960 2240 1050 1053 1059 1089 -hsync +vsync
xrandr –newmode “1680x1050_60.00″ 146.25 1680 1784 1960 2240 1050 1053 1059 1089 -hsync +vsync
xrandr –addmode VGA-1 1680x1050_60.00

After issuing the final command we can select the mode of the monitor (and select relative position etc, etc) using the “monitor preferences” tool. Found in gnome start menu under System>Preferences>Monitors. This tool can be added to the start panel if desired.

Monitor preferences tool, gnome menu

Position of gnome monitor preferences tool, gnome menu, gnome desktop.

Monitor preferences tool

Monitor preferences tool

Monitor icon/applet

Monitor icon/applet

alternative tools exist, e.g. grandr is another graphical tool to see monitor settings.

grandr

grandr

Lenovo T410 Fan Error

http://bootmylaptop.com/ibm-lenovo-fan-error/

http://apttech.wordpress.com/2011/02/05/lenovo-t410-fan-error/

My 1 year old Lenovo T410 started to get an Fan error during booting. I wonder if this is caused by me recently using the laptop positioned in a holder at an angle, or possibly due to the computer failing to suspend because of firefox/flash using 100% or processor over night.

I was a bit upset about this error because I recently got around to setting up my linux debian squeeze system to the point were wireless networking works perfectly, and fixing a problem with screen brightness.

Some advice suggested trying to remove dust, pressing laptop in certain location, or replacing the fan.

Error occurs only on a fresh boot, seems worse if laptop has been in transit, or has been switched off for some time. Some of comments on the Lenovo discussion board reported a lot of failures on Monday in office situation, after users have taken laptops home during weekend.

T410 Fan Failures discussion.

After reading 9 pages of discussion, there is some advice to update the bios, the download is available from Lenovo support, Download. I applied this update from Windows 7, after fully charging the battery and with power connected and with no other programs running.

I haven’t received the error again after the BIOS update, but only had a few boots. Had the fan error warning last week once, and repeatedly yesterday (fortunately laptop eventually booted normally). Fan seems to sound same as usual and is pushing heat out from laptop, so I hope there is no hardware problem.

Laptop repair

Laptop repair

Latex Beamer

http://www.math-linux.com has provided a blog posting telling us
How to make a presentation with Latex – Introduction to Beamer. Which is useful if you want to do that.

Now I know how to use columns, Woohoo!

Follow

Get every new post delivered to your Inbox.