Skip to content
This repository has been archived by the owner on Nov 14, 2021. It is now read-only.

Cannot make #31

Closed
Darklocq opened this issue Apr 8, 2017 · 6 comments
Closed

Cannot make #31

Darklocq opened this issue Apr 8, 2017 · 6 comments

Comments

@Darklocq
Copy link

Darklocq commented Apr 8, 2017

Using MacOS 10.12.3.

Error mess:


$ cmake ..
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/darklocq/Temp/openmw-deps-mac/build
$ make
[  1%] Performing configure step for 'unshield'
-- The C compiler identification is GNU 4.2.1
-- The CXX compiler identification is 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 for working C compiler: /Developer/usr/bin/cc
-- Check for working C compiler: /Developer/usr/bin/cc -- broken
CMake Error at /opt/local/share/cmake-3.7/Modules/CMakeTestCCompiler.cmake:51 (message):
  The C compiler "/Developer/usr/bin/cc" is not able to compile a simple test
  program.

  It fails with the following output:

   Change Dir: /Users/darklocq/Temp/openmw-deps-mac/build/src/unshield-prefix/src/unshield-build/CMakeFiles/CMakeTmp

  

  Run Build Command:"/opt/local/bin/gmake" "cmTC_e9be6/fast"

  gmake[3]: Entering directory
  '/Users/darklocq/TEMP/openmw-deps-mac/build/src/unshield-prefix/src/unshield-build/CMakeFiles/CMakeTmp'


  /opt/local/bin/gmake -f CMakeFiles/cmTC_e9be6.dir/build.make
  CMakeFiles/cmTC_e9be6.dir/build

  gmake[4]: Entering directory
  '/Users/darklocq/TEMP/openmw-deps-mac/build/src/unshield-prefix/src/unshield-build/CMakeFiles/CMakeTmp'


  Building C object CMakeFiles/cmTC_e9be6.dir/testCCompiler.c.o

  /Developer/usr/bin/cc -isysroot macosx10.12 -mmacosx-version-min=10.8 -o
  CMakeFiles/cmTC_e9be6.dir/testCCompiler.c.o -c
  /Users/darklocq/Temp/openmw-deps-mac/build/src/unshield-prefix/src/unshield-build/CMakeFiles/CMakeTmp/testCCompiler.c


  Linking C executable cmTC_e9be6

  /opt/local/bin/cmake -E cmake_link_script
  CMakeFiles/cmTC_e9be6.dir/link.txt --verbose=1

  /Developer/usr/bin/cc -isysroot macosx10.12 -mmacosx-version-min=10.8
  -Wl,-search_paths_first -Wl,-headerpad_max_install_names
  CMakeFiles/cmTC_e9be6.dir/testCCompiler.c.o -o cmTC_e9be6

  ld: library not found for -lcrt1.10.6.o

  collect2: ld returned 1 exit status

  gmake[4]: *** [CMakeFiles/cmTC_e9be6.dir/build.make:98: cmTC_e9be6] Error 1

  gmake[4]: Leaving directory
  '/Users/darklocq/TEMP/openmw-deps-mac/build/src/unshield-prefix/src/unshield-build/CMakeFiles/CMakeTmp'


  gmake[3]: *** [Makefile:126: cmTC_e9be6/fast] Error 2

  gmake[3]: Leaving directory
  '/Users/darklocq/TEMP/openmw-deps-mac/build/src/unshield-prefix/src/unshield-build/CMakeFiles/CMakeTmp'


  

  

  CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
  CMakeLists.txt:2 (project)


-- Configuring incomplete, errors occurred!
See also "/Users/darklocq/Temp/openmw-deps-mac/build/src/unshield-prefix/src/unshield-build/CMakeFiles/CMakeOutput.log".
See also "/Users/darklocq/Temp/openmw-deps-mac/build/src/unshield-prefix/src/unshield-build/CMakeFiles/CMakeError.log".
make[2]: *** [src/unshield-prefix/src/unshield-stamp/unshield-configure] Error 1
make[1]: *** [src/CMakeFiles/unshield.dir/all] Error 2
make: *** [all] Error 2
$ 

Tried it with the sandbox-exec version of the commands, same issue. Googled around a bit and found a similar report about compiling MySQL here
The followup there about using cmake .. -DCMAKE_CXX_COMPILER=g++ -DCMAKE_CC_COMPILER=gcc instead (and I do have gcc and g++ installed) did not work. I tried just make again after doing that, got the same seemingly bogus error that The C compiler "/Developer/usr/bin/cc" is not able to compile a simple test program. Dunno if one must do something different with make after doing these special things with cmake. When I manually try to run the simple test compile, with /opt/local/bin/gmake "cmTC_e9be6/fast", I'm told: gmake: *** No rule to make target 'cmTC_e9be6/fast'. Stop.

So, at this point I can't get the deps to compile much less the game app. I generally do not have compile problems like this, and regularly use MacPorts, Homebrew, and even occasionally Fink to install what I want (whichever has the most current version of something). Admittedly, I generally do not compile stuff from scratch off GitHub, but only using those managers.

@nikolaykasyanov
Copy link
Member

nikolaykasyanov commented Apr 10, 2017

Thanks for your report. It looks like you're using GCC, but, unfortunately, I never tested this repo with compilers except for Xcode's built-in Clang.

@nikolaykasyanov
Copy link
Member

GCC support is discussed in #49.

@Darklocq
Copy link
Author

Darklocq commented Feb 8, 2019

Thanks for the followup. This will probably seem like a dumb question, but if I wanted to try the "Xcode's built-in Clang" method, how would I go about that? Is it simply a matter of using a different path for cmake and make? The only compiling I do is for MacPorts and Homebrew these days, so I don't know a thing about Xcode.

@nikolaykasyanov
Copy link
Member

nikolaykasyanov commented Feb 8, 2019

@Darklocq nothing dumb about it!

Both CMake and Make should be compiler-agnostic, actually. I'm not entirely sure about the mechanism CMake uses to find compilers, although I'd suggest that it simply tries whatever is in CC and CXX environment variables first. It's possible to pass desired compilers to CMake explicitly though:

$ cmake -DCMAKE_C_COMPILER=$(xcrun --find clang) -DCMAKE_CXX_COMPILER=$(xcrun --find clang++) ....

Please make sure xcrun knows where to find the tools by doing the following after installing Xcode:

$ sudo xcode-select --switch /Application/Xcode.app # or whatever your Xcode path is

Actually, having Xcode command line tools could be enough (and since you use Homebrew, I assume you have them installed), unfortunately I can't verify it because I have Xcode everywhere due to being an iOS app developer.

@Darklocq
Copy link
Author

Darklocq commented Feb 9, 2019

Thanks for the hand-holding. I will give this a try (though almost a year down the road, I don't exactly recall why I was so hot to compile my own copy; I'm sure it'll come back to me eventually).

@nikolaykasyanov
Copy link
Member

FYI I've edited the xcode-select command.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants