# 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:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![cserteGT3](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/csertegt3/32/8283_2.png) [@cserteGT3](https://discourse.julialang.org/u/cserteGT3)\
**Post date:** [January 10, 2019, 1:03pm UTC](https://discourse.julialang.org/t/current-state-of-cxx-jl/19466/1 "2019-01-10T13:03:05Z")

</div>

I’d like to inquire about the current state of Cxx.jl. I’m aware of [#390](https://github.com/Keno/Cxx.jl/issues/390), but not really understand when or how the issues will be resolved.  
My goal is to implement a small interface for the Kinect sensor (primarily for myself) and our work is mostly done on Windows, so the other part of my question is about it. Was/is/will it be supported? Also will this change with the 1.1 release of Julia (as the LLVM version changes if I know right)?  
I also know about CxxWrap.jl, but Cxx.jl looks easier to me. (I have only a little experience in C++, so it’s possible that this whole project is too hard for me, but I have the interest to learn more about it.)

---

<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:** [January 11, 2019, 1:38pm UTC](https://discourse.julialang.org/t/current-state-of-cxx-jl/19466/2 "2019-01-11T13:38:50Z")

</div>

X-ref:

> [@Cxx and 0.7](https://discourse.julialang.org/t/cxx-and-0-7/18907/8):
>
> |Julia1.0: | Cxx source build | Cxx binary build(download and unzip prebuild binaries) | |:—:|:—:|:—:|:—:expressionless: | Linux | white_check_mark master | white_check_mark [comment](https://github.com/Keno/Cxx.jl/issues/390#issuecomment-443914331) | | maxOS| white_check_mark [PR#400](https://github.com/Keno/Cxx.jl/pull/400) | white_check_mark [comment](https://github.com/Keno/Cxx.jl/issues/390#issuecomment-443914331) | | Windows| x | x|

---

<div class="post-metadata">

**Author:** ![cserteGT3](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/csertegt3/32/8283_2.png) [@cserteGT3](https://discourse.julialang.org/u/cserteGT3)\
**Post date:** [January 13, 2019, 3:26pm UTC](https://discourse.julialang.org/t/current-state-of-cxx-jl/19466/3 "2019-01-13T15:26:08Z")

</div>

Thank you! I missed that thread.

---

<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:** [April 16, 2019, 2:07pm UTC](https://discourse.julialang.org/t/current-state-of-cxx-jl/19466/4 "2019-04-16T14:07:07Z")

</div>

Hi, are you still there?

[https://github.com/JuliaInterop/Cxx.jl/pull/406](https://github.com/JuliaInterop/Cxx.jl/pull/406)

I’m going to merge this PR, but before that, I need more volunteers to test it. It would be great if you could give some feedback. 🙂

---

<div class="post-metadata">

**Author:** ![cserteGT3](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/csertegt3/32/8283_2.png) [@cserteGT3](https://discourse.julialang.org/u/cserteGT3)\
**Post date:** [April 16, 2019, 2:40pm UTC](https://discourse.julialang.org/t/current-state-of-cxx-jl/19466/5 "2019-04-16T14:40:13Z")

</div>

Definitely, but it’ll take some time as I’m not really experienced with c++ or Cxx itself. (But I happily help!)

---

<div class="post-metadata">

**Author:** ![cserteGT3](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/csertegt3/32/8283_2.png) [@cserteGT3](https://discourse.julialang.org/u/cserteGT3)\
**Post date:** [April 17, 2019, 7:51am UTC](https://discourse.julialang.org/t/current-state-of-cxx-jl/19466/6 "2019-04-17T07:51:40Z")

</div>

Installing the a package (` pkg> add https://github.com/Gnimuc/Cxx.jl#BB2`) went fine, and also `using Cxx`.  
I tried the first and second examples from the Cxx README, and they were also fine. I got an error at the third one.  
Then I tried: `pkg> test Cxx` which also errored. The whole session is below.

```julia
C:\Users\cstamas\Documents\GIT>mkdir cxxtest

C:\Users\cstamas\Documents\GIT>cd cxxtest

C:\Users\cstamas\Documents\GIT\cxxtest>julia
               _
   _ _ _(_)_ | Documentation: https://docs.julialang.org
  (_) | (_) (_) |
   _ _ _| |_ __ _ | Type "?" for help, "]?" for Pkg help.
  | | | | | | |/ _` | |
  | | |_| | | | (_| | | Version 1.1.0 (2019-01-21)
 _/ |\ __'_|_|_|\__'_| | Official https://julialang.org/ release
|__/ |

(v1.1) pkg> activate .

(cxxtest) pkg> add https://github.com/Gnimuc/Cxx.jl#BB2
  Updating registry at `C:\Users\cstamas\.julia\registries\General`
  Updating git-repo `https://github.com/JuliaRegistries/General.git`
   Cloning git-repo `https://github.com/Gnimuc/Cxx.jl`
  Updating git-repo `https://github.com/Gnimuc/Cxx.jl`
 Resolving package versions...
  Updating `C:\Users\cstamas\Documents\GIT\cxxtest\Project.toml`
  [a0b5b9ef] + Cxx v0.2.0+ #BB2 (https://github.com/Gnimuc/Cxx.jl)
  Updating `C:\Users\cstamas\Documents\GIT\cxxtest\Manifest.toml`
  [b99e7846] + BinaryProvider v0.5.3
  [a0b5b9ef] + Cxx v0.2.0+ #BB2 (https://github.com/Gnimuc/Cxx.jl)
  [2a0f44e3] + Base64
  [ade2ca70] + Dates
  [8ba89e20] + Distributed
  [b77e0a4c] + InteractiveUtils
  [76f85450] + LibGit2
  [8f399da3] + Libdl
  [56ddb016] + Logging
  [d6f4376e] + Markdown
  [44cfe95a] + Pkg
  [de0858da] + Printf
  [3fa0cd96] + REPL
  [9a3f8284] + Random
  [ea8e919c] + SHA
  [9e88b42a] + Serialization
  [6462fe0b] + Sockets
  [8dfed614] + Test
  [cf7118a7] + UUIDs
  [4ec0a83e] + Unicode
  Building Cxx → `C:\Users\cstamas\.julia\packages\Cxx\cSkk4\deps\build.log`

julia> using Cxx
[Info: Precompiling Cxx [a0b5b9ef-44b7-5148-a2d1-f6db19f3c3d2]

julia> cxx""" #include<iostream> """
true

julia> cxx"""
       void mycppfunction() {
       int z = 0;
       int y = 5;
       int x = 10;
       z = x*y + 2;
       std::cout << "The number is" << z << std::endl;
       }
       """
true

julia> julia_function() = @cxx mycppfunction()
julia_function (generic function with 1 method)

julia> julia_function()
The number is52

julia> jnum = 10
10

julia> cx
ERROR: UndefVarError: cx not defined

julia> cxx"""
                  void printme(int x) {
                                std::cout << x << std::endl;
                                           }
                                                  """
true

julia> @cxx printme(jnum)
10

julia> @cxx printme(100)
100

julia> cxx"""
                void printme(const char *name) {
                            // const char* => std::string
                                        std::string sname = name;
                                                    // print it out
                                                                std::cout << sname << std::endl;
                                                                         }
                                                                              """
true

julia> @cxx printme(pointer("John"))
LLVM ERROR: Program used external function '__gxx_personality_v0' which could not be resolved!

C:\Users\cstamas\Documents\GIT\cxxtest>julia --project
               _
   _ _ _(_)_ | Documentation: https://docs.julialang.org
  (_) | (_) (_) |
   _ _ _| |_ __ _ | Type "?" for help, "]?" for Pkg help.
  | | | | | | |/ _` | |
  | | |_| | | | (_| | | Version 1.1.0 (2019-01-21)
 _/ |\ __'_|_|_|\__'_| | Official https://julialang.org/ release
|__/ |

(cxxtest) pkg> test Cxx
   Testing Cxx
 Resolving package versions...
    Status `C:\Users\cstamas\AppData\Local\Temp\jl_2E46.tmp\Manifest.toml`
  [b99e7846] BinaryProvider v0.5.3
  [a0b5b9ef] Cxx v0.2.0+ #BB2 (https://github.com/Gnimuc/Cxx.jl)
  [2a0f44e3] Base64 [`@stdlib/Base64`]
  [ade2ca70] Dates [`@stdlib/Dates`]
  [8ba89e20] Distributed [`@stdlib/Distributed`]
  [b77e0a4c] InteractiveUtils [`@stdlib/InteractiveUtils`]
  [76f85450] LibGit2 [`@stdlib/LibGit2`]
  [8f399da3] Libdl [`@stdlib/Libdl`]
  [56ddb016] Logging [`@stdlib/Logging`]
  [d6f4376e] Markdown [`@stdlib/Markdown`]
  [44cfe95a] Pkg [`@stdlib/Pkg`]
  [de0858da] Printf [`@stdlib/Printf`]
  [3fa0cd96] REPL [`@stdlib/REPL`]
  [9a3f8284] Random [`@stdlib/Random`]
  [ea8e919c] SHA [`@stdlib/SHA`]
  [9e88b42a] Serialization [`@stdlib/Serialization`]
  [6462fe0b] Sockets [`@stdlib/Sockets`]
  [8dfed614] Test [`@stdlib/Test`]
  [cf7118a7] UUIDs [`@stdlib/UUIDs`]
  [4ec0a83e] Unicode [`@stdlib/Unicode`]

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 C:\Users\cstamas\.julia\packages\Cxx\cSkk4\test\runtests.jl:7
unknown function (ip: FFFFFFFFFFFFFFFF)
CloneFunctionAndAdjust at C:\Users\cstamas\.julia\packages\Cxx\cSkk4\deps\usr\bin\libcxxffi.DLL (unknown line)
ReplaceFunctionForDecl at C:\Users\cstamas\.julia\packages\Cxx\cSkk4\deps\usr\bin\libcxxffi.DLL (unknown line)
#ReplaceFunctionForDecl#5 at C:\Users\cstamas\.julia\packages\Cxx\cSkk4\src\clangwrapper.jl:385 [inlined]
#ReplaceFunctionForDecl at .\none:0
unknown function (ip: 000000001F2C2CC8)
jl_fptr_trampoline at /home/Administrator/buildbot/worker/package_win64/build/src\gf.c:1864
jl_apply_generic at /home/Administrator/buildbot/worker/package_win64/build/src\gf.c:2219
do_call at /home/Administrator/buildbot/worker/package_win64/build/src\interpreter.c:323
eval_value at /home/Administrator/buildbot/worker/package_win64/build/src\interpreter.c:411
eval_stmt_value at /home/Administrator/buildbot/worker/package_win64/build/src\interpreter.c:362 [inlined]
eval_body at /home/Administrator/buildbot/worker/package_win64/build/src\interpreter.c:755
eval_body at /home/Administrator/buildbot/worker/package_win64/build/src\interpreter.c:689
eval_body at /home/Administrator/buildbot/worker/package_win64/build/src\interpreter.c:689
jl_interpret_toplevel_thunk_callback at /home/Administrator/buildbot/worker/package_win64/build/src\interpreter.c:885
unknown function (ip: FFFFFFFFFFFFFFFE)
unknown function (ip: 000000000608EA8F)
unknown function (ip: 00000000000000A3)
jl_toplevel_eval_flex at /home/Administrator/buildbot/worker/package_win64/build/src\toplevel.c:764
jl_parse_eval_all at /home/Administrator/buildbot/worker/package_win64/build/src\ast.c:883
jl_load at /home/Administrator/buildbot/worker/package_win64/build/src\toplevel.c:826 [inlined]
jl_load_ at /home/Administrator/buildbot/worker/package_win64/build/src\toplevel.c:833
include at .\boot.jl:326 [inlined]
include_relative at .\loading.jl:1038
include at .\sysimg.jl:29
jl_apply_generic at /home/Administrator/buildbot/worker/package_win64/build/src\gf.c:2219
include at .\client.jl:403
jl_fptr_trampoline at /home/Administrator/buildbot/worker/package_win64/build/src\gf.c:1864
jl_apply_generic at /home/Administrator/buildbot/worker/package_win64/build/src\gf.c:2219
do_call at /home/Administrator/buildbot/worker/package_win64/build/src\interpreter.c:323
eval_value at /home/Administrator/buildbot/worker/package_win64/build/src\interpreter.c:411
eval_stmt_value at /home/Administrator/buildbot/worker/package_win64/build/src\interpreter.c:362 [inlined]
eval_body at /home/Administrator/buildbot/worker/package_win64/build/src\interpreter.c:755
jl_interpret_toplevel_thunk_callback at /home/Administrator/buildbot/worker/package_win64/build/src\interpreter.c:885
unknown function (ip: FFFFFFFFFFFFFFFE)
unknown function (ip: 0000000005B106EF)
unknown function (ip: FFFFFFFFFFFFFFFF)
jl_toplevel_eval_flex at /home/Administrator/buildbot/worker/package_win64/build/src\toplevel.c:764
jl_toplevel_eval_flex at /home/Administrator/buildbot/worker/package_win64/build/src\toplevel.c:713
jl_toplevel_eval at /home/Administrator/buildbot/worker/package_win64/build/src\toplevel.c:773 [inlined]
jl_toplevel_eval_in at /home/Administrator/buildbot/worker/package_win64/build/src\toplevel.c:793
eval at .\boot.jl:328
jl_apply_generic at /home/Administrator/buildbot/worker/package_win64/build/src\gf.c:2219
exec_options at .\client.jl:243
_start at .\client.jl:436
jl_apply_generic at /home/Administrator/buildbot/worker/package_win64/build/src\gf.c:2219
jl_apply at /home/Administrator/buildbot/worker/package_win64/build/src\julia.h:1571 [inlined]
true_main at /home/Administrator/buildbot/worker/package_win64/build/ui\repl.c:96
wmain at /home/Administrator/buildbot/worker/package_win64/build/ui\repl.c:217
__tmainCRTStartup at /usr/src/debug/mingw64-x86_64-runtime-5.0.3-1/crt\crtexe.c:329
mainCRTStartup at /usr/src/debug/mingw64-x86_64-runtime-5.0.3-1/crt\crtexe.c:212
BaseThreadInitThunk at C:\WINDOWS\System32\KERNEL32.DLL (unknown line)
RtlUserThreadStart at C:\WINDOWS\SYSTEM32\ntdll.dll (unknown line)
Allocations: 16304048 (Pool: 16301277; Big: 2771); GC: 38
ERROR: Package Cxx errored during testing

julia> versioninfo()
Julia Version 1.1.0
Commit 80516ca202 (2019-01-21 21:24 UTC)
Platform Info:
  OS: Windows (x86_64-w64-mingw32)
  CPU: Intel(R) Core(TM) i7-3632QM CPU @ 2.20GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-6.0.1 (ORCJIT, ivybridge)

(cxxtest) pkg> st
    Status `C:\Users\cstamas\Documents\GIT\cxxtest\Project.toml`
  [a0b5b9ef] Cxx v0.2.0+ #BB2 (https://github.com/Gnimuc/Cxx.jl)

```

I’m happy to try anything else, just don’t know what.

---

<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:** [April 17, 2019, 11:39am UTC](https://discourse.julialang.org/t/current-state-of-cxx-jl/19466/7 "2019-04-17T11:39:44Z")

</div>

Those errors are expected since Windows support is still experimental for now. Thanks for the feedback! 😉

---

<div class="post-metadata">

**Author:** ![cserteGT3](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/csertegt3/32/8283_2.png) [@cserteGT3](https://discourse.julialang.org/u/cserteGT3)\
**Post date:** [April 17, 2019, 4:06pm UTC](https://discourse.julialang.org/t/current-state-of-cxx-jl/19466/8 "2019-04-17T16:06:22Z")

</div>

I tested at work on a Linux server (Ubuntu 16.04.6). The installation went fine and also all the examples I tried (1 to 7). (Although at the fourth example the function returned immediately and didn’t wait for a key.) Testing the package was also succesful.

```julia
(cxxtest) pkg> test Cxx
   Testing Cxx
 Resolving package versions...
    Status `/tmp/tmpmOcWmI/Manifest.toml`
  [b99e7846] BinaryProvider v0.5.3
  [a0b5b9ef] Cxx v0.2.0+ #BB2 (https://github.com/Gnimuc/Cxx.jl)
  [2a0f44e3] Base64 [`@stdlib/Base64`]
  [ade2ca70] Dates [`@stdlib/Dates`]
  [8ba89e20] Distributed [`@stdlib/Distributed`]
  [b77e0a4c] InteractiveUtils [`@stdlib/InteractiveUtils`]
  [76f85450] LibGit2 [`@stdlib/LibGit2`]
  [8f399da3] Libdl [`@stdlib/Libdl`]
  [56ddb016] Logging [`@stdlib/Logging`]
  [d6f4376e] Markdown [`@stdlib/Markdown`]
  [44cfe95a] Pkg [`@stdlib/Pkg`]
  [de0858da] Printf [`@stdlib/Printf`]
  [3fa0cd96] REPL [`@stdlib/REPL`]
  [9a3f8284] Random [`@stdlib/Random`]
  [ea8e919c] SHA [`@stdlib/SHA`]
  [9e88b42a] Serialization [`@stdlib/Serialization`]
  [6462fe0b] Sockets [`@stdlib/Sockets`]
  [8dfed614] Test [`@stdlib/Test`]
  [cf7118a7] UUIDs [`@stdlib/UUIDs`]
  [4ec0a83e] Unicode [`@stdlib/Unicode`]
Test Summary: | Pass Total
import without using Cxx (#316) | 2 2
foo
foo
foo
foo
foo
foo
foo
foo
foo
foo
1
2
3
4
5
6
7
8
9
10
Test Summary: | Pass Total
StdString | 3 3
Test Summary: | Pass Total
StdVector | 70 70
e = (class std::length_error &) {
}

Test Summary: | Pass Total
Exceptions | 2 2
   Testing Cxx tests passed

julia> versioninfo()
Julia Version 1.1.0
Commit 80516ca202 (2019-01-21 21:24 UTC)
Platform Info:
  OS: Linux (x86_64-pc-linux-gnu)
  CPU: Intel(R) Xeon(R) CPU E5-2683 v4 @ 2.10GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-6.0.1 (ORCJIT, broadwell)

```

Should I try any other tests (or examples)?

---

<div class="post-metadata">

**Author:** ![ExpandingMan](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/expandingman/32/866_2.png) [@ExpandingMan](https://discourse.julialang.org/u/ExpandingMan)\
**Post date:** [April 17, 2019, 4:18pm UTC](https://discourse.julialang.org/t/current-state-of-cxx-jl/19466/9 "2019-04-17T16:18:02Z")

</div>

I’m really happy to see that this is now in the `JuliaInterop` github group, when did that happen? Hopefully that is an indication that it will be more realistic to actually merge PR’s in the near future.

---

<div class="post-metadata">

**Author:** ![ffevotte](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ffevotte/32/6587_2.png) [@ffevotte](https://discourse.julialang.org/u/ffevotte)\
**Post date:** [April 17, 2019, 10:04pm UTC](https://discourse.julialang.org/t/current-state-of-cxx-jl/19466/10 "2019-04-17T22:04:39Z")

</div>

> [@Gnimuc](#):
>
> I’m going to merge this PR, but before that, I need more volunteers to test it. It would be great if you could give some feedback. 🙂

Thanks for this work!

I can confirm that everything went well when I tested on my system (Debian testing) : installation, examples from the README, and test suite.

---

<div class="post-metadata">

**Author:** ![cdsousa](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/cdsousa/32/215553_2.png) [@cdsousa](https://discourse.julialang.org/u/cdsousa)\
**Post date:** [April 18, 2019, 10:49am UTC](https://discourse.julialang.org/t/current-state-of-cxx-jl/19466/11 "2019-04-18T10:49:54Z")

</div>

It’s working great for me in both Ubuntu 18.04 and MacOS!

---

<div class="post-metadata">

**Author:** ![dpo](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dpo/32/3335_2.png) [@dpo](https://discourse.julialang.org/u/dpo)\
**Post date:** [April 30, 2019, 9:06pm UTC](https://discourse.julialang.org/t/current-state-of-cxx-jl/19466/12 "2019-04-30T21:06:45Z")

</div>

Is it necessary to install all of Xcode to run Cxx? I have the command-line tools, but `]test Cxx` fails with `ERROR: LoadError: LoadError: Could not find C++ standard library. Is XCode installed?`. I’d rather not install all of Xcode if I can avoid it.

Thanks.

---

<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 1, 2019, 12:18am UTC](https://discourse.julialang.org/t/current-state-of-cxx-jl/19466/13 "2019-05-01T00:18:53Z")

</div>

I tried building Cxx, but it ate up 96 GB of ram before running out and throwing an error,  
That computer has 32 GB of RAM, and I thought 64 GB of swap would be enough.

---

<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, 3:02am UTC](https://discourse.julialang.org/t/current-state-of-cxx-jl/19466/14 "2019-05-01T03:02:29Z")

</div>

do you know another way to find those libc++ headers?

[https://github.com/JuliaInterop/Cxx.jl/blob/47f5215412de63158cdbff68b53b6b620460dba0/src/initialization.jl#L221-L223](https://github.com/JuliaInterop/Cxx.jl/blob/47f5215412de63158cdbff68b53b6b620460dba0/src/initialization.jl#L221-L223)

---

<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, 3:04am UTC](https://discourse.julialang.org/t/current-state-of-cxx-jl/19466/15 "2019-05-01T03:04:40Z")

</div>

did you build Cxx from source or use pre-built binaries? Could you post those errors?

---

<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 1, 2019, 3:25am UTC](https://discourse.julialang.org/t/current-state-of-cxx-jl/19466/16 "2019-05-01T03:25:42Z")

</div>

Trying to build Cxx master on a 5 day old Julia master, with a different computer that has 8 x 16G sticks of RAM (although `htop` shows 126G total):

```julia
┌ Error: Error building `Cxx`, showing the last 100 of log: 
│ virtual memory exhausted: Cannot allocate memory
│ virtual memory exhausted: Cannot allocate memory
│ virtual memory exhausted: Cannot allocate memory
│ virtual memory exhausted: Cannot allocate memory
│ virtual memory exhausted: Cannot allocate memory
│ virtual memory exhausted: Cannot allocate memory
│ virtual memory exhausted: Cannot allocate memory
│ virtual memory exhausted: Cannot allocate memory
│ virtual memory exhausted: Cannot allocate memory
│ virtual memory exhausted: Cannot allocate memory
│ virtual memory exhausted: Cannot allocate memory
│ virtual memory exhausted: Cannot allocate memory
│ {standard input}: {standard input}: {standard input}: Assembler messages:
│ Assembler messages:
│ Assembler messages:
│ {standard input}:445351: {standard input}:402343: {standard input}:835515: Fatal error: Fatal error: Fatal error: can't close CMakeFiles/clangStaticAnalyzerCheckers.dir/ReturnPointerRangeChecker.cpp.o: memory exhaustedcan't close CMakeFiles/clangStaticAnalyzerCheckers.dir/ObjCSelfInitChecker.cpp.o: memory exhaustedcan't close CMakeFiles/clangStaticAnalyzerCheckers.dir/ObjCSuperDeallocChecker.cpp.o: memory exhausted

```

I was watching htop to see the memory getting consumed by the build.

You can’t add the release version of Cxx with Julia master because of unsatisfiable requirements:

```julia
(v1.3) pkg> add Cxx
 Resolving package versions...
ERROR: Unsatisfiable requirements detected for package Cxx [a0b5b9ef]:
 Cxx [a0b5b9ef] log:
 ├─possible versions are: [0.0.1-0.0.2, 0.1.0-0.1.1, 0.2.0, 0.3.0] or uninstalled
 ├─restricted to versions * by an explicit requirement, leaving only versions [0.0.1-0.0.2, 0.1.0-0.1.1, 0.2.0, 0.3.0]
 └─restricted by julia compatibility requirements to versions: uninstalled — no versions left

```

I should just checkout v1.2.

---

<div class="post-metadata">

**Author:** ![dpo](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dpo/32/3335_2.png) [@dpo](https://discourse.julialang.org/u/dpo)\
**Post date:** [May 1, 2019, 3:26am UTC](https://discourse.julialang.org/t/current-state-of-cxx-jl/19466/17 "2019-05-01T03:26:22Z")

</div>

They are installed with the command-line tools:

```julia
dpo:~ $ xcode-select --print-path
/Library/Developer/CommandLineTools
dpo:~ $ ls /Library/Developer/CommandLineTools/usr/include/c++/v1
__bit_reference complex.h new
__bsd_locale_defaults.h condition_variable numeric
__bsd_locale_fallbacks.h csetjmp optional
__config csignal ostream
...
compare module.modulemap
complex mutex

```

There’s no such folder as `/Library/Developer/CommandLineTools/usr/lib/c++/v1` but `libc++.dylib` is in `/usr/lib`.

I’m just wondering if we can get by with the command-line tools only.

---

<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, 3:32am UTC](https://discourse.julialang.org/t/current-state-of-cxx-jl/19466/18 "2019-05-01T03:32:01Z")

</div>

AFAIK, current Cxx master doesn’t work on Julia master because of [this PR](https://github.com/JuliaLang/julia/pull/31272). But I think you could manually apply [this patch](https://github.com/JuliaInterop/Cxx.jl/pull/407) and built Julia without BB2-build enabled.

---

<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, 3:36am UTC](https://discourse.julialang.org/t/current-state-of-cxx-jl/19466/19 "2019-05-01T03:36:25Z")

</div>

I guess it’s possible since we only need those headers, I’ll submit a PR later on.

---

<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 1, 2019, 4:25am UTC](https://discourse.julialang.org/t/current-state-of-cxx-jl/19466/20 "2019-05-01T04:25:04Z")

</div>

I tried checking out that PR and merging in the latest changes, but the same problem. The last few lines:

```julia
virtual memory exhausted: Cannot allocate memory
│ make[3]: *** [lib/Parse/CMakeFiles/clangParse.dir/build.make:232: lib/Parse/CMakeFiles/clangParse.dir/ParseTentative.cpp.o] Error 1
│ make[3]: Leaving directory '/home/chriselrod/.julia/dev/Cxx/deps/build/clang-6.0.1'
│ make[2]: *** [CMakeFiles/Makefile2:2481: lib/Parse/CMakeFiles/clangParse.dir/all] Error 2
│ 
│ cc1plus: out of memory allocating 22586734432 bytes after a total of 423505920 bytes
│ make[3]: *** [lib/StaticAnalyzer/Checkers/CMakeFiles/clangStaticAnalyzerCheckers.dir/build.make:648: lib/StaticAnalyzer/Checkers/CMakeFiles/clangStaticAnalyzerCheckers.dir/MallocSizeofChecker.cpp.o] Error 1
│ make[3]: Leaving directory '/home/chriselrod/.julia/dev/Cxx/deps/build/clang-6.0.1'
│ make[2]: *** [CMakeFiles/Makefile2:3732: lib/StaticAnalyzer/Checkers/CMakeFiles/clangStaticAnalyzerCheckers.dir/all] Error 2
│ 
│ cc1plus: out of memory allocating 7083286720 bytes after a total of 2427383808 bytes
│ make[3]: *** [lib/Format/CMakeFiles/clangFormat.dir/build.make:128: lib/Format/CMakeFiles/clangFormat.dir/FormatTokenLexer.cpp.o] Error 1
│ make[3]: Leaving directory '/home/chriselrod/.julia/dev/Cxx/deps/build/clang-6.0.1'
│ make[2]: *** [CMakeFiles/Makefile2:3842: lib/Format/CMakeFiles/clangFormat.dir/all] Error 2
│ make[2]: Leaving directory '/home/chriselrod/.julia/dev/Cxx/deps/build/clang-6.0.1'
│ make[1]: *** [Makefile:130: all] Error 2
│ make[1]: Leaving directory '/home/chriselrod/.julia/dev/Cxx/deps/build/clang-6.0.1'
│ make: *** [BuildBootstrap.Makefile:114: build/clang-6.0.1/lib/libclangCodeGen.a] Error 2
│ [ Info: Building julia source build
│ ERROR: Error while loading expression starting at /home/chriselrod/.julia/dev/Cxx/deps/build.jl:40
│ caused by [exception 1]
│ failed process: Process(`make -j28 -f BuildBootstrap.Makefile BASE_JULIA_BIN=/home/chriselrod/Documents/languages/julia/usr/bin BASE_JULIA_SRC=/home/chriselrod/Documents/languages/julia/usr/bin/../..`, ProcessExited(2)) [2]

```

Subjectively, I believe it took much longer.  
There was one process that lasted a very long time (\>7 minutes of 100%CPU when I quit watching) that used over \> 80G. Another concurrent process slowly crept up in memory usage, reaching 40G the last time I looked at it.

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