Closed beijinggao closed 6 years ago
@gao8954 你装openmp了吗?我没遇到这个错误。是不是你的gcc有问题?
直接用g++命令编译可正常编译通过,也是奇怪了
@bububa 你好在使用最新的xgboost的时候 发现其中 rabit 的头文件 c_api.h 稍微改变了一种写法 如下:
/! \brief rabit unsigned long type / typedef unsigned long rbt_ulong; // NOLINT(*)
/*!
在您库中的rabit c_api.h 如下:
extern "C" {
/! \brief rabit unsigned long type / typedef unsigned long rbt_ulong; // NOLINT(*)
/*!
仔细对比了一下其实没有啥本质区别 。但在使用你这个版本的头文件时就可以顺利运行,使用他的那个就会报 xgboost/include/rabit/c_api.h:35:11: error: expected '=', ',', ';', 'asm' or 'attribute' before 'void' RABIT_DLL void RabitInit(int argc, char *argv[]); ^ xgboost/include/rabit/c_api.h:41:11: error: expected '=', ',', ';', 'asm' or 'attribute' before 'void' RABIT_DLL void RabitFinalize(); ^ xgboost/include/rabit/c_api.h:44:11: error: expected '=', ',', ';', 'asm' or 'attribute' before 'int' RABIT_DLL int RabitGetRank(); ^ xgboost/include/rabit/c_api.h:47:11: error: expected '=', ',', ';', 'asm' or 'attribute' before 'int' RABIT_DLL int RabitGetWorldSize();
这样的错误,但是我发现最新版本的xgboost 的c_api.h的头文件实现方式和最新版的rabit c_api.h的风格是一样的 使用的时候 就没有这样的问题,您有啥建议吗?是什么原因导致的?
@gao8954 我也遇到了同样问题 -fopenmp 请问是如何解决的
@xuuj go 的版本问题 有些 CFLAGS 没被加进去 ,试了几个版本 有的可以
你好,请问一下在执行的时候 openmp 报非法:invalid flag in #cgo LDFLAGS: -fopenmp 您在使用的时候没遇到吗?如何解决呢