Coder Social home page Coder Social logo

Comments (20)

blegat avatar blegat commented on July 29, 2024

This is a follow up from this reddit post

from buildexecutable.jl.

ihnorton avatar ihnorton commented on July 29, 2024

The issue is that the output of BuildExecutable does not actually load the associated precompiled image, so everything must be JIT'd again before the app can do anything. You can get normal (faster) startup by specifying the image manually:

JULIA_SYSIMAGE=libapp.dylib ./app Hello

(from the build directory, using the build command from your reddit post)

from buildexecutable.jl.

pron avatar pron commented on July 29, 2024

It works! Thank you very much. You may want to consider adding it to the README.
Could this be automatically done by the executable?

P.S.

I'm very new to Julia. Where is the best place to ask questions? Reddit? SO? discourse.julialang.org?

from buildexecutable.jl.

MatthiasErdmann avatar MatthiasErdmann commented on July 29, 2024

Hi,
I am also very new to Julia (have been using Matlab/Python for many years). I am using Julia 0.5.0 64bit on Windows and have tried to compile a simple program using build_executable, but I have not been successful - the process always breaks with a Load Error:

ERROR: LoadError: failed process: Process('C:\Users\merdmann\.julia\v0.5\WinRPM\deps\usr\x86_64-w64-mingw32\sys-root\mingw\bin\gcc.exe' '-LC:\Julia-0.5.0\bin' -shared -ljulia -lssp -o 'C:\Julia-0.5.0\bin\libapp.dll' 'C:\Julia-0.5.0\bin\libapp.o', ProcessExited(1)) [1]
in pipeline_error(::Base.Process) at .\process.jl:616
in run at .\process.jl:592 [inlined]
in link_sysimg(::String, ::String, ::Bool) at C:\Users\merdmann.julia\v0.5\BuildExecutable\src\build_sysimg.jl:151
in (::##2#3{Bool,String})() at C:\Users\merdmann.julia\v0.5\BuildExecutable\src\build_sysimg.jl:80
in cd(::##2#3{Bool,String}, ::String) at .\file.jl:48
in #build_sysimg#1(::Bool, ::Bool, ::Function, ::String, ::String, ::String) at C:\Users\merdmann.julia\v0.5\BuildExecutable\src\build_sysimg.jl:38
in (::#kw##build_sysimg)(::Array{Any,1}, ::#build_sysimg, ::String, ::String, ::String) at .<missing>:0
in include_from_node1(::String) at .\loading.jl:488
in process_options(::Base.JLOptions) at .\client.jl:262
in _start() at .\client.jl:318
while loading C:\Users\merdmann.julia\v0.5\BuildExecutable\src\build_sysimg.jl, in expression starting on line 187

Would you mind to help me with this problem? Thanks a lot!

from buildexecutable.jl.

blegat avatar blegat commented on July 29, 2024

Julia just says that the command has failed and does not give more info.
Could you run the command (i.e. C:\Users\merdmann\.julia\v0.5\WinRPM\deps\usr\x86_64-w64-mingw32\sys-root\mingw\bin\gcc.exe' '-LC:\Julia-0.5.0\bin' -shared -ljulia -lssp -o 'C:\Julia-0.5.0\bin\libapp.dll' 'C:\Julia-0.5.0\bin\libapp.o) in a terminal and tell us the output ?

from buildexecutable.jl.

MatthiasErdmann avatar MatthiasErdmann commented on July 29, 2024

Unfortunately, the command does not produce any output - the command syntax seems to be incorrect.

The final Julia error message is:

LoadError: failed process: Process('C:\Julia-0.5.0\bin\julia' 'C:\Users\merdmann\.julia\v0.5\BuildExecutable\src\build_sysimg.jl' 'C:\Julia-0.5.0\bin\libapp' native 'C:\Users\merdmann\AppData\Local\Temp\jl_D63E.tmp\userimg.jl' --force, ProcessExited(1)) [1]
in pipeline_error(::Base.Process) at .\process.jl:616
in run at .\process.jl:592 [inlined]
in #build_executable#1(::Bool, ::Bool, ::Function, ::String, ::String, ::String, ::String) at C:\Users\merdmann.julia\v0.5\BuildExecutable\src\BuildExecutable.jl:116
in build_executable(::String, ::String, ::String, ::String) at C:\Users\merdmann.julia\v0.5\BuildExecutable\src\BuildExecutable.jl:54
in include_string(::String, ::String) at .\loading.jl:441
in include_string(::Module, ::String, ::String) at C:\Users\merdmann.julia\v0.5\CodeTools\src\eval.jl:32
in (::Atom.##61#64{String,String})() at C:\Users\merdmann.julia\v0.5\Atom\src\eval.jl:81
in withpath(::Atom.##61#64{String,String}, ::String) at C:\Users\merdmann.julia\v0.5\CodeTools\src\utils.jl:30
in withpath(::Function, ::String) at C:\Users\merdmann.julia\v0.5\Atom\src\eval.jl:46
in macro expansion at C:\Users\merdmann.julia\v0.5\Atom\src\eval.jl:79 [inlined]
in (::Atom.##60#63{String,String})() at .\task.jl:60
while loading C:...\julia_sandbox\compilejulia.jl, in expression starting on line 2

My Julia version is 0.5.0 release x86_64-w64-mingw32 - but why mingw32? Does this point to a 64bit/32bit conflict?

from buildexecutable.jl.

blegat avatar blegat commented on July 29, 2024

What I meant is executing the gcc command outside julia. If this commands has now output it means that it succeeded. Did you run

gcc.exe '-LC:\Julia-0.5.0\bin' -shared -ljulia -lssp -o 'C:\Julia-0.5.0\bin\libapp.dll' 'C:\Julia-0.5.0\bin\libapp.o

?

from buildexecutable.jl.

MatthiasErdmann avatar MatthiasErdmann commented on July 29, 2024

Ok - indeed, when leaving out all single quotation marks (but only then),
gcc.exe -LC:\Julia-0.5.0\bin -shared -ljulia -lssp -o C:\Julia-0.5.0\bin\libapp.dll C:\Julia-0.5.0\bin\libapp.o
does succeed (has no output).

from buildexecutable.jl.

blegat avatar blegat commented on July 29, 2024

Good catch ! Let's see what @dhoegh thinks about it. Could you use the "Insert code" button to format the codes in your posts ? it makes it a lot more readable ;)

from buildexecutable.jl.

MatthiasErdmann avatar MatthiasErdmann commented on July 29, 2024

Ok, By the way, I just tried compiling under Linux (Ubuntu 16.04) and got a similar error.

from buildexecutable.jl.

dhoegh avatar dhoegh commented on July 29, 2024

@MatthiasErdmann I have looked into the issue you are having and it is not related to this issue. The main issue you are having is probably related to the issue I am displaying below. If I am trying to run the command manually in CMD on windows I get the following error:
image
@MatthiasErdmann I suspect that when you execute the command manually you use a globally installed GCC while BuildExecutable uses a local one, installed by WinRPM in something like C:\Users\d-hoe\.julia\v0.5\WinRPM\deps\usr\x86_64-w64-mingw32\sys-root\mingw\bin\gcc.exe.

Do any one have an idea what is causing the build to fail with missing libwinpthread-1.dll? I suspect it is caused by an newer GCC. Appveyor has just begun failing, while a month old build succeeded.

from buildexecutable.jl.

dhoegh avatar dhoegh commented on July 29, 2024

From http://download.opensuse.org/repositories/windows:/mingw:/win64/openSUSE_Factory/x86_64/ it seems the GCC version was updated 2016-12-30.

from buildexecutable.jl.

MatthiasErdmann avatar MatthiasErdmann commented on July 29, 2024

Actually, I have used the local gcc installed by WinRPM - Pkg.add("BuildExecutable") leads to the installation of gcc version 6.3.0 under C:\Users\"me"\.julia\v0.5\WinRPM\deps\usr\x86_64-w64-mingw32\sys-root\mingw\bin.
However, I get no error message concerning libwinpthread-1.dll. I don't know if this might give hint, but during installation of the BuildExecutable package there is an INFO: "Multiple package candidates found for mingw64-unistd-pthread-devel, picking newest".

from buildexecutable.jl.

boonpingng avatar boonpingng commented on July 29, 2024

Hi,

@MatthiasErdmann, I have the same problem.

You need to path your "C:\Users"me".julia\v0.5\WinRPM\deps\usr\x86_64-w64-mingw32\sys-root\mingw\bin" in order to run the libwinpthread-1.dll. But after running, nothing happen.

image

Seem like the system execute the comment but there are no .exe file generated.

from buildexecutable.jl.

pron avatar pron commented on July 29, 2024

I'm experiencing the same problem as @MatthiasErdmann on Windows. I'll report more details tomorrow.

from buildexecutable.jl.

dhoegh avatar dhoegh commented on July 29, 2024

Good news, I have a fix for the windows issue in #30.

from buildexecutable.jl.

MatthiasErdmann avatar MatthiasErdmann commented on July 29, 2024

Thank you! Adding the bin dir of the local gcc (C:\Users\"me"\.julia\v0.5\WinRPM\deps\usr\x86_64-w64-mingw32\sys-root\mingw\bin) to $PATH works for me.

from buildexecutable.jl.

boonpingng avatar boonpingng commented on July 29, 2024

Thanks dhoegh.

from buildexecutable.jl.

dhoegh avatar dhoegh commented on July 29, 2024

I have now changed so BuildExecutable to use precompiled image in #32. Please do a Pkg.checkout("BuildExecutable") and verify it fixes the problem.

from buildexecutable.jl.

pron avatar pron commented on July 29, 2024

It works (at least on Mac). Thank you very much for the quick fix!

from buildexecutable.jl.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.