GMAC 0.0.10 compilation on MACOSX

13 views
Skip to first unread message

giangiammy

unread,
Jul 16, 2010, 7:58:15 AM7/16/10
to ADSM Users
Dear all,

I'm trying to use GMAC (found out at PUMPS2010 school)) in a PowerBook
PRO, running MacOSX 10.6.4
(the one with the NVIDIA GeForce 9400M graphic card which supports
CUDA)

nvcc is:

~/Desktop/Dropbox/data-rem1/src/gmac/gmac-0.0.10 $ nvcc --version
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2009 NVIDIA Corporation
Built on Tue_Oct_27_10:04:47_PDT_2009
Cuda compilation tools, release 3.0, V0.2.1221


gcc is:
gcc-4.0 --versioni686-apple-darwin10-gcc-4.0.1 (GCC) 4.0.1 (Apple Inc.
build 5493)
Copyright (C) 2005 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There
is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE.

$ glibtool --versionltmain.sh (GNU libtool) 2.2.6
Written by Gordon Matzigkeit <go...@gnu.ai.mit.edu>, 1996

Copyright (C) 2008 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There
is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE.
~/Desktop/Dropbox/data-rem1/src/gmac/gmac-0.0.10 $


I issued the command:
$ CC=gcc-4.0 CXX=g++-4.0 ./configure --disable-mmap

but at the make I got the followin result:

...
ompat.cpp: In function ‘cudaError_t __getCUDAError(CUresult)’:
compat.cpp:125: error: ‘cudaErrorECCUncorrectable’ was not declared in
this scope
cc1plus: warnings being treated as errors
compat.cpp:96: warning: enumeration value
‘CUDA_ERROR_UNSUPPORTED_LIMIT’ not handled in switch
compat.cpp:96: warning: enumeration value
‘CUDA_ERROR_SHARED_OBJECT_SYMBOL_NOT_FOUND’ not handled in switch
compat.cpp:96: warning: enumeration value
‘CUDA_ERROR_SHARED_OBJECT_INIT_FAILED’ not handled in switch
make[4]: *** [compat.lo] Error 1
make[3]: *** [all-recursive] Error 1
make[2]: *** [all-recursive] Error 1
make[1]: *** [all] Error 2
make: *** [all-recursive] Error 1
~/Desktop/Dropbox/data-rem1/src/gmac/gmac-0.0.10 $


