Board index FlightGear Support Compiling

[SOLVED] isnan problem while compiling simgear

Building FlightGear from source, and in the need for help?

[SOLVED] isnan problem while compiling simgear

Postby mifi » Wed Oct 26, 2016 11:53 am

hi all

I have been getting this error when compiling simgear yesterday and this morning:
'error: ‘isnan’ was not declared in this scope'

Code (): Select all
In file included from /home/mifi/Software/Sources/fgfs53/next/simgear/simgear/sound/soundmgr_openal.cxx:43:0:
/home/mifi/Software/Sources/fgfs53/next/simgear/simgear/sound/soundmgr_openal_private.hxx: In function ‘bool isNaN(float*)’:
/home/mifi/Software/Sources/fgfs53/next/simgear/simgear/sound/soundmgr_openal_private.hxx:77:22: error: ‘isnan’ was not declared in this scope
return (isnan(v[0]) || isnan(v[1]) || isnan(v[2]));
^
/home/mifi/Software/Sources/fgfs53/next/simgear/simgear/sound/soundmgr_openal_private.hxx:77:22: note: suggested alternative:
In file included from /usr/include/c++/5/random:38:0,
from /usr/include/c++/5/bits/stl_algo.h:66,
from /usr/include/c++/5/algorithm:62,
from /home/mifi/Software/Sources/fgfs53/next/simgear/simgear/sound/soundmgr_openal.cxx:35:
/usr/include/c++/5/cmath:641:5: note: ‘std::isnan’
isnan(_Tp __x)
^
simgear/CMakeFiles/SimGearScene.dir/build.make:3062: recipe for target 'simgear/CMakeFiles/SimGearScene.dir/sound/soundmgr_openal.cxx.o' failed
make[2]: *** [simgear/CMakeFiles/SimGearScene.dir/sound/soundmgr_openal.cxx.o] Error 1
CMakeFiles/Makefile2:1158: recipe for target 'simgear/CMakeFiles/SimGearScene.dir/all' failed
make[1]: *** [simgear/CMakeFiles/SimGearScene.dir/all] Error 2
Makefile:149: recipe for target 'all' failed
make: *** [all] Error 2


I am compiling with download_and_compile.sh on Ubuntu 16.04LTS.

I scanned the forum to see if this had been noticed by others, but other than a few old posts, I did not find recent references to 'isnan'.
Is there something wrong in my environment?
Does anybody else notice this?

cheers
Michiel
Last edited by mifi on Wed Nov 02, 2016 2:55 pm, edited 3 times in total.
mifi
 
Posts: 327
Joined: Mon Jul 23, 2007 3:24 pm
Location: NL
Version: git next
OS: Ubuntu 18.04.x Gnome

Re: isnan problem while compiling simgear

Postby bugman » Wed Oct 26, 2016 12:57 pm

This was reported on the devel mailing list, and James has just pushed a fix for it.

Regards,
Edward
bugman
Moderator
 
Posts: 1799
Joined: Thu Mar 19, 2015 9:01 am
Version: next

Re: isnan problem while compiling simgear

Postby mifi » Wed Oct 26, 2016 3:38 pm

Ok. Thanks for the fast reaction.
I am compiling as we speak and let you know.

EDIT: Nope, I still have the same error, so I guess I did not get the fixed version of soundmgr_openal_private.hxx yet.
I will wait a bit for the change to come through.

m
mifi
 
Posts: 327
Joined: Mon Jul 23, 2007 3:24 pm
Location: NL
Version: git next
OS: Ubuntu 18.04.x Gnome

Re: isnan problem while compiling simgear

Postby bugman » Wed Oct 26, 2016 7:42 pm

Are you sure? The isnan() function in soundmgr_openal_private.hxx is from the standard library (std::isnan()), and this instance should not be an issue. Actually, that is not where I had problems with the isnan() function. Which CMake and gcc versions are you using? What do you see if you compile with "make VERBOSE=1". For example for the soundmgr_openal.cxx file, I see:

Code: Select all
cd /flightgear/src/flightgear-simgear/build_debug/simgear && /usr/share/colorgcc/c++   -DHAVE_CONFIG_H -DHAVE_EXPAT_CONFIG_H -DHAVE_INTTYPES_H -DXML_STATIC -std=c++11  -Wall -Wno-unused-local-typedefs  -DBOOST_BIMAP_DISABLE_SERIALIZATION -g -I/flightgear/src/flightgear-simgear/build_debug/simgear -I/flightgear/src/flightgear-simgear/simgear/canvas/ShivaVG/include -I/flightgear/src/flightgear-simgear -I/flightgear/src/flightgear-simgear/build_debug -I/usr/include/AL -I/flightgear/include -I/flightgear/src/flightgear-simgear/3rdparty/expat -I/flightgear/src/flightgear-simgear/build_debug/3rdparty/expat -I/flightgear/src/flightgear-simgear/3rdparty/utf8/source -I/flightgear/src/flightgear-simgear/3rdparty/udns    -o CMakeFiles/SimGearScene.dir/sound/soundmgr_openal.cxx.o -c /flightgear/src/flightgear-simgear/simgear/sound/soundmgr_openal.cxx


Regards,
Edward
bugman
Moderator
 
Posts: 1799
Joined: Thu Mar 19, 2015 9:01 am
Version: next

Re: isnan problem while compiling simgear

Postby mifi » Thu Oct 27, 2016 7:20 am

Hmmm, this morning there still was a problem:

Code (): Select all
In file included from /home/mifi/Software/Sources/fgfs53/next/simgear/simgear/sound/soundmgr_openal.cxx:43:0:
/home/mifi/Software/Sources/fgfs53/next/simgear/simgear/sound/soundmgr_openal_private.hxx: In function ‘bool isNaN(float*)’:
/home/mifi/Software/Sources/fgfs53/next/simgear/simgear/sound/soundmgr_openal_private.hxx:77:22: error: ‘isnan’ was not declared in this scope
return (isnan(v[0]) || isnan(v[1]) || isnan(v[2]));
^
/home/mifi/Software/Sources/fgfs53/next/simgear/simgear/sound/soundmgr_openal_private.hxx:77:22: note: suggested alternative:
In file included from /usr/include/c++/5/random:38:0,
from /usr/include/c++/5/bits/stl_algo.h:66,
from /usr/include/c++/5/algorithm:62,
from /home/mifi/Software/Sources/fgfs53/next/simgear/simgear/sound/soundmgr_openal.cxx:35:
/usr/include/c++/5/cmath:641:5: note: ‘std::isnan’
isnan(_Tp __x)
^


Michiel
mifi
 
Posts: 327
Joined: Mon Jul 23, 2007 3:24 pm
Location: NL
Version: git next
OS: Ubuntu 18.04.x Gnome

Re: isnan problem while compiling simgear

Postby mifi » Thu Oct 27, 2016 7:26 am

I have versions:
Cmake 3.5.1
gcc 4.8.5

I will have a look al make VERBOSE=1
Michiel
mifi
 
Posts: 327
Joined: Mon Jul 23, 2007 3:24 pm
Location: NL
Version: git next
OS: Ubuntu 18.04.x Gnome

Re: isnan problem while compiling simgear

Postby mifi » Thu Oct 27, 2016 7:38 am

hi

Thanks for your help, Edward.
The output of make VERBOSE=1 is this: (I did not see a difference with your output that I would detect as the problem, but who am I?)

