Skip to content
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

MPB build error #107

Open
amrit-poudel opened this issue Sep 18, 2019 · 3 comments
Open

MPB build error #107

amrit-poudel opened this issue Sep 18, 2019 · 3 comments

Comments

@amrit-poudel
Copy link

amrit-poudel commented Sep 18, 2019

I am encountering the following error when trying to build mpb from source on macosx Mojave. All other libraries that mpb depends on are built using homebrew install <formula_name> and they are working fine. However, when I try to build mpb from source, make runs into the following error:

maxwell_op.c:1042:59: warning: unused parameter 'field' [-Wunused-parameter]
void maxwell_scalarfield_otherhalf(maxwell_data *d, real *field)
                                                          ^
14 warnings generated.
  CC       libmaxwell_la-maxwell_pre.lo
  CCLD     libmaxwell.la
  CCLD     libmpb.la
Undefined symbols for architecture x86_64:
  "_dsyev_", referenced from:
      _lapackglue_syev in libmatrices.a(libmatrices_la-blasglue.o)
      _maxwell_sym_matrix_eigs in libmaxwell.a(libmaxwell_la-maxwell_eps.o)
  "_zaxpy_", referenced from:
      _blasglue_axpy in libmatrices.a(libmatrices_la-blasglue.o)
  "_zcopy_", referenced from:
      _blasglue_copy in libmatrices.a(libmatrices_la-blasglue.o)
  "_zdotc_", referenced from:
      _blasglue_dotc in libmatrices.a(libmatrices_la-blasglue.o)
  "_zgeev_", referenced from:
      _lapackglue_geev in libmatrices.a(libmatrices_la-blasglue.o)
  "_zgemm_", referenced from:
      _blasglue_gemm in libmatrices.a(libmatrices_la-blasglue.o)
  "_zheev_", referenced from:
      _lapackglue_heev in libmatrices.a(libmatrices_la-blasglue.o)
  "_zhegv_", referenced from:
      _lapackglue_hegv in libmatrices.a(libmatrices_la-blasglue.o)
  "_zherk_", referenced from:
      _blasglue_herk in libmatrices.a(libmatrices_la-blasglue.o)
  "_zhetrf_", referenced from:
      _lapackglue_hetrf in libmatrices.a(libmatrices_la-blasglue.o)
  "_zhetri_", referenced from:
      _lapackglue_hetri in libmatrices.a(libmatrices_la-blasglue.o)
  "_zpotrf_", referenced from:
      _lapackglue_potrf in libmatrices.a(libmatrices_la-blasglue.o)
  "_zpotri_", referenced from:
      _lapackglue_potri in libmatrices.a(libmatrices_la-blasglue.o)
  "_zscal_", referenced from:
      _blasglue_scal in libmatrices.a(libmatrices_la-blasglue.o)
      _blasglue_rscal in libmatrices.a(libmatrices_la-blasglue.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[4]: *** [libmpb.la] Error 1
make[3]: *** [all-recursive] Error 1
make[2]: *** [all] Error 2
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2
@stevengj
Copy link
Collaborator

It looks like it's not linking the BLAS/LAPACK library. What does egrep 'BLAS|LAPACK' Makefile give?

@amrit-poudel
Copy link
Author

amrit-poudel commented Sep 19, 2019

Output from the above command:
BLAS_LIBS = /Users/amritpoudel/Desktop/HPC_LIB/HOMEBREW/Cellar/openblas/0.3.7/lib/libopenblas.dylib
LAPACK_LIBS = /Users/amritpoudel/Desktop/HPC_LIB/HOMEBREW/Cellar/openblas/0.3.7/lib/libopenblas.dylib

I have LDFLAGS and LD_LIBRARY_PATH pointing to the above lib folder.

I am not sure why I keep getting that error. I am using gcc-9.2.

I installed openblas using: homebrew install openblas. It seems to work fine with python-numpy.

More verbose output:

/bin/sh ../libtool --tag=CC --mode=link gcc -g -O2 -Wall -W -Wbad-function-cast -Wcast-qual -Wpointer-arith -Wcast-align -pedantic -no-undefined -version-info 2:0:1 -L/Users/amritpoudel/Desktop/HPC_LIB/HOMEBREW/Cellar/openblas/0.3.7/lib -L/Users/amritpoudel/Desktop/HPC_LIB/HOMEBREW/Cellar/hdf5/1.10.5_1/lib -L/Users/amritpoudel/Desktop/HPC_LIB/HOMEBREW/Cellar/fftw/3.3.8_1/lib -L/Users/amritpoudel/Desktop/HPC_LIB/HOMEBREW/Cellar/gsl/2.6/lib -L/Users/amritpoudel/Desktop/HPC_LIB/HARMINV/lib -L/Users/amritpoudel/Desktop/HPC_LIB/LIBCTL/lib -o libmpb.la -rpath /Users/amritpoudel/Desktop/HPC_LIB/MPB/lib util/libutil.la matrices/libmatrices.la maxwell/libmaxwell.la -lhdf5 -lz /Users/amritpoudel/Desktop/HPC_LIB/HOMEBREW/Cellar/openblas/0.3.7/lib/libopenblas.dylib /Users/amritpoudel/Desktop/HPC_LIB/HOMEBREW/Cellar/openblas/0.3.7/lib/libopenblas.dylib -lfftw3 -lm -L/Users/amritpoudel/Desktop/HPC_LIB/HOMEBREW/Cellar/openblas/0.3.7/lib -L/Users/amritpoudel/Desktop/HPC_LIB/HOMEBREW/Cellar/hdf5/1.10.5_1/lib -L/Users/amritpoudel/Desktop/HPC_LIB/HOMEBREW/Cellar/fftw/3.3.8_1/lib -L/Users/amritpoudel/Desktop/HPC_LIB/HOMEBREW/Cellar/gsl/2.6/lib -L/Users/amritpoudel/Desktop/HPC_LIB/HARMINV/lib -L/Users/amritpoudel/Desktop/HPC_LIB/LIBCTL/lib -L/Users/amritpoudel/Desktop/HPC_LIB/HOMEBREW/Cellar/gcc/9.2.0/lib/gcc/9/gcc/x86_64-apple-darwin18/9.2.0 -L/Users/amritpoudel/Desktop/HPC_LIB/HOMEBREW/Cellar/gcc/9.2.0/lib/gcc/9/gcc/x86_64-apple-darwin18/9.2.0/../../.. -lgfortran -lquadmath -lm
libtool: link: gcc -dynamiclib -o .libs/libmpb.1.dylib -Wl,-force_load,util/.libs/libutil.a -Wl,-force_load,matrices/.libs/libmatrices.a -Wl,-force_load,maxwell/.libs/libmaxwell.a -L/Users/amritpoudel/Desktop/HPC_LIB/HOMEBREW/Cellar/openblas/0.3.7/lib -L/Users/amritpoudel/Desktop/HPC_LIB/HOMEBREW/Cellar/hdf5/1.10.5_1/lib -L/Users/amritpoudel/Desktop/HPC_LIB/HOMEBREW/Cellar/fftw/3.3.8_1/lib -L/Users/amritpoudel/Desktop/HPC_LIB/HOMEBREW/Cellar/gsl/2.6/lib -L/Users/amritpoudel/Desktop/HPC_LIB/HARMINV/lib -L/Users/amritpoudel/Desktop/HPC_LIB/LIBCTL/lib -L/Users/amritpoudel/Desktop/HPC_LIB/HOMEBREW/Cellar/gcc/9.2.0/lib/gcc/9/gcc/x86_64-apple-darwin18/9.2.0 -L/Users/amritpoudel/Desktop/HPC_LIB/HOMEBREW/Cellar/gcc/9.2.0/lib/gcc/9/gcc/x86_64-apple-darwin18/9.2.0/../../.. -lhdf5 -lz -lfftw3 -lgfortran -lquadmath -lm -g -O2 -install_name /Users/amritpoudel/Desktop/HPC_LIB/MPB/lib/libmpb.1.dylib -compatibility_version 3 -current_version 3.0 -Wl,-single_module
Undefined symbols for architecture x86_64:
"dsyev", referenced from:
_lapackglue_syev in libmatrices.a(libmatrices_la-blasglue.o)
_maxwell_sym_matrix_eigs in libmaxwell.a(libmaxwell_la-maxwell_eps.o)

@amrit-poudel
Copy link
Author

amrit-poudel commented Sep 20, 2019

I’d appreciate any other suggestions on how I can fix this error. Openblas (contains both blas and lapack) is in the path, but I’m not sure why mpb make complains. When homebrew builds openblas, it uses gfortran compiler, which is the same compiler I am using to build all libraries from source.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants