New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cmake Xcode generated project fails to build using most recent cmake 2.8.12.0 #37

Closed
ArEnSc opened this Issue Dec 25, 2013 · 12 comments

Comments

Projects
None yet
2 participants
@ArEnSc

ArEnSc commented Dec 25, 2013

The reason why I would like to build using xcode is so I can hack the source from within the editor. I can get it to build via the instructions just fine but I would like have nicer debug tools available.
Using an out of source build
cmake version 2.8.12
Apple LLVM version 5.0 (clang-500.2.79) (based on LLVM 3.3svn)
Target: x86_64-apple-darwin13.0.0
Thread model: posix

The build.sh

sudo rm -rf build
mkdir build
cd build
cmake .. -G Xcode
-DTARGET_DESKTOP_GLES=ON
-DCMAKE_INSTALL_PREFIX=/usr
-DWITH_SDL2APPLICATION=ON
-DWITH_MESHTOOLS=ON
-DWITH_PRIMITIVES=ON
-DWITH_SCENEGRAPH=ON
-DWITH_SHADERS=ON
-DWITH_SHAPES=ON
-DWITH_TEXT=ON \

-- The C compiler identification is Clang 5.0.0
-- The CXX compiler identification is Clang 5.0.0
-- Check for working C compiler using: Xcode
-- Check for working C compiler using: Xcode -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler using: Xcode
-- Check for working CXX compiler using: Xcode -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Found Corrade: /usr/lib/libCorradeUtility.dylib
-- Found OpenGL: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/System/Library/Frameworks/OpenGL.framework
-- LIB_SUFFIX variable is not defined. It will be autodetected now.
-- You can set it manually with -DLIB_SUFFIX= (64 for example)
-- LIB_SUFFIX autodetected as '', libraries will be installed into /usr/lib
-- Found SDL2: /Library/Frameworks/SDL2.framework
-- Configuring done
-- Generating done
cd build
xcodebuild -version
Xcode 5.0.2
Build version 5A3005
sudo xcodebuild -target install build
The lengthy log here.
http://pastebin.com/W3F8TWnX
/// ends here
The following build commands failed:
Ld build/src/MeshTools/Debug/libMagnumMeshTools.dylib normal x86_64
The I am not sure why this is an issue anyone have a clue?

@mosra

This comment has been minimized.

Show comment
Hide comment
@mosra

mosra Dec 25, 2013

Owner

/opt/local/bin/cmake -E cmake_symlink_library /Users/michaelchung/CodeWorkSpaces/XCodeWorkSpace/Projects/magnum/build/src/Debug/libMagnum.dylib /Users/michaelchung/CodeWorkSpaces/XCodeWorkSpace/Projects/magnum/build/src/Debug/libMagnum.dylib /Users/michaelchung/CodeWorkSpaces/XCodeWorkSpace/Projects/magnum/build/src/Debug/libMagnum.dylib

This looks like CMake is trying to symlink a file to itself, but I have no idea why it would try to do that. It then complains about nonexistent /Users/michaelchung/CodeWorkSpaces/XCodeWorkSpace/Projects/magnum/build/src/Debug/libMagnum.dylib, thus there is really something wrong with that file.

Google search did not found anything particularly helpful, most of the issues related to cmake_symlink_library were related either to insufficient permissions (which is not the case here) or to incapable filesystem. Is it possible that you have a filesystem which doesn't support symlinks (some shared drive, FAT or similar)?

In case this is really a problem with CMake creating circular symlink (which would be shameful), the workaround would be to set some library version (so it would then link libMagnum.dylib.0.1.0 to libMagnum.dylib.0 to libMagnum.dylib), but I hope this is not needed.

Owner

mosra commented Dec 25, 2013

/opt/local/bin/cmake -E cmake_symlink_library /Users/michaelchung/CodeWorkSpaces/XCodeWorkSpace/Projects/magnum/build/src/Debug/libMagnum.dylib /Users/michaelchung/CodeWorkSpaces/XCodeWorkSpace/Projects/magnum/build/src/Debug/libMagnum.dylib /Users/michaelchung/CodeWorkSpaces/XCodeWorkSpace/Projects/magnum/build/src/Debug/libMagnum.dylib

This looks like CMake is trying to symlink a file to itself, but I have no idea why it would try to do that. It then complains about nonexistent /Users/michaelchung/CodeWorkSpaces/XCodeWorkSpace/Projects/magnum/build/src/Debug/libMagnum.dylib, thus there is really something wrong with that file.

Google search did not found anything particularly helpful, most of the issues related to cmake_symlink_library were related either to insufficient permissions (which is not the case here) or to incapable filesystem. Is it possible that you have a filesystem which doesn't support symlinks (some shared drive, FAT or similar)?

In case this is really a problem with CMake creating circular symlink (which would be shameful), the workaround would be to set some library version (so it would then link libMagnum.dylib.0.1.0 to libMagnum.dylib.0 to libMagnum.dylib), but I hope this is not needed.

