编译成功
This commit is contained in:
parent
4076f6803a
commit
bcafb30f35
@ -1,9 +1,10 @@
|
|||||||
cmake_minimum_required(VERSION 3.15.2)
|
cmake_minimum_required(VERSION 3.15.2)
|
||||||
# 设置cxx编译器
|
# 设置cxx编译器
|
||||||
# 如果你使用别的编译器,请在这里修改
|
# 如果你使用别的编译器,请在这里修改
|
||||||
|
set(CMAKE_C_COMPILER /usr/local/bin/gcc-9)
|
||||||
set(CMAKE_CXX_COMPILER /usr/local/bin/g++-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)
|
set(CMAKE_INSTALL_PREFIX /usr/local)
|
||||||
# 添加编译选项
|
# 添加编译选项
|
||||||
|
3
src/lib/config.h
Normal file
3
src/lib/config.h
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
#define HAVE_CONFIG_H
|
||||||
|
/* #undef _MSC_VER */
|
||||||
|
/* #undef USE_SSE */
|
@ -70,7 +70,7 @@ licence.
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
|
|
||||||
#include <lbfgs.h>
|
#include "lbfgs.h"
|
||||||
|
|
||||||
#ifdef _MSC_VER
|
#ifdef _MSC_VER
|
||||||
#define inline __inline
|
#define inline __inline
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <lbfgs.h>
|
#include "../lib/lbfgs.h"
|
||||||
|
|
||||||
static lbfgsfloatval_t evaluate(
|
static lbfgsfloatval_t evaluate(
|
||||||
void *instance,
|
void *instance,
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <lbfgs.h>
|
#include "../lib/lbfgs.h"
|
||||||
|
|
||||||
class objective_function
|
class objective_function
|
||||||
{
|
{
|
||||||
@ -119,7 +119,7 @@ protected:
|
|||||||
|
|
||||||
#define N 100
|
#define N 100
|
||||||
|
|
||||||
int main(int argc, char *argv)
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
objective_function obj;
|
objective_function obj;
|
||||||
return obj.run(N);
|
return obj.run(N);
|
||||||
|
Loading…
Reference in New Issue
Block a user