[lammps-users] Compiling LAMMPS on Cray XE6 with PGI compiler

We have a new Cray XE6 system that I'm trying to get LAMMPS to compile on with the PGI compilers, but it seems that PGI doesn't define certain things like atoll. Any suggestions on how I might get LAMMPS compiled on this system. Attached are my compilation output and the Makefile I'm using. Thanks!

Makefile.beagle.txt (2.53 KB)

pgi-compile.out (17.2 KB)

PGP.sig (203 Bytes)

We have a new Cray XE6 system that I'm trying to get LAMMPS to compile
on with the PGI compilers, but it seems that PGI doesn't define
certain things like atoll. Any suggestions on how I might get LAMMPS

please update to the very latest LAMMPS version and let us know
how that works. there have been changes to increase the portability.

compiled on this system. Attached are my compilation output and the
Makefile I'm using. Thanks!

is there a reason that you cannot use gcc?
it usually outruns PGI on c++ codes.

cheers,
    axel.

We have a new Cray XE6 system that I'm trying to get LAMMPS to compile
on with the PGI compilers, but it seems that PGI doesn't define
certain things like atoll. Any suggestions on how I might get LAMMPS

please update to the very latest LAMMPS version and let us know
how that works. there have been changes to increase the portability.

Will do.

compiled on this system. Attached are my compilation output and the
Makefile I'm using. Thanks!

is there a reason that you cannot use gcc?
it usually outruns PGI on c++ codes.

The default compilation environment on the Cray is PGI so I wanted to provide a version that would work in that environment for people new to the Cray.

Looks like the same issue:

CC -I../../lib -I../../lib/poems -I../../lib/reax -fast -DLAMMPS_GZIP -I/opt/cray/mpt/5.2.0/xt/gemini/mpich2-pgi/include -DFFT_FFTW -I/opt/fftw/2.1.5.2/include -M update.cpp > update.d
"update.cpp", line 281: error: identifier "atoll" is undefined
    ntimestep = ATOBIGINT(arg[0]);
                ^

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Looks like the same issue:

CC -I../../lib -I../../lib/poems -I../../lib/reax -fast -DLAMMPS_GZIP -I/opt/cray/mpt/5.2.0/xt/gemini/mpich2-pgi/include -DFFT_FFTW -I/opt/fftw/2.1.5.2/include -M update.cpp > update.d
"update.cpp", line 281: error: identifier "atoll" is undefined
ntimestep = ATOBIGINT(arg[0]);
^

i am not overly surprised. you should check whether there is a flag
in the PGI compiler or a define that needs to be set that turns
on c99 compatibility.

i don't know any details about the XE type crays, but if they run
the CNL kernels on the nodes, then it shouldn't matter whether
you compile with gcc or not, since the binaries would be static
anyways.

cheers,
    axel.

The -c99 option didn't make much difference. If I get complaints about a PGI version not existing, I'll make sure they're aware performance is much better for the GNU version anyway. Thanks for all your help!

hi!

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

The -c99 option didn't make much difference. If I get complaints about a PGI version not existing, I'll make sure they're aware performance is much better for the GNU version anyway. Thanks for all your help!

just made some tests on a machine with PGI installed.
there seems a workaround, at least for linux boxes. if you
load the src/lmptype.h file into a text editor and change
the code starting from line 61 from:

#define ATOTAGINT atoi
#define ATOBIGINT atoll

to:

#define ATOTAGINT atoi
#define ATOBIGINT atoll

// fixups for broken compilers
// 1) PGI does not have atoll() but long long and long are 64bit on linux.
#if defined(__PGI) && defined(__linux)
#undef ATOBIGINT
#define ATOBIGINT atol
#endif

cheers,
     axel.

Much closer! It actually attempts to link before bailing:

