tshort / StaticCompiler.jl

Compiles Julia code to a standalone library (experimental)
Other
488 stars 31 forks source link

ld: symbol(s) not found for architecture x86_64 #126

Closed anke1460 closed 1 year ago

anke1460 commented 1 year ago

Hey, i run my code :

compile_executable(test, (), "./")

raise

ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
ERROR: failed process: Process(`cc -e _julia_test ./julia_test.o -o ./julia_test`, ProcessExited(1)) [1]

I can run this demo code compile_executable(hello, (), "./") and works

My clang:

Apple clang version 14.0.3 (clang-1403.0.22.14.1)
Target: x86_64-apple-darwin22.4.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
MasonProtter commented 1 year ago

There’s nothing we can do about this without knowing what test does.

anke1460 commented 1 year ago

My test code:

using DataFramesMeta, DataFrames, CSV,  StaticCompiler
function test(params)
   if  params["bq"] == "1"
    ......
   else
    .....
   end
   dsm = DataFrame(params["data"])
   ......
   mjkn = Dict()
    for i =1:16
        msnc = Dict()
        if length(rds[i]) !== 0
            a = i-1
            smdw = fmin(rds[i])
            msnc = Dict(a=>smdw)
        end
        mjkn = merge(mjkn,msnc)
    end
    return(mjkn)
end
MasonProtter commented 1 year ago

Heap allocations are not yet supported. See this section: https://github.com/tshort/StaticCompiler.jl#limitations