I've Built a Couple OSX CUDA Apps...

Message boards : Number crunching : I've Built a Couple OSX CUDA Apps...
Message board moderation

To post messages, you must log in.

1 · 2 · 3 · 4 . . . 49 · Next

AuthorMessage
TBar
Volunteer tester

Send message
Joined: 22 May 99
Posts: 3788
Credit: 186,019,806
RAC: 236,509
United States
Message 1745455 - Posted: 28 Nov 2015, 19:23:06 UTC
Last modified: 28 Nov 2015, 19:33:48 UTC

However, I'm still receiving the same Errors in Mavericks using the current repository files;
...-msse2 -mfpmath=sse -DUSE_SSE -DUSE_SSE2   -MT seti_cuda-analyzeFuncs_sse2.o -MD -MP -MF .deps/seti_cuda-analyzeFuncs_sse2.Tpo -c -o seti_cuda-analyzeFuncs_sse2.o `test -f 'vector/analyzeFuncs_sse2.cpp' || echo './'`vector/analyzeFuncs_sse2.cpp
In file included from vector/analyzeFuncs_sse2.cpp:33:
vector/x86_float4.h:59:44: error: use of undeclared identifier 'INT_MIN'
ALIGNED(static const int sign_bits[4],16)={INT_MIN, INT_MIN, INT_MIN, INT_MIN};
                                           ^
vector/x86_float4.h:59:53: error: use of undeclared identifier 'INT_MIN'
ALIGNED(static const int sign_bits[4],16)={INT_MIN, INT_MIN, INT_MIN, INT_MIN};
                                                    ^
vector/x86_float4.h:59:62: error: use of undeclared identifier 'INT_MIN'
ALIGNED(static const int sign_bits[4],16)={INT_MIN, INT_MIN, INT_MIN, INT_MIN};
                                                             ^
vector/x86_float4.h:59:71: error: use of undeclared identifier 'INT_MIN'
ALIGNED(static const int sign_bits[4],16)={INT_MIN, INT_MIN, INT_MIN, INT_MIN};
                                                                      ^
vector/x86_float4.h:60:45: error: use of undeclared identifier 'INT_MAX'
ALIGNED(static const int other_bits[4],16)={INT_MAX, INT_MAX, INT_MAX, INT_MAX};
                                            ^
vector/x86_float4.h:60:54: error: use of undeclared identifier 'INT_MAX'
ALIGNED(static const int other_bits[4],16)={INT_MAX, INT_MAX, INT_MAX, INT_MAX};
                                                     ^
vector/x86_float4.h:60:63: error: use of undeclared identifier 'INT_MAX'
ALIGNED(static const int other_bits[4],16)={INT_MAX, INT_MAX, INT_MAX, INT_MAX};
                                                              ^
vector/x86_float4.h:60:72: error: use of undeclared identifier 'INT_MAX'
ALIGNED(static const int other_bits[4],16)={INT_MAX, INT_MAX, INT_MAX, INT_MAX};
                                                                       ^
vector/x86_float4.h:259:12: warning: conversion function converting 'const_float4' to its base class 'float4' will never be used
    inline operator float4() const { return *this; };

&
...-msse2 -mfpmath=sse -DUSE_SSE -DUSE_SSE2   -DUSE_SSE3 \
        -MT seti_cuda-analyzeFuncs_sse3.o -MD -MP -MF ".deps/seti_cuda-analyzeFuncs_sse3.Tpo" -msse3 \
	-c -o seti_cuda-analyzeFuncs_sse3.o vector/analyzeFuncs_sse3.cpp; then mv -f ".deps/seti_cuda-analyzeFuncs_sse3.Tpo" ".deps/seti_cuda-analyzeFuncs_sse3.Po"; \
	else rm -f ".deps/seti_cuda-analyzeFuncs_sse3.Tpo"; exit 1; fi
In file included from vector/analyzeFuncs_sse3.cpp:36:
vector/x86_float4.h:59:44: error: use of undeclared identifier 'INT_MIN'
ALIGNED(static const int sign_bits[4],16)={INT_MIN, INT_MIN, INT_MIN, INT_MIN};
                                           ^
vector/x86_float4.h:59:53: error: use of undeclared identifier 'INT_MIN'
ALIGNED(static const int sign_bits[4],16)={INT_MIN, INT_MIN, INT_MIN, INT_MIN};
                                                    ^
vector/x86_float4.h:59:62: error: use of undeclared identifier 'INT_MIN'
ALIGNED(static const int sign_bits[4],16)={INT_MIN, INT_MIN, INT_MIN, INT_MIN};
                                                             ^
vector/x86_float4.h:59:71: error: use of undeclared identifier 'INT_MIN'
ALIGNED(static const int sign_bits[4],16)={INT_MIN, INT_MIN, INT_MIN, INT_MIN};
                                                                      ^
vector/x86_float4.h:60:45: error: use of undeclared identifier 'INT_MAX'
ALIGNED(static const int other_bits[4],16)={INT_MAX, INT_MAX, INT_MAX, INT_MAX};
                                            ^
vector/x86_float4.h:60:54: error: use of undeclared identifier 'INT_MAX'
ALIGNED(static const int other_bits[4],16)={INT_MAX, INT_MAX, INT_MAX, INT_MAX};
                                                     ^
vector/x86_float4.h:60:63: error: use of undeclared identifier 'INT_MAX'
ALIGNED(static const int other_bits[4],16)={INT_MAX, INT_MAX, INT_MAX, INT_MAX};
                                                              ^
