LAMMPS WWW Site - LAMMPS Documentation - LAMMPS Mailing List Archives
Re: [lammps-users] undefined reference to scalable_aligned_malloc, scalable_aligned_realloc, and scalable_aligned_free?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lammps-users] undefined reference to scalable_aligned_malloc, scalable_aligned_realloc, and scalable_aligned_free?


From: Axel Kohlmeyer <akohlmey@...24...>
Date: Fri, 28 Jul 2017 17:42:22 -0400



On Fri, Jul 28, 2017 at 4:22 PM, Patrick Goetz <pgoetz@...7023...> wrote:
Hi -

I'm trying to compile LAMMPS using Makefile_intel_cpu_mpich and have run in to an error with the linker:

memory.o: In function `LAMMPS_NS::Memory::smalloc(long, char const*)':
/root/lammps-31Mar17/src/Obj_intel_cpu_mpich/../memory.cpp:51: undefined reference to `scalable_aligned_malloc'
memory.o: In function `LAMMPS_NS::Memory::srealloc(void*, long, char const*)':
/root/lammps-31Mar17/src/Obj_intel_cpu_mpich/../memory.cpp:81: undefined reference to `scalable_aligned_realloc'
memory.o: In function `LAMMPS_NS::Memory::sfree(void*)':
/root/lammps-31Mar17/src/Obj_intel_cpu_mpich/../memory.cpp:111: undefined reference to `scalable_aligned_free'
/root/lammps-31Mar17/src/Obj_intel_cpu_mpich/../memory.cpp:111: undefined reference to `scalable_aligned_free'
make[1]: *** [../lmp_intel_cpu_mpich] Error 1
make[1]: Leaving directory `/root/lammps-31Mar17/src/Obj_intel_cpu_mpich'
make: *** [intel_cpu_mpich] Error 2


Some details.  This is a cluster environment with modules, so I loaded both the intel and mpich modules before initiating `make intel_cpu_mpich`:

[root@...7024... src]# module list

Currently Loaded Modules:
  1) intel/17.0.1.132   2) mpich/3.2

​you are compiling without need as root. this is a very, very, VERY bad idea. there is no need for it, and any typo, misconfiguration, or bug in a script that is called during setup or compilation can result in a complete disaster and ruin the entire setup (e.g. by rm -rf /${SOME_VARIABLE} becoming: rm -rf /) and many other, similar problems. best practice is to create an "install" users and make that use owner of the directory tree where you install your environment modules.

 


I did make a minor edit to the Makefile.  On an earlier run I got hundreds of warning messages about -no-offload being deprecated and that I should use -qno-offload instead, so I changed this in the CCFLAGS entry in the Makefile:

-
CCFLAGS =   -g -qopenmp -DLAMMPS_MEMALIGN=64 -no-offload \
                -fno-alias -ansi-alias -restrict $(OPTFLAGS)
+
CCFLAGS =   -g -qopenmp -DLAMMPS_MEMALIGN=64 -qno-offload \
                -fno-alias -ansi-alias -restrict $(OPTFLAGS)


Also, the users requested quite a number of add on packages, although I don't think this is related to this issue.

Looking at memory.cpp, it looks like the problem comes from some improperly defined identifiers?

#if defined(LMP_USER_INTEL) && defined(__INTEL_COMPILER)
#ifndef LMP_INTEL_NO_TBB
#define LMP_USE_TBB_ALLOCATOR
#include "tbb/scalable_allocator.h"
#else
#include <malloc.h>
#endif
#endif


​try linking with -ltbbmalloc_proxy​

if that fails, look up the proper linker flags for linking with the thread optimized malloc bundled with your TBB library.

axel.


 
We have a floating license for the Intel Parallel Studio XE Composer Edition, which does NOT include Intel's MPI implementation, but this is why I explicitly selected the intel_cpu_mpich Makefile.

Any help with this would be appreciated.

Thanks.






------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
lammps-users mailing list
lammps-users@...655....net
https://lists.sourceforge.net/lists/listinfo/lammps-users



--
Dr. Axel Kohlmeyer  akohlmey@...92......  http://goo.gl/1wk0
College of Science & Technology, Temple University, Philadelphia PA, USA
International Centre for Theoretical Physics, Trieste. Italy.