static-julia icon indicating copy to clipboard operation
static-julia copied to clipboard

Compilation fails under Windows10

Open ChristianKurz opened this issue 7 years ago • 9 comments

I tried using juliac.jl and get this error:

Build object file "hello.o":
`'C:\Users\Christian\AppData\Local\Julia-0.6.1\bin\julia.exe' -Cx86-64 '-JC:\Users\Christian\AppData\Local\Julia-0.6.1\lib\julia\sys.dll' --compile=yes --depwarn=yes --startup-file=no --output-o hello.o -e 'include("C:\\Users\\Christian\
\Documents\\Julia\\static-julia-master\\hello.jl"); push!(Base.LOAD_CACHE_PATH, "C:\\Users\\Christian\\.julia\\lib\\v0.6"); empty!(Base.LOAD_CACHE_PATH)'`
Build shared library "libhello.dll":
`'C:\Users\Christian\.julia\v0.6\WinRPM\deps\usr\x86_64-w64-mingw32\sys-root\mingw\bin\gcc.exe' -m64 -shared -o libhello.dll hello.o -std=gnu99 '-IC:\Users\Christian\AppData\Local\Julia-0.6.1\include\julia' -DJULIA_ENABLE_THREADING=1 '-L
C:\Users\Christian\AppData\Local\Julia-0.6.1\bin' -Wl,--stack,8388608 -ljulia -lopenlibm -Wl,--export-all-symbols`
Build executable file "hello.exe":
`'C:\Users\Christian\.julia\v0.6\WinRPM\deps\usr\x86_64-w64-mingw32\sys-root\mingw\bin\gcc.exe' -m64 -o hello.exe 'C:\Users\Christian\Documents\Julia\static-julia-master\program.c' libhello.dll -std=gnu99 '-IC:\Users\Christian\AppData\Lo
cal\Julia-0.6.1\include\julia' -DJULIA_ENABLE_THREADING=1 '-LC:\Users\Christian\AppData\Local\Julia-0.6.1\bin' -Wl,--stack,8388608 -ljulia -lopenlibm`
ERROR: LoadError: failed process: Process(`'C:\Users\Christian\.julia\v0.6\WinRPM\deps\usr\x86_64-w64-mingw32\sys-root\mingw\bin\gcc.exe' -m64 -o hello.exe 'C:\Users\Christian\Documents\Julia\static-julia-master\program.c' libhello.dll -
std=gnu99 '-IC:\Users\Christian\AppData\Local\Julia-0.6.1\include\julia' -DJULIA_ENABLE_THREADING=1 '-LC:\Users\Christian\AppData\Local\Julia-0.6.1\bin' -Wl,--stack,8388608 -ljulia -lopenlibm`, ProcessExited(1)) [1]
Stacktrace:
 [1] pipeline_error(::Base.Process) at .\process.jl:682
 [2] run(::Cmd) at .\process.jl:651
 [3] julia_compile(::String, ::String, ::Bool, ::Bool, ::Bool, ::Bool, ::Bool, ::Bool, ::Bool) at C:\Users\Christian\Documents\Julia\static-julia-master\juliac.jl:171
 [4] main(::Array{String,1}) at C:\Users\Christian\Documents\Julia\static-julia-master\juliac.jl:52
 [5] include_from_node1(::String) at .\loading.jl:576
 [6] include(::String) at .\sysimg.jl:14
 [7] process_options(::Base.JLOptions) at .\client.jl:305
 [8] _start() at .\client.jl:371
while loading C:\Users\Christian\Documents\Julia\static-julia-master\juliac.jl, in expression starting on line 215

MinGW was installed using WinRPM, i hardcoded the path to gcc.exe as my system could not find it otherwise. Any idea what i am doing wrong?

ChristianKurz avatar Oct 28 '17 16:10 ChristianKurz

I use x86_64-w64-mingw32-gcc on windows and it works just fine. Note that it is different from gcc.

joaquimg avatar Oct 29 '17 22:10 joaquimg

Please follow these instructions to install the x86_64-w64-mingw32-gcc compiler with Cygwin.

lucatrv avatar Oct 31 '17 22:10 lucatrv

Any idea what the reason is for this and if it's solvable? Would be nice to be able to use the gcc from WinRPM, to get automatic installation of gcc on windows working.

SimonDanisch avatar Feb 13 '18 17:02 SimonDanisch

Ah fixed it I think! I will fix this in https://github.com/SimonDanisch/PackageCompiler.jl/pull/18

SimonDanisch avatar Feb 13 '18 18:02 SimonDanisch

Awesome to see efforts unite with PackageCompiler.jl and this project. We should find a more general home. Perhaps in JuliaLang.

ViralBShah avatar Feb 13 '18 18:02 ViralBShah

I was just working on adding WinRPM support to static-julia, maybe I should stop and go ahead after it is merged into PackageCompiler.jl? @ViralBShah there is still PR #60 to merge (which allows to specify builddir without cprog), should I close it and open a new one on PackageCompiler.jl?

lucatrv avatar Feb 13 '18 22:02 lucatrv

@SimonDanisch Any preferences? I suspect it is better to work on PackageCompiler.jl going forward.

ViralBShah avatar Feb 14 '18 15:02 ViralBShah

sounds good to me!

SimonDanisch avatar Feb 14 '18 15:02 SimonDanisch

I closed PR #60, I am going to open next PRs on PackageCompiler.jl.

lucatrv avatar Feb 15 '18 00:02 lucatrv