Community
cancel
Showing results for 
Search instead for 
Did you mean: 
jlbocquet
Beginner
81 Views

linking with MKL 10.2.5.035 and Lapack for Linux

Hello, On an IA-32 platform, I installed recently MKL 10.2.5.035 and Fortran compiler 11.1.072 My Fortran program needs dsyev, dgetrf, dpotrf ... subroutines belonging to the Lapack package. I tried the available link line advisor on Intel Software Network but did not succeed up to now to write correctly the linking command lines. With: $MKLPATH/libmkl_solver_sequential.a Wl,--start-group $MKLPATH/libmkl_intel.a $MKLPATH/libmkl_sequential.a $MKLPATH/libmkl_core.a -Wl,--end-group -lpthread the answer is (of course !) that dsyev ... are undefined references. Question : Where do I have to add the Lapack libraries ? In which order (before the group { }, after or in between ?) I am not a developper but only a base user of programming; any suggestion or receipe will be fruitful. Thanks in advance
0 Kudos
4 Replies
Todd_R_Intel
Employee
81 Views

Hi there,
To better understand what is happening, I really need to have a little more information. Can you provide your full link line? What is the value of $MKLPATH or at least the last bit of it? Could you provide the full output of the linker with all error messages?

Thanks,
Todd
jlbocquet
Beginner
81 Views

Hi Todd,

I send you the content of the files named "ld-command_line" of my Makefile and the output "ld-output"

(I was not able to find the command of this mail to send the files as attached pieces)
----------------------------------------------------------------------------------------------------
# environment variables used in the Makefile
F90 = $(HOME)/opt/intel/fc/11.1.072/bin/ia32/ifort
FLAGS = -check all -watch all -assume nobuffered_io -O2

LIBDIRS = -L${HOME}/opt/intel/mkl/10.2.5.035/lib/32

LIBS = -libmkl_solver_sequential.a \
-Wl,--start-group \
-libmkl_intel.a \
-libmkl_intel_thread.a \
-libmkl_core.a \
-Wl,--end-group -lpthread

LD= = $(F90)

# load command in the Makefile

$(LD) $(FLAGS) -o $@ $(OBJS) $(LIBDIRS) $(LIBS)

--------------------------------------------------------------------------------------------------

Loading mocarella.exec ...
/home/bocquet/opt/intel/fc/11.1.072/bin/ia32/ifort -check all -watch all -assume nobuffered_io -O2 -o mocarella.exec alloc_atom.o alloc_cavites.o alloc_cell.o alloc_const_elast.o alloc_pixels.o alloc_relax.o alloc_vibra.o const_elast_deriv.o const_elast_numer.o control_depla.o crea_config.o crea_defaut.o dealloc_atom.o dealloc_cavites.o dealloc_cell.o dealloc_const_elast.o dealloc_pixels.o dealloc_relax.o dealloc_vibra.o decsol.o depiege.o detect_cavites.o determ.o entrop_deform.o extend_nvoismx_exact.o extend_nvoismx_interact.o extract_rijvib.o forcons.o gdr.o gradcon_coor.o gradcon_etai.o gradcon_form.o gradcon_rota.o gradu_cols.o gradu_etai.o gradu_form.o gradu_parm.o gradu_rota.o gradu_site.o init_xcol.o init_xsit.o majabc_vs_xform.o majxform_vs_abc.o majxyz.o minim_form.o minim_parm.o mocarella.o mod_alloc_atom.o mod_alloc_cavites.o mod_alloc_cell.o mod_alloc_const_elast.o mod_alloc_dxdydz.o mod_alloc_pixels.o mod_alloc_relax.o mod_alloc_vibra.o mod_alloc_xyznew.o mod_alloc_xyzold.o mod_cell.o mod_const_elast.o mod_contraintes.o mod_dim_atom.o mod_dim_cavites.o mod_dim_cell.o mod_dim_pixels.o mod_dim_relax.o mod_dim_vibra.o mod_divers.o mod_interac_general.o mod_interac_specif.o mod_options.o mod_pavage.o mod_potentiels.o mod_recentr.o mod_relaxation.o mod_saut.o mod_tri.o mod_vibration.o numcell.o phonons.o potin.o potin_specif.o ppvp_vps.o preprel.o prepvib.o prod_vps.o ptes_elast.o recentr.o recherche_lacune.o relax_conf_cols.o relax_conf_site.o reprise.o rescale_boite.o rescale_xrel.o reseau.o sauvegarde.o sigma_atomique.o sortie_rasmol.o sro.o tabvois_fresh.o tabvois_renew.o topo_loc.o tout_vps.o trajec.o vecteurs_saut.o vibra_conf_cols.o vibra_conf_site.o voisinage.o voisins.o -L/home/bocquet/opt/intel/mkl/10.2.5.035/lib/32
/home/bocquet/opt/intel/fc/11.1.072/bin/ia32/fortcom \
-mP1OPT_version=11.1-ia32 \
-mGLOB_diag_file=alloc_atom.diag \
-mGLOB_source_language=GLOB_SOURCE_LANGUAGE_F90 \
-mGLOB_tune_for_fort \
-mGLOB_use_fort_dope_vector \
-mP2OPT_static_promotion \
-mP1OPT_print_version=FALSE \
-mP3OPT_use_mspp_call_convention \
-mCG_use_gas_got_workaround=F \
-mP2OPT_align_option_used=TRUE \
"-mGLOB_options_string=-check all -watch all -assume nobuffered_io -O2 -o mocarella.exec -L/home/bocquet/opt/intel/mkl/10.2.5.035/lib/32" \
-mGLOB_cxx_limited_range=FALSE \
-mGLOB_as_output_backup_file_name=/tmp/ifortKANSb8as_.s \
-mGLOB_runtime_check_undefined \
-mGLOB_lp64=FALSE \
-mIPOPT_activate \
-mGLOB_machine_model=GLOB_MACHINE_MODEL_PW \
-mGLOB_use_base_pointer \
-mP2OPT_subs_out_of_bound=FALSE \
-mGLOB_ansi_alias \
-mP2OPT_align_array_to_cache_line=FALSE \
-mGLOB_opt_level=2 \
-mP2OPT_hlo_level=2 \
-mP2OPT_hlo \
-mIPOPT_link \
-mIPOPT_ipo_activate \
-mIPOPT_ipo_mo_activate \
-mIPOPT_ipo_mo_nfiles=1 \
-mIPOPT_source_files_list=/tmp/ifortIFT1ULlst \
-mIPOPT_global_data \
-mIPOPT_link_script_file=/tmp/ifort9C3KFyscript \
-mIPOPT_link_version=2.18.0.20080103 \
"-mIPOPT_cmdline_link="/usr/lib/gcc/i486-linux-gnu/4.2.4/../../../../lib/crt1.o" "/usr/lib/gcc/i486-linux-gnu/4.2.4/../../../../lib/crti.o" "/usr/lib/gcc/i486-linux-gnu/4.2.4/crtbegin.o" "--eh-frame-hdr" "-dynamic-linker" "/lib/ld-linux.so.2" "-m" "elf_i386" "-o" "mocarella.exec" "/home/bocquet/opt/intel/fc/11.1.072/lib/ia32/for_main.o" "alloc_atom.o" "alloc_cavites.o" "alloc_cell.o" "alloc_const_elast.o" "alloc_pixels.o" "alloc_relax.o" "alloc_vibra.o" "const_elast_deriv.o" "const_elast_numer.o" "control_depla.o" "crea_config.o" "crea_defaut.o" "dealloc_atom.o" "dealloc_cavites.o" "dealloc_cell.o" "dealloc_const_elast.o" "dealloc_pixels.o" "dealloc_relax.o" "dealloc_vibra.o" "decsol.o" "depiege.o" "detect_cavites.o" "determ.o" "entrop_deform.o" "extend_nvoismx_exact.o" "extend_nvoismx_interact.o" "extract_rijvib.o" "forcons.o" "gdr.o" "gradcon_coor.o" "gradcon_etai.o" "gradcon_form.o" "gradcon_rota.o" "gradu_cols.o" "gradu_etai.o" "gradu_form.o" "gradu_parm.o" "gradu_rota.o" "gradu_site.o" "init_xcol.o" "init_xsit.o" "majabc_vs_xform.o" "majxform_vs_abc.o" "majxyz.o" "minim_form.o" "minim_parm.o" "mocarella.o" "mod_alloc_atom.o" "mod_alloc_cavites.o" "mod_alloc_cell.o" "mod_alloc_const_elast.o" "mod_alloc_dxdydz.o" "mod_alloc_pixels.o" "mod_alloc_relax.o" "mod_alloc_vibra.o" "mod_alloc_xyznew.o" "mod_alloc_xyzold.o" "mod_cell.o" "mod_const_elast.o" "mod_contraintes.o" "mod_dim_atom.o" "mod_dim_cavites.o" "mod_dim_cell.o" "mod_dim_pixels.o" "mod_dim_relax.o" "mod_dim_vibra.o" "mod_divers.o" "mod_interac_general.o" "mod_interac_specif.o" "mod_options.o" "mod_pavage.o" "mod_potentiels.o" "mod_recentr.o" "mod_relaxation.o" "mod_saut.o" "mod_tri.o" "mod_vibration.o" "numcell.o" "phonons.o" "potin.o" "potin_specif.o" "ppvp_vps.o" "preprel.o" "prepvib.o" "prod_vps.o" "ptes_elast.o" "recentr.o" "recherche_lacune.o" "relax_conf_cols.o" "relax_conf_site.o" "reprise.o" "rescale_boite.o" "rescale_xrel.o" "reseau.o" "sauvegarde.o" "sigma_atomique.o" "sortie_rasmol.o" "sro.o" "tabvois_fresh.o" "tabvois_renew.o" "topo_loc.o" "tout_vps.o" "trajec.o" "vecteurs_saut.o" "vibra_conf_cols.o" "vibra_conf_site.o" "voisinage.o" "voisins.o" "-L/home/bocquet/opt/intel/mkl/10.2.5.035/lib/32" "-L/opt/soft/intel/fc/lib/ia32" "-L/opt/soft/intel/fc/mkl/lib/32" "-L/opt/soft/intel/fc/lib/ia32" "-L/opt/soft/intel/fc/mkl/lib/32" "-L/home/bocquet/opt/intel/fc/11.1.072/lib/ia32" "-L/usr/lib/gcc/i486-linux-gnu/4.2.4/" "-L/usr/lib/gcc/i486-linux-gnu/4.2.4/../../../../lib/" "-L/lib/../lib/" "-L/usr/lib/../lib/" "-L/opt/soft/intel/fc/lib/ia32/" "-L/opt/soft/intel/fc/mkl/lib/32/" "-L/usr/lib/gcc/i486-linux-gnu/4.2.4/../../../" "-L/lib/" "-L/usr/lib" "-Bstatic" "-lifport" "-lifcore" "-limf" "-lsvml" "-Bdynamic" "-lm" "-Bstatic" "-lipgo" "-lirc" "-Bdynamic" "-lc" "-lgcc_s" "-lgcc" "-Bstatic" "-lirc_s" "-Bdynamic" "-ldl" "-lc" "/usr/lib/gcc/i486-linux-gnu/4.2.4/crtend.o" "/usr/lib/gcc/i486-linux-gnu/4.2.4/../../../../lib/crtn.o"" \
-mIPOPT_il_in_obj \
-mIPOPT_ipo_activate_warn=FALSE \
-mIPOPT_obj_output_file_name=/tmp/ipo_ifortnn9bUC.o \
-mGLOB_linker_version=2.18.0.20080103 \
-mP3OPT_asm_target=P3OPT_ASM_TARGET_GAS \
-mGLOB_obj_output_file=/tmp/ipo_ifortnn9bUC.o \
-mP1OPT_source_file_name=ipo_out.f \
alloc_atom.o \
alloc_cavites.o \
alloc_cell.o \
alloc_const_elast.o \
alloc_pixels.o \
alloc_relax.o \
alloc_vibra.o \
const_elast_deriv.o \
const_elast_numer.o \
control_depla.o \
crea_config.o \
crea_defaut.o \
dealloc_atom.o \
dealloc_cavites.o \
dealloc_cell.o \
dealloc_const_elast.o \
dealloc_pixels.o \
dealloc_relax.o \
dealloc_vibra.o \
decsol.o \
depiege.o \
detect_cavites.o \
determ.o \
entrop_deform.o \
extend_nvoismx_exact.o \
extend_nvoismx_interact.o \
extract_rijvib.o \
forcons.o \
gdr.o \
gradcon_coor.o \
gradcon_etai.o \
gradcon_form.o \
gradcon_rota.o \
gradu_cols.o \
gradu_etai.o \
gradu_form.o \
gradu_parm.o \
gradu_rota.o \
gradu_site.o \
init_xcol.o \
init_xsit.o \
majabc_vs_xform.o \
majxform_vs_abc.o \
majxyz.o \
minim_form.o \
minim_parm.o \
mocarella.o \
mod_alloc_atom.o \
mod_alloc_cavites.o \
mod_alloc_cell.o \
mod_alloc_const_elast.o \
mod_alloc_dxdydz.o \
mod_alloc_pixels.o \
mod_alloc_relax.o \
mod_alloc_vibra.o \
mod_alloc_xyznew.o \
mod_alloc_xyzold.o \
mod_cell.o \
mod_const_elast.o \
mod_contraintes.o \
mod_dim_atom.o \
mod_dim_cavites.o \
mod_dim_cell.o \
mod_dim_pixels.o \
mod_dim_relax.o \
mod_dim_vibra.o \
mod_divers.o \
mod_interac_general.o \
mod_interac_specif.o \
mod_options.o \
mod_pavage.o \
mod_potentiels.o \
mod_recentr.o \
mod_relaxation.o \
mod_saut.o \
mod_tri.o \
mod_vibration.o \
numcell.o \
phonons.o \
potin.o \
potin_specif.o \
ppvp_vps.o \
preprel.o \
prepvib.o \
prod_vps.o \
ptes_elast.o \
recentr.o \
recherche_lacune.o \
relax_conf_cols.o \
relax_conf_site.o \
reprise.o \
rescale_boite.o \
rescale_xrel.o \
reseau.o \
sauvegarde.o \
sigma_atomique.o \
sortie_rasmol.o \
sro.o \
tabvois_fresh.o \
tabvois_renew.o \
topo_loc.o \
tout_vps.o \
trajec.o \
vecteurs_saut.o \
vibra_conf_cols.o \
vibra_conf_site.o \
voisinage.o \
voisins.o \
-mIPOPT_mo_unique_name=mocarella \
-mIPOPT_object_files=/tmp/ifort3CeTEptxt \
-mIPOPT_assembly_files=/tmp/ifortmsRApctxt \
-mIPOPT_cmdline_link_new=/tmp/ifortqg7iaZtxt

ld \
--eh-frame-hdr \
-dynamic-linker \
/lib/ld-linux.so.2 \
-m \
elf_i386 \
-o \
mocarella.exec \
-L/home/bocquet/opt/intel/mkl/10.2.5.035/lib/32 \
-L/opt/soft/intel/fc/lib/ia32 \
-L/opt/soft/intel/fc/mkl/lib/32 \
-L/opt/soft/intel/fc/lib/ia32 \
-L/opt/soft/intel/fc/mkl/lib/32 \
-L/home/bocquet/opt/intel/fc/11.1.072/lib/ia32 \
-L/usr/lib/gcc/i486-linux-gnu/4.2.4/ \
-L/usr/lib/gcc/i486-linux-gnu/4.2.4/../../../../lib/ \
-L/lib/../lib/ \
-L/usr/lib/../lib/ \
-L/opt/soft/intel/fc/lib/ia32/ \
-L/opt/soft/intel/fc/mkl/lib/32/ \
-L/usr/lib/gcc/i486-linux-gnu/4.2.4/../../../ \
-L/lib/ \
-L/usr/lib \
/usr/lib/gcc/i486-linux-gnu/4.2.4/../../../../lib/crt1.o \
/usr/lib/gcc/i486-linux-gnu/4.2.4/../../../../lib/crti.o \
/usr/lib/gcc/i486-linux-gnu/4.2.4/crtbegin.o \
/home/bocquet/opt/intel/fc/11.1.072/lib/ia32/for_main.o \
alloc_atom.o \
alloc_cavites.o \
alloc_cell.o \
alloc_const_elast.o \
alloc_pixels.o \
alloc_relax.o \
alloc_vibra.o \
const_elast_deriv.o \
const_elast_numer.o \
control_depla.o \
crea_config.o \
crea_defaut.o \
dealloc_atom.o \
dealloc_cavites.o \
dealloc_cell.o \
dealloc_const_elast.o \
dealloc_pixels.o \
dealloc_relax.o \
dealloc_vibra.o \
decsol.o \
depiege.o \
detect_cavites.o \
determ.o \
entrop_deform.o \
extend_nvoismx_exact.o \
extend_nvoismx_interact.o \
extract_rijvib.o \
forcons.o \
gdr.o \
gradcon_coor.o \
gradcon_etai.o \
gradcon_form.o \
gradcon_rota.o \
gradu_cols.o \
gradu_etai.o \
gradu_form.o \
gradu_parm.o \
gradu_rota.o \
gradu_site.o \
init_xcol.o \
init_xsit.o \
majabc_vs_xform.o \
majxform_vs_abc.o \
majxyz.o \
minim_form.o \
minim_parm.o \
mocarella.o \
mod_alloc_atom.o \
mod_alloc_cavites.o \
mod_alloc_cell.o \
mod_alloc_const_elast.o \
mod_alloc_dxdydz.o \
mod_alloc_pixels.o \
mod_alloc_relax.o \
mod_alloc_vibra.o \
mod_alloc_xyznew.o \
mod_alloc_xyzold.o \
mod_cell.o \
mod_const_elast.o \
mod_contraintes.o \
mod_dim_atom.o \
mod_dim_cavites.o \
mod_dim_cell.o \
mod_dim_pixels.o \
mod_dim_relax.o \
mod_dim_vibra.o \
mod_divers.o \
mod_interac_general.o \
mod_interac_specif.o \
mod_options.o \
mod_pavage.o \
mod_potentiels.o \
mod_recentr.o \
mod_relaxation.o \
mod_saut.o \
mod_tri.o \
mod_vibration.o \
numcell.o \
phonons.o \
potin.o \
potin_specif.o \
ppvp_vps.o \
preprel.o \
prepvib.o \
prod_vps.o \
ptes_elast.o \
recentr.o \
recherche_lacune.o \
relax_conf_cols.o \
relax_conf_site.o \
reprise.o \
rescale_boite.o \
rescale_xrel.o \
reseau.o \
sauvegarde.o \
sigma_atomique.o \
sortie_rasmol.o \
sro.o \
tabvois_fresh.o \
tabvois_renew.o \
topo_loc.o \
tout_vps.o \
trajec.o \
vecteurs_saut.o \
vibra_conf_cols.o \
vibra_conf_site.o \
voisinage.o \
voisins.o \
-Bstatic \
-lifport \
-lifcore \
-limf \
-lsvml \
-Bdynamic \
-lm \
-Bstatic \
-lipgo \
-lirc \
-Bdynamic \
-lc \
-lgcc_s \
-lgcc \
-Bstatic \
-lirc_s \
-Bdynamic \
-ldl \
-lc \
/usr/lib/gcc/i486-linux-gnu/4.2.4/crtend.o \
/usr/lib/gcc/i486-linux-gnu/4.2.4/../../../../lib/crtn.o

