Loading tools/driver/qcor.in +19 −2 Original line number Diff line number Diff line Loading @@ -230,6 +230,8 @@ fatal_error_verbose = False def main(argv=None): compiler = '@CLANG_EXECUTABLE@' # .o -> executable linker (use the Clang compiler by default) obj_linker = compiler verbose=False if '--verbose' in sys.argv[1:]: Loading Loading @@ -273,6 +275,18 @@ def main(argv=None): defaultFlags = ['-std=c++17', '-include', '@CMAKE_INSTALL_PREFIX@/include/qcor/qcor_lang_ext.hpp', '-fplugin=@CMAKE_INSTALL_PREFIX@/clang-plugins/libqcor-syntax-handler@CMAKE_SHARED_LIBRARY_SUFFIX@'] if '-linker' in sys.argv[1:]: # Ability to use another linker for the final compilation stage. # In some (custom) systems, e.g., Summit, our compiled-from-source Clang-CSP compiler # may not work properly. Hence, just allowing users to use the system-wide compiler. idx = sys.argv.index('-linker') linker_to_use = sys.argv[idx+1] sys.argv.remove(linker_to_use) sys.argv.remove('-linker') if verbose: info('Using ' + linker_to_use + ' linker') obj_linker = linker_to_use extra_flags = '@QCOR_EXTRA_COMPILER_FLAGS@'.split(' ') if len(extra_flags): defaultFlags += extra_flags Loading Loading @@ -912,7 +926,7 @@ def main(argv=None): exit(1) else: # This is a .o file, so execute the link phase commands = [compiler] commands = [obj_linker] if len(extra_flags): commands += extra_flags commands += ['-Wno-unused-command-line-argument', '-Wno-override-module'] + baseLibs + sys.argv[1:] Loading @@ -920,7 +934,10 @@ def main(argv=None): if verbose: info('{}'.format(' '.join([c for c in commands]))) try: if obj_linker == compiler: result = subprocess.run(commands, check=True) else: os.system('{}'.format(' '.join([c for c in commands]))) except subprocess.CalledProcessError as e: print(e.output) print(e.returncode) Loading Loading
tools/driver/qcor.in +19 −2 Original line number Diff line number Diff line Loading @@ -230,6 +230,8 @@ fatal_error_verbose = False def main(argv=None): compiler = '@CLANG_EXECUTABLE@' # .o -> executable linker (use the Clang compiler by default) obj_linker = compiler verbose=False if '--verbose' in sys.argv[1:]: Loading Loading @@ -273,6 +275,18 @@ def main(argv=None): defaultFlags = ['-std=c++17', '-include', '@CMAKE_INSTALL_PREFIX@/include/qcor/qcor_lang_ext.hpp', '-fplugin=@CMAKE_INSTALL_PREFIX@/clang-plugins/libqcor-syntax-handler@CMAKE_SHARED_LIBRARY_SUFFIX@'] if '-linker' in sys.argv[1:]: # Ability to use another linker for the final compilation stage. # In some (custom) systems, e.g., Summit, our compiled-from-source Clang-CSP compiler # may not work properly. Hence, just allowing users to use the system-wide compiler. idx = sys.argv.index('-linker') linker_to_use = sys.argv[idx+1] sys.argv.remove(linker_to_use) sys.argv.remove('-linker') if verbose: info('Using ' + linker_to_use + ' linker') obj_linker = linker_to_use extra_flags = '@QCOR_EXTRA_COMPILER_FLAGS@'.split(' ') if len(extra_flags): defaultFlags += extra_flags Loading Loading @@ -912,7 +926,7 @@ def main(argv=None): exit(1) else: # This is a .o file, so execute the link phase commands = [compiler] commands = [obj_linker] if len(extra_flags): commands += extra_flags commands += ['-Wno-unused-command-line-argument', '-Wno-override-module'] + baseLibs + sys.argv[1:] Loading @@ -920,7 +934,10 @@ def main(argv=None): if verbose: info('{}'.format(' '.join([c for c in commands]))) try: if obj_linker == compiler: result = subprocess.run(commands, check=True) else: os.system('{}'.format(' '.join([c for c in commands]))) except subprocess.CalledProcessError as e: print(e.output) print(e.returncode) Loading