It contains two arguments, separated by a comma and surrounded by parentheses. The ifneq directive begins the conditional, and specifies the condition. The lines of the makefile following the ifeq are obeyed if the two arguments match otherwise they are ignored. Variable substitution is performed on both arguments and then they are compared.
The ifeq directive begins the conditional, and specifies the condition. So please check if your make supports the directives we are explaining here. The make program on your system may not support all the directives. There are numerous directives available in various forms. The second rule is the default rule used by make to create a.
The following is the code for main.cpp source file − Makefiles are special format files that help build and manage the projects automatically.įor example, let’s assume we have the following source files. Makefiles are the solution to simplify this task. Setting up this environment took me a while, and while I don’t have the time to write a more in-depth guide, I will more than likely have run into your error once or twice before.Compiling the source code files can be tiring, especially when you have to include several source files and type the compiling command every time you need to compile. This will mostly fix it: #ifdef _CDT_PARSER_ Of course, you could always just edit the makefile to get around this, but there is a lot of junk generated by the build and it’s best to keep them seperate.Īlso, the Eclipse syntax highlighting will not fully appreciate. You need to make a folder called “src” and a folder called “bin”. “cudart” is automatically linked by nvcc (the cuda compiler), but add it to the list of libraries if this is not true for your compiler. h dependencies because I could not get it to work, but is not such a big deal anyway (for me, at least). I’m not the greatest with Makefiles, but it works. Nvcc $(OBJECTS) $(LIBPATH) $(LIBS) -o $(APP) #export CUDA_PROFILE_CONFIG = cuda_profile.cfg LIBPATH = -L"$(VCDIR)/lib/amd64" -L"$(NVSDKCUDA_ROOT)\common\lib" INCPATH = -I"$(VCDIR)/include" -I"$(NVSDKCUDA_ROOT)\common\inc" The makefile: VCDIR = C:/Program Files (x86)/Microsoft Visual Studio 9.0/VC My path also includes the bin64 directory of the CUDA toolkit, but again, I was under the impression that it was automatically added. I have some environment variables set, and while I think that all of them are automatically set, there is a chance that I made them: cl.exe secretly includes another directory, so for proper highlighting add: C:\Program Files\Microsoft SDKs\Windows\v6.0A\Include Those include directories are referenced in the Makefile and you should be able to input them through the Eclipse options page. Eclipse is set up to use “mingw32-make” to compile the project, and you need to specify the correct include directories if you want syntax highlighting. I am also using MinGW, but any GNU Make program will work. I am using the 64-bit versions, but porting it to 32-bit should not be difficult. Of course, you need the CUDA Toolkit and SDK installed. There is probably a work around, more than likely based on the environment.
The Windows SDK (aka the free version) will not work because, while it comes with the necessary compilers, CUDA is not fully configured to see it and will complain about an invalid compiler. Express Edition will probably work for 32-bit, but will not for 64-bit because it does not come with the 64-bit compilers.
You NEEEED Visual Studio 2008 Professional Edition installed for 64-bit compiling. There is no magical exe to run, although these steps aren’t exactly hard.
Before you get too excited, I have not detailed my steps and you need some sort of experience working in this type of environment. I don’t exactly remember the steps required, but this will surely help one or two people out. I spent a while getting a makefile going for windows 64-bit so I could use an IDE like Eclipse.