Code (): Select all
cd /home/mifi/Software/Sources/fgfs53/next/build/simgear/simgear && /usr/bin/c++ -DHAVE_CONFIG_H -DHAVE_EXPAT_CONFIG_H -DHAVE_INTTYPES_H -DXML_STATIC -I/home/mifi/Software/Sources/fgfs53/next/build/simgear/simgear -I/home/mifi/Software/Sources/fgfs53/next/simgear/simgear/canvas/ShivaVG/include -I/home/mifi/Software/Sources/fgfs53/next/simgear -I/home/mifi/Software/Sources/fgfs53/next/build/simgear -I/usr/include/AL -I/home/mifi/Software/Sources/fgfs53/next/simgear/3rdparty/expat -I/home/mifi/Software/Sources/fgfs53/next/build/simgear/3rdparty/expat -I/home/mifi/Software/Sources/fgfs53/next/simgear/3rdparty/utf8/source -I/home/mifi/Software/Sources/fgfs53/next/simgear/3rdparty/udns -Wall -Wno-unused-local-typedefs -DBOOST_BIMAP_DISABLE_SERIALIZATION -O3 -DNDEBUG -std=gnu++11 -o CMakeFiles/SimGearScene.dir/sound/soundmgr_openal.cxx.o -c /home/mifi/Software/Sources/fgfs53/next/simgear/simgear/sound/soundmgr_openal.cxx
In file included from /home/mifi/Software/Sources/fgfs53/next/simgear/simgear/sound/soundmgr_openal.cxx:41:0:
/home/mifi/Software/Sources/fgfs53/next/simgear/simgear/sound/soundmgr.hxx:331:10: warning: ‘template<class> class std::auto_ptr’ is deprecated [-Wdeprecated-declarations]
std::auto_ptr<SoundManagerPrivate> d;
^
In file included from /usr/include/c++/5/memory:81:0,
from /home/mifi/Software/Sources/fgfs53/next/simgear/simgear/sound/soundmgr.hxx:36,
from /home/mifi/Software/Sources/fgfs53/next/simgear/simgear/sound/soundmgr_openal.cxx:41:
/usr/include/c++/5/bits/unique_ptr.h:49:28: note: declared here
template<typename> class auto_ptr;
^
In file included from /home/mifi/Software/Sources/fgfs53/next/simgear/simgear/sound/soundmgr_openal.cxx:43:0:
/home/mifi/Software/Sources/fgfs53/next/simgear/simgear/sound/soundmgr_openal_private.hxx: In function ‘bool isNaN(float*)’:
/home/mifi/Software/Sources/fgfs53/next/simgear/simgear/sound/soundmgr_openal_private.hxx:77:22: error: ‘isnan’ was not declared in this scope
return (isnan(v[0]) || isnan(v[1]) || isnan(v[2]));
^
/home/mifi/Software/Sources/fgfs53/next/simgear/simgear/sound/soundmgr_openal_private.hxx:77:22: note: suggested alternative:
In file included from /usr/include/c++/5/random:38:0,
from /usr/include/c++/5/bits/stl_algo.h:66,
from /usr/include/c++/5/algorithm:62,
from /home/mifi/Software/Sources/fgfs53/next/simgear/simgear/sound/soundmgr_openal.cxx:35:
/usr/include/c++/5/cmath:641:5: note: ‘std::isnan’
isnan(_Tp __x)
^
simgear/CMakeFiles/SimGearScene.dir/build.make:3062: recipe for target 'simgear/CMakeFiles/SimGearScene.dir/sound/soundmgr_openal.cxx.o' failed
make[2]: *** [simgear/CMakeFiles/SimGearScene.dir/sound/soundmgr_openal.cxx.o] Error 1


Michiel
mifi
 
Posts: 327
Joined: Mon Jul 23, 2007 3:24 pm
Location: NL
Version: git next
OS: Ubuntu 18.04.x Gnome

Re: isnan problem while compiling simgear

Postby mifi » Thu Oct 27, 2016 7:42 am

I did notice something peculiar that might give different results on windows and Linux.

In the build directory build/simgear I noticed there are two subdirs:

build/simgear/simgear and
build/simgear/SimGear containing just SimGearConfig.cmake and SimGearConfigVersion.cmake.

Notice the capitals.
Is this as expected?
Michiel
mifi
 
Posts: 327
Joined: Mon Jul 23, 2007 3:24 pm
Location: NL
Version: git next
OS: Ubuntu 18.04.x Gnome

Re: isnan problem while compiling simgear

Postby bugman » Thu Oct 27, 2016 7:48 am

