invalid conversion of "int" to "boolean"

Hi All,
I am trying to install LAMMPS with make g++ with user define paths. I got stuck in this error.Please tell me what to do ?

…/image.cpp: In member function ‘void LAMMPS_NS::Image::write_JPG(FILE*)’:
…/image.cpp:1063:34: error: invalid conversion from ‘int’ to ‘boolean’ [-fpermissive]
/home/vampire/lmp/jpeg/include/jpeglib.h:984:14: error: initializing argument 3 of ‘void jpeg_set_quality(j_compress_ptr, int, boolean)’ [-fpermissive]
…/image.cpp:1064:32: error: invalid conversion from ‘int’ to ‘boolean’ [-fpermissive]
/home/vampire/lmp/jpeg/include/jpeglib.h:1003:14: error: initializing argument 2 of ‘void jpeg_start_compress(j_compress_ptr, boolean)’ [-fpermissive]
make[1]: *** [image.o] Error 1
make[1]: Leaving directory `/home/vampire/tools/lmp/lammps-30Sep13/src/Obj_g++’
make: *** [g++] Error 2

Hi All,
I am trying to install LAMMPS with make g++ with user define paths. I got
stuck in this error.Please tell me what to do ?

difficult to say, but the error message seems to be bogus to me.
which compiler version and jpeg library version are you using?
i'm regularly compiling LAMMPS on a range of linux machines with
different "age" of the OS and never ran across this one.
you probably want to use the jpeg development package that is provided
by your OS rather than rolling your own.

../image.cpp: In member function ‘void LAMMPS_NS::Image::write_JPG(FILE*)’:
../image.cpp:1063:34: error: invalid conversion from ‘int’ to ‘boolean’
[-fpermissive]
/home/vampire/lmp/jpeg/include/jpeglib.h:984:14: error: initializing
argument 3 of ‘void jpeg_set_quality(j_compress_ptr, int, boolean)’
[-fpermissive]
../image.cpp:1064:32: error: invalid conversion from ‘int’ to ‘boolean’
[-fpermissive]
/home/vampire/lmp/jpeg/include/jpeglib.h:1003:14: error: initializing
argument 2 of ‘void jpeg_start_compress(j_compress_ptr, boolean)’
[-fpermissive]
make[1]: *** [image.o] Error 1
make[1]: Leaving directory
`/home/vampire/tools/lmp/lammps-30Sep13/src/Obj_g++'
make: *** [g++] Error 2

this is the change that would be required to appease the error message.

diff --git a/src/image.cpp b/src/image.cpp
index 3b71d64..5f3ed88 100644
--- a/src/image.cpp
+++ b/src/image.cpp
@@ -1005,8 +1005,8 @@ void Image::write_JPG(FILE *fp)
   cinfo.in_color_space = JCS_RGB;

   jpeg_set_defaults(&cinfo);
- jpeg_set_quality(&cinfo, 100, 1);
- jpeg_start_compress(&cinfo, 1);
+ jpeg_set_quality(&cinfo, 100, true);
+ jpeg_start_compress(&cinfo, true);

   while (cinfo.next_scanline < cinfo.image_height) {
     row_pointer = (JSAMPROW)

axel.

compiler is GNU g++ and jpegsrc.v9 are used. How to select development version of it in Ubuntu??

Hi All,
I am trying to install LAMMPS with make g++ with user define paths. I got
stuck in this error.Please tell me what to do ?

difficult to say, but the error message seems to be bogus to me.
which compiler version and jpeg library version are you using?
i’m regularly compiling LAMMPS on a range of linux machines with
different “age” of the OS and never ran across this one.
you probably want to use the jpeg development package that is provided
by your OS rather than rolling your own.

…/image.cpp: In member function ‘void LAMMPS_NS::Image::write_JPG(FILE*)’:
…/image.cpp:1063:34: error: invalid conversion from ‘int’ to ‘boolean’
[-fpermissive]
/home/vampire/lmp/jpeg/include/jpeglib.h:984:14: error: initializing
argument 3 of ‘void jpeg_set_quality(j_compress_ptr, int, boolean)’
[-fpermissive]
…/image.cpp:1064:32: error: invalid conversion from ‘int’ to ‘boolean’
[-fpermissive]
/home/vampire/lmp/jpeg/include/jpeglib.h:1003:14: error: initializing
argument 2 of ‘void jpeg_start_compress(j_compress_ptr, boolean)’
[-fpermissive]
make[1]: *** [image.o] Error 1
make[1]: Leaving directory
`/home/vampire/tools/lmp/lammps-30Sep13/src/Obj_g++’
make: *** [g++] Error 2

this is the change that would be required to appease the error message.

diff --git a/src/image.cpp b/src/image.cpp
index 3b71d64…5f3ed88 100644
— a/src/image.cpp
+++ b/src/image.cpp
@@ -1005,8 +1005,8 @@ void Image::write_JPG(FILE *fp)
cinfo.in_color_space = JCS_RGB;

jpeg_set_defaults(&cinfo);

  • jpeg_set_quality(&cinfo, 100, 1);
  • jpeg_start_compress(&cinfo, 1);
  • jpeg_set_quality(&cinfo, 100, true);
  • jpeg_start_compress(&cinfo, true);

while (cinfo.next_scanline < cinfo.image_height) {
row_pointer = (JSAMPROW)

axel.

compiler is GNU g++ and jpegsrc.v9 are used. How to select development

what does g++ -v say?

GNU g++ comes in a large variety of versions.

version of it in Ubuntu??

this is a ubuntu and not a lammps question. i don't use ubuntu, so i
don't know, but there have been people repeatedly posting instructions
to compile lammps on ubuntu.

axel.

g++ -v said “gcc version 4.6.3 (Ubuntu/Linaro 4.6.3-1ubuntu5)”. yes, this is Ubuntu 12.04lts OS. I heard it is difficult to install in Ubuntu anyway worth to try. Thanks for you feedback too.

compiler is GNU g++ and jpegsrc.v9 are used. How to select development

what does g++ -v say?

GNU g++ comes in a large variety of versions.

version of it in Ubuntu??

this is a ubuntu and not a lammps question. i don’t use ubuntu, so i
don’t know, but there have been people repeatedly posting instructions
to compile lammps on ubuntu.

axel.

g++ -v said "gcc version 4.6.3 (Ubuntu/Linaro 4.6.3-1ubuntu5)". yes, this is
Ubuntu 12.04lts OS. I heard it is difficult to install in Ubuntu anyway

this is nonsense. LAMMPS is one of the most portable scientific
packages around that i have come across (and there have been quite a
few and there are also machines where it is much trickier to compile
for. be thankful that most of those are in a museum or long forgotten
by now. if you feel like doing a bit of digging, search the web for
the nCUBE 3 machines, for example, where you had to cross compiler on
a sun workstation to "plan 9" as OS... ).

if you need to make your life easier, leave out packages that you
don't need. particularly, if you have little experience with compilers
and compiling.

axel

Jeff,

if there are problems with compiling LAMMPS in Ubuntu you wouldn't like to spend your time solving, there is an option to install pre-compiled binaries from PPA repository made especially for Ubuntu. More info on LAMMPS website: http://lammps.sandia.gov/download.html#ubuntu

I've got Ubuntu on my machines and could compare makefile settings with yours and see what's different, if you're interested; but little later.

Regards,
Oleg.

26.10.2013, 14:36, "Jeffrey De Lile" <[email protected]>:

g++ -v said "gcc version 4.6.3 (Ubuntu/Linaro 4.6.3-1ubuntu5)". yes, this is
Ubuntu 12.04lts OS. I heard it is difficult to install in Ubuntu anyway
worth to try. Thanks for you feedback too.

besides, one has to be careful with word of the mouth. in my
experience, there isn't much of a significant difference between linux
distributions as far as LAMMPS is concerned. however, there is a big
difference in which kind of users are attracted by what distribution.
unbuntu very deliberately tries to appeal to users with little
experience and thus you will simply see more people struggling with
compilation of software packages that require a minimal amount of
knowledge about compilers and libraries. people with significant
experience usually prefer distributions like gentoo or fedora that are
designed to appeal more to developers and geeks. so some of the
hearsay is just that, and massively biased because of the
self-selection of users.

axel.

Oleg,
Yes please. I am happy to see what are the differences in makefiles I have. Sure, I will go for pre-compiled version. Hope it will work without much struggle.

g++ -v said “gcc version 4.6.3 (Ubuntu/Linaro 4.6.3-1ubuntu5)”. yes, this is
Ubuntu 12.04lts OS. I heard it is difficult to install in Ubuntu anyway
worth to try. Thanks for you feedback too.

besides, one has to be careful with word of the mouth. in my
experience, there isn’t much of a significant difference between linux
distributions as far as LAMMPS is concerned. however, there is a big
difference in which kind of users are attracted by what distribution.
unbuntu very deliberately tries to appeal to users with little
experience and thus you will simply see more people struggling with
compilation of software packages that require a minimal amount of
knowledge about compilers and libraries. people with significant
experience usually prefer distributions like gentoo or fedora that are
designed to appeal more to developers and geeks. so some of the
hearsay is just that, and massively biased because of the
self-selection of users.

axel.

Jeff,

here is an example makefile that works on ubuntu with svn version of lammps. All the prerequisites were installed through apt-get. You'll need libfftw3-dev, libjpeg-dev, mpich2 and libmpich2-dev.

Oleg.

26.10.2013, 16:28, "Jeffrey De Lile" <[email protected]>:

Makefile.g++ (2.65 KB)

Dear Oleg,
Thanks you so much for your post. I followed the command lines in lammps-daily installation and I believe that is installed in my system as i can find /usr/share/doc/lammps-daily/examples etc. However, it is better some one can give me some stepwise infomation how to run those example files in above directory. Because even after I read http://lammps.sandia.gov/doc/Section_example.html doesn’t click my brain… as I don’t have src/lmp folder how to run those examples?? Please give me some guidelines in this.
Thanks a lot

Jeff,

here is an example makefile that works on ubuntu with svn version of lammps. All the prerequisites were installed through apt-get. You’ll need libfftw3-dev, libjpeg-dev, mpich2 and libmpich2-dev.

Oleg.

26.10.2013, 16:28, “Jeffrey De Lile” <[email protected]…16…>:

Dear Oleg,
Thanks you so much for your post. I followed the command lines in
lammps-daily installation and I believe that is installed in my system as i
can find /usr/share/doc/lammps-daily/examples etc. However, it is better
some one can give me some stepwise infomation how to run those example files
in above directory. Because even after I read
http://lammps.sandia.gov/doc/Section_example.html doesn't click my brain..
as I don't have src/lmp folder how to run those examples?? Please give me
some guidelines in this.

please try to make an effort to not go haywire with every little
problem and use a little bit of common sense. the examples are - of
course - bundled with the sources that you have downloaded and tried
to compile lammps from earlier.

axel.