10
1
mirror of https://github.com/pfloos/quack synced 2024-12-22 12:23:42 +01:00

update make_ninja file for cuda objects

This commit is contained in:
Abdallah Ammar 2024-11-26 15:26:03 +01:00
parent 3009ffe8f7
commit a10e4c8c23

View File

@ -3,13 +3,13 @@ import os
import sys import sys
import subprocess import subprocess
import argparse
parser = argparse.ArgumentParser(description='This script generate the compilation files for QuAcK.')
DEBUG=False parser.add_argument('-d', '--debug', action='store_true', help='Debug mode. Default is false.')
try: parser.add_argument('-u', '--use-gpu', action='store_true', help='Use GPU. Default is false.')
DEBUG = sys.argv[1] == "debug" args = parser.parse_args()
except: DEBUG = args.debug
pass USE_GPU = args.use_gpu
if "QUACK_ROOT" not in os.environ: if "QUACK_ROOT" not in os.environ:
@ -120,6 +120,7 @@ IDIR=$QUACK_ROOT/include
LDIR=$QUACK_ROOT/lib LDIR=$QUACK_ROOT/lib
BDIR=$QUACK_ROOT/bin BDIR=$QUACK_ROOT/bin
SDIR=$QUACK_ROOT/src SDIR=$QUACK_ROOT/src
CUDA_DIR=$QUACK_ROOT/src/cuda/build
LIBXC_VERSION=5.0.0 LIBXC_VERSION=5.0.0
@ -248,6 +249,9 @@ rule build_lib
sources = [ "$SDIR/{0}/{1}".format(exe_dir,x) for x in os.listdir(exe_dir) ] sources = [ "$SDIR/{0}/{1}".format(exe_dir,x) for x in os.listdir(exe_dir) ]
sources = filter(lambda x: x.endswith(".f") or x.endswith(".f90"), sources) sources = filter(lambda x: x.endswith(".f") or x.endswith(".f90"), sources)
sources = " ".join(sources) sources = " ".join(sources)
if USE_GPU:
f.write("build $BDIR/{0}: build_exe $CUDA_DIR/cuda.a {1} {2}\n".format(exe_dir,libs,sources))
else:
f.write("build $BDIR/{0}: build_exe {1} {2}\n".format(exe_dir,libs,sources)) f.write("build $BDIR/{0}: build_exe {1} {2}\n".format(exe_dir,libs,sources))
f.write(" dir = {0} \n".format(exe_dir) ) f.write(" dir = {0} \n".format(exe_dir) )