CC environment variable not overriding compiler used on Windows 10

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • Mike.bench
    Junior Member
    • Nov 2022
    • 5

    CC environment variable not overriding compiler used on Windows 10

    Setting CC environment variable is not overriding compiler used when install test with phoronix. I am sort of new to this flow so I might be doing something wrong. I alos mention this was on Windows 10 as this is what I was using but don't know if issue specific to that.

    From the image you can see that:
    - clang and (older) gcc are my path
    - the CC environment variable is set to 'clang' but a newer version (not in my path) of gcc is being used. So it appears CC is ignored.
    - the CFLAGS environment variable is set to '--version' and you can see this is honored as version is emitted.

    image.png

    Some secondary questions:
    2) Does phoronix-test-suite have something like a verbose option to see what is going on? In particular would like to see exact compiler used and options passed to i.
    3) Does phoronix-test-suite have environment variables (or other mechanism) to override default link command and link options?
  • Michael
    Phoronix
    • Jun 2006
    • 14283

    #2
    If CC isn't working, then it's the Windows program/test not honoring CC itself. PTS doesn't interfere with CC itself. PTS on Linux though does have additional safeguards to try to ensure CC is always honored by the program (symlinking magic trick to override other clang / gcc / cc commands, etc). But doesn't do that on Windows.

    No, PTS doesn't have any overrides/extra vars for linking and stuff beyond whatever the upstream program supports.
    Michael Larabel
    https://www.michaellarabel.com/

    Comment

    • Mike.bench
      Junior Member
      • Nov 2022
      • 5

      #3
      I tried running the commands from original post on linux and can confirm the the CC environment variable does override the compiler used.

      "then it's the Windows program/test not honoring CC itself.", I tried about half a dozen other tests on Windows and none of them seemed to use/honor the CC environment flag. Btw, for me there was nothing special about the aobench test - it just seemed like a relatively simple test to experiment with change the compiler / options.

      Comment

      • shivagup
        Junior Member
        • Feb 2023
        • 1

        #4
        The same issue I have, I can't change the compiler from GCC to AOCC while benchmarking the stockfish test profile.
        I see there is an option to change the compiler while building the source of stockfish with 'make comp=clang'.
        Can I ask how much effort is required for the support it in Phoronix-test-suite or if it is possible or not?
        Happy to contribute to the Phoronix-test-suite repo.

        Comment

        • Michael
          Phoronix
          • Jun 2006
          • 14283

          #5
          Not all tests upstream honors CC/CXX, etc, so the fool-proof way to manage outside of PTS before starting is to update cc/gcc/clang symlinks to your intended compiler. It's outside the scope of PTS that may of the contained open-source software packages don't follow CC and such nicely.
          Michael Larabel
          https://www.michaellarabel.com/

          Comment

          • krishoza
            Junior Member
            • Nov 2024
            • 3

            #6
            Originally posted by Michael View Post
            Not all tests upstream honors CC/CXX, etc, so the fool-proof way to manage outside of PTS before starting is to update cc/gcc/clang symlinks to your intended compiler. It's outside the scope of PTS that may of the contained open-source software packages don't follow CC and such nicely.
            even if we can use
            Code:
            export CC
            and set it to the desired compiler how does users are able to customize compiler flags for running different benchmark. Lets say I wish to run FFMPEG benchmark using some custom compiler flags how do I pass the flags to compile the benchmark ?

            Comment

            • Michael
              Phoronix
              • Jun 2006
              • 14283

              #7
              Originally posted by krishoza View Post

              even if we can use
              Code:
              export CC
              and set it to the desired compiler how does users are able to customize compiler flags for running different benchmark. Lets say I wish to run FFMPEG benchmark using some custom compiler flags how do I pass the flags to compile the benchmark ?
              Just set the CFLAGS/CXXFLAGS and as long as the upstream software honors those env vars and doesn't blatantly wipe them, they will be recognized when installing the test.
              Michael Larabel
              https://www.michaellarabel.com/

              Comment

              • krishoza
                Junior Member
                • Nov 2024
                • 3

                #8
                Need one more help. I am trying to modify the install.sh script of stream benchmark at path ob-cache/test-profiles/pts/stream-1.3.4/install.sh and trying to hard code the NUM_CPU_CORES by modifying the below shown block. However the output file generated after phoronix-test-suite force-install stream command doesn't honor the changes and reverts back to NUM_CPU_CORES instead of the hardcoded value I have provided any specific reason why this happens

                image.png

                Comment

                • Michael
                  Phoronix
                  • Jun 2006
                  • 14283

                  #9
                  Originally posted by krishoza View Post
                  Need one more help. I am trying to modify the install.sh script of stream benchmark at path ob-cache/test-profiles/pts/stream-1.3.4/install.sh and trying to hard code the NUM_CPU_CORES by modifying the below shown block. However the output file generated after phoronix-test-suite force-install stream command doesn't honor the changes and reverts back to NUM_CPU_CORES instead of the hardcoded value I have provided any specific reason why this happens

                  image.png
                  ob-cache/ is only a read-only cache used on initial run... You need to be modifying the files in ~/.phoronix-test-suite/test-profiles/ or /var/lib/phoronix-test-suite/test-profiles if root.
                  Michael Larabel
                  https://www.michaellarabel.com/

                  Comment

                  Working...
                  X