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

Build failure OSX #10

Closed
skaller opened this issue Aug 5, 2018 · 16 comments
Closed

Build failure OSX #10

skaller opened this issue Aug 5, 2018 · 16 comments

Comments

@skaller
Copy link

skaller commented Aug 5, 2018

Hi I get this with easy build, I'm using a brew installed clang 6.01 on OSX 10.12.1 (Sierra).

I suspect there's a mismatch between the brew installed compiler and the Xcode supplied libraries. Not sure why clang++ isn't using its own libraries.

~/filament>./build.sh -j release
Building release in out/cmake-release...
[45/807] Building CXX object libs/utils/CMakeFiles/test_utils.dir/test/test_Zip2Iterator.cpp.o
FAILED: libs/utils/CMakeFiles/test_utils.dir/test/test_Zip2Iterator.cpp.o
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++  -DFILAMENT_DRIVER_SUPPORTS_VULKAN -I../../libs/utils/include -I../../third_party/libgtest/tnt/../include -I../../third_party/robin-map/tnt/.. -I../../libs/math/include -std=c++14 -fstrict-aliasing -Wno-unknown-pragmas -Wno-unused-function -fcolor-diagnostics -O3 -DNDEBUG -fomit-frame-pointer -ffunction-sections -fdata-sections -MD -MT libs/utils/CMakeFiles/test_utils.dir/test/test_Zip2Iterator.cpp.o -MF libs/utils/CMakeFiles/test_utils.dir/test/test_Zip2Iterator.cpp.o.d -o libs/utils/CMakeFiles/test_utils.dir/test/test_Zip2Iterator.cpp.o -c ../../libs/utils/test/test_Zip2Iterator.cpp
In file included from ../../libs/utils/test/test_Zip2Iterator.cpp:17:
In file included from ../../third_party/libgtest/tnt/../include/gtest/gtest.h:55:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/ostream:138:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/ios:216:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__locale:15:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/string:439:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/algorithm:627:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/utility:280:38: error: no type named 'type' in 'std::__1::enable_if<false, void>'; 'enable_if' cannot be used to disable this declaration
                 ,typename enable_if<is_convertible<const _U1&, _T1>::value &&
                                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../libs/utils/include/utils/Zip2Iterator.h:42:38: note: in instantiation of member function 'std::__1::pair<int &, int &>::pair' requested here
        using std::pair<Ref1, Ref2>::pair;
                                     ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/algorithm:3746:20: note: while substituting deduced template arguments into function template 'Ref' [with _U1 = int, _U2 = int]
            *__j = _VSTD::move(__t);
                   ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__config:397:15: note: expanded from macro '_VSTD'
#define _VSTD std::_LIBCPP_NAMESPACE
              ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/algorithm:3870:20: note: in instantiation of function template specialization 'std::__1::__insertion_sort_3<(lambda at ../../libs/utils/test/test_Zip2Iterator.cpp:43:21) &, utils::Zip2Iterator<int *, int *> >' requested here
            _VSTD::__insertion_sort_3<_Compare>(__first, __last, __comp);

(and lots more).

@romainguy
Copy link
Collaborator

