CMake Xcode generator uses no longer supported options - xcode

I'm trying to make a Xcode project from the Insight Toolkit (ITK, itk.org). I issued the following command into the terminal:
ccmake -DCMAKE_C_COMPILER=/Applications/Xcode.app/Contents/Developer/usr/bin/gcc -DCMAKE_CXX_COMPILER=/Applications/Xcode.app/Contents/Developer/usr/bin/g++ -GXcode /<path to source>
When I try to generate the project it fails with this error:
CMake Error at /Applications/CMake 2.8-7.app/Contents/share/cmake-2.8/Modules/CMakeTestCCompiler.cmake:52 (MESSAGE):
The C compiler "/Applications/Xcode.app/Contents/Developer/usr/bin/gcc" is not able to compile a simple test program.
It fails with the following output:
Change Dir: /<path to destination folder>/CMakeFiles/CMakeTmp
Run Build Command:/Applications/CMake\ 2.8-7.app/Contents/bin/cmakexbuild -project CMAKE_TRY_COMPILE.xcode build -target cmTryCompileExec -buildstyle Development
xcodebuild: error: option '-buildstyle' is no longer supported
How can I configure the call to cmakexbuild? I haven't found a respective entry in the CMake configuration menu.
I have found similar problems from other users with other projects so I assume it's a problem with the CMake configuration.
I'm using Xcode 4.3 and CMake 2.8.7 on Mac OS X Lion 10.7.3.
Thanks for your help,
Paul

It's a CMake bug and it seem to be been fixed in development version:
http://public.kitware.com/Bug/view.php?id=12621

You can fix this by telling OSX which version of Xcode you want to use. If you installed 4.3, it has moved to the Apps folder, along with all the tools. Previously they were all in /Developer. Do the following and try again.
sudo /usr/bin/xcode-select -switch /Applications/Xcode.app/Contents/Developer
You may also have to install the command-line tools. I already installed these so I don't know what will happen without them.

cmake 2.8.8 rc1 is out now. Perhaps try that. I think it has solved my problem. :)

Related

Installing Unreal Engine on OSX Mojave

So I'm trying to clone the Unreal Engine from GitHub and setup on OSX Mojave and when running the GenerateProjectFiles.command file as part of the setup, I get the following error:
ERROR: UnrealBuildTool Exception: Invalid SDK MacOSX.sdk, not found in /Library/Developer/CommandLineTools/Platforms/MacOSX.platform/Developer/SDKs
I do have a folder called MacOSX.sdk in a different directory, but when I try to create a symlink to it in the directory that Unreal is searching for, I get this following error instead:
ERROR: UnrealBuildTool Exception: Unable to find installed MacOS SDK on remote agent.
It seems like I'm missing the correct version of the MacOSX.sdk that Unreal needs but I'm not sure what that is. I know you get it when you install XCode, but I have both XCode 10.1 and XCode 9.4 with command line tools installed and still no luck.
What am I missing here?
I have same issue and find a measure for my case.
sudo xcode-select --reset
from here
you need the correct version of xcode with the specific version of unreal.
for unreal engine 4.24 or earlier, you need to install xcode 11 from here:Download xcode 11.for 4.25 or later, use xcode 12 or later if you haven't installed.
if not use sudo xcode-select --reset

Missing Kernel.framework/Headers

I'm attempting to build an internal project that requires libkern/OSAtomic.h and make (using clang) is complaining that it is not found.
I'm using the latest version of XCode (6.2). My coworker has the following folder on his system:
/System/Library/Frameworks/Kernel.framework/Headers
I do not have this folder. What do I need to do to make sure my system headers are available?
So sorry, I'm an idiot. I had not installed the CLT (command line tools) for XCode yet.

Why is clang not working in Mac Os X 10.5.8 (Leopard) for compiling Z3?

I am not a pro-user of Mac, so I am having a lot of problems to install software. I would like to run the Z3Py (Z3 API using Python). I download Z3 v4.3.1, I installed clang v2.9 using Macports-2.1.2 and finally, when I run for Z3
>autoconf
>./configure CXX=clang++
>python scripts/mk_make.py
>cd build
>make
I obtained:
src/shell/datalog_frontend.cpp
make: clang++: Command not found
make: *** [shell/datalog_frontend.o] Error 127
Since clang++ is in /opt/local/libexec/llvm-2.9/bin
I am not able to understand what it is happening and how to solve it. I really appreciate whatever hint because after two days trying I have not find any solution.
I just tried to replicate this error report, but I was unable to do so. Z3 builds just fine with CXX=clang++ on my machine. I can only suspect that your clang++, while it may be installed, is not in the path. For instance, simply running clang++ in the console would throw the same "command not found" error. Perhaps this could be fixed by simply running
export PATH=$PATH:/opt/local/libexec/llvm-2.9/bin
before attempting compilation. However, I suspect there would be more issues with libraries not being found after that.
I could imagine that something went wrong during the installation via MacPorts, e.g., that it requires modifications to various environment variables which are not done automatically.
As Nuno suggests, XCode (with CLI tools) may be much easier to use and they should be available for free in the AppStore.
You should install XCode CLI tools instead. It already includes an up-to-date version of clang (2.9 is very old).
I think both XCode and XCode CLI tools are free on Appstore and/or apple developer center.

Setting environment variables to compile node on Mountain Lion with XCode4.4

After upgrading to Mountain Lion (10.8) and XCode 4.4, and installing the XCode Command Line utilities from the XCode Preferences pane, I was unable to compile node.js (0.8.5) from source. Specifically, the configure script believed that I did not have a C compiler installed.
It looks to me like the environment variables required for the command line tools were lost somewhere along the way.
I tried sudo xcode-select --switch /Applications/Xcode.app but this did not appear to clear up the problem.
I had to perform these steps to make the node build system happy:
export PATH=$PATH:/Applications/Xcode.app/Contents/Developer/usr/bin
export CC='gcc --sysroot=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/'
export CXX='g++ --sysroot=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/'
After that I was able to compile and link.
So... why did I have to do this? Am I missing some easy step that could have done this for me automatically? Or am I in some bad state because I installed XCode before upgrading to Mountain Lion, and the XCode updater went off the rails?
Once you've updated to Mountain Lion and updated XCode 4.4, you have to reinstall the command line tools inside XCode.
Go to XCode/Preferences/Downloads/Components and click install on "Command Line Tools" and once it has downloaded and installed, you should once again have gcc and g++ in your (normal) path.
The correct thing to do was to reinstall the command-line tools from inside Xcode.
This was temporarily impossible because a malformed download list was being served by Apple, but the problem was fixed. The malformation was detectable by inspecting the output from Xcode in Console.
Once the tools were reinstalled, compilation worked normally.
http://docwiki.embarcadero.com/RADStudio/XE4/en/Installing_the_Xcode_Command_Line_Tools_on_a_Mac
Please refer the above link and try to install command line from apple developer portals

Problem installing node on Mac OSX 10.6.7

I'm getting this error when I try and install node on my new mac
error: could not configure a cxx compiler!
The error always occurs when I get to the ./configure part of the installation
I found this problem which applies to a linux build with the same error, but the solution does not seem to apply in my case:
How to compile/install node.js(could not configure a cxx compiler!) (Ubuntu).
I also took a look at the troubleshoot guide on the node wiki here:
https://github.com/joyent/node/wiki/Troubleshooting-Installation
and tried this solution:
export PATH=/Developer/usr/bin:$PATH
ISYSROOT="-isysroot /Developer/SDKs/MacOSX10.5.sdk"
export LINKFLAGS=$ISYSROOT CXXFLAGS=$ISYSROOT CFLAGS=$ISYSROOT
./configure --prefix=$HOME --without-ssl
make
But I get the same problem when I get to the ./configure step
Any advice, insights or help would be much appreciated here.
Thanks
When you install Mac OS X Developer Tools (XCode, etc) ensure you have the Unix Tools option checked. I had to remember to install Developer Tools/Unix tools when I set up my new MBP and it resolved this error for me.
Optionally, you could remove and try installing with Homebrew. However, it still has the same requirements (XCode/Dev Tools) so ensure that you have those installed.
Hope this helps.
I had this problem too, I resolved this in a different way, as far as I know xcode 4.3.1 doesnt come with an Install Xcode.app file from the appstore, if you are under this case, just run xcode, go to preferences -> downloads and click on the Install button for the command line tools option. I did just that and all the errors on the .configure and make commands were gone :)
I had the same problem on OSX 10.7 with Xcode 4.2. I was trying to build node v0.4.7. I kept getting "unable to configure a c compiler" error. What finally worked for me is installing the GCC compiler seperately. I found a nice package for that here:
https://github.com/kennethreitz/osx-gcc-installer/
configure is currently broken for some versions of MacOS; for more details, see How to compile Node.js v0.4.2 on MacOS 10.5.8. The working approach cited there is as follows:
export PATH=/Developer/usr/bin:$PATH
ISYSROOT="-isysroot /Developer/SDKs/MacOSX10.5.sdk"
export LINKFLAGS=$ISYSROOT CXXFLAGS=$ISYSROOT CFLAGS=$ISYSROOT
./configure --prefix=$HOME --without-ssl
make
This worked for me .
Al
After installing XCode 4.3.2 (in Mac OS X Lion) I still had the error.
Open XCode, Preferences, Downloads and installed Command Line Tools.
After it gets installed ./configure runs ok.

Resources