# Error in compiling torchx

**URL:** <https://forum.elixirforum.com/t/error-in-compiling-torchx/71221>\
**Category:** Questions\
**Tags:** nx, torchx\
**Created:** [June 11, 2025, 6:24am UTC](https://forum.elixirforum.com/t/error-in-compiling-torchx/71221 "2025-06-11T06:24:04Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![DOVECYJ](https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/dovecyj/32/37174_2.png) [@DOVECYJ](https://forum.elixirforum.com/u/DOVECYJ)\
**Post date:** [June 11, 2025, 6:24am UTC](https://forum.elixirforum.com/t/error-in-compiling-torchx/71221/1 "2025-06-11T06:24:04Z")

</div>

My environment：

```elixir
Erlang/OTP 27 [erts-15.2.7] [source] [64-bit] [smp:24:24] [ds:24:24:10] [async-threads:1] [jit:ns]

Elixir 1.18.4 (compiled with Erlang/OTP 27)

```

My mix deps：

```elixir
{:axon, "~> 0.7.0"},
{:torchx, "~> 0.9.0"}

```

My os: windows 11.

My libtorch library: `libtorch-2.4.0-cpu.zip`

I’m learning the example in [Axon docs](https://hexdocs.pm/axon/Axon.html). I want to use torchx backend in my windows computer. But I got an error when compiling torchx. It says “there is no CMakeLists.txt in \_build/dev/lib/torchx/cmake directory.”

I found `cmake` function in `deps/torchx/mix.exs` file, it just create the ‘cmake’ directory:

```elixir
File.mkdir_p!(cmake_build_dir)

```

And I add the following code after that:

```elixir
File.cp!("CMakeLists.txt", Path.join(cmake_build_dir, "CMakeLists.txt"))

```

And then `mix deps.compile torchx` is going to work.

I wonder is this a bug, or, it’s my fault in using?

* * *

There is another issue. I am using VSCode, which seems to be incompatible with my ElixirLS plugin. ElixirLS compiles my dependencies on its own, causing some issues with the CMake cache. I am not sure what is going on.

---

<div class="post-metadata">

**Author:** ![DOVECYJ](https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/dovecyj/32/37174_2.png) [@DOVECYJ](https://forum.elixirforum.com/u/DOVECYJ)\
**Post date:** [June 26, 2025, 8:34am UTC](https://forum.elixirforum.com/t/error-in-compiling-torchx/71221/2 "2025-06-26T08:34:42Z")

</div>

It’s my fault, I miss some environment variable.
