bart icon indicating copy to clipboard operation
bart copied to clipboard

Compile fail on CentOS

Open Timsey opened this issue 5 years ago • 3 comments

I am trying to compile BART 0.5.00 on a CentOS cluster. I cloned the master branch from git, and encountered the following error:

gcc -Wall -Wextra -MMD -MF /var/scratch/tbbakker/bart/src/num/.lapack.d -iquote /var/scratch/tbbakker/bart/src/ -I/usr//include/ -I/usr//include -DFFTWTHREADS -DMAIN_LIST="avg, bench, bitmask, cabs, caldir, calmat, carg, casorati, cc, ccapply, cdf97, circshift, conj, conv, copy, cpyphs, creal, crop, delta, ecalib, ecaltwo, estdelay, estdims, estshift, estvar, extract, fakeksp, fft, fftmod, fftrot, fftshift, filter, flatten, flip, fmac, homodyne, index, invert, itsense, join, looklocker, lrmatrix, mandelbrot, mip, moba, nlinv, noise, normalize, nrmse, nufft, ones, pattern, phantom, pics, pocsense, poisson, poly, repmat, reshape, resize, rmfreq, rof, rss, sake, saxpy, scale, sdot, show, slice, spow, sqpics, squeeze, ssa, std, svd, tgv, threshold, toimg, traj, transpose, twixread, var, vec, version, walsh, wave, wavelet, wavepsf, whiten, window, wshfl, zeros, zexp, ()" -include src/main.h -O3 -ffast-math -Wmissing-prototypes -std=gnu11 -fopenmp -c -o /var/scratch/tbbakker/bart/src/num/lapack.o /var/scratch/tbbakker/bart/src/num/lapack.c /var/scratch/tbbakker/bart/src/num/lapack.c:14:21: fatal error: lapacke.h: No such file or directory #include <lapacke.h> ^ compilation terminated. make[1]: *** [/var/scratch/tbbakker/bart/src/num/lapack.o] Error 1

I don't have root access on this system, so could not follow the instructions detailed in the README for installation on CentOS: sudo yum install devtoolset-8 atlas-devel fftw3-devel libpng-devel lapack-devel

Instead, given the error, I tried building lapack (version 3.9.0) from source. Unfortunately, the error remains.

I tried inspecting the Makefile for a hint, and found the following lines:

ifeq ($(BUILDTYPE), Linux) ifneq (,$(findstring Red Hat,$(shell gcc --version))) CPPFLAGS+=-I/usr/include/lapacke/ LDFLAGS+=-L/usr/lib64/atlas -laterals endif endif

I suspect this tells the compiler where to look for the missing lapacke.h? As a side-note, this line was missing from the Makefile in bart-0.5.00.tar I obtained from the BART webpage in another attempt to solve this issue (is this intentional?).

Regardless, /usr/include/lapacke/ indeed exists on this system, and contains (among other files) a file lapacke.h. I'm rather unfamiliar with these systems, and am unsure how to proceed.

CentOS version: CentOS Linux release 7.4.1708 (Core) BART version: 0.5.00

Timsey avatar Apr 17 '20 14:04 Timsey

Try to set NOLAPACKE=1 in the Makefile.local

uecker avatar Apr 17 '20 20:04 uecker

Thanks for the quick reply!

That definitely did something, I now get the following error:

gcc -rdynamic -O3 -ffast-math -Wmissing-prototypes -std=gnu11 -fopenmp -Wall -Wextra -DNOLAPACKE -MMD -MF ./.bart.d -iquote /var/scratch/t bbakker/bart/src/ -Isrc/lapacke -I/usr//include/ -I/usr//include -DFFTWTHREADS -DMAIN_LIST="avg, bench, bitmask, cabs, caldir, calmat, car g, casorati, cc, ccapply, cdf97, circshift, conj, conv, copy, cpyphs, creal, crop, delta, ecalib, ecaltwo, estdelay, estdims, estshift, es tvar, extract, fakeksp, fft, fftmod, fftrot, fftshift, filter, flatten, flip, fmac, homodyne, index, invert, itsense, join, looklocker, lr matrix, mandelbrot, mip, moba, nlinv, noise, normalize, nrmse, nufft, ones, pattern, phantom, pics, pocsense, poisson, poly, repmat, resha pe, resize, rmfreq, rof, rss, sake, saxpy, scale, sdot, show, slice, spow, sqpics, squeeze, ssa, std, svd, tgv, threshold, toimg, traj, tr anspose, twixread, var, vec, version, walsh, wave, wavelet, wavepsf, whiten, window, wshfl, zeros, zexp, ()" -include src/main.h -Dmain_re al=main_bart -o bart src/main.c /var/scratch/tbbakker/bart/src/bart.o lib/libbox.a lib/libgrecon.a lib/libsense.a lib/libnoir.a lib/libite r.a lib/liblinops.a lib/libwavelet.a lib/liblowrank.a lib/libnoncart.a lib/libcalib.a lib/libsimu.a lib/libsake.a lib/libdfwavelet.a lib/l ibnlops.a lib/libmoba.a lib/libnum.a lib/libmisc.a lib/libnum.a lib/libmisc.a lib/liblapacke.a -L/usr//lib -lfftw3f -lfftw3f_threads -L/u sr//lib -llapack -lblas -lpng -lm /cm/shared/package/gcc/4.9.2/bin/ld: skipping incompatible /usr//lib/libm.so when searching for -lm /cm/shared/package/gcc/4.9.2/bin/ld: skipping incompatible /usr//lib/libm.so when searching for -lm /cm/shared/package/gcc/4.9.2/bin/ld: skipping incompatible /usr//lib/libgcc_s.so.1 when searching for libgcc_s.so.1 /cm/shared/package/gcc/4.9.2/bin/ld: skipping incompatible /usr//lib/libgcc_s.so.1 when searching for libgcc_s.so.1 /cm/shared/package/gcc/4.9.2/bin/ld: skipping incompatible /usr//lib/libpthread.so when searching for -lpthread /cm/shared/package/gcc/4.9.2/bin/ld: skipping incompatible /usr//lib/libpthread.so when searching for -lpthread /cm/shared/package/gcc/4.9.2/bin/ld: skipping incompatible /usr//lib/libc.so when searching for -lc /cm/shared/package/gcc/4.9.2/bin/ld: skipping incompatible /usr//lib/libc.so when searching for -lc /cm/shared/package/gcc/4.9.2/bin/ld: skipping incompatible /usr//lib/libgcc_s.so.1 when searching for libgcc_s.so.1 /cm/shared/package/gcc/4.9.2/bin/ld: skipping incompatible /usr//lib/libgcc_s.so.1 when searching for libgcc_s.so.1 lib/libnum.a(blas.o): In function `blas_cgemm': blas.c:(.text+0x7e): undefined reference to `cblas_cgemm' lib/libnum.a(blas.o): In function `blas_matrix_multiply': blas.c:(.text+0xf7): undefined reference to `cblas_cgemm' lib/libnum.a(blas.o): In function `blas_csyrk': blas.c:(.text+0x18c): undefined reference to `cblas_csyrk' collect2: error: ld returned 1 exit status make[1]: *** [bart] Error 1

Followed by a bunch of Field 'name' not cached: and Field 'hname' not cached:.

Timsey avatar Apr 20 '20 10:04 Timsey

There are packages for CentOS 8. Does this help?

https://copr.fedorainfracloud.org/coprs/schaten/bart/

uecker avatar Jul 03 '20 12:07 uecker