gcc not installed with 10.7.x???

Discussion in 'Mac Programming' started by cfshelor, Nov 4, 2011.

  1. cfshelor macrumors newbie

    Joined:
    Nov 4, 2011
    #1
    I recently upgraded to Lion and have discovered that I can no longer run gcc from the command line. If I try to access the gcc in the developer area from the command line, it cannot locate any of the standard libraries. (Yes, I must have access to gcc from the command line as I am developing MPI programs that will not link with Xcode unless someone can tell me how to fix that!)

    If someone could point me to instructions on how to run OpenMP and MPI from Xcode 4, that would be extremely helpful as well!!

    Thanks for any suggestions.

    Charles
     
  2. darki macrumors newbie

    Joined:
    May 27, 2011
    Location:
    Austria
    #2
    You need to install Xcode 4.xx, the gcc compiler is not included in lion.
    Its available for free on the app store.

    Im able to compile OpenMp C/C++ stuff from the command line (using a makefile).
     
  3. cfshelor thread starter macrumors newbie

    Joined:
    Nov 4, 2011
    #3
    gcc returned, but #include <omp.h> now errors

    Installing Xcode 4.2 returned gcc to /usr/lib. However, my OpenMP include file line: #include <omp.h> now returns 'omp.h' file not found error. This statement works fine in Xcode 3.5.x and 3.6.x. Does anyone know how to make this work in Xcode 4.2?

    Thanks!

    Charles
     
  4. darki macrumors newbie

    Joined:
    May 27, 2011
    Location:
    Austria
    #4
    Hi

    #include <omp.h> is correct.

    Are you using the -fopenmp flag to compile your stuff?
     
  5. cfshelor thread starter macrumors newbie

    Joined:
    Nov 4, 2011
    #5
    In Xcode 3.6 there was a check box in the build controls in the project settings. I cannot find the equivalent in Xcode 4.2, but assumed the project settings would have been copied over from the Xcode 3.6 settings. Where do I set that flag in Xcode 4.2?
     
  6. otherside macrumors newbie

    Joined:
    Sep 7, 2006
    #6
    You can change the compiler to LLVM GCC 4.2 and turn on "Enable OpenMP Support" in Build Settings.

    After that I can build and run a simple OpenMP program (just for testing) even though Xcode still complains "omp.h file not found". Anyone got a solution for the "file not found" thing?

    Thanks!
     
  7. Mr. Retrofire macrumors 601

    Mr. Retrofire

    Joined:
    Mar 2, 2010
    Location:
    www.emiliana.cl/en
    #7
  8. Mr. Retrofire macrumors 601

    Mr. Retrofire

    Joined:
    Mar 2, 2010
    Location:
    www.emiliana.cl/en
    #8
    Make sure you include the correct directory which contains the omp.h file in the list of the user specified header search paths. If necessary, use Find Any File, to find the appropriate omp.h file on your machine.
     

Share This Page