EAVL icon indicating copy to clipboard operation
EAVL copied to clipboard

OSX 10.7+ Cuda lib64

Open robertmaynard opened this issue 13 years ago • 4 comments

Just tried to build eavl on mountain lion with cuda support enabled and couldn't because it tries to find /usr/local/cuda/lib64. With version 10.7 of OSX cuda doesn't have a lib64 folder since it only provides 64bit libraries which are in lib.

robertmaynard avatar Sep 17 '12 18:09 robertmaynard

The test in configure.ac should attempt to try linking against lib/ first, and only failover to lib64/ if lib/ doesn't work. I'm wondering if there's something else going wrong. Does anything in config.log indicate any detail of the failure?

jsmeredith avatar Sep 17 '12 19:09 jsmeredith

configure.log lists:

configure:3901: result: no

configure:3952: checking for TR1 headers from the compiler

configure:3966: g++ -c -g -O2 conftest.cpp >&5

configure:3966: $? = 0

configure:3970: result: yes

configure:4019: checking for nvcc

configure:4038: found /usr/local/cuda/bin/nvcc

configure:4050: result: /usr/local/cuda/bin/nvcc

configure:4118: checking if nvcc works

configure:4122: result: yes

configure:4154: checking if CUDA include and linker paths work with lib/

configure:4168: g++ -o conftest -g -O2 -I/usr/local/cuda/include -L/usr/local/cuda/lib conftest.cpp -lcuda -lcudart >&5

ld: library not found for -lcuda

and when I do locate on libcuda I get:

~/W/V/build> locate libcuda /Library/Frameworks/CUDA.framework/Versions/A/Libraries/libcuda_256.00.35.dylib /Library/Frameworks/CUDA.framework/Versions/A/Libraries/libcuda_256.01.00.dylib /Library/Frameworks/CUDA.framework/Versions/A/Libraries/libcuda_256.02.25.dylib /Library/Frameworks/CUDA.framework/Versions/A/Libraries/libcuda_270.00.00.dylib /Library/Frameworks/CUDA.framework/Versions/A/Libraries/libcuda_270.05.00.dylib /Library/Frameworks/CUDA.framework/Versions/A/Libraries/libcuda_270.05.05.dylib /Library/Frameworks/CUDA.framework/Versions/A/Libraries/libcuda_270.05.10.dylib /Library/Frameworks/CUDA.framework/Versions/A/Libraries/libcuda_270.05.20.dylib /Library/Frameworks/CUDA.framework/Versions/A/Libraries/libcuda_270.05.25.dylib /Library/Frameworks/CUDA.framework/Versions/A/Libraries/libcuda_295.10.05.dylib /Library/Frameworks/CUDA.framework/Versions/A/Libraries/libcuda_295.10.10.dylib /Library/Frameworks/CUDA.framework/Versions/A/Libraries/libcuda_295.10.15.dylib /Library/Frameworks/CUDA.framework/Versions/A/Libraries/libcuda_295.10.20.dylib /Library/Frameworks/CUDA.framework/Versions/A/Libraries/libcuda_295.30.00.dylib /Library/Frameworks/CUDA.framework/Versions/A/Libraries/libcuda_304.00.00.dylib /usr/local/cuda/lib/libcudart.dylib

On Mon, Sep 17, 2012 at 3:51 PM, Jeremy Meredith [email protected]:

The test in configure.ac should attempt to try linking against lib/ first, and only failover to lib64/ if lib/ doesn't work. I'm wondering if there's something else going wrong. Does anything in config.log indicate any detail of the failure?

— Reply to this email directly or view it on GitHubhttps://github.com/jsmeredith/EAVL/issues/3#issuecomment-8628424.

Robert Maynard

robertmaynard avatar Sep 17 '12 20:09 robertmaynard

So when compiling Dax the linking to cuda is done by the -framework call:

"/Applications/CMake 2.8-9.app/Contents/bin/cmake" -E cmake_link_script CMakeFiles/daxexample2_cuda.dir/link.txt --verbose=1 /usr/local/bin/g++-4.7 -fopenmp -g -Wl,-search_paths_first -Wl,-headerpad_max_install_names CMakeFiles/daxexample2_cuda.dir/./daxexample2_cuda_generated_example2.cu.o -o daxexample2_cuda /usr/local/cuda/lib/libcudart.dylib -Wl,-rpath -Wl,/usr/local/cuda/lib -framework cuda

robertmaynard avatar Sep 20 '12 15:09 robertmaynard

The EAVL source has been patched to allow the user to pass CUDA_LIBS. For example, run: ./configure CUDA_LIBS="-framework cuda -lcudart".

Note, you may encounter errors at the end of the build implying mixed processor types, as if 64-bit and 32-bit code were combined. Apparently nvcc disagrees with gcc about the proper default. On a 64-bit system, we worked around this by specifying NVCXXFLAGS=m64 to get nvcc to match the other parts of the compilation toolchain. (Add this to the end of your configure line like we did with CUDA_LIBS above.)

I'm leaving this open so that we can change the source to detect these two conditions automatically.

jsmeredith avatar Sep 21 '12 14:09 jsmeredith