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

Unable to build on Ubuntu 18.04 with clang/clang++ 10.0 or 7.0 #808

Open
osa1 opened this issue Apr 5, 2020 · 8 comments
Open

Unable to build on Ubuntu 18.04 with clang/clang++ 10.0 or 7.0 #808

osa1 opened this issue Apr 5, 2020 · 8 comments
Labels
A-infrastructure Area: Project infrastructure, build system, Ci, website etc. question Further information is requested

Comments

@osa1
Copy link

osa1 commented Apr 5, 2020

Searched for an existing bug report but no luck..

  • Operating System: Ubuntu 18.04
  • Revery Version: Git HEAD
  • OCaml version: 4.05.0
  • Native, Bytecode, or JS build: Dunno, I'm just running esy build

Tried with clang 10.0 and 7.0. Got the same error in both cases:

...
    clang++ -MMD -MF obj/src/effects/effects.SkAlphaThresholdFilter.o.d -DNDEBUG -DSK_SAMPLES_FOR_X -DSK_GAMMA_APPLY_TO_A8 -DSK_ENABLE_DISCRETE_GPU -DGR_TEST_UTILS=1 -DSKIA_IMPLEMENTATION=1 -I../../include/android -I../../include/c -I../../include/codec -I../../include/config -I../../include/core -I../../include/effects -I../../include/encode -I../../include/gpu -I../../include/atlastext -I../../include/pathops -I../../include/ports -I../../include/svg -I../../include/utils -I../../include/utils/mac -I../../include/private -I../../src/c -I../../src/codec -I../../src/core -I../../src/effects -I../../src/fonts -I../../src/image -I../../src/images -I../../src/lazy -I../../src/opts -I../../src/pathops -I../../src/pdf -I../../src/ports -I../../src/sfnt -I../../src/shaders -I../../src/shaders/gradients -I../../src/sksl -I../../src/utils -I../../src/utils/win -I../../src/xml -I../../third_party/gif -I../../src/gpu -fstrict-aliasing -fPIC -fvisibility=hidden -O3 -fdata-sections -ffunction-sections -g -Werror -Wall -Wextra -Winit-self -Wpointer-arith -Wsign-compare -Wvla -Wno-deprecated-declarations -Wno-maybe-uninitialized -Wno-extra-semi-stmt -Weverything -Wno-unknown-warning-option -Wno-nonportable-include-path -Wno-nonportable-system-include-path -Wno-cast-align -Wno-cast-qual -Wno-conversion -Wno-disabled-macro-expansion -Wno-documentation -Wno-documentation-unknown-command -Wno-double-promotion -Wno-exit-time-destructors -Wno-float-equal -Wno-format-nonliteral -Wno-global-constructors -Wno-missing-prototypes -Wno-missing-variable-declarations -Wno-pedantic -Wno-reserved-id-macro -Wno-shadow -Wno-shift-sign-overflow -Wno-signed-enum-bitfield -Wno-switch-enum -Wno-undef -Wno-unreachable-code -Wno-unreachable-code-break -Wno-unreachable-code-return -Wno-unused-macros -Wno-unused-member-function -Wno-unused-template -Wno-zero-as-null-pointer-constant -Wno-bad-function-cast -Wno-covered-switch-default -Wno-deprecated -Wno-missing-noreturn -Wno-old-style-cast -Wno-padded -Wno-newline-eof -Wno-implicit-fallthrough -Wno-unused-parameter -I/home/omer/.esy/3_____________________________________________________________________/i/esy_libjpeg_turbo-fc2602b2/include -std=c++11 -fvisibility-inlines-hidden -fno-exceptions -fno-rtti -Wnon-virtual-dtor -Wno-noexcept-type -Wno-abstract-vbase-init -Wno-weak-vtables -Wno-c++98-compat -Wno-c++98-compat-pedantic -Wno-undefined-func-template -c ../../src/effects/SkAlphaThresholdFilter.cpp -o obj/src/effects/effects.SkAlphaThresholdFilter.o
    In file included from ../../src/effects/SkAlphaThresholdFilter.cpp:8:
    In file included from ../../include/effects/SkAlphaThresholdFilter.h:11:
    In file included from ../../include/core/SkImageFilter.h:11:
    In file included from ../../include/core/../private/SkTArray.h:11:
    In file included from ../../include/private/../private/SkSafe32.h:11:
    ../../include/core/SkTypes.h:21:10: fatal error: 'ciso646' file not found
    #include <ciso646>  // Include something innocuous to define _LIBCPP_VERISON if it's libc++.
    1 error generated.
    ninja: build stopped: subcommand failed.
    error: command failed: 'bash' './esy/build.sh' 'linux' '/home/omer/.esy/3_____________________________________________________________________/i/esy_libjpeg_turbo-fc2602b2' (exited with 1)
    esy-build-package: exiting with errors above...

  building esy-skia@github:revery-ui/esy-skia#07c13a9
