Skip to content

CI: Use MSVC generator #150

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft

CI: Use MSVC generator #150

wants to merge 1 commit into from

Conversation

certik
Copy link
Contributor

@certik certik commented Feb 18, 2022

No description provided.

@namannimmo10
Copy link
Collaborator

Build failure once again.

@certik
Copy link
Contributor Author

certik commented Feb 18, 2022

But this is a good failure. It now picks up MSVC:

-- The C compiler identification is MSVC 19.30.30709.0
-- The CXX compiler identification is MSVC 19.30.30709.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: C:/Program Files/Microsoft Visual Studio/2022/Enterprise/VC/Tools/MSVC/14.30.30705/bin/Hostx64/x64/cl.exe - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: C:/Program Files/Microsoft Visual Studio/2022/Enterprise/VC/Tools/MSVC/14.30.30705/bin/Hostx64/x64/cl.exe - skipped

We just have to fix the actual error now.

@certik
Copy link
Contributor Author

certik commented Feb 18, 2022

The error is:

2022-02-18T20:29:01.9367273Z LLVMMCJIT.lib(MCJIT.cpp.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '0' doesn't match value '2' in lpython.obj [D:\a\lpython\lpython\lpython-0.1.0-465-gcb0e16efb\test-bld\src\bin\lpython.vcxproj]

I know what that is: we are compiling in debug mode but llvm is compiled in release mode, so it can't be linked together.

@certik
Copy link
Contributor Author

certik commented Feb 18, 2022

Ok, it built. Now we just need the Release thing.

@certik
Copy link
Contributor Author

certik commented Feb 19, 2022

Almost. Just the last part of ci/build.xsh needs reworking:

if $WIN == "1":
    cp lpython-$lpython_version/test-bld/src/runtime/legacy/lfortran_runtime* src/runtime/
else:
    cp lpython-$lpython_version/test-bld/src/runtime/liblfortran_runtime* src/runtime/
cp lpython-$lpython_version/test-bld/src/runtime/*.mod src/runtime/

# Run some simple compilation tests, works everywhere:
src/bin/lpython --version
# Compile and link separately
src/bin/lpython -c examples/expr2.py -o expr2.o
src/bin/lpython -o expr2 expr2.o
./expr2

# Test the new Python frontend, manually for now:
src/bin/lpython --show-ast tests/doconcurrentloop_01.py
src/bin/lpython --show-asr tests/doconcurrentloop_01.py
src/bin/lpython --show-cpp tests/doconcurrentloop_01.py

if $WIN != "1":
    python run_tests.py
    python integration_tests/run_tests.py

I think CMake needs updating to generate the runtime library without the Release suffix.

@certik
Copy link
Contributor Author

certik commented Feb 19, 2022

Now it fails with:

$ ci\build.xsh:80:src/bin/lpython -o expr2 expr2.o
link: extra operand 'expr2.o'
Try 'link --help' for more information.
The command 'link /NOLOGO /OUT:expr2 expr2.o D:\a\lpython\lpython\SRC\BIN/../runtime\lfortran_runtime_static.lib' failed.

@certik
Copy link
Contributor Author

certik commented Feb 19, 2022

I wonder if it might be calling the wrong link program?

@certik
Copy link
Contributor Author

certik commented Feb 19, 2022

We'll have to port the improvements from this PR over one by one with the older Windows image, that should work. And then we can switch the image and just iron out the path to MSVC.

@certik certik changed the title CI: Select MSVC 17 CI: Use MSVC generator Feb 19, 2022
@certik
Copy link
Contributor Author

certik commented Feb 19, 2022

Now when main works on Windows, I'll use this PR to see how to use the MSVC generator but with the current older Windows image which works. Once this works, it should be easier to switch to the newer MSVC version.

@certik
Copy link
Contributor Author

certik commented Feb 22, 2022

Split into #156, #157. What remains is just the switch to the MSVC generator.

@certik
Copy link
Contributor Author

certik commented Feb 26, 2022

I am going to leave this open for now. The actual build (excluding the initial package installation) got 2x slower (from about 5 min to 10 min).

The main thing we need is to figure out how to update to the latest windows image, so we'll use this PR to help us there, but let's not merge it until we figure out what is going on with the speed, possibly keeping it with Ninja.

@certik certik marked this pull request as draft October 4, 2022 15:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants