File tree Expand file tree Collapse file tree 3 files changed +26
-1
lines changed Expand file tree Collapse file tree 3 files changed +26
-1
lines changed Original file line number Diff line number Diff line change @@ -1623,6 +1623,7 @@ if(NOT INTERN_BUILD_MOBILE)
1623
1623
find_package (LAPACK )
1624
1624
if (LAPACK_FOUND )
1625
1625
set (USE_LAPACK 1 )
1626
+ list (APPEND Caffe2_PRIVATE_DEPENDENCY_LIBS ${LAPACK_LIBRARIES} )
1626
1627
endif ()
1627
1628
1628
1629
if (NOT USE_CUDA )
Original file line number Diff line number Diff line change @@ -153,7 +153,7 @@ if((NOT BLAS_LIBRARIES)
153
153
BLAS
154
154
sgemm
155
155
""
156
- "openblas;pthread" )
156
+ "openblas;pthread;m " )
157
157
if (BLAS_LIBRARIES )
158
158
set (BLAS_INFO "open" )
159
159
endif (BLAS_LIBRARIES )
Original file line number Diff line number Diff line change @@ -123,6 +123,30 @@ if(BLAS_FOUND)
123
123
IF ((NOT LAPACK_INFO ) AND (BLAS_INFO STREQUAL "open" ))
124
124
SET (CMAKE_REQUIRED_LIBRARIES ${BLAS_LIBRARIES} )
125
125
check_function_exists ("cheev_" OPEN_LAPACK_WORKS )
126
+ if (OPEN_LAPACK_WORKS )
127
+ check_function_exists ("cgesdd_" LAPACK_CGESDD_WORKS )
128
+ if (NOT LAPACK_CGESDD_WORKS )
129
+ find_library (GFORTRAN_LIBRARY
130
+ NAMES libgfortran.a gfortran
131
+ PATHS /usr/lib/gcc/aarch64-linux-gnu/9/
132
+ /usr/lib/gcc/x86_64-redhat-linux/9/
133
+ /usr/lib/gcc/aarch64-linux-gnu/8/
134
+ /usr/lib/gcc/x86_64-redhat-linux/8/
135
+ /usr/lib/gcc/aarch64-linux-gnu/7/
136
+ /usr/lib/gcc/x86_64-redhat-linux/7/
137
+ )
138
+ list (APPEND CMAKE_REQUIRED_LIBRARIES "${GFORTRAN_LIBRARY} " )
139
+ unset (LAPACK_CGESDD_WORKS CACHE )
140
+ check_function_exists ("cgesdd_" LAPACK_CGESDD_WORKS )
141
+ if (LAPACK_CGESDD_WORKS )
142
+ list (APPEND LAPACK_LIBRARIES "${GFORTRAN_LIBRARY} " )
143
+ else ()
144
+ message (WARNING "OpenBlas has been compiled with Lapack support, but cgesdd can not be used" )
145
+ set (OPEN_LAPACK_WORKS NO )
146
+ endif ()
147
+ endif ()
148
+ endif ()
149
+
126
150
set (CMAKE_REQUIRED_LIBRARIES )
127
151
if (OPEN_LAPACK_WORKS )
128
152
SET (LAPACK_INFO "open" )
You can’t perform that action at this time.
0 commit comments