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

Upgrade build system to BB2 -- Part 1 #406

Merged
merged 31 commits into from
Apr 23, 2019
Merged

Upgrade build system to BB2 -- Part 1 #406

merged 31 commits into from
Apr 23, 2019

Conversation

Gnimuc
Copy link
Member

@Gnimuc Gnimuc commented Mar 9, 2019

This PR is for providing an out-of-box user installation experience of Cxx.jl. You could give it a test by (v1.1) pkg> add https://github.com/Gnimuc/Cxx.jl#BB2.

Platform Status
macOS
Linux x86_64
Linux i686
Windows x86_64 experimental (see #406 (comment) below)
Windows i686
FreeBSD

In short, the package works fine almost on all x86_64 platforms. There is a symbol missing error (clang::FileManager::getVirtualFile(llvm::StringRef, long, long)) on i686 platforms, which is probably due to the incompatibility between LLVMBuilder(only tested with gcc7) and current released 32bit Julia.

UPDATE

Since there are still some compatibility issues between Julia and LLVMBuilder (especially i686 platforms), I won't revisit this until Julia1.2 is released. Currently, the binary build for macOS and Linux x86_64 is working quite well. Windows x86_64 support is still experimental: pre-built binary can be loaded successfully and a lot of examples can work as expected, but other examples may trigger segment faults which, I guess, are due to some unknown bugs in Cxx.

I think the first step is to merge this PR and tag a new release so more people can test this package and submit bug reports. Then we can try to support other Tier 1 platforms until after Julia1.2 is released. It looks like Keno is heading on other important things and doesn't have time to review this, so I'm pinging all you guys here (sorry in advance if this is disturbing), but it would be great if you could help to review/test this PR.

cc @ararslan @cdsousa @phlavenk @btaidm @oschulz @ahumenberger @grizzlysmit @zsz00 @ervinbosenbacher @DrKrar @skariel

fix #403, fix #398, fix #397, fix #394, fix #393, fix #388

It looks that `dump` is no longer exposed in LLVM release build.
@ararslan
Copy link
Member

ararslan commented Mar 9, 2019

Don't forget to add FreeBSD to the list. 😉

@ararslan
Copy link
Member

ararslan commented Mar 9, 2019

Why delete the Project.toml file?

@Gnimuc
Copy link
Member Author

Gnimuc commented Mar 10, 2019

To temporarily workaround a dependency problem, I will add it back in the end.

@Gnimuc
Copy link
Member Author

Gnimuc commented Mar 10, 2019

It turns out LLVMBuilder for FreeBSD is currently broken :(

@Gnimuc
Copy link
Member Author

Gnimuc commented Mar 10, 2019

Package compiled on Windows, but I got some errors when running the basic example:

julia> using Cxx
julia> jnum = 10
10
julia> cxx""" #include<iostream> """
true
julia> cxx"""
           void printme(int x) {
               std::cout << x << std::endl;
           }
          """
true
julia> @cxx printme(jnum)
Invalid bitcast
  %dummy = bitcast i64 %0 to i32
define void @cxxjl.5(i64) personality i32 ()* @__cxxjl_personality_v0 {
top:
  %dummy.addr = alloca i32, align 4
  %dummy = bitcast i64 %0 to i32
  store i32 %dummy, i32* %dummy.addr, align 4
  %1 = load i32, i32* %dummy.addr, align 4
  call void @_Z7printmei(i32 %1)
  ret void
}
ERROR: error compiling cppcall: Malformed LLVM Function
Stacktrace:
 [1] top-level scope at none:0

this can be fixed by @cxx printme(Cint(jnum)), so I guess there might be something wrong in the codegen. @Keno could you give some hints on how to debug this issue?

UPDATE

This issue was reported on 32bit platforms before: #370

UPDATE2

This has been fixed by forcing to use

Cxx.jl/src/bootstrap.cpp

Lines 172 to 173 in c62cb57

TYPE_ACCESS(cT_int64,LongLongTy)
TYPE_ACCESS(cT_uint64,UnsignedLongLongTy)

even on 64bit Windows. However, I don't any idea about how to fix the following segfaults: This error is due to Julia/Cxx can't handle $:(julia_global::Int64) correctly on Windows. It can be fixed by directly insert $julia_global into the cxx_str macro.

julia> using Cxx
julia> cxx"""
       #include <stdint.h>
       """
julia> julia_global = 1
julia> cxx"""
       uint64_t bar() {
           return (uint64_t)$:(julia_global::Int64);
           }
           """

Please submit a bug report with steps to reproduce this fault, and any error messages that follow (in their entirety). Thanks.
Exception: EXCEPTION_ACCESS_VIOLATION at 0x0 -- unknown function (ip: 0000000000000000)
in expression starting at no file:0
unknown function (ip: FFFFFFFFFFFFFFFF)
CloneFunctionAndAdjust at C:\Users\gnimuc\.julia\dev\Cxx\deps\usr\bin\libcxxffi.DLL (unknown line)
ReplaceFunctionForDecl at C:\Users\gnimuc\.julia\dev\Cxx\deps\usr\bin\libcxxffi.DLL (unknown line)
#ReplaceFunctionForDecl#5 at C:\Users\gnimuc\.julia\dev\Cxx\src\clangwrapper.jl:385 [inlined]
#ReplaceFunctionForDecl at .\none:0 [inlined]
#ReplaceFunctionForDecl#6 at C:\Users\gnimuc\.julia\dev\Cxx\src\clangwrapper.jl:391 [inlined]
#ReplaceFunctionForDecl at .\none:0
...
...
...

@Gnimuc Gnimuc marked this pull request as ready for review March 10, 2019 14:43
@Gnimuc Gnimuc requested a review from Keno March 10, 2019 14:56
@twadleigh
Copy link

I have been using the Gnimuc:patch-mac branch of Cxx lately, but last night gave this branch a try. I got this:

In file included from /Cxx.cpp:1:
In file included from /home/tracy/dev/CompoundEye-CUDA/jl/pkgs/CeCxx/src/generic.jl:117:
In file included from /usr/lib/gcc/x86_64-linux-gnu/7.3.0/../../../../include/boost/shared_ptr.hpp:17:
In file included from /usr/lib/gcc/x86_64-linux-gnu/7.3.0/../../../../include/boost/smart_ptr/shared_ptr.hpp:28:
In file included from /usr/lib/gcc/x86_64-linux-gnu/7.3.0/../../../../include/boost/smart_ptr/detail/shared_count.hpp:29:
In file included from /usr/lib/gcc/x86_64-linux-gnu/7.3.0/../../../../include/boost/smart_ptr/detail/sp_counted_base.hpp:45:
In file included from /usr/lib/gcc/x86_64-linux-gnu/7.3.0/../../../../include/boost/smart_ptr/detail/sp_counted_base_clang.hpp:18:
In file included from /usr/lib/gcc/x86_64-linux-gnu/7.3.0/../../../../include/boost/detail/sp_typeinfo.hpp:20:
In file included from /usr/lib/gcc/x86_64-linux-gnu/7.3.0/../../../../include/boost/core/typeinfo.hpp:119:
In file included from /usr/lib/gcc/x86_64-linux-gnu/7.3.0/../../../../include/boost/core/demangle.hpp:32:
/usr/lib/gcc/x86_64-linux-gnu/7.3.0/../../../../include/c++/7.3.0/cxxabi.h:128:3: error: exception specification in declaration does not match previous declaration
  __cxa_atexit(void (*)(void*), void*, void*) _GLIBCXX_NOTHROW;
  ^
/home/tracy/.julia/packages/Cxx/4XAMz/src/boot.h:35:10: note: previous declaration is here
    void __cxa_atexit() {}
         ^

The offending line was:

cxx"""
#include <memory>
#include <boost/shared_ptr.hpp>  // <-- this one
"""

I realize this is just a WIP right now, but thought I'd try to help surface any issues early.

@Gnimuc
Copy link
Member Author

Gnimuc commented Mar 13, 2019

@twadleigh that's due to this commit 7b9dd68 which should be Win32 only.

@Gnimuc Gnimuc changed the title WIP: Upgrade build system to BB2 Upgrade build system to BB2 -- Part 1 Apr 11, 2019
@Gnimuc Gnimuc requested a review from ararslan April 11, 2019 16:17
@@ -200,7 +200,7 @@ julia> const path_to_lib = pwd();
julia> addHeaderDir(path_to_lib, kind=C_System)

julia> Libdl.dlopen(joinpath(path_to_lib, "libarraymaker.so"), Libdl.RTLD_GLOBAL)
Ptr{Void} @0x00007f9dd4556d60
Ptr{Cvoid} @0x00007f9dd4556d60
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cvoid is actually an alias for Nothing; void pointers print as Ptr{Nothing}.

src/cxxstr.jl Outdated
@@ -714,7 +716,6 @@ end
dne = CreateDeclRefExpr(C,FD)
argt = tuple(llvmargs...)
expr = CallDNE(C,dne,argt; argidxs = argidxs, symargs = symargs)
expr
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why get rid of this? If you do want to get rid of it, you can similarly ditch the assignment above it, since it's just the RHS that will be used/returned.

contains(xcode_path, "Xcode.app") && (xcode_path *= "/Toolchains/XcodeDefault.xctoolchain")
xcode_path *= "/"

xcode_path = "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there not still a way to get this automatically, e.g. via xcode-select?

@ararslan
Copy link
Member

ararslan commented Apr 11, 2019

This is really great work! I don't feel fully qualified to review it, but I've left a few comments in-line. Aside from those, I'll note:

  • LLVMBuilder now supports FreeBSD, so it should be possible to add that here as well
  • Can the Project.toml file now be reinstated?
  • Why require Julia 1.1 instead of 1.0?

Since we're not going to support binary build for v0.7-, these code are totally obsoleted.
@Gnimuc
Copy link
Member Author

Gnimuc commented Apr 12, 2019

Hi @ararslan, I've rebased this PR and applied your suggestions. I can successfully build libcxxffi binary for FreeBSD: https://github.com/Gnimuc/CxxBuilder/releases/tag/v0.0.4-1, but I don't have a BSD environment for testing whether the pre-built lib is dlopen-able. We also need to add an init function for it.

This PR is for Julia-1.1+LLVM-6.0.1 only. The main reason is the incompatibility between the official Julia binaries and LLVMBuilder releases. You could refer to previous discussions for details:

It's possible to add binary-build support for Julia-1.0, but I failed to make that work on Windows. For now, the libcxxffi binary used in this PR is actually Julia-master compatible which happens to be compatible with Julia-1.1 x86_64 platforms. It's hard to get everything works without the full compatibility between Julia and LLVMBuilder. Hopefully, we will have it in post-Julia-1.2-era.

@ararslan
Copy link
Member

I can give it a try on my FreeBSD system, and if all goes well we can turn on Cirrus CI for this repo to test on FreeBSD.

@ararslan
Copy link
Member

ararslan commented Apr 12, 2019

welp staticfloat/LLVMBuilder#45

EDIT: So apparently one should not be opening multiple copies of libLLVM, which is the cause of that issue. What is it that needs to be dlopened in this case? Is it libclang?

@Gnimuc
Copy link
Member Author

Gnimuc commented Apr 13, 2019

It's libcxxffi.so, but I think libLLVM should also be dlopen-able.

@kraftpunk97-zz
Copy link

@Gnimuc Not sure if this is still a WIP, but I got multiple errors when I tried to precompile your #master. Is this behaviour expected?

@Gnimuc
Copy link
Member Author

Gnimuc commented Apr 16, 2019

@kraftpunk97 It should work as long as you're working on macOS, Linux(64bit) or Windows(64bit). Could you comment those errors below?

BTW, you may need to manually git fetch the latest master.

@kraftpunk97-zz
Copy link

kraftpunk97-zz commented Apr 16, 2019

@Gnimuc Here's the error when I precompile Cxx, after calling ] add https://github.com/Gnimuc/Cxx.jl and building it...
It says could not add directory /usr/include to clang search path. Perhaps, this is an easy fix?

julia> using Cxx
[ Info: Recompiling stale cache file /Users/kartikeygupta/.julia/compiled/v1.1/Cxx/ESGkI.ji for Cxx [a0b5b9ef-44b7-5148-a2d1-f6db19f3c3d2]
WARNING: Could not add directory /usr/include to clang search path!
In file included from /Cxx.h:1:
In file included from /Users/kartikeygupta/.julia/packages/Cxx/mXAva/src/boot.h:16:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/cstring:61:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/string.h:61:15: fatal error: 'string.h' file not found
#include_next <string.h>
              ^~~~~~~~~~
In file included from /Cxx.h:1:
In file included from /Users/kartikeygupta/.julia/packages/Cxx/mXAva/src/CxxREPL/replpane.jl:83:
In file included from /Users/kartikeygupta/.julia/packages/Cxx/mXAva/src/CxxREPL/../../deps/usr/src/clang-6.0.1/include/clang/Parse/Parser.h:17:
In file included from /Users/kartikeygupta/.julia/packages/Cxx/mXAva/src/CxxREPL/../../deps/usr/src/clang-6.0.1/include/clang/AST/Availability.h:17:
In file included from /Users/kartikeygupta/.julia/packages/Cxx/mXAva/src/CxxREPL/../../deps/usr/src/clang-6.0.1/include/clang/Basic/SourceLocation.h:18:
In file included from /Users/kartikeygupta/.julia/packages/Cxx/mXAva/src/CxxREPL/../../deps/usr/src/clang-6.0.1/include/clang/Basic/LLVM.h:22:
In file included from /Users/kartikeygupta/.julia/packages/Cxx/mXAva/src/CxxREPL/../../deps/usr/build/clang-6.0.1/include/llvm/Support/Casting.h:19:
In file included from /Users/kartikeygupta/.julia/packages/Cxx/mXAva/src/CxxREPL/../../deps/usr/build/clang-6.0.1/include/llvm/Support/type_traits.h:19:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/utility:198:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/__tuple:80:44: error: base specifier must name a class
template <class _Tp> struct __tuple_like : false_type {};
                                           ^~~~~~~~~~
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/__tuple:165:63: error: base specifier must name a class
template <class... _Tp> struct __tuple_like<tuple<_Tp...> > : true_type {};
                                                              ^~~~~~~~~
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/__tuple:197:72: error: base specifier must name a class
template <class _T1, class _T2> struct __tuple_like<pair<_T1, _T2> > : true_type {};
                                                                       ^~~~~~~~~
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/__tuple:225:78: error: base specifier must name a class
template <class _Tp, size_t _Size> struct __tuple_like<array<_Tp, _Size> > : true_type {};
                                                                             ^~~~~~~~~
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/__tuple:299:71: error: base specifier must name a class
template <class... _Tp> struct __tuple_like<__tuple_types<_Tp...> > : true_type {};
                                                                      ^~~~~~~~~
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/__tuple:418:14: error: base specifier must name a class
    : public false_type {};
      ~~~~~~~^~~~~~~~~~
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/__tuple:433:14: error: base specifier must name a class
    : public false_type {};
      ~~~~~~~^~~~~~~~~~
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/__tuple:448:14: error: base specifier must name a class
    : public false_type {};
      ~~~~~~~^~~~~~~~~~
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/__tuple:472:37: error: base specifier must name a class
struct __tuple_like_with_size_imp : false_type {};
                                    ^~~~~~~~~~
In file included from /Cxx.h:1:
In file included from /Users/kartikeygupta/.julia/packages/Cxx/mXAva/src/CxxREPL/replpane.jl:83:
In file included from /Users/kartikeygupta/.julia/packages/Cxx/mXAva/src/CxxREPL/../../deps/usr/src/clang-6.0.1/include/clang/Parse/Parser.h:17:
In file included from /Users/kartikeygupta/.julia/packages/Cxx/mXAva/src/CxxREPL/../../deps/usr/src/clang-6.0.1/include/clang/AST/Availability.h:17:
In file included from /Users/kartikeygupta/.julia/packages/Cxx/mXAva/src/CxxREPL/../../deps/usr/src/clang-6.0.1/include/clang/Basic/SourceLocation.h:18:
In file included from /Users/kartikeygupta/.julia/packages/Cxx/mXAva/src/CxxREPL/../../deps/usr/src/clang-6.0.1/include/clang/Basic/LLVM.h:22:
In file included from /Users/kartikeygupta/.julia/packages/Cxx/mXAva/src/CxxREPL/../../deps/usr/build/clang-6.0.1/include/llvm/Support/Casting.h:19:
In file included from /Users/kartikeygupta/.julia/packages/Cxx/mXAva/src/CxxREPL/../../deps/usr/build/clang-6.0.1/include/llvm/Support/type_traits.h:19:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/utility:268:1: error: redefinition of 'swap' as different kind of symbol
swap(_Tp (&__a)[_Np], _Tp (&__b)[_Np]) _NOEXCEPT_(__is_nothrow_swappable<_Tp>::value)
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/type_traits:4602:1: note: previous definition is here
swap(_Tp (&__a)[_Np], _Tp (&__b)[_Np]) _NOEXCEPT_(__is_nothrow_swappable<_Tp>::value);
^
In file included from /Cxx.h:1:
In file included from /Users/kartikeygupta/.julia/packages/Cxx/mXAva/src/CxxREPL/replpane.jl:83:
In file included from /Users/kartikeygupta/.julia/packages/Cxx/mXAva/src/CxxREPL/../../deps/usr/src/clang-6.0.1/include/clang/Parse/Parser.h:17:
In file included from /Users/kartikeygupta/.julia/packages/Cxx/mXAva/src/CxxREPL/../../deps/usr/src/clang-6.0.1/include/clang/AST/Availability.h:17:
In file included from /Users/kartikeygupta/.julia/packages/Cxx/mXAva/src/CxxREPL/../../deps/usr/src/clang-6.0.1/include/clang/Basic/SourceLocation.h:18:
In file included from /Users/kartikeygupta/.julia/packages/Cxx/mXAva/src/CxxREPL/../../deps/usr/src/clang-6.0.1/include/clang/Basic/LLVM.h:22:
In file included from /Users/kartikeygupta/.julia/packages/Cxx/mXAva/src/CxxREPL/../../deps/usr/build/clang-6.0.1/include/llvm/Support/Casting.h:19:
In file included from /Users/kartikeygupta/.julia/packages/Cxx/mXAva/src/CxxREPL/../../deps/usr/build/clang-6.0.1/include/llvm/Support/type_traits.h:19:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/utility:950:10: error: no member named 'memcpy' in namespace 'std'; did you mean 'memchr'?
    std::memcpy(&__r, __p, sizeof(__r));
    ~~~~~^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/cstring:81:9: note: 'memchr' declared here
using ::memchr;
        ^
In file included from /Cxx.h:1:
In file included from /Users/kartikeygupta/.julia/packages/Cxx/mXAva/src/CxxREPL/replpane.jl:83:
In file included from /Users/kartikeygupta/.julia/packages/Cxx/mXAva/src/CxxREPL/../../deps/usr/src/clang-6.0.1/include/clang/Parse/Parser.h:17:
In file included from /Users/kartikeygupta/.julia/packages/Cxx/mXAva/src/CxxREPL/../../deps/usr/src/clang-6.0.1/include/clang/AST/Availability.h:17:
In file included from /Users/kartikeygupta/.julia/packages/Cxx/mXAva/src/CxxREPL/../../deps/usr/src/clang-6.0.1/include/clang/Basic/SourceLocation.h:18:
In file included from /Users/kartikeygupta/.julia/packages/Cxx/mXAva/src/CxxREPL/../../deps/usr/src/clang-6.0.1/include/clang/Basic/LLVM.h:22:
In file included from /Users/kartikeygupta/.julia/packages/Cxx/mXAva/src/CxxREPL/../../deps/usr/build/clang-6.0.1/include/llvm/Support/Casting.h:20:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/cassert:21:10: fatal error: 'assert.h' file not found
#include <assert.h>
         ^~~~~~~~~~
WARNING: Could not add directory /usr/include to clang search path!
In file included from /Cxx.cpp:1:
In file included from /Cxx.h:1:
In file included from /Users/kartikeygupta/.julia/packages/Cxx/mXAva/src/CxxREPL/replpane.jl:83:
In file included from /Users/kartikeygupta/.julia/packages/Cxx/mXAva/src/CxxREPL/../../deps/usr/src/clang-6.0.1/include/clang/Parse/Parser.h:22:
In file included from /Users/kartikeygupta/.julia/packages/Cxx/mXAva/src/CxxREPL/../../deps/usr/src/clang-6.0.1/include/clang/Lex/Preprocessor.h:18:
In file included from /Users/kartikeygupta/.julia/packages/Cxx/mXAva/src/CxxREPL/../../deps/usr/src/clang-6.0.1/include/clang/Basic/Builtins.h:19:
In file included from /Users/kartikeygupta/.julia/packages/Cxx/mXAva/src/CxxREPL/../../deps/usr/build/clang-6.0.1/include/llvm/ADT/ArrayRef.h:26:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/vector:328:38: error: no type named 'const_pointer' in 'std::__1::allocator_traits<std::__1::allocator<bool> >'
    typedef typename __alloc_traits::const_pointer   const_pointer;
            ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/vector:448:15: note: in instantiation of template class 'std::__1::__vector_base<bool, std::__1::allocator<bool> >' requested here
    : private __vector_base<_Tp, _Allocator>
              ^
/Users/kartikeygupta/.julia/packages/Cxx/mXAva/src/std.jl:43:12: note: in instantiation of template class 'std::__1::vector<bool, std::__1::allocator<bool> >' requested here
__juliavar1.size();
           ^
In file included from /Cxx.cpp:1:
In file included from /Cxx.h:1:
In file included from /Users/kartikeygupta/.julia/packages/Cxx/mXAva/src/CxxREPL/replpane.jl:83:
In file included from /Users/kartikeygupta/.julia/packages/Cxx/mXAva/src/CxxREPL/../../deps/usr/src/clang-6.0.1/include/clang/Parse/Parser.h:17:
In file included from /Users/kartikeygupta/.julia/packages/Cxx/mXAva/src/CxxREPL/../../deps/usr/src/clang-6.0.1/include/clang/AST/Availability.h:17:
In file included from /Users/kartikeygupta/.julia/packages/Cxx/mXAva/src/CxxREPL/../../deps/usr/src/clang-6.0.1/include/clang/Basic/SourceLocation.h:18:
In file included from /Users/kartikeygupta/.julia/packages/Cxx/mXAva/src/CxxREPL/../../deps/usr/src/clang-6.0.1/include/clang/Basic/LLVM.h:22:
In file included from /Users/kartikeygupta/.julia/packages/Cxx/mXAva/src/CxxREPL/../../deps/usr/build/clang-6.0.1/include/llvm/Support/Casting.h:21:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/memory:2166:38: error: no member named 'value' in 'std::__1::is_same<int, std::__1::allocator<bool> >'
  static_assert((!is_same<_T1, _T2>::value),
                  ~~~~~~~~~~~~~~~~~~~^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/vector:334:48: note: in instantiation of template class 'std::__1::__compressed_pair<int, std::__1::allocator<bool> >' requested here
    __compressed_pair<pointer, allocator_type> __end_cap_;
                                               ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/vector:448:15: note: in instantiation of template class 'std::__1::__vector_base<bool, std::__1::allocator<bool> >' requested here
    : private __vector_base<_Tp, _Allocator>
              ^
/Users/kartikeygupta/.julia/packages/Cxx/mXAva/src/std.jl:43:12: note: in instantiation of template class 'std::__1::vector<bool, std::__1::allocator<bool> >' requested here
__juliavar1.size();
           ^
In file included from /Cxx.cpp:1:
In file included from /Cxx.h:1:
In file included from /Users/kartikeygupta/.julia/packages/Cxx/mXAva/src/CxxREPL/replpane.jl:83:
In file included from /Users/kartikeygupta/.julia/packages/Cxx/mXAva/src/CxxREPL/../../deps/usr/src/clang-6.0.1/include/clang/Parse/Parser.h:22:
In file included from /Users/kartikeygupta/.julia/packages/Cxx/mXAva/src/CxxREPL/../../deps/usr/src/clang-6.0.1/include/clang/Lex/Preprocessor.h:18:
In file included from /Users/kartikeygupta/.julia/packages/Cxx/mXAva/src/CxxREPL/../../deps/usr/src/clang-6.0.1/include/clang/Basic/Builtins.h:19:
In file included from /Users/kartikeygupta/.julia/packages/Cxx/mXAva/src/CxxREPL/../../deps/usr/build/clang-6.0.1/include/llvm/ADT/ArrayRef.h:26:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/vector:457:30: error: '__alloc_traits' is a protected member of 'std::__1::__vector_base<bool, std::__1::allocator<bool> >'
    typedef typename __base::__alloc_traits          __alloc_traits;
                             ^
/Users/kartikeygupta/.julia/packages/Cxx/mXAva/src/std.jl:43:12: note: in instantiation of template class 'std::__1::vector<bool, std::__1::allocator<bool> >' requested here
__juliavar1.size();
           ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/vector:322:54: note: declared protected here
    typedef allocator_traits<allocator_type>         __alloc_traits;
                                                     ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/vector:458:30: error: 'reference' is a protected member of 'std::__1::__vector_base<bool, std::__1::allocator<bool> >'
    typedef typename __base::reference               reference;
                             ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/vector:323:54: note: declared protected here
    typedef value_type&                              reference;
                                                     ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/vector:459:30: error: 'const_reference' is a protected member of 'std::__1::__vector_base<bool, std::__1::allocator<bool> >'
    typedef typename __base::const_reference         const_reference;
                             ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/vector:324:54: note: declared protected here
    typedef const value_type&                        const_reference;
                                                     ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/vector:460:30: error: 'size_type' is a protected member of 'std::__1::__vector_base<bool, std::__1::allocator<bool> >'
    typedef typename __base::size_type               size_type;
                             ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/vector:325:54: note: declared protected here
    typedef typename __alloc_traits::size_type       size_type;
                                                     ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/vector:461:30: error: 'difference_type' is a protected member of 'std::__1::__vector_base<bool, std::__1::allocator<bool> >'
    typedef typename __base::difference_type         difference_type;
                             ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/vector:326:54: note: declared protected here
    typedef typename __alloc_traits::difference_type difference_type;
                                                     ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/vector:462:30: error: 'pointer' is a protected member of 'std::__1::__vector_base<bool, std::__1::allocator<bool> >'
    typedef typename __base::pointer                 pointer;
                             ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/vector:327:54: note: declared protected here
    typedef typename __alloc_traits::pointer         pointer;
                                                     ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/vector:463:30: error: 'const_pointer' is a protected member of 'std::__1::__vector_base<bool, std::__1::allocator<bool> >'
    typedef typename __base::const_pointer           const_pointer;
                             ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/vector:328:54: note: declared protected here
    typedef typename __alloc_traits::const_pointer   const_pointer;
                                                     ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/vector:469:78: error: no member named 'value' in 'std::__1::is_same<bool, bool>'
    static_assert((is_same<typename allocator_type::value_type, value_type>::value),
                   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

@fredrikekre
Copy link

Here's the error when I precompile Cxx, after calling ] add https://github.com/Gnimuc/Cxx.jl and building it...

Shouldn't you use the BB2 branch that this PR is based on? e.g. ] add https://github.com/Gnimuc/Cxx.jl#BB2

@Gnimuc
Copy link
Member Author

Gnimuc commented Apr 16, 2019

aha, I got that /usr/include-missing error before. Apple is the one to be blamed here. It could be fixed by https://apple.stackexchange.com/questions/337940/why-is-usr-include-missing-i-have-xcode-and-command-line-tools-installed-moja

Shouldn't you use the BB2 branch that this PR is based on? e.g. ] add https://github.com/Gnimuc/Cxx.jl#BB2

Yeah, that's actually my bad. I've updated the command in the OP. Currently, I manually keep syncing these two branches.

@kraftpunk97-zz
Copy link

Thanks @Gnimuc, problem solved

@Gnimuc
Copy link
Member Author

Gnimuc commented Apr 22, 2019

Hi @ararslan, did you successfully dlopen libcxxffi.so on FreeBSD? If not, I think we can try it again when Julia 1.2 is released. For now, let's merge this and tag a new version for Julia 1.1.

It turns out macOS SDK headers are not installed in `/usr/include` by default on Mojave.
@ararslan
Copy link
Member

Sorry for the delay in getting back to you on that. I just tried your FreeBSD-compatible release for CxxBuilder and I can dlopen libcxxffi.so just fine on FreeBSD 11.2 with Julia 1.1.

@Gnimuc Gnimuc merged commit 3ebd5a7 into JuliaInterop:master Apr 23, 2019
@oschulz
Copy link
Contributor

oschulz commented Apr 23, 2019

Seems to work out of the box (CentOS Singularity Container on Ubuntu)! Thanks so much for all your work on this, @Gnimuc and all the other that were involved! I was really missing Cxx.jl ...

@oschulz
Copy link
Contributor

oschulz commented Apr 23, 2019

Yep, just remembered, lol. Sorry! Hadn't used Cxx for too long. :-)

@oschulz
Copy link
Contributor

oschulz commented Apr 23, 2019

Another question: Is there an easy way to supply the binary deps in a central location (e.g. a container image), to speed up Cxx installation and keep the user .julia directories small(er)?

@Petr-Hlavenka
Copy link

Thank you for your effort!
Installs on windows without problem and runs as "experimental" as expected - I've started to fill windows specific issues to #409.

@Gnimuc
Copy link
Member Author

Gnimuc commented Apr 23, 2019

@oschulz It's possible to shrink deps size. I tried before but failed to do it correctly. For now, BB just ships the whole LLVM/Clang deps which are very huge. I think we can revisit it after Julia 1.2 has been released.

@grizzlysmit
Copy link

grizzlysmit commented Apr 23, 2019 via email

@Gnimuc
Copy link
Member Author

Gnimuc commented Apr 23, 2019

@grizzlysmit, unfortunately, Cxx doesn't support binary build for Julia 1.0.x for now. You may need to upgrade Julia to 1.1 firstly and then run dev Cxx. The reason why it doesn't support 1.0 is explained at this #406 (comment).

@Gnimuc Gnimuc mentioned this pull request Apr 23, 2019
@oschulz
Copy link
Contributor

oschulz commented Apr 23, 2019

@oschulz It's possible to shrink deps size. I tried before but failed to do it correctly. For now, BB just ships the whole LLVM/Clang deps which are very huge. I think we can revisit it after Julia 1.2 has been released.

Sounds good, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
8 participants