mifi wrote in Thu Oct 27, 2016 7:42 am:build/simgear/simgear and
build/simgear/SimGear containing just SimGearConfig.cmake and SimGearConfigVersion.cmake.


This is correct. Well, the directories should be simply build/simgear and build/SimGear, but maybe you created a base 'build/simgear' directory and ran CMake from there.

Regards,
Edward
bugman
Moderator
 
Posts: 1799
Joined: Thu Mar 19, 2015 9:01 am
Version: next

Re: isnan problem while compiling simgear

Postby mifi » Thu Oct 27, 2016 8:13 am

Ok. Thanks. I did, yes. I removed the build/simgear and rebuilt simgear.
Same result as before.
It fails on 'return (isnan(v[0]) || isnan(v[1]) || isnan(v[2]));' in 'soundmgr_openal_private.hxx:77:22: error: ‘isnan’ was not declared in this scope' when included from 'soundmgr_openal.cxx:43:0'

Regards,
Michiel
mifi
 
Posts: 327
Joined: Mon Jul 23, 2007 3:24 pm
Location: NL
Version: git next
OS: Ubuntu 18.04.x Gnome

Re: isnan problem while compiling simgear

Postby bugman » Thu Oct 27, 2016 8:43 am

Can you test changing:

Code: Select all
#if defined(HAVE_STD_ISNAN) && !defined(HAVE_ISNAN)
using std::isnan;
#endif

to simply:

Code: Select all
using std::isnan;

Regards,
Edward
bugman
Moderator
 
Posts: 1799
Joined: Thu Mar 19, 2015 9:01 am
Version: next

Re: isnan problem while compiling simgear

Postby mifi » Thu Oct 27, 2016 9:34 am

That seems to have worked, Edward.

EDIT: Confirmed. I have now fully generated a working flightgear with the workaround version of simgear. So why are those variables not set as expected? Would it be possible that both HAVE_STD_ISNAN and HAVE_ISNAN are defined?

Regards,
Michiel
mifi
 
Posts: 327
Joined: Mon Jul 23, 2007 3:24 pm
Location: NL
Version: git next
OS: Ubuntu 18.04.x Gnome

Re: isnan problem while compiling simgear

Postby mifi » Thu Oct 27, 2016 10:05 am

In CMakeCache.txt I found:

774: //Test HAVE_ISNAN
775: HAVE_ISNAN:INTERNAL=1

786: //Test HAVE_STD_ISNAN
787: HAVE_STD_ISNAN:INTERNAL=1

I do not quite know what it is I am looking at here, but perhaps it helps?

Regards
Michiel
mifi
 
Posts: 327
Joined: Mon Jul 23, 2007 3:24 pm
Location: NL
Version: git next
OS: Ubuntu 18.04.x Gnome

Re: isnan problem while compiling simgear

Postby bugman » Thu Oct 27, 2016 3:29 pm

This is quite strange, as these are set in the CMakeLists.txt file in the base simgear directory:

Code: Select all
# isnan might not be real symbol, so can't check using function_exists
check_cxx_source_compiles(
    "#include <cmath>
    int main() { return isnan(0.0);} "
    HAVE_ISNAN)

check_cxx_source_compiles(
    "#include <cmath>
    int main() { return std::isnan(0.0);} "
    HAVE_STD_ISNAN)


The second test with std::isnan() should have worked. Can you try a clean build? I.e. with no files in the build directory, except maybe a ".cmake" script.

Cheers,
Edward
bugman
Moderator
 
Posts: 1799
Joined: Thu Mar 19, 2015 9:01 am
Version: next

Re: isnan problem while compiling simgear

Postby mifi » Thu Oct 27, 2016 4:51 pm

You think the second one failed? What if they both succeed?

I have rm -rf'ed build/simgear several times already, but I will remove the entire build tree, revert the changes to soundmgr_openal_private.hxx and try again and report back.

m
mifi
 
Posts: 327
Joined: Mon Jul 23, 2007 3:24 pm
Location: NL
Version: git next
OS: Ubuntu 18.04.x Gnome

Next

Return to Compiling

Who is online

Users browsing this forum: No registered users and 1 guest