Driving the PSP display with a FPGA

A2DGL() - A 2D Graphics Library: is a hardware accelerated graphics library for FPGAs and Microcontrollers. Mission Statement: produce a Borland(TM) BGI type graphics library with modern computer graphics constructs. Project Page:

The Missing Lecture Notes

The Missing Lecture Notes (MLN) series begins with Ben Popoola's popular series on hardware design. This series includes developing driver boards for the LQ043T3DX02 (Sony PSP) display, the OT-CO430-2P display and the development of a skeleton device drivers.

The Scientific Engineer

FPGA Design Tutorials. The first set of tutorials begin by developing a serial communications protocol between the DE0 Nano and a PC, using a USB to serial converter.

You are here: HomeBenMac OS X Dev (1) - Installing Xcode, MacPorts and XQuartz on Mavericks 10.9.5, An OpenGL Example

Latest Blog Posts

News
5 post(s)
In the News #5 - The Arduino TRE

Hot on the heels of the Raspberry Pi 2 Model B+ with its quad core processor, Arduino are set to release the Arduino TRE consisting of an AVR arduino and a 1-GHz Sitara AM335x processor, which allows makers to get up to 100 times more performance than the Arduino Leonardo or Uno. The TRE is set to host a Linux operating system that will allow users to run processing-intensive algorithm and high-speed communications, alongside the Arduino's traditional applications. Sounds similar to Intel's Galileo doesn't it? Also, this will be the first Arduino manufactured in the U.S and not in Italy or China.

Continue Reading...
In the News #4 - The ARM, IBM Internet of Things Starter Kit

ARM and IBM have teamed up to produce an Internet of Things (IoT) starter kit, consisting of an ARM mbed enabled development board and an application board containing sensors. The kit has been designed to "spur on the invention" of Internet-connected gadgets in about five minutes, that is, from the time the kit is unboxed. It works by allowing the devices, hosting an ARM Cortex-M4 processor, to connect to IBM's cloud services and start sending readings to online apps.

Continue Reading...
In The News #3 - FTDI's SuperSpeed USB3.0 Devices

FTDI are set to release a series of USB3.0 devices to complement their renowned USB endpoint-to-FIFO bridge USB 2.0 (FT232H) and USB 1.1 (FT245) ones, which have been available for a few years.  Available with optional 16-bit and 32-bit FIFO interfaces, the FT600 will be the first device released in the series. This is splendid news and music to the ears of the FPGA community, as the device could be used to  provide FPGA enhanced applications with simplified connectivity to host computers, with data transfer rates of up to 5 Gpbs.

Continue Reading...
In The News #2 - The Raspberry Pi 2 Model B+

Without much fanfare the new Raspberry Pi 2 (B Model) has arrived on our doorsteps, well ours  did! This is the first major upgrade the world's most popular single-board computer has received, since its first release in 2012. This is a much needed upgrade that allows the Pi to compete against its faster contemporaries, including the Beagle Bone and the Banana Pi.

Continue Reading...
In The News #1 - Free Non-Commercial Renderman

For years 3D animation hobbyists interested in Renderman, but not wanting to fork out the ££££ required for a  license, have had to rely on third-party REYES compliant renderers like, Aqsis (a favourite of ours), Pixie, Gelato, Angel and others.

Previously, we had used Aqsis, however in 2015, Pixar the owners of Renderman are due to release a free. non-commercial, version of their famous software.

Continue Reading...

Ben's Blog

No description yet.

  • Home
    Home This is where you can find all the blog posts throughout the site.
  • Categories
    Categories Displays a list of categories from this blog.
  • Tags
    Tags Displays a list of tags that have been used in the blog.
  • Archives
    Archives Contains a list of blog posts that were created previously.
  • Login
    Login Login form

Mac OS X Dev (1) - Installing Xcode, MacPorts and XQuartz on Mavericks 10.9.5, An OpenGL Example

Posted by on in Development, Software and Tools
  • Font size: Larger Smaller
  • 0 Comments

 As the title of this blog suggests this post is about installing and building an application using XCode on a Mac OS X system in general and on a Mac OS X with Mavericks 10.9.5 installed in particular. The purpose of the installation is to use it to program an OpenGL example from the legendary OpenGL red book.

However, while installing Xcode is straightforward understanding the mechanisms required to run an OpenGL example are not. For example, should one install MacPorts, XQuartz, both or neither to run X11 applications? Should Glut or FreeGlut be installed? The decisions I made to compile and run a basic OpenGL tutorial are the subject of this blog post.

Installing Xcode 6.0.1

First released in 2003, Xcode is an Integrated Development Environment (IDE) containing a suite of software development tools, developed by Apple, for developing software for OS X and iOS devices.

