How do I tell GCC and Clang to look at /usr/local/cuda for include/libs?
Clash Royale CLAN TAG#URR8PPP
up vote
0
down vote
favorite
I have installed CUDA on my system, but seems like its files are not being found by libraries that depend on it. What should I append to my .bashrc
in order for both GCC and Clang to look on the directories /usr/local/cuda/include
and /usr/local/cuda/lib
?
shell gcc
add a comment |Â
up vote
0
down vote
favorite
I have installed CUDA on my system, but seems like its files are not being found by libraries that depend on it. What should I append to my .bashrc
in order for both GCC and Clang to look on the directories /usr/local/cuda/include
and /usr/local/cuda/lib
?
shell gcc
add a comment |Â
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I have installed CUDA on my system, but seems like its files are not being found by libraries that depend on it. What should I append to my .bashrc
in order for both GCC and Clang to look on the directories /usr/local/cuda/include
and /usr/local/cuda/lib
?
shell gcc
I have installed CUDA on my system, but seems like its files are not being found by libraries that depend on it. What should I append to my .bashrc
in order for both GCC and Clang to look on the directories /usr/local/cuda/include
and /usr/local/cuda/lib
?
shell gcc
shell gcc
asked Jan 20 '15 at 4:35
MaiaVictor
1094
1094
add a comment |Â
add a comment |Â
3 Answers
3
active
oldest
votes
up vote
1
down vote
You have to do it:
gcc -I/path_of_include_files -L/path_of_load_libraries_files
NOTE: you can have some -I
and some -L
such as :
gcc -I. -L. -I../include -L../libs
add a comment |Â
up vote
1
down vote
Both gcc
and clang
respect some environment variables that can help achieve what you want. Try adding these to your ~/.bashrc
:
export CFLAGS="-I /usr/local/cuda/include"
export LDFLAGS="-L /usr/local/cuda/lib"
However this is usually not done on a global level - different projects need different includes and libs so best to configure the custom include and lib directories per-project in your Makefile
or using ./configure
.
This answer is misleading.CFLAGS
andLDFLAGS
aren't environment variables related to GCC or Clang. These are make variables merely respected by convention.
â alecov
11 mins ago
add a comment |Â
up vote
0
down vote
Both the GCC and Clang drivers respect the following environment variables:
export C_INCLUDE_PATH=/usr/local/cuda/include
export CPLUS_INCLUDE_PATH=/usr/local/cuda/include
export LIBRARY_PATH=/usr/local/cuda/lib
Check the manuals.
add a comment |Â
3 Answers
3
active
oldest
votes
3 Answers
3
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
1
down vote
You have to do it:
gcc -I/path_of_include_files -L/path_of_load_libraries_files
NOTE: you can have some -I
and some -L
such as :
gcc -I. -L. -I../include -L../libs
add a comment |Â
up vote
1
down vote
You have to do it:
gcc -I/path_of_include_files -L/path_of_load_libraries_files
NOTE: you can have some -I
and some -L
such as :
gcc -I. -L. -I../include -L../libs
add a comment |Â
up vote
1
down vote
up vote
1
down vote
You have to do it:
gcc -I/path_of_include_files -L/path_of_load_libraries_files
NOTE: you can have some -I
and some -L
such as :
gcc -I. -L. -I../include -L../libs
You have to do it:
gcc -I/path_of_include_files -L/path_of_load_libraries_files
NOTE: you can have some -I
and some -L
such as :
gcc -I. -L. -I../include -L../libs
answered Jan 20 '15 at 4:43
PersianGulf
6,76543358
6,76543358
add a comment |Â
add a comment |Â
up vote
1
down vote
Both gcc
and clang
respect some environment variables that can help achieve what you want. Try adding these to your ~/.bashrc
:
export CFLAGS="-I /usr/local/cuda/include"
export LDFLAGS="-L /usr/local/cuda/lib"
However this is usually not done on a global level - different projects need different includes and libs so best to configure the custom include and lib directories per-project in your Makefile
or using ./configure
.
This answer is misleading.CFLAGS
andLDFLAGS
aren't environment variables related to GCC or Clang. These are make variables merely respected by convention.
â alecov
11 mins ago
add a comment |Â
up vote
1
down vote
Both gcc
and clang
respect some environment variables that can help achieve what you want. Try adding these to your ~/.bashrc
:
export CFLAGS="-I /usr/local/cuda/include"
export LDFLAGS="-L /usr/local/cuda/lib"
However this is usually not done on a global level - different projects need different includes and libs so best to configure the custom include and lib directories per-project in your Makefile
or using ./configure
.
This answer is misleading.CFLAGS
andLDFLAGS
aren't environment variables related to GCC or Clang. These are make variables merely respected by convention.
â alecov
11 mins ago
add a comment |Â
up vote
1
down vote
up vote
1
down vote
Both gcc
and clang
respect some environment variables that can help achieve what you want. Try adding these to your ~/.bashrc
:
export CFLAGS="-I /usr/local/cuda/include"
export LDFLAGS="-L /usr/local/cuda/lib"
However this is usually not done on a global level - different projects need different includes and libs so best to configure the custom include and lib directories per-project in your Makefile
or using ./configure
.
Both gcc
and clang
respect some environment variables that can help achieve what you want. Try adding these to your ~/.bashrc
:
export CFLAGS="-I /usr/local/cuda/include"
export LDFLAGS="-L /usr/local/cuda/lib"
However this is usually not done on a global level - different projects need different includes and libs so best to configure the custom include and lib directories per-project in your Makefile
or using ./configure
.
answered Jan 20 '15 at 4:52
MLu
1,223821
1,223821
This answer is misleading.CFLAGS
andLDFLAGS
aren't environment variables related to GCC or Clang. These are make variables merely respected by convention.
â alecov
11 mins ago
add a comment |Â
This answer is misleading.CFLAGS
andLDFLAGS
aren't environment variables related to GCC or Clang. These are make variables merely respected by convention.
â alecov
11 mins ago
This answer is misleading.
CFLAGS
and LDFLAGS
aren't environment variables related to GCC or Clang. These are make variables merely respected by convention.â alecov
11 mins ago
This answer is misleading.
CFLAGS
and LDFLAGS
aren't environment variables related to GCC or Clang. These are make variables merely respected by convention.â alecov
11 mins ago
add a comment |Â
up vote
0
down vote
Both the GCC and Clang drivers respect the following environment variables:
export C_INCLUDE_PATH=/usr/local/cuda/include
export CPLUS_INCLUDE_PATH=/usr/local/cuda/include
export LIBRARY_PATH=/usr/local/cuda/lib
Check the manuals.
add a comment |Â
up vote
0
down vote
Both the GCC and Clang drivers respect the following environment variables:
export C_INCLUDE_PATH=/usr/local/cuda/include
export CPLUS_INCLUDE_PATH=/usr/local/cuda/include
export LIBRARY_PATH=/usr/local/cuda/lib
Check the manuals.
add a comment |Â
up vote
0
down vote
up vote
0
down vote
Both the GCC and Clang drivers respect the following environment variables:
export C_INCLUDE_PATH=/usr/local/cuda/include
export CPLUS_INCLUDE_PATH=/usr/local/cuda/include
export LIBRARY_PATH=/usr/local/cuda/lib
Check the manuals.
Both the GCC and Clang drivers respect the following environment variables:
export C_INCLUDE_PATH=/usr/local/cuda/include
export CPLUS_INCLUDE_PATH=/usr/local/cuda/include
export LIBRARY_PATH=/usr/local/cuda/lib
Check the manuals.
answered 1 min ago
alecov
1062
1062
add a comment |Â
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f179986%2fhow-do-i-tell-gcc-and-clang-to-look-at-usr-local-cuda-for-include-libs%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password