nvcc w cygwin gcc (not cl) how to use cygwin to build cuda apps
I would like to use cygwin with the CUDA tools to build CUDA applications on XP.
I tried using the --foreign option with nvcc but the attempt to compile the matrixMul.cu file fails with the following types of errors from cudafe:

[code]
nvcc  --foreign --keep --verbose -dp /local/cygwin/  -I /c/local/NVIDIA_CUDA_SDK/common/inc/ matrixMul.cu 2>&1 | head -30
#$ _SPACE_=
#$ _HERE_=c:\local\CUDA\bin
#$ TOP=c:\local\CUDA\bin/..
#$ PATH=... # too long to print
#$ INCLUDES="-Ic:\local\CUDA\bin/../include" "-Ic:\local\CUDA\bin/../include/cudart"  
#$ LIBRARIES=  "c:\local\CUDA\bin/../lib/cuda.lib" "c:\local\CUDA\bin/../lib/cudart.lib"  /OPT:NOICF
#$ PTXAS_FLAGS=
#$ OPENCC_FLAGS=
#$ gcc -E -x c++ -DCUDA_FLOAT_MATH_FUNCTIONS -DCUDA_NO_SM_11_ATOMIC_INTRINSICS  "-Ic:\local\CUDA\bin/../include" "-Ic:\local\CUDA\bin/../include/cudart"   -I. -D__CUDACC__ -C  -I"/c/local/NVIDIA_CUDA_SDK/common/inc/" -include "cuda_runtime.h" -m32 -malign-double -o "matrixMul.cpp1.ii" "matrixMul.cu"
#$ cudafe --m32 "-Ic:\local\CUDA\bin/../include" "-Ic:\local\CUDA\bin/../include/cudart"   -I. --gen_c_file_name "matrixMul.cudafe1.c" --gen_device_file_name "matrixMul.cudafe1.gpu" --include_file_name matrixMul.fatbin.c --diag_error=host_device_limited_call --no_exceptions -tused  -I"/c/local/NVIDIA_CUDA_SDK/common/inc/" "matrixMul.cpp1.ii"
"c:/local/CUDA/bin/../include/vector_types.h", line 66: error: expected a type
         specifier
 struct __attribute__((aligned(2))) char2
                               ^

"c:/local/CUDA/bin/../include/vector_types.h", line 66: error: function
         "aligned" returns incomplete type "__attribute__"
 struct __attribute__((aligned(2))) char2
                       ^

"c:/local/CUDA/bin/../include/vector_types.h", line 66: error: expected a "{"
 struct __attribute__((aligned(2))) char2
                                    ^

"c:/local/CUDA/bin/../include/vector_types.h", line 69: warning: missing
         return statement at end of non-void function "aligned"
 };
 ^

"c:/local/CUDA/bin/../include/vector_types.h", line 68: warning: variable "x"
...
[/code]

I had hoped that since gcc was supported for linux, it would be possible to use cygwin gcc tools under windows. The problem line:

[code]struct __attribute__((aligned(2))) char2[/code]

works fine with gcc but cudafe reports an error. Has anyone gotten the CUDA tools to work with cygwin rather than MSVC? Is it even possible?

Suggestions welcome.
Thanks much.
I would like to use cygwin with the CUDA tools to build CUDA applications on XP.

I tried using the --foreign option with nvcc but the attempt to compile the matrixMul.cu file fails with the following types of errors from cudafe:





nvcc  --foreign --keep --verbose -dp /local/cygwin/  -I /c/local/NVIDIA_CUDA_SDK/common/inc/ matrixMul.cu 2>&1 | head -30

#$ _SPACE_=

#$ _HERE_=c:\local\CUDA\bin

#$ TOP=c:\local\CUDA\bin/..

#$ PATH=... # too long to print

#$ INCLUDES="-Ic:\local\CUDA\bin/../include" "-Ic:\local\CUDA\bin/../include/cudart"  

#$ LIBRARIES=  "c:\local\CUDA\bin/../lib/cuda.lib" "c:\local\CUDA\bin/../lib/cudart.lib"  /OPT:NOICF

#$ PTXAS_FLAGS=

#$ OPENCC_FLAGS=

