FreeBSD 10 + clang + 0.5.1 r1 (ports)

Trying to build your own version of Vega Strike and having problems? Unix users, paste your config.log here (stderr output alone is not helpful).

FreeBSD 10 + clang + 0.5.1 r1 (ports)

Postby PYO » Wed May 21, 2014 4:07 pm

Have a problem with building from ports:

Code: Select all
In file included from src/networking/fileutil.cpp:1:
In file included from ./src/cmd/unit_generic.h:41:
In file included from ./src/vs_globals.h:6:
In file included from ./src/universe_generic.h:28:
In file included from ./src/star_system_generic.h:7:
In file included from ./src/xml_support.h:10:
In file included from ./src/hashtable.h:25:
In file included from ./src/gnuhash.h:61:
In file included from /usr/include/c++/v1/ext/hash_map:206:
/usr/include/c++/v1/ext/__hash:22:61: error: implicit instantiation of undefined
      template 'std::__1::hash<std::__1::__wrap_iter<easyDomNode **> >'
template <typename T> struct _LIBCPP_TYPE_VIS hash : public std::hash<T>
                                                            ^
/usr/include/c++/v1/type_traits:887:38: note: in instantiation of template class
      '__gnu_cxx::hash<std::__1::__wrap_iter<easyDomNode **> >' requested here
    : public integral_constant<bool, __is_empty(_Tp)> {};
                                     ^
/usr/include/c++/v1/ext/hash_map:218:42: note: in instantiation of template
      class
      'std::__1::is_empty<__gnu_cxx::hash<std::__1::__wrap_iter<easyDomNode **>
      > >' requested here
template <class _Tp, class _Hash, bool = is_empty<_Hash>::value
                                         ^
/usr/include/c++/v1/ext/hash_map:490:13: note: in instantiation of default
      argument for
      '__hash_map_hasher<std::__1::pair<std::__1::__wrap_iter<easyDomNode **>,
      unsigned int>, __gnu_cxx::hash<std::__1::__wrap_iter<easyDomNode **> > >'
      required here
    typedef __hash_map_hasher<__value_type, hasher>   __hasher;
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
./src/SharedPool.h:20:22: note: in instantiation of template class
      '__gnu_cxx::hash_map<std::__1::__wrap_iter<easyDomNode **>, unsigned int,
      __gnu_cxx::hash<std::__1::__wrap_iter<easyDomNode **> >,
      std::__1::equal_to<std::__1::__wrap_iter<easyDomNode **> >,
      std::__1::allocator<std::__1::pair<const std::__1::__wrap_iter<easyDomNode
      **>, unsigned int> > >' requested here
    ReferenceCounter referenceCounter;
                     ^
./src/SharedPool.h:211:33: note: in instantiation of template class
      'SharedPool<std::__1::__wrap_iter<easyDomNode **>,
      __gnu_cxx::hash_compare<std::__1::__wrap_iter<easyDomNode **>,
      std::__1::less<std::__1::__wrap_iter<easyDomNode **> > > >' requested here
bool operator==( const typename SharedPool< T >::Reference &r, const T &s )
                                ^
./src/SharedPool.h:211:6: note: while substituting deduced template arguments
      into function template 'operator==' [with T =
      std::__1::__wrap_iter<easyDomNode **>]
bool operator==( const typename SharedPool< T >::Reference &r, const T &s )
     ^
./src/easydom.h:102:46: note: in instantiation of function template
      specialization
      'std::__1::operator!=<easyDomNode *const *, easyDomNode **>' requested
      here
        for (siter = subnodes.begin(); siter != subnodes.end(); siter++) {
                                             ^
/usr/include/c++/v1/memory:3129:29: note: template is declared here
template <class _Tp> struct hash;
                            ^
1 warning and 7 errors generated.


I guess it's something todo with src/gnuhash.h, because the warning is "/usr/include/c++/v1/ext/hash_map:209:2: warning: Use of the header
<ext/hash_map> is deprecated. Migrate to <unordered_map> [-W#warnings]"
Attachments
config.log
(177.27 KiB) Downloaded 80 times
PYO
Star Pilot
Star Pilot
 
Posts: 7
Topics: 1
Joined: Wed May 21, 2014 3:32 pm

Share On:

Share on Facebook Facebook Share on Twitter Twitter Share on Digg Digg

Re: FreeBSD 10 + clang + 0.5.1 r1 (ports)

Postby loki1950 » Wed May 21, 2014 8:13 pm

Welcome aboard PYO haven't seen a config log in a while since we moved to cmake and I am not very familiar with C/C++ so don't know exactly how to remedy this hopefully someone who does will see this before to long.

Enjoy the Choice :)
my box::HP Envy i5-6400 @2Q70GHzx4 8 Gb ram/1 Tb(Win10 64)/3 Tb Mint 18/GTX745 4Gb acer S243HL K222HQL
Q8200/Asus P5QDLX/8 Gb ram/WD 2Tb 2-500 G HD/GF GT640 2Gb Mint 17.3 64 bit Win 10 32 bit acer and DELL E6400 4GB ram/100 GB HD Mint 17.3 6
User avatar
loki1950
The Shepherd
 
Posts: 5715
Topics: 51
Joined: Fri May 13, 2005 1:37 pm
Location: Ottawa

Re: FreeBSD 10 + clang + 0.5.1 r1 (ports)

Postby ezee » Thu May 22, 2014 10:49 am

Hello .
I am a windows dev , and i only can help you in the c++ side .
From what i understand , the real problem is with :

error: implicit instantiation of undefined
template 'std::__1::hash<std::__1::__wrap_iter<easyDomNode **> >'
template <typename T> struct _LIBCPP_TYPE_VIS hash : public std::hash<T>


Portable code is always done with a lot of defines , to allow the port to different systems/os.

It seem to me that your project must be configured so it allow the std:: lib to be known .
So may be you'll need to add a define in the preprocessor options .

Perhaps ask your problem to the clang forums , i guess this problem is well known .
Sorry , i can't help better .

Alternative is to use Gcc instead of Clang to compile ?

EDIT : Okay , i just realized you provided a config.log

The error is :

line 1097 in config.log
1 error generated.
configure:2049: $? = 1
configure: failed program was:
| /* confdefs.h. */


That seem to lead to a cascade fails , that concern the std:: lib :
in line 1116 :
configure:1998: c++ -c -O2 -pipe -fno-strict-aliasing -I/usr/local/include conftest.cc >&5
conftest.cc:9:17: error: use of undeclared identifier 'std'
extern "C" void std::exit (int) throw (); using std::exit;
^
conftest.cc:9:49: error: use of undeclared identifier 'std'
extern "C" void std::exit (int) throw (); using std::exit;
^
2 errors generated.


I will try to trace that ...


EDIT 2 :

The very first error is specific to Clang/compiler side i think :

line 1042
FreeBSD clang version 3.3 (tags/RELEASE_33/final 183502) 20130610
Target: x86_64-unknown-freebsd10.0
Thread model: posix
configure:1634: $? = 0
configure:1636: c++ -V </dev/null >&5
c++: error: argument to '-V' is missing (expected 1 value)
c++: error: no input files


This error could introduce the following errors , if -V is used to compute the defines .
But i'm a poor windows dev , and i can't help you further .
good luck !
:wink:

Edit3 : You definitivly have a problem with the paths in your config .
The config log shows that Al,Gl,Glut etc are also missing for the compiler .
I see that all the critical #defines are done in the file :
/* confdefs.h. */


It is may be a configuration problem only .
Sorry , i only know how to configure visual studio for windows .
:(
Code: Select all
 if (!track.HasWeapons())
            {
                // So what are you going to threaten me with? Exhaustion gas?
                return ThreatLevel::None;
            }

Vegastrike evolved
DEV YOUTUBE CHANNEL
Vegastrike evolved wiki
ezee
Intrepid Venturer
Intrepid Venturer
 
Posts: 703
Topics: 65
Joined: Mon Feb 10, 2014 5:47 pm
Location: FRANCE

Re: FreeBSD 10 + clang + 0.5.1 r1 (ports)

Postby PYO » Thu May 22, 2014 1:57 pm

Tried gcc 4.7, got other error:
Code: Select all
In file included from ./src/cmd/unit_generic.h:61:0,
                 from src/gfx/vdu.h:5,
                 from src/gfx/cockpit.h:18,
                 from src/gfx/cockpit.cpp:18:
./src/cmd/collide_map.h: In member function 'void Collidable::SetPosition(const QVector&)':
./src/cmd/collide_map.h:38:14: error: 'isnan' was not declared in this scope
./src/cmd/collide_map.h:38:14: note: suggested alternative:
Attachments
config.log
(179.66 KiB) Downloaded 73 times
Last edited by PYO on Thu May 22, 2014 2:05 pm, edited 1 time in total.
PYO
Star Pilot
Star Pilot
 
Posts: 7
Topics: 1
Joined: Wed May 21, 2014 3:32 pm

Re: FreeBSD 10 + clang + 0.5.1 r1 (ports)

Postby ezee » Thu May 22, 2014 2:03 pm

mm...
That seem to be better , the error is Vegastrike specific .

./src/cmd/collide_map.h:38:14: error: 'isnan' was not declared in this scope


Probably again a #define that don't work somewhere .
' isnan ' seem to be not compatible for you .

The best way to understand what's going on here is to open collide_map.h and check the
portable code .
I' m gonna have a look for you on that .

EDIT : Please paste your full error log .

I've found in collide_map.h ( http://spacetechs.free.fr/VEGASTRIKEDEV ... ource.html )

#if defined (_WIN32) || __GNUC__ != 2
7 #include <limits>
8 #endif
9 #include <vector>


I guess you use a wrong version definition ( limits or vector ) , that lead to a bad interpretation of isnan method , running in a wrong context .

I will try to see the line where isnan is invoked , and trace it to understand .
:wink:

Edit : Done !

Look :
#ifdef __APPLE__
34 if ( !FINITE( getKey() ) )
35 position = QVector( 0, 0, 0 ); //hack for now
36
37 #else
38 if ( ISNAN( getKey() ) )

39 position = QVector( 0, 0, 0 ); //hack for now
40 #endif


I wonder if you run on Apple , because if it's the case , you will have to change your projects options . Your system should use FINITE instead of ISNAN .
If u use an Apple , you have more details about that common problem :

I've been using isinf, isnan functions on Linux platforms which worked perfectly. But this didn't work on OS-X, so I decided to use std::isinf std::isnan which works on both Linux and OS-X.
source :how do I make a portable isnan/isinf function
Last edited by ezee on Thu May 22, 2014 2:25 pm, edited 1 time in total.
Code: Select all
 if (!track.HasWeapons())
            {
                // So what are you going to threaten me with? Exhaustion gas?
                return ThreatLevel::None;
            }

Vegastrike evolved
DEV YOUTUBE CHANNEL
Vegastrike evolved wiki
ezee
Intrepid Venturer
Intrepid Venturer
 
Posts: 703
Topics: 65
Joined: Mon Feb 10, 2014 5:47 pm
Location: FRANCE

Re: FreeBSD 10 + clang + 0.5.1 r1 (ports)

Postby PYO » Thu May 22, 2014 2:20 pm

I guess it's full log with error, since output is scrambled :) for me.

Code: Select all
if g++47 -DHAVE_CONFIG_H -I. -I. -I.   -DBOOST_PYTHON_NO_PY_SIGNATURES -DBOOST_PYTHON_STATIC_LIB -I./boost/1_45 -I/usr/local/include   -DHAVE_SDL=1 -DSDL_WINDOWING=1      -DHAVE_AL=1   -DHAVE_OGG  -DNV_CUBE_MAP=1 -DDATA_DIR=\"/usr/local/share/vegastrike\"  -I/usr/local/include/python2.7 -DHAVE_PYTHON=1    -I./src   -pipe -Wl,-rpath=/usr/local/lib/gcc47 -fno-strict-aliasing -Wl,-rpath=/usr/local/lib/gcc47 -pipe -DNV_CUBE_MAP -O2 -pipe -Wl,-rpath=/usr/local/lib/gcc47 -fno-strict-aliasing -Wl,-rpath=/usr/local/lib/gcc47 -I/usr/local/include/SDL -I/usr/local/include -D_GNU_SOURCE=1 -D_REENTRANT -D_THREAD_SAFE -pthread -MT src/gfx/coord_select.o -MD -MP -MF "$depbase.Tpo" -c -o src/gfx/coord_select.o src/gfx/coord_select.cpp; \
then mv -f "$depbase.Tpo" "$depbase.Po"; else rm -f "$depbase.Tpo"; exit 1; fi
In file included from ./src/cmd/unit_generic.h:61:0,
                 from src/gfx/vdu.h:5,
                 from src/gfx/cockpit.h:18,
                 from src/gfx/cockpit.cpp:18:
./src/cmd/collide_map.h: In member function 'void Collidable::SetPosition(const QVector&)':
./src/cmd/collide_map.h:38:14: error: 'isnan' was not declared in this scope
./src/cmd/collide_map.h:38:14: note: suggested alternative:
In file included from /usr/local/lib/gcc47/include/c++/complex:44:0,
                 from ./boost/1_45/boost/python/converter/builtin_converters.hpp:13,
                 from ./boost/1_45/boost/python/converter/arg_to_python.hpp:17,
                 from ./boost/1_45/boost/python/call.hpp:15,
                 from ./boost/1_45/boost/python/object_core.hpp:14,
                 from ./boost/1_45/boost/python/object.hpp:9,
                 from src/gfx/cockpit.cpp:8:
/usr/local/lib/gcc47/include/c++/cmath:839:5: note:   'std::isnan'
In file included from ./src/cmd/unit_generic.h:61:0,
                 from src/gfx/vdu.h:5,
                 from src/gfx/cockpit.h:18,
                 from src/gfx/cockpit.cpp:18:
./src/cmd/collide_map.h: In constructor 'Collidable::Collidable(unsigned int, float, const QVector&)':
./src/cmd/collide_map.h:79:13: error: 'isnan' was not declared in this scope
./src/cmd/collide_map.h:79:13: note: suggested alternative:
In file included from /usr/local/lib/gcc47/include/c++/complex:44:0,
                 from ./boost/1_45/boost/python/converter/builtin_converters.hpp:13,
                 from ./boost/1_45/boost/python/converter/arg_to_python.hpp:17,
                 from ./boost/1_45/boost/python/call.hpp:15,
                 from ./boost/1_45/boost/python/object_core.hpp:14,
                 from ./boost/1_45/boost/python/object.hpp:9,
                 from src/gfx/cockpit.cpp:8:
/usr/local/lib/gcc47/include/c++/cmath:839:5: note:   'std::isnan'
depbase=`echo src/gfx/env_map_gent.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`; \
if g++47 -DHAVE_CONFIG_H -I. -I. -I.   -DBOOST_PYTHON_NO_PY_SIGNATURES -DBOOST_PYTHON_STATIC_LIB -I./boost/1_45 -I/usr/local/include   -DHAVE_SDL=1 -DSDL_WINDOWING=1      -DHAVE_AL=1   -DHAVE_OGG  -DNV_CUBE_MAP=1 -DDATA_DIR=\"/usr/local/share/vegastrike\"  -I/usr/local/include/python2.7 -DHAVE_PYTHON=1    -I./src   -pipe -Wl,-rpath=/usr/local/lib/gcc47 -fno-strict-aliasing -Wl,-rpath=/usr/local/lib/gcc47 -pipe -DNV_CUBE_MAP -O2 -pipe -Wl,-rpath=/usr/local/lib/gcc47 -fno-strict-aliasing -Wl,-rpath=/usr/local/lib/gcc47 -I/usr/local/include/SDL -I/usr/local/include -D_GNU_SOURCE=1 -D_REENTRANT -D_THREAD_SAFE -pthread -MT src/gfx/env_map_gent.o -MD -MP -MF "$depbase.Tpo" -c -o src/gfx/env_map_gent.o src/gfx/env_map_gent.cpp; \
then mv -f "$depbase.Tpo" "$depbase.Po"; else rm -f "$depbase.Tpo"; exit 1; fi
gmake[3]: *** [src/gfx/cockpit.o] Ошибка 1



UPD 1 I'm running AMD64 based system.
PYO
Star Pilot
Star Pilot
 
Posts: 7
Topics: 1
Joined: Wed May 21, 2014 3:32 pm

Re: FreeBSD 10 + clang + 0.5.1 r1 (ports)

Postby ezee » Thu May 22, 2014 2:30 pm

Thank you for your reports .
I will study this report and tell you more after that .
Amd64 , check .
:)

EDIT :

I noticed in the log :
./src/cmd/collide_map.h:38:14: note: suggested alternative:
In file included from /usr/local/lib/gcc47/include/c++/complex:44:0,
from ./boost/1_45/boost/python/converter/builtin_converters.hpp:13,
from ./boost/1_45/boost/python/converter/arg_to_python.hpp:17,
from ./boost/1_45/boost/python/call.hpp:15,
from ./boost/1_45/boost/python/object_core.hpp:14,
from ./boost/1_45/boost/python/object.hpp:9,
from src/gfx/cockpit.cpp:8:
/usr/local/lib/gcc47/include/c++/cmath:839:5: note: 'std::isnan'


Does that mean that the compiler suggestion is to use the std::isnan version ?
Probably .

What to do now ?
I don't know , i 'll think about that .
More info about this error :
In these versions of g++ isnan is defined as a macro in <math.h> unless <cmath> is included, in which case std::isnan() is defined instead. The configure script (config/lf_cxx.m4) uses <math.h> and thus doesn't find std::isnan(), but (since revision 4108) gr_math.h includes <gr_complex.h> which indirectly includes <cmath>. So std::isnan() is defined, but CXX_HAS_STD_ISNAN is not defined, and isnan (as a macro) is not defined.
source : http://gnuradio.org/redmine/issues/117

A lot of projects seem to be affected by the same problems , not only Vegastrike .
I think that is due to a compiler version that differs from the old defined in the sources files.

g++47 ?
if g++47 -DHAVE_CONFIG_H -I. -I. -I. -DBOOST_PYTHON_NO_PY_SIGNATURES -DBOOST_PYTHON_STATIC_LIB -I./boost/1_45 -I/usr/local/include -DHAVE_SDL=1 -DSDL_WINDOWING=1 -DHAVE_AL=1 -DHAVE_OGG -DNV_CUBE_MAP=1 -DDATA_DIR=\"/usr/local/share/vegastrike\" -I/usr/local/include/python2.7 -DHAVE_PYTHON=1 -I./src -pipe -Wl,-rpath=/usr/local/lib/gcc47 -fno-strict-aliasing -Wl,-rpath=/usr/local/lib/gcc47 -pipe -DNV_CUBE_MAP -O2 -pipe -Wl,-rpath=/usr/local/lib/gcc47 -fno-strict-aliasing -Wl,-rpath=/usr/local/lib/gcc47 -I/usr/local/include/SDL -I/usr/local/include -D_GNU_SOURCE=1 -D_REENTRANT -D_THREAD_SAFE -pthread -MT src/gfx/coord_select.o -MD -MP -MF "$depbase.Tpo" -c -o src/gfx/coord_select.o src/gfx/coord_select.cpp; \
then mv -f "$depbase.Tpo" "$depbase.Po"; else rm -f "$depbase.Tpo"; exit 1; fi
Code: Select all
 if (!track.HasWeapons())
            {
                // So what are you going to threaten me with? Exhaustion gas?
                return ThreatLevel::None;
            }

Vegastrike evolved
DEV YOUTUBE CHANNEL
Vegastrike evolved wiki
ezee
Intrepid Venturer
Intrepid Venturer
 
Posts: 703
Topics: 65
Joined: Mon Feb 10, 2014 5:47 pm
Location: FRANCE

Re: FreeBSD 10 + clang + 0.5.1 r1 (ports)

Postby PYO » Thu May 22, 2014 2:52 pm

g++47 and many others like gcc47, etc, because system is clang:

Code: Select all
% cc -v
FreeBSD clang version 3.3 (tags/RELEASE_33/final 183502) 20130610
Target: x86_64-unknown-freebsd10.0
Thread model: posix
% gcc47 -v
Using built-in specs.
COLLECT_GCC=gcc47
COLLECT_LTO_WRAPPER=/usr/local/libexec/gcc47/gcc/x86_64-portbld-freebsd10.0/4.7.3/lto-wrapper
Target: x86_64-portbld-freebsd10.0
Configured with: ./../gcc-4.7.3/configure --disable-bootstrap --disable-nls --enable-gnu-indirect-function --libdir=/usr/local/lib/gcc47 --libexecdir=/usr/local/libexec/gcc47 --program-suffix=47 --with-as=/usr/local/bin/as --with-gmp=/usr/local --with-gxx-include-dir=/usr/local/lib/gcc47/include/c++/ --with-ld=/usr/local/bin/ld --with-pkgversion='FreeBSD Ports Collection' --with-system-zlib --with-ecj-jar=/usr/local/share/java/ecj-4.5.jar --enable-languages=c,c++,objc,fortran,java --prefix=/usr/local --mandir=/usr/local/man --infodir=/usr/local/info/gcc47 --build=x86_64-portbld-freebsd10.0
Thread model: posix
gcc version 4.7.3 (FreeBSD Ports Collection)
%


I can install other versions. this one was installed by port (software), that only builds with it.

Thank you for help. I'll try to learn config.log with clang.

I'll always know that ISO party has great people and always searched a their system, however it was far away from start ;)
PYO
Star Pilot
Star Pilot
 
Posts: 7
Topics: 1
Joined: Wed May 21, 2014 3:32 pm

Re: FreeBSD 10 + clang + 0.5.1 r1 (ports)

Postby ezee » Thu May 22, 2014 4:13 pm

Ok , good luck !
:)
Code: Select all
 if (!track.HasWeapons())
            {
                // So what are you going to threaten me with? Exhaustion gas?
                return ThreatLevel::None;
            }

