[lammps-users] Building LAMMPS under MS Windows, ERROR: 'pclose' : undeclared identifier

Hi, LAMMPS users,

Thanks to the tips of “compiling LAMMPS under MS Windows”, I have almost built LAMMPS.exe.
But I met a build error which reads as follows;

C:\LAMMPS\dump.cpp(110) : error C2065: ‘pclose’ : undeclared identifier

It seems that VC doesn’t understand pclose function.
I really wonder how you’ve solved this problem if you built LAMMPS under MS windows.
Any advice would be appreciated,

Thanks in advance.

Sincerely yours,
Kelvin.

Hi, LAMMPS users,

Thanks to the tips of "compiling LAMMPS under MS Windows", I have
almost built LAMMPS.exe.
But I met a build error which reads as follows;

C:\LAMMPS\dump.cpp(110) : error C2065: 'pclose' : undeclared
identifier

ahhhh... another infamous incompatibility of windows
c/++ compilers versus the rest of the world.
you can change the call to pclose(3) to fclose(3)
and it should compiled.

It seems that VC doesn't understand pclose function.

very annoying, indeed.

I really wonder how you've solved this problem if you built LAMMPS
under MS windows.

because the lammps source was only recently corrected
from using fclose(3) to pclose(3) and nobody remembered
or noticed that this would cause incompatibilities on
windows.

cheers,
   axel.

Thanks to Alex’s useful help, I finally succeeded in compiling (building the executible).
Still long way to go!
I run the example files (in.crack, in.shear, etc) for test and after several seconds running, they all failed.
The error messages are like this;

Debug Error!
Program: C\LAMMPS\LAMMPS.exe
DAMAGE: after Normal block (#311) at 0x00797640.

Other examples also failed with similar error messages.
Do you guys think this is VC problem or something else?
Because I’ve been so much tamed by MS, I even don’t dream to use UNIX like things.
Very much depressed.

kelvin,

I run the example files (in.crack, in.shear, etc) for test and after
several seconds running, they all failed.
The error messages are like this;

Debug Error!
Program: C\LAMMPS\LAMMPS.exe
DAMAGE: after Normal block (#311) at 0x00797640.

Other examples also failed with similar error messages.

this looks like something got miscompiled or some ABI of a
library doesn't math its definition in the headers.

you should compile with debug info included and run that
executable in the debugger and see where the error comes
from. it looks like some memory corruptions, so it could
be that the original error is not where the executable
bails out.

Do you guys think this is VC problem or something else?
Because I've been so much tamed by MS, I even don't dream to use UNIX
like things.
Very much depressed.

no reason to be depressed. you can try out unix-y stuff
without any fear or harm by using, e.g., a knoppix dvd.

cheers,
   axel.