Error during compiling a custom makefile

Bader charge density analysis

Moderator: moderators

Post Reply
andyrox
Posts: 5
Joined: Mon Nov 25, 2013 10:43 am

Error during compiling a custom makefile

Post by andyrox »

Hi all,

I'm new of Bader. I'm trying to compile a 32bit version of the bader executable on my Ubuntu Precise Pangolin 32 bit. (gfortran --version
GNU Fortran (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3)

I used the following makefile
************************************
.SUFFIXES: .f90

FC = gfortran

FFLAGS = -O2

LINK =

OBJS = kind_mod.o \
matrix_mod.o \
ions_mod.o \
options_mod.o \
charge_mod.o \
chgcar_mod.o \
cube_mod.o \
io_mod.o \
bader_mod.o \
voronoi_mod.o \
multipole_mod.o

%.o %.mod : %.f90
$(FC) $(FFLAGS) -c $*.f90

bader: $(OBJS) main.o
rm -f bader
$(FC) $(LINK) main.o -o $@ $(OBJS)

dist: bader
tar -cf bader_lnx_32.tar bader
gzip -9 bader_lnx_32.tar

clean:
rm -f *.o *.mod bader bader_lnx_32.tar.gz
**********************************

I obtained a executable file that I tested with "$ sh bader -h", but I got the following message error
*****************
bader: 1: bader: Syntax error: word unexpected (expecting ")")
*****************

Can someone help me?
graeme
Site Admin
Posts: 2291
Joined: Tue Apr 26, 2005 4:25 am
Contact:

Re: Error during compiling a custom makefile

Post by graeme »

You shouldn't run it with sh; it is an executable, not a shell script.
andyrox
Posts: 5
Joined: Mon Nov 25, 2013 10:43 am

Re: Error during compiling a custom makefile

Post by andyrox »

[quote="graeme"]You shouldn't run it with sh; it is an executable, not a shell script.[/quote]

Thank you! Now it works...

Another question: how can I calculate the Bader atomic charge from the output present in the ACF.dat file?!? For example: for the N atom in acridine I got the following number: 7.69. How can I get the related atomic charge from it? Do I simply need to subtract the number of electrons of neutral nitrogen (7)? So: 7.69-7 = 0.69?

Thank you in advance!

Andrea.
graeme
Site Admin
Posts: 2291
Joined: Tue Apr 26, 2005 4:25 am
Contact:

Re: Error during compiling a custom makefile

Post by graeme »

Yes, that's correct.
Post Reply