phonons.o: In function `phonons_':
phonons.f90:(.text+0x14b6): undefined reference to `dsyev_'
prod_vps.o: In function `prod_vps_':
prod_vps.f90:(.text+0xbc9): undefined reference to `dsytrf_'
prod_vps.f90:(.text+0x1a93): undefined reference to `dpotrf_'
prod_vps.f90:(.text+0x1f78): undefined reference to `dgetrf_'
tout_vps.o: In function `tout_vps_':
tout_vps.f90:(.text+0x22d): undefined reference to `dsyev_'
rm /tmp/iforteY2xp3libgcc

rm /tmp/ifortUmzw9Pgnudirs

rm /tmp/ifort3CeTEptxt

rm /tmp/ifortmsRApctxt

rm /tmp/ifortqg7iaZtxt

rm /tmp/ifortIFT1ULlst

rm /tmp/ifort9C3KFyscript

rm /tmp/ipo_ifortnn9bUC.o

rm /tmp/ifortRBYuqlgas

rm /tmp/ifortKANSb8as_.s

rm /tmp/ifortTXliXUldashv

rm /tmp/ifortFzyqJHgnudirs

rm /tmp/ifortBacvxuarg

make: *** [mocarella.exec] Error 1




Thank you
barragan_villanueva_
Valued Contributor I
81 Views

Hi,

Acoording to the log there are no MKL libs added to linker. Maybe, something wrong in your makefile?
I can see there strage line:
LD= = $(F90)
Why two equal sings used?
LD = $(F90)

Please check setting for macro LIBS also.
jlbocquet
Beginner
81 Views

Hello I finally found my solution (IA32, static linking, sequential version of library, precision solver, use of lapack subroutines dsyev, dgetrf, dpotrf ...) I had forgotten to invoke the link with lapack and blas libraries ! (the = = sign for the load command was an error in the rewriting of the corresponding command line of my Makefile in the letter I sent you) It works now with: LIBS= -lmkl_solver_sequential \ -lmkl_lapack95 \ -lmkl_blas95 \ -lmkl_intel \ -lmkl_sequential \ -lmkl_core Thank you for your help Regards JLouis Bocquet