xmalloc.h not found and segmentation fault

option, parallelism,...

Moderators: fgoudreault, mcote

Forum rules
Please have a look at ~abinit/doc/config/build-config.ac in the source package for detailed and up-to-date information about the configuration of Abinit 8 builds.
For a video explanation on how to build Abinit 7.x for Linux, please go to: http://www.youtube.com/watch?v=DppLQ-KQA68.
IMPORTANT: when an answer solves your problem, please check the little green V-like button on its upper-right corner to accept it.
Locked
henry924
Posts: 6
Joined: Mon Sep 24, 2012 5:24 am

xmalloc.h not found and segmentation fault

Post by henry924 » Mon Sep 24, 2012 5:35 am

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.

User avatar
pouillon
Posts: 651
Joined: Wed Aug 19, 2009 10:08 am
Location: Spain
Contact:

Re: xmalloc.h not found and segmentation fault

Post by pouillon » Mon Sep 24, 2012 12:57 pm

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.
Yann Pouillon
Simune Atomistics
Donostia-San Sebastián, Spain

henry924
Posts: 6
Joined: Mon Sep 24, 2012 5:24 am

Re: xmalloc.h not found and segmentation fault

Post by henry924 » Tue Sep 25, 2012 5:15 am

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.

henry924
Posts: 6
Joined: Mon Sep 24, 2012 5:24 am

Re: xmalloc.h not found and segmentation fault

Post by henry924 » Tue Sep 25, 2012 5:56 am

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.

User avatar
gmatteo
Posts: 291
Joined: Sun Aug 16, 2009 5:40 pm

Re: xmalloc.h not found and segmentation fault

Post by gmatteo » Tue Sep 25, 2012 5:57 pm

/* 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_ */

henry924
Posts: 6
Joined: Mon Sep 24, 2012 5:24 am

Re: xmalloc.h not found and segmentation fault

Post by henry924 » Wed Sep 26, 2012 4:40 am

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.

Locked