vector/x86_float4.h:60:72: error: use of undeclared identifier 'INT_MAX'
ALIGNED(static const int other_bits[4],16)={INT_MAX, INT_MAX, INT_MAX, INT_MAX};
                                                                       ^
vector/x86_float4.h:259:12: warning: conversion function converting 'const_float4' to its base class 'float4' will never be used
    inline operator float4() const { return *this; };

&
...-msse2 -mfpmath=sse -DUSE_SSE -DUSE_SSE2   -MT seti_cuda-analyzeFuncs.o -MD -MP -MF .deps/seti_cuda-analyzeFuncs.Tpo -c -o seti_cuda-analyzeFuncs.o `test -f 'analyzeFuncs.cpp' || echo './'`analyzeFuncs.cpp
In file included from analyzeFuncs.cpp:73:
./cuda/cudaAcc_utilities.h:4:37: error: unknown type name 'cudaError_t'
extern int cudaAcc_SafeCall_No_Sync(cudaError_t err, char* errMessage, char* file, int line);
                                    ^
./cuda/cudaAcc_utilities.h:5:34: error: unknown type name 'cudaError_t'
extern int cudaAcc_SafeCall_Sync(cudaError_t err, char* errMessage, char* file, int line);
                                 ^
./cuda/cudaAcc_utilities.h:6:43: error: unknown type name 'cudaError_t'
extern int cudaAcc_SafeCall_No_Sync_wExit(cudaError_t err, char* errMessage, char* file, int line);
                                          ^
