c - Broken CMake and gcc under OSX -


when running configure in cmake-gui on osx platform, following error occuring:

the c compiler identification gnu cxx compiler identification gnu checking whether c compiler has -isysroot checking whether c compiler has -isysroot - yes checking whether c compiler supports osx deployment target flag checking whether c compiler supports osx deployment target flag - yes check working c compiler: /usr/bin/gcc-4.0 check working c compiler: /usr/bin/gcc-4.0 -- broken cmake error @ /applications/cmake 2.8-2.app/contents/share/cmake-2.8/modules/cmaketestccompiler.cmake:52 (message):   c compiler "/usr/bin/gcc-4.0" not able compile simple test   program.    fails following output:      change dir: /users/bill/desktop/cmake_test/build/cmakefiles/cmaketmp      run build command:/opt/local/bin/gmake "cmtrycompileexec/fast"    /opt/local/bin/gmake -f cmakefiles/cmtrycompileexec.dir/build.make   cmakefiles/cmtrycompileexec.dir/build    gmake[1]: entering directory   `/users/bill/desktop/cmake_test/build/cmakefiles/cmaketmp'    "/applications/cmake 2.8-2.app/contents/bin/cmake" -e cmake_progress_report   /users/bill/desktop/cmake_test/build/cmakefiles/cmaketmp/cmakefiles 1    building c object cmakefiles/cmtrycompileexec.dir/testccompiler.c.o    /usr/bin/gcc-4.0 -isysroot -o   cmakefiles/cmtrycompileexec.dir/testccompiler.c.o -c   /users/bill/desktop/cmake_test/build/cmakefiles/cmaketmp/testccompiler.c     i686-apple-darwin10-gcc-4.0.1:   cmakefiles/cmtrycompileexec.dir/testccompiler.c.o: no such file or   directory      <snip> 

from looking @ forums etc on internet, have established path variable. here path variable analysis:

! echo $path /library/frameworks/python.framework/versions/current/bin:/library/frameworks/python.framework/versions/2.7/bin:/sw/bin:/sw/sbin:/applications/matlab_r2012a.app/bin:/opt/local/bin:/opt/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/texbin:/usr/x11/bin:/usr/x11r6/bin 

this path variable has changed when configured python, , think gcc problems must have sprung @ same sort of time. wrong system installation occurring?


some more details. build program specified cmake_make_program /opt/local/bin/gmake.

i have discovered these errors thrown when running configure in cmake-gui. on command line (running cmake .. build folder), configuration completes fine:

! cmake .. -- c compiler identification gnu 4.0.1 -- cxx compiler identification gnu 4.2.1 -- checking whether c compiler has -isysroot -- checking whether c compiler has -isysroot - yes -- checking whether c compiler supports osx deployment target flag -- checking whether c compiler supports osx deployment target flag - yes -- check working c compiler: /usr/bin/gcc-4.0 -- check working c compiler: /usr/bin/gcc-4.0 -- works -- detecting c compiler abi info -- detecting c compiler abi info - done -- checking whether cxx compiler has -isysroot -- checking whether cxx compiler has -isysroot - yes -- checking whether cxx compiler supports osx deployment target flag -- checking whether cxx compiler supports osx deployment target flag - yes -- check working cxx compiler: /usr/bin/c++ -- check working cxx compiler: /usr/bin/c++ -- works -- detecting cxx compiler abi info -- detecting cxx compiler abi info - done -- configuring done -- generating done 

however, compilation not successfull when using libraries - see example this question have asked here. therefore think might still going wrong in cmake process.

some observations question, may lead solution...

you using cmake 2.8.2, old, far cmake versions go. try 2.8.11 or release candidate of upcoming 2.8.12 see if problem still exists. if nothing else, perhaps you'll better error message.

see question , answer , links see various ways of guaranteeing consistent path values between command line environments , gui apps launched via other means on mac: https://serverfault.com/questions/16355/how-to-set-global-path-on-os-x/277034

the cmake gui not inherit same path value see in terminal, unless launch terminal open command.

two other things pop out @ me here: gcc 4.0 c compiler, g++ 4.2 c++ compiler. why different?

also, cmake_make_program points /opt/local/bin/gmake. true in both of build trees? (the command line 1 , gui one?) seems curious me cmake pick c , c++ compilers /usr/bin, gmake /opt/local/bin...

is command line environment set use these tools these paths? or unexpected you?

you don't mention version of xcode tools using @ all. perhaps adding question better answer pop someone's brain.

one last observation: have lot of stuff in path. minimizing path value use in build environments go long way helping avoid problems this. heartily recommend stripping down bare minimum need, @ least software building environment.

sorry non-answer answer, commentary seemed bit excessive stack overflow comment... :-)


Comments

Popular posts from this blog

linux - xterm copying to CLIPBOARD using copy-selection causes automatic updating of CLIPBOARD upon mouse selection -

c++ - qgraphicsview horizontal scrolling always has a vertical delta -