#$ gcc -E -x c++ -DCUDA_FLOAT_MATH_FUNCTIONS -DCUDA_NO_SM_11_ATOMIC_INTRINSICS  "-Ic:\local\CUDA\bin/../include" "-Ic:\local\CUDA\bin/../include/cudart"   -I. -D__CUDACC__ -C  -I"/c/local/NVIDIA_CUDA_SDK/common/inc/" -include "cuda_runtime.h" -m32 -malign-double -o "matrixMul.cpp1.ii" "matrixMul.cu"

#$ cudafe --m32 "-Ic:\local\CUDA\bin/../include" "-Ic:\local\CUDA\bin/../include/cudart"   -I. --gen_c_file_name "matrixMul.cudafe1.c" --gen_device_file_name "matrixMul.cudafe1.gpu" --include_file_name matrixMul.fatbin.c --diag_error=host_device_limited_call --no_exceptions -tused  -I"/c/local/NVIDIA_CUDA_SDK/common/inc/" "matrixMul.cpp1.ii"

"c:/local/CUDA/bin/../include/vector_types.h", line 66: error: expected a type

         specifier

 struct __attribute__((aligned(2))) char2

                               ^



"c:/local/CUDA/bin/../include/vector_types.h", line 66: error: function

         "aligned" returns incomplete type "__attribute__"

 struct __attribute__((aligned(2))) char2

                       ^



"c:/local/CUDA/bin/../include/vector_types.h", line 66: error: expected a "{"

 struct __attribute__((aligned(2))) char2

                                    ^



"c:/local/CUDA/bin/../include/vector_types.h", line 69: warning: missing

         return statement at end of non-void function "aligned"

 };

 ^



"c:/local/CUDA/bin/../include/vector_types.h", line 68: warning: variable "x"

...




I had hoped that since gcc was supported for linux, it would be possible to use cygwin gcc tools under windows. The problem line:



struct __attribute__((aligned(2))) char2




works fine with gcc but cudafe reports an error. Has anyone gotten the CUDA tools to work with cygwin rather than MSVC? Is it even possible?



Suggestions welcome.

Thanks much.

#1
Posted 08/09/2007 07:38 PM   
You can download MicrosoftVS Express, the free version of visual studio, which comes with a command line compiler. You can use that from cygwin and it should work.

Edit: After seeing your subject line I see you do not want to use cl. Then my question is why? It is free...
You can download MicrosoftVS Express, the free version of visual studio, which comes with a command line compiler. You can use that from cygwin and it should work.



Edit: After seeing your subject line I see you do not want to use cl. Then my question is why? It is free...

#2
Posted 08/10/2007 05:58 PM   
Hi,

since this thread is already quite old, I was wondering if anybody has made any progress on this topic?

That is: [i]is it in the meantime possible to use cygwin in combination with gcc (NOT cl) on windows XP?[/i]

