Skip to content

spack compiler find: write into packages.yaml#44419

Closed
alalazo wants to merge 13 commits intospack:developfrom
alalazo:deprecation/compilers-yaml
Closed

spack compiler find: write into packages.yaml#44419
alalazo wants to merge 13 commits intospack:developfrom
alalazo:deprecation/compilers-yaml

Conversation

@alalazo
Copy link
Copy Markdown
Member

@alalazo alalazo commented May 28, 2024

This commit makes:

$ spack compiler find 

write in packages.yaml, instead of compilers.yaml. It also removes dead code after this switch.

@spackbot-app spackbot-app bot added commands compilers core PR affects Spack core functionality environments new-variant shell-support tests General test capability(ies) labels May 28, 2024
@alalazo alalazo force-pushed the deprecation/compilers-yaml branch 4 times, most recently from 39786ab to 26c2956 Compare May 30, 2024 16:49
@alalazo alalazo force-pushed the deprecation/compilers-yaml branch from 26c2956 to f083170 Compare June 5, 2024 16:24
@spackbot-app spackbot-app bot added the workflow label Jun 5, 2024
@alalazo
Copy link
Copy Markdown
Member Author

alalazo commented Jun 5, 2024

It seems these compilers are detected on Windows:

packages:
  llvm:
    externals:
    - spec: [email protected]+clang+lld~lldb
      prefix: C:\Program Files\LLVM
      extra_attributes:
        compilers:
          c: C:\Program Files\LLVM\bin\clang.exe
          cxx: C:\Program Files\LLVM\bin\clang++.exe
          ld: C:\Program Files\LLVM\bin\ld.lld.exe
  gcc:
    externals:
    - spec: [email protected] languages='c,c++,fortran'
      prefix: C:\Strawberry\c
      extra_attributes:
        compilers:
          c: C:\Strawberry\c\bin\gcc.exe
          cxx: C:\Strawberry\c\bin\g++.exe
          fortran: C:\Strawberry\c\bin\gfortran.exe
    - spec: [email protected] languages='c,c++,fortran'
      prefix: C:\mingw64
      extra_attributes:
        compilers:
          c: C:\mingw64\bin\gcc.exe
          cxx: C:\mingw64\bin\g++.exe
          fortran: C:\mingw64\bin\gfortran.exe

@alalazo
Copy link
Copy Markdown
Member Author

alalazo commented Jun 5, 2024

Apparently one needs to source:

. "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\Tools\Launch-VsDevShell.ps1"

to get compilers in PATH on windows-latest.

@alalazo alalazo force-pushed the deprecation/compilers-yaml branch 5 times, most recently from ab4bfd7 to 2291267 Compare June 6, 2024 18:25
@alalazo alalazo marked this pull request as ready for review June 6, 2024 18:37
@spackbot-app spackbot-app bot added the gitlab Issues related to gitlab integration label Jun 10, 2024
@alalazo alalazo force-pushed the deprecation/compilers-yaml branch 4 times, most recently from 039258b to b06addc Compare July 1, 2024 16:51
@alalazo alalazo mentioned this pull request Jul 1, 2024
2 tasks
@haampie
Copy link
Copy Markdown
Member

haampie commented Jul 2, 2024

Why is ld: C:\Program Files\LLVM\bin\ld.lld.exe added?

@alalazo
Copy link
Copy Markdown
Member Author

alalazo commented Jul 2, 2024

Why is ld: C:\Program Files\LLVM\bin\ld.lld.exe added?

Not part of this PR. It's the external search logic in LLVM that finds it.

@alalazo alalazo force-pushed the deprecation/compilers-yaml branch from 0583081 to 7da4308 Compare August 14, 2024 16:59
diehlpk pushed a commit to diehlpk/spack that referenced this pull request Aug 14, 2024
Extracted from spack#44419

This adds / modifies some external detection tests for compilers,
to reproduce cases that are currently tested in unit tests.

The unit tests will later be removed.
Chrismarsh pushed a commit to Chrismarsh/spack that referenced this pull request Aug 16, 2024
Extracted from spack#44419

This adds / modifies some external detection tests for compilers,
to reproduce cases that are currently tested in unit tests.

The unit tests will later be removed.
@psakievich
Copy link
Copy Markdown
Contributor

I have some questions.

How will mixed toolchains be accounted for?

Say I have a compiler that only supplies languages=[c,cxx] like apple-clang. Is the expectation to manually add a fortran entry when needed and then still use foo%apple-clang if foo depends_on("fortran") or would I do something likefoo%apple-clang.c%apple-clang.cxx%gcc.fortran? Also is double % syntactically correct here? I'm already forgetting some of these nuances.

Seems like the former will work for many cases and meets some of my requests for a concise way to represent a tool chain. However, it feels really hacky and also seems super limited. The latter is really verbose, but also very clear. Anything in the middle seems scary like foo%apple-clang%gcc. I suppose foo%apple-clang%gcc.fortran would be a little better if the concretizer were smart enough to know and enforce that apple-clang.[c,cxx] need to take precedent over gcc.[c,cxx].

Anyways what's the correct syntax here?

@alalazo
Copy link
Copy Markdown
Member Author

alalazo commented Aug 19, 2024

@psakievich Syntax changes are discussed in #44379 (I see a 👍 from you there 😉 ) There's nothing like %gcc.cxx or similar syntax, so not sure where this is coming from. Using a dot is ambiguous: gcc.fortran right now parses as the fortran package from the gcc repository.

The % gets translated to "direct build dependency".

To you question on mixed toolchain, the example we have in the issue reads:

foo %apple-clang %[virtuals=fortran] gcc

@psakievich
Copy link
Copy Markdown
Contributor

@psakievich Syntax changes are discussed in #44379 (I see a 👍 from you there 😉 )

Sorry. Too many sources of input to keep track of. I'll review and move my comments there.

tldahlgren pushed a commit to AcriusWinter/spack that referenced this pull request Aug 20, 2024
Extracted from spack#44419

This adds / modifies some external detection tests for compilers,
to reproduce cases that are currently tested in unit tests.

The unit tests will later be removed.
@alalazo
Copy link
Copy Markdown
Member Author

alalazo commented Aug 23, 2024

Superseded by #45784

@alalazo alalazo closed this Aug 23, 2024
@alalazo alalazo deleted the deprecation/compilers-yaml branch August 23, 2024 11:03
FrederickDeny pushed a commit to FrederickDeny/spack that referenced this pull request Aug 26, 2024
Extracted from spack#44419

This adds / modifies some external detection tests for compilers,
to reproduce cases that are currently tested in unit tests.

The unit tests will later be removed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

commands compilers core PR affects Spack core functionality documentation Improvements or additions to documentation environments gitlab Issues related to gitlab integration new-variant shell-support tests General test capability(ies) utilities workflow

Projects

Development

Successfully merging this pull request may close these issues.

3 participants