Skip to content

Conversation

@e-kwsm
Copy link
Contributor

@e-kwsm e-kwsm commented Feb 22, 2023

The author has only NVIDIA 22.9.0, so information on older versions is missed.

For example, https://docs.nvidia.com/hpc-sdk/archive/20.7/hpc-sdk-release-notes/index.html#platform-requirements shows requirements but NVIDIA’s C/C++ support status is missed.

@e-kwsm e-kwsm requested a review from dcbaker as a code owner February 22, 2023 02:44
@codecov
Copy link

codecov bot commented Feb 22, 2023

Codecov Report

Merging #11437 (ea33603) into master (9a29557) will decrease coverage by 1.77%.
The diff coverage is 16.66%.

@@            Coverage Diff             @@
##           master   #11437      +/-   ##
==========================================
- Coverage   66.97%   65.20%   -1.77%     
==========================================
  Files         414      207     -207     
  Lines       90834    45446   -45388     
  Branches    20178    10781    -9397     
==========================================
- Hits        60835    29635   -31200     
+ Misses      25324    13538   -11786     
+ Partials     4675     2273    -2402     
Impacted Files Coverage Δ
mesonbuild/compilers/c.py 55.60% <14.28%> (-1.40%) ⬇️
mesonbuild/compilers/cpp.py 45.96% <18.75%> (-1.11%) ⬇️
scripts/hotdochelper.py
optinterpreter.py
modules/cmake.py
compilers/mixins/xc16.py
templates/sampleimpl.py
compilers/mixins/intel.py
scripts/env2mfile.py
modules/qt6.py
... and 199 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@eli-schwartz
Copy link
Member

Seems like old releases can be found here: https://developer.nvidia.com/nvidia-hpc-sdk-releases

I looked at the online docs for the oldest version listed there, which claims nvc++ is a C++17 compiler, and nvc is a C11 compiler.

BTW the commit message confuses me, not sure how to read the domain of interest. Maybe the commit title prefix should be nvidia_hpc compiler:?

@dcbaker
Copy link
Member

dcbaker commented Oct 29, 2025

@e-kwsm can you update the commit message to something like compilers/nvidia_hpc: support C/C++ -std?

I'll merge this with that done.

@dcbaker dcbaker merged commit 6c88d99 into mesonbuild:master Oct 29, 2025
32 checks passed
@e-kwsm e-kwsm deleted the nvidia_hpc.std branch October 29, 2025 19:04
@mochaaP
Copy link
Contributor

mochaaP commented Dec 6, 2025

Please also fixup the changes made by #13274:

diff --git a/mesonbuild/compilers/c.py b/mesonbuild/compilers/c.py
index 7143d9e92..915b12217 100644
--- a/mesonbuild/compilers/c.py
+++ b/mesonbuild/compilers/c.py
@@ -301,13 +301,13 @@ class NvidiaHPC_CCompiler(PGICompiler, CCompiler):
                            env, linker=linker, full_version=full_version)
         PGICompiler.__init__(self)
 
     def get_options(self) -> 'MutableKeyedOptionDictType':
         opts = super().get_options()
         cppstd_choices = ['c89', 'c90', 'c99', 'c11', 'c17', 'c18']
         std_opt = opts[self.form_compileropt_key('std')]
         assert isinstance(std_opt, options.UserStdOption), 'for mypy'
         std_opt.set_versions(cppstd_choices, gnu=True)
         return opts
+
+    def get_option_std_args(self, target: BuildTarget, subproject: T.Optional[str] = None) -> T.List[str]:
+        args: T.List[str] = []
+        std = self.get_compileropt_value('std', target, subproject)
+        assert isinstance(std, str)
+        if std != 'none':
+            args.append('-std=' + std)
+        return args
 
 
 class ElbrusCCompiler(ElbrusCompiler, CCompiler):
diff --git a/mesonbuild/compilers/cpp.py b/mesonbuild/compilers/cpp.py
index bdf60f6c2..0eff30992 100644
--- a/mesonbuild/compilers/cpp.py
+++ b/mesonbuild/compilers/cpp.py
@@ -561,16 +561,13 @@ class NvidiaHPC_CPPCompiler(PGICompiler, CPPCompiler):
                              env, linker=linker, full_version=full_version)
         PGICompiler.__init__(self)
 
     def get_options(self) -> 'MutableKeyedOptionDictType':
         opts = super().get_options()
         cppstd_choices = [
             'c++98', 'c++03', 'c++11', 'c++14', 'c++17', 'c++20', 'c++23',
             'gnu++98', 'gnu++03', 'gnu++11', 'gnu++14', 'gnu++17', 'gnu++20'
         ]
         std_opt = opts[self.form_compileropt_key('std')]
         assert isinstance(std_opt, options.UserStdOption), 'for mypy'
         std_opt.set_versions(cppstd_choices)
         return opts
+
+    def get_option_std_args(self, target: BuildTarget, subproject: T.Optional[str] = None) -> T.List[str]:
+        args: T.List[str] = []
+        std = self.get_compileropt_value('std', target, subproject)
+        assert isinstance(std, str)
+        if std != 'none':
+            args.append(self._find_best_cpp_std(std))
+        return args
 
 
 class ElbrusCPPCompiler(ElbrusCompiler, CPPCompiler):

@mochaaP
Copy link
Contributor

mochaaP commented Dec 6, 2025

#15353

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants