Page 1 of 1
xmalloc.h not found and segmentation fault
Posted: Mon Sep 24, 2012 5:35 am
by henry924
I tried to compile abinit 6.12.3 with default settings (mpi not enable) and got an error with "xmalloc.h" not found. Then I tried to download "xmalloc.h" from internet and copied to {abinit-src}/fallbacks/exports/include/. the compilation finished without error. However when i run abinit i got an "segmentation fault" error.
Tried it on both ubuntu and scientific linux and got the same error.
Can anyone help?
Thanks.
Re: xmalloc.h not found and segmentation fault
Posted: Mon Sep 24, 2012 12:57 pm
by pouillon
There should be no error because
xmalloc.h is within the sources of Abinit. The segmentation fault you get is normal because you have downloaded an incompatible version.
You'll find
xmalloc.h in
~abinit/src/02_clib/. If your problem persists, try configuring with the following option:
Code: Select all
CPPFLAGS_EXTRA='-I$(abinit_srcdir)/src/02_clib'
We'll not be able to help you more without more information about your build environment.
Re: xmalloc.h not found and segmentation fault
Posted: Tue Sep 25, 2012 5:15 am
by henry924
pouillon,
Thank you for your help. I just checked the source code directory and found there's no xmalloc.h included within the source code tree. Only xmalloc.c is under src/02_clib. The source code i used to compile abinit is from abinit-6.12.3.tar.gz, which was downloaded from abinit web site. This is quite strange. In the mean time I am downloading the source package abinit-6.12.3.tar.gz again from the web site. I will let you know whether xmalloc.h is included or not.
By the way, if it's possible could you please reply with xmalloc.h as attachment?
Thanks a lot.
Re: xmalloc.h not found and segmentation fault
Posted: Tue Sep 25, 2012 5:56 am
by henry924
pouillon,
it's confirmed that xmalloc.h is not included in the abinit-6.12.3.tar.gz from abinit website, only xmalloc.c is included.
Could you please reply with xmalloc.h as an attachment?
By the way, could anyone from abinit team check this issue?
thanks.
Re: xmalloc.h not found and segmentation fault
Posted: Tue Sep 25, 2012 5:57 pm
by gmatteo
/* xmalloc.h -- memory allocation that aborts on errors. */
/*
* Copyright (C) 2009-2012 ABINIT group (MG)
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
#ifndef _XMALLOC_H_
#define _XMALLOC_H_
extern void* xmalloc (size_t);
extern void* xrealloc (void *, size_t);
extern void xfree (void *);
#endif /* _XMALLOC_H_ */
Re: xmalloc.h not found and segmentation fault
Posted: Wed Sep 26, 2012 4:40 am
by henry924
Thank you, gmatteo.
copy xmalloc.h into src/02_clib/ then everything works OK.
This xmalloc.h nightmare wastes me around a week's time. How can xmalloc.h not be in the source code package abinit-6.12.3.tar.gz while xmalloc.c is? What a mystery! But I'll leave that to the abinit team to figure it out.
gmatteo & pouillon, thanks a lot for your help.