To install the environment on a Macbook Air running on Mavericks 10.9.5 I did the following:

 002-002-001-000001.png

 Firstly, I went to the App Store and located and download the Xcode application. It's free, which sounded suspicious. Is this apple doing their part for the community or a cunning ploy? Anyway, it installed okay and to prove it I typed gcc -v in a Terminal window to determine the version of GCC Xcode installed. The result can be seen in the Bash shell output below. 

 gcc -v 
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/include/c++/4.2.1 
Apple LLVM version 6.0 (clang-600.0.51) (based on LLVM 3.5svn) 
Target: x86_64-apple-darwin13.4.0 
Thread model: posix 

 Xcode version 6.0.1 installed GCC 4.2.1. Once installed I doubled clicked on the newly available Xcode icon, which rewarded me with the welcoming Xcode splash screen seen, in the image, below. This was a promising start and I suppose they, being Apple, can afford to develop free software if the main focus of their business is in selling hardware. I was now less suspicious, although years of avoiding using Microsoft Windows products warned me to not let my guard down. All in all a promising start.

002-002-001-000004.png

So having installed the first building block in my Macbook Air development environment the next step in the process  was to decide whether to install MacPorts or XQuartz. However, before I could do that I needed to know the difference between the two!

MacPorts or XQuartz

So what is MacPorts? Well, according to the MacPorts website (www.macports.org) "The MacPorts Project is an open-source community initiative to design an easy-to-use system for compiling, installing, and upgrading either command-line, X11 or Aqua based open-source software on the OSX operating system".

The XQuartz project (www.macosforge.org) on the other hand also has blurb on their website stating the following "... is an open-source effort to develop a version of the X.Org X Window System that runs on OS X. Together with supporting libraries and applications, it forms the X11.app that Apple has shipped with OS X since version 10.5".

So after visiting both websites I still didn't have a clue, which one should I install. Although I did get an inkling from the Apple development forums that actually I could install both. However, my gut feeling was to install MacPorts and after reading the corresponding Wikipedia page my mind was almost made up. 

