AMD下载
- 下载地址
选择837.zip下载即可,将837.zib考入相应的文件夹下,并解压缩
wget http://netlib.org/toms/837.zip
unzip 837.zip
cd 837
make lib
make fortran
make clean
AMD使用
将amd中的头文件,库文件,以及要测试的例子的源码考到自己要测试的相应目录下面:
cp ../../software/amd/837/Include/amd.h ./include/
cp ../../software/amd/837/Lib/libamd.* lib/
cp ../../software/amd/837/Demo/amd_simple.c src/
cmake文件如下:
cmake_minimum_required (VERSION 2.6)
project (TEST)
set (TEST_VERSION 0.1)
set(CMAKE_BUILD_TYPE "Debug")
set(CMAKE_CXX_FLAGS_DEBUG "$ENV{CXXFLAGS} -O0 -Wall -g -ggdb -DDEBUG")
set(CMAKE_CXX_FLAGS_RELEASE "$ENV{CXXFLAGS} -O3 -Wall")
set(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/../bin)
aux_source_directory(${PROJECT_SOURCE_DIR}/src DIR_SRC)
include_directories(${PROJECT_SOURCE_DIR}/src)
include_directories(${PROJECT_SOURCE_DIR}/include)
link_directories(${PROJECT_SOURCE_DIR}/lib)
add_executable(main ${DIR_SRC})
target_link_libraries(main libamd.a)
target_link_libraries(main -lm)
最后进入build文件,执行
cmake ..
make
在bin文件下面便生成执行文件main了。