(the reason why I'd need this setup is that CUDA should be used in conjunction with an existing application that needs to be compiled with gcc).

Thanks in advance!
Hi,



since this thread is already quite old, I was wondering if anybody has made any progress on this topic?



That is: is it in the meantime possible to use cygwin in combination with gcc (NOT cl) on windows XP?



(the reason why I'd need this setup is that CUDA should be used in conjunction with an existing application that needs to be compiled with gcc).



Thanks in advance!

#3
Posted 08/01/2008 10:05 PM   
As far as I know, it's not possible to use the Cygwin gcc with CUDA.
As far as I know, it's not possible to use the Cygwin gcc with CUDA.

#4
Posted 08/01/2008 10:29 PM   
[quote name='tmurray' date='Aug 1 2008, 02:29 PM']As far as I know, it's not possible to use the Cygwin gcc with CUDA.
[right][snapback]419565[/snapback][/right]
[/quote]

Thanks (although I had hoped for a different answer /ermm.gif' class='bbc_emoticon' alt=':ermm:' />)
[quote name='tmurray' date='Aug 1 2008, 02:29 PM']As far as I know, it's not possible to use the Cygwin gcc with CUDA.

[snapback]419565[/snapback]






Thanks (although I had hoped for a different answer /ermm.gif' class='bbc_emoticon' alt=':ermm:' />)

#5
Posted 08/04/2008 04:37 PM   
OK let me ask again, since this thread is two years old: is it possible to use CUDA with cygwin gcc??
OK let me ask again, since this thread is two years old: is it possible to use CUDA with cygwin gcc??

#6
Posted 07/19/2011 01:14 PM   
[quote name='nocharge' date='19 July 2011 - 08:14 AM' timestamp='1311081298' post='1267436']
OK let me ask again, since this thread is two years old: is it possible to use CUDA with cygwin gcc??
[/quote]


According to the NVCC guide this is still not possible.
[quote name='nocharge' date='19 July 2011 - 08:14 AM' timestamp='1311081298' post='1267436']

OK let me ask again, since this thread is two years old: is it possible to use CUDA with cygwin gcc??







According to the NVCC guide this is still not possible.

#7
Posted 01/15/2012 11:43 PM   
[quote name='nocharge' date='19 July 2011 - 08:14 AM' timestamp='1311081298' post='1267436']
OK let me ask again, since this thread is two years old: is it possible to use CUDA with cygwin gcc??
[/quote]


According to the NVCC guide this is still not possible.
[quote name='nocharge' date='19 July 2011 - 08:14 AM' timestamp='1311081298' post='1267436']

OK let me ask again, since this thread is two years old: is it possible to use CUDA with cygwin gcc??







According to the NVCC guide this is still not possible.

#8
Posted 01/15/2012 11:43 PM   
[quote name='eelsen' date='10 August 2007 - 11:58 AM' timestamp='1186768696' post='235259']
You can download MicrosoftVS Express, the free version of visual studio, which comes with a command line compiler. You can use that from cygwin and it should work.

Edit: After seeing your subject line I see you do not want to use cl. Then my question is why? It is free...
[/quote]


Hi,

I had the same question (aka being able to use nvcc without cl, gcc for example) and disappointed to hear that it is not possible. The reason for not using MS VS express is that it is only for 32bits and my machine has windows 7 64bits....

I guess I will need to buy MSVS 10...
[quote name='eelsen' date='10 August 2007 - 11:58 AM' timestamp='1186768696' post='235259']

You can download MicrosoftVS Express, the free version of visual studio, which comes with a command line compiler. You can use that from cygwin and it should work.



Edit: After seeing your subject line I see you do not want to use cl. Then my question is why? It is free...







Hi,



I had the same question (aka being able to use nvcc without cl, gcc for example) and disappointed to hear that it is not possible. The reason for not using MS VS express is that it is only for 32bits and my machine has windows 7 64bits....



I guess I will need to buy MSVS 10...

#9
Posted 04/12/2012 08:01 PM   
[quote name='spknet' date='12 April 2012 - 09:01 PM' timestamp='1334260864' post='1395469']
Hi,

I had the same question (aka being able to use nvcc without cl, gcc for example) and disappointed to hear that it is not possible. The reason for not using MS VS express is that it is only for 32bits and my machine has windows 7 64bits....

I guess I will need to buy MSVS 10...
[/quote]

I have the same problem. As a work-around I compile .cu files with the -m32 flag. This produces a 32-bit executable, that runs without problems on a 64-bit Windows 7 system. One needs to set CUDA_LIB = $(CUDA_PATH)\lib\Win32\cudart.lib for linking - I use Makefiles with nmake.exe and cl.exe, not the VS IDE.
[quote name='spknet' date='12 April 2012 - 09:01 PM' timestamp='1334260864' post='1395469']

Hi,



I had the same question (aka being able to use nvcc without cl, gcc for example) and disappointed to hear that it is not possible. The reason for not using MS VS express is that it is only for 32bits and my machine has windows 7 64bits....



I guess I will need to buy MSVS 10...





I have the same problem. As a work-around I compile .cu files with the -m32 flag. This produces a 32-bit executable, that runs without problems on a 64-bit Windows 7 system. One needs to set CUDA_LIB = $(CUDA_PATH)\lib\Win32\cudart.lib for linking - I use Makefiles with nmake.exe and cl.exe, not the VS IDE.

#10
Posted 04/20/2012 08:16 AM   
Scroll To Top