Problem with "9 - Julia is fast.ipynb"

Hello dear community,

I downloaded the jupiter notebook file 9 Julia is fast.ipynb about benchmark from intro course (here).

When I run the first cell about C language (where it’s supposed to allow writing C in julia env) into in visual studio code, I obtained the following error :

{
	"name": "Base.IOError",
	"message": "IOError: could not spawn `gcc -fPIC -O3 -msse3 -xc -shared -o 'C:\\Users\\Benjamin\\AppData\\Local\\Temp\\jl_yxklA7KvEp.dll' -`: no such file or directory (ENOENT)",
	"stack": "IOError: could not spawn `gcc -fPIC -O3 -msse3 -xc -shared -o 'C:\\Users\\Benjamin\\AppData\\Local\\Temp\\jl_yxklA7KvEp.dll' -`: no such file or directory (ENOENT)

Stacktrace:
  [1] _spawn_primitive(file::String, cmd::Cmd, stdio::Vector{Union{RawFD, Base.Libc.WindowsRawSocket, IO}})
    @ Base .\\process.jl:128
  [2] #784
    @ .\\process.jl:139 [inlined]
  [3] setup_stdios(f::Base.var\"#784#785\"{Cmd}, stdios::Vector{Union{RawFD, Base.Libc.WindowsRawSocket, IO}})
    @ Base .\\process.jl:223
  [4] _spawn
    @ .\\process.jl:138 [inlined]
  [5] open(cmds::Cmd, stdio::Base.DevNull; write::Bool, read::Bool)
    @ Base .\\process.jl:397
  [6] open
    @ .\\process.jl:383 [inlined]
  [7] open(cmds::Cmd, mode::String, stdio::Base.DevNull)
    @ Base .\\process.jl:366
  [8] open
    @ .\\process.jl:361 [inlined]
  [9] open(f::var\"#9#10\", cmds::Cmd, args::String; kwargs::@Kwargs{})
    @ Base .\\process.jl:415
 [10] open(f::Function, cmds::Cmd, args::String)
    @ Base .\\process.jl:414

}

Does anyone has an idea where the problem comes from ?
Is my vs-code missing something ?

Thanks in advance !

watchben

This error message tells you what is going on — that notebook compiles C code by launching gcc to compile it, which works well on Unix and Mac systems that have a compiler named gcc installed, but is failing for you on Windows because you probably don’t have that compiler.

You could install gcc or modify that code to launch some other C compiler you have (changing the command-line arguments accordingly).

1 Like

Okay, I will check on that, thank you for your help !

** EDIT : problem solved :white_check_mark:**

I installed MinGW, following this vs-code [tutorial].(Get Started with C++ and MinGW-w64 in Visual Studio Code)

Thank you again @stevengj for your guidance !

Have a nice day !

1 Like