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

Current release (2.1.0) fails to compile #125

Closed
paolodragone opened this Issue Nov 17, 2016 · 4 comments

Comments

Projects
None yet
3 participants
@paolodragone

paolodragone commented Nov 17, 2016

Hi,
I am trying to compile the new release from source, I get a compilation error:

[paolodragone@dragon build]$ cmake ..
-- The CXX compiler identification is GNU 6.2.1
-- The C compiler identification is GNU 6.2.1
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Performing Test HAS_WERROR
-- Performing Test HAS_WERROR - Success
-- Performing Test HAS_CPP11
-- Performing Test HAS_CPP11 - Success
-- Performing Test HAS_ATTR_THREAD
-- Performing Test HAS_ATTR_THREAD - Success
-- Performing Test HAS_ATOLL
-- Performing Test HAS_ATOLL - Success
-- Performing Test HAS_PIDPATH
-- Performing Test HAS_PIDPATH - Failed
-- Performing Test HAS_GETMODULEFILENAME
-- Performing Test HAS_GETMODULEFILENAME - Failed
-- Performing Test HAS_GETFILEATTRIBUTES
-- Performing Test HAS_GETFILEATTRIBUTES - Failed
-- Performing Test HAS_MEMCPY_S
-- Performing Test HAS_MEMCPY_S - Failed
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE  
-- Configuring done
-- Generating done
-- Build files have been written to: /home/paolodragone/Software/libminizinc/build
[paolodragone@dragon build]$ cmake --build .
[  2%] Generating lexer.yy.cpp
[  4%] Generating parser.tab.cpp, minizinc/parser.tab.hh
Scanning dependencies of target minizinc
[  6%] Building CXX object CMakeFiles/minizinc.dir/lib/ast.cpp.o
In file included from /home/paolodragone/Software/libminizinc/lib/ast.cpp:15:0:
/home/paolodragone/Software/libminizinc/include/minizinc/iter.hh: In function ‘bool MiniZinc::Ranges::overlaps(const MiniZinc::FloatVal&, const MiniZinc::FloatVal&)’:
/home/paolodragone/Software/libminizinc/include/minizinc/iter.hh:302:14: error: ‘nextafter’ is not a member of ‘std’
       return std::nextafter(x.toDouble(),INFINITY) >= y.toDouble();
              ^~~
/home/paolodragone/Software/libminizinc/include/minizinc/iter.hh:302:42: error: ‘INFINITY’ was not declared in this scope
       return std::nextafter(x.toDouble(),INFINITY) >= y.toDouble();
                                          ^~~~~~~~
/home/paolodragone/Software/libminizinc/include/minizinc/iter.hh: In function ‘MiniZinc::FloatVal MiniZinc::Ranges::nextHigher(const MiniZinc::FloatVal&)’:
/home/paolodragone/Software/libminizinc/include/minizinc/iter.hh:313:14: error: ‘nextafter’ is not a member of ‘std’
       return std::nextafter(x.toDouble(),INFINITY);
              ^~~
/home/paolodragone/Software/libminizinc/include/minizinc/iter.hh:313:42: error: ‘INFINITY’ was not declared in this scope
       return std::nextafter(x.toDouble(),INFINITY);
                                          ^~~~~~~~
/home/paolodragone/Software/libminizinc/include/minizinc/iter.hh: In function ‘MiniZinc::FloatVal MiniZinc::Ranges::nextLower(const MiniZinc::FloatVal&)’:
/home/paolodragone/Software/libminizinc/include/minizinc/iter.hh:319:14: error: ‘nextafter’ is not a member of ‘std’
       return std::nextafter(x.toDouble(),-INFINITY);
              ^~~
/home/paolodragone/Software/libminizinc/include/minizinc/iter.hh:319:43: error: ‘INFINITY’ was not declared in this scope
       return std::nextafter(x.toDouble(),-INFINITY);
                                           ^~~~~~~~
make[2]: *** [CMakeFiles/minizinc.dir/build.make:75: CMakeFiles/minizinc.dir/lib/ast.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:179: CMakeFiles/minizinc.dir/all] Error 2
make: *** [Makefile:150: all] Error 2

I tested it on Debian and Arch linux with the same outcome.
I was able to compile the previous release (2.0.14), did you add some new dependency?
Thanks.

Paolo

@paolodragone

This comment has been minimized.

paolodragone commented Nov 18, 2016

I found the commit after which I can no longer compile:
a478cf5ea3857f59db41b91abf8d821c7345ebbc
Unfortunately I can't find out the cause.
Could you have a look at it?
Thanks again!

Paolo

@a1880

This comment has been minimized.

a1880 commented Nov 18, 2016

I am no MiniZinc insider, but ....
Did you change your compiler? GNU 6.2.1 looks very new?
INFINITY was introduced in c++11
It requires include of <cmath>
Function std::nextafter() also requires <cmath>, but I cannot find it included in the MiniZinc sources

@guidotack

This comment has been minimized.

Member

guidotack commented Nov 19, 2016

Right, looks like some compilers need for these features (the ones we use for building packages and testing apparently don't). I've added on the develop branch.

@paolodragone

This comment has been minimized.

paolodragone commented Nov 19, 2016

I can confirm that I can compile now, including <cmath> makes it work.

@guidotack guidotack closed this in c619ad6 Dec 14, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment