FIX: fix the cuda_arch on the fly and create dir

This commit is contained in:
Germann Elsa Sylvia
2022-10-11 17:14:15 +02:00
parent 437fdc899f
commit 89cd768cf2

View File

@ -66,12 +66,13 @@ class Hyquas(CMakePackage, CudaPackage):
def build_cutt(self): def build_cutt(self):
cuda_arch = self.spec.variants['cuda_arch'].value[0] cuda_arch = self.spec.variants['cuda_arch'].value[0]
# Filtering CMakefile & Makefile to change the cuda arch flags which are hardcoded
CMakefile = FileFilter('CMakeLists.txt') CMakefile = FileFilter('CMakeLists.txt')
CMakefile.filter(r'^\s*CUDA_NVCC_FLAGS\s*=.*', 'CUDA_NVCC_FLAGS := -Xcompiler -fopenmp -std=c++14 -O2 -g -arch=compute_' + cuda_arch + '-code=sm_' + cuda_arch + '--ptxas-options=-v -lineinfo -keep' ) CMakefile.filter("CUDA_NVCC_FLAGS .*", "CUDA_NVCC_FLAGS \"-Xcompiler -fopenmp -std=c++14 -O2 -g -arch=compute_{0} -code=sm_{0} --ptxas-options=-v -lineinfo -keep\")".format(cuda_arch))
with working_dir('./third-party/cutt'): with working_dir('./third-party/cutt'):
makefile = FileFilter('Makefile') makefile = FileFilter('Makefile')
makefile.filter("GENCODE_FLAGS := .*", "GENCODE_FLAGS := -gencode arch=compute_{0},code=sm_{0}".format(cuda_arch))
makefile.filter(r'^\s*GENCODE_FLAGS\s*=.*', 'GENCODE_FLAGS := -gencode arch=compute_' + cuda_arch +',code=sm_' + cuda_arch )
make() make()
def cmake_args(self): def cmake_args(self):
@ -95,5 +96,7 @@ class Hyquas(CMakePackage, CudaPackage):
def install(self, spec, prefix): def install(self, spec, prefix):
mkdir(prefix.bin) mkdir(prefix.bin)
with working_dir(self.stage.source_path):
mkdirp('evaluator-preprocess/parameter-files')
with working_dir(self.build_directory): with working_dir(self.build_directory):
install('main', prefix.bin) install('main', prefix.bin)