waynebhayes / SANA

Simulating Annealing Network Aligner
25 stars 40 forks source link

Compilation / runtime exception issues on Cygwin #153

Closed bmlaw closed 1 year ago

bmlaw commented 1 year ago
  1. The makefile has a line calling /dev/null for NetGO. This fails on Cygwin. Can be fixed by commenting it out.
  2. C++ runtime errors in cygwin do not write error output to the console, so program terminates mysteriously. Can be fixed by wrapping the main() function, see: https://stackoverflow.com/a/2715411
waynebhayes commented 1 year ago

Hey, Brian! Great to hear from you! Wow... here I thought I was the sole academic user on the planet still using Cygwin. :-)

I've implemented both your fixes and added them to the SANA2 repo, but here's my comments:

  1. Odd. Works on my Cygwin... but yes having an empty dependency is a better way to force it to always make.
  2. Also works on my Cygwin. What version of Cygwin are you using? (Admittedly mine is ancient, and I'm reluctant to change it since it's a magic version where everything "just works").

It sounds like your /dev directory isn't configured properly in cygwin. Here's mine:

image

Also, what version of gcc/g++ are you using? I'm also using an old version... gcc/g++ 5. I've found that pretty much every version past that has some problem, but 5.2.0, 5.3.0, and 5.4.0 work everywhere I've tried (Cygwin, MacOS, Linux CentOS + Ubuntu). Here's what I'm using:

image

bmlaw commented 1 year ago

Hi Wayne,

I don't know if I'd call myself a Cygwin user, so much as I'm a person using Cygwin to try to run SANA off my laptop instead of our Unix cluster.

So first, here's my replication of your first screenshot, which looks all the same to me. I am able to echo to /dev/null normally.

image

As for what version of g++ I'm using, at first I used 11.4.0-1, which was the latest version on the Cygwin downloader:

image

