Current state of Cxx.jl?

I have no idea about this. Could you give it a try with only a single thread enabled? make -j1

hi @dpo, could you give this PR a try?

1 Like

The problem was that the CFLAGS environment variable on that OS is set by default to include (among other things) -g. Building clang with debug info apparently consumes oodles of memory.
Now I get:

In file included from src/clang-6.0.1/include/clang/AST/RecursiveASTVisitor.h:24,
                 from ../src/bootstrap.cpp:53:
src/clang-6.0.1/include/clang/AST/DeclOpenMP.h:97:1: warning: multi-line comment [-Wcomment]
   97 | /// #pragma omp declare reduction (foo : int,float : omp_out += omp_in) \
      | ^
../src/bootstrap.cpp:150:38: error: ‘C’ was not declared in this scope; did you mean ‘llvm::CallingConv::C’?
  150 |   JL_DLLEXPORT const clang::Type *EX(C) {                          \
      |                                      ^
../src/bootstrap.cpp:154:3: note: in expansion of macro ‘TYPE_ACCESS’
  154 |   TYPE_ACCESS(cT_char,CharTy)
      |   ^~~~~~~~~~~
In file included from /home/chriselrod/Documents/languages/julia6/usr/bin/../include/llvm/IR/Function.h:29,
                 from /home/chriselrod/Documents/languages/julia6/usr/bin/../include/llvm/IR/Module.h:26,
                 from /home/chriselrod/Documents/languages/julia6/usr/bin/../include/llvm/IR/ModuleSummaryIndex.h:27,
                 from /home/chriselrod/Documents/languages/julia6/usr/bin/../include/llvm/Bitcode/BitcodeWriter.h:18,
                 from ../src/bootstrap.cpp:34:
/home/chriselrod/Documents/languages/julia6/usr/bin/../include/llvm/IR/CallingConv.h:35:5: note: ‘llvm::CallingConv::C’ declared here
   35 |     C = 0,
      |     ^

Sorry, that’s a mistake when I was merging the old commits from here. This line should be JL_DLLEXPORT const clang::Type *EX(CxxInstance *Cxx) { \.

Great. It’s now build succesfuly.
But, I’m not running into:

julia> using Cxx
[ Info: Precompiling Cxx [a0b5b9ef-44b7-5148-a2d1-f6db19f3c3d2]
ERROR: Error while loading expression starting at /home/chriselrod/.julia/packages/Cxx/VbI6P/src/Cxx.jl:170
caused by [exception 2]
Error while loading expression starting at /home/chriselrod/.julia/packages/Cxx/VbI6P/src/initialization.jl:420
caused by [exception 1]
Could not find C++ standard library
Stacktrace:
 [1] error(::String) at ./error.jl:33
 [2] CollectLinuxHeaderPaths!(::Array{Tuple{String,Int32},1}) at /home/chriselrod/.julia/packages/Cxx/VbI6P/src/initialization.jl:333

On this computer, the path to gcc is: /usr/lib64/gcc/x86_64-generic-linux/9/
The X86_64Triples is x86_64-generic-linux, which isn’t currently in that vector of possibilities.

Running ScanLibDirForGCCTriple using x86_64-generic-linux, I get:

julia> Version, VersionString, GccPath
(v"9.0.0", "9", "/usr/lib64/gcc/x86_64-generic-linux/9/../../..")

shell> gcc --version
gcc (Clear Linux OS for Intel Architecture) 9.1.1 20190506 gcc-9-branch@270912
Copyright (C) 2019 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

It looks like the correct answer should be v"9.1.1", and not v"9.0.0", but that’s probably close enough to not matter?

It’s OK as long as Version is not v0.0.0. Would you mind submitting a PR to add the missing triple?

I just want to say - incredible work with this package and getting it working in 1.x. It is really really impressive.

5 Likes