Skip to content
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

Failure to build on OSX with self-compiled clang #608

Closed
cuavas opened this issue Feb 5, 2017 · 7 comments
Closed

Failure to build on OSX with self-compiled clang #608

cuavas opened this issue Feb 5, 2017 · 7 comments

Comments

@cuavas
Copy link

cuavas commented Feb 5, 2017

When building on OSX using self-compiled clang or a clang package from MacPorts, glm gets the following kind of build errors (using clang 3.9.1):

glm/glm/detail/../simd/platform.h:157:5: error: "GLM requires Clang 3.4 / Apple Clang 6.0 or higher"
#                       error "GLM requires Clang 3.4 / Apple Clang 6.0 or higher"

The issue is that these kinds of clang builds use standard clang numbers rather than Apple's inflated clang version numbers. I'm not sure whether it's possible to detect this using the preprocessor, and __APPLE_CC__ and __APPLE__ macros are still defined.

Would it be possible to provide a mechanism to hint that clang is using standard version numbers on OSX? I don't mind if I have to define another macro, like GLM_MACPORTS_COMPILER or something.

@Groovounet
Copy link
Member

Isn't it a MacPorts bug? I was looking at Clang 3.9.1 source but couldn't find a define to detect the version selection. It looks like the version is baked by CMake at build configuration. Or am I missing something?

@cuavas
Copy link
Author

cuavas commented Feb 9, 2017

Well, MacPorts clang or self-compiled clang are not Apple clang, so they use regular clang version numbers. I just want a macro or something that I can define to tell glm that I'm using regular clang with regular version numbers on Mac, not Apple clang, so the version detection doesn't tell me I have an unsupported compiler.

@Groovounet
Copy link
Member

I am just saying that the Apple or regular version is baked in Clang build system so I don't really understand how MacPorts clang ends up with a different version.

@Groovounet
Copy link
Member

Hi @jeremyhu, it looks like that you are the maintainer of MacPorts Clang. It looks like you are using the regular version of Clang in MacPorts Clang. Do you know whether there is a way to detect (using a define?) whether the Clang compiler used is the one from XCode or the regular one? This is causing issues with GLM...

@cuavas, a quick workaround should be for you to define GLM_FORCE_COMPILER_UNKNOWN before including GLM.

Thanks,
Christophe

@jeremyhu
Copy link

jeremyhu commented Feb 10, 2017

I'm not sure how official it is, but __apple_build_version__ should do the trick for you.

@Groovounet
Copy link
Member

Thanks @jeremyhu for the tip!
@cuavas this issue should be fixed in GLM 0.9.8 (for GLM 0.9.8.5 release) and master branches, it would be great if you could confirm the fix.

Thanks for contributing,
Christophe

@cuavas
Copy link
Author

cuavas commented Feb 25, 2017

Confirmed fixed. Thanks.

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

No branches or pull requests

3 participants