When I used these settings and tried to make, I got the following compilation error (excuse the long text, but I'm providing you the exact output.)

$ make g++ -c -o _objs/src/utils/utils.o src/utils/utils.cpp -USTRICT_ANSI -Wall -std=c++11 -O3 In file included from /usr/lib/gcc/x86_64-pc-cygwin/11/include/c++/cmath:41, from /usr/lib/gcc/x86_64-pc-cygwin/11/include/c++/random:38, from src/utils/utils.cpp:1: /usr/lib/gcc/x86_64-pc-cygwin/11/include/c++/x86_64-pc-cygwin/bits/c++config.h:573:2: warning: #warning "STRICT_ANSI seems to have been undefined; this is not supported" [-Wcpp] 573 | #warning "STRICT_ANSI__ seems to have been undefined; this is not supported" | ^~~ src/utils/utils.cpp: In function ‘std::string intToString(int)’: src/utils/utils.cpp:219:59: error: taking address of rvalue [-fpermissive] 219 | return static_cast<ostringstream*>( &(ostringstream() << n) )->str(); | ~~~^~~ In file included from /usr/lib/gcc/x86_64-pc-cygwin/11/include/c++/bits/stl_algobase.h:63, from /usr/lib/gcc/x86_64-pc-cygwin/11/include/c++/bits/char_traits.h:39, from /usr/lib/gcc/x86_64-pc-cygwin/11/include/c++/string:40, from /usr/lib/gcc/x86_64-pc-cygwin/11/include/c++/random:40, from src/utils/utils.cpp:1: /usr/lib/gcc/x86_64-pc-cygwin/11/include/c++/ext/numeric_traits.h: In instantiation of ‘struct gnu_cxx::numeric_traits_integer<int128 unsigned>’: /usr/lib/gcc/x86_64-pc-cygwin/11/include/c++/bits/uniform_int_dist.h:251:31: required from ‘static _Up std::uniform_int_distribution<_IntType>::_S_nd(_Urbg&, _Up) [with _Wp = int128 unsigned; _Urbg = std::subtract_with_carry_engine<long unsigned int, 24, 10, 24>; _Up = long unsigned int; _IntType = int]’ /usr/lib/gcc/x86_64-pc-cygwin/11/include/c++/bits/uniform_int_dist.h:307:35: required from ‘std::uniform_int_distribution<_IntType>::result_type std::uniform_int_distribution<_IntType>::operator()(_UniformRandomBitGenerator&, const std::uniform_int_distribution<_IntType>::param_type&) [with _UniformRandomBitGenerator = std::subtract_with_carry_engine<long unsigned int, 24, 10, 24>; _IntType = int; std::uniform_int_distribution<_IntType>::result_type = int]’ /usr/lib/gcc/x86_64-pc-cygwin/11/include/c++/bits/uniform_int_dist.h:193:34: required from ‘std::uniform_int_distribution<_IntType>::result_type std::uniform_int_distribution<_IntType>::operator()(_UniformRandomBitGenerator&) [with _UniformRandomBitGenerator = std::subtract_with_carry_engine<long unsigned int, 24, 10, 24>; _IntType = int; std::uniform_int_distribution<_IntType>::result_type = int]’ src/utils/utils.cpp:33:15: required from here /usr/lib/gcc/x86_64-pc-cygwin/11/include/c++/ext/numeric_traits.h:64:53: error: static assertion failed: invalid specialization 64 | static_assert(__is_integer_nonstrict<_Value>::value, | ^~~ /usr/lib/gcc/x86_64-pc-cygwin/11/include/c++/ext/numeric_traits.h:64:53: note: ‘std::is_integer<__int128 unsigned>::value’ evaluates to false In file included from /usr/lib/gcc/x86_64-pc-cygwin/11/include/c++/bits/random.h:35, from /usr/lib/gcc/x86_64-pc-cygwin/11/include/c++/random:49, from src/utils/utils.cpp:1: /usr/lib/gcc/x86_64-pc-cygwin/11/include/c++/bits/uniform_int_dist.h: In instantiation of ‘static _Up std::uniform_int_distribution<_IntType>::_S_nd(_Urbg&, _Up) [with _Wp = int128 unsigned; _Urbg = std::subtract_with_carry_engine<long unsigned int, 24, 10, 24>; _Up = long unsigned int; _IntType = int]’: /usr/lib/gcc/x86_64-pc-cygwin/11/include/c++/bits/uniform_int_dist.h:307:35: required from ‘std::uniform_int_distribution<_IntType>::result_type std::uniform_int_distribution<_IntType>::operator()(_UniformRandomBitGenerator&, const std::uniform_int_distribution<_IntType>::param_type&) [with _UniformRandomBitGenerator = std::subtract_with_carry_engine<long unsigned int, 24, 10, 24>; _IntType = int; std::uniform_int_distribution<_IntType>::result_type = int]’ /usr/lib/gcc/x86_64-pc-cygwin/11/include/c++/bits/uniform_int_dist.h:193:34: required from ‘std::uniform_int_distribution<_IntType>::result_type std::uniform_int_distribution<_IntType>::operator()(_UniformRandomBitGenerator&) [with _UniformRandomBitGenerator = std::subtract_with_carry_engine<long unsigned int, 24, 10, 24>; _IntType = int; std::uniform_int_distribution<_IntType>::result_type = int]’ src/utils/utils.cpp:33:15: required from here /usr/lib/gcc/x86_64-pc-cygwin/11/include/c++/bits/uniform_int_dist.h:252:46: error: static assertion failed: W must be twice as wide as U 252 | static_assert(_Wp_traits::digits == (2 * _Up_traits::digits), | ~~~^~~~~~~ /usr/lib/gcc/x86_64-pc-cygwin/11/include/c++/bits/uniform_int_dist.h:252:46: note: ‘(((int)gnu_cxx::numeric_traits_integer<int128 unsigned>::digits) == (2 * ((int)gnu_cxx::numeric_traits_integer::digits)))’ evaluates to false make: *** [_objs/src/utils/utils.o] Error 1

Some enterprising Googling on my part suggested this was due to a change in GCC-11 (https://github.com/clementine-player/Clementine/issues/6865) so I installed GCC 10 instead.

image

and that version was compiling, except for the two issues mentioned. With the latest commit you made, it compiles and runs fine on 10.2 now, but still fails on 11.X, using built-in specs.

I see also that you're using 32-bit and I'm on 64-bit. I'll also add that gcc 10.2 isn't available any more from the Cygwin package manager; only 7.4 and 11.X now.

Brian.