Cuda Clang and OS X Mavericks

后端 未结 6 1149
遇见更好的自我
遇见更好的自我 2020-11-29 09:37

I\'m currently trying to build a Cuda project with Cmake on MacOS 10.9. My C and C++ compiler are gcc, but it seems that since Mavericks gcc and g++ links to clang, which is

6条回答
  •  情书的邮戳
    2020-11-29 10:18

    Here's a Homebrew recipe that works for me on Lion.

    $ brew cat memtestG80
    require "formula"
    
    # Documentation: https://github.com/Homebrew/homebrew/wiki/Formula-Cookbook
    #                /usr/local/Library/Contributions/example-formula.rb
    # PLEASE REMOVE ALL GENERATED COMMENTS BEFORE SUBMITTING YOUR PULL REQUEST!
    
    # Requires at compile time nvcc from https://developer.nvidia.com/cuda-downloads
    
    # Requires popt at compile time
    
    class Memtestg80 < Formula
      homepage ""
      url "https://github.com/ihaque/memtestG80/archive/master.zip"
      sha1 ""
      version "c4336a69fff07945c322d6c7fc40b0b12341cc4c"
    
      # depends_on "cmake" => :build
      depends_on :x11 # if your formula requires any X11/XQuartz components
    
      def install
        # ENV.deparallelize  # if your formula fails when building in parallel
    
        system "make", "-f", "Makefiles/Makefile.osx", "NVCC=/usr/local/cuda/bin/nvcc -ccbin /usr/bin/clang", "POPT_DIR=/usr/local/Cellar/popt/1.16/lib"
        system "cp", "-a", "memtestG80", "/usr/local/bin"
      end
    
      test do
        # `test do` will create, run in and delete a temporary directory.
        #
        # This test will fail and we won't accept that! It's enough to just replace
        # "false" with the main program this formula installs, but it'd be nice if you
        # were more thorough. Run the test with `brew test memtestG80`.
        #
        # The installed folder is not in the path, so use the entire path to any
        # executables being tested: `system "#{bin}/program", "do", "something"`.
        system "false"
      end
    end
    

提交回复
热议问题