esy: exiting due to errors above
@despairblue
Copy link
Contributor

Just guessing here, did you install all packages mentioned here?

@osa1
Copy link
Author

osa1 commented Apr 5, 2020

Just guessing here, did you install all packages mentioned here?

Yes.

@despairblue
Copy link
Contributor

Then I'm at a loss here. Hope somebody else can help 😞

@Et7f3
Copy link
Member

Et7f3 commented Apr 5, 2020

Someone has a similar issue in rdkit/rdkit. it should be a misconfigured clang. Can you build a regular cpp hello world with clang ? If you manage can you try to build revery-ui/esy-skia master ?

@osa1
Copy link
Author

osa1 commented Apr 6, 2020

Can you build a regular cpp hello world with clang ?

I don't know enough C++ to write this myself but I found this code online:

#include <iostream>

int main() {
    std::cout << "Hello World!";
    return 0;
}

And it seems like I can't build it:

$ clang++ test.cpp
test.cpp:1:10: fatal error: 'iostream' file not found
#include <iostream>
         ^~~~~~~~~~
1 error generated.

So perhaps you're right that this is a clang configuration problem.

@Et7f3
Copy link
Member

Et7f3 commented Apr 7, 2020

It is fine if you don't know enough C++. This example your provide is valid. I was able to compile on my linux. So the issue is with you clang++. How do you install it ? Regular apt-get install ? In GitHub Action we just install package listed on our wiki: https://github.com/revery-ui/revery/blob/master/.github/workflows/validate-pr.yml#L141

I should first try applying his answer: https://stackoverflow.com/a/31187510/7227940 (maybe you could use a more recent gcc). In case you still have your problem, we had issue with clang in Centos. What we have used is:

RUN scl enable llvm-toolset-7.0 'clang -v'
and
source /opt/rh/llvm-toolset-7.0/enable
It might be unrelevant because it is not ubuntu.

Hope it help

@osa1
Copy link
Author

osa1 commented Apr 7, 2020

Thanks for pointing out the GH Action script -- that's helpful. I already have all those packages installed (just run the same command from the script -- all already installed).

I'm trying with two clang versions, 7 and 10, both installed using pre-built executables in https://releases.llvm.org/download.html. Both are failing with the same error.

I should add that, esy build does not use the clang I have in $PATH, I think it always looks for /usr/bin/clang. I have to do something like sudo ln -s which clang /usr/bin/clang before running, otherwise it fails early on with a "clang not found" error.

@osa1
Copy link
Author

osa1 commented Apr 7, 2020

Hmm, I don't see how clang is installed in the GA action script. Any ideas?

@glennsl glennsl added A-infrastructure Area: Project infrastructure, build system, Ci, website etc. question Further information is requested labels Apr 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-infrastructure Area: Project infrastructure, build system, Ci, website etc. question Further information is requested
Projects
None yet
Development

No branches or pull requests

4 participants