Vegastrike evolved
DEV YOUTUBE CHANNEL
Vegastrike evolved wiki
ezee
Intrepid Venturer
Intrepid Venturer
 
Posts: 703
Topics: 65
Joined: Mon Feb 10, 2014 5:47 pm
Location: FRANCE

Re: FreeBSD 10 + clang + 0.5.1 r1 (ports)

Postby PYO » Thu May 22, 2014 4:48 pm

there is no problem in config.log.

The problem is in gnuhash.h (at least by now).

I have HAVE_TR1_UNORDERED_MAP set, however it's unset by line 9.

I removed this block and remove tr1 from path in lines 15-17.

Now clang complains about line 101, I'm stuck how if's are used. Maybe this code is not in use when HAVE_TR1_UNORDERED_MAP set?
PYO
Star Pilot
Star Pilot
 
Posts: 7
Topics: 1
Joined: Wed May 21, 2014 3:32 pm

Re: FreeBSD 10 + clang + 0.5.1 r1 (ports)

Postby ezee » Thu May 22, 2014 6:02 pm

woaw...
:mrgreen:

//The following block is to only use tr1 from at least 4.3 since 4.2 apparently bugs out.
5 //Windows is untested at the moment.
6 #ifdef HAVE_TR1_UNORDERED_MAP
7 #ifndef WIN32
8 #if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 3)
9 #undef HAVE_TR1_UNORDERED_MAP

