<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
Hi!<br>
<br>
I just find the solution. The problem was in order how libraries
were specified.<br>
target_link_libraries(${lib_name} <br>
general rt<br>
general dl<br>
general pthread<br>
debug ${do_scoring_debug}<br>
optimized ${do_scoring}<br>
general ${spinx}<br>
general ${cblas}<br>
general ${atlas}<br>
)<br>
<br>
<br>
23.04.2012 16:28, Andreas Pakulat написал:
<blockquote
cite="mid:CAExHGmTrdAD75fzom6q+7udgMLGZ76iA7UHTCajNxWtyb-xQyA@mail.gmail.com"
type="cite">
<div class="gmail_extra">Hi,<br>
<br>
<div class="gmail_quote">On Mon, Apr 23, 2012 at 13:24,
Vyacheslav Karamov <span dir="ltr"><<a
moz-do-not-send="true" href="mailto:ubuntulist@yandex.ru"
target="_blank">ubuntulist@yandex.ru</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">Hi All!<br>
<br>
I have a problem with target_link_libraries. It can't link
with shared libraries not from directory listed in
LD_LIBRARY_PATH.<br>
1. When I try to link shared library with the full path
obtained from find_library, my library is passed to gcc
without -l option as ordinary object file.<br>
</blockquote>
<div><br>
</div>
<div>What is the problem with linking the absolute path of the
shared library? This should just work </div>
<div> </div>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">
2. When I try to link by specifying short name "cblas" I've
got the error message:<br>
<br>
Linking CXX shared library ../../sndcompare/amd64sse3/libsndcompared.so<br>
/usr/bin/ld: cannot find -lcblas<br>
collect2: ld returned 1 exit status<br>
make[2]: *** [../../sndcompare/amd64sse3/libsndcompared.so]
Error 1<br>
make[1]: *** [CMakeFiles/sndcompare.dir/all] Error 2<br>
make: *** [all] Error 2<br>
*** Failed ***<br>
</blockquote>
<div><br>
</div>
<div>This is because the linker does not know the directory
where to search for the library.</div>
<div> </div>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">
add_library(${lib_name} SHARED<br>
${io_files}<br>
${utils_files}<br>
${tech_independ_files}<br>
${other_files}<br>
)<br>
<br>
find_library(atlas<br>
NAME atlas<br>
PATHS ${CMAKE_CURRENT_SOURCE_DIR}/${CMAKE_SYSTEM_NAME}/atlas/${arch}/lib<br>
DOC "Atlas library"<br>
)<br>
<br>
find_library(cblas<br>
NAME cblas<br>
PATHS ${CMAKE_CURRENT_SOURCE_DIR}/${CMAKE_SYSTEM_NAME}/atlas/${arch}/lib<br>
DOC "Cblas library"<br>
)<br>
<br>
link_directories(<br>
${CMAKE_CURRENT_SOURCE_DIR}/${CMAKE_SYSTEM_NAME}/atlas/${arch}/lib<br>
${CMAKE_CURRENT_SOURCE_DIR}/../../Sphinx/sphinxbase/${CMAKE_SYSTEM_NAME}/${arch}/lib<br>
)<br>
</blockquote>
<div><br>
</div>
<div>link_directories is not needed at all here or should not
be needed. Just make sure to pass ${cblas} and ${atlas} to</div>
<div>target_link_libraries. If that produces errors please
provide the exact error message.</div>
<div><br>
</div>
<div>Andreas</div>
</div>
</div>
</blockquote>
<br>
</body>
</html>