@mosra

This comment has been minimized.

Show comment
Hide comment
@mosra

mosra Dec 25, 2013

Owner

I tried to dig deeper and it seems that this might actually be a bug in CMake 2.8.12, which added shared library versioning for XCode. Could you please try building with CMake 2.8.11, if possible?

Owner

mosra commented Dec 25, 2013

I tried to dig deeper and it seems that this might actually be a bug in CMake 2.8.12, which added shared library versioning for XCode. Could you please try building with CMake 2.8.11, if possible?

@ArEnSc

This comment has been minimized.

Show comment
Hide comment
@ArEnSc

ArEnSc Dec 25, 2013

I will try it out and hopefully not run into the xcode5 support issues that occurred with version 11 or 10, and let you know.

ArEnSc commented Dec 25, 2013

I will try it out and hopefully not run into the xcode5 support issues that occurred with version 11 or 10, and let you know.

@ArEnSc ArEnSc closed this Dec 26, 2013

@mosra

This comment has been minimized.

Show comment
Hide comment
@mosra

mosra Dec 26, 2013

Owner

Okay, so does it work with 2.8.11 or not?

Owner

mosra commented Dec 26, 2013

Okay, so does it work with 2.8.11 or not?

@ArEnSc

This comment has been minimized.

Show comment
Hide comment
@ArEnSc

ArEnSc Dec 26, 2013

I am going to test this sometime today. It is hard to    test this because darwin ports only has 2.8.10.1 and 2.8.10.2 and then 2.8.12.0 I am going to look for the binaries sometime today when I have a stable internet connection. From: Vladimír VondrušSent: Thursday, December 26, 2013 12:21 PMTo: mosra/magnumReply To: mosra/magnumCc: ArEnScSubject: Re: [magnum] Cmake Xcode generated project fails to build using most recent cmake 2.8.12.0 (#37)Okay, so does it work with 2.8.11 or not?

—Reply to this email directly or view it on GitHub.

ArEnSc commented Dec 26, 2013

I am going to test this sometime today. It is hard to    test this because darwin ports only has 2.8.10.1 and 2.8.10.2 and then 2.8.12.0 I am going to look for the binaries sometime today when I have a stable internet connection. From: Vladimír VondrušSent: Thursday, December 26, 2013 12:21 PMTo: mosra/magnumReply To: mosra/magnumCc: ArEnScSubject: Re: [magnum] Cmake Xcode generated project fails to build using most recent cmake 2.8.12.0 (#37)Okay, so does it work with 2.8.11 or not?

—Reply to this email directly or view it on GitHub.

@mosra

This comment has been minimized.

Show comment
Hide comment
@mosra

mosra Dec 26, 2013

Owner

No need to rush :-) Thank you very much for looking into this.

Anyway, I'll keep this bug open until this CMake bug is fixed or worked around.

Owner

mosra commented Dec 26, 2013

No need to rush :-) Thank you very much for looking into this.

Anyway, I'll keep this bug open until this CMake bug is fixed or worked around.

@mosra mosra reopened this Dec 26, 2013

@ArEnSc

This comment has been minimized.

Show comment
Hide comment
@ArEnSc

ArEnSc Dec 27, 2013

I have tried 2.8.11.2 It still fails in the exact same way. I guess ill be using sublime text 2 to edit.

ArEnSc commented Dec 27, 2013

I have tried 2.8.11.2 It still fails in the exact same way. I guess ill be using sublime text 2 to edit.

@mosra

This comment has been minimized.

Show comment
Hide comment
@mosra

mosra Dec 29, 2013

Owner

Can you please try this patch if it fixes the issue? https://gist.github.com/mosra/2d133eb5ced36f4f92ce (apply with git apply xcode.patch). I hope this works, since the same thing is done in Corrade and it appears to be working flawlessly with XCode.

If the patch helps, I'll commit it to master and mark this issue as resolved (although this is only a workaround and the CMake bug still needs to be fixed).

Owner

mosra commented Dec 29, 2013

Can you please try this patch if it fixes the issue? https://gist.github.com/mosra/2d133eb5ced36f4f92ce (apply with git apply xcode.patch). I hope this works, since the same thing is done in Corrade and it appears to be working flawlessly with XCode.

If the patch helps, I'll commit it to master and mark this issue as resolved (although this is only a workaround and the CMake bug still needs to be fixed).

@ArEnSc

This comment has been minimized.

Show comment
Hide comment
@ArEnSc

ArEnSc Dec 31, 2013

== BUILD TARGET Magnum OF PROJECT Magnum WITH THE DEFAULT CONFIGURATION (Debug) ===

Check dependencies