10 #endif
11 #endif
12 #endif
13
14 #ifdef HAVE_TR1_UNORDERED_MAP
15 #define vsUMap std::tr1::unordered_map
16 #define vsHashComp std::tr1::hash_compare
17 #define vsHash std::tr1::hash

18 #else
19 #define vsUMap stdext::hash_map
20 #define vsHashComp stdext::hash_compare
21 #define vsHash stdext::hash
22 #endif
23
24 #ifdef _WIN32
25 #ifdef HAVE_TR1_UNORDERED_MAP
26 #if defined(_MSC_VER) && _MSC_VER >= 1600
27 #include <unordered_map> //MSVC doesn't use tr1 dirs
28 #else
29 #include <tr1/unordered_map>
30 #endif
31 #else
32 #include <hash_map>
33 #endif
34 #else //#ifdef _WIN32 { ... } else ...
35 #if __GNUC__ == 2
36 #include <map>
37 #define hash_map map
38 #define stdext std

That is really a tricky file ...
Portability means a big headache ...

There are so many defines in that file ...
Normally , the changes are to be made at the preprocessor level , in commands .
If you start to change manually the defines in source , you will have troubles with files that
are linked with , and that may use the preprocessor commands .

line 101 ?
template < >
101 class hash< const void* >
102 {
103 hash< size_t >a;
104 public:
105 size_t operator()( const void*const &key ) const
106 {
107 return a( (size_t) key );
108 }
109 };


What is the complaint from the compiler about the hash class ?
" undef HAVE_TR1_UNORDERED_MAP " seem to occur only if the compiler version is
< to 4.3 .

As you use 4.7 , you actually have them enabled .
right ?

An other define is critical :
35 #if __GNUC__ == 2
36 #include <map>
37 #define hash_map map
38 #define stdext std
39 namespace stdext
40 {
41 template < class Key, class Traits = std::less< Key > >
42 class hash_compare
43 {
44 public:
45 static const size_t bucket_size = 4;
46 static const size_t min_buckets = 8;
47 };
48 }
49
50 #include "hashtable.h"

51 #else // __GNUC__ is not equal to 2 at following
52 #ifdef HAVE_TR1_UNORDERED_MAP
53 #include <tr1/unordered_map>
54 #include "hashtable.h"
55 class Unit;
56 namespace std
57 {
58 namespace tr1
59 {


So __GNUC__ version and HAVE_TR1_UNORDERED_MAP are critical flags .
What is your __GNUC__ version ?
And please report the error logs ...
Code: Select all
 if (!track.HasWeapons())
            {
                // So what are you going to threaten me with? Exhaustion gas?
                return ThreatLevel::None;
            }

Vegastrike evolved
DEV YOUTUBE CHANNEL
Vegastrike evolved wiki
ezee
Intrepid Venturer
Intrepid Venturer
 
Posts: 703
Topics: 65
Joined: Mon Feb 10, 2014 5:47 pm
Location: FRANCE

Re: FreeBSD 10 + clang + 0.5.1 r1 (ports)

Postby PYO » Thu May 22, 2014 6:25 pm

I'm using clang.

From config.log (first with clang) it seems that HAVE_TR1_UNORDERED_MAP is set:
#define HAVE_TR1_UNORDERED_MAP 1
but the error I had is
In file included from ./src/gnuhash.h:61:
That part is used when HAVE_TR1_UNORDERED_MAP is not defined.

I removed all stuff that is not related to HAVE_TR1_UNORDERED_MAP and things got better, but:
- I have to comment namespace tr1 { - no sure what it is, but clang did not like this, complaining about namespace __1 ( :shock:)
- clang fails to compile other files which use hashes, saying that it unable to find std::__1::hash for given varibles types.

So I download trunk :) and it also:
- do not use unordered_map (gnuhash.h)
- fails on building:
Code: Select all
[ 54%] Building CXX object CMakeFiles/vegastrike.dir/src/physics.cpp.o
In file included from /usr/ports/games/vegastrike/work/vegastrike-src-0.5.1.r1/src/gldrv/gl_sphere_list_server.cpp:3:
In file included from /usr/ports/games/vegastrike/work/vegastrike-src-0.5.1.r1/src/gfx/matrix.h:26:
In file included from /usr/ports/games/vegastrike/work/vegastrike-src-0.5.1.r1/src/vs_globals.h:6:
In file included from /usr/ports/games/vegastrike/work/vegastrike-src-0.5.1.r1/src/universe_generic.h:28:
In file included from /usr/ports/games/vegastrike/work/vegastrike-src-0.5.1.r1/src/star_system_generic.h:7:
In file included from /usr/ports/games/vegastrike/work/vegastrike-src-0.5.1.r1/src/xml_support.h:10:
In file included from /usr/ports/games/vegastrike/work/vegastrike-src-0.5.1.r1/src/hashtable.h:25:
In file included from /usr/ports/games/vegastrike/work/vegastrike-src-0.5.1.r1/src/gnuhash.h:89:
/usr/include/c++/v1/ext/hash_map:209:2: warning: Use of the header <ext/hash_map> is deprecated.  Migrate to <unordered_map> [-W#warnings]
#warning Use of the header <ext/hash_map> is deprecated.  Migrate to <unordered_map>
 ^
In file included from /usr/ports/games/vegastrike/work/vegastrike-src-0.5.1.r1/src/physics.cpp:24:
In file included from /usr/ports/games/vegastrike/work/vegastrike-src-0.5.1.r1/src/gfx/quaternion.h:5:
In file included from /usr/ports/games/vegastrike/work/vegastrike-src-0.5.1.r1/src/gfx/matrix.h:26:
In file included from /usr/ports/games/vegastrike/work/vegastrike-src-0.5.1.r1/src/vs_globals.h:6:
In file included from /usr/ports/games/vegastrike/work/vegastrike-src-0.5.1.r1/src/universe_generic.h:28:
In file included from /usr/ports/games/vegastrike/work/vegastrike-src-0.5.1.r1/src/star_system_generic.h:7:
In file included from /usr/ports/games/vegastrike/work/vegastrike-src-0.5.1.r1/src/xml_support.h:10:
In file included from /usr/ports/games/vegastrike/work/vegastrike-src-0.5.1.r1/src/hashtable.h:25:
In file included from /usr/ports/games/vegastrike/work/vegastrike-src-0.5.1.r1/src/gnuhash.h:89:
In file included from /usr/include/c++/v1/ext/hash_map:203:
In file included from /usr/include/c++/v1/__hash_table:19:
/usr/include/c++/v1/cmath:1111:46: error: declaration conflicts with target of using declaration already in scope
inline _LIBCPP_INLINE_VISIBILITY float       copysign(float __x, float __y) _NOEXCEPT             {return copysignf(__x, __y);}
                                             ^
/usr/ports/games/vegastrike/work/vegastrike-src-0.5.1.r1/src/physics.h:30:7: note: target of using declaration
float copysign( float x, float y );
      ^
/usr/include/c++/v1/cmath:1108:9: note: using declaration
using ::copysign;
        ^

+ giving warnings to use:
warning: rvalue references are a C++11 extension [-Wc++11-extensions]
PYO
Star Pilot
Star Pilot
 
Posts: 7
Topics: 1
Joined: Wed May 21, 2014 3:32 pm

Re: FreeBSD 10 + clang + 0.5.1 r1 (ports)

Postby ezee » Thu May 22, 2014 6:56 pm

mm...
/usr/include/c++/v1/cmath:1111:46: error: declaration conflicts with target of using declaration already in scope
inline _LIBCPP_INLINE_VISIBILITY
float copysign(float __x, float __y) _NOEXCEPT {return copysignf(__x, __y);}


Very complicated ...
Like the msg report it , it is a target problem .
You try to build vegastrike with a system ( FreeBSD 10 + clang + 0.5.1 r1 ) that was not
considered at the time of the creation of the sources .
So i think this particular case needs a particular setup .

use clang is perhaps challenging , i don't know ...
I've found a possible way to fix the actual conflict with the inline _LIBCPP_INLINE_VISIBILITY :
Each of the macros defined and used by libc++ can be overridden.

_LIBCPP_INLINE_VISIBILITY controls how an inlined function is attributed and defaults to:

#ifndef _LIBCPP_INLINE_VISIBILITY
#define _LIBCPP_INLINE_VISIBILITY __attribute__ ((__visibility__("hidden"), __always_inline__))
#endif

You can turn this off with:

-D_LIBCPP_INLINE_VISIBILITY=""

And extern templates are done with:

#ifndef _LIBCPP_EXTERN_TEMPLATE
#define _LIBCPP_EXTERN_TEMPLATE(...) extern template __VA_ARGS__;
#endif

This latter one is more difficult to "turn off". The incantation is:

-D'_LIBCPP_EXTERN_TEMPLATE(...)='

Using either (or both) of these workarounds will silence your link error. But a bug report against clang might be a better long term solution.


from this source :clang-developers

edit : but in fact , there is two definitions for one fonction , and the compiler is lost ...
The problem is that physics.h uses :
#ifndef PHYSICS_H
23 #define PHYSICS_H
24
25 #include "gfx/vec.h"
26
27 static const float oocc = (float) 0.0000000000000000111265005605; //1/c^2
28 static const float c = (float) 299792458.0;
29 static const float co10 = (float) 29979245.8;
30 float copysign( float x, float y );


but the compiler want to use /usr/include/c++/v1/cmath version of that fonction .
So the fix would be to make a #ifndef USE CMATH , in the physics.h file .
Something like this ( physics.h line 30 :
#ifdef USE_CMATH
float copysign( float x, float y );
#endif

You can safely try that .
( but this function definition is located in an other file ... :mrgreen:
http://spacetechs.free.fr/VEGASTRIKEDEV ... tml#l00633 )
I expect the CMATH fonction is doing the same than the physics version , otherwise that
is not a solution .
Last edited by ezee on Thu May 22, 2014 7:27 pm, edited 2 times in total.
Code: Select all
 if (!track.HasWeapons())
            {
                // So what are you going to threaten me with? Exhaustion gas?
                return ThreatLevel::None;
            }

Vegastrike evolved
DEV YOUTUBE CHANNEL
Vegastrike evolved wiki
ezee
Intrepid Venturer
Intrepid Venturer
 
Posts: 703
Topics: 65
Joined: Mon Feb 10, 2014 5:47 pm
Location: FRANCE

Re: FreeBSD 10 + clang + 0.5.1 r1 (ports)

Postby PYO » Thu May 22, 2014 7:05 pm

Will try tomorrow, thank you.

Again, there is gnuhash.h in the list. I think I just need to learn how to force use <unordered_map> instead of <ext/hash_map> and build a trunk.

Yes, there are no defines for freebsd or clang, but I saw messages about compiling with clang without problems here on forum.
PYO
Star Pilot
Star Pilot
 
Posts: 7
Topics: 1
Joined: Wed May 21, 2014 3:32 pm

Re: FreeBSD 10 + clang + 0.5.1 r1 (ports)

Postby ezee » Thu May 22, 2014 7:24 pm

oh yeah , you are right , the conflict is due to :
In file included from /usr/ports/games/vegastrike/work/vegastrike-src-0.5.1.r1/src/gnuhash.h:89:
In file included from /usr/include/c++/v1/ext/hash_map:203:
In file included from /usr/include/c++/v1/__hash_table:19:
/usr/include/c++/v1/cmath:1111:46: error: declaration conflicts with target of using


So
Again, there is gnuhash.h in the list. I think I just need to learn how to force use <unordered_map> instead of <ext/hash_map> and build a trunk.


sounds good .
Perhaps you can try to send a MP to the authors of the threads that successfully compiled and linked VS with clang ?
Code: Select all
 if (!track.HasWeapons())
            {
                // So what are you going to threaten me with? Exhaustion gas?
                return ThreatLevel::None;
            }

Vegastrike evolved
DEV YOUTUBE CHANNEL
Vegastrike evolved wiki
ezee
Intrepid Venturer
Intrepid Venturer
 
Posts: 703
Topics: 65
Joined: Mon Feb 10, 2014 5:47 pm
Location: FRANCE



Return to Compiling Problems [paste config.log]

Who is online

Users browsing this forum: No registered users and 1 guest

cron