Linuxbrew-core: Error in dependenciy llvm@4 while installing pcl

Created on 19 Nov 2018  路  41Comments  路  Source: Homebrew/linuxbrew-core

brew gist-logs llvm@4
https://gist.github.com/danielaDESM/1c4a77a86bb902cf82a0416742849ddd
==> cmake -G Unix Makefiles .. -DCMAKE_C_FLAGS_RELEASE=-DNDEBUG -DCMAKE_CXX_FLAG
==> make
Last 15 lines from /home/daniela/.cache/Homebrew/Logs/llvm@4/02.make:
cd /tmp/llvm@4-20181119-13858-oz1nqq/llvm-4.0.1.src/build/tools/lld/lib/ReaderWriter/MachO && /home/daniela/.linuxbrew/opt/gcc/bin/g++  -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/tmp/llvm@4-20181119-13858-oz1nqq/llvm-4.0.1.src/build/tools/lld/lib/ReaderWriter/MachO -I/tmp/llvm@4-20181119-13858-oz1nqq/llvm-4.0.1.src/tools/lld/lib/ReaderWriter/MachO -I/tmp/llvm@4-20181119-13858-oz1nqq/llvm-4.0.1.src/tools/lld/include -I/tmp/llvm@4-20181119-13858-oz1nqq/llvm-4.0.1.src/build/tools/lld/include -I/tmp/llvm@4-20181119-13858-oz1nqq/llvm-4.0.1.src/build/include -I/tmp/llvm@4-20181119-13858-oz1nqq/llvm-4.0.1.src/include -I/tmp/llvm@4-20181119-13858-oz1nqq/llvm-4.0.1.src/tools/lld/lib/ReaderWriter/MachO/.  -fPIC -fvisibility-inlines-hidden -Wall -W -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long -Wno-maybe-uninitialized -Wdelete-non-virtual-dtor -Wno-comment -Werror=date-time -std=c++11 -ffunction-sections -fdata-sections -DNDEBUG     -o CMakeFiles/lldMachO.dir/StubsPass.cpp.o -c /tmp/llvm@4-20181119-13858-oz1nqq/llvm-4.0.1.src/tools/lld/lib/ReaderWriter/MachO/StubsPass.cpp
[ 20%] Building CXX object tools/lld/lib/ReaderWriter/MachO/CMakeFiles/lldMachO.dir/TLVPass.cpp.o
cd /tmp/llvm@4-20181119-13858-oz1nqq/llvm-4.0.1.src/build/tools/lld/lib/ReaderWriter/MachO && /home/daniela/.linuxbrew/opt/gcc/bin/g++  -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/tmp/llvm@4-20181119-13858-oz1nqq/llvm-4.0.1.src/build/tools/lld/lib/ReaderWriter/MachO -I/tmp/llvm@4-20181119-13858-oz1nqq/llvm-4.0.1.src/tools/lld/lib/ReaderWriter/MachO -I/tmp/llvm@4-20181119-13858-oz1nqq/llvm-4.0.1.src/tools/lld/include -I/tmp/llvm@4-20181119-13858-oz1nqq/llvm-4.0.1.src/build/tools/lld/include -I/tmp/llvm@4-20181119-13858-oz1nqq/llvm-4.0.1.src/build/include -I/tmp/llvm@4-20181119-13858-oz1nqq/llvm-4.0.1.src/include -I/tmp/llvm@4-20181119-13858-oz1nqq/llvm-4.0.1.src/tools/lld/lib/ReaderWriter/MachO/.  -fPIC -fvisibility-inlines-hidden -Wall -W -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long -Wno-maybe-uninitialized -Wdelete-non-virtual-dtor -Wno-comment -Werror=date-time -std=c++11 -ffunction-sections -fdata-sections -DNDEBUG     -o CMakeFiles/lldMachO.dir/TLVPass.cpp.o -c /tmp/llvm@4-20181119-13858-oz1nqq/llvm-4.0.1.src/tools/lld/lib/ReaderWriter/MachO/TLVPass.cpp
[ 20%] Building CXX object tools/lld/lib/ReaderWriter/MachO/CMakeFiles/lldMachO.dir/WriterMachO.cpp.o
cd /tmp/llvm@4-20181119-13858-oz1nqq/llvm-4.0.1.src/build/tools/lld/lib/ReaderWriter/MachO && /home/daniela/.linuxbrew/opt/gcc/bin/g++  -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/tmp/llvm@4-20181119-13858-oz1nqq/llvm-4.0.1.src/build/tools/lld/lib/ReaderWriter/MachO -I/tmp/llvm@4-20181119-13858-oz1nqq/llvm-4.0.1.src/tools/lld/lib/ReaderWriter/MachO -I/tmp/llvm@4-20181119-13858-oz1nqq/llvm-4.0.1.src/tools/lld/include -I/tmp/llvm@4-20181119-13858-oz1nqq/llvm-4.0.1.src/build/tools/lld/include -I/tmp/llvm@4-20181119-13858-oz1nqq/llvm-4.0.1.src/build/include -I/tmp/llvm@4-20181119-13858-oz1nqq/llvm-4.0.1.src/include -I/tmp/llvm@4-20181119-13858-oz1nqq/llvm-4.0.1.src/tools/lld/lib/ReaderWriter/MachO/.  -fPIC -fvisibility-inlines-hidden -Wall -W -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long -Wno-maybe-uninitialized -Wdelete-non-virtual-dtor -Wno-comment -Werror=date-time -std=c++11 -ffunction-sections -fdata-sections -DNDEBUG     -o CMakeFiles/lldMachO.dir/WriterMachO.cpp.o -c /tmp/llvm@4-20181119-13858-oz1nqq/llvm-4.0.1.src/tools/lld/lib/ReaderWriter/MachO/WriterMachO.cpp
[ 20%] Linking CXX static library ../../../../../lib/liblldMachO.a
cd /tmp/llvm@4-20181119-13858-oz1nqq/llvm-4.0.1.src/build/tools/lld/lib/ReaderWriter/MachO && /home/daniela/.linuxbrew/Cellar/cmake/3.12.4/bin/cmake -P CMakeFiles/lldMachO.dir/cmake_clean_target.cmake
cd /tmp/llvm@4-20181119-13858-oz1nqq/llvm-4.0.1.src/build/tools/lld/lib/ReaderWriter/MachO && /home/daniela/.linuxbrew/Cellar/cmake/3.12.4/bin/cmake -E cmake_link_script CMakeFiles/lldMachO.dir/link.txt --verbose=1
/home/daniela/.linuxbrew/bin/ar qc ../../../../../lib/liblldMachO.a  CMakeFiles/lldMachO.dir/ArchHandler.cpp.o CMakeFiles/lldMachO.dir/ArchHandler_arm.cpp.o CMakeFiles/lldMachO.dir/ArchHandler_arm64.cpp.o CMakeFiles/lldMachO.dir/ArchHandler_x86.cpp.o CMakeFiles/lldMachO.dir/ArchHandler_x86_64.cpp.o CMakeFiles/lldMachO.dir/CompactUnwindPass.cpp.o CMakeFiles/lldMachO.dir/GOTPass.cpp.o CMakeFiles/lldMachO.dir/LayoutPass.cpp.o CMakeFiles/lldMachO.dir/MachOLinkingContext.cpp.o CMakeFiles/lldMachO.dir/MachONormalizedFileBinaryReader.cpp.o CMakeFiles/lldMachO.dir/MachONormalizedFileBinaryWriter.cpp.o CMakeFiles/lldMachO.dir/MachONormalizedFileFromAtoms.cpp.o CMakeFiles/lldMachO.dir/MachONormalizedFileToAtoms.cpp.o CMakeFiles/lldMachO.dir/MachONormalizedFileYAML.cpp.o CMakeFiles/lldMachO.dir/ObjCPass.cpp.o CMakeFiles/lldMachO.dir/ShimPass.cpp.o CMakeFiles/lldMachO.dir/StubsPass.cpp.o CMakeFiles/lldMachO.dir/TLVPass.cpp.o CMakeFiles/lldMachO.dir/WriterMachO.cpp.o
/home/daniela/.linuxbrew/bin/ranlib ../../../../../lib/liblldMachO.a
make[2]: Leaving directory '/tmp/llvm@4-20181119-13858-oz1nqq/llvm-4.0.1.src/build'
[ 20%] Built target lldMachO
make[1]: Leaving directory '/tmp/llvm@4-20181119-13858-oz1nqq/llvm-4.0.1.src/build'
Makefile:154: recipe for target 'all' failed
make: *** [all] Error 2