(If other information are useful, let me know, and I'll post them)

Any idea how to fix the cudaErrorECCUncorrectable error?


thanks
giammy

Gianluca Moro

unread,
Jul 16, 2010, 9:51:38 AM7/16/10
to adsm-...@googlegroups.com
hi again,

and thanks for the quick reply!

I have been looking around a bit, and report my tests, hoping
they will be useful to someone else too!

CUDA 3.0 do not have the definition of cudaErrorECCUncorrectable
in file cuda/include/driver_types.h

as workaround I modified gmac-0.0.10/src/api/cuda/compat.cpp:
to put all the undefined codes in the catch all cudaErrorUnknown

#if CUDART_VERSION >= 3000
        case CUDA_ERROR_ECC_UNCORRECTABLE:
          // GMY(commented out this)                                            
          // return cudaErrorECCUncorrectable;

          //GMY added these (to avoid warnings)                                                     
          case CUDA_ERROR_UNSUPPORTED_LIMIT:                                  
          case CUDA_ERROR_SHARED_OBJECT_SYMBOL_NOT_FOUND:                     
          case CUDA_ERROR_SHARED_OBJECT_INIT_FAILED:                          
          //GMY end added these                                                 

        case CUDA_ERROR_POINTER_IS_64BIT:
        case CUDA_ERROR_SIZE_IS_64BIT:
        case CUDA_ERROR_NOT_MAPPED_AS_ARRAY:
        case CUDA_ERROR_NOT_MAPPED_AS_POINTER:
#endif

with this patch the code gmac-0.0.10 correctly compiles on CUDA 3.0 for MAC.

Then I installed CUDA 3.1 for MAC, and as a matter of fact the 
driver_types.h file includes all the needed definitions,
so on CUDA 3.1, gmac-0.0.10 compiles correctly out of the box!

thank you
giammy

On Fri, Jul 16, 2010 at 3:34 PM, Isaac Gelado <ige...@gmail.com> wrote:
Hi,
 it seems like CUDA 3.0 in MacOS X has different error codes than the
Linux version. Could you try installing CUDA 3.1, which is already
available from the NVIDIA CUDA web site.

 I will try to reproduce the problem on our systems and provide you a
patch, but this will take me some time.

 Cheers,
 Isaac
--
Isaac Gelado

 'As gold which he cannot spend will make no man rich
    so knowledge which he cannot apply will make no man wise'



--
Gianluca Moro                                               http://www.cloudusb.net
http://www.math.unipd.it/~giammy/
Department of Pure and Applied Mathematics - University of Padova
CityGroup: "New Nuclear – The Economics Say No" –  https://www.citigroupgeo.com/pdf/SEU27102.pdf

Gianluca Moro

unread,
Jul 17, 2010, 5:35:28 AM7/17/10
to adsm-...@googlegroups.com
Hi all,

always working on MacOSX 10.6.4, CUDA 3.1, GMAC 0.0.10

I'm testing the tests in gmac-0.0.10/tests with
$ CC=gcc-4.0 CXX=g++-4.0 ./configure --disable-mmap --enable-tests

verything compiles corrctly, but when I run gmacVecAdd I get:

gmac-0.0.10/tests $ ./gmacVecAdd 
dyld: Symbol not found: _allocator
  Referenced from: /usr/local/lib/libgmac.0.dylib
  Expected in: flat namespace
 in /usr/local/lib/libgmac.0.dylib
Trace/BPT trap


Thinking about some problems with shared libaries, I tested:
$ CC=gcc-4.0 CXX=g++-4.0 ./configure --disable-mmap --enable-tests --disable-shared
but in this configuration I got a compilation error (the same symbol
which was not found, now it's not defined)

libtool: link: g++-4.0 -m32 -Wall -Wno-unused-variable -Werror -g -O3 -fomit-frame-pointer -o gmacVecAdd gmacVecAdd.o utils.o -Wl,-bind_at_load  ../src/gmac/.libs/libgmac.a -L/usr/local/cuda/bin/../lib -L/usr/local/cuda/bin/../lib32 -ldl -lm -lcuda
Undefined symbols:
  "_allocator", referenced from:
      _allocator$non_lazy_ptr in libgmac.a(gmac.o)
     (maybe you meant: _allocator$non_lazy_ptr)
  "gmac::memoryFini()", referenced from:
      gmac::Process::~Process()in libgmac.a(Process.o)
      gmac::Process::~Process()in libgmac.a(Process.o)
  "gmac::memoryInit(char const*, char const*)", referenced from:
      gmac::Process::init(char const*, char const*)in libgmac.a(Process.o)
  "_manager", referenced from:
      _manager$non_lazy_ptr in libgmac.a(gmac.o)
      _manager$non_lazy_ptr in libgmac.a(Process.o)
      _manager$non_lazy_ptr in libgmac.a(io.o)
      _manager$non_lazy_ptr in libgmac.a(lt1-io.o)
      _manager$non_lazy_ptr in libgmac.a(lt3-Context.o)
     (maybe you meant: _manager$non_lazy_ptr)
ld: symbol(s) not found
collect2: ld returned 1 exit status
make[1]: *** [gmacVecAdd] Error 1
make: *** [all-recursive] Error 1



do I miss something?

thanks
Giammy

Isaac Gelado

unread,
Jul 17, 2010, 5:41:51 AM7/17/10
to adsm-...@googlegroups.com
Hi,
this is a well-know problem of glibtool for MacOS X. You need
glibtool 2.2.10 installed,
otherwise the configuration scripts will use the incorrect linker flags.

Have you tried following the instructions from
http://code.google.com/p/adsm/wiki/MacOs ?

Best,
Isaac

Gianluca Moro

unread,
Jul 19, 2010, 8:11:58 AM7/19/10
to adsm-...@googlegroups.com
hi,

On Sat, Jul 17, 2010 at 11:41 AM, Isaac Gelado <ige...@gmail.com> wrote:
Hi,

 this is a well-know problem of glibtool for MacOS X. You need
glibtool 2.2.10 installed,
otherwise the configuration scripts will use the incorrect linker flags.

Have you tried following the instructions from
http://code.google.com/p/adsm/wiki/MacOs ?


i updated to glibtool 2.2.10 using macports, and followed the instruction up to:

$ CC=gcc-4.0 CXX=g++-4.0 ./configure --disable-mmap

it all compiles correctly.

But if I run

$ CC=gcc-4.0 CXX=g++-4.0 ./configure --disable-mmap --enable-tests

to compile the tests, it correctly compiles, but when running the test I get:

$ tests/gmacVecAdd 
dyld: Symbol not found: _allocator
  Referenced from: /Users/giammy/src/gmac/gmac-0.0.10/src/gmac/.libs/libgmac.0.dylib
  Expected in: flat namespace
 in /Users/giammy/src/gmac/gmac-0.0.10/src/gmac/.libs/libgmac.0.dylib
Trace/BPT trap

(same as before :-(

thanks
giammy

P.S: (the gmacVecAdd test runs correctly on an Intel with Linux/Ubuntu)

Isaac Gelado

unread,
Jul 19, 2010, 5:35:46 PM7/19/10
to adsm-...@googlegroups.com
Hi,
did you execute the setup.sh script before compiling?

Cheers,
Isaac

Gianluca Moro

unread,
Jul 20, 2010, 9:36:44 AM7/20/10
to adsm-...@googlegroups.com
Hi,

On Mon, Jul 19, 2010 at 11:35 PM, Isaac Gelado <ige...@gmail.com> wrote:
Hi,

 did you execute the setup.sh script before compiling?


The conclusion is that now I have gmac and the tests running on Mac!

Some details about my tests, if they can be of interest:

I started working on gmac-0.0.10.tar.gz from http://code.google.com/p/adsm/downloads/list
where I do not see any setup.sh :-(
Perhaps it could be useful put it in the distribution.

After that I downloaded the mercury snapshot
(hg clone https://adsm.googlecode.com/hg/ adsm)
but I've not understand if it's the last version: for example
in adsm/libgmac/src/api/cudadrv/driver.cpp,
the function
cudaError_t cudaConfigureCall(dim3 gridDim, dim3 blockDim,                                                 
              size_t sharedMem, int tokens)                                                                

gives error, while in gmac-0.0.10.tar.gz the same function is defined as

cudaError_t cudaConfigureCall(dim3 gridDim, dim3 blockDim,
                              size_t sharedMem, cudaStream_t tokens)

and gives no error.

Anyway, i get the setup.sh form the repository run on the source
from gmac-0.0.10.tar.gz and compiled with

$ CC=gcc-4.0 CXX=g++-4.0 ./configure --disable-mmap --enable-tests

(removed from tests Makefile the compilation for
hybridComputation$(EXEEXT) and gmacHybridComputation$(EXEEXT))

and

$ make

By the way: applying the patch described in http://code.google.com/p/adsm/wiki/MacOs
to config.guess (force "i386" instead of "x86_64)                                                            
compiles all but the tests fail at runtime)           

Well, thanks for the support: now I will start to use and test a bit more GMAC!

Gianluca

Isaac Gelado

unread,
Jul 21, 2010, 2:41:40 AM7/21/10
to adsm-...@googlegroups.com
Hi,
thanks for the information and the fixes! I was not aware that the
mercurial repository was so outdated! We will try to push the latest
version we have.

Actually, I think the problem is related to the litool version
(2.2.6b) we used to generate the tar.gz file. I will try to generate a
0.0.10-1 version using a updated libtool so it should solve all these
issues.

Isaac

--

Reply all
Reply to author
Forward
0 new messages