prefix-dev / shell

The ultimate cross-platform, bash-like shell
MIT License
63 stars 9 forks source link

Replacing lfortran/ci/build.xsh #61

Open certik opened 2 months ago

certik commented 2 months ago

I would like to use shell to replace https://github.com/lfortran/lfortran/blob/79e7444ca0e58adbaa06db5e839b91d5e9eb915f/ci/build.xsh.

To do that, we need:

certik commented 2 months ago

With the tricks in #36 I was able to compile LFortran in our shell almost completely, it failed at the very end:

C:\Users\ondrejcertik\repos\lfortran\src\libasr\asr_utils.h(5282,96): warning C
4244:         [ [C:\Users\ondrejcertik\repos\lfortran\src\bin\lfortran.vcxproj]
C:\Users\ondrejcertik\repos\lfortran\src\libasr\asr_utils.h(5282,96): warning C
4244:             T=float [C:\Users\ondrejcertik\repos\lfortran\src\bin\lfortra
n.vcxproj]
C:\Users\ondrejcertik\repos\lfortran\src\libasr\asr_utils.h(5282,96): warning C
4244:         ] [C:\Users\ondrejcertik\repos\lfortran\src\bin\lfortran.vcxproj]
LINK : fatal error LNK1104: cannot open file 'C:\Program Files (x86)\Microsoft
Visual Studio\2019\Enterprise\DIA SDK\lib\amd64\diaguids.lib' [C:\Users\ondrejc
ertik\repos\lfortran\src\bin\lfortran.vcxproj]
certik commented 2 months ago

Got the same error on another machine:

LINK : fatal error LNK1104: cannot open file 'C:\Program Files (x86)\Microsoft Visua
l Studio\2019\Enterprise\DIA SDK\lib\amd64\diaguids.lib' [C:\Users\ondrejcertik\repo
s\lfortran\src\bin\lfortran.vcxproj]

Based on https://stackoverflow.com/questions/78085548/building-with-llvm-using-cmake-llvm-clang-vs-path-is-wrong it might be due to LLVM being built with an older MSVC.

I found the library in:

~$ ls -l 'C:\Program Files\Microsoft Visual Studio\2022\Community\DIA SDK\lib\amd64\diaguids.lib'
-rwxrwxrwx 1 somebody somegroup 1983854 Sep 10 13:29 'C:\Program Files\Microsoft Visual Studio\2022\Community\DIA SDK\lib\amd64\diaguids.lib'

I went to src/bin/lfortran.vcxproj and modified that one path to diaguids.lib (for Release) to the correct one and it built. The same error happened for other executables, but lfortran.exe was built correctly.