As in the comment, adding the -I /opt/clAmdFft-1.10.321/include
to the CFLAGS= -I /usr/local/cuda/include -g
is my preferred way to solve this particular problem.
As to how to use C_INCLUDE_PATH
, technically your usage is correct - except you are not compiling the code with gcc
but with g++
and thus you should use CPLUS_INCLUDE_PATH
.
Here's a compile-example (not showing my xemacs session creating testing.cpp and testing.h - testing.cpp simply doing #include <testing.h>
(which contains a simple define that I'm printing).
$ mkdir ../testing
$ export C_INCLUDE_PATH=../testing
$ g++ -Wall testing.cpp
testing.cpp:2:21: fatal error: testing.h: No such file or directory
compilation terminated.
$ export CPLUS_INCLUDE_PATH=../testing
$ g++ -Wall testing.cpp
However, the whole point of using makefiles is that they define what you get included from where. Using global environment variables will just lead to your project depending on what each user on the system has configured their C_INCLUDE_PATH
and CPLUS_INCLUDE_PATH
.
Likewise, if you end up moving your project from one machine to another, if all the include-paths, etc, are in the makefile, you can just copy the project files [and install the dependencies, of course - although you CAN have the makefile do that too, if you work at it]. If you rely on CPLUS_INCLUDE_PATH
and the like, you end up having to also go edit your .bashrc or whatever.
(And I learned something new today, I didn't even know these environment variables existed).