From bcafb30f35802d3a31bda39ddbf17d00228b9593 Mon Sep 17 00:00:00 2001 From: Yi Zhang Date: Mon, 21 Oct 2019 22:40:08 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BC=96=E8=AF=91=E6=88=90=E5=8A=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CMakeLists.txt | 3 ++- src/lib/config.h | 3 +++ src/lib/lbfgs.c | 2 +- src/sample/sample.c | 2 +- src/sample/sample2.cpp | 4 ++-- 5 files changed, 9 insertions(+), 5 deletions(-) create mode 100644 src/lib/config.h diff --git a/CMakeLists.txt b/CMakeLists.txt index 65989f9..a02e5bf 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,9 +1,10 @@ cmake_minimum_required(VERSION 3.15.2) # 设置cxx编译器 # 如果你使用别的编译器,请在这里修改 +set(CMAKE_C_COMPILER /usr/local/bin/gcc-9) set(CMAKE_CXX_COMPILER /usr/local/bin/g++-9) # 设置工程名称和语言 -project(LIBLBFGS VERSION 1.0.0 LANGUAGES CXX) +project(LIBLBFGS VERSION 1.0.0) # 设置安装地址 set(CMAKE_INSTALL_PREFIX /usr/local) # 添加编译选项 diff --git a/src/lib/config.h b/src/lib/config.h new file mode 100644 index 0000000..68b9098 --- /dev/null +++ b/src/lib/config.h @@ -0,0 +1,3 @@ +#define HAVE_CONFIG_H +/* #undef _MSC_VER */ +/* #undef USE_SSE */ diff --git a/src/lib/lbfgs.c b/src/lib/lbfgs.c index e3075b7..88bd457 100644 --- a/src/lib/lbfgs.c +++ b/src/lib/lbfgs.c @@ -70,7 +70,7 @@ licence. #include #include -#include +#include "lbfgs.h" #ifdef _MSC_VER #define inline __inline diff --git a/src/sample/sample.c b/src/sample/sample.c index 90e36cd..129505f 100644 --- a/src/sample/sample.c +++ b/src/sample/sample.c @@ -1,5 +1,5 @@ #include -#include +#include "../lib/lbfgs.h" static lbfgsfloatval_t evaluate( void *instance, diff --git a/src/sample/sample2.cpp b/src/sample/sample2.cpp index ad7be97..07fc4f8 100644 --- a/src/sample/sample2.cpp +++ b/src/sample/sample2.cpp @@ -1,5 +1,5 @@ #include -#include +#include "../lib/lbfgs.h" class objective_function { @@ -119,7 +119,7 @@ protected: #define N 100 -int main(int argc, char *argv) +int main(int argc, char *argv[]) { objective_function obj; return obj.run(N);