command line compilation error on a linux machine using spack installation of deal.ii dev

67 views
Skip to first unread message

Nicola Giuliani

unread,
Jan 28, 2019, 5:35:33 AM1/28/19
to deal.II User Group
Dear all,

I have just updated my spack installation of deal.ii on Linux Mint (18) machine. 

When I try to compile my deal.ii based project I get puzzling errors. The compiler has already compiled all the files of the project and put them into a library, then It tries to compile the main file executing the following line

/home/ngiuliani/spack/opt/spack/linux-linuxmint18-x86_64/gcc-7.2.0/openmpi-3.0.0-qmx362t6s5wbgobozcrsjf7fpvxxxtqs/bin/mpic++  -DBEM_STOKES_WITH_OCE -DBOOST_NO_AUTO_PTR -DDEBUG -DDIMENSION=2 -I/home/ngiuliani/dealii-sak/build_install/include -I/include -isystem /home/ngiuliani/spack/opt/spack/linux-linuxmint18-x86_64/gcc-7.2.0/dealii-develop-2v2xq5su2vyofnxqquxt3wbsplcjt6xj/include -isystem /home/ngiuliani/spack/opt/spack/linux-linuxmint18-x86_64/gcc-7.2.0/dealii-develop-2v2xq5su2vyofnxqquxt3wbsplcjt6xj/include/deal.II/bundled -isystem /home/ngiuliani/spack/opt/spack/linux-linuxmint18-x86_64/gcc-7.2.0/intel-tbb-2018.2-3yqjnfismuxzlishgreplwswwnjkp6sd/include -isystem /home/ngiuliani/spack/opt/spack/linux-linuxmint18-x86_64/gcc-7.2.0/boost-1.65.1-l3bryfy7bnr4jbhwp7ldbtac45gn7ne5/include -isystem /home/ngiuliani/spack/opt/spack/linux-linuxmint18-x86_64/gcc-7.2.0/metis-5.1.0-hal6zbzzif2jbcojunoe36l4epw6cqac/include -isystem /home/ngiuliani/spack/opt/spack/linux-linuxmint18-x86_64/gcc-7.2.0/trilinos-12.12.1-yqgfszu6kimskd24vz5h4wlaxi7tq6en/include -isystem /home/ngiuliani/spack/opt/spack/linux-linuxmint18-x86_64/gcc-7.2.0/mumps-5.1.1-ecfcy3fzi3noojrzuhc2n4wbsri2a7my/include -isystem /home/ngiuliani/spack/opt/spack/linux-linuxmint18-x86_64/gcc-7.2.0/hypre-2.13.0-hwqkerj6rfm7mzuwnb3gjggsqvwm7agp/include -isystem /home/ngiuliani/spack/opt/spack/linux-linuxmint18-x86_64/gcc-7.2.0/suite-sparse-5.1.0-7i3wjnbuiveb45ccgcw3zu2zqrkjna4g/include -isystem /home/ngiuliani/spack/opt/spack/linux-linuxmint18-x86_64/gcc-7.2.0/superlu-dist-5.2.2-x6zcv3ymem5ilr4rkhjsg65fqh4mdhjy/include -isystem /home/ngiuliani/spack/opt/spack/linux-linuxmint18-x86_64/gcc-7.2.0/hdf5-1.10.1-e4hecy27gm4bbkcjw7o5rlm5ks5gdvix/include -isystem /home/ngiuliani/spack/opt/spack/linux-linuxmint18-x86_64/gcc-7.2.0/parmetis-4.0.3-ozqu7yum5rtyfpevexemuyca5tbpgvny/include -isystem /home/ngiuliani/spack/opt/spack/linux-linuxmint18-x86_64/gcc-7.2.0/matio-1.5.9-ux4v3m3uh46n4yyfq5i5bnohpc3viswr/include -isystem /home/ngiuliani/spack/opt/spack/linux-linuxmint18-x86_64/gcc-7.2.0/netcdf-4.4.1.1-vufcufzmm4ffdgg2hlyx332chjyan233/include -isystem /home/ngiuliani/spack/opt/spack/linux-linuxmint18-x86_64/gcc-7.2.0/petsc-3.8.3-lmwlnrxe4vkcpkirqxfz2rkesiynr2qb/include -isystem /home/ngiuliani/spack/opt/spack/linux-linuxmint18-x86_64/gcc-7.2.0/zlib-1.2.11-xt3uvetpnhkxcaux4ddycsnicznofkzc/include -isystem /home/ngiuliani/spack/opt/spack/linux-linuxmint18-x86_64/gcc-7.2.0/gsl-2.4-lnc4cv5nphh7a3q4yljawek325tm7v4u/include -isystem /home/ngiuliani/spack/opt/spack/linux-linuxmint18-x86_64/gcc-7.2.0/oce-0.18.2-un7nocwlake5oahvcxksnpggy7zso2c2/include/oce -isystem /home/ngiuliani/spack/opt/spack/linux-linuxmint18-x86_64/gcc-7.2.0/p4est-2.0-y5m4noajhmxyljij5rxukokunfcbynju/include -isystem /home/ngiuliani/spack/opt/spack/linux-linuxmint18-x86_64/gcc-7.2.0/slepc-3.8.2-kdgryfco2lpdcfscwg6ptarttke3xkw2/include -I../include -pedantic -fPIC -Wall -Wextra -Woverloaded-virtual -Wpointer-arith -Wsign-compare -Wswitch -Wsynth -Wwrite-strings -Wno-placement-new -Wno-literal-suffix -Wno-psabi -fopenmp-simd -std=c++17 -Wno-unused-local-typedefs -O0 -ggdb -Wa,--compress-debug-sections -std=c++14 -Og -MD -MT CMakeFiles/bem_stokes_2d.g.dir/source/main.cc.o -MF CMakeFiles/bem_stokes_2d.g.dir/source/main.cc.o.d -o CMakeFiles/bem_stokes_2d.g.dir/source/main.cc.o -c ../source/main.cc