CC -lstdc++ -L../../lib/meam -L../../lib/poems -L../../lib/reax -L../../lib/atc -pgf90libs -L/opt/cray/mpt/5.2.0/xt/gemini/mpich2-pgi/lib -L/opt/fftw/2.1.5.2/lib angle_charmm.o angle_cosine.o angle_cosine_delta.o angle_cosine_periodic.o angle_cosine_squared.o angle.o angle_harmonic.o angle_hybrid.o angle_table.o atom.o atom_vec_angle.o atom_vec_atomic.o atom_vec_bond.o atom_vec_charge.o atom_vec.o atom_vec_full.o atom_vec_hybrid.o atom_vec_molecular.o bond.o bond_fene.o bond_fene_expand.o bond_harmonic.o bond_hybrid.o bond_morse.o bond_nonlinear.o bond_quartic.o bond_table.o change_box.o comm.o compute_angle_local.o compute_atom_molecule.o compute_bond_local.o compute_centro_atom.o compute_cna_atom.o compute_com.o compute_com_molecule.o compute_coord_atom.o compute.o compute_dihedral_local.o compute_displace_atom.o compute_erotate_sphere.o compute_group_group.o compute_gyration.o compute_gyration_molecule.o compute_heat_flux.o compute_improper_local.o compute_ke_atom.o compute_ke.o compute_msd.o compute_msd_molecule.o compute_pair.o compute_pair_local.o compute_pe_atom.o compute_pe.o compute_pressure.o compute_property_atom.o compute_property_local.o compute_property_molecule.o compute_rdf.o compute_reduce.o compute_reduce_region.o compute_stress_atom.o compute_temp_com.o compute_temp.o compute_temp_deform.o compute_temp_partial.o compute_temp_profile.o compute_temp_ramp.o compute_temp_region.o compute_temp_sphere.o compute_ti.o create_atoms.o create_box.o delete_atoms.o delete_bonds.o dihedral_charmm.o dihedral.o dihedral_harmonic.o dihedral_helix.o dihedral_hybrid.o dihedral_multi_harmonic.o dihedral_opls.o displace_atoms.o displace_box.o domain.o dump_atom.o dump_cfg.o dump.o dump_custom.o dump_dcd.o dump_local.o dump_xyz.o error.o ewald.o fft3d.o fft3d_wrap.o finish.o fix_adapt.o fix_addforce.o fix_ave_atom.o fix_ave_correlate.o fix_aveforce.o fix_ave_histo.o fix_ave_spatial.o fix_ave_time.o fix_bond_break.o fix_bond_create.o fix_bond_swap.o fix_box_relax.o fix.o fix_deform.o fix_deposit.o fix_drag.o fix_dt_reset.o fix_efield.o fix_enforce2d.o fix_evaporate.o fix_external.o fix_gravity.o fix_heat.o fix_indent.o fix_langevin.o fix_lineforce.o fix_minimize.o fix_momentum.o fix_move.o fix_nh.o fix_nh_sphere.o fix_nph.o fix_nph_sphere.o fix_npt.o fix_npt_sphere.o fix_nve.o fix_nve_limit.o fix_nve_noforce.o fix_nve_sphere.o fix_nvt.o fix_nvt_sllod.o fix_nvt_sphere.o fix_orient_fcc.o fix_planeforce.o fix_press_berendsen.o fix_print.o fix_qeq_comb.o fix_read_restart.o fix_recenter.o fix_respa.o fix_rigid.o fix_rigid_nve.o fix_rigid_nvt.o fix_setforce.o fix_shake.o fix_shear_history.o fix_spring.o fix_spring_rg.o fix_spring_self.o fix_store_force.o fix_store_state.o fix_temp_berendsen.o fix_temp_rescale.o fix_thermal_conductivity.o fix_tmd.o fix_ttm.o fix_viscosity.o fix_viscous.o fix_wall.o fix_wall_harmonic.o fix_wall_lj126.o fix_wall_lj93.o fix_wall_reflect.o fix_wall_region.o force.o group.o improper.o improper_cvff.o improper_harmonic.o improper_hybrid.o improper_umbrella.o input.o integrate.o irregular.o kspace.o lammps.o lattice.o library.o main.o memory.o min_cg.o min.o min_fire.o min_hftn.o minimize.o min_linesearch.o min_quickmin.o min_sd.o modify.o neigh_bond.o neighbor.o neigh_derive.o neigh_full.o neigh_gran.o neigh_half_bin.o neigh_half_multi.o neigh_half_nsq.o neigh_list.o neigh_request.o neigh_respa.o neigh_stencil.o output.o pack.o pair_airebo.o pair_born_coul_long.o pair_born.o pair_buck_coul_cut.o pair_buck_coul_long.o pair_buck.o pair_comb.o pair_coul_cut.o pair_coul_debye.o pair_coul_long.o pair.o pair_dpd.o pair_dpd_tstat.o pair_eam_alloy.o pair_eam.o pair_eam_fs.o pair_eim.o pair_gauss.o pair_hbond_dreiding_lj.o pair_hbond_dreiding_morse.o pair_hybrid.o pair_hybrid_overlay.o pair_lj96_cut.o pair_lj_charmm_coul_charmm.o pair_lj_charmm_coul_charmm_implicit.o pair_lj_charmm_coul_long.o pair_lj_cut_coul_cut.o pair_lj_cut_coul_debye.o pair_lj_cut_coul_long.o pair_lj_cut_coul_long_tip4p.o pair_lj_cut.o pair_lj_expand.o pair_lj_gromacs_coul_gromacs.o pair_lj_gromacs.o pair_lj_smooth.o pair_morse.o pair_soft.o pair_sw.o pair_table.o pair_tersoff.o pair_tersoff_zbl.o pair_yukawa.o pppm.o pppm_tip4p.o random_mars.o random_park.o read_data.o read_restart.o region_block.o region_cone.o region.o region_cylinder.o region_intersect.o region_plane.o region_prism.o region_sphere.o region_union.o remap.o remap_wrap.o replicate.o respa.o run.o set.o special.o thermo.o timer.o universe.o update.o variable.o velocity.o verlet.o write_restart.o -lmpich -lpthread -ldfftw -lpoems -lmeam -lreax -latc -o ../lmp_beagle
fix_adapt.o: In function `LAMMPS_NS::FixAdapt::setup_pre_force( (int))':
/soft/build/lammps-18Feb11/src/Obj_beagle/./fix_adapt.cpp:330: undefined reference to `addstep_compute__Q2_9LAMMPS_NS6ModifyFL'
fix_adapt.o: In function `LAMMPS_NS::FixAdapt::pre_force( (int))':
/soft/build/lammps-18Feb11/src/Obj_beagle/./fix_adapt.cpp:330: undefined reference to `addstep_compute__Q2_9LAMMPS_NS6ModifyFL'
fix_adapt.o: In function `LAMMPS_NS::FixAdapt::change_settings( (void))':
/soft/build/lammps-18Feb11/src/Obj_beagle/./fix_adapt.cpp:333: undefined reference to `addstep_compute__Q2_9LAMMPS_NS6ModifyFL'
fix_addforce.o: In function `LAMMPS_NS::FixAddForce::post_force( (int))':
/soft/build/lammps-18Feb11/src/Obj_beagle/./fix_addforce.cpp:272: undefined reference to `addstep_compute__Q2_9LAMMPS_NS6ModifyFL'
fix_aveforce.o: In function `LAMMPS_NS::FixAveForce::post_force( (int))':
/soft/build/lammps-18Feb11/src/Obj_beagle/./fix_aveforce.cpp:222: undefined reference to `addstep_compute__Q2_9LAMMPS_NS6ModifyFL'
fix_box_relax.o: In function `LAMMPS_NS::FixBoxRelax::min_energy( (double *))':
/soft/build/lammps-18Feb11/src/Obj_beagle/./fix_box_relax.cpp:671: undefined reference to `addstep__Q2_9LAMMPS_NS7ComputeFL'
fix_efield.o: In function `LAMMPS_NS::FixEfield::post_force( (int))':
/soft/build/lammps-18Feb11/src/Obj_beagle/./fix_efield.cpp:196: undefined reference to `addstep_compute__Q2_9LAMMPS_NS6ModifyFL'
fix_indent.o: In function `LAMMPS_NS::FixIndent::post_force( (int))':
/soft/build/lammps-18Feb11/src/Obj_beagle/./fix_indent.cpp:346: undefined reference to `addstep_compute__Q2_9LAMMPS_NS6ModifyFL'
fix_move.o: In function `LAMMPS_NS::FixMove::initial_integrate( (int))':
/soft/build/lammps-18Feb11/src/Obj_beagle/./fix_move.cpp:602: undefined reference to `addstep_compute__Q2_9LAMMPS_NS6ModifyFL'
fix_nh.o: In function `LAMMPS_NS::FixNH::setup( (int))':
/soft/build/lammps-18Feb11/src/Obj_beagle/./fix_nh.cpp:863: undefined reference to `addstep__Q2_9LAMMPS_NS7ComputeFL'
fix_nh.o: In function `LAMMPS_NS::FixNH::initial_integrate( (int))':
/soft/build/lammps-18Feb11/src/Obj_beagle/./fix_nh.cpp:863: undefined reference to `addstep__Q2_9LAMMPS_NS7ComputeFL'
fix_nh.o: In function `LAMMPS_NS::FixNH::final_integrate( (void))':
/soft/build/lammps-18Feb11/src/Obj_beagle/./fix_nh.cpp:863: undefined reference to `addstep__Q2_9LAMMPS_NS7ComputeFL'
fix_nh.o: In function `initial_integrate_respa__Q2_9LAMMPS_NS5FixNHFiN21':
/soft/build/lammps-18Feb11/src/Obj_beagle/./fix_nh.cpp:863: undefined reference to `addstep__Q2_9LAMMPS_NS7ComputeFL'
fix_press_berendsen.o: In function `LAMMPS_NS::FixPressBerendsen::setup( (int))':
/soft/build/lammps-18Feb11/src/Obj_beagle/./fix_press_berendsen.cpp:332: undefined reference to `addstep__Q2_9LAMMPS_NS7ComputeFL'
fix_press_berendsen.o:/soft/build/lammps-18Feb11/src/Obj_beagle/./fix_press_berendsen.cpp:370: more undefined references to `addstep__Q2_9LAMMPS_NS7ComputeFL' follow
fix_print.o: In function `LAMMPS_NS::FixPrint::__ct( (LAMMPS_NS::LAMMPS *, int, char **))':
/soft/build/lammps-18Feb11/src/Obj_beagle/./fix_print.cpp:95: undefined reference to `addstep_compute_all__Q2_9LAMMPS_NS6ModifyFL'
fix_print.o: In function `LAMMPS_NS::FixPrint::end_of_step( (void))':
/soft/build/lammps-18Feb11/src/Obj_beagle/./fix_print.cpp:127: undefined reference to `addstep_compute__Q2_9LAMMPS_NS6ModifyFL'
fix_setforce.o: In function `LAMMPS_NS::FixSetForce::post_force( (int))':
/soft/build/lammps-18Feb11/src/Obj_beagle/./fix_setforce.cpp:257: undefined reference to `addstep_compute__Q2_9LAMMPS_NS6ModifyFL'
fix_store_state.o: In function `LAMMPS_NS::FixStoreState::end_of_step( (void))':
/soft/build/lammps-18Feb11/src/Obj_beagle/./fix_store_state.cpp:467: undefined reference to `addstep_compute__Q2_9LAMMPS_NS6ModifyFL'
fix_wall.o: In function `LAMMPS_NS::FixWall::post_force( (int))':
/soft/build/lammps-18Feb11/src/Obj_beagle/./fix_wall.cpp:243: undefined reference to `addstep_compute__Q2_9LAMMPS_NS6ModifyFL'
fix_wall_reflect.o: In function `LAMMPS_NS::FixWallReflect::post_integrate( (void))':
/soft/build/lammps-18Feb11/src/Obj_beagle/./fix_wall_reflect.cpp:224: undefined reference to `addstep_compute__Q2_9LAMMPS_NS6ModifyFL'
min_cg.o: In function `LAMMPS_NS::MinCG::iterate( (int))':
/soft/build/lammps-18Feb11/src/Obj_beagle/./min_cg.cpp:180: undefined reference to `LAMMPS_NS::Output::write( (long))'
min.o: In function `LAMMPS_NS::Min::run( (int))':
/soft/build/lammps-18Feb11/src/Obj_beagle/./min.cpp:378: undefined reference to `LAMMPS_NS::Output::write( (long))'
min_fire.o: In function `LAMMPS_NS::MinFire::iterate( (int))':
/soft/build/lammps-18Feb11/src/Obj_beagle/./min_fire.cpp:266: undefined reference to `LAMMPS_NS::Output::write( (long))'
min_hftn.o: In function `execute_hftn___Q2_9LAMMPS_NS7MinHFTNFbdT2RdT4':
/soft/build/lammps-18Feb11/src/Obj_beagle/./min_hftn.cpp:537: undefined reference to `LAMMPS_NS::Output::write( (long))'
min_quickmin.o: In function `LAMMPS_NS::MinQuickMin::iterate( (int))':
/soft/build/lammps-18Feb11/src/Obj_beagle/./min_quickmin.cpp:233: undefined reference to `LAMMPS_NS::Output::write( (long))'
min_sd.o:/soft/build/lammps-18Feb11/src/Obj_beagle/./min_sd.cpp:101: more undefined references to `LAMMPS_NS::Output::write( (long))' follow
output.o: In function `LAMMPS_NS::Output::setup( (int))':
/soft/build/lammps-18Feb11/src/Obj_beagle/./output.cpp:186: undefined reference to `addstep_compute__Q2_9LAMMPS_NS6ModifyFL'
/soft/build/lammps-18Feb11/src/Obj_beagle/./output.cpp:187: undefined reference to `addstep_compute_all__Q2_9LAMMPS_NS6ModifyFL'
/soft/build/lammps-18Feb11/src/Obj_beagle/./output.cpp:228: undefined reference to `addstep_compute__Q2_9LAMMPS_NS6ModifyFL'
output.o: In function `write__Q2_9LAMMPS_NS6OutputFL':
/soft/build/lammps-18Feb11/src/Obj_beagle/./output.cpp:261: undefined reference to `addstep_compute__Q2_9LAMMPS_NS6ModifyFL'
/soft/build/lammps-18Feb11/src/Obj_beagle/./output.cpp:305: undefined reference to `addstep_compute__Q2_9LAMMPS_NS6ModifyFL'
respa.o: In function `LAMMPS_NS::Respa::setup( (void))':
/soft/build/lammps-18Feb11/src/Obj_beagle/./respa.cpp:339: undefined reference to `ev_set__Q2_9LAMMPS_NS9IntegrateFL'
respa.o: In function `LAMMPS_NS::Respa::setup_minimal( (int))':
/soft/build/lammps-18Feb11/src/Obj_beagle/./respa.cpp:408: undefined reference to `ev_set__Q2_9LAMMPS_NS9IntegrateFL'
respa.o: In function `LAMMPS_NS::Respa::run( (int))':
/soft/build/lammps-18Feb11/src/Obj_beagle/./respa.cpp:450: undefined reference to `ev_set__Q2_9LAMMPS_NS9IntegrateFL'
verlet.o: In function `LAMMPS_NS::Verlet::run( (int))':
/soft/build/lammps-18Feb11/src/Obj_beagle/./verlet.cpp:283: undefined reference to `LAMMPS_NS::Output::write( (long))'
make[1]: *** [../lmp_beagle] Error 2
make[1]: Leaving directory `/soft/build/lammps-18Feb11/src/Obj_beagle'
make: *** [beagle] Error 2

did you do a "make clean-beagle" ?

this looks like you have mixed objects from different compilers.

axel.

I did a make clean-all before building.

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I did a make clean-all before building.

well, i cannot reproduce your build error on the cray xt5
systems that i have access to. ...and i tried different versions
of the PGI compiler, too. in all cases the hack to lmptype.h
to work around the (non-standard!) lack of atoll was sufficient
to get a complete build.

axel.

Alrighty. I'll keep hacking at it and figure out what's broken in our environment.

The only thing I have to add to this thread is this comment in lmptype.h

// NOTE: if your machine/MPI does not support "long long" ints,
// but only "long" ints, then you will need to change
// MPI_LONG_LONG to MPI_LONG, and atoll to atol

I suggest you follow this, and see if you can build. I an not keen
on adding a bunch of machine/compiler dependency checks to that
file. But if an edit can be made that allows a user to pass in a compiler
switch, like -DLMP_USE_ATOL, and it then selects atol instead of atoll
that would be OK.

Steve