CMake Yields "unknown compiler"

CMake Yields "unknown compiler"

Discuss everything related to compiling and running Spring on Mac OS X.

Moderator: Moderators

Post Reply
evan
Posts: 11
Joined: 25 Jun 2012, 19:18

CMake Yields "unknown compiler"

Post by evan »

Trying to build on OS X Lion and I get an "unknown compiler" message when I run cmake. Any ideas? (I'm also curious about all the OpenMP failures, but perhaps that is related.) Thanks.

Code: Select all

-- The C compiler identification is GNU 4.2.1
-- The CXX compiler identification is Clang 3.1.0
-- 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 for working C compiler: /usr/bin/gcc
-- Check for working C compiler: /usr/bin/gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Boost version: 1.49.0
-- Found the following Boost libraries:
--   thread
--   regex
--   program_options
--   system
--   signals
-- Found SDL: /opt/local/lib/libSDLmain.a;/opt/local/lib/libSDL.dylib;-framework Cocoa  
-- Found DevIL: /usr/local/include/IL/il.h  
-- Found DevIL-ILU: /usr/local/lib/libILU.dylib - /usr/local/include/IL/ilu.h
-- Found DevIL-ILUT: /usr/local/lib/libILUT.dylib - /usr/local/include/IL/ilut.h
-- Checking to see if CXX compiler accepts flag -fvisibility-inlines-hidden
-- Checking to see if CXX compiler accepts flag -fvisibility-inlines-hidden - yes
-- Checking to see if CXX compiler accepts flag -msse -mfpmath=sse
-- Checking to see if CXX compiler accepts flag -msse -mfpmath=sse - yes
-- Checking to see if CXX compiler accepts flag -mno-sse2
-- Checking to see if CXX compiler accepts flag -mno-sse2 - yes
-- Checking to see if CXX compiler accepts flag -mno-sse3
-- Checking to see if CXX compiler accepts flag -mno-sse3 - yes
-- Checking to see if CXX compiler accepts flag -mno-ssse3
-- Checking to see if CXX compiler accepts flag -mno-ssse3 - yes
-- Checking to see if CXX compiler accepts flag -mno-sse4.1
-- Checking to see if CXX compiler accepts flag -mno-sse4.1 - yes
-- Checking to see if CXX compiler accepts flag -mno-sse4.2
-- Checking to see if CXX compiler accepts flag -mno-sse4.2 - yes
-- Checking to see if CXX compiler accepts flag -mno-sse4
-- Checking to see if CXX compiler accepts flag -mno-sse4 - yes
-- Checking to see if CXX compiler accepts flag -mno-sse4a
-- Checking to see if CXX compiler accepts flag -mno-sse4a - yes
-- Checking to see if CXX compiler accepts flag -mno-avx
-- Checking to see if CXX compiler accepts flag -mno-avx - yes
-- Checking to see if CXX compiler accepts flag -mno-fma
-- Checking to see if CXX compiler accepts flag -mno-fma - yes
-- Checking to see if CXX compiler accepts flag -mno-fma4
-- Checking to see if CXX compiler accepts flag -mno-fma4 - yes
-- Checking to see if CXX compiler accepts flag -mno-xop
-- Checking to see if CXX compiler accepts flag -mno-xop - yes
-- Checking to see if CXX compiler accepts flag -mno-lwp
-- Checking to see if CXX compiler accepts flag -mno-lwp - yes
-- Checking to see if CXX compiler accepts flag -mno-avx2
-- Checking to see if CXX compiler accepts flag -mno-avx2 - yes
-- Checking to see if CXX compiler accepts flag -mieee-fp
-- Checking to see if CXX compiler accepts flag -mieee-fp - yes
-- Checking to see if CXX compiler accepts flag -march=i686
-- Checking to see if CXX compiler accepts flag -march=i686 - no
-- Checking to see if CXX compiler accepts flag -march=x86_64
-- Checking to see if CXX compiler accepts flag -march=x86_64 - no
-- Building Spring for 64bit environment
-- Try OpenMP C flag = [-fopenmp]
-- Performing Test OpenMP_FLAG_DETECTED
-- Performing Test OpenMP_FLAG_DETECTED - Success
-- Try OpenMP CXX flag = [-fopenmp]
-- Performing Test OpenMP_FLAG_DETECTED
-- Performing Test OpenMP_FLAG_DETECTED - Failed
-- Try OpenMP CXX flag = [/openmp]
-- Performing Test OpenMP_FLAG_DETECTED
-- Performing Test OpenMP_FLAG_DETECTED - Failed
-- Try OpenMP CXX flag = [-Qopenmp]
-- Performing Test OpenMP_FLAG_DETECTED
-- Performing Test OpenMP_FLAG_DETECTED - Failed
-- Try OpenMP CXX flag = [-openmp]
-- Performing Test OpenMP_FLAG_DETECTED
-- Performing Test OpenMP_FLAG_DETECTED - Failed
-- Try OpenMP CXX flag = [ ]
-- Performing Test OpenMP_FLAG_DETECTED
-- Performing Test OpenMP_FLAG_DETECTED - Failed
-- Try OpenMP CXX flag = [-xopenmp]
-- Performing Test OpenMP_FLAG_DETECTED
-- Performing Test OpenMP_FLAG_DETECTED - Failed
-- Try OpenMP CXX flag = [+Oopenmp]
-- Performing Test OpenMP_FLAG_DETECTED
-- Performing Test OpenMP_FLAG_DETECTED - Failed
-- Try OpenMP CXX flag = [-qsmp]
-- Performing Test OpenMP_FLAG_DETECTED
-- Performing Test OpenMP_FLAG_DETECTED - Failed
-- Try OpenMP CXX flag = [-mp]
-- Performing Test OpenMP_FLAG_DETECTED
-- Performing Test OpenMP_FLAG_DETECTED - Failed
-- Could NOT find OpenMP (missing:  OpenMP_CXX_FLAGS) 
CMake Error at CMakeLists.txt:304 (Message):
  unknown compiler
User avatar
jK
Spring Developer
Posts: 2299
Joined: 28 Jun 2007, 07:30

Re: CMake Yields "unknown compiler"

Post by jK »

Clang/LLVM builds aren't tested. They will likely not compile and never work in online gaming.
I don't have any experience with xcode, but you need to switch its CXX compiler to GCC.
evan
Posts: 11
Joined: 25 Jun 2012, 19:18

Re: CMake Yields "unknown compiler"

Post by evan »

Thanks. I installed GCC using Kenneth Reitz's tool, and now cmake tells me that the CXX compiler is GNU 4.2.1. All is well with cmake. Unfortunately, "make spring" is resulting in a segmentation fault very early on, on rts/System/Sound/CMakeFiles/sound.dir/EFX.cpp.o. It seems like this is going to get very finicky, so I'm just going to stick with Ubuntu until someone smarter and more familiar with developing on a Mac has time to work on this.
User avatar
jK
Spring Developer
Posts: 2299
Joined: 28 Jun 2007, 07:30

Re: CMake Yields "unknown compiler"

Post by jK »

I don't know what you are up to, we have a binary osx build.
evan
Posts: 11
Joined: 25 Jun 2012, 19:18

Re: CMake Yields "unknown compiler"

Post by evan »

I'm a university student, not an expert dev or expert Mac user, so I'm only going off of the the wiki article Building Spring on MacOSX. (Why am I trying to build Spring myself if I'm not an expert? We need LuaSocket support, which is currently only available by building the development branch.) I noticed that your binary was built on Snow Leopard, so perhaps there are differences between that and Lion that are causing problems. Or I messed it up on my own in some other way.

My research into Mac-dom was purely for convenience, since we have several Macs in our lab. Taking too much more time to troubleshoot my problems wouldn't be worth it though, since we've got everything working on Ubuntu.

As a side note, is there a release date planned for Spring 89? We're very eager to be able to deploy our mod without having to build a binary from source.
gajop
Moderator
Posts: 3051
Joined: 05 Aug 2009, 20:42

Re: CMake Yields "unknown compiler"

Post by gajop »

1) If you're a computer science/software engineer student, you should learn how to compile stuff. You should know it anyhow if you plan to develop games for spring - it makes testing new spring engine release candidates with your game easier.
2) If you run into problems with compilation you can try to post it here, someone may be able to help you. I don't think (m)any engine devs use or even own a mac, so don't assume it will get fixed by itself magically.
User avatar
daftalx
Posts: 89
Joined: 30 May 2010, 11:56

Re: CMake Yields "unknown compiler"

Post by daftalx »

I (and many others) believe that Lion was not a revolution tech-wise, this is why I haven't upgraded any of my machines (including the server on which Spring for Mac is built). This is why the binary is currently SL-compatible, although Lion users have been able to run the binary.

I might consider switching directly to Mountain Lion though, more forced to than willing, just not to be left too far behind as Apple is known to drop legacy hardware and software quite fast.

Bottom line in the meantime, no troubleshooting on Lion yet (unless a charitable/knowledgeable reader passes by).
abma
Spring Developer
Posts: 3798
Joined: 01 Jun 2009, 00:08

Re: CMake Yields "unknown compiler"

Post by abma »

As a side note, is there a release date planned for Spring 89? We're very eager to be able to deploy our mod without having to build a binary from source.
soon:
http://springrts.com/dl/buildbot/defaul ... eopard.zip
evan
Posts: 11
Joined: 25 Jun 2012, 19:18

Re: CMake Yields "unknown compiler"

Post by evan »

Thanks all for the input. abma, thanks for the link. Unfortunately, I'm told that Spring_89.0 can't be opened and to check with the developer that it works with this version of Mac OS X...
abma
Spring Developer
Posts: 3798
Joined: 01 Jun 2009, 00:08

Re: CMake Yields "unknown compiler"

Post by abma »

sorry for not replying such a long time, was quiet busy for myself. hopefully do you have any success to report?

about the error message... i can't help, as i'm not familar with osx. i would guess it was because of some version difference / arch problem (like springs binary is 64 bit and osx is 32 bit...)
evan
Posts: 11
Joined: 25 Jun 2012, 19:18

Re: CMake Yields "unknown compiler"

Post by evan »

No worries. We didn't really make much progress, but we weren't trying too hard. Running on OSX was just a very small item on a wish list for my team. We're running smoothly on Windows and Ubuntu these days.
abma
Spring Developer
Posts: 3798
Joined: 01 Jun 2009, 00:08

Re: CMake Yields "unknown compiler"

Post by abma »

ok, nice to hear. Sadly spring on osx is still experimental, as we have no dev running macosx.
nicholaskell
Posts: 1
Joined: 21 Nov 2012, 01:23

Re: CMake Yields "unknown compiler"

Post by nicholaskell »

use

Code: Select all

-D CMAKE_CXX_COMPILER=/usr/bin/g++ 
when running cmake.
unreal
Posts: 1
Joined: 03 Jul 2013, 15:34

Re: CMake Yields "unknown compiler"

Post by unreal »

nicholaskell wrote:use

Code: Select all

-D CMAKE_CXX_COMPILER=/usr/bin/g++ 
when running cmake.
thanks nicholas!
Post Reply

Return to “Mac OS X”