<p>I am trying to build a simple program that uses mlpack As a test case, I've copied the <em>perceptron_testcpp</em> from mlpack trunk into a source folder and am now attempting to link against mlpack to get it to run</p>
<p>I'm using mlpack from trunk (<a href="https://github.com/mlpack/mlpack/commit/3b926fd86ab143eb8af7327b9fb89fead7538df0" class="commit-link"><tt>3b926fd</tt></a>) and armadillo from ubuntu 1404 (http://packagesubuntucom/trusty/libarmadillo-dev) I am running boost 155</p>
<p>I have the following directory structure in my source tree:</p>
<pre><code>/
CMakeListstxt
cmake/
FindLibXml2cmake
Findmlpackcmake
test/
CMakeListstxt
maincpp
perceptron_testcpp
</code></pre>
<p>The contents of the parent CMakeListstxt file is:</p>
<pre><code>cmake_minimum_required(VERSION 30)
add_definitions(-std=c++14 -Wpedantic -Wall -Werror)
add_definitions(-DBOOST_LOG_DYN_LINK)
set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake" ${CMAKE_MODULE_PATH})
find_package(Boost 1550)
find_package(mlpack)
find_package(LibXml2)
enable_testing()
include_directories(
${PROJECT_SOURCE_DIR}
${LIBXML2_INCLUDE_DIRS}
)
add_subdirectory(test)
</code></pre>
<p>The context of the CMakeListstxt file in /test is:</p>
<pre><code>cmake_minimum_required(VERSION 30)
add_executable(masterTest
maincpp
perceptron_testcpp
)
target_link_libraries(masterTest
mlpack
${BOOST_unit_test_framework_LIBRARY}
)
add_test(masterTest masterTest)
</code></pre>
<p>when I build with g++ version 510 I get the following:</p>
<pre><code>usr@usr-desktop:~/Documents/neurobuild$ ninja
[1/1] Linking CXX executable test/masterTest
FAILED: : && /usr/bin/g++ test/CMakeFiles/masterTestdir/maincppo test/CMakeFiles/masterTestdir/perceptron_testcppo -o test/masterTest -rdynamic -lmlpack && :
/usr/bin/ld: test/CMakeFiles/masterTestdir/perceptron_testcppo: undefined reference to symbol 'wrapper_dgemm_'
//usr/lib/libarmadilloso4: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
ninja: build stopped: subcommand failed
</code></pre>
<p>Interestingly, when I build the tests (including the <em>perceptron_testcpp</em>) that ships with mlpack directly, these tests link fine</p>
<p>I don't have any other versions of armadillo installed on my machine</p>
<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br>Reply to this email directly or <a href="https://github.com/mlpack/mlpack/issues/494">view it on GitHub</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/AJ4bFJvGjaw5zExia5PzMiQUD55yzR1Gks5pPBN4gaJpZM4G0HE2.gif" width="1" /></p>
<div itemscope itemtype="http://schema.org/EmailMessage">
<div itemprop="action" itemscope itemtype="http://schema.org/ViewAction">
<link itemprop="url" href="https://github.com/mlpack/mlpack/issues/494"></link>
<meta itemprop="name" content="View Issue"></meta>
</div>
<meta itemprop="description" content="View this Issue on GitHub"></meta>
</div>