and It reports

<command-line>:0:11: error: expected identifier before numeric constant
<command-line>:0:11: error: expected unqualified-id before numeric constant
<command-line>:0:11: error: expected unqualified-id before numeric constant

Looking on the internet I have seen that it should be an error at line 0 character 11, but this is one of the "i" in "ngiuiani" so I don't understand.

 

The project is compiling with a 9.0pre installation of dealii using spack. I tried two different compilers gcc 5.4 and gcc 7.2 with the same results. On a different Linux machine and on my Mac laptop it compiles. Both Linux machines have the same ARGMAX limit (2097152)

Do you have any idea on the reasons and possible solutions/debuggin strategies?

Bests and thank you,
Nicola

Jean-Paul Pelteret

unread,
Jan 28, 2019, 8:19:15 AM1/28/19
to dea...@googlegroups.com
Dear Nicola,

This is pretty strange, since you say that the same code compiles on other machines. From what I can tell from a brief search of this error message, it typically appears when there is a stray brace or comma or the like. Are you completely sure that source files on this problematic machine are exactly the same as the others? You could checksum them to verify this (or if you’re working from a git repo then reset your working copy to the same commit as is on the other machines). Can you successfully compile the tutorial programs and run the quick tests? 

I hope that you get to the bottom of this quickly…
Jean-Paul

--
The deal.II project is located at http://www.dealii.org/
For mailing list/forum options, see https://groups.google.com/d/forum/dealii?hl=en
---
You received this message because you are subscribed to the Google Groups "deal.II User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dealii+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Wolfgang Bangerth

unread,
Jan 28, 2019, 9:18:43 AM1/28/19
to dea...@googlegroups.com
On 1/28/19 3:35 AM, Nicola Giuliani wrote:
>
> and It reports
>
> <command-line>:0:11: error: expected identifier before numeric constant
> <command-line>:0:11: error: expected unqualified-id before numeric constant
> <command-line>:0:11: error: expected unqualified-id before numeric constant
>
> Looking on the internet I have seen that it should be an error at line 0
> character 11, but this is one of the "i" in "ngiuiani" so I don't understand.

The key to finding what's happening is that it is on the command line. I
believe that what is happening is, for example, that the command line *should*
contain text like
-D some_symbol -std=c++17
but for whatever reason, something in the cmake scripts has gone wrong and we
end up with
-D -std=c++17
The compiler then tries to interpret "-std=c++17" as a token sequence that
would make sense as a `#define` macro name, and finds that this doesn't work.

I don't see where in your command that happens, but since you have it, you can
copy-paste it onto the command line, and reduce it until the error goes away
-- for example, you can remove all of the -W... flags (unimportant during
linking), -I..., -isystem, ... flags (also unimportant) and see what remains
and what causes it. If you know what causes it, the solution will likely be
obvious.

Best
W.


--
------------------------------------------------------------------------
Wolfgang Bangerth email: bang...@colostate.edu
www: http://www.math.colostate.edu/~bangerth/

Denis Davydov

unread,
Jan 29, 2019, 2:46:18 AM1/29/19
to deal.II User Group
Hi Nicola


On Monday, January 28, 2019 at 11:35:33 AM UTC+1, Nicola Giuliani wrote:
Dear all,

I have just updated my spack installation of deal.ii on Linux Mint (18) machine. 

by updated you mean you pulled the recent version and installed the deal.II via Spack? 
What commit are you on?
My Ubuntu tester is on 09033e991ef390370955eebecb2c0f734994d16b (12.01.19), I quickly checked recently merged PRs in Spack and 
did not immediately noticed anything that could break CMake packages in general or deal.II in particular.
 

When I try to compile my deal.ii based project I get puzzling errors. The compiler has already compiled all the files of the project and put them into a library, then It tries to compile the main file executing the following line

so the deal.II re-installation was fine? Did you start from clean build folder for your downstream project?
Depending on what changed between you previous setup and the current one, you might get different versions/flavors of third-party-libraries, like OpenMPI, Trilinos, etc.
It is possible that CMake was confused between the two build of deal.II you use in the downstream project (old and new one).
 
and It reports

<command-line>:0:11: error: expected identifier before numeric constant
<command-line>:0:11: error: expected unqualified-id before numeric constant
<command-line>:0:11: error: expected unqualified-id before numeric constant

I don't think I ever saw such errors ;-(

Hopefully we can get to the bottom of this.

Regards,
Denis.

Nicola Giuliani

unread,
Feb 6, 2019, 11:37:23 AM2/6/19
to deal.II User Group
Dear all,

I have found the solution thanking to Alberto Sartori who suggested that the problem could be a repeated definition between my main.cc and something else somewhere in deal.ii.

In my CMakeLists.txt I defined DIMENSION, defining DDDDIMENSION the compilation works fine.

So we just need to be careful on the choice of the names for the defines.

Bests and thank you again,
Nicola
Reply all
Reply to author
Forward
0 new messages