According to Wikipedia (http://en.wikipedia.org/wiki/MacPorts) "MacPorts, formerly called DarwinPorts, is a package management system that simplifies the installation of software on the Mac OS X and Darwin operating systems. It is a free/open source software project to simplify installation of other free/open source software. ... It allows the installation of a number of packages by entering the command

sudo port install packagename

in a Terminal window, which will then download, ...,compile and install the requested software, while also installing any required dependencies automatically. Installed packages can be updated with the command

sudo port upgrade installed

b2ap3_thumbnail_002-002-001-000005.pngSo it looks like I needed both! Still unsure and just to throw a cat amongst the pigeons, using LaunchPad I navigated to the X11 icon and clicked on it. The result was the dialog shown in the image on the left. 

So it seems that X11 is no longer included in Mavericks 10.9.5 and you need to install an open source community version. So I clicked on the Continue button, which took me to the webpage shown in the screenshot below. According to this page, on the apple developers forum, one needs to install XQuartz to provide OS X Mavericks with X11 server and client libraries.

002-002-001-000006.png

So now secure with the knowledge that I understood the relationship between Mac OS X Mavericks 10.9.5, MacPorts and XQuartz I downloaded and installed both. To install MacPorts, which I decided to do first, navigate to the MacPorts website and install the version that matches your operating system, which in my case is OS X 10.9 Mavericks.

Not feeling daunted by the different installation options available I opted for the easiest and doubled clicked on the pre-packaged one, which was promptly downloaded to my Macbook. This should be done after the Xcode and the Xcode command line tools have been installed.

002-002-001-000007.png

Once downloaded and after clicking on the downloaded installer a series of dialogs walk you through the installation process. The first dialog to appear can be seen, in the screenshot, above.  After clicking on the continue button the usual options are available that allow one to choose an installation location, as well as providing an option to accept a license agreement. Once all this had been done I had MacPorts-2.3.1-10.9-Mavericks.pkg downloaded and installed on 14.6MB of my disk space. This was confirmed by the final dialog that appeared, seen below.

002-002-001-000008.png In a terminal window I confirmed that the version of MacPorts installed is 2.3.1 by typing port version in a terminal window.

 port version
Version: 2.3.1

Now for the installation of XQuartz. To do this I simply navigated to the XQuartz website and doubled clicked on the XQuartz-2.7.7.dmg, as shown in the image below. 

a1sx2_Original1_Screen-Shot-2014-10-05-at-13.28.48.png

This downloaded the .dmg package and hence the XQuartz installer onto my PC. Again, clicking on the Continue button, seen in the Figure below, led me through a series of dialogs of important information, Software License Agreement and a dialog informing me that 166.5MB of disk space would be required to install the application. I agreed to everything, as there was no point in questioning things at this stage.

002-002-001-000010.png

Once XQuartz had been installed I was rewarded with the same "This installation has been successful" dialog seen previously. Now I could get down to the business end of things and finally program an OpenGL example. 

OpenGL and FreeGlut

To do this I had to scrape myself out of my chair to get to my bookshelf where I found a copy of the OpenGL Programming Guide, Third Edition, Version 1.2, that dates back to 1999. Although a bit long in the tooth it was good enough for this elementary exercise. However, it was a telltale sign that it has been quite a while, since I had programmed in OpenGL in anger. For most of the last couple of years I have been programming in Hardware Description Languages (HDLs), but returning to software was most welcome. 

However, on opening the book I soon realised that I would need to study close to a hundred pages to get back up to scratch. Instead I decided to follow a tutorial on the web. However, to do so I needed to install FreeGlut and so I did.

"FreeGLUT is a completely OpenSourced alternative to the OpenGL Utility Toolkit (GLUT) library. GLUT was originally written by Mark Kilgard to support the sample programs in the second edition OpenGL 'RedBook'. Since then, GLUT has been used in a wide variety of practical applications because it is simple, widely available and highly portable". - The FreeGlut Project (free glut.sourceforge.net)

Initially, to install FreeGlut I went to the FreeGlut Project website and downloaded the latest stable version. Then a thought came to me, which suggested that it would be a good idea to see Xcode in action. So instead I had to log out of my account and log back in again to enable XQuartz's X11 server, as the default one.

Once I had logged back in to my account I clicked on the XQuartz icon that now appeared in the Launchpad's view. I think this enables the server, but I'm not too sure. Next, in a terminal window, I typed sudo port install freeglut as suggested above, which gladly worked, as can be seen in the Figure below.

a1sx2_Original1_002-002-001-000011.png

Good, I now had the recipe to create, not the perfect storm, but an OpenGL example. So I launched Xcode. In the Welcome to Xcode splash screen,  described previously, I clicked on Create a New Xcode Project

002-002-001-000012.png

The dialog that results allows one to choose the project's application and application type. For this example I choose to create an application for OS X to be run from the command line tool. I did this because the example I found on the Internet from Lazyfoo's website (www.lazyfoo.net) suggested that I  should.

002-002-001-000013.png

The next dialog was annoying, because all the options had to be filled in before one can advance. So I randomly filled it in and moved on. The dialogue after that was quite interesting, as one has the option of automatically creating a Git repository for the project, but before I could take a screenshot it disappeared when I tried changing the project's directory. Never mind, I will need to investigate Git's integration into Xcode on another day. The main Xcode application window was now visible, as seen below.

002-001-000014.png

I deleted the main.c file, as suggested by Lazyfoo's tutorial and replaced it with the files from his example, as shown by item (1) in the Figure above. In order for this application to compile and link successfully the location of the include and library directories need to be provided in the Build Settings tab, on the right-hand side of the Xcode application window above.

In the search paths section, item (2) in the Figure above, add the following, such that the XQuartz headers and libraries can be found in /opt/X11/ and FreeGlut headers and libraries can be found in /usr/local/ as one can partly see above.

Header  Path Section: /opt/X11/include; /usr/local/include

Library Search Paths: /opt/X11/lib; /usr/local/lib

 002-002-001-000015.png

Finally,  for the OpenGL libraries to be recognised open the Build Phases Tab, Item (1), in the Figure above, and in the Link Binary with Libraries Section, item (2), add the OpenGL framework, as seen in the dialogue of item (3). When I first ran this example it failed to compile, because I forgot to add the -lGLUT libraries to the the Other Linker Flags section. Also, it looks like things have changed since Lazyfoo's implementation as the directory /usr/local/lib does not exist and can be removed from the instructions above. The result of this exercise can be seen below, which is the basic display of a polygon using OpenGL.

002-002-001-000016.png 

Conclusion

This installation exercise has required a lot of patience and persistence to get to this point, but it has been done not only willingly, but out of necessity. This is because I intend to use OpenGL to provide a visual representation of the values of a 3 Degrees-Of-Freedom (DOF) gyroscope and a 3 DOF accelerometer of the MPU-6050 and other MEMS sensors in general, as part of my 17 DOF Robot Kit project.

002-002-001-000017.pngI envision this framework being used for other projects too. Also, because the tools I have chosen to use, not out of coincidence, are X11 based it means that applications developed on this platform should be readily portable to LINUX. 

However, I am not out of the woods yet, this is because apart from visually displaying MEMs values I also need to display numerical values in text windows. To this end, for historical purposes, l need to install Openmotif (GLUI may be an alternative). Also,  to communicate with my hardware debug environment I need to install the FTDI library files, ftd2xx.lib.

A preliminary investigation into both would suggest that both installations are possible on the Mac OS X Maverics platform. Having been a LINUX devotee for years I can say that I am truly impressed with Xcode and its whole IDE framework. Stay turned for updates on this and other projects. 

Last modified on
0
 

Most Popular Blog Post

Mac OS X Dev (1) - Installing Xcode, MacPorts and XQuartz on Mavericks 10.9.5, An OpenGL Example
Development, Software and Tools
 As the title of this blog suggests this post is about installing and building an application using XCode on a Mac OS X system in general and on a Mac OS X with Mavericks 10.9.5 installed in pa...

Easy Tag Cloud


Powered by Easytagcloud v2.1