[jira] [Updated] (MXNET-115) USE_LAPACK is forced on all platforms with OpenBLAS and cmake

2018-03-20 Thread Anton Chernov (JIRA)

 [ 
https://issues.apache.org/jira/browse/MXNET-115?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Anton Chernov updated MXNET-115:

Description: 
When building with cmake, MXNET_USE_LAPACK is inappropriately forced on all 
platforms breaking the build if the library is not available.
{code:java}
tests/CMakeFiles/mxnet_unit_tests.dir/cpp/operator/krprod_test.cc.o: In 
function `mxnet_lapack_dposv':
/work/mxnet/src/operator/contrib/../c_lapack_api.h:260: undefined reference to 
`dposv_'
/work/mxnet/src/operator/contrib/../c_lapack_api.h:265: undefined reference to 
`dposv_'
libmxnet.a(la_op.cc.o): In function `MXNET_LAPACK_sgelqf':
/work/mxnet/src/operator/tensor/./.././c_lapack_api.h:285: undefined reference 
to `sgeqrf_'
libmxnet.a(la_op.cc.o): In function `MXNET_LAPACK_sorglq':
/work/mxnet/src/operator/tensor/./.././c_lapack_api.h:302: undefined reference 
to `sorgqr_'
libmxnet.a(la_op.cc.o): In function `MXNET_LAPACK_dgelqf':
/work/mxnet/src/operator/tensor/./.././c_lapack_api.h:286: undefined reference 
to `dgeqrf_'
libmxnet.a(la_op.cc.o): In function `MXNET_LAPACK_dorglq':
/work/mxnet/src/operator/tensor/./.././c_lapack_api.h:303: undefined reference 
to `dorgqr_'
libmxnet.a(la_op.cc.o): In function `MXNET_LAPACK_sgelqf':
/work/mxnet/src/operator/tensor/./.././c_lapack_api.h:285: undefined reference 
to `sgeqrf_'
libmxnet.a(la_op.cc.o): In function `MXNET_LAPACK_sorglq':
/work/mxnet/src/operator/tensor/./.././c_lapack_api.h:302: undefined reference 
to `sorgqr_'
libmxnet.a(la_op.cc.o): In function `MXNET_LAPACK_dpotri':
/work/mxnet/src/operator/tensor/./.././c_lapack_api.h:235: undefined reference 
to `dpotri_'
libmxnet.a(la_op.cc.o): In function `MXNET_LAPACK_spotri':
/work/mxnet/src/operator/tensor/./.././c_lapack_api.h:234: undefined reference 
to `spotri_'
libmxnet.a(la_op.cc.o): In function `MXNET_LAPACK_dpotrf':
/work/mxnet/src/operator/tensor/./.././c_lapack_api.h:233: undefined reference 
to `dpotrf_'
libmxnet.a(la_op.cc.o): In function `MXNET_LAPACK_spotrf':
/work/mxnet/src/operator/tensor/./.././c_lapack_api.h:232: undefined reference 
to `spotrf_'
libmxnet.a(la_op.cc.o): In function `MXNET_LAPACK_dsyevd':
/work/mxnet/src/operator/tensor/./.././c_lapack_api.h:323: undefined reference 
to `dsyevd_'
/work/mxnet/src/operator/tensor/./.././c_lapack_api.h:323: undefined reference 
to `dsyevd_'
/work/mxnet/src/operator/tensor/./.././c_lapack_api.h:323: undefined reference 
to `dsyevd_'
libmxnet.a(la_op.cc.o): In function `MXNET_LAPACK_ssyevd':
/work/mxnet/src/operator/tensor/./.././c_lapack_api.h:322: undefined reference 
to `ssyevd_'
/work/mxnet/src/operator/tensor/./.././c_lapack_api.h:322: undefined reference 
to `ssyevd_'
/work/mxnet/src/operator/tensor/./.././c_lapack_api.h:322: undefined reference 
to `ssyevd_'
libmxnet.a(la_op.cc.o): In function `MXNET_LAPACK_dgelqf':
/work/mxnet/src/operator/tensor/./.././c_lapack_api.h:286: undefined reference 
to `dgeqrf_'
libmxnet.a(la_op.cc.o): In function `MXNET_LAPACK_dorglq':
/work/mxnet/src/operator/tensor/./.././c_lapack_api.h:303: undefined reference 
to `dorgqr_'
collect2: error: ld returned 1 exit status
{code}
The corresponding cmake override is in root 
[CMakeLists.txt|https://github.com/apache/incubator-mxnet/blob/master/CMakeLists.txt#L350-L359]:
{code:java}
# ---[ LAPack
if(USE_LAPACK AND NOT MSVC)
  add_definitions(-DMXNET_USE_LAPACK=1)
  list(APPEND mxnet_LINKER_LIBS lapack)
else(USE_LAPACK)
  # Workaround for Windows until using new Jenkinsfile.
  if(BLAS STREQUAL "Open" OR BLAS STREQUAL "open" OR USE_BLAS STREQUAL "Open" 
OR USE_BLAS STREQUAL "open")
add_definitions(-DMXNET_USE_LAPACK=1)
  endif()
endif()
{code}
This effectively forces the {{MXNET_USE_LAPACK}} define on all platforms 
(USE_LAPACK=OFF, MSVC=ON / USE_LAPACK=OFF, MSVC=OFF) if the intent was actually 
switching it off.

Right now the problem is that some python tests depend on the lapack functions.
h2. Possible solution

An API function should be introduced to tell the language binding if lapack (or 
corresponding operators) is available and the tests should be skipped if not.

  was:
When building with cmake, MXNET_USE_LAPACK is inappropriately forced on all 
platforms breaking the build if the library is not available.
{code}
tests/CMakeFiles/mxnet_unit_tests.dir/cpp/operator/krprod_test.cc.o: In 
function `mxnet_lapack_dposv':
/work/mxnet/src/operator/contrib/../c_lapack_api.h:260: undefined reference to 
`dposv_'
/work/mxnet/src/operator/contrib/../c_lapack_api.h:265: undefined reference to 
`dposv_'
libmxnet.a(la_op.cc.o): In function `MXNET_LAPACK_sgelqf':
/work/mxnet/src/operator/tensor/./.././c_lapack_api.h:285: undefined reference 
to `sgeqrf_'
libmxnet.a(la_op.cc.o): In function `MXNET_LAPACK_sorglq':
/work/mxnet/src/operator/tensor/./.././c_lapack_api.h:302: undefined reference 
to `sorgqr_'
libmxnet.a(la_op.cc.o): In function `MXNET_LAPACK_dgelqf':
/work/mxnet/src/operator/tensor/./.././c_lapac

[jira] [Updated] (MXNET-115) USE_LAPACK is forced on all platforms with OpenBLAS and cmake

2018-03-20 Thread Anton Chernov (JIRA)

 [ 
https://issues.apache.org/jira/browse/MXNET-115?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Anton Chernov updated MXNET-115:

Description: 
When building with cmake, MXNET_USE_LAPACK is inappropriately forced on all 
platforms breaking the build if the library is not available.
{code}
tests/CMakeFiles/mxnet_unit_tests.dir/cpp/operator/krprod_test.cc.o: In 
function `mxnet_lapack_dposv':
/work/mxnet/src/operator/contrib/../c_lapack_api.h:260: undefined reference to 
`dposv_'
/work/mxnet/src/operator/contrib/../c_lapack_api.h:265: undefined reference to 
`dposv_'
libmxnet.a(la_op.cc.o): In function `MXNET_LAPACK_sgelqf':
/work/mxnet/src/operator/tensor/./.././c_lapack_api.h:285: undefined reference 
to `sgeqrf_'
libmxnet.a(la_op.cc.o): In function `MXNET_LAPACK_sorglq':
/work/mxnet/src/operator/tensor/./.././c_lapack_api.h:302: undefined reference 
to `sorgqr_'
libmxnet.a(la_op.cc.o): In function `MXNET_LAPACK_dgelqf':
/work/mxnet/src/operator/tensor/./.././c_lapack_api.h:286: undefined reference 
to `dgeqrf_'
libmxnet.a(la_op.cc.o): In function `MXNET_LAPACK_dorglq':
/work/mxnet/src/operator/tensor/./.././c_lapack_api.h:303: undefined reference 
to `dorgqr_'
libmxnet.a(la_op.cc.o): In function `MXNET_LAPACK_sgelqf':
/work/mxnet/src/operator/tensor/./.././c_lapack_api.h:285: undefined reference 
to `sgeqrf_'
libmxnet.a(la_op.cc.o): In function `MXNET_LAPACK_sorglq':
/work/mxnet/src/operator/tensor/./.././c_lapack_api.h:302: undefined reference 
to `sorgqr_'
libmxnet.a(la_op.cc.o): In function `MXNET_LAPACK_dpotri':
/work/mxnet/src/operator/tensor/./.././c_lapack_api.h:235: undefined reference 
to `dpotri_'
libmxnet.a(la_op.cc.o): In function `MXNET_LAPACK_spotri':
/work/mxnet/src/operator/tensor/./.././c_lapack_api.h:234: undefined reference 
to `spotri_'
libmxnet.a(la_op.cc.o): In function `MXNET_LAPACK_dpotrf':
/work/mxnet/src/operator/tensor/./.././c_lapack_api.h:233: undefined reference 
to `dpotrf_'
libmxnet.a(la_op.cc.o): In function `MXNET_LAPACK_spotrf':
/work/mxnet/src/operator/tensor/./.././c_lapack_api.h:232: undefined reference 
to `spotrf_'
libmxnet.a(la_op.cc.o): In function `MXNET_LAPACK_dsyevd':
/work/mxnet/src/operator/tensor/./.././c_lapack_api.h:323: undefined reference 
to `dsyevd_'
/work/mxnet/src/operator/tensor/./.././c_lapack_api.h:323: undefined reference 
to `dsyevd_'
/work/mxnet/src/operator/tensor/./.././c_lapack_api.h:323: undefined reference 
to `dsyevd_'
libmxnet.a(la_op.cc.o): In function `MXNET_LAPACK_ssyevd':
/work/mxnet/src/operator/tensor/./.././c_lapack_api.h:322: undefined reference 
to `ssyevd_'
/work/mxnet/src/operator/tensor/./.././c_lapack_api.h:322: undefined reference 
to `ssyevd_'
/work/mxnet/src/operator/tensor/./.././c_lapack_api.h:322: undefined reference 
to `ssyevd_'
libmxnet.a(la_op.cc.o): In function `MXNET_LAPACK_dgelqf':
/work/mxnet/src/operator/tensor/./.././c_lapack_api.h:286: undefined reference 
to `dgeqrf_'
libmxnet.a(la_op.cc.o): In function `MXNET_LAPACK_dorglq':
/work/mxnet/src/operator/tensor/./.././c_lapack_api.h:303: undefined reference 
to `dorgqr_'
collect2: error: ld returned 1 exit status
{code}
The corresponding cmake override is in root 
[CMakeLists.txt|https://github.com/apache/incubator-mxnet/blob/master/CMakeLists.txt#L350-L359]:
{code}
# ---[ LAPack
if(USE_LAPACK AND NOT MSVC)
  add_definitions(-DMXNET_USE_LAPACK=1)
  list(APPEND mxnet_LINKER_LIBS lapack)
else(USE_LAPACK)
  # Workaround for Windows until using new Jenkinsfile.
  if(BLAS STREQUAL "Open" OR BLAS STREQUAL "open" OR USE_BLAS STREQUAL "Open" 
OR USE_BLAS STREQUAL "open")
add_definitions(-DMXNET_USE_LAPACK=1)
  endif()
endif()
{code}

This effectively forces the {{MXNET_USE_LAPACK}} define on all platforms 
(USE_LAPACK=OFF, MSVC=ON / USE_LAPACK=OFF, MSVC=OFF) if the intent was actually 
switching it off.

Right now the problem is that some python tests depend on the lapack functions.

h3. Possible solution

An API function should be introduced to tell the language binding if lapack (or 
corresponding operators) is available and the tests should be skipped if not.

  was:
When building with cmake, MXNET_USE_LAPACK is inappropriately forced on all 
platforms breaking the build if the library is not available.
{code}
tests/CMakeFiles/mxnet_unit_tests.dir/cpp/operator/krprod_test.cc.o: In 
function `mxnet_lapack_dposv':
/work/mxnet/src/operator/contrib/../c_lapack_api.h:260: undefined reference to 
`dposv_'
/work/mxnet/src/operator/contrib/../c_lapack_api.h:265: undefined reference to 
`dposv_'
libmxnet.a(la_op.cc.o): In function `MXNET_LAPACK_sgelqf':
/work/mxnet/src/operator/tensor/./.././c_lapack_api.h:285: undefined reference 
to `sgeqrf_'
libmxnet.a(la_op.cc.o): In function `MXNET_LAPACK_sorglq':
/work/mxnet/src/operator/tensor/./.././c_lapack_api.h:302: undefined reference 
to `sorgqr_'
libmxnet.a(la_op.cc.o): In function `MXNET_LAPACK_dgelqf':
/work/mxnet/src/operator/tensor/./.././c_lapack_api.h:

[jira] [Updated] (MXNET-115) USE_LAPACK is forced on all platforms with OpenBLAS and cmake

2018-03-20 Thread Anton Chernov (JIRA)

 [ 
https://issues.apache.org/jira/browse/MXNET-115?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Anton Chernov updated MXNET-115:

Description: 
When building with cmake, MXNET_USE_LAPACK is inappropriately forced on all 
platforms breaking the build if the library is not available.
{code}
tests/CMakeFiles/mxnet_unit_tests.dir/cpp/operator/krprod_test.cc.o: In 
function `mxnet_lapack_dposv':
/work/mxnet/src/operator/contrib/../c_lapack_api.h:260: undefined reference to 
`dposv_'
/work/mxnet/src/operator/contrib/../c_lapack_api.h:265: undefined reference to 
`dposv_'
libmxnet.a(la_op.cc.o): In function `MXNET_LAPACK_sgelqf':
/work/mxnet/src/operator/tensor/./.././c_lapack_api.h:285: undefined reference 
to `sgeqrf_'
libmxnet.a(la_op.cc.o): In function `MXNET_LAPACK_sorglq':
/work/mxnet/src/operator/tensor/./.././c_lapack_api.h:302: undefined reference 
to `sorgqr_'
libmxnet.a(la_op.cc.o): In function `MXNET_LAPACK_dgelqf':
/work/mxnet/src/operator/tensor/./.././c_lapack_api.h:286: undefined reference 
to `dgeqrf_'
libmxnet.a(la_op.cc.o): In function `MXNET_LAPACK_dorglq':
/work/mxnet/src/operator/tensor/./.././c_lapack_api.h:303: undefined reference 
to `dorgqr_'
libmxnet.a(la_op.cc.o): In function `MXNET_LAPACK_sgelqf':
/work/mxnet/src/operator/tensor/./.././c_lapack_api.h:285: undefined reference 
to `sgeqrf_'
libmxnet.a(la_op.cc.o): In function `MXNET_LAPACK_sorglq':
/work/mxnet/src/operator/tensor/./.././c_lapack_api.h:302: undefined reference 
to `sorgqr_'
libmxnet.a(la_op.cc.o): In function `MXNET_LAPACK_dpotri':
/work/mxnet/src/operator/tensor/./.././c_lapack_api.h:235: undefined reference 
to `dpotri_'
libmxnet.a(la_op.cc.o): In function `MXNET_LAPACK_spotri':
/work/mxnet/src/operator/tensor/./.././c_lapack_api.h:234: undefined reference 
to `spotri_'
libmxnet.a(la_op.cc.o): In function `MXNET_LAPACK_dpotrf':
/work/mxnet/src/operator/tensor/./.././c_lapack_api.h:233: undefined reference 
to `dpotrf_'
libmxnet.a(la_op.cc.o): In function `MXNET_LAPACK_spotrf':
/work/mxnet/src/operator/tensor/./.././c_lapack_api.h:232: undefined reference 
to `spotrf_'
libmxnet.a(la_op.cc.o): In function `MXNET_LAPACK_dsyevd':
/work/mxnet/src/operator/tensor/./.././c_lapack_api.h:323: undefined reference 
to `dsyevd_'
/work/mxnet/src/operator/tensor/./.././c_lapack_api.h:323: undefined reference 
to `dsyevd_'
/work/mxnet/src/operator/tensor/./.././c_lapack_api.h:323: undefined reference 
to `dsyevd_'
libmxnet.a(la_op.cc.o): In function `MXNET_LAPACK_ssyevd':
/work/mxnet/src/operator/tensor/./.././c_lapack_api.h:322: undefined reference 
to `ssyevd_'
/work/mxnet/src/operator/tensor/./.././c_lapack_api.h:322: undefined reference 
to `ssyevd_'
/work/mxnet/src/operator/tensor/./.././c_lapack_api.h:322: undefined reference 
to `ssyevd_'
libmxnet.a(la_op.cc.o): In function `MXNET_LAPACK_dgelqf':
/work/mxnet/src/operator/tensor/./.././c_lapack_api.h:286: undefined reference 
to `dgeqrf_'
libmxnet.a(la_op.cc.o): In function `MXNET_LAPACK_dorglq':
/work/mxnet/src/operator/tensor/./.././c_lapack_api.h:303: undefined reference 
to `dorgqr_'
collect2: error: ld returned 1 exit status
{code}
The corresponding cmake override is in root 
[CMakeLists.txt|https://github.com/apache/incubator-mxnet/blob/master/CMakeLists.txt#L350-L359]:
{code}
# ---[ LAPack
if(USE_LAPACK AND NOT MSVC)
  add_definitions(-DMXNET_USE_LAPACK=1)
  list(APPEND mxnet_LINKER_LIBS lapack)
else(USE_LAPACK)
  # Workaround for Windows until using new Jenkinsfile.
  if(BLAS STREQUAL "Open" OR BLAS STREQUAL "open" OR USE_BLAS STREQUAL "Open" 
OR USE_BLAS STREQUAL "open")
add_definitions(-DMXNET_USE_LAPACK=1)
  endif()
endif()
{code}

This effectively forces the {{MXNET_USE_LAPACK}} define on all platforms 
(USE_LAPACK=OFF, MSVC=ON / USE_LAPACK=OFF, MSVC=OFF) if the intent was actually 
switching it off.

Right now the problem is that some python tests depend on the lapack functions.

Possible solution

An API function should be introduced to tell the language binding if lapack (or 
corresponding operators) is available and the tests should be skipped if not.

  was:
When building with cmake, MXNET_USE_LAPACK is inappropriately forced on all 
platforms breaking the build if the library is not available.

 
{code:java}
tests/CMakeFiles/mxnet_unit_tests.dir/cpp/operator/krprod_test.cc.o: In 
function `mxnet_lapack_dposv':
/work/mxnet/src/operator/contrib/../c_lapack_api.h:260: undefined reference to 
`dposv_'
/work/mxnet/src/operator/contrib/../c_lapack_api.h:265: undefined reference to 
`dposv_'
libmxnet.a(la_op.cc.o): In function `MXNET_LAPACK_sgelqf':
/work/mxnet/src/operator/tensor/./.././c_lapack_api.h:285: undefined reference 
to `sgeqrf_'
libmxnet.a(la_op.cc.o): In function `MXNET_LAPACK_sorglq':
/work/mxnet/src/operator/tensor/./.././c_lapack_api.h:302: undefined reference 
to `sorgqr_'
libmxnet.a(la_op.cc.o): In function `MXNET_LAPACK_dgelqf':
/work/mxnet/src/operator/tensor/./.././c_lapack_ap