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

【MAC】build failed #156

Closed
dandingol03 opened this issue Dec 28, 2021 · 2 comments
Closed

【MAC】build failed #156

dandingol03 opened this issue Dec 28, 2021 · 2 comments

Comments

@dandingol03
Copy link

OS: Mac big sur
python version: 2.7.16

log as below:

Checking for Qt 5.x... yes
Checking for clang++ ...no
Could not compile a simple C++ fragment, verify that clang++ is installed! This could also mean that the Boost libraries are missing. The file "config.log" should contain more information.

In file included from .sconf_temp/conftest_0.cpp:1:
In file included from /usr/local/opt/llvm@9/bin/../include/c++/v1/sstream:173:
In file included from /usr/local/opt/llvm@9/bin/../include/c++/v1/ostream:138:
In file included from /usr/local/opt/llvm@9/bin/../include/c++/v1/ios:215:
In file included from /usr/local/opt/llvm@9/bin/../include/c++/v1/__locale:14:
In file included from /usr/local/opt/llvm@9/bin/../include/c++/v1/string:504:
In file included from /usr/local/opt/llvm@9/bin/../include/c++/v1/string_view:175:
In file included from /usr/local/opt/llvm@9/bin/../include/c++/v1/__string:56:
In file included from /usr/local/opt/llvm@9/bin/../include/c++/v1/algorithm:643:
In file included from /usr/local/opt/llvm@9/bin/../include/c++/v1/memory:667:
In file included from /usr/local/opt/llvm@9/bin/../include/c++/v1/atomic:553:
dependencies/version:1:1: error: expected unqualified-id
0.6.0
^
In file included from .sconf_temp/conftest_0.cpp:1:
In file included from /usr/local/opt/llvm@9/bin/../include/c++/v1/sstream:173:
In file included from /usr/local/opt/llvm@9/bin/../include/c++/v1/ostream:138:
In file included from /usr/local/opt/llvm@9/bin/../include/c++/v1/ios:215:
In file included from /usr/local/opt/llvm@9/bin/../include/c++/v1/__locale:14:
In file included from /usr/local/opt/llvm@9/bin/../include/c++/v1/string:504:
In file included from /usr/local/opt/llvm@9/bin/../include/c++/v1/string_view:175:
In file included from /usr/local/opt/llvm@9/bin/../include/c++/v1/__string:56:
In file included from /usr/local/opt/llvm@9/bin/../include/c++/v1/algorithm:643:
In file included from /usr/local/opt/llvm@9/bin/../include/c++/v1/memory:667:
/usr/local/opt/llvm@9/bin/../include/c++/v1/atomic:1019:73: error: unknown type name 'ptrdiff_t'
_Tp* __cxx_atomic_fetch_add(__cxx_atomic_base_impl<_Tp*> volatile* __a, ptrdiff_t __delta, memory_order __order) _NOEXCEPT {
                                                                        ^
/usr/local/opt/llvm@9/bin/../include/c++/v1/atomic:1024:65: error: unknown type name 'ptrdiff_t'
_Tp* __cxx_atomic_fetch_add(__cxx_atomic_base_impl<_Tp*> * __a, ptrdiff_t __delta, memory_order __order) _NOEXCEPT {
                                                                ^
/usr/local/opt/llvm@9/bin/../include/c++/v1/atomic:1040:73: error: unknown type name 'ptrdiff_t'
_Tp* __cxx_atomic_fetch_sub(__cxx_atomic_base_impl<_Tp*> volatile* __a, ptrdiff_t __delta, memory_order __order) _NOEXCEPT {
                                                                        ^
/usr/local/opt/llvm@9/bin/../include/c++/v1/atomic:1045:65: error: unknown type name 'ptrdiff_t'
_Tp* __cxx_atomic_fetch_sub(__cxx_atomic_base_impl<_Tp*> * __a, ptrdiff_t __delta, memory_order __order) _NOEXCEPT {
                                                                ^
/usr/local/opt/llvm@9/bin/../include/c++/v1/atomic:1679:20: error: unknown type name 'ptrdiff_t'
    _Tp* fetch_add(ptrdiff_t __op, memory_order __m = memory_order_seq_cst)
                   ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
scons: Configure: no


@wenjian-zhou
Copy link

I have the same problem like you, did you fix it?

merlinND added a commit that referenced this issue May 2, 2022
Fixes a header naming conflict on macOS (issue #156).
@merlinND
Copy link
Member

merlinND commented May 2, 2022

Hi,

After digging a little, it seems that on macOS, the following header include:

#include <version>

accidentally resolves to dependencies/version.
A quick workaround is to rename it to dependencies/version.txt, and update SConscript.configure to refer to the new filename:

diff --git a/build/SConscript.configure b/build/SConscript.configure
index baca8b74..c98f0345 100644
--- a/build/SConscript.configure
+++ b/build/SConscript.configure
@@ -281,7 +281,7 @@ else:
 Export('MTS_VERSION')
 
 if needsBuildDependencies:
-        versionFilename = GetBuildPath('#dependencies/version')
+        versionFilename = GetBuildPath('#dependencies/version.txt')
         versionMismatch = False
 
         if not os.path.exists(versionFilename):

I'm opening a couple of PRs to integrate those changes.

By the way, in case you're using the scons-python3 branch, I've just updated it to stop using has_key method which was removed. I tested it with SCons 4.3.0.

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

No branches or pull requests

3 participants