vgvassilev / cling

The interactive C++ interpreter Cling
https://rawgit.com/vgvassilev/cling/master/www/index.html
Other
1.77k stars 100 forks source link

Build failed on macOS 10.12 #131

Open valkjsaaa opened 7 years ago

valkjsaaa commented 7 years ago

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?

vgvassilev commented 7 years ago

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

valkjsaaa commented 7 years ago

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

vgvassilev commented 7 years ago

Could you clone it from source instead?

valkjsaaa commented 7 years ago

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

valkjsaaa commented 7 years ago

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

vgvassilev commented 7 years ago

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

valkjsaaa commented 7 years ago

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

valkjsaaa commented 7 years ago

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.

vgvassilev commented 7 years ago

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.

valkjsaaa commented 7 years ago

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

SylvainCorlay commented 7 years ago

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

valkjsaaa commented 7 years ago

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

valkjsaaa commented 7 years ago

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

SylvainCorlay commented 7 years ago

@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.

valkjsaaa commented 7 years ago

@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!

AndrewSB commented 7 years ago

@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 commented 7 years ago

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