PhaseScriptExecution CMake\ PostBuild\ Rules build/src/Magnum.build/Debug/Magnum.build/Script-FF41B1CE2D984D36819F1BCA.sh
cd /Users/michaelchung/CodeWorkSpaces/XCodeWorkSpace/Projects/magnum
/bin/sh -c /Users/michaelchung/CodeWorkSpaces/XCodeWorkSpace/Projects/magnum/build/src/Magnum.build/Debug/Magnum.build/Script-FF41B1CE2D984D36819F1BCA.sh
echo "Creating symlinks"
Creating symlinks
/Applications/CMake\ 2.8-12.app/Contents/bin/cmake -E cmake_symlink_library /Users/michaelchung/CodeWorkSpaces/XCodeWorkSpace/Projects/magnum/build/src/Debug/libMagnum.0.1.dylib /Users/michaelchung/CodeWorkSpaces/XCodeWorkSpace/Projects/magnum/build/src/Debug/libMagnum.0.dylib /Users/michaelchung/CodeWorkSpaces/XCodeWorkSpace/Projects/magnum/build/src/Debug/libMagnum.dylib
CMake Error: cmake_symlink_library: System Error: No such file or directory
CMake Error: cmake_symlink_library: System Error: No such file or directory
make: *** [Magnum_buildpart_0] Error 1

** BUILD FAILED **

The following build commands failed:
PhaseScriptExecution CMake\ PostBuild\ Rules build/src/Magnum.build/Debug/Magnum.build/Script-FF41B1CE2D984D36819F1BCA.sh
(1 failure)

Different issue but were getting somewhere.

ArEnSc commented Dec 31, 2013

== BUILD TARGET Magnum OF PROJECT Magnum WITH THE DEFAULT CONFIGURATION (Debug) ===

Check dependencies

PhaseScriptExecution CMake\ PostBuild\ Rules build/src/Magnum.build/Debug/Magnum.build/Script-FF41B1CE2D984D36819F1BCA.sh
cd /Users/michaelchung/CodeWorkSpaces/XCodeWorkSpace/Projects/magnum
/bin/sh -c /Users/michaelchung/CodeWorkSpaces/XCodeWorkSpace/Projects/magnum/build/src/Magnum.build/Debug/Magnum.build/Script-FF41B1CE2D984D36819F1BCA.sh
echo "Creating symlinks"
Creating symlinks
/Applications/CMake\ 2.8-12.app/Contents/bin/cmake -E cmake_symlink_library /Users/michaelchung/CodeWorkSpaces/XCodeWorkSpace/Projects/magnum/build/src/Debug/libMagnum.0.1.dylib /Users/michaelchung/CodeWorkSpaces/XCodeWorkSpace/Projects/magnum/build/src/Debug/libMagnum.0.dylib /Users/michaelchung/CodeWorkSpaces/XCodeWorkSpace/Projects/magnum/build/src/Debug/libMagnum.dylib
CMake Error: cmake_symlink_library: System Error: No such file or directory
CMake Error: cmake_symlink_library: System Error: No such file or directory
make: *** [Magnum_buildpart_0] Error 1

** BUILD FAILED **

The following build commands failed:
PhaseScriptExecution CMake\ PostBuild\ Rules build/src/Magnum.build/Debug/Magnum.build/Script-FF41B1CE2D984D36819F1BCA.sh
(1 failure)

Different issue but were getting somewhere.

@mosra

This comment has been minimized.

Show comment
Hide comment
@mosra

mosra Jan 2, 2014

Owner

Huh, okay, so the bug is somewhere else than I thought. It looks to me that CMake isn't able to properly generate build commands for Magnum library (which is composed only of OBJECT libraries and not any source files) and thus the library file is not create at all. Could you please try this patch instead? https://gist.github.com/mosra/68e26fdb8d1cd721f807 This is only a dirty hack and I'll fix work around the issue properly, if it works. Thanks again.

Owner

mosra commented Jan 2, 2014

Huh, okay, so the bug is somewhere else than I thought. It looks to me that CMake isn't able to properly generate build commands for Magnum library (which is composed only of OBJECT libraries and not any source files) and thus the library file is not create at all. Could you please try this patch instead? https://gist.github.com/mosra/68e26fdb8d1cd721f807 This is only a dirty hack and I'll fix work around the issue properly, if it works. Thanks again.

@ArEnSc

This comment has been minimized.

Show comment
Hide comment
@ArEnSc

ArEnSc Jan 4, 2014

The patch worked!!! thanks!

ArEnSc commented Jan 4, 2014

The patch worked!!! thanks!

@mosra

This comment has been minimized.

Show comment
Hide comment
@mosra

mosra Jan 4, 2014

Owner

Glad the issue is finally solved. The proper fix is in 24f7de8, please reopen if you still encounter the problem.

Owner

mosra commented Jan 4, 2014

Glad the issue is finally solved. The proper fix is in 24f7de8, please reopen if you still encounter the problem.

@mosra mosra closed this Jan 4, 2014

mosra added a commit that referenced this issue Jan 5, 2016

Math: fix test compilation on XCode.
See file comment for details. Yet another instance of the problem described
in #37.

@mosra mosra added this to the 2014.01 milestone Feb 15, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment