This thread is locked.Only browsing is available.
Top Page > Browsing
Solutions for installation of OpenMX3.7 with MKL in linux64
Date: 2013/07/13 02:15
Name: Daniel Coimbra

I had lots of trouble installing OpenMX and getting it to work, and I also noticed other post with problems some of which I went through, so I am writing the solutions I found in hopes of helping other troubled users.


First I unpacked and patched as per the instructions given, no problems here.
The first problem I encounted was that the objects (*.o) were not being created on compilation. I had to edit the makefile and in every session starting "openmx.o: ..." and add "-o $@" to the command. As an example the resulting lines would be:

openmx.o: openmx.c openmx_common.h tran_variables.h tran_prototypes.h
$(CC) -c openmx.c -o $@


After that the objects were generated successfully.
Next I had problems at the linking part, a series of "undefined reference" errors were printed. This is caused by libraries not being found by ld. I solved this by editing the "LIB" definition to include those libraries. I also made other changes and here is what I ended up with:

MKLPATH = /opt/intel/mkl/10.2.5.035 # Change this path if you have other version
MKLROOT = $MKLPATH/lib/em64t
MKLINCLUDE = $MKLPATH/include
CC = mpicc -ffast-math -fopenmp -O3 -Df77 -I/usr/local/include \
-pthread -I${MKLINCLUDE} -I/usr/local/include/openmpi -I${MKLINCLUDE}/em64t/lp64
FC = mpif90 -ffast-math -fopenmp -O3 -Df77 -I/usr/local/include \
-pthread -I${MKLINCLUDE} -I/usr/local/include/openmpi -I${MKLINCLUDE}/em64t/lp64
LIB = -L/usr/local/lib -L${MKLROOT} -L/usr/lib \
-lmpi -lmpi_f77 -lmpi_f90 -lgfortran \
-Wl,--start-group -lmkl_blacs_intelmpi_lp64 \
-lmkl_gf_lp64 \
-lmkl_gnu_thread \
-lmkl_lapack \
-lmkl_core -Wl,--end-group \
-liomp5 -lpthread -lm

The order of the MKL libs is very important.
I also had a situation in which the program linked succesfully but when running an example I got "MKL ERROR: Parameter X was incorrect on entry to SOMEVAR". I found this error was caused by the use of the "ilp64" MKL libraries instead of "lp64". The ilp64 libraries are for the IA-64 architeture, which is different from "normal" 64 bits.



After a week of work and several modifications I finally got a working executable that successfully completes the H2O.dat example.
I hope this helps anyone with trouble in the installation of OpenMX
メンテ
Page: [1]

Re: Solutions for installation of OpenMX3.7 with MKL in linux64 ( No.1 )
Date: 2013/08/08 00:23
Name: Grigory Shamov

Hi,

I've tried to build OpenMX 3.7 with MKL and either OpenMPI or IntelMPI, but it always fails at the link stage with the ELPA missing something. For OpenMPI it misses the MPI libraries. Even though I gave it the include path and used the mpif90 wrapper.

For IntelMPI it misses something obscure like for_check_mult_overflow64, for_alloc_allocatable, for_dealloc_allocatable that seems to be a part of core Fortran libraries?

Are there any special tricks/depeldencies to build this ELPA library?

--
Grigory Shamov
University of Manitoba/Westgrid
メンテ
Re: Solutions for installation of OpenMX3.7 with MKL in linux64 ( No.2 )
Date: 2013/08/08 00:29
Name: Grigory Shamov

"The ilp64 libraries are for the IA-64 architeture, which is different from "normal" 64 bits."

That is not exactly correct. ilp64 are the normal 64 floating point bits; they are for longer integer array indexes (-i8) as opposed to default -i4.

This knowledge doesnt help me bild it though :)
メンテ
Re: Solutions for installation of OpenMX3.7 with MKL in linux64 ( No.3 )
Date: 2013/08/08 01:18
Name: Grigory Shamov

OK, figured it out using a different forum thread here.

The problems stem from linikin Fortran MPI subs with C main program.

1) For Intel MPI: it will find MPI but miss the Fortran runtime library. Add '-lifcore' and it will work.

2) For OpenMPI: it will miss Fortran MPI libraries, and Fortran MPI .mod file that lives under Library, not Include of OpenMPI! The way to figure out what it needs is to run "mpif90 --show" and then add "-I$(OPENMPI_HOME)/include -I$(OPENMPI_HOME)/lib" to compiler flags and "-L$(OPENMPI_HOME)/lib -lmpi_f90 -lmpi_f77 -lmpi " etc. to the linker flags.

And, yes, it needs 32bit indexes in 64bit BLAS/LAPACK, so "_lp64" MKL names should be used.

--
Grigory Shamov

メンテ
Re: Solutions for installation of OpenMX3.7 with MKL in linux64 ( No.4 )
Date: 2013/09/03 17:33
Name: Somesh Bhattacharya  <somesh.bhattacharya@aist.go.jp>

Dear OpenMX users,

I am trying to compile OpenMX3.7 on the linux x86_64 SMP architecture. The above points were very helpful to sort out some of the basec errors in compilation. However,
I cannot overcome the following error :

