-
Notifications
You must be signed in to change notification settings - Fork 5.7k
remove gfortran and dlopen lapack libs #1958
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
DynamicLoad.h/cpp
是不是改成DynamicLoader.h/cpp
比较好- 使用了动态装载的方式,应该是不需要
PADDLE_USE_LAPACK
这个宏了吧 cblas.cmake
里面对lapack库的check是不是也应该去掉openblas.cmake
里面最后的一步ExternalProject_Add_Step
应该去掉
paddle/math/MathFunctions.cpp
Outdated
#else | ||
return LAPACKE_sgetrf(order, M, N, A, lda, ipiv); | ||
return dynload::LAPACKE_sgetrf(order, M, N, A, lda, ipiv); | ||
#endif | ||
#else | ||
LOG(FATAL) << "Not implemented"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
是不是可以写个宏,简化一下这里的调用逻辑?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
paddle/utils/DynamicLoad.cpp
Outdated
|
||
void GetLapackDsoHandle(void** dso_handle) { | ||
#if defined(__APPLE__) || defined(__OSX__) | ||
GetDsoHandleFromSearchPath(FLAGS_warpctc_dir, "liblapack.dylib", dso_handle); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo:FLAGS_warpctc_dir -> FLAGS_lapack_dir
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
paddle/math/MathFunctions.cpp
Outdated
@@ -87,9 +132,9 @@ int getrf<float>(const CBLAS_ORDER order, | |||
int* ipiv) { | |||
#ifdef PADDLE_USE_LAPACK |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PADDLE_USE_LAPACK
这个是否可以去掉了?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
done
done
done
这个可以保留,ExternalProject_Add_Step只是copy了几个lapacke头文件, 这个lapacke.h在编译的时候,是需要的。 |
如果使用了动态装载的方式, 不需要。 |
@lzhao4ever 确实不需要了 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
This only fixes the issue for ATLAS MKL is still another fix.
Fix dynamic loading of Lapack caused by #1958
* add christmas application * fix element source
由于大多数情况下,用不到lapack的三个接口,然后编译lapack又需要使用gfortran,因此这里我们dlopen lapack动态库,如果运行时找不到库,再
apt-get install liblapacke-dev
安装就行了,不需要编译引入复杂的gfrotran编译器以及库。