本文介绍了将Nsight设置为使用现有Makefile项目运行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我通常使用emacs或Kate,但我决定尝试现代的IDEs运行我的代码。
我已经工作的CUDA / C ++ makefile项目,我想在nsight上运行,但我不知道如何满足我的需求。



如何通过使用现有的makefile来告诉nsight eclipse 5.0.0运行我的项目?

解决方案

如果我的问题听起来很蠢,您有几个选项:



创建新项目并复制来源



您可以使用shell或任何文件管理器将源文件复制到项目位置。



在与源文件相同的文件夹中创建项目

在这篇文章中,我将使用nbody CUDA示例(请注意,Nsight还有一个更原生的选项来导入CUDA示例,我将忽略这个选项):


  1. Ran cuda-install-samples-6.0.sh在〜/ dev / cuda / NVIDIA_CUDA-6.0_Samples中创建样本的可写副本

  2. 在Nsight EE中,转至File-> New-> CUDA C / C ++项目

  3. 在第一个向导页面:




    • 输入您的项目名称(几乎可以是任何字符串)

    • 取消选中使用默认位置 〜/ dev / cuda / NVIDIA_CUDA-6.0_Samples / 5_Simulations / nbody in my case)

    • 项目类型树中选择

    • ul>
    • 完成向导

您将看到新创建的项目, 项目浏览器视图。按 将在您的项目位置中运行 make all - 您可以在项目属性中自定义此选项。



注意: Nsight会将多个文件添加到项目的根文件夹中。



注意: Nsight中的一些源编辑功能可能无法像Makefile项目一样可靠,因为它们与Nsight维护makefile本身一样。 Nsight不知道从自定义makefile传递的所有编译器参数,因此它可能不知道所有包含路径或宏值。


I usually use emacs or Kate but I decided to try out "modern" IDEs for running my codes. I have an already working CUDA/C++ makefile project which I want to run on nsight but I don't see how to fulfill my needs.

How can I tell nsight eclipse 5.0.0 to run my project by using an existing makefile?sorry if my question sounds silly to you, but I'm totally new to IDEs.

解决方案

With Nsight EE you have several options:

Create a new project and copy the sources

You can use your shell or any file manager to copy source files to the project location. Make sure you manually refresh the project after you copied the files.

Creating a project in the same folder as your source files

In this post I will be using nbody CUDA Sample (note that Nsight also has a more native option to import CUDA samples, I will ignore that option here):

  1. Ran cuda-install-samples-6.0.sh to make a writable copy of samples in ~/dev/cuda/NVIDIA_CUDA-6.0_Samples
  2. In Nsight EE, go to File->New->CUDA C/C++ Project
  3. On the first wizard page:

    • Type in your project name (can be pretty much any string)
    • Uncheck "Use default location" and select your root folder (~/dev/cuda/NVIDIA_CUDA-6.0_Samples/5_Simulations/nbody in my case)
    • In the Project Type tree select Makefile Project/*Empty Project*
    • Select CUDA Toolkit 5.5 in the Toolchains list.
  4. Complete the wizard

You will see newly created project with all your files in the Project Explorer view. Pressing Build will run make all in your project location - you can customize this (among other things) in the project properties.

Note: Nsight will add several files to the root folder of your project.

Note: Some source editing features in Nsight may not work as reliably with Makefile projects as they do with the projects were Nsight maintains makefiles itself. Nsight does not know all compiler arguments passed from the custom makefile so it may not know all include paths or macro values.

这篇关于将Nsight设置为使用现有Makefile项目运行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-17 02:49