How to compile source code in mac os?

Discussion in 'Mac Programming' started by MacMan988, Mar 1, 2013.

  1. macrumors 6502a


    Jul 7, 2012
    Hi guys, I have been trying to install some programs such as Tesseract which requires compilations and I really don't have a clue about what those terminal commands such as "./configure","make","make install" are doing and I would like to learn more about those steps.

    Are they gonna make the source compiled and installed completely? Are those commands enough to get the source compiled and running when I type the program name in Terminal? Or do I have to manually place the executable file generated somewhere in the OS so it can file it up when I type the program name in Terminal?

  2. LPZ
    macrumors 65816

    Jul 11, 2006
    First, please check out MacPorts. You might find it a better choice than building your own binaries from source.

    "configure" can be used to enable/disable features in the software you are building. The output of configure is a "makefile". "make" reads the info in the makefile and directs the actual compiling of the source code and the linking of libraries. Invoking "make install" installs the executable and supporting files in your file system. Typically, by default the executable goes in /usr/local/bin. But this can be specified in the configure process. If /usr/local/bin is the list of search paths specified by your PATH variable, you should be able to invoke your program simply by entering its name at a Terminal prompt. In any case, you should always be able to invoke the program by entering its full path: /usr/local/bin/name-goes-here.

    Again, please check out MacPorts.:)
  3. Moderator


    Staff Member

    Aug 16, 2005
    New England
    Especially since they do have a tesseract port.

    The precursor to installing macports though is installing Xcode and the Command Line Tools in order to be able to compile code at all.

    EDIT: MOD NOTE: I think the folks in the programming forum might be able to help more so I moved the thread there even though it is not strictly a programming question/thread.

  4. thread starter macrumors 6502a


    Jul 7, 2012
    Thank you for all the information you have provided. And specially thanks for telling me about MacPorts ! :)

Share This Page