Problems with installation in Ubuntu 16.04

Asked by Gonzalo Tancredi

My system manager upgrade the computer from Ubuntu 14.04 to 16.04.
In Ubuntu 14.04, I was running esys-particle without problems, but after the upgrade I could not install essays-particle again.

I am trying to install the esys trunk version 2.3.4

When I run the ./configure I get the following error:
checking for Boost headers version >= 1.34.1... yes
checking for Boost's header version...
./configure: line 19542: let: major_version=/100000: syntax error: operand expected (error token is "/100000")
./configure: line 19543: let: minor_version=/100%1000: syntax error: operand expected (error token is "/100%1000")
./configure: line 19544: let: patch_level=%100: syntax error: operand expected (error token is "%100")
./configure: line 19549: test: : integer expression expected
./configure: line 19554: test: : integer expression expected
Boost Version is .
configure: error: invalid value: boost_major_version=

It seems that the variable ${boost_cv_full_lib_version} is not set.

I am using lib boost version 1.58
I found it with:
dpkg -S /usr/include/boost/version.hpp
>> libboost1.58-dev:amd64: /usr/include/boost/version.hpp

Any help?

I could also fire my system manager, but it is very difficult to get a new one.

Regards

Question information

Language:
English Edit question
Status:
Solved
For:
ESyS-Particle Edit question
Assignee:
No assignee Edit question
Solved by:
Gonzalo Tancredi
Solved:
Last query:
Last reply:
Revision history for this message
Vince Boros (v-boros) said :
#1

Hello Gonzalo:

I am unsure if Ubuntu has changed standard locations for system files or if the Config/boost.m4 script is broken. Simple things first:

1) It appears that you have not used the --with-boost option to supply a path for the Boost directory (not typically a problem if Boost files have been installed in a system location). Add:

  --with-boost=/usr

to your configure line, and then post the same output as above. This will not likely fix your problem, but I wish to see what the configure script outputs. Ordinarily the above line:

  checking for Boost headers version >= 1.34.1... yes

indicates that the system Boost files have been found, and then the rest of the Boost configuration proceeds smoothly. So probably there is a deeper issue.

2) Search for a line in /usr/include/boost/version.hpp that looks like:

  #define BOOST_VERSION 105800

3) In config.log look for a line containing:

  checking for Boost headers version

and post the next several lines when you reply.

Regards,

Vince

Revision history for this message
Gonzalo Tancredi (gonzalo) said :
#2

Hi Vince

I follow your requests:

1) Using
/configure CC=mpicc CXX=mpic++ --prefix=/home/gonzalo/Software/esys-particle-install --with-boost=/usr

I get
checking for Boost headers version >= 1.34.1... /usr/include
checking for Boost's header version...
./configure: line 19542: let: major_version=/100000: syntax error: operand expected (error token is "/100000")
./configure: line 19543: let: minor_version=/100%1000: syntax error: operand expected (error token is "/100%1000")
./configure: line 19544: let: patch_level=%100: syntax error: operand expected (error token is "%100")
./configure: line 19549: test: : integer expression expected
./configure: line 19554: test: : integer expression expected
Boost Version is .
configure: error: invalid value: boost_major_version=

2)
I do have the line
#define BOOST_VERSION 105800

3) The config.log of the previous run have
configure:19389: checking for Boost headers version >= 1.34.1
configure:19460: mpic++ -c -g -O2 -I/usr/include conftest.cpp >&5
configure:19460: $? = 0
configure:19481: result: /usr/include
configure:19512: checking for Boost's header version
configure:19540: result:
configure:19558: error: invalid value: boost_major_version=

But if I do not include in the .configure command the --with-boost=/usr
I get in the output:
checking for Boost headers version >= 1.34.1... yes
checking for Boost's header version...
./configure: line 19542: let: major_version=/100000: syntax error: operand expected (error token is "/100000")
./configure: line 19543: let: minor_version=/100%1000: syntax error: operand expected (error token is "/100%1000")
./configure: line 19544: let: patch_level=%100: syntax error: operand expected (error token is "%100")
./configure: line 19549: test: : integer expression expected
./configure: line 19554: test: : integer expression expected
Boost Version is .
configure: error: invalid value: boost_major_version=

And in the config.log file
configure:19389: checking for Boost headers version >= 1.34.1
configure:19460: mpic++ -c -g -O2 conftest.cpp >&5
configure:19460: $? = 0
configure:19481: result: yes
configure:19512: checking for Boost's header version
configure:19540: result:
configure:19558: error: invalid value: boost_major_version=

Regards

Gonzalo

Revision history for this message
Gonzalo Tancredi (gonzalo) said :
#3

Hi Vince

I follow your requests:

1) Using
/configure CC=mpicc CXX=mpic++ --prefix=/home/gonzalo/Software/esys-particle-install --with-boost=/usr

I get
checking for Boost headers version >= 1.34.1... /usr/include
checking for Boost's header version...
./configure: line 19542: let: major_version=/100000: syntax error: operand expected (error token is "/100000")
./configure: line 19543: let: minor_version=/100%1000: syntax error: operand expected (error token is "/100%1000")
./configure: line 19544: let: patch_level=%100: syntax error: operand expected (error token is "%100")
./configure: line 19549: test: : integer expression expected
./configure: line 19554: test: : integer expression expected
Boost Version is .
configure: error: invalid value: boost_major_version=

2)
I do have the line
#define BOOST_VERSION 105800

3) The config.log of the previous run have
configure:19389: checking for Boost headers version >= 1.34.1
configure:19460: mpic++ -c -g -O2 -I/usr/include conftest.cpp >&5
configure:19460: $? = 0
configure:19481: result: /usr/include
configure:19512: checking for Boost's header version
configure:19540: result:
configure:19558: error: invalid value: boost_major_version=

But if I do not include in the .configure command the --with-boost=/usr
I get in the output:
checking for Boost headers version >= 1.34.1... yes
checking for Boost's header version...
./configure: line 19542: let: major_version=/100000: syntax error: operand expected (error token is "/100000")
./configure: line 19543: let: minor_version=/100%1000: syntax error: operand expected (error token is "/100%1000")
./configure: line 19544: let: patch_level=%100: syntax error: operand expected (error token is "%100")
./configure: line 19549: test: : integer expression expected
./configure: line 19554: test: : integer expression expected
Boost Version is .
configure: error: invalid value: boost_major_version=

And in the config.log file
configure:19389: checking for Boost headers version >= 1.34.1
configure:19460: mpic++ -c -g -O2 conftest.cpp >&5
configure:19460: $? = 0
configure:19481: result: yes
configure:19512: checking for Boost's header version
configure:19540: result:
configure:19558: error: invalid value: boost_major_version=

Regards

Gonzalo

Revision history for this message
Anton Gladky (gladky-anton) said :
#4

Hi,

if you need just a working ESyS particle and do not need to modify the
source code, you can install it from package manager (apt-get install esys-particle).
Otherwise there is a d\rules file [1] which builds the package, you can get
configuration flags from there.

[1] https://sources.debian.net/src/esys-particle/2.3.4%2Bdfsg1-2/debian/rules/#L22

Best regards

Anton

Revision history for this message
Gonzalo Tancredi (gonzalo) said :
#5

Hi Anton

I need to install essys from the source code because I have some students working in some new implementations of the code.
I will have a look to the the rules file. Thanks.

Regards

Gonzalo

Revision history for this message
Gonzalo Tancredi (gonzalo) said :
#6

Hi Anton

I tried to extract the configuration flags from the rules file, but I did not succeed.
Any further help would be useful.

Regards

Gonzalo

Revision history for this message
Vince Boros (v-boros) said :
#7

Hi Gonzalo:

The problem seems to start from about line 237 in Config/boost.m4:

      [boost_cv_full_lib_version=`cat conftest.i`])])

After this command ${boost_cv_full_lib_version} is empty, when it ought to have a value. conftest.i should contain the number 105800. I wonder if this file is not generated by the configure script. Can you modify boost.m4 to find out? In the Config/ directory:

$cp -p boost.m4 boost.m4.original

Open boost.m4 and go to about line 91. This line should be "rm -rf conftest*", inside the m4_define for _BOOST_SED_CPP. Above this line add the following:

  for name in conftest*; do cp -p ${name} copy.${name}; done

Save boost.m4, go back to your source directory, run autogen.sh followed by your usual configure command. Then look for copy.conftest.i and see if it contains "105800" as it should. If it does, then try on the command line:

$boost_cv_full_lib_version=`cat conftest.i`
$echo ${boost_cv_full_lib_version}

In the meantime, I will need to install the latest Ubuntu and try to duplicate the errors that you have encountered.

Regards,

Vince

Revision history for this message
Gonzalo Tancredi (gonzalo) said :
#8

Hi Vince

I follow your steps.
The output of
cat copy.conftest.i
is an empty line.