brew config
HOMEBREW_VERSION: 1.8.2-1-g9769fb2
ORIGIN: https://github.com/Linuxbrew/brew.git
HEAD: 9769fb22fe2cef2dc00420111fd4ecf5b19e5c0d
Last commit: 2 days ago
Core tap ORIGIN: https://github.com/Linuxbrew/homebrew-core
Core tap HEAD: c7e37d57f0655d422f9a6eb2d225836bca3d7cfa
Core tap last commit: 22 hours ago
HOMEBREW_PREFIX: /home/daniela/.linuxbrew
HOMEBREW_REPOSITORY: /home/daniela/.linuxbrew
HOMEBREW_CELLAR: /home/daniela/.linuxbrew/Cellar
HOMEBREW_CACHE: /home/daniela/.cache/Homebrew
HOMEBREW_DEV_CMD_RUN: 1
CPU: octa-core 64-bit skylake
Homebrew Ruby: 2.3.7 => /home/daniela/.linuxbrew/Library/Homebrew/vendor/portable-ruby/2.3.7/bin/ruby
Clang: N/A
Git: 2.7.4 => /usr/bin/git
Curl: 7.47.0 => /usr/bin/curl
Kernel: Linux 4.15.0-39-generic x86_64 GNU/Linux
OS: Ubuntu 16.04.5 LTS (xenial)
Host glibc: 2.23
/usr/bin/gcc: 5.4.0
glibc: N/A
gcc: 5.5.0_4
xorg: 20170115_1

brew doctor
Your system is ready to brew.

Please note we will close your issue without comment if you delete, do not read or do not fill out the issue checklist below and provide ALL the requested information. If you repeatedly fail to use the issue template, we will block you from ever submitting issues to Homebrew again.

  • [ ] have a problem with brew install (or upgrade, reinstall) a single formula? If it's a general brew problem please file this issue at Linuxbrew/brew: https://github.com/Linuxbrew/brew/issues/new/choose. If it's a tap (e.g. Brewsci/homebrew-bio) problem please file this issue at the tap.
  • [ ] ran brew update and can still reproduce the problem?
  • [ ] ran brew doctor, fixed all issues and can still reproduce the problem?
  • [ ] ran brew gist-logs <formula> (where <formula> is the name of the formula that failed) and included the output link?
  • [ ] if brew gist-logs didn't work: ran brew config and brew doctor and included their output with your issue?

To help us debug your issue please explain:

  • What you were trying to do (and why)
  • What happened (include command output)
  • What you expected to happen
  • Step-by-step reproduction instructions (by running brew install commands)
bug outdated

Most helpful comment

I鈥檝e added the in-progress label to stop the stale bot posting for the fifth time! I鈥檒l also try and revive the closed PRs around this and get it working, as it still seems to be a problem.

All 41 comments

