Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: "expected initializer before ‘:’ token" when run "make" command #620

Closed
luannnh opened this issue Jul 11, 2016 · 8 comments
Closed
Labels

Comments

@luannnh
Copy link

luannnh commented Jul 11, 2016

Description:

pgRouting: v2.2.3
PostgreSQL: v9.6
Operating System: Centos 6.6 64 bit

Installation steps:

mkdir build
cd build
cmake  ..
make 
sudo make install

=> And getting a problem in make step

make[2]: *** [src/common/src/CMakeFiles/common.dir/basePath_SSEC.cpp.o] Error 1
make[1]: *** [src/common/src/CMakeFiles/common.dir/all] Error 2

Here's my error file: 1107-04.txt
Here's two code files (appended *.txt to upload) , below:
basePath_SSEC.cpp.txt
basePath_SSEC.hpp.txt

It takes me over 4 hours to find solution but until now, I cannot resolve it. I don't know why this problem happens (because I didn't edit any code files) . Please explain to me if you knew it.

Thanks

@cvvergara
Copy link
Member

From what I see, your compiler is not accepting range loops and lambda notation.
Run this command:
g++ -v
make sure your compiler is at least 4.8.4
Also, make sure that its compiling with -std=c++0x flag

@woodbri
Copy link
Contributor

woodbri commented Jul 11, 2016

Should cmake check that the compiler supports these options?

@cvvergara
Copy link
Member

cvvergara commented Jul 11, 2016

Yeah, cmake CmakeLists.txt needs a lot of fixing.

@luannnh
Copy link
Author

luannnh commented Jul 12, 2016

Thanks a lot.
I updated gcc/g++ and cgal-devel (sorry, because I don't check these dependencies carefully )

Updated:

gcc/g++ : v4.9.1
cmake : v2.8.12.2
boost graph library : v1.59
CGAL : v4.5.1
GMP: v4.3

gcc/g++ steps:

cd /etc/yum.repos.d
wget http://linuxsoft.cern.ch/cern/scl/slc6-scl.repo
yum -y --nogpgcheck install devtoolset-3-gcc devtoolset-3-gcc-c++
scl enable devtoolset-3 bash

cgal steps:

wget -P /opt/  https://gforge.inria.fr/frs/download.php/file/34400/CGAL-4.5.1.tar.gz
cd /opt/CGAL-4.5.1/
mkdir build
cd build
cmake ..
make
make install

Now, the problem is on CGAL:

Scanning dependencies of target alpha_shape
[ 72%] Building C object src/alpha_shape/src/CMakeFiles/alpha_shape.dir/alpha.c.o
[ 73%] Building CXX object src/alpha_shape/src/CMakeFiles/alpha_shape.dir/alpha_drivedist.cpp.o
In file included from /usr/local/include/CGAL/internal/Exact_type_selector.h:39:0,
                 from /usr/local/include/CGAL/Filtered_kernel.h:35,
                 from /home/postgres/pgrouting-pgrouting-2.2.3/src/alpha_shape/src/alpha_drivedist.cpp:47:
/usr/local/include/CGAL/Mpzf.h: In function ‘CGAL::Mpzf CGAL::Mpzf_square(const CGAL::Mpzf&)’:
/usr/local/include/CGAL/Mpzf.h:718:38: error: ‘mpn_sqr’ was not declared in this scope
     mpn_sqr(res.data(),a.data(),asize);
                                      ^
make[2]: *** [src/alpha_shape/src/CMakeFiles/alpha_shape.dir/alpha_drivedist.cpp.o] Error 1
make[1]: *** [src/alpha_shape/src/CMakeFiles/alpha_shape.dir/all] Error 2
make: *** [all] Error 2

I'm trying to fix.
I attached "cmake & make" processs: 20160712-cmake-make.txt

@luannnh
Copy link
Author

luannnh commented Jul 12, 2016

After updating CGAL : gmplib
These errors are changed : 20160712-cgal.txt

May be, I have to find a suitable CGAL (or GMP) to install .

@luannnh
Copy link
Author

luannnh commented Jul 12, 2016

@ALL: I installed pgrouting successfully.
Solution: update all dependencies

Thanks.

@luannnh luannnh closed this as completed Jul 12, 2016
@dkastl
Copy link
Member

dkastl commented Jul 13, 2016

@luannnh thanks for indicating that you could solve the issue.
I remember, that dependencies like CGAL caused difficulties in the past. So this still seems to be the case for some distributions.

I thought there are also pgRouting binaries in the YUM repsoitory of PostgreSQL, though I haven't tried it for long time: http://yum.postgresql.org/news-packagelist.php

@luannnh
Copy link
Author

luannnh commented Jul 13, 2016

@dkastl :
I tried to yum postgresql+postgis+pgrouting from http://yum.postgresql.org. It's ok.
I had some problems when build from source.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants