Help installing siesta, error on make
I am trying to install siesta on Ubuntu 18.04.4 LTS inside windows (Linux sub-system for windows). I have processor AMD FX(tm).
This is what I did:
1. I downloaded siesta4,1-b4.
2. I ran "sh Src/obj_setup.sh".
3. Then, "cp Obj/DOCUMENTED-
4. I modified arch.make to change the relevant options for mpi (as described by the pdf):
CC = mpicc
FC = mpifort # or mpif90
MPI_INTERFACE = libmpi_f90.a
MPI_INCLUDE = .
FPPFLAGS += -DMPI
5. I installed some required libraries (mpi, openblas, etc).
5. I ran make and got errors saying I was missing some libraries so I installed them.
6. I then got this error:
...\
/usr/bin/ld: diag.o: undefined reference to symbol 'dtrsm_'
//usr/lib/
collect2: error: ld returned 1 exit status
Makefile:493: recipe for target 'siesta' failed
make: *** [siesta] Error 1
Please correct me if I did something wrong and tell me if I need to provide more details.
Question information
- Language:
- English Edit question
- Status:
- Solved
- For:
- Siesta Edit question
- Assignee:
- No assignee Edit question
- Solved by:
- Oscar Xavier
- Solved:
- Last query:
- Last reply:
Revision history for this message
|
#1 |
I'm not sure but perhaps you need to specify the path to the libraries. In my case, it looked like this:
BLAS_LIBS=-lblas
LAPACK_
BLACS_LIBS=
SCALAPACK_
And also verify that these variables are indicated in LIBS
LIBS=$(
Revision history for this message
|
#2 |
Thank you for your reply. I tried to specify the path to the libraries but I couldn't locate blacs or scalapack so I installed them. After adding them to the arch.make I got another symbol error.
I wrote this on the arch.make:
BLAS_LIBS = /usr/lib/
LAPACK_LIBS = /usr/lib/
BLACS_LIBS = /usr/lib/
SCALAPACK_LIBS = /usr/lib/
This is the new error I got:
/usr/bin/ld: m_trimat_invert.o: undefined reference to symbol 'zgesv_'
//usr/lib/
collect2: error: ld returned 1 exit status
Makefile:493: recipe for target 'siesta' failed
make: *** [siesta] Error 1
Revision history for this message
|
#3 |
SIESTA 4.0 contains a script for automatic arch.make generation. This script is called configure and is located in the Src folder. The option --enable-mpi allows you to generate the arch.make for parallel SIESTA (sh path/to/
Revision history for this message
|
#4 |
I would like to try the automatic arch.make generation.
However, my siesta files do not have such a script.
from the siesta directory I ran:
find . -name "*conf*"
and
find . -type f -print | xargs grep -e "--enable-mpi"
both returned nothing. I have no files containing conf in their name nor having --enable-mpi in their text.
Could you point me to the correct filename or where I can download this script?
Revision history for this message
|
#5 |
I did not find this file in SIESTA 4.1, but it is present in SIESTA 4.0 (SIESTA 4.0 can be downloaded here: https:/
sh path/to/
As a result, an arch.make file will be generated to compile a serial SIESTA 4.0. You must specify an additional option "--enable-mpi" to generate an arch.make file for a parallel SIESTA:
sh path/to/
You can learn more about additional script features using the -h option:
sh path/to/
It is possible that the script will not be able to detect some necessary libraries or compilers.
Revision history for this message
|
#6 |
I ran the congifure --enable-mpi and as you said, some were not recognized
Here I paste the part where it says no:
checking for netcdf... no
checking is BLAS linked by default... no
checking for BLAS in -lblasmt... no
checking for BLAS in ATLAS... no
checking for sgemm in -lblas... yes
checking for dgemm in -ldgemm... no
checking for sgemm in -lcxml... no
checking for sgemm in -ldxml... no
checking for sgemm in -lscs... no
checking for sgemm in -lcomplib.
checking for sgemm in -lblas... (cached) yes
checking for sgemm in -lessl... no
checking for sgemm in -lblas... (cached) yes
checking LAPACK already linked... no
checking for LAPACK in -llapackmt... no
checking for LAPACK in -llapack... yes
checking LAPACK includes divide-and-conquer routines... yes
configure: using DC_LAPACK routines packaged with SIESTA due to bug in library. Linker flag might be needed to avoid duplicate symbols
checking if we can compile a BLACS program... no
checking for BLACS in -lblacs... no
checking for BLACS in -lblacsF77init -lblacs -lblacsF77init... no
checking for BLACS in -ls3l... no
configure: Don't know how to compile with BLACS - edit arch.make by hand
checking if we can compile a ScaLAPACK program... no
configure: Don't know how to compile with ScaLAPACK - edit arch.make by hand
The resulting arch.make had the blacs or scalapak options blank, so I filled them with the one I mentioned previously.
BLAS_LIBS = /usr/lib/
LAPACK_LIBS = /usr/lib/
BLACS_LIBS = /usr/lib/
SCALAPACK_LIBS = /usr/lib/
I got the same error:
...\
/usr/bin/ld: m_trimat_invert.o: undefined reference to symbol 'zgesv_'
//usr/lib/
collect2: error: ld returned 1 exit status
Makefile:493: recipe for target 'siesta' failed
make: *** [siesta] Error 1
Revision history for this message
|
#7 |
There may be several files in the BLACS and SCALAPACK libraries. In the case of the scalapack library on my computer, this is libscalapack.so and libscalapack.so.2. I specified both files on the same line of arch.make: SCALAPACK_
Probably, automatic generation with configure script fails because it is not possible to determine the location of the BLACS and SCALAPACK libraries. A description of how to make libraries visible to the system is described in these forums:
https:/
https:/
Revision history for this message
|
#8 |
Thank you for that information. I was indeed missing some paths to the libraries. However, I still got the same error after adding the missing ones. This is what I added:
BLAS_LIBS = /usr/lib/
LAPACK_LIBS = /usr/lib/
BLACS_LIBS = /usr/lib/
SCALAPACK_LIBS = /usr/lib/
I also tried the suggestions in the stackexchange answers in the link you provided and still got the same error.
When I do `ldconfig -p` I get:
ldconfig -p | grep openblas
libblas.so (libc6,x86-64) => /usr/lib/
ldconfig -p | grep lapack
ldconfig -p | grep blacs
I notice I have several possibilities of libraries to choose, is it possible that some of those libraries don't work together well and I have to use a specific group of them?
Revision history for this message
|
#9 |
Let me correct a few things you are doing:
1) When using shared libraries *.so typically is a link to *.so.<integer>. You can check this by doing
$> ls -l /usr/lib/
which will most likely show:
/usr/lib/
Hence, only link ONE of the libraries, and preferably do:
-L/usr/
Nothing more!
2) You seem to use wrong libraries, you have to link lapack and blas (you added BLAS two times). Please carefully go through your arch.make.
3) ScaLAPACK requires that you do not mix different MPI implementations. You have:
-lblacs-openmpi AND -lscalapack-mpich
OpenMPI and MPICH are not compatible. So please only use one of them! The library you use NEEDS to correspond to your mpif90 and mpicc command (i.e. if mpif90 is MPICH, then use MPICH libraries)
Lastly, you have never shown your complete arch.make which would probably help. However, you most severe mistake seems to be the above 2 things.
Revision history for this message
|
#10 |
Thank you very much for your reply. This is the kind of information I needed. I modified the file based on what you told me and I no longer get the error in the libraries. Now I don't understand the output and don't know what I have to do next. Could you help me with this?
Here I paste the library paths:
/usr/lib/
/usr/lib/
/usr/lib/
/usr/lib/
Here's the arch.make file:
.SUFFIXES:
.SUFFIXES: .f .F .o .c .a .f90 .F90
SIESTA_ARCH = unknown
CC = mpicc
FPP = $(FC) -E -P -x c
FC = mpifort
FC_SERIAL = gfortran
FFLAGS = -O2 -fPIC -ftree-vectorize -march=native
AR = ar
ARFLAGS_EXTRA =
RANLIB = ranlib
SYS = nag
SP_KIND = 4
DP_KIND = 8
KINDS = $(SP_KIND) $(DP_KIND)
DEFS_PREFIX =
LDFLAGS =
FCFLAGS_fixed_f =
FCFLAGS_free_f90 =
FPPFLAGS_fixed_F =
FPPFLAGS_free_F90 =
BLAS_LIBS = -L/usr/
LAPACK_LIBS = -L/usr/
BLACS_LIBS = -L/usr/
SCALAPACK_LIBS = /usr/lib/
/usr/lib/
COMP_LIBS =
MPI_INTERFACE = libmpi_f90.a
MPI_INCLUDE = .
FPPFLAGS = $(DEFS_
FPPFLAGS += -DMPI
LIBS = $(NETCDF_LIBS) $(BLAS_LIBS) $(LAPACK_LIBS) $(BLACS_LIBS) $(SCALAPACK_LIBS) $(MPI_LIBS) $(COMP_LIBS)
FFLAGS_DEBUG = -g -O0 # your appropriate flags here...
atom.o: atom.F
$(FC) -c $(FFLAGS_DEBUG) $(INCFLAGS) $(FPPFLAGS) $(FPPFLAGS_fixed_F) $<
.c.o:
$(CC) -c $(CFLAGS) $(INCFLAGS) $(CPPFLAGS) $<
.F.o:
$(FC) -c $(FFLAGS) $(INCFLAGS) $(FPPFLAGS) $(FPPFLAGS_fixed_F) $<
.F90.o:
$(FC) -c $(FFLAGS) $(INCFLAGS) $(FPPFLAGS) $(FPPFLAGS_
.f.o:
$(FC) -c $(FFLAGS) $(INCFLAGS) $(FCFLAGS_fixed_f) $<
.f90.o:
$(FC) -c $(FFLAGS) $(INCFLAGS) $(FCFLAGS_free_f90) $<
And this is the complete output
Compilation architecture to be used: unknown
If this is not what you want, create the right
arch.make file using the models in Src/Sys
Hit ^C to abort...
==> Incorporating information about present compilation (compiler and flags)
make "FPPFLAGS=
make[1]: Entering directory '/home/
mpifort -c -O2 -fPIC -ftree-vectorize -march=native -DFC_HAVE_ABORT -DMPI compinfo.F90
make[1]: Leaving directory '/home/
mpifort -c -O2 -fPIC -ftree-vectorize -march=native -DFC_HAVE_ABORT -DMPI /home/izxle/
mpifort -c -O2 -fPIC -ftree-vectorize -march=native -DFC_HAVE_ABORT -DMPI /home/izxle/
mpifort -o siesta \