Daniela, gist-logs command failed too. In order for Linuxbrew to be able to create a gist-log (a new entry under your name in https://gist.github.com/), you have to create an access token for it. Homebrew already suggested where you can do that:

https://github.com/settings/tokens/new?scopes=gist,public_repo&description=Homebrew

So, click the link above, scroll down and click "Generate token". On the new page you'll see your new Personal Access Token -- copy it and then execute in your Terminal:

echo 'export HOMEBREW_GITHUB_API_TOKEN=<your-personal-access-token-without-brackets>' >> ~/.bashrc
. ~/.bashrc

After that, your Homebrew should be able to create gist-logs:

brew gist-logs llvm@4

I am so sorry, I can't. I tried couple of times but it keeps sending an error after I export the token to the bash:
echo 'export HOMEBREW_GITHUB_API_TOKEN=your_token_here' >> ~/.bash_profile
(with the token generated in https://github.com/settings/tokens/new?scopes=gist,public_repo&description=Homebrew)
In the terminal, it asks my username and password, but it does not work. Like if I am giving the wrong, but I have verified through the web browser. I tried with my username and pass, and with my email and pass.

Make sure you source (.) the right file: I used ~/.bashrc in my example. You used ~/.bash_profile in yours. You can also simply execute that export ... command without the redirection (>> ~/.bash...) in the current shell and then do brew gist-logs llvm@4

Error: GitHub Bad credentials:HOMEBREW_GITHUB_API_TOKEN may be invalid or expired; check:
https://github.com/settings/tokens

I have regenerated the token 3 times.

  1. Edit your ~/.bashrc and ~/.bash_profile and delete all export HOMEBREW_GITHUB_API_TOKEN lines there.
  2. Start a new Terminal session
  3. Execute compgen -A variable HOMEBREW and make sure you do NOT have any HOMEBREW variables (empty output).
  4. Execute: cd $(brew --repo) && git clean -dfx && git pull origin master
  5. Go to https://github.com/settings/tokens and delete all tokens there
  6. Generate a new token and save it somewhere (to a text file)
  7. Execute export HOMEBREW_GITHUB_API_TOKEN=... in your terminal shell
  8. Execute brew gist-logs llvm@4
    And let me know if it still fails to create a gist-log.

It worked. Thanks!! I updated the first post. I also leave the link below:
https://gist.github.com/danielaDESM/1c4a77a86bb902cf82a0416742849ddd

Great. Let's make small steps and start by fixing errors reported by brew doctor:

sudo mkdir -p /home/daniela/.linuxbrew/{etc,include,lib,opt,sbin,share,var/homebrew/linked,Cellar}
sudo chown -R $(whoami) /home/daniela/.linuxbrew/{etc,include,lib,opt,sbin,share,var/homebrew/linked,Cellar}

Once that is done, execute brew doctor and copy the results here

After crating the directories and changing the permissions and running again brew doctor:

daniela@daniela-XPS-8910:~/.linuxbrew$ brew doctor
Your system is ready to brew.

OK, let's now do:

brew install --only-dependencies llvm@4

Sorry for the delay,

daniela@daniela-XPS-8910:~$ brew install --only-dependencies llvm@4
Updating Homebrew...
==> Auto-updated Homebrew!
Updated 1 tap (homebrew/core).
==> Updated Formulae
tinyxml2

All dependencies for llvm@4 are satisfied.

OK. Let's now make sure Linuxbrew packages are up-to-date:

brew upgrade

and then clean everything up:

brew cleanup --prune=0
brew prune
rm -rf $(brew --cache)

After that, execute:

brew install --verbose llvm@4

... and report gist-logs in case of a failure.

Weird. Could you please execute the following sequence of commands:

sed -i '/ENV.libcxx/a \ \ \ \ ENV.cxx11' $(brew --repo linuxbrew/core)/Formula/[email protected]
export HOMEBREW_NO_AUTO_UPDATE=1
brew install --verbose llvm@4

I see. I'll try to identify the problem and let you know what I find.
Meanwhile, reset the formula recipe to its default with:

git -C $(brew --repo linuxbrew/core) checkout -- .

Thanks a lot again

These lines may need a change:
https://github.com/Linuxbrew/homebrew-core/blob/master/Formula/[email protected]#L190-L193

To something like:

    if OS.mac?
      args << "-DLLVM_ENABLE_LIBCXX=ON"
    else
      args << "-DLLVM_ENABLE_LIBCXX=OFF"
      args << "-DCLANG_DEFAULT_CXX_STDLIB=libstdc++"
    end

There may be other changes that are needed. You can maybe try to align the llvm@4 code with the llvm@6 code.

I'm building the formula locally and at 57% it still has not failed.
Regarding the changes: the bottle was built successfully about a year ago and since then no changes have been made. So, assuming the Linuxbrew/brew behavior with regards to the flags remained the same, the problem must be somewhere else. The trick is to identify the component that results in the reported failure.

... a few seconds later it failed :trollface:

These warnings sound familiar to me:

-- Performing Test CXX_SUPPORTS_STDLIB - Failed
CMake Warning at cmake/modules/HandleLLVMStdlib.cmake:24 (message):
  Can't specify libc++ with '-stdlib='
Call Stack (most recent call first):
  cmake/config-ix.cmake:15 (include)
  CMakeLists.txt:582 (include)
CMake Warning:
  Manually-specified variables were not used by the project:

    LLVM_ENABLE_LIBCXXABI

The build will start, but fail, as you saw. I was able to fix that for the other formulae using the lines above. Though there may be other changes needed.

See my attempt to get this running here: https://github.com/Linuxbrew/homebrew-core/pull/9146/files

All these changes may need to be ported :)

I'm trying DLLVM_ENABLE_LIBCXX=OFF. I don't think DCLANG_DEFAULT_CXX_STDLIB has any effect for gcc

Let's try to revive the llvm 4 build: #10389

Regarding the comment from @xu-cheng : let's try first to get a clean libstdc++ build. I do not care so much about libc++ on Linux. I think that upstream (homebrew) removed the options and is just building libc++ on mac. If somebody really needs this I would be willing to accept pull requests that align all the llvm formulae so that they all propose this option.

Thanks a lot to both.

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

Is this the same issue caused by the following error?

llvm-4.0.1.src/projects/libcxx/include/__locale:39:22: fatal error: xlocale.h: No such file or directory

Apparently xlocale.h was removed in glibc 2.26 (https://sourceware.org/glibc/wiki/Release/2.26#Removal_of_.27xlocale.h.27).
My Ubuntu 18.04 LTS system has version 2.27 and therefore no longer has the required header. (And I can't install Linuxbrew's earlier version of course due to compatibility issues.)

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

Please don't close this. Still fails to reinstall for me due to the xlocale.h error I mentioned above (https://github.com/Homebrew/linuxbrew-core/issues/10371#issuecomment-449734835).

Same error here as the OP

I have got a fix. Basically you need to remove all the libcxx stuff out of the way and change some cmake option when building the compiler-rt library

Great to hear that! Would you like to submit a PR?

See PR #12486

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

Not stale.

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

Not stale...

I鈥檝e added the in-progress label to stop the stale bot posting for the fifth time! I鈥檒l also try and revive the closed PRs around this and get it working, as it still seems to be a problem.

It seems no PRs are merged at the end and the broken llvm@4 still breaks packages that depend on it (e.g., Embree). Hope someone can help fix it...

pcl does not depend on llvm@4 anymore. A bottle has been built for it.

llvm@4 has been deleted.

Was this page helpful?
0 / 5 - 0 ratings