/usr/lib64/gcc/x86_64-suse-linux/4.7/../../../../x86_64-suse-linux/bin/ld: elpa1.o: undefined reference to symbol '_gfortran_transfer_real_write@@GFORTRAN_1.4'
/usr/lib64/gcc/x86_64-suse-linux/4.7/../../../../x86_64-suse-linux/bin/ld: note: '_gfortran_transfer_real_write@@GFORTRAN_1.4' is defined in DSO /usr/lib64/libgfortran.so.3 so try adding it to the linker command line
/usr/lib64/libgfortran.so.3: could not read symbols: Invalid operation
collect2: error: ld returned 1 exit status
make: *** [openmx] Error 1


Can anybody guide me on this?

Best regards,

Somesh
メンテ
Re: Solutions for installation of OpenMX3.7 with MKL in linux64 ( No.5 )
Date: 2013/09/03 22:29
Name: T.V.T. Duy  <duytvt@jaist.ac.jp>

Hi,

Could you please add -lgfortran to LIB and try again?

LIB = .... -lgfortran

Best regards,
T.V.T. Duy
メンテ
Re: Solutions for installation of OpenMX3.7 with MKL in linux64 ( No.6 )
Date: 2013/09/04 12:28
Name: Somesh Bhattacharya  <somesh.bhattacharya@aist.go.jp>

Thanks Duy.

That worked and I can compile the openmp version.

I was also trying to install the mpi version.

My fortran and c compilers along with the linking libraries are as follows :

CC = /home/somesh/softwares/mpich-install/bin/mpicc -Dnoomp -O3 -I/home/somesh/softwares/mpich-install/include -I/home/somesh/softwares/mpich-install/lib64
FC = /home/somesh/softwares/mpich-install/bin/mpif90 -Dnoomp -O3 -I/home/somesh/softwares/mpich-install/include -I/home/somesh/softwares/mpich-install/lib64
LIB = -lm -lintlc -lsvml -lgfortran -I/home/somesh/softwares/FFTW/include -L/home/somesh/softwares/FFTW/lib64 -lfftw3 -L/opt/intel/composer_xe_2011_sp1.11.339/mkl/lib/intel64 -lmkl_lapack95_ilp64 -lmkl_lapack95_lp64 -lmkl_blas95_lp64 -lmkl_blacs_intelmpi_ilp64 -lmkl_intel_lp64 -lmkl_sequential -lmkl_core -lifcore -L/home/somesh/softwares/mpich-install/lib64 -lmpich -lfmpich -lmpichcxx -lmpichf90 #-lmpi_f77 -lmpi_f90 -lmpi

But I am getting a bunch of errors as :

openmx.c:(.text+0x18c): undefined reference to `ompc_set_num_threads'
truncation.o: In function `Trn_System':
truncation.c:(.text+0x81e9): undefined reference to `omp_get_thread_num'
truncation.c:(.text+0x81f1): undefined reference to `omp_get_num_threads'
truncation.c:(.text+0x8201): undefined reference to `omp_get_num_procs'
truncation.o: In function `Estimate_Trn_System':
truncation.c:(.text+0x8b5d): undefined reference to `omp_get_thread_num'
truncation.c:(.text+0x8b64): undefined reference to `omp_get_num_threads'
truncation.c:(.text+0x8b6f): undefined reference to `omp_get_num_procs'
truncation.o: In function `UCell_Box':
truncation.c:(.text+0xa758): undefined reference to `omp_get_thread_num'
truncation.c:(.text+0xa760): undefined reference to `omp_get_num_threads'
truncation.c:(.text+0xa76b): undefined reference to `omp_get_num_procs'
truncation.c:(.text+0xc1d9): undefined reference to `omp_get_thread_num'
truncation.c:(.text+0xc1e0): undefined reference to `omp_get_num_threads'
truncation.c:(.text+0xc1ec): undefined reference to `omp_get_num_procs'
truncation.c:(.text+0xca13): undefined reference to `omp_get_thread_num'
truncation.c:(.text+0xca1b): undefined reference to `omp_get_num_threads'
truncation.c:(.text+0xca23): undefined reference to `omp_get_num_procs'


Can you suggest any solution?

Regards,

Somesh
メンテ
Re: Solutions for installation of OpenMX3.7 with MKL in linux64 ( No.7 )
Date: 2013/09/04 13:12
Name: T.V.T. Duy  <duytvt@jaist.ac.jp>

Please modify CC, FC, and LIB as below and try again.

CC = /home/somesh/softwares/mpich-install/bin/mpicc -fopenmp -O3 -I/home/somesh/softwares/mpich-install/include -I/home/somesh/softwares/FFTW/include

FC = /home/somesh/softwares/mpich-install/bin/mpif90 -O3 -I/home/somesh/softwares/mpich-install/include

LIB = -L/home/somesh/softwares/FFTW/lib64 -lfftw3 -L/opt/intel/composer_xe_2011_sp1.11.339/mkl/lib/intel64 -lmkl_lapack95_ilp64 -lmkl_lapack95_lp64 -lmkl_blas95_lp64 -lmkl_blacs_intelmpi_ilp64 -lmkl_intel_lp64 -lmkl_sequential -lmkl_core -lifcore -L/home/somesh/softwares/mpich-install/lib64 -lmpich -lfmpich -lmpichcxx -lmpichf90 -lmpi_f77 -lmpi_f90-lmpi -lm -lintlc -lsvml -lgfortran
メンテ
Re: Solutions for installation of OpenMX3.7 with MKL in linux64 ( No.8 )
Date: 2013/09/04 14:06
Name: Somesh Bhattacharya  <somesh.bhattacharya@aist.go.jp>

Thanks a lot for the useful suggestions. It worked this time.

Regards,

Somesh
メンテ

Page: [1]