I would recommend you stick with Xcode's clang instead. We don't test with MacPort or HomeBrew installed compilers and we don't really intend to (we don't have the bandwidth unfortunately). It definitely looks like a mismatch between the compiler and the standard libraries (we've seen similar issues on Linux between gcc and clang).

What do you get when running c++ --version? Mine gives the following on High Sierra:

Apple LLVM version 9.1.0 (clang-902.0.39.2)
Target: x86_64-apple-darwin17.7.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

@skaller
Copy link
Author

skaller commented Aug 5, 2018

I get this:

~/filament>/usr/bin/clang --version
Apple LLVM version 8.0.0 (clang-800.0.42.1)
Target: x86_64-apple-darwin16.1.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

And the same for saying c++ --version. However I forced links in /usr/local/bin to the homebrew installed clang version 6 because my own code does not support specified compilers.
I'm using the brew version because it supports more recent C++ (C++17 in particular) which I want to use in my own project. My project builds fine with both compilers at the moment but I will be adding C++14 and C++17 code which won't build on the Sierra compiler.

Is there a way to tell the filament build script to use /usr/bin/clang and /usr/bin/clang++ instead of the one on the PATH?

@romainguy
Copy link
Collaborator

You can try to export CC=/usr/bin/clang and export CXX=/usr/bin/clang++ before running the script. It should instruct CMake to use these compilers instead.

@skaller
Copy link
Author

skaller commented Aug 5, 2018

Same problem.

@romainguy
Copy link
Collaborator

romainguy commented Aug 5, 2018

Did you nuke the cmake directory first? (Just checking, I can't think of what else the problem could be)

@romainguy
Copy link
Collaborator

You could just remove the tests from libs/utils/CMakeLists.txt in the meantime

@skaller
Copy link
Author

skaller commented Aug 5, 2018

Nope. I will try that... same problem. I will try upgrading to High Sierra, should provide newer clang?

@skaller
Copy link
Author

skaller commented Aug 5, 2018

[BTW thanks for prompt support!]

@romainguy
Copy link
Collaborator

Upgrading to High Sierra should definitely fix it. I've compiled Filament myself on 4 different MacPros/MacBook Pros and they all work properly with High Sierra installed. I wish I could help you more but it's hard without a machine that reproduces the issue.

@skaller
Copy link
Author

skaller commented Aug 5, 2018

Its hard even with a machine. I run Linux and Windows 10 Summer as well. C++ has become a real pain. With clang 6, I get linker warnings building my code. Its not my code, its clang's library. Sigh.

Also the brew Caveats are a bit confusing.

==> Caveats
To use the bundled libc++ please add the following LDFLAGS:
  LDFLAGS="-L/usr/local/opt/llvm/lib -Wl,-rpath,/usr/local/opt/llvm/lib"

This formula is keg-only, which means it was not symlinked into /usr/local,
because macOS already provides this software and installing another version in
parallel can cause all kinds of trouble.

If you need to have this software first in your PATH run:
  echo 'export PATH="/usr/local/opt/llvm/bin:$PATH"' >> ~/.bash_profile

For compilers to find this software you may need to set:
    LDFLAGS:  -L/usr/local/opt/llvm/lib
    CPPFLAGS: -I/usr/local/opt/llvm/include

I cannot add flags to compilation lines at the moment. The compilation lines are hard coded into binaries. Environment variables are fine. I don't know what it means "add the following LDFLAGS". Add what to what? Even the export hint above is wrong. That only finds clang-6 and clang++-6, not clang and clang++ which is what my code looks for. Hence the symlinks to hide the system compiler. Which works fine with my software (except for a visibility bug in the C++ library).

@skaller
Copy link
Author

skaller commented Aug 5, 2018

So I have High Sierra now. Installed Xcode tools. Same error.

Apple LLVM version 8.0.0 (clang-800.0.42.1)
Target: x86_64-apple-darwin17.7.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
~/felix>cd ..
~>cd filament/
~/filament>rm -rf out
~/filament>./build.sh -j release
Building release in out/cmake-release...
-- The C compiler identification is AppleClang 8.0.0.8000042
-- The CXX compiler identification is AppleClang 8.0.0.8000042
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- The ASM compiler identification is AppleClang
-- Found assembler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc
-- Found PythonInterp: /usr/local/bin/python (found version "2.7.14")
-- SPIR-V optimizer enabled
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/skaller/filament/out/cmake-release
[31/845] Building CXX object libs/util...utils.dir/test/test_Zip2Iterator.cpp.o
FAILED: libs/utils/CMakeFiles/test_utils.dir/test/test_Zip2Iterator.cpp.o
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++  -DFILAMENT_DRIVER_SUPPORTS_VULKAN -I../../libs/utils/include -I../../third_party/libgtest/tnt/../include -I../../third_party/robin-map/tnt/.. -I../../libs/math/include -std=c++14 -fstrict-aliasing -Wno-unknown-pragmas -Wno-unused-function -fcolor-diagnostics -O3 -DNDEBUG -fomit-frame-pointer -ffunction-sections -fdata-sections -MD -MT libs/utils/CMakeFiles/test_utils.dir/test/test_Zip2Iterator.cpp.o -MF libs/utils/CMakeFiles/test_utils.dir/test/test_Zip2Iterator.cpp.o.d -o libs/utils/CMakeFiles/test_utils.dir/test/test_Zip2Iterator.cpp.o -c ../../libs/utils/test/test_Zip2Iterator.cpp
In file included from ../../libs/utils/test/test_Zip2Iterator.cpp:17:
In file included from ../../third_party/libgtest/tnt/../include/gtest/gtest.h:55:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/ostream:138:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/ios:216:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__locale:15:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/string:439:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/algorithm:627:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/utility:280:38: error: no type named 'type' in 'std::__1::enable_if<false, void>'; 'enable_if' cannot be used to disable this declaration
                 ,typename enable_if<is_convertible<const _U1&, _T1>::value &&
                                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../libs/utils/include/utils/Zip2Iterator.h:42:38: note: in instantiation of member function 'std::__1::pair<int &, int &>::pair' requested here
        using std::pair<Ref1, Ref2>::pair;
                                     ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/algorithm:3746:20: note: while substituting deduced template arguments into function template 'Ref' [with _U1 = int, _U2 = int]
            *__j = _VSTD::move(__t);
                   ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__config:397:15: note: expanded from macro '_VSTD'
#define _VSTD std::_LIBCPP_NAMESPACE
              ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/algorithm:3870:20: note: in instantiation of function template specialization 'std::__1::__insertion_sort_3<(lambda at ../../libs/utils/test/test_Zip2Iterator.cpp:43:21) &, utils::Zip2Iterator<int *, int *> >' requested here
            _VSTD::__insertion_sort_3<_Compare>(__first, __last, __comp);
                   ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/algorithm:4041:5: note: in instantiation of function template specialization 'std::__1::__sort<(lambda at ../../libs/utils/test/test_Zip2Iterator.cpp:43:21) &, utils::Zip2Iterator<int *, int *> >' requested here
    __sort<_Comp_ref>(__first, __last, __comp);
    ^
../../libs/utils/test/test_Zip2Iterator.cpp:43:10: note: in instantiation of function template specialization 'std::__1::sort<utils::Zip2Iterator<int *, int *>, (lambda at ../../libs/utils/test/test_Zip2Iterator.cpp:43:21)>' requested here
    std::sort(b, e, [](auto const& lhs, auto const& rhs) { return lhs.second < rhs.second; });
         ^
In file included from ../../libs/utils/test/test_Zip2Iterator.cpp:17:
In file included from ../../third_party/libgtest/tnt/../include/gtest/gtest.h:55:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/ostream:138:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/ios:216:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__locale:15:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/string:439:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/algorithm:627:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/utility:324:37: error: no type named 'type' in 'std::__1::enable_if<false, void>'; 'enable_if' cannot be used to disable this declaration
                 typename enable_if<is_convertible<_U1, _T1>::value &&
                                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../libs/utils/include/utils/Zip2Iterator.h:42:38: note: in instantiation of member function 'std::__1::pair<int &, int &>::pair' requested here
        using std::pair<Ref1, Ref2>::pair;
                                     ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/algorithm:3746:20: note: while substituting deduced template arguments into function template 'Ref' [with _U1 = int, _U2 = int]
            *__j = _VSTD::move(__t);
                   ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__config:397:15: note: expanded from macro '_VSTD'
#define _VSTD std::_LIBCPP_NAMESPACE
              ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/algorithm:3870:20: note: in instantiation of function template specialization 'std::__1::__insertion_sort_3<(lambda at ../../libs/utils/test/test_Zip2Iterator.cpp:43:21) &, utils::Zip2Iterator<int *, int *> >' requested here
            _VSTD::__insertion_sort_3<_Compare>(__first, __last, __comp);
                   ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/algorithm:4041:5: note: in instantiation of function template specialization 'std::__1::__sort<(lambda at ../../libs/utils/test/test_Zip2Iterator.cpp:43:21) &, utils::Zip2Iterator<int *, int *> >' requested here
    __sort<_Comp_ref>(__first, __last, __comp);
    ^
../../libs/utils/test/test_Zip2Iterator.cpp:43:10: note: in instantiation of function template specialization 'std::__1::sort<utils::Zip2Iterator<int *, int *>, (lambda at ../../libs/utils/test/test_Zip2Iterator.cpp:43:21)>' requested here
    std::sort(b, e, [](auto const& lhs, auto const& rhs) { return lhs.second < rhs.second; });
         ^
In file included from ../../libs/utils/test/test_Zip2Iterator.cpp:17:
In file included from ../../third_party/libgtest/tnt/../include/gtest/gtest.h:55:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/ostream:138:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/ios:216:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__locale:15:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/string:439:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/algorithm:627:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/utility:280:38: error: no type named 'type' in 'std::__1::enable_if<false, void>'; 'enable_if' cannot be used to disable this declaration
                 ,typename enable_if<is_convertible<const _U1&, _T1>::value &&
                                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../libs/utils/include/utils/Zip2Iterator.h:42:38: note: in instantiation of member function 'std::__1::pair<int &, int &>::pair' requested here
        using std::pair<Ref1, Ref2>::pair;
                                     ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/algorithm:3746:20: note: while substituting deduced template arguments into function template 'Ref' [with _U1 = int, _U2 = int]
            *__j = _VSTD::move(__t);
                   ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__config:397:15: note: expanded from macro '_VSTD'
#define _VSTD std::_LIBCPP_NAMESPACE
              ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/algorithm:3870:20: note: in instantiation of function template specialization 'std::__1::__insertion_sort_3<(lambda at ../../libs/utils/test/test_Zip2Iterator.cpp:43:21) &, utils::Zip2Iterator<int *, int *> >' requested here
            _VSTD::__insertion_sort_3<_Compare>(__first, __last, __comp);
                   ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/algorithm:4041:5: note: in instantiation of function template specialization 'std::__1::__sort<(lambda at ../../libs/utils/test/test_Zip2Iterator.cpp:43:21) &, utils::Zip2Iterator<int *, int *> >' requested here
    __sort<_Comp_ref>(__first, __last, __comp);
    ^
../../libs/utils/test/test_Zip2Iterator.cpp:43:10: note: in instantiation of function template specialization 'std::__1::sort<utils::Zip2Iterator<int *, int *>, (lambda at ../../libs/utils/test/test_Zip2Iterator.cpp:43:21)>' requested here
    std::sort(b, e, [](auto const& lhs, auto const& rhs) { return lhs.second < rhs.second; });
         ^
In file included from ../../libs/utils/test/test_Zip2Iterator.cpp:17:
In file included from ../../third_party/libgtest/tnt/../include/gtest/gtest.h:55:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/ostream:138:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/ios:216:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__locale:15:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/string:439:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/algorithm:627:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/utility:324:37: error: no type named 'type' in 'std::__1::enable_if<false, void>'; 'enable_if' cannot be used to disable this declaration
                 typename enable_if<is_convertible<_U1, _T1>::value &&
                                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../libs/utils/include/utils/Zip2Iterator.h:42:38: note: in instantiation of member function 'std::__1::pair<int &, int &>::pair' requested here
        using std::pair<Ref1, Ref2>::pair;
                                     ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/algorithm:3746:20: note: while substituting deduced template arguments into function template 'Ref' [with _U1 = int, _U2 = int]
            *__j = _VSTD::move(__t);
                   ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__config:397:15: note: expanded from macro '_VSTD'
#define _VSTD std::_LIBCPP_NAMESPACE
              ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/algorithm:3870:20: note: in instantiation of function template specialization 'std::__1::__insertion_sort_3<(lambda at ../../libs/utils/test/test_Zip2Iterator.cpp:43:21) &, utils::Zip2Iterator<int *, int *> >' requested here
            _VSTD::__insertion_sort_3<_Compare>(__first, __last, __comp);
                   ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/algorithm:4041:5: note: in instantiation of function template specialization 'std::__1::__sort<(lambda at ../../libs/utils/test/test_Zip2Iterator.cpp:43:21) &, utils::Zip2Iterator<int *, int *> >' requested here
    __sort<_Comp_ref>(__first, __last, __comp);
    ^
../../libs/utils/test/test_Zip2Iterator.cpp:43:10: note: in instantiation of function template specialization 'std::__1::sort<utils::Zip2Iterator<int *, int *>, (lambda at ../../libs/utils/test/test_Zip2Iterator.cpp:43:21)>' requested here
    std::sort(b, e, [](auto const& lhs, auto const& rhs) { return lhs.second < rhs.second; });
         ^
In file included from ../../libs/utils/test/test_Zip2Iterator.cpp:17:
In file included from ../../third_party/libgtest/tnt/../include/gtest/gtest.h:55:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/ostream:138:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/ios:216:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__locale:15:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/string:439:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/algorithm:627:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/utility:280:38: error: no type named 'type' in 'std::__1::enable_if<false, void>'; 'enable_if' cannot be used to disable this declaration
                 ,typename enable_if<is_convertible<const _U1&, _T1>::value &&
                                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../libs/utils/include/utils/Zip2Iterator.h:42:38: note: in instantiation of member function 'std::__1::pair<int &, int &>::pair' requested here
        using std::pair<Ref1, Ref2>::pair;
                                     ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/algorithm:3792:20: note: while substituting deduced template arguments into function template 'Ref' [with _U1 = int, _U2 = int]
            *__j = _VSTD::move(__t);
                   ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__config:397:15: note: expanded from macro '_VSTD'
#define _VSTD std::_LIBCPP_NAMESPACE
              ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/algorithm:3996:32: note: in instantiation of function template specialization 'std::__1::__insertion_sort_incomplete<(lambda at ../../libs/utils/test/test_Zip2Iterator.cpp:43:21) &, utils::Zip2Iterator<int *, int *> >' requested here
            bool __fs = _VSTD::__insertion_sort_incomplete<_Compare>(__first, __i, __comp);
                               ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/algorithm:4041:5: note: in instantiation of function template specialization 'std::__1::__sort<(lambda at ../../libs/utils/test/test_Zip2Iterator.cpp:43:21) &, utils::Zip2Iterator<int *, int *> >' requested here
    __sort<_Comp_ref>(__first, __last, __comp);
    ^
../../libs/utils/test/test_Zip2Iterator.cpp:43:10: note: in instantiation of function template specialization 'std::__1::sort<utils::Zip2Iterator<int *, int *>, (lambda at ../../libs/utils/test/test_Zip2Iterator.cpp:43:21)>' requested here
    std::sort(b, e, [](auto const& lhs, auto const& rhs) { return lhs.second < rhs.second; });
         ^
In file included from ../../libs/utils/test/test_Zip2Iterator.cpp:17:
In file included from ../../third_party/libgtest/tnt/../include/gtest/gtest.h:55:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/ostream:138:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/ios:216:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__locale:15:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/string:439:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/algorithm:627:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/utility:324:37: error: no type named 'type' in 'std::__1::enable_if<false, void>'; 'enable_if' cannot be used to disable this declaration
                 typename enable_if<is_convertible<_U1, _T1>::value &&
                                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../libs/utils/include/utils/Zip2Iterator.h:42:38: note: in instantiation of member function 'std::__1::pair<int &, int &>::pair' requested here
        using std::pair<Ref1, Ref2>::pair;
                                     ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/algorithm:3792:20: note: while substituting deduced template arguments into function template 'Ref' [with _U1 = int, _U2 = int]
            *__j = _VSTD::move(__t);
                   ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__config:397:15: note: expanded from macro '_VSTD'
#define _VSTD std::_LIBCPP_NAMESPACE
              ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/algorithm:3996:32: note: in instantiation of function template specialization 'std::__1::__insertion_sort_incomplete<(lambda at ../../libs/utils/test/test_Zip2Iterator.cpp:43:21) &, utils::Zip2Iterator<int *, int *> >' requested here
            bool __fs = _VSTD::__insertion_sort_incomplete<_Compare>(__first, __i, __comp);
                               ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/algorithm:4041:5: note: in instantiation of function template specialization 'std::__1::__sort<(lambda at ../../libs/utils/test/test_Zip2Iterator.cpp:43:21) &, utils::Zip2Iterator<int *, int *> >' requested here
    __sort<_Comp_ref>(__first, __last, __comp);
    ^
../../libs/utils/test/test_Zip2Iterator.cpp:43:10: note: in instantiation of function template specialization 'std::__1::sort<utils::Zip2Iterator<int *, int *>, (lambda at ../../libs/utils/test/test_Zip2Iterator.cpp:43:21)>' requested here
    std::sort(b, e, [](auto const& lhs, auto const& rhs) { return lhs.second < rhs.second; });
         ^
In file included from ../../libs/utils/test/test_Zip2Iterator.cpp:17:
In file included from ../../third_party/libgtest/tnt/../include/gtest/gtest.h:55:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/ostream:138:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/ios:216:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__locale:15:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/string:439:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/algorithm:627:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/utility:280:38: error: no type named 'type' in 'std::__1::enable_if<false, void>'; 'enable_if' cannot be used to disable this declaration
                 ,typename enable_if<is_convertible<const _U1&, _T1>::value &&
                                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../libs/utils/include/utils/Zip2Iterator.h:42:38: note: in instantiation of member function 'std::__1::pair<int &, int &>::pair' requested here
        using std::pair<Ref1, Ref2>::pair;
                                     ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/algorithm:3792:20: note: while substituting deduced template arguments into function template 'Ref' [with _U1 = int, _U2 = int]
            *__j = _VSTD::move(__t);
                   ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__config:397:15: note: expanded from macro '_VSTD'
#define _VSTD std::_LIBCPP_NAMESPACE
              ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/algorithm:3996:32: note: in instantiation of function template specialization 'std::__1::__insertion_sort_incomplete<(lambda at ../../libs/utils/test/test_Zip2Iterator.cpp:43:21) &, utils::Zip2Iterator<int *, int *> >' requested here
            bool __fs = _VSTD::__insertion_sort_incomplete<_Compare>(__first, __i, __comp);
                               ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/algorithm:4041:5: note: in instantiation of function template specialization 'std::__1::__sort<(lambda at ../../libs/utils/test/test_Zip2Iterator.cpp:43:21) &, utils::Zip2Iterator<int *, int *> >' requested here
    __sort<_Comp_ref>(__first, __last, __comp);
    ^
../../libs/utils/test/test_Zip2Iterator.cpp:43:10: note: in instantiation of function template specialization 'std::__1::sort<utils::Zip2Iterator<int *, int *>, (lambda at ../../libs/utils/test/test_Zip2Iterator.cpp:43:21)>' requested here
    std::sort(b, e, [](auto const& lhs, auto const& rhs) { return lhs.second < rhs.second; });
         ^
In file included from ../../libs/utils/test/test_Zip2Iterator.cpp:17:
In file included from ../../third_party/libgtest/tnt/../include/gtest/gtest.h:55:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/ostream:138:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/ios:216:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__locale:15:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/string:439:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/algorithm:627:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/utility:324:37: error: no type named 'type' in 'std::__1::enable_if<false, void>'; 'enable_if' cannot be used to disable this declaration
                 typename enable_if<is_convertible<_U1, _T1>::value &&
                                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../libs/utils/include/utils/Zip2Iterator.h:42:38: note: in instantiation of member function 'std::__1::pair<int &, int &>::pair' requested here
        using std::pair<Ref1, Ref2>::pair;
                                     ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/algorithm:3792:20: note: while substituting deduced template arguments into function template 'Ref' [with _U1 = int, _U2 = int]
            *__j = _VSTD::move(__t);
                   ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__config:397:15: note: expanded from macro '_VSTD'
#define _VSTD std::_LIBCPP_NAMESPACE
              ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/algorithm:3996:32: note: in instantiation of function template specialization 'std::__1::__insertion_sort_incomplete<(lambda at ../../libs/utils/test/test_Zip2Iterator.cpp:43:21) &, utils::Zip2Iterator<int *, int *> >' requested here
            bool __fs = _VSTD::__insertion_sort_incomplete<_Compare>(__first, __i, __comp);
                               ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/algorithm:4041:5: note: in instantiation of function template specialization 'std::__1::__sort<(lambda at ../../libs/utils/test/test_Zip2Iterator.cpp:43:21) &, utils::Zip2Iterator<int *, int *> >' requested here
    __sort<_Comp_ref>(__first, __last, __comp);
    ^
../../libs/utils/test/test_Zip2Iterator.cpp:43:10: note: in instantiation of function template specialization 'std::__1::sort<utils::Zip2Iterator<int *, int *>, (lambda at ../../libs/utils/test/test_Zip2Iterator.cpp:43:21)>' requested here
    std::sort(b, e, [](auto const& lhs, auto const& rhs) { return lhs.second < rhs.second; });
         ^
8 errors generated.
[40/845] Building CXX object libs/math...les/test_math.dir/tests/test_mat.cpp.o
ninja: build stopped: subcommand failed.
~/filament>

@romainguy
Copy link
Collaborator

Something's not right, with the latest Xcode and tools you should be on clang-902 (Apple LLVM version 9.1.0). (BTW you can use -c with build.sh to trigger a clean build). Here's the top of my CMake output:

Building release in out/cmake-release...
-- The C compiler identification is AppleClang 9.1.0.9020039
-- The CXX compiler identification is AppleClang 9.1.0.9020039
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -- works
-

This is with Xcode 9.4.1.

@skaller
Copy link
Author

skaller commented Aug 5, 2018

i did run xcode-select --install .. hmm .. you're right. Its the same compiler. Checking AppStore it tells me I installed version 9.4 of the tools. But, you're right those tools aren't the current ones. Sorry AppStore won't let me copy/paste. Stupid crap. AppStore ALSO tells me there is an update for El Capitan Xcode 8.2. Grrr.

@skaller
Copy link
Author

skaller commented Aug 5, 2018

Ok .. I will try to manually download xcode from the AppStore. Its installing it. Despite telling me I already did install it .. GRRR .. give me Debian any day.

@skaller
Copy link
Author

skaller commented Aug 5, 2018

Ok, after AppStore download of 5+G failed because I ran out of credit and then restarted from scratch (come on, Apple are you morons? FTP could restart downloads 40 years ago), $100 later Xcode installed and filament built!

@cgmb
Copy link
Contributor

cgmb commented Aug 14, 2018

I encountered the same build error with clang-3.8 on Ubuntu 16.04. That's the default version you get from apt install clang. I worked around the problem by using a newer version of clang.

You can install a newer version of clang with the command apt install clang-6.0. The version number is appended to the file name to avoid conflicting with the old clang, so you use CC=/usr/bin/clang-6.0 CXX=/usr/bin/clang++-6.0 when calling CMake to select it.

rbsheth pushed a commit to rbsheth/filament that referenced this issue Jun 30, 2022
- change AssetLoader to allow create asset with cgltf_data
- change ResourceLoader to allow passing in decoded image bytes via
cgltf_image.extensions, and skip decoding in this case
rbsheth pushed a commit to rbsheth/filament that referenced this issue Jun 30, 2022
- change AssetLoader to allow create asset with cgltf_data
- change ResourceLoader to allow passing in decoded image bytes via
cgltf_image.extensions, and skip decoding in this case
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