cling icon indicating copy to clipboard operation
cling copied to clipboard

Build failed on macOS 10.12

Open valkjsaaa opened this issue 8 years ago • 17 comments

I use cmake to build from source with cling v0.3 and patched llvm clang r274612. However, I get the following error while using cmake

/tmp/cling-20170205-15851-95l3mq/llvm-cling-patches-r274612/tools/cling/lib/Interpreter/DeclUnloader.h:277:16: error:
      target of using declaration conflicts with declaration already in scope
  using clang::DeclUnloader;
               ^
/tmp/cling-20170205-15851-95l3mq/llvm-cling-patches-r274612/tools/cling/lib/Interpreter/DeclUnloader.h:27:9: note:
      target of using declaration
  class DeclUnloader : public DeclVisitor<DeclUnloader, bool> {
        ^
/tmp/cling-20170205-15851-95l3mq/llvm-cling-patches-r274612/tools/cling/../clang/include/clang/AST/Decl.h:33:25: note:
      conflicting declaration
namespace cling { class DeclUnloader; }
                        ^
In file included from /tmp/cling-20170205-15851-95l3mq/llvm-cling-patches-r274612/tools/cling/lib/Interpreter/AutoloadCallback.cpp:28:
/tmp/cling-20170205-15851-95l3mq/llvm-cling-patches-r274612/tools/cling/lib/Interpreter/DeclUnloader.h:281:18: error:
      variable has incomplete type 'cling::DeclUnloader'
    DeclUnloader Unloader(S, nullptr, nullptr);
                 ^
/tmp/cling-20170205-15851-95l3mq/llvm-cling-patches-r274612/tools/cling/../clang/include/clang/AST/Decl.h:33:25: note:
      forward declaration of 'cling::DeclUnloader'
namespace cling { class DeclUnloader; }
                        ^
In file included from /tmp/cling-20170205-15851-95l3mq/llvm-cling-patches-r274612/tools/cling/lib/Interpreter/AutoloadCallback.cpp:28:
/tmp/cling-20170205-15851-95l3mq/llvm-cling-patches-r274612/tools/cling/lib/Interpreter/DeclUnloader.h:287:18: error:
      variable has incomplete type 'cling::DeclUnloader'
    DeclUnloader Unloader(S, CG, nullptr);
                 ^
/tmp/cling-20170205-15851-95l3mq/llvm-cling-patches-r274612/tools/cling/../clang/include/clang/AST/Decl.h:33:25: note:
      forward declaration of 'cling::DeclUnloader'
namespace cling { class DeclUnloader; }

Any ideas how to fix this?

valkjsaaa avatar Feb 06 '17 02:02 valkjsaaa

Hm, did you switch to r274612 the clang repository, too?

vgvassilev avatar Feb 06 '17 09:02 vgvassilev

I think so. I use https://github.com/vgvassilev/clang/archive/cling-patches-r274612.tar.gz for clang.

valkjsaaa avatar Feb 06 '17 15:02 valkjsaaa

Could you clone it from source instead?

vgvassilev avatar Feb 06 '17 16:02 vgvassilev

I just found that the clang repository on Github does not have cling-patches branch. Is that a mistake?

valkjsaaa avatar Feb 06 '17 16:02 valkjsaaa

Also the cling-patches-r274612 seems to be even more ahead than master branch of clang.

valkjsaaa avatar Feb 06 '17 16:02 valkjsaaa

cling-patches is the current one and it shouldn't be used with v0.3. You should use the tag cling-patches-r274612

vgvassilev avatar Feb 06 '17 16:02 vgvassilev

So you mean I should try clone the source and switch to tag cling-patches-r274612?

valkjsaaa avatar Feb 06 '17 16:02 valkjsaaa

BTW, I tried using the script posted on the website https://raw.githubusercontent.com/karies/cling-all-in-one/master/clone.sh, and it built with no problem.

I'm trying to write a Homebrew package for cling so that it can be installed easier on macOS in the future. However, they seems to prefer that the package is built from source instead of built by a script.

valkjsaaa avatar Feb 06 '17 16:02 valkjsaaa

Ah, I see. This is a problem with our release procedure. We do not tag the clang and the llvm repos when we tag cling...

Thanks for pointing that out to us. Any help will be greatly appreciated.

About moving to homebrew: great! We also want cling to go in as many package managers as possible. Look at the work done in #112.

vgvassilev avatar Feb 06 '17 16:02 vgvassilev

Got it. So which version of llvm and clang do you recommend to build with cling v0.3?

valkjsaaa avatar Feb 06 '17 16:02 valkjsaaa

@valkjsaaa I have been working on the packaging of cling for the conda package manager (cross-platform OS X, Windows, Linux).

  • Regarding llvm and clang, I rebased the cling-patches branches on the top of v3.9.1 and applied the resulting patches to the source tar balls.
  • I have done the cling variants for llvm and clang and am just waiting for the cling core devs to tag a v0.4.0 for cling so that I can complete the packaging of cling for conda.

SylvainCorlay avatar Feb 06 '17 17:02 SylvainCorlay

@SylvainCorlay Great! I think that will make packing for Homebrew much easier.

valkjsaaa avatar Feb 06 '17 17:02 valkjsaaa

@SylvainCorlay BTW, how do you address the problem that cling generate binaries such as clang and clang-format which conflict with existed packages?

valkjsaaa avatar Feb 06 '17 17:02 valkjsaaa

@SylvainCorlay BTW, how do you address the problem that cling generate binaries such as clang and clang-format which conflict with existed packages?

Conda supports variants of packages through a functionality called "build features". When installing cling, you will get the "cling" variant of llvm and clang.

Also, conda has the notion of isolated environment. So that you can have environments with different numbered versions / variants of the same packages.

However, I do think that it is important for the llvm patches to go upstream so that we can have environments with both Julia and cling installed. It is less critical for clang since few packages have a runtime dependency on it.

SylvainCorlay avatar Feb 06 '17 18:02 SylvainCorlay

@vgvassilev can you make one more version? Tag v0.3 currently don't build with any archived version of Clang and LLVM and there is no stable version after that. I need one version number in order to make a Homebrew package(#homebrew-core#9693).

Thanks!

valkjsaaa avatar Apr 11 '17 22:04 valkjsaaa

@valkjsaaa it looks like https://github.com/vgvassilev/cling/releases/tag/v0.4 has been released, should we try to make a new PR on homebrew?

AndrewSB avatar Aug 15 '17 22:08 AndrewSB

@valkjsaaa I created https://github.com/Homebrew/homebrew-core/pull/16841, but it doesn't build yet

AndrewSB avatar Aug 15 '17 22:08 AndrewSB