Closed rotcx closed 3 years ago
upgrade your gcc like: brew install gcc@8
upgrade your gcc like: brew install gcc@8
gcc version is 9 currently
gcc -v Using built-in specs. COLLECT_GCC=gcc-9 COLLECT_LTO_WRAPPER=/usr/local/Cellar/gcc/9.2.0_3/libexec/gcc/x86_64-apple-darwin18/9.2.0/lto-wrapper Target: x86_64-apple-darwin18 Configured with: ../configure --build=x86_64-apple-darwin18 --prefix=/usr/local/Cellar/gcc/9.2.0_3 --libdir=/usr/local/Cellar/gcc/9.2.0_3/lib/gcc/9 --disable-nls --enable-checking=release --enable-languages=c,c++,objc,obj-c++,fortran --program-suffix=-9 --with-gmp=/usr/local/opt/gmp --with-mpfr=/usr/local/opt/mpfr --with-mpc=/usr/local/opt/libmpc --with-isl=/usr/local/opt/isl --with-system-zlib --with-pkgversion='Homebrew GCC 9.2.0_3' --with-bugurl=https://github.com/Homebrew/homebrew-core/issues --disable-multilib --with-native-system-header-dir=/usr/include --with-sysroot=/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk Thread model: posix gcc version 9.2.0 (Homebrew GCC 9.2.0_3)
upgrade your gcc like: brew install gcc@8
g++ -v
Using built-in specs.
COLLECT_GCC=g++-9
COLLECT_LTO_WRAPPER=/usr/local/Cellar/gcc/9.2.0_3/libexec/gcc/x86_64-apple-darwin18/9.2.0/lto-wrapper
Target: x86_64-apple-darwin18
Configured with: ../configure --build=x86_64-apple-darwin18 --prefix=/usr/local/Cellar/gcc/9.2.0_3 --libdir=/usr/local/Cellar/gcc/9.2.0_3/lib/gcc/9 --disable-nls --enable-checking=release --enable-languages=c,c++,objc,obj-c++,fortran --program-suffix=-9 --with-gmp=/usr/local/opt/gmp --with-mpfr=/usr/local/opt/mpfr --with-mpc=/usr/local/opt/libmpc --with-isl=/usr/local/opt/isl --with-system-zlib --with-pkgversion='Homebrew GCC 9.2.0_3' --with-bugurl=https://github.com/Homebrew/homebrew-core/issues --disable-multilib --with-native-system-header-dir=/usr/include --with-sysroot=/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk
Thread model: posix
gcc version 9.2.0 (Homebrew GCC 9.2.0_3)
upgrade your gcc like: brew install gcc@8
if I used gcc to complie
/usr/local/Cellar/gcc/9.2.0_3/include/c++/9.2.0/bits/hashtable.h:192:21: error: static assertion failed: unordered container must have the same value_type as its allocator
192 | static_assert(is_same<typename _Alloc::value_type, _Value>{},
| ^~~~~~~~~~
gcc -O3 fm_train.cpp src/Frame/pc_frame.cpp src/Utils/utils.cpp -I . -std=c++11 -o bin/fm_train -lpthread
In file included from /usr/local/Cellar/gcc/9.2.0_3/include/c++/9.2.0/unordered_map:46,
from src/FTRL/ftrl_model.h:4,
from src/FTRL/ftrl_trainer.h:5,
from fm_train.cpp:5:
/usr/local/Cellar/gcc/9.2.0_3/include/c++/9.2.0/bits/hashtable.h: In instantiation of 'class std::_Hashtable<const char, std::pair<const char const, ftrl_model_unit~~~~~~~~~
/usr/local/Cellar/gcc/9.2.0_3/include/c++/9.2.0/bits/hashtable.h:275:21: error: static assertion failed: Cache the hash code or qualify your functors involved in hash code and bucket index computation with noexcept
275 | static_assert(noexcept(declval<const hash_code_base_access&>()
| ^~~~~~~~~~~~~~
276 | ._M_bucket_index((const node_type~~~~~~~~~
277 | (std::size_t)0)),
| ~~~~
/usr/local/Cellar/gcc/9.2.0_3/include/c++/9.2.0/bits/hashtable.h: In instantiation of 'class std::_Hashtable<const char, std::pair<const char const, ftrl_model_unit~~~~~~~~~
/usr/local/Cellar/gcc/9.2.0_3/include/c++/9.2.0/bits/hashtable.h:275:21: error: static assertion failed: Cache the hash code or qualify your functors involved in hash code and bucket index computation with noexcept
275 | static_assert(noexcept(declval<const hash_code_base_access&>()
| ^~~~~~~~~~~~~~
276 | ._M_bucket_index((const node_type~~~~~~~~~
277 | (std::size_t)0)),
| ~~~~
src/Frame/pc_frame.cpp: In member function 'bool pc_frame::init(pc_task&, int, int, int)':
src/Frame/pc_frame.cpp:9:27: warning: 'int sem_init(sem_t, int, unsigned int)' is deprecated [-Wdeprecated-declarations]
9 | sem_init(&semPro, 0, 1);
| ^
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/semaphore.h:29,
from src/Frame/pc_frame.h:11,
from src/Frame/pc_frame.cpp:1:
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/semaphore.h:55:5: note: declared here
55 | int sem_init(sem_t , int, unsigned int) deprecated;
| ^~~~
src/Frame/pc_frame.cpp:9:27: warning: 'int sem_init(sem_t, int, unsigned int)' is deprecated [-Wdeprecated-declarations]
9 | sem_init(&semPro, 0, 1);
| ^
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/semaphore.h:29,
from src/Frame/pc_frame.h:11,
from src/Frame/pc_frame.cpp:1:
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/semaphore.h:55:5: note: declared here
55 | int sem_init(sem_t , int, unsigned int) deprecated;
| ^~~~
src/Frame/pc_frame.cpp:10:27: warning: 'int sem_init(sem_t, int, unsigned int)' is deprecated [-Wdeprecated-declarations]
10 | sem_init(&semCon, 0, 0);
| ^
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/semaphore.h:29,
from src/Frame/pc_frame.h:11,
from src/Frame/pc_frame.cpp:1:
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/semaphore.h:55:5: note: declared here
55 | int sem_init(sem_t , int, unsigned int) deprecated;
| ^~~~
src/Frame/pc_frame.cpp:10:27: warning: 'int sem_init(sem_t, int, unsigned int)' is deprecated [-Wdeprecated-declarations]
10 | sem_init(&semCon, 0, 0);
| ^
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/semaphore.h:29,
from src/Frame/pc_frame.h:11,
from src/Frame/pc_frame.cpp:1:
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/semaphore.h:55:5: note: declared here
55 | int sem_init(sem_t , int, unsigned int) deprecated;
| ^~~~
MacOS
g++ -O3 fm_train.cpp src/Frame/pc_frame.cpp src/Utils/utils.cpp -I . -std=c++11 -o bin/fm_train -lpthread In file included from fm_train.cpp:5: In file included from ./src/FTRL/ftrl_trainer.h:5: In file included from ./src/FTRL/ftrl_model.h:14: ./src/FTRL/../Mem/my_allocator.h:42:58: error: expected expression if(typeid(T) == typeid(__detail::_Hash_node_base)) ^ ./src/FTRL/../Mem/my_allocator.h:42:42: error: no member named '_Hash_node_base' in namespace 'std::1::detail' if(typeid(T) == typeid(__detail::_Hash_node_base))