fail to build translated makefile on snow leopard 10.6.5 w/ g++ 4.2.1

Discussion in 'C++' started by nyiotis, Dec 19, 2010.

  1. nyiotis

    nyiotis Guest

    greetings!

    I am trying to build research code written in (templated) c++, size is
    approximately ~15K lines.
    the code was never been tested on a mac, not to mention snow leopard.
    I have the guarantee that it compiles + builds for win + linux.
    I 've successfully translated the *.vcproj file into a makefile, fixed
    a few issues, linked to external libs,
    but the build fails and I get

    i686-apple-darwin10-g++-4.2.1: g++: No such file or directory
    make[2]: *** [CMakeFiles/.../.../...cpp.o] Error 1
    make[1]: *** [CMakeFiles/.../.../all] Error 2
    make: *** [all] Error 2

    which, honestly, I don't remember seeing before -> complaining about g
    +
    + I mean and not missing file or dir

    I am stuck a few hours now and I suspect (or better hope) that the
    problem is sth similar to the
    typical 32-bit/64-bit problem in mac ports. I tried w/ -arch i386 -m32
    flags without any luck,
    so I 'd love to hear any thoughts, ideas..
    I guess there are parts of the code need to be re-written especially
    for OS X SL, but I cannot figure out the problem
    since the failing error is not descriptive enough

    thanks for any help!

    ps. note that I am building from command line without xcode
    and the -pedantic flag I use is not the reason of the failure
     
    nyiotis, Dec 19, 2010
    #1
    1. Advertising

  2. nyiotis

    Jorgen Grahn Guest

    Re: fail to build translated makefile on snow leopard 10.6.5 w/ g++4.2.1

    On Sun, 2010-12-19, nyiotis wrote:
    > greetings!
    >
    > I am trying to build research code written in (templated) c++, size is
    > approximately ~15K lines.
    > the code was never been tested on a mac, not to mention snow leopard.
    > I have the guarantee that it compiles + builds for win + linux.


    Then build it the same way as you'd do on Linux. Don't write another
    Makefile. (The problem is probably in your Makefile, and unrelated to
    C++.)

    /Jorgen

    --
    // Jorgen Grahn <grahn@ Oo o. . .
    \X/ snipabacken.se> O o .
     
    Jorgen Grahn, Dec 19, 2010
    #2
    1. Advertising

  3. nyiotis

    Geoff Guest

    On Sun, 19 Dec 2010 12:15:55 -0800 (PST), nyiotis
    <> wrote:

    >greetings!
    >
    >I am trying to build research code written in (templated) c++, size is
    >approximately ~15K lines.
    >the code was never been tested on a mac, not to mention snow leopard.
    >I have the guarantee that it compiles + builds for win + linux.
    >I 've successfully translated the *.vcproj file into a makefile, fixed
    >a few issues, linked to external libs,
    >but the build fails and I get
    >

    [snip]
    >
    >thanks for any help!
    >
    >ps. note that I am building from command line without xcode
    >and the -pedantic flag I use is not the reason of the failure


    Use the Linux makefile. Use otool as your library tool instead of ldd.
     
    Geoff, Dec 20, 2010
    #3
  4. nyiotis <> wrote:
    > i686-apple-darwin10-g++-4.2.1: g++: No such file or directory


    Well, the error message is rather obvious, isn't it? What exactly is
    your question?

    If your question is "how do I install g++?" then it happens when
    installing Xcode: When you are installing Xcode, there's an option
    somewhere which you have to check for it to install the command-line
    tools.
     
    Juha Nieminen, Dec 20, 2010
    #4
  5. nyiotis

    nyiotis Guest

    On Dec 19, 9:15 pm, nyiotis <> wrote:
    > greetings!
    >
    > I am trying to build research code written in (templated) c++, size is
    > approximately ~15K lines.
    > the code was never been tested on a mac, not to mention snow leopard.
    > I have the guarantee that it compiles + builds for win + linux.
    > I 've successfully translated the *.vcproj file into a makefile, fixed
    > a few issues, linked to external libs,
    > but the build fails and I get
    >
    > i686-apple-darwin10-g++-4.2.1: g++: No such file or directory
    > make[2]: *** [CMakeFiles/.../.../...cpp.o] Error 1
    > make[1]: *** [CMakeFiles/.../.../all] Error 2
    > make: *** [all] Error 2
    >
    > which, honestly, I don't remember seeing before -> complaining about g
    > +
    > + I mean and not missing file or dir
    >
    > I am stuck a few hours now and I suspect (or better hope) that the
    > problem is sth similar to the
    > typical 32-bit/64-bit problem in mac ports. I tried w/ -arch i386 -m32
    > flags without any luck,
    > so I 'd love to hear any thoughts, ideas..
    > I guess there are parts of the code need to be re-written especially
    > for OS X SL, but I cannot figure out the problem
    > since the failing error is not descriptive enough
    >
    > thanks for any help!
    >
    > ps. note that I am building from command line without xcode
    > and the -pedantic flag I use is not the reason of the failure


    thank you all!
    it's still unclear to me though..

    @Jorgen/ @Geoff: project was a collaborative effort and unfortunately
    I am stuck without a makefile =P
    and with the ugly *.vcproj file. Note that I did not use an automated
    ruby script I found for
    the translation of *.vcproj to makefile, since the script only handled
    the basics -> no pre/post-build steps or
    file-specific flags are included; instead, I translated from scratch
    to CMakelists and then converted to makefile.
    not that tricky as it sounds..
    so, assuming the problem is w/ the makefile, why do I have a clean
    makefile during the configuration/generation steps?
    Note that I choose Unix makefile, not xcode.

    when I build a xcodeproj (with g++ flag -arch i386), I get:

    lipo: can't figure out the architecture type of: /var/folders/9b/
    9b2CWG5gHvCi5hawjO4o5E+++TI/-Tmp-//ccXHDX6t.out
    Command /Developer/usr/bin/gcc-4.2 failed with exit code 1


    when I build a xcodeproj (with g++ flag -arch x86_64), I get:

    setenv LANG en_US.US-ASCII
    /Developer/usr/bin/gcc-4.2 -x c++ -arch x86_64 -fmessage-length=0 -
    pipe -Wno-trigraphs -fpascal-strings -fasm-blocks -O0 -mdynamic-no-pic
    -DCMAKE_INTDIR="Debug" -isysroot /Developer/SDKs/MacOSX10.6.sdk -
    mmacosx-version-min=10.6 -gdwarf-2 -Wmost -Wno-four-char-constants -
    Wno-unknown-pragmas //... ...

    i686-apple-darwin10-gcc-4.2.1: g++: No such file or directory
    Command /Developer/usr/bin/gcc-4.2 failed with exit code 1


    also @Geoff: although developing on a mac, I do not use Cocoa(/xcode)
    that uses otool to find any required shared libraries.
    so from the command line I don't have to care about otool, right?

    @Juha: I take it that you imply that g++ is missing. if so that's not
    the case -> gcc version 4.2.1 (Apple Inc. build 5664)
    @Sherm: xcode is installed, yes. but I use the command line


    cheers
     
    nyiotis, Dec 20, 2010
    #5
  6. nyiotis

    Jorgen Grahn Guest

    Re: fail to build translated makefile on snow leopard 10.6.5 w/ g++4.2.1

    On Mon, 2010-12-20, nyiotis wrote:
    > On Dec 19, 9:15 pm, nyiotis <> wrote:
    >> greetings!
    >>
    >> I am trying to build research code written in (templated) c++, size is
    >> approximately ~15K lines.

    ....

    > @Jorgen/ @Geoff: project was a collaborative effort and unfortunately
    > I am stuck without a makefile =P


    OK, then it doesn't build with Linux like you said -- someone just
    claims it builds with Linux given some changes (to the build system)
    which you don't have access to :-(

    ....
    > when I build a xcodeproj (with g++ flag -arch x86_64), I get:
    >
    > setenv LANG en_US.US-ASCII
    > /Developer/usr/bin/gcc-4.2 -x c++ -arch x86_64 -fmessage-length=0 -
    > pipe -Wno-trigraphs -fpascal-strings -fasm-blocks -O0 -mdynamic-no-pic
    > -DCMAKE_INTDIR="Debug" -isysroot /Developer/SDKs/MacOSX10.6.sdk -
    > mmacosx-version-min=10.6 -gdwarf-2 -Wmost -Wno-four-char-constants -
    > Wno-unknown-pragmas //... ...
    >
    > i686-apple-darwin10-gcc-4.2.1: g++: No such file or directory
    > Command /Developer/usr/bin/gcc-4.2 failed with exit code 1


    You're not showing the full command line -- I take it the "// ..."
    means "boring details which I have omitted"?

    I think you *do* have the compiler properly installed, but I bet that
    part has an extra "g++" in it somewhere, so that the command line
    turns into something equivalent to:

    % gcc-4.2 -x c++ g++ foo.cc
    gcc-4.2: g++: No such file or directory

    /Jorgen

    --
    // Jorgen Grahn <grahn@ Oo o. . .
    \X/ snipabacken.se> O o .
     
    Jorgen Grahn, Dec 20, 2010
    #6
  7. nyiotis

    nyiotis Guest

    On Dec 20, 11:22 pm, Jorgen Grahn <> wrote:
    > On Mon, 2010-12-20, nyiotis wrote:
    > > On Dec 19, 9:15 pm, nyiotis <> wrote:
    > >> greetings!

    >
    > >> I am trying to build research code written in (templated) c++, size is
    > >> approximately ~15K lines.

    >
    > ...
    >
    > > @Jorgen/ @Geoff: project was a collaborative effort and unfortunately
    > > I am stuck without a makefile =P

    >
    > OK, then it doesn't build with Linux like you said -- someone just
    > claims it builds with Linux given some changes (to the build system)
    > which you don't have access to :-(
    >
    > ...
    >
    > > when I build a xcodeproj (with g++ flag -arch x86_64), I get:

    >
    > > setenv LANG en_US.US-ASCII
    > > /Developer/usr/bin/gcc-4.2 -x c++ -arch x86_64 -fmessage-length=0 -
    > > pipe -Wno-trigraphs -fpascal-strings -fasm-blocks -O0 -mdynamic-no-pic
    > > -DCMAKE_INTDIR="Debug" -isysroot /Developer/SDKs/MacOSX10.6.sdk -
    > > mmacosx-version-min=10.6 -gdwarf-2 -Wmost -Wno-four-char-constants -
    > > Wno-unknown-pragmas //... ...

    >


    thanks. yes '//... ...' goes for name of files + external libraries
    attached which works fine


    > > i686-apple-darwin10-gcc-4.2.1: g++: No such file or directory
    > > Command /Developer/usr/bin/gcc-4.2 failed with exit code 1

    >
    > You're not showing the full command line -- I take it the "// ..."
    > means "boring details which I have omitted"?
    >
    > I think you *do* have the compiler properly installed, but I bet that
    > part has an extra "g++" in it somewhere, so that the command line
    > turns into something equivalent to:
    >
    > % gcc-4.2 -x c++ g++ foo.cc
    > gcc-4.2: g++: No such file or directory


    I cannot think how to check this out..

    But, assuming that /usr/bin was somehow not in the path during the
    cmake invocation,
    I used

    set(CMAKE_C_COMPILER /usr/bin/gcc)
    set(CMAKE_CXX_COMPILER /usr/bin/g++)

    in the beginning of my CMakeList.txt without any gain.
    It complained temporarily for a conflict, i.e. had to reset the cache,
    but no progress so far.

    > /Jorgen
    >
    > --
    >   // Jorgen Grahn <grahn@  Oo  o.   .  .
    > \X/     snipabacken.se>   O  o   .
     
    nyiotis, Dec 20, 2010
    #7
  8. nyiotis

    nyiotis Guest

    On Dec 20, 11:42 pm, nyiotis <> wrote:
    > On Dec 20, 11:22 pm, Jorgen Grahn <> wrote:
    >
    >
    >
    >
    >
    >
    >
    >
    >
    > > On Mon, 2010-12-20, nyiotis wrote:
    > > > On Dec 19, 9:15 pm, nyiotis <> wrote:
    > > >> greetings!

    >
    > > >> I am trying to build research code written in (templated) c++, size is
    > > >> approximately ~15K lines.

    >
    > > ...

    >
    > > > @Jorgen/ @Geoff: project was a collaborative effort and unfortunately
    > > > I am stuck without a makefile =P

    >
    > > OK, then it doesn't build with Linux like you said -- someone just
    > > claims it builds with Linux given some changes (to the build system)
    > > which you don't have access to :-(

    >
    > > ...

    >
    > > > when I build a xcodeproj (with g++ flag -arch x86_64), I get:

    >
    > > > setenv LANG en_US.US-ASCII
    > > > /Developer/usr/bin/gcc-4.2 -x c++ -arch x86_64 -fmessage-length=0 -
    > > > pipe -Wno-trigraphs -fpascal-strings -fasm-blocks -O0 -mdynamic-no-pic
    > > > -DCMAKE_INTDIR="Debug" -isysroot /Developer/SDKs/MacOSX10.6.sdk -
    > > > mmacosx-version-min=10.6 -gdwarf-2 -Wmost -Wno-four-char-constants -
    > > > Wno-unknown-pragmas //... ...

    >
    > thanks. yes '//... ...' goes for name of files + external libraries
    > attached which works fine
    >
    > > > i686-apple-darwin10-gcc-4.2.1: g++: No such file or directory
    > > > Command /Developer/usr/bin/gcc-4.2 failed with exit code 1

    >
    > > You're not showing the full command line -- I take it the "// ..."
    > > means "boring details which I have omitted"?

    >
    > > I think you *do* have the compiler properly installed, but I bet that
    > > part has an extra "g++" in it somewhere, so that the command line
    > > turns into something equivalent to:

    >
    > > % gcc-4.2 -x c++ g++ foo.cc
    > > gcc-4.2: g++: No such file or directory

    >
    > I cannot think how to check this out..
    >
    > But, assuming that /usr/bin was somehow not in the path during the
    > cmake invocation,
    > I used
    >
    > set(CMAKE_C_COMPILER /usr/bin/gcc)
    > set(CMAKE_CXX_COMPILER /usr/bin/g++)
    >
    > in the beginning of my CMakeList.txt without any gain.
    > It complained temporarily for a conflict, i.e. had to reset the cache,
    > but no progress so far.
    >
    >
    >
    >
    >
    >
    >
    > > /Jorgen

    >
    > > --
    > >   // Jorgen Grahn <grahn@  Oo  o.   .  .
    > > \X/     snipabacken.se>   O  o   .


    Okay, it turns that a setenv command in my .profile caused all this
    trouble
    (I am using bash) together w/ a system-specific command in the
    CMakeLists.
    issue *almost* resolved

    N
     
    nyiotis, Dec 21, 2010
    #8
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Alia Khouri

    python version in snow leopard?

    Alia Khouri, Jun 9, 2009, in forum: Python
    Replies:
    2
    Views:
    270
    Alia K
    Jun 9, 2009
  2. Roedy Green

    Java hom foer the Mac Snow Leopard?

    Roedy Green, Sep 2, 2009, in forum: Java
    Replies:
    7
    Views:
    392
    Kevin McMurtrie
    Sep 7, 2009
  3. Xiao Yu
    Replies:
    0
    Views:
    412
    Xiao Yu
    Oct 13, 2009
  4. Xiao
    Replies:
    1
    Views:
    487
    Ned Deily
    Dec 1, 2009
  5. Jean-eric Godard
    Replies:
    1
    Views:
    115
    Dave Howell
    Jun 21, 2010
Loading...

Share This Page