mersenneforum.org  

Go Back   mersenneforum.org > Extra Stuff > Programming

Reply
 
Thread Tools
Old 2014-12-22, 06:22   #1
Prime95
P90 years forever!
 
Prime95's Avatar
 
Aug 2002
Yeehaw, FL

72·151 Posts
Default CUDA linking on Mac

I've downloaded, compiled, and installed the "quad double" package qd-2.3.15 using clang++ on my Mac. I've written a C++ program using the QD package and all is well.

Now I want to convert some of my C++ program to use CUDA.

I can compile, link, and run a simple CUDA program that prints out the device capabilities.

When I try to link in any of my C++ code that uses the QD library the linker starts complaining loudly, starting with:
Code:
  "std::__1::locale::use_facet(std::__1::locale::id&) const", referenced from:
      qd_real::error(char const*) in libqd.a(qd_real.o)
      operator<<(std::__1::basic_ostream<char, std::__1::char_traits<char> >&, qd_real const&) in libqd.a(qd_real.o)
Three hours of google and trying various ideas and I'm still stuck.

Are there any CUDA developers willing to give me some help -- preferably owning a Mac?
Prime95 is offline   Reply With Quote
Old 2014-12-22, 06:38   #2
ewmayer
2ω=0
 
ewmayer's Avatar
 
Sep 2002
Rep├║blica de California

2D6816 Posts
Default

Quote:
Originally Posted by Prime95 View Post
I've downloaded, compiled, and installed the "quad double" package qd-2.3.15 using clang++ on my Mac. I've written a C++ program using the QD package and all is well.

Now I want to convert some of my C++ program to use CUDA.

I can compile, link, and run a simple CUDA program that prints out the device capabilities.

When I try to link in any of my C++ code that uses the QD library the linker starts complaining loudly
Was the code you're trying to link to successfully recompiled using nvcc? I don't think you can link clang or gcc-compiled code with nvcc-compiled code. (But I will defer to the CUDA experts, if they say different.)
ewmayer is offline   Reply With Quote
Old 2014-12-22, 14:41   #3
Prime95
P90 years forever!
 
Prime95's Avatar
 
Aug 2002
Yeehaw, FL

72·151 Posts
Default

Quote:
Originally Posted by ewmayer View Post
Was the code you're trying to link to successfully recompiled using nvcc?
No. The QD library is now a stand-alone library sitting in /usr/local/lib.

I'm going to try developing on Linux today.
Prime95 is offline   Reply With Quote
Old 2014-12-22, 17:20   #4
Prime95
P90 years forever!
 
Prime95's Avatar
 
Aug 2002
Yeehaw, FL

739910 Posts
Default

The linux build worked. Development on a remote machine is a pain, so it would be nice to figure out how to get Mac development on track. I'm pretty sure the problem is nvcc is insisting on using gcc rather than clang. There are options that tell nvcc what compiler to use, but these options either don't work or I'm not understanding the whole nvcc build environment.

At least I can now proceed with my program development.

Last fiddled with by Prime95 on 2014-12-22 at 17:20
Prime95 is offline   Reply With Quote
Old 2014-12-22, 22:01   #5
ewmayer
2ω=0
 
ewmayer's Avatar
 
Sep 2002
Rep├║blica de California

23·1,453 Posts
Default

Quote:
Originally Posted by Prime95 View Post
The linux build worked. Development on a remote machine is a pain, so it would be nice to figure out how to get Mac development on track. I'm pretty sure the problem is nvcc is insisting on using gcc rather than clang. There are options that tell nvcc what compiler to use, but these options either don't work or I'm not understanding the whole nvcc build environment.
Yeah, clang is great (fast compiles, better error/warnings) when it works, but I still keep a working copy of GCC on my Mac for a reason.

Quote:
At least I can now proceed with my program development.
Just out of curiosity, what problem are you intending to employ your massively parallel quad-float stuff on?
ewmayer is offline   Reply With Quote
Old 2014-12-22, 22:30   #6
Prime95
P90 years forever!
 
Prime95's Avatar
 
Aug 2002
Yeehaw, FL

1CE716 Posts
Default

I'll PM you the details
Prime95 is offline   Reply With Quote
Reply

Thread Tools


Similar Threads
Thread Thread Starter Forum Replies Last Post
Best CUDA GPU for the $$ Christenson GPU Computing 24 2011-05-01 00:06
Msieve: problem linking with other C library srawlins Msieve 6 2010-04-02 02:05
Linkhelpers, Link error while linking a shared lib linkhelpers Linux 1 2009-09-17 03:49
BUG: upgrade/linking lost my reservations sylvester PrimeNet 0 2008-10-28 05:21
Linking error JHansen Linux 1 2005-03-17 14:29

All times are UTC. The time now is 11:25.

Sat Apr 10 11:25:31 UTC 2021 up 2 days, 6:06, 1 user, load averages: 2.06, 1.70, 1.49

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.

This forum has received and complied with 0 (zero) government requests for information.

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation.
A copy of the license is included in the FAQ.