how to compile/make a program

Discussion in 'Mac Programming' started by maghemi, Jan 22, 2010.

  1. maghemi macrumors 6502

    Aug 7, 2009
    Melbourne Australia
    Ok, so I am a complete programming novice. However I'm trying to setup an arduino. The instructions i'm using refer to a program Cutecom a lot. So I'd like to be able to use the program they refer to.

    However I have no idea how to install that program, and can't seem to find any idiot proof instructions.

    Don't spose anyone here could point me in the right direction?
  2. robbieduncan Moderator emeritus


    Jul 24, 2002
    If you have to compile from source there are almost certainly no completely idiot-proof instructions. In general download and install the developer tools from Apple. Then open the terminal, cd to the correct directory and do a ./configure and make install.
  3. Cromulent macrumors 603


    Oct 2, 2006
    The Land of Hope and Glory
  4. maghemi thread starter macrumors 6502

    Aug 7, 2009
    Melbourne Australia
    I've got that software, however some of the instructions I want to run, were done in cutecom because "Do not use Arduino IDE serial monitor for sending AT commands - It does not send CR (Carriage return)"

    If I were smarted I'd work out another way to do what I want.

    I'm trying to use the arduino as a gateway at this point as per this page to use the GPRS module.
  5. mslide macrumors 6502a

    Sep 17, 2007
    You're in luck because this program actually builds without trouble. I just tried it. You will need to have XCode installed. You can get it from Here's what you need to do:

    1) It requires the Qt framework. Go here and download "Download Qt Libraries 4.6.1 for Mac". Install it. That should install without any trouble.

    2) You're program uses the CMake program to build. CMake is a build system that generates makefiles and whatnot. Download and install it from here. You want the following: "cmake-2.8.0-Darwin-universal.dmg". That should also install without issue. This is in contrast to most open source software that uses the autoconf stuff that's very popular on linux and what not (with those programs, that typical build procedure is "./configure && make". if you do that here, it will simply call cmake and do what I'm about to tell you).

    I use Qt and CMake on a daily basis for all my programming so let me know if you have any troubles with the above steps.

    3) Download the source to your program. Latest version is 0.22.0. You can get it from the link you provided

    4) Open up Terminal. Go to the directory that has the cutecom-0.22.0.tar.gz file you downloaded.

    4a) You will need /usr/local/Trolltech/Qt-4.6.1/bin in your PATH variable. You can do this by executing the following on the command line:

    export PATH=/usr/local/Trolltech/Qt-4.6.1/bin:$PATH
    5) Execute the following command to 'untar' (unpackage/unzip) it:

    tar zvxf cutecom-0.22.0.tar.gz
    6) Go into that directory (cd cutecom-0.22.0)

    7) Create a 'build' directory. It's just a directory that you will build all the stuff in. This isn't necessarily required but it's good practice and I recommend doing it when building anything that supports building in a different directory.

     mkdir build
    cd build
    8) Build with the following commands:

    cmake ..
    cross your fingers ...

    If it worked, you will see some colored output that says:

    $ make
    [ 20%] Generating ui_cutecommdlg.h
    [ 40%] Generating moc_qcppdialogimpl.cxx
    Scanning dependencies of target cutecom
    [ 60%] Building CXX object CMakeFiles/cutecom.dir/main.cpp.o
    [ 80%] Building CXX object CMakeFiles/cutecom.dir/qcppdialogimpl.cpp.o
    [100%] Building CXX object CMakeFiles/cutecom.dir/moc_qcppdialogimpl.cxx.o
    Linking CXX executable
    [100%] Built target cutecom
    9) If everything went right. You will have a '' in that same directory. That's your program. If you know what 'sudo' is, you can install it by doing:

     sudo make install
    and that will put it in /Applications. If you don't want to do that or have no idea what sudo is, then there's your program and you can put it whereever you want. If you open up finder and navigate to that directory, you will be able to double click on it to start it. Instead of doing the 'sudo make install' you can also use finder and drag the file over to your Applications folder.
  6. autorelease macrumors regular

    Oct 13, 2008
    Achewood, CA
    CuteCom is mainly a Linux program, which will make it a bit of a pain to install.

    The command-line program "screen" can be used to interact with an Arduino as well, and it's on every Mac. You start it with the command (where /dev/cu.usbserial is the device ID of the Arduino)
    screen /dev/cu.usbserial 9600
    and quit by pressing Ctrl-A followed by Ctrl-backslash.
  7. maghemi thread starter macrumors 6502

    Aug 7, 2009
    Melbourne Australia
    Well I was totally unsuccesful even following those instructions. I don't wend up with the .app
  8. savar macrumors 68000


    Jun 6, 2003
    District of Columbia
    You're in luck. Cutecom has a package in Darwin ports, so it should be simple to install.

    1) Install darwin ports (

    2) Go to terminal and type 'sudo port install cutecom-qt4-mac'*

    That should do it. If you get interested in open source software, you'll find that quite a few really great apps can be installed using darwin ports.

    * One caveat: if you get a message like 'Error: Port cutecom-qt4-mac not found', then insert this command as step 1.5: 'sudo port selfupdate' and then repeat step 2.

Share This Page