-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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 when clang isn't default compiler #4
Comments
Whoops, looks like an issue in the documentation. Which version of clang are you using to build, and can you give the specific errors clang spits out? |
I'm using clang 6.0.1. All basic file not found errors: I didn't look close enough to figure out how it is killing off the standard include paths.
|
I experience the problem on ubuntu 18.04. |
Thanks for reporting this issue. We only support compiling with I'll fix the docs, it's supposed to prefix cmake with |
I just updated the README, please let me know if installing |
On ubuntu 18.04, installing libc++-dev and libc++abi-dev makes the compilation work. Now I get link errors though:
|
Same issue here using the same setup. |
You can fix this by passing |
BTW if anybody know how to make this work properly, I'm all ears. I made linking against |
I did manage to get the release build to link on fedora by commenting out the It is unclear why it wasn't finding the static libraries (I installed libstdc++-static-8.1.1-5.fc28.x86_64). My initial problem was caused by a missing libstdc++ devel package (I just assumed it had be installed previously). |
The static link is there only for us when we need to distribute binaries. For your own machine... :)) |
Same issue on Ubuntu 18.04, but work around resolved it. As for a proper fix I didn't have enough free time to take a look. Why do development on Ubuntu 14.04? It would seem to be easier to do Vulkan dev on a distro that's not so close to EOL. Even its replacement Ubuntu 16.04 is going maintenance only this year (2018). |
Just got the build to work on Ubuntu 18.04. In addition to following the instructions in the readme for setting the compiler to Clang, I needed to pass the Might be worth adding |
@thendrix This particular CI infrastructure uses Ubuntu 14, I do not control this. We actually develop on Debian Rodete. @RoryDungan The README already mentions that |
It would be useful to check the minimum versions in the CMake. Somehow I missed that in the docs. It took a few tweaks to build on Ubuntu 16.04. Starting with d9ba399, I followed these steps: # install dependencies
sudo apt install cmake ninja-build clang-6.0 libglu1-mesa-dev libc++-dev libc++abi-dev libxi-dev
# apply patch to fix compile/link errors
git apply <<'EOF'
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 8ca0d25..5fa5c27 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -74,13 +74,14 @@ endif()
if (LINUX)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++")
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -isystem /usr/include/libcxxabi")
if (FILAMENT_REQUIRES_CXXABI)
# Required in CI environment with custom libc++ and libc++abi
link_libraries("-lc++abi")
endif()
# To distribute our binaries, we must remove the dependency on libc++ and libgcc.
if (CMAKE_BUILD_TYPE STREQUAL "Release")
- link_libraries("-static-libgcc -static-libstdc++")
+# link_libraries("-static-libgcc -static-libstdc++")
endif()
else()
if (FILAMENT_REQUIRES_CXXABI)
EOF
# configure
CC=/usr/bin/clang-6.0 CXX=/usr/bin/clang++-6.0 cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=out/release/filament -DFILAMENT_REQUIRES_CXXABI=true -H. -Bout/cmake-release -G Ninja
# build
ninja -C out/cmake-release |
The README does specify that clang 5.0 is the minimum. |
Opps. I saw that just after I posted and I edited my comment, but you're way too fast! |
Thanks to @cgmb the readme now checks whether clang is the compiler and that it is the right version. |
The commands in the readme Linux section says:
But the following command matches the one above.
I tried the obvious to set CC to /usr/bin/clang and CXX to /usr/bin/clang++ prior to running cmake. cmake completes, but the build fails with some fairly basic #include file not found errors (things like and ).
I'm building on Fedora 28 x86_64.
The text was updated successfully, but these errors were encountered: