Skip to content
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

[vcpkg-ci-fortran] New test port #42754

Draft
wants to merge 10 commits into
base: master
Choose a base branch
from
Draft

[vcpkg-ci-fortran] New test port #42754

wants to merge 10 commits into from

Conversation

dg0yt
Copy link
Contributor

@dg0yt dg0yt commented Dec 17, 2024

WIP

@JonLiu1993 JonLiu1993 added the category:infrastructure Pertaining to the CI/Testing infrastrucutre label Dec 17, 2024
@dg0yt
Copy link
Contributor Author

dg0yt commented Dec 18, 2024

As expected (from octave CI logs): vcpkg_find_fortran unexpectedly switches C and CXX compiler from MSVC to MinGW.

@Neumann-A
Copy link
Contributor

Neumann-A commented Dec 18, 2024

That is probably intentional since otherwise you cannot combine fortran and other languages object files into a single lib. At least if you use default gfortran in vcpkg

@dg0yt
Copy link
Contributor Author

dg0yt commented Dec 19, 2024

That is probably intentional

This is what I assume...

since otherwise you cannot combine fortran and other languages object files into a single lib [...] if you use default gfortran in vcpkg

... but I wonder if this is the right goal? This seems to clearly contradict the policy of "the triplet defines the (C/C++) compiler." It isn't allowed to change the compiler even for packages which more or less insist on clang(-cl) for windows.

And with MinGW C/C++, the implications are even more tricky IMO.

(AFAIU CMake promises some limited use of GFortran with MSVC in form of fortran libs being transformed to what is accepted by MSVC, but not to "combine fortran and other languages object files into a single lib".)

@Neumann-A
Copy link
Contributor

"the triplet defines the (C/C++) compiler."

historic reasons. The correct approach is displayed in #42129 and uses per port customization which avoids the rebuild of the whole tree via a conditional include and VCPKG_HASH_ADDITIONAL_FILES. However, that approach wasn't implementable in the past and would always require a whole rebuild of the tree if a single port required special behavior. As such the special behavior has been implemented into the portfile instead of the triplet to avoid a rebuild of the tree. Maybe it is time to remove the port special compiler behavior and move it into the triplet instead.

CMake promises some limited use of GFortran with MSVC in form of fortran libs being transformed to what is accepted by MSVC, but not to "combine fortran and other languages object files into a single lib

It has GNUtoMS which works not only for Fortran.

However, I wouldn't spend too much time on it since there seems to be some historic decision in the team to switch to flang as soon as it becomes readily available from llvm. (and then the GNUtoMS hack is no longer necessary)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category:infrastructure Pertaining to the CI/Testing infrastrucutre
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants