# Current state of Cxx.jl?

**URL:** <https://discourse.julialang.org/t/current-state-of-cxx-jl/19466>\
**Category:** General Usage\
**Tags:** question, cxx\
**Created:** [January 10, 2019, 1:03pm UTC](https://discourse.julialang.org/t/current-state-of-cxx-jl/19466 "2019-01-10T13:03:05Z")\
**Posts on this page:** 7\
**Page:** 2

<div class="post-metadata">

**Author:** ![Gnimuc](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gnimuc/32/2194_2.png) [@Gnimuc](https://discourse.julialang.org/u/Gnimuc)\
**Post date:** [May 1, 2019, 7:48am UTC](https://discourse.julialang.org/t/current-state-of-cxx-jl/19466/21 "2019-05-01T07:48:28Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Gnimuc](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gnimuc/32/2194_2.png) [@Gnimuc](https://discourse.julialang.org/u/Gnimuc)\
**Post date:** [May 1, 2019, 7:51am UTC](https://discourse.julialang.org/t/current-state-of-cxx-jl/19466/22 "2019-05-01T07:51:41Z")

</div>

hi @dpo, could you give [this PR](https://github.com/JuliaInterop/Cxx.jl/pull/414) a try?

---

<div class="post-metadata">

**Author:** ![Elrod](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/elrod/32/22461_2.png) [@Elrod](https://discourse.julialang.org/u/Elrod)\
**Post date:** [May 6, 2019, 10:15pm UTC](https://discourse.julialang.org/t/current-state-of-cxx-jl/19466/23 "2019-05-06T22:15:01Z")

</div>

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:

```julia
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,
      | ^

```

---

<div class="post-metadata">

**Author:** ![Gnimuc](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gnimuc/32/2194_2.png) [@Gnimuc](https://discourse.julialang.org/u/Gnimuc)\
**Post date:** [May 7, 2019, 5:27am UTC](https://discourse.julialang.org/t/current-state-of-cxx-jl/19466/24 "2019-05-07T05:27:20Z")

</div>

Sorry, that’s a mistake when I was merging the old commits from [here](https://github.com/Gnimuc/CxxBuilder/blob/master/libcxxffi/bootstrap.cpp#L160). [This line](https://github.com/JuliaInterop/Cxx.jl/blob/4fab8f11792831c4368a753626861b5e5421d4f0/src/bootstrap.cpp#L150) should be `JL_DLLEXPORT const clang::Type *EX(CxxInstance *Cxx) { \`.

---

<div class="post-metadata">

**Author:** ![Elrod](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/elrod/32/22461_2.png) [@Elrod](https://discourse.julialang.org/u/Elrod)\
**Post date:** [May 7, 2019, 8:37am UTC](https://discourse.julialang.org/t/current-state-of-cxx-jl/19466/25 "2019-05-07T08:37:15Z")

</div>

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

```julia
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](https://github.com/JuliaInterop/Cxx.jl/blob/master/src/initialization.jl#L293) is `x86_64-generic-linux`, which isn’t currently in that vector of possibilities.

Running [ScanLibDirForGCCTriple](https://github.com/JuliaInterop/Cxx.jl/blob/master/src/initialization.jl#L242) using `x86_64-generic-linux`, I get:

```julia
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?

---

<div class="post-metadata">

**Author:** ![Gnimuc](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gnimuc/32/2194_2.png) [@Gnimuc](https://discourse.julialang.org/u/Gnimuc)\
**Post date:** [May 7, 2019, 10:59am UTC](https://discourse.julialang.org/t/current-state-of-cxx-jl/19466/26 "2019-05-07T10:59:34Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![pazzo83](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pazzo83/32/232_2.png) [@pazzo83](https://discourse.julialang.org/u/pazzo83)\
**Post date:** [May 7, 2019, 2:47pm UTC](https://discourse.julialang.org/t/current-state-of-cxx-jl/19466/27 "2019-05-07T14:47:48Z")

</div>

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

[Previous page](https://discourse.julialang.org/t/current-state-of-cxx-jl/19466.md?page=1)
