This thread is locked.Only browsing is available.
Top Page > Browsing
Openmx linking problem
Date: 2008/09/30 00:40
Name: Mauro Sgroi   <maurosgroi@yahoo.it>

Dear all,
my name is Mauro Sgroi and I'm trying to install OpenMx on my Linux
workstation to perform some DFT calculation on nanoclusters.
I can compile the code with gcc and link it to a static ATLAS library
containing the full lapack support.
If I try to link to the dynamic version of the same library I get the
following error:

mpicc -O3 -mtune=native -m64 -ffast-math -fopenmp -I/opt/fftw-3.1.2/include openmx.o openmx_common.o Input_std.o Inputtools.o init.o LU_inverse.o ReLU_inverse.o truncation.o Find_ApproxFactN.o readfile.o FT_PAO.o FT_NLP.o FT_ProExpn_VNA.o FT_VNA.o FT_ProductPAO.o Hamiltonian_Cluster.o Overlap_Cluster.o Hamiltonian_Band.o Overlap_Band.o Hamiltonian_Cluster_NC.o Hamiltonian_Band_NC.o Hamiltonian_Cluster_SO.o Get_OneD_HS_Col.o SetPara_DFT.o XC_Ceperly_Alder.o XC_CA_LSDA.o XC_PW91C.o XC_PBE.o XC_EX.o DFT.o Mixing_DM.o Force.o Poisson.o Cluster_DFT.o Cluster_DFT_Dosout.o Band_DFT_Col.o Band_DFT_NonCol.o Band_DFT_kpath.o Band_DFT_MO.o Band_DFT_Dosout.o Set_Density_Grid.o Set_Orbitals_Grid.o Set_Aden_Grid.o Gauss_Legendre.o zero_cfrac.o xyz2spherical.o AngularF.o RadialF.o Dr_RadialF.o PhiF.o VNAF.o Dr_VNAF.o VH_AtomF.o Dr_VH_AtomF.o Dr_AtomicDenF.o RF_BesselF.o QuickSort.o Nonlocal_RadialF.o AtomicDenF.o Mulliken_Charge.o Occupation_Number_LDA_U.o Eff_Hub_Pot.o EulerAngle_Spin.o Smoothing_Func.o Orbital_Moment.o AtomicPCCF.o Dr_AtomicPCCF.o Pot_NeutralAtom.o Simple_Mixing_DM.o DIIS_Mixing_DM.o GR_Pulay_DM.o Kerker_Mixing_Rhok.o DIIS_Mixing_Rhok.o Total_Energy.o Contract_Hamiltonian.o Contract_iHNL.o Cont_Matrix0.o Cont_Matrix1.o Cont_Matrix2.o Cont_Matrix3.o Opt_Contraction.o Initial_CntCoes.o Set_XC_Grid.o Get_Orbitals.o Get_dOrbitals.o Get_Cnt_Orbitals.o Get_Cnt_dOrbitals.o Gaunt.o Find_CGrids.o MD_pac.o RestartFileDFT.o Output_CompTime.o Merge_LogFile.o Make_FracCoord.o Make_InputFile_with_FinalCoord.o Divide_Conquer.o GDivide_Conquer.o Krylov.o Krylov_Dosout.o Divide_Conquer_Dosout.o GDivide_Conquer_Dosout.o Eigen_lapack.o EigenBand_lapack.o Eigen_PReHH.o BroadCast_ReMatrix.o Eigen_PHH.o BroadCast_ComplexMatrix.o lapack_dstedc1.o lapack_dstedc2.o lapack_dstegr1.o lapack_dstegr2.o lapack_dstevx1.o lapack_dstevx2.o lapack_dsteqr1.o Nonlocal_Basis.o Set_OLP_Kin.o Set_Nonlocal.o Set_ProExpn_VNA.o Set_Hamiltonian.o Set_Vpot.o Voronoi_Charge.o Voronoi_Orbital_Moment.o Fuzzy_Weight.o dampingF.o deri_dampingF.o Spherical_Bessel.o iterout.o iterout_md.o Allocate_Arrays.o Free_Arrays.o Init_List_YOUSO.o outputfile1.o malloc_multidimarray.o PrintMemory.o PrintMemory_Fix.o dtime.o OutData.o init_alloc_first.o File_CntCoes.o SCF2File.o mimic_mpi.o mimic_omp.o Make_Comm_Worlds.o Set_Allocate_Atom2CPU.o Cutoff.o Generating_MP_Special_Kpt.o setup_CPU_group.o Maketest.o Runtest.o Memory_Leak_test.o Force_test.o Show_DFT_DATA.o TRAN_Allocate.o TRAN_DFT.o TRAN_DFT_Dosout.o TRAN_Apply_Bias2e.o TRAN_FFT_interpolation3c.o TRAN_RestartFile.o TRAN_Calc_CentGreen.o TRAN_Input_std.o TRAN_Set_CentOverlap.o TRAN_Calc_CentGreenLesser.o TRAN_Calc_GC_LorR.o TRAN_Input_std_Atoms.o TRAN_Set_Electrode_Grid.o TRAN_Calc_GridBound.o TRAN_Interp_ElectrodeDensity_Grid.o TRAN_Set_IntegPath.o TRAN_Output_HKS.o TRAN_Set_MP.o TRAN_Calc_SelfEnergy.o TRAN_Output_Trans_HS.o TRAN_Set_PathEnergyStr.o TRAN_Calc_SurfGreen.o TRAN_Output_Transmission.o TRAN_Set_SurfOverlap.o TRAN_Overwrite_Densitygrid.o TRAN_Set_Value.o TRAN_Calc_VHartree_G0.o TRAN_Overwrite_V2.o TRAN_adjust_Grid_Origin.o TRAN_Calc_VHartree_Gnon0.o TRAN_Poisson.o TRAN_adjust_Ngrid.o TRAN_Print.o TRAN_Print_Grid.o Lapack_LU_inverse.o TRAN_Distribute_Node.o TRAN_Output_HKS_Write_Grid.o TRAN_Credit.o TRAN_Check_Region_Lead.o TRAN_Check_Region.o RecursionS_H.o -L/opt/fftw-3.1.2/lib -lfftw3 -L/opt/atlas/lib/shared -latlas -lgfortran -lm -o openmx
/usr/bin/ld: openmx: hidden symbol `__powidf2' in /usr/lib/gcc/x86_64-linux-gnu/4.3.1/libgcc.a(_powidf2.o) is referenced by DSO
/usr/bin/ld: final link failed: Nonrepresentable section on output
collect2: ld returned 1 exit status
make: *** [openmx] Error 1

Is this a compiler bug or is there a specific reason to use only static libraries?
Thanks a lot and best regards,
Mauro Sgroi.
Italy.

メンテ
Page: [1]

Re: Openmx linking problem ( No.1 )
Date: 2008/10/01 01:13
Name: Mauro Sgroi  <maurosgroi@yahoo.it>

Dear all,
after two days of trials I succeded to compile with dynamic atlas and fftw3 libraries.
The point is to link the final excutable with mpif90 (gfortran) instead of mpicc.
I modified slightly the makefile as follows:


CC=mpicc -O3 -mtune=native -m64 -ffast-math -fopenmp -I/opt/fftw-3.1.2/include -fPIC
LD=mpif90 -O3 -mtune=native -m64 -ffast-math -fopenmp -I/opt/fftw-3.1.2/include -fPIC

LIB=-L/opt/fftw-3.1.2/lib -lfftw3 -L/opt/atlas/lib -latlas -lgfortran -rdynamic

The option -rdynamic is importan, as you get a segmentation fault without it.


Moreover the linker has been modiefied as follows:


openmx: $(OBJS)

$(LD) $(OBJS) $(STACK) $(LIB) -lm -o openmx


LD was placed instead of CC.


The obtained excutable run faster than the statically linked one and passed all the tests.
I hope this information can be useful to someone.
Best regards,
Mauro Sgroi.


メンテ

Page: [1]