Comments (4)
Could you provide some more info about how it fails? Yes packages are supported, this is also tested in https://github.com/dhoegh/BuildExecutable.jl/blob/master/test/test.jl. Please do only use import
statement and not using
as the functions are not imported in the the namespace and essentially only act as import
normally would.
from buildexecutable.jl.
Hi Daniel,
Thanks for the sample. I will try it out.
The problem is like I uses the Interpolation package, which I will need to use "using Interpolations" to run in Julia terminal. When I compile without using import, the error is as shown(cannot find the package). In the later part of the program, I also use the "Plots" package.
Another part is that I am using the file ndgrid.jl to run some process. Currently, I put the file under the working directory.
Here is my code.
`
import Plots.plot
import Grid.InterpGrid
import Grid.BCnil
import Grid.InterpLinear
#function main()
a = 5; # length of rectangle
b = 4; # breath of rectangle
h = 5.5; # distance to surface
h1 = 0.01; # distance to freeform lens
M_line = 16; # N_rec must be even and >2
N_rec = 8;
cnst = 100
q = 1:N_rec;
C = a*(q/N_rec.^0.5); # Length of individual rectangle x
C1 = C*b/a; # Breath of individual rectangle y
inter_x = zeros(length(C),div(M_line,2));
inter_y = zeros(length(C),div(M_line,2)-1); # Remove overlapping
for ii = 1:length(C)
for jj = 1:div(M_line,2)
inter_x[ii,jj] = div(2*C[ii]jj,M_line);
end
for jj = 1:div(M_line,2)-1
inter_y[ii,jj] = div(2C1[ii]*jj,M_line);
end
end
coor = [vec(Cones(1,size(inter_y,2))) vec(inter_y) ; vec(inter_x) vec(C1ones(1,size(inter_x,2)))];
coor = [C zeros(N_rec,1) ; coor ; zeros(N_rec,1) C1];
theta = linspace(1,2,10)pi/180;
intensity1 = collect([1.2 3.6 5.4 6.6 7.0 3.6 6.5 3.5 6.7 8.6]);
intpl_theta = linspace(1,length(theta),cnstN_rec);
itp = InterpGrid(intensity1, BCnil, InterpLinear);
intensity = itp[intpl_theta];
tot_int = pi/2*sum(intensity.*sin(intpl_theta));
cul_int = cumsum(intensity.sin(intpl_theta));
N_int = tot_int2/pi/N_rec;
ind = zeros(N_rec,1);
for ii = 1:N_rec
tmp = abs(cul_int-ii*N_int);
(~,idx) = findmin(tmp);
ind[ii] = idx;
end
intpl_theta = intpl_theta[ind];
gamma = (0:M_line)*pi/2/M_line;
gamma_size = length(gamma);
intpl_theta_size = length(intpl_theta);
intpl_theta = repmat(intpl_theta ,1, gamma_size);
gamma = repmat(gamma' , intpl_theta_size);
x = sin(intpl_theta).*cos(gamma);
y = sin(intpl_theta).*sin(gamma);
z = cos(intpl_theta);
LIDC = [vec(x) vec(y) vec(z)]; # Does not include origin
coor = [coor h*ones(size(coor,1),1)];
plot(coor[:,1],coor[:,2],line=(:dots))
#end
`
from buildexecutable.jl.
Sorry for the late response. You do not need to use using
to get it working in REPL, you just need to qualify all call to library function with the corresponding module. For example you need to put Plot.
in front of the plot
. Fyi it is unlikely to get plotting working as it depends on a lot of binary dependencies, which is not supported by this package.
from buildexecutable.jl.
Hi, this is similar questions,
I want to use HDF5 package in my script. however, after using buildexecutable, i got an error message.
fatal: error thrown and no exception handler available.
Base.InitError(mod=:HDF5, error=ErrorException("could not load library "C:\Users\Donghyeon Kim.julia\v0.5\WinRPM\deps\usr\x86_64-w64-mingw32\sys-root\mingw\bin\libhdf5.DLL"
The specified module could not be found.
"))
rec_backtrace at /home/Administrator/buildbot/slave/package_win6_2-x64/build/src/home/Administrator/buildbot/slave/package_win6_2-x64/build/src\stackwalk.c:84
record_backtrace at /home/Administrator/buildbot/slave/package_win6_2-x64/build/src/home/Administrator/buildbot/slave/package_win6_2-x64/build/src\task.c:233
jl_throw at /home/Administrator/buildbot/slave/package_win6_2-x64/build/src/home/Administrator/buildbot/slave/package_win6_2-x64/build/src\task.c:551
jl_errorf at /home/Administrator/buildbot/slave/package_win6_2-x64/build/src/home/Administrator/buildbot/slave/package_win6_2-x64/build/src\builtins.c:78
jl_dlerror at /home/Administrator/buildbot/slave/package_win6_2-x64/build/src/home/Administrator/buildbot/slave/package_win6_2-x64/build/src\dlload.c:69
jl_load_dynamic_library_ at /home/Administrator/buildbot/slave/package_win6_2-x64/build/src/home/Administrator/buildbot/slave/package_win6_2-x64/build/src\dlload.c:209
jl_get_library at /home/Administrator/buildbot/slave/package_win6_2-x64/build/src/home/Administrator/buildbot/slave/package_win6_2-x64/build/src\runtime_ccall.cpp:152
jl_load_and_lookup at /home/Administrator/buildbot/slave/package_win6_2-x64/build/src/home/Administrator/buildbot/slave/package_win6_2-x64/build/src\runtime_ccall.cpp:163
unknown function (ip: 0000000004692CAA)
init_libhdf5 at C:\Users\Donghyeon Kim.julia\v0.5\HDF5\src\HDF5.jl:24 [inlined]
init at C:\Users\Donghyeon Kim.julia\v0.5\HDF5\src\HDF5.jl:2365
unknown function (ip: 00000000046A55CE)
jl_call_method_internal at /home/Administrator/buildbot/slave/package_win6_2-x64/build/src/home/Administrator/buildbot/slave/package_win6_2-x64/build/src\julia_internal.h:211 [inlined]
jl_apply_generic at /home/Administrator/buildbot/slave/package_win6_2-x64/build/src/home/Administrator/buildbot/slave/package_win6_2-x64/build/src\gf.c:1950
jl_apply at /home/Administrator/buildbot/slave/package_win6_2-x64/build/src/home/Administrator/buildbot/slave/package_win6_2-x64/build/src\julia.h:1388 [inlined]
jl_module_run_initializer at /home/Administrator/buildbot/slave/package_win6_2-x64/build/src/home/Administrator/buildbot/slave/package_win6_2-x64/build/src\toplevel.c:83
_julia_init at /home/Administrator/buildbot/slave/package_win6_2-x64/build/src/home/Administrator/buildbot/slave/package_win6_2-x64/build/src\init.c:753
julia_init at /home/Administrator/buildbot/slave/package_win6_2-x64/build/src/home/Administrator/buildbot/slave/package_win6_2-x64/build/src\task.c:284
jl_init_with_image at /home/Administrator/buildbot/slave/package_win6_2-x64/build/src/home/Administrator/buildbot/slave/package_win6_2-x64/build/src\jlapi.c:45
main at C:/Users/DONGHY~1/AppData/Local/Temp/jl_2C1E.tmp\start_func.c:30
__tmainCRTStartup at /home/abuild/rpmbuild/BUILD/mingw-w64-crt\crt\crtexe.c:334
mainCRTStartup at /home/abuild/rpmbuild/BUILD/mingw-w64-crt\crt\crtexe.c:212
BaseThreadInitThunk at C:\Windows\System32\KERNEL32.DLL (unknown line)
RtlUserThreadStart at C:\Windows\SYSTEM32\ntdll.dll (unknown line)
After using buildexecutable, the binary tried to find library in absolute path (in my computer)
that's why it cannot run in other computers..
from buildexecutable.jl.
Related Issues (20)
- @windows_only is deprecated in Julia v0.5.0 HOT 2
- Writing to /usr/lib HOT 3
- Whats the point in using inference0? HOT 1
- BuildExecutable use-case question HOT 7
- .juliarc.jl not respected
- Test fails Ubuntu 16 Julia 0.5.2
- Test Failed under julia 0.6
- Fails with "@unix_only not defined" HOT 5
- Adopt approach from JuliaComputing/static-julia? HOT 1
- Tag a new release
- Portable cpu_target on Windows HOT 1
- Build sys.o hangs
- Test failed...
- Wont build with Gtk
- error
- undefined reference to `jl_show' HOT 1
- windows 7 portability issue
- Julia 1.0 Build Error
- Info about upcoming removal of packages in the General registry
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from buildexecutable.jl.