我正在开发一个小型神经网络,主要是作为一个训练示例(我想在使用mlpack之前自己做)
所以我尝试安装acml来加速我的gpu的一些矩阵操作。我无法让它工作,所以我尝试禁用它,现在我在编译时遇到了这个警告
/usr/bin/ld: warning: libacml_mp.so, needed by /usr/lib64/libarmadillo.so, not found (try using -rpath or -rpath-link)
当然,在运行时我收到以下错误:
/home/sapphie/Documents/CLionProjects/FirstNNTest/cmake-build-debug/FirstNNTest: error while loading shared libraries: libacml_mp.so: cannot open shared object file: No such file or directory
我尝试过设置LD_LIBRARY_PATH和LIBRARY_PATH变量,我尝试过修改rpath和rpath链接,什么都没有,我一直在解决这些问题。
现在,如果我尝试通过cmake链接ACML,我会得到另一个更有趣的问题。
/usr/bin/ld: warning: libacml_mp.so, needed by /usr/lib64/libarmadillo.so, not found (try using -rpath or -rpath-link)
/usr/bin/ld: warning: libgfortran.so.3, needed by /opt/acml5.3.1/gfortran64/lib/libacml.so, not found (try using -rpath or -rpath-link)
/opt/acml5.3.1/gfortran64/lib/libacml.so: undefined reference to '_gfortran_internal_unpack@GFORTRAN_1.0'
/opt/acml5.3.1/gfortran64/lib/libacml.so: undefined reference to '_gfortran_transfer_integer_write@GFORTRAN_1.4'
/opt/acml5.3.1/gfortran64/lib/libacml.so: undefined reference to '_gfortran_concat_string@GFORTRAN_1.0'
/opt/acml5.3.1/gfortran64/lib/libacml.so: undefined reference to '_gfortran_stop_string@GFORTRAN_1.0'
/opt/acml5.3.1/gfortran64/lib/libacml.so: undefined reference to '_gfortran_transfer_character_write@GFORTRAN_1.4'
/opt/acml5.3.1/gfortran64/lib/libacml.so: undefined reference to '_gfortran_st_write_done@GFORTRAN_1.0'
/opt/acml5.3.1/gfortran64/lib/libacml.so: undefined reference to '_gfortran_st_read@GFORTRAN_1.0'
/opt/acml5.3.1/gfortran64/lib/libacml.so: undefined reference to '_gfortran_string_index@GFORTRAN_1.0'
/opt/acml5.3.1/gfortran64/lib/libacml.so: undefined reference to '_gfortran_transfer_integer@GFORTRAN_1.0'
/opt/acml5.3.1/gfortran64/lib/libacml.so: undefined reference to '_gfortran_compare_string@GFORTRAN_1.0'
/opt/acml5.3.1/gfortran64/lib/libacml.so: undefined reference to '_gfortran_transfer_real_write@GFORTRAN_1.4'
/opt/acml5.3.1/gfortran64/lib/libacml.so: undefined reference to '_gfortran_internal_pack@GFORTRAN_1.0'
/opt/acml5.3.1/gfortran64/lib/libacml.so: undefined reference to '_gfortran_pow_i4_i4@GFORTRAN_1.0'
/opt/acml5.3.1/gfortran64/lib/libacml.so: undefined reference to '_gfortran_st_read_done@GFORTRAN_1.0'
/opt/acml5.3.1/gfortran64/lib/libacml.so: undefined reference to '_gfortran_st_write@GFORTRAN_1.0'
collect2: error: ld returned 1 exit status
make[2]: *** [CMakeFiles/FirstNNTest.dir/build.make:123: FirstNNTest] Error 1
make[1]: *** [CMakeFiles/Makefile2:68: CMakeFiles/FirstNNTest.dir/all] Error 2
make: *** [Makefile:84: all] Error 2
使用以下cmakelist:
cmake_minimum_required(VERSION 3.7)
project(FirstNNTest)
set(CMAKE_CXX_STANDARD 11)
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake")
find_package(Armadillo REQUIRED)
find_package(ACML REQUIRED)
include_directories(${ARMADILLO_INCLUDE_DIRS})
include_directories(${ACML_INCLUDE_DIRS})
set(SOURCE_FILES main.cpp Network.cpp Network.h Tools.h)
add_executable(FirstNNTest ${SOURCE_FILES})
target_link_libraries(FirstNNTest ${ARMADILLO_LIBRARIES} ${ACML_LIBRARIES})
我已经在这个问题上花了好几个小时,而这只是重新安装我的整个操作系统。