Hi Clint,
In my case, it wasn't anything like that. I was only specifying
/usr/local/cuda/lib once. More specifically, my CMakeLists.txt specified
TARGET_LINK_LIBRARIES(${SHARED_TARGET} ${CUDA_LIBRARIES})
where CUDA_LIBRARIES is
/usr/local/cuda/lib/libcudart.dylib-Wl,-rpath-Wl,/usr/local/cuda/lib
This library also linked against another of my libraries, that also happened to
link against CUDA. So that's why it was getting referenced twice: once
directly, and once indirectly via a second library.
In any case, it's not clear to me why CMake is calling "install_name_tool
-delete_rpath". Everything works fine without doing that. And when you do it,
that breaks things.
Peter
On Oct 14, 2014, at 11:06 AM, Clinton Stimpson <[email protected]> wrote:
> Here's a simple way to reproduce from the command line:
>
> echo "void foo() {}" > lib.c
> gcc -dynamiclib -o libtest.dylib -Wl,-rpath,/usr/lib -Wl,-rpath,/usr/lib lib.c
> install_name_tool -delete_rpath /usr/lib libtest.dylib
> otool -L libtest.dylib
> # gives me the error: "load command 13 size zero (can't advance to other
> load commands)"
>
> At install time, CMake will call "install_name_tool -delete_rpath ... " as
> needed.
>
> I can't get into Apple's bug tracker. I don't know why. When I try to log
> in, it comes back with a generic error and it asks me to email them with
> details about the error.
>
> When I do the same on Linux, the GNU linker will consolidate the duplicate
> paths.
>
> Thanks!
>
> Clint
--
Powered by www.kitware.com
Please keep messages on-topic and check the CMake FAQ at:
http://www.cmake.org/Wiki/CMake_FAQ
Kitware offers various services to support the CMake community. For more
information on each offering, please visit:
CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html
Visit other Kitware open-source projects at
http://www.kitware.com/opensource/opensource.html
Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake