Bootstrap

IPX下载安装

IPX下载安装

该软件需要事先安装LAPACKopenblas,相关安装教程请点击链接。

1.下载

mkdir IPX
cd IPX
git clone https://github.com/ERGO-Code/basiclu.git
cd basiclu
make
git clone https://github.com/ERGO-Code/ipx.git
cd ipx

2.添加相关链接文件的地址

此时直接安装或者按他的要求添加静态库文件会报错,因此需要自己配置一下,在ipx文件夹下建立solver文件

mkdir solver
cd solver
mkdir src
mkdir lib
mkdir include
mkdir build
cp ../ipx/src/* ./src/
cp ../ipx/include/* ./include/
cp ../basiclu/include/basiclu* ./include/
cp ../basiclu/lib/libbasiclu.a ./lib/
cp ~/software/openblas/OpenBLAS/libopenblas.a ./lib/
cp ~/software/lapack/lapack-3.8.0/*.a ./lib/

3.自己在solver目录下写CMakeLists.txt文件

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 libbasiclu.a )
target_link_libraries(main liblapack.a -lgfortran)
target_link_libraries(main librefblas.a -lgfortran)
target_link_libraries(main libtmglib.a -lgfortran)

target_link_libraries(main libopenblas.a -lgfortran)

转载于:https://www.cnblogs.com/qujingtongxiao/p/11167144.html

;