The output of
cat copy.conftest.cpp
is:
/* confdefs.h */
#define PACKAGE_NAME "ESyS-Particle"
#define PACKAGE_TARNAME "esys-particle"
#define PACKAGE_VERSION "2.3.2"
#define PACKAGE_STRING "ESyS-Particle 2.3.2"
#define PACKAGE_BUGREPORT "<email address hidden>"
#define PACKAGE_URL ""
#define PACKAGE "esys-particle"
#define VERSION "2.3.2"
#define STDC_HEADERS 1
#define HAVE_SYS_TYPES_H 1
#define HAVE_SYS_STAT_H 1
#define HAVE_STDLIB_H 1
#define HAVE_STRING_H 1
#define HAVE_MEMORY_H 1
#define HAVE_STRINGS_H 1
#define HAVE_INTTYPES_H 1
#define HAVE_STDINT_H 1
#define HAVE_UNISTD_H 1
#define HAVE_DLFCN_H 1
#define LT_OBJDIR ".libs/"
#define HAVE_LIBPYTHON2_7 1
#define HAVE_BOOST 1
/* end confdefs.h. */
#include <boost/version.hpp>
boost-full-lib-version = BOOST_VERSION

If I do in the command line
$boost_cv_full_lib_version=`cat copy.conftest.i`
$echo ${boost_cv_full_lib_version}

