konovod / linalg

Linear algebra library based on LAPACK

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Building application for Windows

IbrahimMohammed47 opened this issue · comments

I'm trying to build my linalg application using crystal build on ubuntu.. so that I can run it on Windows, but I can't get it right.
Here is what I did:
1- On Ubuntu, I build .obj file like this:
crystal build linalg-app.cr --target "x86_64-pc-windows-msvc" --cross-compile --static
2- I took the generated .obj file, together with the generated linker command, and run them on Windows, which looks like this
cl /nologo linalg-app.obj /Felinalg-app /link /DEBUG:FULL /PDBALTPATH:%_PDB% /INCREMENTAL:NO /STACK:0x800000 /LIBPATH:/usr/bin/../lib/crystal libopenblas.lib pcre.lib gc.lib /ENTRY:wmainCRTStartup iconv.lib advapi32.lib shell32.lib ole32.lib WS2_32.lib legacy_stdio_definitions.lib DbgHelp.lib libcmt.lib

but then I get that error:
fatal error lnk1181 cannot open input file 'libopenblas.lib

Any leads on how to compile a standalone executable that can run on windows?

Update:
I decided to use crystal compiler on windows, I think it's not fully supported yet, but it's working, and it took me to the same error:

1

So I took the libopenblas.lib file from the directory and added it manually to crystal libraries C:\crystal\lib
Now when I run the file, it does nothing at all.. no errors, no outputs.. nothing.

commented

You need a lib file, right, and also put 64-bit openblas.dll to a directory with program.
Crystal compiler on Windows is as good as cross-compilation (probably better) - limitations are currently in stdlib, not compiler.

Thanks @konovod, that solved my problem.
I coudn't see that because I'm using --static when I compile, so I never thought I would need the .dll file