analyzeFuncs.cpp:101:9: warning: ----ooura---- [-W#pragma-messages]
#pragma message ("----ooura----")

It ends with;
g++ -mmacosx-version-min=10.8 -ldl /usr/lib/libz.1.dylib -lpthread -fstrict-aliasing -framework Carbon -Wl,-rpath,\$ORIGIN -o seti_cuda seti_cuda-main.o seti_cuda-confsettings.o seti_cuda-analyzeFuncs_vector.o seti_cuda-analyzeFuncs_fpu.o seti_cuda-analyzeFuncs_sse.o seti_cuda-analyzeFuncs_sse2.o seti_cuda-analyzeFuncs_sse3.o seti_cuda-analyzeFuncs_x86_64.o seti_cuda-analyzeFuncs_altivec.o seti_cuda-x86_float4.o seti_cuda-hires_timer.o seti_cuda-analyzeFuncs.o seti_cuda-analyzeReport.o seti_cuda-analyzePoT.o seti_cuda-pulsefind.o seti_cuda-gaussfit.o seti_cuda-lcgamm.o seti_cuda-malloc_a.o seti_cuda-seti.o seti_cuda-seti_header.o seti_cuda-timecvt.o seti_cuda-s_util.o seti_cuda-sah_version.o seti_cuda-worker.o seti_cuda-chirpfft.o seti_cuda-spike.o seti_cuda-progress.o seti_cuda-fft8g.o seti_cuda-gdata.o seti_cuda-autocorr.o seti_cuda-schema_master.o seti_cuda-sqlrow.o seti_cuda-sqlblob.o seti_cuda-xml_util.o   -L/Users/Tom/boinc/api -lboinc_api -L/Users/Tom/boinc/lib -lboinc  -lm      cudaAcceleration.o cudaAcc_CalcChirpData.o cudaAcc_fft.o cudaAcc_gaussfit.o cudaAcc_PowerSpectrum.o cudaAcc_pulsefind.o cudaAcc_summax.o cudaAcc_transpose.o cudaAcc_utilities.o cudaAcc_autocorr.o cudaAcc_analyzeReport.o -lpthread -L/Developer/NVIDIA/CUDA-6.0/lib64 -lcudart -lcufft -I/Developer/NVIDIA/CUDA-6.0/include
clang: error: no such file or directory: 'seti_cuda-analyzeFuncs_sse2.o'
clang: error: no such file or directory: 'seti_cuda-analyzeFuncs_sse3.o'
clang: error: no such file or directory: 'seti_cuda-analyzeFuncs.o'
clang: error: no such file or directory: 'cudaAcceleration.o'
make[2]: [seti_cuda] Error 1 (ignored)
...
/bin/cp seti_cuda setiathome_x41zc_x86_64-apple-darwin_cuda60
cp: seti_cuda: No such file or directory
make[2]: [setiathome_x41zc_x86_64-apple-darwin_cuda60] Error 1 (ignored)
strip setiathome_x41zc_x86_64-apple-darwin_cuda60
error: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/strip: can't open file: setiathome_x41zc_x86_64-apple-darwin_cuda60 (No such file or directory)

Ideas, suggestions, comments...
ID: 1745455 · Report as offensive     Reply Quote
Profile Gary CharpentierCrowdfunding Project Donor
Volunteer tester
Avatar

Send message
Joined: 25 Dec 00
Posts: 21095
Credit: 30,537,606
RAC: 21,351
United States
Message 1745465 - Posted: 28 Nov 2015, 20:31:44 UTC - in response to Message 1745455.  

ID: 1745465 · Report as offensive     Reply Quote
TBar
Volunteer tester

Send message
Joined: 22 May 99
Posts: 3788
Credit: 186,019,806
RAC: 236,509
United States
Message 1745468 - Posted: 28 Nov 2015, 20:55:42 UTC - in response to Message 1745465.  
Last modified: 28 Nov 2015, 21:24:19 UTC

Yes, that was a while ago. It seems easy enough to fix, just declare INT_MAX, fix the type name cudaError_t, and possibly it will produce a working App.

Yes, it's right there;
/* C90/99 5.2.4.2.1 */
#define SCHAR_MAX __SCHAR_MAX__
#define SHRT_MAX __SHRT_MAX__
#define INT_MAX __INT_MAX__
#define LONG_MAX __LONG_MAX__

#define SCHAR_MIN (-__SCHAR_MAX__-1)
#define SHRT_MIN (-__SHRT_MAX__ -1)
#define INT_MIN (-__INT_MAX__ -1)
ID: 1745468 · Report as offensive     Reply Quote
Profile Gary CharpentierCrowdfunding Project Donor
Volunteer tester
Avatar

Send message
Joined: 25 Dec 00
Posts: 21095
Credit: 30,537,606
RAC: 21,351
United States
Message 1745484 - Posted: 28 Nov 2015, 22:30:27 UTC - in response to Message 1745468.  

Yes, that was a while ago. It seems easy enough to fix, just declare INT_MAX, fix the type name cudaError_t, and possibly it will produce a working App.

Yes, it's right there;
/* C90/99 5.2.4.2.1 */
#define SCHAR_MAX __SCHAR_MAX__
#define SHRT_MAX __SHRT_MAX__
#define INT_MAX __INT_MAX__
#define LONG_MAX __LONG_MAX__

#define SCHAR_MIN (-__SCHAR_MAX__-1)
#define SHRT_MIN (-__SHRT_MAX__ -1)
#define INT_MIN (-__INT_MAX__ -1)

Well, maybe, but something is causing the limits.h header file to not be processed. Some of those library files use a lot of macro tricks and it is possible someone has defined or undefined a reserved identifier they should not have. It might work with some compilers but not others!

You might want to ask on the Dev board as Charlie may have a correct fix for this.
ID: 1745484 · Report as offensive     Reply Quote
Profile jason_gee
Volunteer developer
Volunteer tester
Avatar

Send message
Joined: 24 Nov 06
Posts: 7471
Credit: 91,022,419
RAC: 11,075
Australia
Message 1745486 - Posted: 28 Nov 2015, 22:34:55 UTC
Last modified: 28 Nov 2015, 22:58:10 UTC

Should be able to attempt to include cleaning up the OSX build situation as the v8 code goes in, adding in what you find. In a lot of cases the currently active codepaths don't ever use the functions in those cpu targeted files, so they can most likely in a number of cases come out of the build process entirely (and possibly be removed from the branch, as dead code).

The other helpful thing for distribution builds would be to add the switches into the makefile templates for adding the executable origin into the library search path of the executable. That's just so users don't need to install any Cuda toolkit(s)/ After build, that was using otool (or whatever it was called that I used, fair while back now), but should be injectable in the makefile linker settings instead.
"Living by the wisdom of computer science doesn't sound so bad after all. And unlike most advice, it's backed up by proofs." -- Algorithms to live by: The computer science of human decisions.
ID: 1745486 · Report as offensive     Reply Quote
TBar
Volunteer tester

Send message
Joined: 22 May 99
Posts: 3788
Credit: 186,019,806
RAC: 236,509
United States
Message 1745501 - Posted: 29 Nov 2015, 0:33:15 UTC - in response to Message 1745486.  

If I search Xbranch 'configure' for limits.h I find;
/* System header to define __stub macros and hopefully few prototypes,
    which can conflict with char $2 (); below.
    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
    <limits.h> exists even on freestanding compilers.  */

#ifdef __STDC__
# include <limits.h>
#else
# include <assert.h>
#endif

If I search the compiler for limits.h I find;
checking /usr/include/assert.h usability... yes
checking /usr/include/assert.h presence... yes
checking for /usr/include/assert.h... yes
checking /Developer/include/limits.h usability... yes
checking /Developer/include/limits.h presence... yes
checking for /Developer/include/limits.h... yes

So...limits.h is seen, but Not used it would seem.
If I search the compiler for STDC, it doesn't find anything...
ID: 1745501 · Report as offensive     Reply Quote
Profile jason_gee
Volunteer developer
Volunteer tester
Avatar

Send message
Joined: 24 Nov 06
Posts: 7471
Credit: 91,022,419
RAC: 11,075
Australia
Message 1745503 - Posted: 29 Nov 2015, 0:56:18 UTC - in response to Message 1745501.  
Last modified: 29 Nov 2015, 1:07:12 UTC

probably just a factor relating to things using clang (perhaps...)

In that context I would just *try* changing:
#ifdef __STDC__
to
#if 1

and see what happens (then if it helps, fix it properly later with other ifdefs). There could be other issues cascading from doing that, though I wouldn't expect limits.h to be too deep.

[Edit:]
#if defined(__STDC__) || defined(__clang__)
, or similar may work
"Living by the wisdom of computer science doesn't sound so bad after all. And unlike most advice, it's backed up by proofs." -- Algorithms to live by: The computer science of human decisions.
ID: 1745503 · Report as offensive     Reply Quote
TBar
Volunteer tester

Send message
Joined: 22 May 99
Posts: 3788
Credit: 186,019,806
RAC: 236,509
United States
Message 1745505 - Posted: 29 Nov 2015, 1:36:42 UTC - in response to Message 1745503.  
Last modified: 29 Nov 2015, 1:38:20 UTC

I changed every instance of #ifdef __STDC__ to #if defined(__STDC__) || defined(__clang__)
There must be half a dozen or more, I lost count.
It didn't change anything, I still get the same errors;
/Users/Tom/sah_v7_opt/Xbranch/client/vector/x86_float4.h:59:71: error: use of undeclared identifier 'INT_MIN'
ALIGNED(static const int sign_bits[4],16)={INT_MIN, INT_MIN, INT_MIN, INT_MIN};
^
/Users/Tom/sah_v7_opt/Xbranch/client/vector/x86_float4.h:60:45: error: use of undeclared identifier 'INT_MAX'
ALIGNED(static const int other_bits[4],16)={INT_MAX, INT_MAX, INT_MAX, INT_MAX};
...
clang: error: no such file or directory: 'seti_cuda-analyzeFuncs_sse2.o'
clang: error: no such file or directory: 'seti_cuda-analyzeFuncs_sse3.o'
clang: error: no such file or directory: 'seti_cuda-analyzeFuncs.o'
clang: error: no such file or directory: 'cudaAcceleration.o'

:-(
ID: 1745505 · Report as offensive     Reply Quote
Profile jason_gee
Volunteer developer
Volunteer tester
Avatar

Send message
Joined: 24 Nov 06
Posts: 7471
Credit: 91,022,419
RAC: 11,075
Australia
Message 1745506 - Posted: 29 Nov 2015, 1:41:34 UTC - in response to Message 1745505.  
Last modified: 29 Nov 2015, 2:16:07 UTC

Well must be some other test inside limits.h, or the defines aren't there. Will be able to have a good look a bit later with beer stocks replenished.

[Edit:] note that by rights only the non sse named analyzefuncs has the Cuda code, and the required functions (though we build them with sse+ capability anyway, 64 bit having mandatory sse2 minimum). Something to go through the configure (and template makefile) lines and remove the dead file entries, as I did for Linux.

[Edit:] I am assuming later Cuda toolkit(s) and OSX environment switched over to clang entirely... something to verify that we aren't forced to using gcc if possible.

[Edit:] Confirmed for Cuda 7 onwards (at least), have to use clang+XCode
Table 1. Mac Operating System Support in CUDA 7.0
OS	Toolchain
Native x86_64	Clang 5.0 (Xcode 5)	Clang 6.0 (Xcode 6)
Mac OS X 10.10	NO	YES
Mac OS X 10.9	YES	YES

"Living by the wisdom of computer science doesn't sound so bad after all. And unlike most advice, it's backed up by proofs." -- Algorithms to live by: The computer science of human decisions.
ID: 1745506 · Report as offensive     Reply Quote
Profile jason_gee
Volunteer developer
Volunteer tester
Avatar

Send message
Joined: 24 Nov 06
Posts: 7471
Credit: 91,022,419
RAC: 11,075
Australia
Message 1745509 - Posted: 29 Nov 2015, 2:31:38 UTC - in response to Message 1745484.  
Last modified: 29 Nov 2015, 2:35:22 UTC

Well, maybe, but something is causing the limits.h header file to not be processed. Some of those library files use a lot of macro tricks and it is possible someone has defined or undefined a reserved identifier they should not have. It might work with some compilers but not others!

You might want to ask on the Dev board as Charlie may have a correct fix for this.


clang didn't exist afaik (or at least wasn't required by default on OSX + Cuda Toolkit). Will probably have to update the whole configure/make system to handle it correctly (now that I actually own a Mac)
"Living by the wisdom of computer science doesn't sound so bad after all. And unlike most advice, it's backed up by proofs." -- Algorithms to live by: The computer science of human decisions.
ID: 1745509 · Report as offensive     Reply Quote
TBar
Volunteer tester

Send message
Joined: 22 May 99
Posts: 3788
Credit: 186,019,806
RAC: 236,509
United States
Message 1745516 - Posted: 29 Nov 2015, 3:00:30 UTC - in response to Message 1745509.  

No Clang?
:-(
ID: 1745516 · Report as offensive     Reply Quote
Profile jason_gee
Volunteer developer
Volunteer tester
Avatar

Send message
Joined: 24 Nov 06
Posts: 7471
Credit: 91,022,419
RAC: 11,075
Australia
Message 1745520 - Posted: 29 Nov 2015, 3:57:01 UTC - in response to Message 1745516.  
Last modified: 29 Nov 2015, 4:21:42 UTC

No Clang?
:-(


hahaha, well not at the time seti@home and the Cuda makefiles were setup. Now of course it's required on OSX+Cuda (unless you use a very old Cuda toolkit)

Clang came about, I believe roughly first release 2009 as a part of LLVM's success. Cuda started adopting LLVM components to replace the original compiler about Cuda 4. No idea when OSX+XCode switched from gcc to clang completely.

In any case, yeah this codebase is substantially older than Clang, even though primitive forms existed for later parts, they were far from 'standard'

Now it seems they are well ahead in adopting new C standards :D (that's a good thing and worthy migrating everything where practical)

[Edit:] note that gradle, as used mostly under android+java for now, could well pass popularity of the configure/make build tools, so that'll be another thing to consider integrating in time. [ ... at which point, if so, autosetup+configure+make would probably fall into a [further!] state of neglect, since gradle supports all the platforms, and detects compilers etc]
"Living by the wisdom of computer science doesn't sound so bad after all. And unlike most advice, it's backed up by proofs." -- Algorithms to live by: The computer science of human decisions.
ID: 1745520 · Report as offensive     Reply Quote
Profile Gary CharpentierCrowdfunding Project Donor
Volunteer tester
Avatar

Send message
Joined: 25 Dec 00
Posts: 21095
Credit: 30,537,606
RAC: 21,351
United States
Message 1745536 - Posted: 29 Nov 2015, 5:50:25 UTC - in response to Message 1745516.  

No Clang?
:-(

Yes, clang is the issue. Their versions of headers are not the same as gcc/lvmm
I suspect a switch might be missing on the compile line or a macro requesting a specific handling is missing, so the wrong/incompatible library header files may be in use. Mind you I'm no expert.

gcc's version
/*
 * Copyright (c) 1988, 1993
 *	The Regents of the University of California.  All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 * 3. All advertising materials mentioning features or use of this software
 *    must display the following acknowledgement:
 *	This product includes software developed by the University of
 *	California, Berkeley and its contributors.
 * 4. Neither the name of the University nor the names of its contributors
 *    may be used to endorse or promote products derived from this software
 *    without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 * SUCH DAMAGE.
 *
 *	@(#)limits.h	8.3 (Berkeley) 1/4/94
 */

#ifndef _I386_LIMITS_H_
#define _I386_LIMITS_H_

#include <sys/cdefs.h>
#include <i386/_limits.h>

#define	CHAR_BIT	8		/* number of bits in a char */
#define	MB_LEN_MAX	6		/* Allow 31 bit UTF2 */

#if !defined(_ANSI_SOURCE) && (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE))
#define	CLK_TCK		__DARWIN_CLK_TCK	/* ticks per second */
#endif /* !_ANSI_SOURCE && (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */

/*
 * According to ANSI (section 2.2.4.2), the values below must be usable by
 * #if preprocessing directives.  Additionally, the expression must have the
 * same type as would an expression that is an object of the corresponding
 * type converted according to the integral promotions.  The subtraction for
 * INT_MIN and LONG_MIN is so the value is not unsigned; 2147483648 is an
 * unsigned int for 32-bit two's complement ANSI compilers (section 3.1.3.2).
 * These numbers work for pcc as well.  The UINT_MAX and ULONG_MAX values
 * are written as hex so that GCC will be quiet about large integer constants.
 */
#define	SCHAR_MAX	127		/* min value for a signed char */
#define	SCHAR_MIN	(-128)		/* max value for a signed char */

#define	UCHAR_MAX	255		/* max value for an unsigned char */
#define	CHAR_MAX	127		/* max value for a char */
#define	CHAR_MIN	(-128)		/* min value for a char */

#define	USHRT_MAX	65535		/* max value for an unsigned short */
#define	SHRT_MAX	32767		/* max value for a short */
#define	SHRT_MIN	(-32768)	/* min value for a short */

#define	UINT_MAX	0xffffffff	/* max value for an unsigned int */
#define	INT_MAX		2147483647	/* max value for an int */
#define	INT_MIN		(-2147483647-1)	/* min value for an int */

#ifdef __LP64__
#define	ULONG_MAX	0xffffffffffffffffUL	/* max unsigned long */
#define	LONG_MAX	0x7fffffffffffffffL	/* max signed long */
#define	LONG_MIN	(-0x7fffffffffffffffL-1) /* min signed long */
#else /* !__LP64__ */
#define	ULONG_MAX	0xffffffffUL	/* max unsigned long */
#define	LONG_MAX	2147483647L	/* max signed long */
#define	LONG_MIN	(-2147483647L-1) /* min signed long */
#endif /* __LP64__ */

#define	ULLONG_MAX	0xffffffffffffffffULL	/* max unsigned long long */
#define	LLONG_MAX	0x7fffffffffffffffLL	/* max signed long long */
#define	LLONG_MIN	(-0x7fffffffffffffffLL-1) /* min signed long long */

#if !defined(_ANSI_SOURCE)
#ifdef __LP64__
#define LONG_BIT	64
#else /* !__LP64__ */
#define LONG_BIT	32
#endif /* __LP64__ */
#define	SSIZE_MAX	LONG_MAX	/* max value for a ssize_t */
#define WORD_BIT	32

#if (!defined(_POSIX_C_SOURCE) && !defined(_XOPEN_SOURCE)) || defined(_DARWIN_C_SOURCE)
#define	SIZE_T_MAX	ULONG_MAX	/* max value for a size_t */

#define	UQUAD_MAX	ULLONG_MAX
#define	QUAD_MAX	LLONG_MAX
#define	QUAD_MIN	LLONG_MIN

#endif /* (!_POSIX_C_SOURCE && !_XOPEN_SOURCE) || _DARWIN_C_SOURCE */
#endif /* !_ANSI_SOURCE */

#endif /* _I386_LIMITS_H_ */


contrast with clang's version
/*===---- limits.h - Standard header for integer sizes --------------------===*\
 *
 * Copyright (c) 2009 Chris Lattner
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE.
 *
\*===----------------------------------------------------------------------===*/

#ifndef __CLANG_LIMITS_H
#define __CLANG_LIMITS_H

/* The system's limits.h may, in turn, try to #include_next GCC's limits.h.
   Avert this #include_next madness. */
#if defined __GNUC__ && !defined _GCC_LIMITS_H_
#define _GCC_LIMITS_H_
#endif

/* System headers include a number of constants from POSIX in <limits.h>.
   Include it if we're hosted. */
#if __STDC_HOSTED__ && \
    defined(__has_include_next) && __has_include_next(<limits.h>)
#include_next <limits.h>
#endif

/* Many system headers try to "help us out" by defining these.  No really, we
   know how big each datatype is. */
#undef  SCHAR_MIN
#undef  SCHAR_MAX
#undef  UCHAR_MAX
#undef  SHRT_MIN
#undef  SHRT_MAX
#undef  USHRT_MAX
#undef  INT_MIN
#undef  INT_MAX
#undef  UINT_MAX
#undef  LONG_MIN
#undef  LONG_MAX
#undef  ULONG_MAX

#undef  CHAR_BIT
#undef  CHAR_MIN
#undef  CHAR_MAX

/* C90/99 5.2.4.2.1 */
#define SCHAR_MAX __SCHAR_MAX__
#define SHRT_MAX  __SHRT_MAX__
#define INT_MAX   __INT_MAX__
#define LONG_MAX  __LONG_MAX__

#define SCHAR_MIN (-__SCHAR_MAX__-1)
#define SHRT_MIN  (-__SHRT_MAX__ -1)
#define INT_MIN   (-__INT_MAX__  -1)
#define LONG_MIN  (-__LONG_MAX__ -1L)

#define UCHAR_MAX (__SCHAR_MAX__*2  +1)
#define USHRT_MAX (__SHRT_MAX__ *2  +1)
#define UINT_MAX  (__INT_MAX__  *2U +1U)
#define ULONG_MAX (__LONG_MAX__ *2UL+1UL)

#ifndef MB_LEN_MAX
#define MB_LEN_MAX 1
#endif

#define CHAR_BIT  __CHAR_BIT__

#ifdef __CHAR_UNSIGNED__  /* -funsigned-char */
#define CHAR_MIN 0
#define CHAR_MAX UCHAR_MAX
#else
#define CHAR_MIN SCHAR_MIN
#define CHAR_MAX __SCHAR_MAX__
#endif

/* C99 5.2.4.2.1: Added long long.
   C++11 18.3.3.2: same contents as the Standard C Library header <limits.h>.
 */
#if __STDC_VERSION__ >= 199901 || __cplusplus >= 201103L

#undef  LLONG_MIN
#undef  LLONG_MAX
#undef  ULLONG_MAX

#define LLONG_MAX  __LONG_LONG_MAX__
#define LLONG_MIN  (-__LONG_LONG_MAX__-1LL)
#define ULLONG_MAX (__LONG_LONG_MAX__*2ULL+1ULL)
#endif

/* LONG_LONG_MIN/LONG_LONG_MAX/ULONG_LONG_MAX are a GNU extension.  It's too bad
   that we don't have something like #pragma poison that could be used to
   deprecate a macro - the code should just use LLONG_MAX and friends.
 */
#if defined(__GNU_LIBRARY__) ? defined(__USE_GNU) : !defined(__STRICT_ANSI__)

#undef   LONG_LONG_MIN
#undef   LONG_LONG_MAX
#undef   ULONG_LONG_MAX

#define LONG_LONG_MAX  __LONG_LONG_MAX__
#define LONG_LONG_MIN  (-__LONG_LONG_MAX__-1LL)
#define ULONG_LONG_MAX (__LONG_LONG_MAX__*2ULL+1ULL)
#endif

#endif /* __CLANG_LIMITS_H */

ID: 1745536 · Report as offensive     Reply Quote
Profile jason_gee
Volunteer developer
Volunteer tester
Avatar

Send message
Joined: 24 Nov 06
Posts: 7471
Credit: 91,022,419
RAC: 11,075
Australia
Message 1745540 - Posted: 29 Nov 2015, 6:02:36 UTC - in response to Message 1745536.  
Last modified: 29 Nov 2015, 6:05:56 UTC

You have to admire the similarties despite the timespan on the dates. Mind you I also doubt there'd be any particular 'expert' familiar enough with both the differences and the seti codebase, but pretty confident (now I have some beer :) ) we can cobble something together.
"Living by the wisdom of computer science doesn't sound so bad after all. And unlike most advice, it's backed up by proofs." -- Algorithms to live by: The computer science of human decisions.
ID: 1745540 · Report as offensive     Reply Quote
TBar
Volunteer tester

Send message
Joined: 22 May 99
Posts: 3788
Credit: 186,019,806
RAC: 236,509
United States
Message 1745549 - Posted: 29 Nov 2015, 6:53:27 UTC - in response to Message 1745540.  
Last modified: 29 Nov 2015, 7:09:24 UTC

Which do you think would be successful as you can use CUDA Toolkit 6.0 with Mountain Lion. These are the last errors I received in ML;
clang: error: linker command failed with exit code 1 (use -v to see invocation)
clang: error: no such file or directory: '/Users/Tom/sah_v7_opt/Xbranch/client/vector//asmlibe.a'
clang: error: no such file or directory: '/Users/Tom/sah_v7_opt/Xbranch/client/vector//asmlibm.a'
clang: error: no such file or directory: '/Users/Tom/sah_v7_opt/Xbranch/client/vector//asmlibo.lib'
/System/Library/Frameworks/Kernel.framework/Versions/A/Headers/sys/systm.h:108:10: fatal error: 'libkern/libkern.h' file not found
1 error generated.
/System/Library/Frameworks/Kernel.framework/Versions/A/Headers/sys/systm.h:108:10: fatal error: 'libkern/libkern.h' file not found
1 error generated.
conftest.cpp:145:13: error: use of undeclared identifier '_Bool'
1 error generated.
conftest.cpp:148:20: error: expected expression
1 error generated.
conftest.cpp:148:21: error: expected expression
1 error generated.
conftest.cpp:152:24: error: expected expression
1 error generated.
conftest.cpp:153:13: error: use of undeclared identifier '_int64'
1 error generated.
conftest.cpp:153:22: error: expected expression
1 error generated.
conftest.cpp:154:19: error: expected expression
1 error generated.
conftest.cpp:155:13: error: use of undeclared identifier '_int32'
1 error generated.
conftest.cpp:155:22: error: expected expression
1 error generated.
conftest.cpp:156:13: error: unknown type name 'hrtime_t'; did you mean 'time_t'?
1 error generated.
conftest.cpp:156:28: error: expected expression
1 error generated.
conftest.cpp:157:23: error: expected expression
1 error generated.
conftest.cpp:158:13: error: use of undeclared identifier '_uint64'
1 error generated.
conftest.cpp:158:24: error: expected expression
1 error generated.
conftest.cpp:159:22: error: expected expression
1 error generated.
conftest.cpp:160:13: error: unknown type name 'off64_t'; did you mean 'off_t'?
1 error generated.
conftest.c:160:20: error: expected expression
1 error generated.
clang: error: linker command failed with exit code 1 (use -v to see invocation)
| /* Override any GCC internal prototype to avoid an error.
clang: error: linker command failed with exit code 1 (use -v to see invocation)
| /* Override any GCC internal prototype to avoid an error.
clang: error: linker command failed with exit code 1 (use -v to see invocation)
| /* Override any GCC internal prototype to avoid an error.
clang: error: linker command failed with exit code 1 (use -v to see invocation)
| /* Override any GCC internal prototype to avoid an error.
clang: error: linker command failed with exit code 1 (use -v to see invocation)
| /* Override any GCC internal prototype to avoid an error.
clang: error: linker command failed with exit code 1 (use -v to see invocation)
| /* Override any GCC internal prototype to avoid an error.
clang: error: linker command failed with exit code 1 (use -v to see invocation)
| /* Override any GCC internal prototype to avoid an error.
clang: error: linker command failed with exit code 1 (use -v to see invocation)
| /* Override any GCC internal prototype to avoid an error.

There is a huge difference, I never have been able to compile an OpenCL App in Mavericks, they have all been compiled in ML.

Hmmm, it appears you can even use Toolkit 6.5 with Mountain Lion. I wonder if that would be high enough for Petri's 'Mods', the Mods don't seem to work very well in Toolkit 6.0.
ID: 1745549 · Report as offensive     Reply Quote
Profile jason_gee
Volunteer developer
Volunteer tester
Avatar

Send message
Joined: 24 Nov 06
Posts: 7471
Credit: 91,022,419
RAC: 11,075
Australia
Message 1745559 - Posted: 29 Nov 2015, 7:47:07 UTC - in response to Message 1745549.  

Well the asmlib stuff is the awesome work by agner fog, which has no application in a Cuda only application. It'll be important in heterogeneous stuff, but for now you can safely say that it's a red herring
"Living by the wisdom of computer science doesn't sound so bad after all. And unlike most advice, it's backed up by proofs." -- Algorithms to live by: The computer science of human decisions.
ID: 1745559 · Report as offensive     Reply Quote
Profile Gary CharpentierCrowdfunding Project Donor
Volunteer tester
Avatar

Send message
Joined: 25 Dec 00
Posts: 21095
Credit: 30,537,606
RAC: 21,351
United States
Message 1745668 - Posted: 29 Nov 2015, 19:51:13 UTC - in response to Message 1745540.  

You have to admire the similarties despite the timespan on the dates. Mind you I also doubt there'd be any particular 'expert' familiar enough with both the differences and the seti codebase, but pretty confident (now I have some beer :) ) we can cobble something together.

Well, they should be identical in effect as they are part of the language standard going back to K&R C. So seeing one of them undefined tends to mean something went horribly wrong. Perhaps the wrong language standards are being requested or are missing and I see a switch for a hosted vs. a cross platform compile in there as well.

As to _Bool, _int64, _int32 again these are reserved identifiers in the language standard. Something went wrong big time. Wrong language standard?

I'd suspect the make files first, or perhaps xcode default is overriding some compile time switch?
ID: 1745668 · Report as offensive     Reply Quote
Profile jason_gee
Volunteer developer
Volunteer tester
Avatar

Send message
Joined: 24 Nov 06
Posts: 7471
Credit: 91,022,419
RAC: 11,075
Australia
Message 1745671 - Posted: 29 Nov 2015, 19:59:41 UTC - in response to Message 1745668.  
Last modified: 29 Nov 2015, 20:00:10 UTC

I'd suspect the make files first, or perhaps xcode default is overriding some compile time switch?


A combination of both seems likely to me. Will likely get a good chance to play with it soon. Well pre ansi K&R definitely had some major semantic differences, and Apple and NV seem to have their own ideas, so at this point I'd still keep options leaning towards anything's possible.
"Living by the wisdom of computer science doesn't sound so bad after all. And unlike most advice, it's backed up by proofs." -- Algorithms to live by: The computer science of human decisions.
ID: 1745671 · Report as offensive     Reply Quote
TBar
Volunteer tester

Send message
Joined: 22 May 99
Posts: 3788
Credit: 186,019,806
RAC: 236,509
United States
Message 1745672 - Posted: 29 Nov 2015, 20:07:14 UTC - in response to Message 1745559.  
Last modified: 29 Nov 2015, 20:24:16 UTC

Well the asmlib stuff is the awesome work by agner fog, which has no application in a Cuda only application. It'll be important in heterogeneous stuff, but for now you can safely say that it's a red herring

It's possible that last Mountain Lion run was with Petri's Modded source, not sure but the list was from the config.log Not the compiler. I have switched over to ML, reinstalled the CUDA 6.0 Toolkit, and I noticed;
Operating System  Native x86_64  GCC    Clang
Mac OS X 10.9.x       YES              5.0, 4.2
Mac OS X 10.8.x       YES       4.2.1    5.0

So, the Toolkit Works with GCC in ML.
I also noticed that just as with Mavericks the Paths aren't sticking in ML,
everytime I open a New terminal window I have to enter;
export PATH=/Developer/NVIDIA/CUDA-6.0/bin:$PATH
export DYLD_LIBRARY_PATH=/Developer/NVIDIA/CUDA-6.0/lib:$DYLD_LIBRARY_PATH
or the compiler can't find nvcc. This is starting to be annoying.

So, I ran the stock files with Clang and the compiler says;
clang: error: no such file or directory: 'seti_cuda-analyzeFuncs.o'
clang: error: no such file or directory: 'cudaAcceleration.o'
clang: error: no such file or directory: 'cudaAcc_CalcChirpData.o'
clang: error: no such file or directory: 'cudaAcc_fft.o'
clang: error: no such file or directory: 'cudaAcc_gaussfit.o'
clang: error: no such file or directory: 'cudaAcc_PowerSpectrum.o'
clang: error: no such file or directory: 'cudaAcc_pulsefind.o'
clang: error: no such file or directory: 'cudaAcc_summax.o'
clang: error: no such file or directory: 'cudaAcc_transpose.o'
clang: error: no such file or directory: 'cudaAcc_utilities.o'
clang: error: no such file or directory: 'cudaAcc_autocorr.o'
make[2]: [seti_cuda] Error 1 (ignored)


I ran the stock files with GCC and the results were;
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking for style of include used by make... GNU
checking dependency style of g++... gcc3
checking how to run the C++ preprocessor... g++ -E
checking for x86_64-apple-darwin-gcc... /usr/bin/gcc
checking whether we are using the GNU C compiler... yes
checking whether /usr/bin/gcc accepts -g... yes
checking for /usr/bin/gcc option to accept ISO C89... none needed
checking whether /usr/bin/gcc understands -c and -o together... yes
checking dependency style of /usr/bin/gcc... gcc3
...
clang: error: no such file or directory: 'seti_cuda-analyzeFuncs.o'
clang: error: no such file or directory: 'cudaAcceleration.o'
clang: error: no such file or directory: 'cudaAcc_CalcChirpData.o'
clang: error: no such file or directory: 'cudaAcc_fft.o'
clang: error: no such file or directory: 'cudaAcc_gaussfit.o'
clang: error: no such file or directory: 'cudaAcc_PowerSpectrum.o'
clang: error: no such file or directory: 'cudaAcc_pulsefind.o'
clang: error: no such file or directory: 'cudaAcc_summax.o'
clang: error: no such file or directory: 'cudaAcc_transpose.o'
clang: error: no such file or directory: 'cudaAcc_utilities.o'
clang: error: no such file or directory: 'cudaAcc_autocorr.o'
make[2]: [seti_cuda] Error 1 (ignored)

Well at least the SSE2 & SSE3 Errors are gone.

I also noticed that with Clang I still get;
In file included from analyzeFuncs.cpp:73: ./cuda/cudaAcc_utilities.h:4:37: error: unknown type name 'cudaError_t'
extern int cudaAcc_SafeCall_No_Sync(cudaError_t err, char* errMessage, char* file, int line);
^
./cuda/cudaAcc_utilities.h:5:34: error: unknown type name 'cudaError_t'
extern int cudaAcc_SafeCall_Sync(cudaError_t err, char* errMessage, char* file, int line);
^
./cuda/cudaAcc_utilities.h:6:43: error: unknown type name 'cudaError_t'
extern int cudaAcc_SafeCall_No_Sync_wExit(cudaError_t err, char* errMessage, char* file, int line);
^
analyzeFuncs.cpp:101:9: warning: ----ooura---- [-W#pragma-messages]
#pragma
message ("----ooura----")

I also see the Same errors with GCC...
ID: 1745672 · Report as offensive     Reply Quote
Profile jason_gee
Volunteer developer
Volunteer tester
Avatar

Send message
Joined: 24 Nov 06
Posts: 7471
Credit: 91,022,419
RAC: 11,075
Australia
Message 1745713 - Posted: 29 Nov 2015, 23:51:06 UTC - in response to Message 1745672.  

I guess that places the switchover of the toolkit to clang only, to more recent than I thought. Yes GCC and clang should compile the same code. Since it does so on Linux it'll just be a breakage in the darwin/osx/apple specific configuration. Not too hard to track down after work.
"Living by the wisdom of computer science doesn't sound so bad after all. And unlike most advice, it's backed up by proofs." -- Algorithms to live by: The computer science of human decisions.
ID: 1745713 · Report as offensive     Reply Quote
1 · 2 · 3 · 4 . . . 49 · Next

Message boards : Number crunching : I've Built a Couple OSX CUDA Apps...


 
©2017 University of California
 
SETI@home and Astropulse are funded by grants from the National Science Foundation, NASA, and donations from SETI@home volunteers. AstroPulse is funded in part by the NSF through grant AST-0307956.