NIST-MNI / patch_morphology

ITK patch morphology tools: denoising, segmentation, grading
GNU General Public License v3.0
3 stars 0 forks source link

(in minc-toolkit-v2 superbuild) If external OpenBlas is used, CMAKE include and LIB are not defined #4

Open gdevenyi opened 6 years ago

gdevenyi commented 6 years ago

Was running into this:

[ 13%] Linking CXX executable itk_patch_grading
CMakeFiles/itk_patch_grading.dir/3rd_party/nnls/nnls.c.o: In function `nnls':
nnls.c:(.text+0x44a): undefined reference to `cblas_dgemv'
nnls.c:(.text+0x473): undefined reference to `cblas_daxpy'
nnls.c:(.text+0x4ca): undefined reference to `cblas_dgemv'
nnls.c:(.text+0x4f3): undefined reference to `cblas_daxpy'
nnls.c:(.text+0x534): undefined reference to `cblas_dgemv'
nnls.c:(.text+0xc68): undefined reference to `LAPACKE_dgels'
nnls.c:(.text+0xf89): undefined reference to `cblas_daxpy'
CMakeFiles/itk_patch_grading.dir/3rd_party/nnls/nnls.c.o: In function `nnls_updates':
nnls.c:(.text+0x1c95): undefined reference to `cblas_dgemv'
nnls.c:(.text+0x1cc1): undefined reference to `cblas_daxpy'
nnls.c:(.text+0x1d1b): undefined reference to `cblas_dgemv'
nnls.c:(.text+0x1d47): undefined reference to `cblas_daxpy'
nnls.c:(.text+0x1d8b): undefined reference to `cblas_dgemv'
nnls.c:(.text+0x22a7): undefined reference to `cblas_ddot'
nnls.c:(.text+0x22ca): undefined reference to `cblas_daxpy'
nnls.c:(.text+0x22e5): undefined reference to `cblas_ddot'
nnls.c:(.text+0x2338): undefined reference to `cblas_dnrm2'
nnls.c:(.text+0x2379): undefined reference to `cblas_dscal'
nnls.c:(.text+0x23c2): undefined reference to `cblas_ddot'
nnls.c:(.text+0x2973): undefined reference to `cblas_daxpy'
nnls.c:(.text+0x2d37): undefined reference to `cblas_drot'
nnls.c:(.text+0x2d73): undefined reference to `cblas_drot'
nnls.c:(.text+0x2da8): undefined reference to `cblas_drot'
CMakeFiles/itk_patch_grading.dir/3rd_party/nnls/nnls.c.o: In function `nnls_updates_single':
nnls.c:(.text+0x36f5): undefined reference to `cblas_dgemv'
nnls.c:(.text+0x3721): undefined reference to `cblas_daxpy'
nnls.c:(.text+0x377b): undefined reference to `cblas_dgemv'
nnls.c:(.text+0x37a7): undefined reference to `cblas_daxpy'
nnls.c:(.text+0x37eb): undefined reference to `cblas_dgemv'
nnls.c:(.text+0x3d07): undefined reference to `cblas_ddot'
nnls.c:(.text+0x3d2a): undefined reference to `cblas_daxpy'
nnls.c:(.text+0x3d45): undefined reference to `cblas_ddot'
nnls.c:(.text+0x3d98): undefined reference to `cblas_dnrm2'
nnls.c:(.text+0x3dd9): undefined reference to `cblas_dscal'
nnls.c:(.text+0x3e22): undefined reference to `cblas_ddot'
nnls.c:(.text+0x43d3): undefined reference to `cblas_daxpy'
nnls.c:(.text+0x4797): undefined reference to `cblas_drot'
nnls.c:(.text+0x47d3): undefined reference to `cblas_drot'
nnls.c:(.text+0x4808): undefined reference to `cblas_drot'
CMakeFiles/itk_patch_grading.dir/3rd_party/nnls/nnls.c.o: In function `nnls2_updates_single':
nnls.c:(.text+0x5272): undefined reference to `cblas_dgemv'
nnls.c:(.text+0x529e): undefined reference to `cblas_daxpy'
nnls.c:(.text+0x52f8): undefined reference to `cblas_dgemv'
nnls.c:(.text+0x5324): undefined reference to `cblas_daxpy'
nnls.c:(.text+0x5368): undefined reference to `cblas_dgemv'
nnls.c:(.text+0x5884): undefined reference to `cblas_ddot'
nnls.c:(.text+0x58a7): undefined reference to `cblas_daxpy'
nnls.c:(.text+0x58c2): undefined reference to `cblas_ddot'
nnls.c:(.text+0x5915): undefined reference to `cblas_dnrm2'
nnls.c:(.text+0x5956): undefined reference to `cblas_dscal'
nnls.c:(.text+0x599f): undefined reference to `cblas_ddot'
nnls.c:(.text+0x5f53): undefined reference to `cblas_daxpy'
nnls.c:(.text+0x6315): undefined reference to `cblas_drot'
nnls.c:(.text+0x6351): undefined reference to `cblas_drot'
nnls.c:(.text+0x6386): undefined reference to `cblas_drot'
make[5]: *** [src/itk_patch_grading] Error 1
make[4]: *** [src/CMakeFiles/itk_patch_grading.dir/all] Error 2
make[3]: *** [all] Error 2
make[2]: *** [patch_morphology-prefix/src/patch_morphology-stamp/patch_morphology-build] Error 2
make[1]: *** [CMakeFiles/patch_morphology.dir/all] Error 2
make: *** [all] Error 2

Running ccmake ../../minc-toolkit-v2/patch_morphology/ I found that CMake had found the OpenBlas config, however it had not populated the LIB or Include entries.

I populated those entries and re-generated the build and the rest completed.

I'm guessing that maybe a find_package is missing which populates these from the Cmake config file if the superbuild doesn't build openblas.

Not clear yet if this is minc-toolkit-v2 or patch_morphology