I am trying to get barra-sim running on OpenSUSE 12.3 x64. I downloaded cuda sdk 2.3 because it is the lastest version of cuda toolkit supported by barra-sim.
When I try to compile the sample code in NVIDIA_GPU_Computing_SDK it give me the following error saying “__builtin_bswap32” is undefined. Is there any way to fix this problem?
Thanks
make -C src/BlackScholes/
make[1]: Entering directory `/home/cheng/NVIDIA_GPU_Computing_SDK/C/src/BlackScholes'
/usr/include/bits/byteswap.h(47): error: identifier "__builtin_bswap32" is undefined
/usr/include/bits/byteswap.h(111): error: identifier "__builtin_bswap64" is undefined
2 errors detected in the compilation of "/tmp/tmpxft_00003c03_00000000-4_BlackScholes.cpp1.ii".
make[1]: *** [obj/release/BlackScholes.cu.o] Error 255
make[1]: Leaving directory `/home/cheng/NVIDIA_GPU_Computing_SDK/C/src/BlackScholes'
make: *** [src/BlackScholes/Makefile.ph_build] Error 2
Thank you for your reply. However, it did not solve the problem I have. My openSUSE 12.3 has linux-glibc-devel-3.7.1-2.1.3.noarch installed. and the swab.h file only has couple of lines:
#ifndef _ASM_TILE_SWAB_H
#define _ASM_TILE_SWAB_H
/* Tile gcc is always >= 4.3.0, so we use __builtin_bswap. */
#define __arch_swab32(x) __builtin_bswap32(x)
#define __arch_swab64(x) __builtin_bswap64(x)
#define __arch_swab16(x) (__builtin_bswap32(x) >> 16)
#endif
The code that gives me error:
#ifdef __GNUC__
# if __GNUC_PREREQ (4, 3)
static __inline unsigned int
__bswap_32 (unsigned int __bsx)
{
return __builtin_bswap32 (__bsx); <---
}
# elif __GNUC__ >= 2
I tried to replace __builtin_bswap32(__bsx) with __arch_swab32(__bsx), but it didn’t do anything to the problem
Yes, I have copy and paste the error to google, but didn’t get much from it. Is there anyway to make it compile with a newer version of gcc?
dsgafThe goal of this project I try to do is to make barra-sim more portable and compatible with newer technology, but I am still fairly new to c and c++ so I don’t know much about the compatibility issues.
I have already built barra-sim. I just want to test it to see if it is working. The latest version of cuda toolkit it supports is 2.3, so I kind of have to get cuda sdk 2.3 build right now.
They aren’t on the mirrors, so you will need to click on the files you need and install manually. Then you would need to export the gcc version (isn’t this done via a nvcc option?) so it points to the gcc version when building.
Am 02.04.2013 06:16, schrieb malcolmlewis:
>
> Kaito_Hacker;2543664 Wrote:
>> I have already built barra-sim. I just want to test it to see if it is
>> working. The latest version of cuda toolkit it supports is 2.3, so I
>> kind of have to get cuda sdk 2.3 build right now.
> Hi
> Looks like there are 12.3 gcc4.3.4 packages here;
> http://tinyurl.com/coyb5dl
>
> They aren’t on the mirrors, so you will need to click on the files you
> need and install manually. Then you would need to export the gcc version
> (isn’t this done via a nvcc option?) so it points to the gcc version
> when building.
>
>
You are completely right about the older gcc to use, that was already
needed in 12.2 for CUDA and discussed here http://forums.opensuse.org/english/get-technical-help-here/install-boot-login/480602-easy-downgrade-12-2-12-1-a.html
It should really work the same on 12.3 (not yet tested by me).
–
PC: oS 12.3 x86_64 | i7-2600@3.40GHz | 16GB | KDE 4.10.0 | GTX 650 Ti
ThinkPad E320: oS 12.3 x86_64 | i3@2.30GHz | 8GB | KDE 4.10.0 | HD 3000
HannsBook: oS 12.3 x86_64 | SU4100@1.3GHz | 2GB | KDE 4.10.0 | GMA4500
On Tue 02 Apr 2013 09:04:14 AM CDT, Martin Helm wrote:
Am 02.04.2013 06:16, schrieb malcolmlewis:
>
> Kaito_Hacker;2543664 Wrote:
>> I have already built barra-sim. I just want to test it to see if it
>> is working. The latest version of cuda toolkit it supports is 2.3,
>> so I kind of have to get cuda sdk 2.3 build right now.
> Hi
> Looks like there are 12.3 gcc4.3.4 packages here;
> http://tinyurl.com/coyb5dl
>
> They aren’t on the mirrors, so you will need to click on the files you
> need and install manually. Then you would need to export the gcc
> version (isn’t this done via a nvcc option?) so it points to the gcc
> version when building.
>
>
You are completely right about the older gcc to use, that was already
needed in 12.2 for CUDA and discussed here http://forums.opensuse.org/english/get-technical-help-here/install-boot-login/480602-easy-downgrade-12-2-12-1-a.html
It should really work the same on 12.3 (not yet tested by me).
Hi
Ahh, didn’t do a search I built barra-sim as a rpm, so I normally
export on the fly, rather than a symlink;
Am 02.04.2013 14:13, schrieb malcolmlewis:
> Hi
> Ahh, didn’t do a search I built barra-sim as a rpm, so I normally
> export on the fly, rather than a symlink;
> export CC=/usr/bin/gcc-4.3
> export CXX=/usr/bin/g+±4.3
The Cuda installer did not like that back then (I used the full Cuda 5
package which includes also the SDK), I have not tried again in the
meantime, maybe it is better now.
Worth a try at least, I admit the symbolic link was nothing than an ugly
hack to get it done.
–
PC: oS 12.3 x86_64 | i7-2600@3.40GHz | 16GB | KDE 4.10.0 | GTX 650 Ti
ThinkPad E320: oS 12.3 x86_64 | i3@2.30GHz | 8GB | KDE 4.10.0 | HD 3000
HannsBook: oS 12.3 x86_64 | SU4100@1.3GHz | 2GB | KDE 4.10.0 | GMA4500
malcolmlewis;2543672 Wrote:
> Hi
> Looks like there are 12.3 gcc4.3.4 packages here;
> http://tinyurl.com/coyb5dl
>
> They aren’t on the mirrors, so you will need to click on the files you
> need and install manually. Then you would need to export the gcc
> version (isn’t this done via a nvcc option?) so it points to the gcc
> version when building.
Where can I download those packages? I can’t find it in the download
repository.
Hi
Correct, they don’t appear to be synced. You need to click on the rpm
names for your arch, it will take you to another page with the file
information. At the top, the name is a download link (Detailed
information). You will need to create an OBS account though…
–
Cheers Malcolm °¿° (Linux Counter #276890)
openSUSE 12.3 (x86_64) Kernel 3.7.10-1.1-desktop
up 1 day 23:06, 4 users, load average: 0.04, 0.03, 0.05
CPU Intel® i5 CPU M520@2.40GHz | GPU Intel® Ironlake Mobile
#ifdef __GNUC__
# if __GNUC_PREREQ (4, 3)
+ extern unsigned int __builtin_bswap32(unsigned int);
+ extern unsigned long long __builtin_bswap64(unsigned long long);
static __inline unsigned int
__bswap_32 (unsigned int __bsx)
{
return __builtin_bswap32 (__bsx);
}
# elif __GNUC__ >= 2
So I have add those two line I found online to the code and the error disappeared, did it actually fix the problem? The place I found this two line didn’t have clear explanation on what they does and how they fix the problem so I am quite sure if this actually works or not.
malcolmlewis;2544116 Wrote:
> Hi
> Correct, they don’t appear to be synced. You need to click on the rpm
> names for your arch, it will take you to another page with the file
> information. At the top, the name is a download link (Detailed
> information). You will need to create an OBS account though…
>
>
> –
> Cheers Malcolm °¿° (Linux Counter #276890)
> openSUSE 12.3 (x86_64) Kernel 3.7.10-1.1-desktop
> up 1 day 23:06, 4 users, load average: 0.04, 0.03, 0.05
> CPU Intel® i5 CPU M520@2.40GHz | GPU Intel® Ironlake Mobile
Code:
#ifdefGNUC
if __GNUC_PREREQ (4, 3)
extern unsigned int __builtin_bswap32(unsigned int);
extern unsigned long long __builtin_bswap64(unsigned long long);
static __inline unsigned int
__bswap_32 (unsigned int __bsx)
{
return __builtin_bswap32 (__bsx);
}
elif GNUC >= 2
So I have add those two line I found online to the code and the error
disappeared, did it actually fix the problem? The place I found this two
line didn’t have clear explanation on what they does and how they fix
the problem so I am quite sure if this actually works or not.