(note that I change conftest.i to copy.conftest.i in your set of commands, because there is no conftest.i file.

Therefore copy.conftest.i does not contains "105800"

Regards

Gonzalo

Revision history for this message
Vince Boros (v-boros) said :
#9

Well, we know that conftest.cpp can be created by configure. Looking in boost.m4, lines 86-90 and 234-236, I think that M4 runs the C++ preprocessor on conftest.cpp to replace "BOOST_VERSION" in the line "boost-full-lib-version = BOOST_VERSION" with its #defined value 105800. Then sed tries to run "/^boost-full-lib-version = /{s///p;q;}" over the output from the C++ preprocessor to locate the value 105800 and strip away everything before it. Can you try the following on the command line to duplicate this?

$echo ${script} # to check that the variable does not already hold a value
$script="/^boost-full-lib-version = /{s///p;q;}"
$echo ${script} # to check the new value
$gcc -E copy.conftest.cpp | sed -n -e "${script}" > copy.conftest.i

This should create copy.conftest.i which has only 105800. The goal of this test is to verify that the basic syntax still works on the upgraded ubuntu.

You might also try reverting to the original boost.m4 (copy the contents of https://github.com/tsuna/boost.m4/blob/master/build-aux/boost.m4 into a new boost.m4), run autogen.sh and configure and see what happens. The configure script may not get as far as checking for Boost, but it is worth a try. If it does, and successfully finds the correct Boost version, it may indicate either that the changes in the ESyS-Particle version are broken or that the developmental boost.m4 has recent changes that make it work. If it succeeds not, then there may be something fundamental to boost.m4 that is now making the configure script fall over. (Be prepared, however, that boost.m4 from the website may still break configure after this point. For example, it seems not to be aware of the multiarch names that I had to add because of Linuxes like Ubuntu and Debian.)

Let me know how you go. I will delve some more into this problem shortly, but at the moment I have fallen behind in my current job. My thanks for your testing so far.

Regards,

Vince

Revision history for this message
Vince Boros (v-boros) said :
#10

In my last few messages suggesting a command to run at the prompt ($), I should have had a space between the prompt symbol and the command for the sake of readability; for example:

$ echo ${script}

instead of

$echo ${script}

I've only now picked up on these mistakes.

Revision history for this message
Gonzalo Tancredi (gonzalo) said :
#11

Hi Vince

Bad news.

I tried the first test. The output of
$ gcc -E copy.conftest.cpp | sed -n -e "${script}" > copy.conftest.i
is an empty line in copy.conftest.i

I also run
$ gcc -E copy.conftest.cpp
and I get
# 1 "copy.conftest.cpp"
# 1 "<built-in>"
# 1 "<command-line>"
# 1 "/usr/include/stdc-predef.h" 1 3 4
# 1 "<command-line>" 2
# 1 "copy.conftest.cpp"
# 25 "copy.conftest.cpp"
# 1 "/usr/include/boost/version.hpp" 1 3 4
# 26 "copy.conftest.cpp" 2
boost-full-lib-version =
# 26 "copy.conftest.cpp" 3 4
                        105800

(I try the same in another linux machine with 14.04 and I get for the last lines
# 26 "copy.conftest.cpp" 2
boost-full-lib-version = 105500
)

Therefore I guess there is something wrong with the output structure.

I also copy the boost.m4 of the link, run autopen.sh and config and I get up to
checking for Py_Main in -lpython2.7... yes
./configure: line 18917: syntax error near unexpected token `else'
./configure: line 18917: ` else'

and error just before the
checking for Boost headers version
of the previous runs.

Thanks and Regards

Gonzalo

Revision history for this message
Vince Boros (v-boros) said :
#12

Hello Gonzalo:

I think you have narrowed the problem down to the version of GCC that ships with Ubuntu 16.04 (rather than a syntax error which I earlier suspected). The C++ preprocessor in your version is treating the number 105800 as coming from a system header file (https://gcc.gnu.org/onlinedocs/cpp/Preprocessor-Output.html). I'm unsure why. I would have thought this to be covered by the earlier line:

# 1 "/usr/include/boost/version.hpp" 1 3 4

Running "gcc -E copy.conftest.cpp" on my current machine (using GCC 4.9.2) yields:

# 1 "copy.conftest.cpp"
# 1 "<built-in>"
# 1 "<command-line>"
# 1 "/usr/include/stdc-predef.h" 1 3 4
# 1 "<command-line>" 2
# 1 "copy.conftest.cpp"
# 25 "copy.conftest.cpp"
# 1 "/usr/include/boost/version.hpp" 1 3 4
# 26 "copy.conftest.cpp" 2
boost-full-lib-version = 105500

What version of GCC have you on Ubuntu 16.04, and on the 14.04 machine? It seems that the new preprocessor distinguishes between "boost-full-lib-version = ", which comes from copy.conftest.cpp, and the expansion of BOOST_VERSION in copy.conftest.cpp to 105800, which originally came from /usr/include/boost/version.hpp, which is a system header file.

Add "-P" to the gcc command:

$ gcc -E -P copy.conftest.cpp

On my computer this gives me one line of output:

boost-full-lib-version = 105500

I am curious to know if you get:

boost-full-lib-version = 105800

from your upgraded ubuntu as an unbroken line.

Regards,

Vince

Revision history for this message
Gonzalo Tancredi (gonzalo) said :
#13

Hi Vince

The output of
$ gcc -E -P copy.conftest.cpp
is
boost-full-lib-version = 105800

Regarding the version of gcc, if I run
$ gcc -v
I get
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/5/lto-wrapper
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 5.4.0-6ubuntu1~16.04.2' --with-bugurl=file:///usr/share/doc/gcc-5/README.Bugs --enable-languages=c,ada,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-5 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-libmpx --enable-plugin --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-5-amd64/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-5-amd64 --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-5-amd64 --with-arch-directory=amd64 --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --enable-objc-gc --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.2)

Regards

Gonzalo

Revision history for this message
Vince Boros (v-boros) said :
#14

Okay, you have GCC 5.4.0.

Repeat the earlier test with the -P option:

$ echo ${script} # to check that the variable does not already hold a value
$ script="/^boost-full-lib-version = /{s///p;q;}"
$ echo ${script} # to check the new value
$ gcc -E -P copy.conftest.cpp | sed -n -e "${script}" > copy.conftest.i

If you get 105800 in copy.conftest.i as a result, then try adding -P to boost.m4. (Unfortunately I am away from the machine that has Boost and ESyS-Particle installed, otherwise I would try this now myself.) Change line 86 from:

(eval "$ac_cpp conftest.$ac_ext") 2>&AS_MESSAGE_LOG_FD |

to:

(eval "$ac_cpp -P conftest.$ac_ext") 2>&AS_MESSAGE_LOG_FD |

As before, run autogen.sh and then configure. I have limited knowledge of shell scripting (and very limited understanding of the M4 language), so I hope this works.

Regards,

Vince

Revision history for this message
Gonzalo Tancredi (gonzalo) said :
#15

SOLVED !!!

Hi Vince

The problem is it solved with your last suggestion:

In the original file Config/boost.m4 change line 86 from:

(eval "$ac_cpp conftest.$ac_ext") 2>&AS_MESSAGE_LOG_FD |

to:

(eval "$ac_cpp -P conftest.$ac_ext") 2>&AS_MESSAGE_LOG_FD |

 run autogen.sh and then configure

It also solve the same problem with the installation of Gengeo.
In that case, you must change config/boost.m4.

Thank you very much !!!

Best regards

Gonzalo

Revision history for this message
Vince Boros (v-boros) said :
#16

Hello Gonzalo:

That is very good. As you may have guessed, "-P Inhibit[s] generation of linemarkers in the output from the preprocessor. This might be useful when running the preprocessor on something that is not C code, and will be sent to a program which might be confused by the linemarkers." (From https://gcc.gnu.org/onlinedocs/gcc/Preprocessor-Options.html.) Although the code snippet in conftest.cpp is C or C++, programs creating and then reading conftest.i were "confused," as was I for a while.

I will update the ESyS-Particle and GenGeo repositories with the patch in the next few days. Thank you very much for your patience and your testing. It got us to the solution much quicker than otherwise.

Regards,

Vince