Commits

Karl Rupp committed d2d6f19

CUDA-CMake: Removed quotes for NVCC flags. Added contents of initial_cmake_file.cmake to configure.log

  • Participants
  • Parent commits f79f3ca

Comments (0)

Files changed (2)

File config/cmakeboot.py

        self.cuda = self.framework.require('PETSc.packages.cuda',       None)
        if (self.cuda.directory != None):
          options.append('CUDA_TOOLKIT_ROOT_DIR ' + self.cuda.directory + ' CACHE FILEPATH')
-       options.append('CUDA_NVCC_FLAGS "' + self.setCompilers.getCompilerFlags() + '" CACHE STRING')
+       options.append('CUDA_NVCC_FLAGS ' + self.setCompilers.getCompilerFlags() + ' CACHE STRING')
      else:
        flags = [self.setCompilers.getCompilerFlags(),
                 self.setCompilers.CPPFLAGS,
          for flag in flags:
            for f in flag.split():
              flagstring += ',' + f
-         options.append('PETSC_CUDA_HOST_FLAGS "' + flagstring + '" CACHE STRING')
+         options.append('PETSC_CUDA_HOST_FLAGS ' + flagstring + ' CACHE STRING')
        self.setCompilers.popLanguage()
    options.append('CMAKE_AR '+self.setCompilers.AR + " CACHE FILEPATH")
    ranlib = shlex.split(self.setCompilers.RANLIB)[0]
 
    # Create inital cache file:
    initial_cache_file = open(initial_cache_filename, 'w')
+   self.logPrint('Contents of initial cache file %s :' % initial_cache_filename)
    for option in options:
      initial_cache_file.write('SET (' + option + ' "Dummy comment" FORCE)\n')
+     self.logPrint('SET (' + option + ' "Dummy comment" FORCE)\n')
    initial_cache_file.close()   
    try:
      # Try to remove the old cache because some versions of CMake lose CMAKE_C_FLAGS when reconfiguring this way

File config/cmakegen.py

 if (PETSC_HAVE_CUDA)
   find_package (CUDA REQUIRED)
   set (CUDA_PROPAGATE_HOST_FLAGS OFF)
-  set (CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS} "--compiler-options ${PETSC_CUDA_HOST_FLAGS}")
+  set (CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS} --compiler-options ${PETSC_CUDA_HOST_FLAGS})
 endif ()
 
 include_directories ("${PETSc_SOURCE_DIR}/include" "${PETSc_BINARY_DIR}/include")