Skip to content
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

Couldn't compile in FreeBSD #1562

Closed
GhOsTMZ opened this issue Jul 3, 2015 · 5 comments
Closed

Couldn't compile in FreeBSD #1562

GhOsTMZ opened this issue Jul 3, 2015 · 5 comments

Comments

@GhOsTMZ
Copy link

GhOsTMZ commented Jul 3, 2015

Hi all,
i have trouble with compile in freebsd 9.3. Used compiler - Clang 3.4.1. luabind version - 0.9.1, boost - 1.55. I successfully build OSRM using GCC 4.8.4., but his seg-fault crash.

PS: sorry for my english.

root@BSD-san-2:/home/Project-OSRM/build # cmake .. -DCMAKE_CXX_COMPILER_ID=Clang -DCMAKE_CXX_COMPILER=/usr/bin/clang++ -DCMAKE_C_COMPILER=/usr/bin/clang -DCMAKE_CXX_FLAGS='-v'
-- The C compiler identification is Clang 3.4.1
-- The CXX compiler identification is Clang
-- Check for working C compiler: /usr/bin/clang
-- Check for working C compiler: /usr/bin/clang -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/clang++
-- Check for working CXX compiler: /usr/bin/clang++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Building on a 64 bit system
-- Configuring OSRM in release mode
-- Performing Test LTO_AVAILABLE
-- Performing Test LTO_AVAILABLE - Failed
-- Boost version: 1.55.0
-- Found the following Boost libraries:
-- date_time
-- filesystem
-- iostreams
-- program_options
-- regex
-- system
-- thread
-- unit_test_framework
-- Looking for include file pthread.h
-- Looking for include file 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
-- Found Intel TBB
-- Looking for Luabind...
-- Found Luabind: /usr/local/lib/libluabind.so
-- Found Luabind: /usr/local/lib/libluabind.so
-- Found Lua52: /usr/local/lib/liblua-5.2.so;/usr/lib/libm.so
-- Looking for LuaJIT 5.2
-- Could NOT find LUAJIT (missing: LUAJIT_LIBRARIES)
-- Performing Test LUABIND_WORKS
-- Performing Test LUABIND_WORKS - Failed
-- Luabind/Lua5.2 not feasible, falling back to Lua 5.1.
-- Found Lua51: /usr/local/lib/liblua-5.2.so;/usr/lib/libm.so (found version "5.1.5")
-- Looking for LuaJIT 5.1
-- Found LUAJIT: /usr/local/lib/libluajit-5.1.so;/usr/lib/libm.so
-- Found LuaJIT: /usr/local/lib/libluajit-5.1.so
-- Performing Test LUABIND51_WORKS
-- Performing Test LUABIND51_WORKS - Success
-- Luabind works with Lua 5.1 at /usr/local/lib/liblua-5.1.so
-- Found EXPAT: /usr/local/lib/libexpat.so (found version "2.1.0")
-- Looking for STXXL...
-- Found STXXL: /usr/local/lib/libstxxl.a
-- Found STXXL: /usr/local/lib/libstxxl.a
-- Looking for OSMPBF...
-- Found OSMPBF: /usr/local/lib/libosmpbf.a
-- Found OSMPBF: /usr/local/lib/libosmpbf.a
-- Found PROTOBUF: /usr/local/lib/libprotobuf.so
-- Found BZip2: /usr/lib/libbz2.so (found version "1.0.6")
-- Looking for BZ2_bzCompressInit in /usr/lib/libbz2.so
-- Looking for BZ2_bzCompressInit in /usr/lib/libbz2.so - found
-- Found ZLIB: /usr/lib/libz.so (found version "1.2.8")
-- Configuring done
-- Generating done
-- Build files have been written to: /home/Project-OSRM/build

root@BSD-san-2:/home/Project-OSRM/build # make
Scanning dependencies of target ANGLE
[ 2%] Building CXX object CMakeFiles/ANGLE.dir/util/compute_angle.cpp.o
FreeBSD clang version 3.4.1 (tags/RELEASE_34/dot1-final 208032) 20140512
Target: x86_64-unknown-freebsd9.3
Thread model: posix
Selected GCC installation:
"/usr/bin/clang++" -cc1 -triple x86_64-unknown-freebsd9.3 -emit-obj -disable-free -main-file-name compute_angle.cpp -mrelocation-model pic -pic-level 2 -mdisable-fp-elim -masm-verbose -mconstructor-aliases -munwind-tables -target-cpu x86-64 -v -coverage-file /home/Project-OSRM/build/CMakeFiles/ANGLE.dir/util/compute_angle.cpp.o -resource-dir /usr/bin/../lib/clang/3.4.1 -D BOOST_TEST_DYN_LINK -D NDEBUG -I /home/Project-OSRM/include -I /home/Project-OSRM/third_party -I /home/Project-OSRM/third_party/libosmium/include -I /usr/local/include -I /usr/local/include/luabind -I /usr/local/include/lua51 -I /usr/local/include/osmpbf -internal-isystem /usr/include/c++/4.2 -internal-isystem /usr/include/c++/4.2/backward -O3 -Wall -Wunreachable-code -pedantic -std=c++11 -fdeprecated-macro -fdebug-compilation-dir /home/Project-OSRM/build -ferror-limit 19 -fmessage-length 212 -mstackrealign -fobjc-runtime=gnustep -fcxx-exceptions -fexceptions -fdiagnostics-show-option -fcolor-diagnostics -vectorize-loops -vectorize-slp -o CMakeFiles/ANGLE.dir/util/compute_angle.cpp.o -x c++ /home/Project-OSRM/util/compute_angle.cpp
clang -cc1 version 3.4.1 based upon LLVM 3.4.1 default target x86_64-unknown-freebsd9.3
ignoring nonexistent directory "/usr/bin/../lib/clang/3.4.1/include"

include "..." search starts here:

include <...> search starts here:

/home/Project-OSRM/include
/home/Project-OSRM/third_party
/home/Project-OSRM/third_party/libosmium/include
/usr/local/include
/usr/local/include/luabind
/usr/local/include/lua51
/usr/local/include/osmpbf
/usr/include/c++/4.2
/usr/include/c++/4.2/backward
/usr/include/clang/3.4.1
/usr/include
End of search list.
In file included from /home/Project-OSRM/util/compute_angle.cpp:33:
/home/Project-OSRM/include/osrm/coordinate.hpp:33:10: fatal error: 'type_traits' file not found

include <type_traits>

     ^

1 error generated.
*** [CMakeFiles/ANGLE.dir/util/compute_angle.cpp.o] Error code 1

Stop in /usr/home/Project-OSRM/build.
*** [CMakeFiles/ANGLE.dir/all] Error code 1

Stop in /usr/home/Project-OSRM/build.
*** [all] Error code 1

Stop in /usr/home/Project-OSRM/build.

Ok.
root@BSD-san-2:/home/Project-OSRM/build # find / -iname type_traits
/usr/include/c++/4.2/tr1/type_traits
/usr/local/share/doc/boost/libs/ratio/example/type_traits
/usr/local/share/doc/boost/libs/type_traits
/usr/local/include/boost/icl/type_traits
/usr/local/include/boost/tr1/tr1/type_traits
/usr/local/include/boost/type_traits
/usr/local/include/c++/v1/c++/v1/type_traits
/usr/local/include/c++/v1/type_traits
/usr/local/lib/gcc48/include/c++/tr1/type_traits
/usr/local/lib/gcc48/include/c++/tr2/type_traits
/usr/local/lib/gcc48/include/c++/type_traits
/usr/ports/devel/boost-docs/work/boost_1_55_0/boost/icl/type_traits
/usr/ports/devel/boost-docs/work/boost_1_55_0/boost/tr1/tr1/type_traits
/usr/ports/devel/boost-docs/work/boost_1_55_0/boost/type_traits
/usr/ports/devel/boost-docs/work/boost_1_55_0/libs/ratio/example/type_traits
/usr/ports/devel/boost-docs/work/boost_1_55_0/libs/tr1/test/type_traits
/usr/ports/devel/boost-docs/work/boost_1_55_0/libs/type_traits
/usr/ports/devel/boost-docs/work/stage/usr/local/share/doc/boost/libs/ratio/example/type_traits
/usr/ports/devel/boost-docs/work/stage/usr/local/share/doc/boost/libs/type_traits

root@BSD-san-2:/home/Project-OSRM/build # cmake .. -DCMAKE_CXX_COMPILER_ID=Clang -DCMAKE_CXX_COMPILER=/usr/bin/clang++ -DCMAKE_C_COMPILER=/usr/bin/clang -DCMAKE_CXX_FLAGS='-I/usr/local/include/c++/v1/ -v'
-- The C compiler identification is Clang 3.4.1
-- The CXX compiler identification is Clang
-- Check for working C compiler: /usr/bin/clang
-- Check for working C compiler: /usr/bin/clang -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/clang++
-- Check for working CXX compiler: /usr/bin/clang++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Building on a 64 bit system
-- Configuring OSRM in release mode
-- Performing Test LTO_AVAILABLE
-- Performing Test LTO_AVAILABLE - Failed
-- Boost version: 1.55.0
-- Found the following Boost libraries:
-- date_time
-- filesystem
-- iostreams
-- program_options
-- regex
-- system
-- thread
-- unit_test_framework
-- Looking for include file pthread.h
-- Looking for include file 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
-- Found Intel TBB
-- Looking for Luabind...
-- Found Luabind: /usr/local/lib/libluabind.so
-- Found Luabind: /usr/local/lib/libluabind.so
-- Found Lua52: /usr/local/lib/liblua-5.2.so;/usr/lib/libm.so
-- Looking for LuaJIT 5.2
-- Could NOT find LUAJIT (missing: LUAJIT_LIBRARIES)
-- Performing Test LUABIND_WORKS
-- Performing Test LUABIND_WORKS - Failed
-- Luabind/Lua5.2 not feasible, falling back to Lua 5.1.
-- Found Lua51: /usr/local/lib/liblua-5.2.so;/usr/lib/libm.so (found version "5.1.5")
-- Looking for LuaJIT 5.1
-- Found LUAJIT: /usr/local/lib/libluajit-5.1.so;/usr/lib/libm.so
-- Found LuaJIT: /usr/local/lib/libluajit-5.1.so
-- Performing Test LUABIND51_WORKS
-- Performing Test LUABIND51_WORKS - Failed
CMake Error at cmake/check_luabind.cmake:38 (message):
Luabind does not work with Lua 5.1 at /usr/local/lib/liblua-5.1.so, no
working Luabind found
Call Stack (most recent call first):
CMakeLists.txt:251 (include)

-- Configuring incomplete, errors occurred!
See also "/home/Project-OSRM/build/CMakeFiles/CMakeOutput.log".
See also "/home/Project-OSRM/build/CMakeFiles/CMakeError.log".

root@BSD-san-2:/home/Project-OSRM/build # cat CMakeFiles/CMakeError.log
Performing C++ SOURCE FILE Test LTO_AVAILABLE failed with the following output:
Change Dir: /home/Project-OSRM/build/CMakeFiles/CMakeTmp

Run Build Command:"/usr/local/bin/gmake" "cmTryCompileExec1729888361/fast"
/usr/local/bin/gmake -f CMakeFiles/cmTryCompileExec1729888361.dir/build.make CMakeFiles/cmTryCompileExec1729888361.dir/build
gmake[1]: Entering directory '/usr/home/Project-OSRM/build/CMakeFiles/CMakeTmp'
/usr/local/bin/cmake -E cmake_progress_report /home/Project-OSRM/build/CMakeFiles/CMakeTmp/CMakeFiles 1
Building CXX object CMakeFiles/cmTryCompileExec1729888361.dir/src.cxx.o
/usr/bin/clang++ -I/usr/local/include/c++/v1/ -v -DLTO_AVAILABLE -flto -o CMakeFiles/cmTryCompileExec1729888361.dir/src.cxx.o -c /home/Project-OSRM/build/CMakeFiles/CMakeTmp/src.cxx
FreeBSD clang version 3.4.1 (tags/RELEASE_34/dot1-final 208032) 20140512
Target: x86_64-unknown-freebsd9.3
Thread model: posix
Selected GCC installation:
"/usr/bin/clang++" -cc1 -triple x86_64-unknown-freebsd9.3 -emit-llvm-bc -disable-free -main-file-name src.cxx -mrelocation-model static -mdisable-fp-elim -masm-verbose -mconstructor-aliases -munwind-tables -target-cpu x86-64 -v -coverage-file /usr/home/Project-OSRM/build/CMakeFiles/CMakeTmp/CMakeFiles/cmTryCompileExec1729888361.dir/src.cxx.o -resource-dir /usr/bin/../lib/clang/3.4.1 -D LTO_AVAILABLE -I /usr/local/include/c++/v1/ -internal-isystem /usr/include/c++/4.2 -internal-isystem /usr/include/c++/4.2/backward -fdeprecated-macro -fdebug-compilation-dir /usr/home/Project-OSRM/build/CMakeFiles/CMakeTmp -ferror-limit 19 -fmessage-length 0 -mstackrealign -fobjc-runtime=gnustep -fcxx-exceptions -fexceptions -fdiagnostics-show-option -vectorize-slp -o CMakeFiles/cmTryCompileExec1729888361.dir/src.cxx.o -x c++ /home/Project-OSRM/build/CMakeFiles/CMakeTmp/src.cxx
clang -cc1 version 3.4.1 based upon LLVM 3.4.1 default target x86_64-unknown-freebsd9.3
ignoring nonexistent directory "/usr/bin/../lib/clang/3.4.1/include"

include "..." search starts here:

include <...> search starts here:

/usr/local/include/c++/v1
/usr/include/c++/4.2
/usr/include/c++/4.2/backward
/usr/include/clang/3.4.1
/usr/include
End of search list.
Linking CXX executable cmTryCompileExec1729888361
/usr/local/bin/cmake -E cmake_link_script CMakeFiles/cmTryCompileExec1729888361.dir/link.txt --verbose=1
/usr/bin/clang++ -I/usr/local/include/c++/v1/ -v -DLTO_AVAILABLE CMakeFiles/cmTryCompileExec1729888361.dir/src.cxx.o -o cmTryCompileExec1729888361
FreeBSD clang version 3.4.1 (tags/RELEASE_34/dot1-final 208032) 20140512
Target: x86_64-unknown-freebsd9.3
Thread model: posix
Selected GCC installation:
"/usr/bin/ld" --eh-frame-hdr -dynamic-linker /libexec/ld-elf.so.1 --hash-style=both --enable-new-dtags -o cmTryCompileExec1729888361 /usr/lib/crt1.o /usr/lib/crti.o /usr/lib/crtbegin.o -L/usr/lib CMakeFiles/cmTryCompileExec1729888361.dir/src.cxx.o -lstdc++ -lm -lgcc --as-needed -lgcc_s --no-as-needed -lc -lgcc --as-needed -lgcc_s --no-as-needed /usr/lib/crtend.o /usr/lib/crtn.o
CMakeFiles/cmTryCompileExec1729888361.dir/src.cxx.o: file not recognized: File format not recognized
clang++: error: linker command failed with exit code 1 (use -v to see invocation)
CMakeFiles/cmTryCompileExec1729888361.dir/build.make:88: recipe for target 'cmTryCompileExec1729888361' failed
gmake[1]: *** [cmTryCompileExec1729888361] Error 1
gmake[1]: Leaving directory '/usr/home/Project-OSRM/build/CMakeFiles/CMakeTmp'
Makefile:117: recipe for target 'cmTryCompileExec1729888361/fast' failed
gmake: *** [cmTryCompileExec1729888361/fast] Error 2

Source file was:
int main() { return 0; }
Determining if the pthread_create exist failed with the following output:
Change Dir: /home/Project-OSRM/build/CMakeFiles/CMakeTmp

Run Build Command:"/usr/local/bin/gmake" "cmTryCompileExec2240362196/fast"
/usr/local/bin/gmake -f CMakeFiles/cmTryCompileExec2240362196.dir/build.make CMakeFiles/cmTryCompileExec2240362196.dir/build
gmake[1]: Entering directory '/usr/home/Project-OSRM/build/CMakeFiles/CMakeTmp'
/usr/local/bin/cmake -E cmake_progress_report /home/Project-OSRM/build/CMakeFiles/CMakeTmp/CMakeFiles 1
Building C object CMakeFiles/cmTryCompileExec2240362196.dir/CheckSymbolExists.c.o
/usr/bin/clang -o CMakeFiles/cmTryCompileExec2240362196.dir/CheckSymbolExists.c.o -c /home/Project-OSRM/build/CMakeFiles/CMakeTmp/CheckSymbolExists.c
Linking C executable cmTryCompileExec2240362196
/usr/local/bin/cmake -E cmake_link_script CMakeFiles/cmTryCompileExec2240362196.dir/link.txt --verbose=1
/usr/bin/clang CMakeFiles/cmTryCompileExec2240362196.dir/CheckSymbolExists.c.o -o cmTryCompileExec2240362196
CMakeFiles/cmTryCompileExec2240362196.dir/CheckSymbolExists.c.o: In function main': /home/Project-OSRM/build/CMakeFiles/CMakeTmp/CheckSymbolExists.c:(.text+0x19): undefined reference topthread_create'
clang: error: linker command failed with exit code 1 (use -v to see invocation)
CMakeFiles/cmTryCompileExec2240362196.dir/build.make:88: recipe for target 'cmTryCompileExec2240362196' failed
gmake[1]: Leaving directory '/usr/home/Project-OSRM/build/CMakeFiles/CMakeTmp'
gmake[1]: *** [cmTryCompileExec2240362196] Error 1
Makefile:117: recipe for target 'cmTryCompileExec2240362196/fast' failed
gmake: *** [cmTryCompileExec2240362196/fast] Error 2

File /home/Project-OSRM/build/CMakeFiles/CMakeTmp/CheckSymbolExists.c:
/* */

include <pthread.h>

int main(int argc, char** argv)
{
(void)argv;

ifndef pthread_create

return ((int*)(&pthread_create))[argc];

else

(void)argc;
return 0;

endif

}

Determining if the function pthread_create exists in the pthreads failed with the following output:
Change Dir: /home/Project-OSRM/build/CMakeFiles/CMakeTmp

Run Build Command:"/usr/local/bin/gmake" "cmTryCompileExec3613373695/fast"
/usr/local/bin/gmake -f CMakeFiles/cmTryCompileExec3613373695.dir/build.make CMakeFiles/cmTryCompileExec3613373695.dir/build
gmake[1]: Entering directory '/usr/home/Project-OSRM/build/CMakeFiles/CMakeTmp'
/usr/local/bin/cmake -E cmake_progress_report /home/Project-OSRM/build/CMakeFiles/CMakeTmp/CMakeFiles 1
Building C object CMakeFiles/cmTryCompileExec3613373695.dir/CheckFunctionExists.c.o
/usr/bin/clang -DCHECK_FUNCTION_EXISTS=pthread_create -o CMakeFiles/cmTryCompileExec3613373695.dir/CheckFunctionExists.c.o -c /usr/local/share/cmake/Modules/CheckFunctionExists.c
Linking C executable cmTryCompileExec3613373695
/usr/local/bin/cmake -E cmake_link_script CMakeFiles/cmTryCompileExec3613373695.dir/link.txt --verbose=1
/usr/bin/clang -DCHECK_FUNCTION_EXISTS=pthread_create CMakeFiles/cmTryCompileExec3613373695.dir/CheckFunctionExists.c.o -o cmTryCompileExec3613373695 -lpthreads
/usr/bin/ld: cannot find -lpthreads
clang: error: linker command failed with exit code 1 (use -v to see invocation)
CMakeFiles/cmTryCompileExec3613373695.dir/build.make:88: recipe for target 'cmTryCompileExec3613373695' failed
gmake[1]: *** [cmTryCompileExec3613373695] Error 1
gmake[1]: Leaving directory '/usr/home/Project-OSRM/build/CMakeFiles/CMakeTmp'
Makefile:117: recipe for target 'cmTryCompileExec3613373695/fast' failed
gmake: *** [cmTryCompileExec3613373695/fast] Error 2

Performing C++ SOURCE FILE Test LUABIND_WORKS failed with the following output:
Change Dir: /home/Project-OSRM/build/CMakeFiles/CMakeTmp

Run Build Command:"/usr/local/bin/gmake" "cmTryCompileExec4007365468/fast"
/usr/local/bin/gmake -f CMakeFiles/cmTryCompileExec4007365468.dir/build.make CMakeFiles/cmTryCompileExec4007365468.dir/build
gmake[1]: Entering directory '/usr/home/Project-OSRM/build/CMakeFiles/CMakeTmp'
/usr/local/bin/cmake -E cmake_progress_report /home/Project-OSRM/build/CMakeFiles/CMakeTmp/CMakeFiles 1
Building CXX object CMakeFiles/cmTryCompileExec4007365468.dir/src.cxx.o
/usr/bin/clang++ -I/usr/local/include/c++/v1/ -v -Wall -Wunreachable-code -pedantic -fPIC -std=c++11 -DLUABIND_WORKS -O3 -DNDEBUG -I/usr/local/include -I/usr/local/include/luabind -I/usr/local/include/lua52 -o CMakeFiles/cmTryCompileExec4007365468.dir/src.cxx.o -c /home/Project-OSRM/build/CMakeFiles/CMakeTmp/src.cxx
FreeBSD clang version 3.4.1 (tags/RELEASE_34/dot1-final 208032) 20140512
Target: x86_64-unknown-freebsd9.3
Thread model: posix
Selected GCC installation:
"/usr/bin/clang++" -cc1 -triple x86_64-unknown-freebsd9.3 -emit-obj -disable-free -main-file-name src.cxx -mrelocation-model pic -pic-level 2 -mdisable-fp-elim -masm-verbose -mconstructor-aliases -munwind-tables -target-cpu x86-64 -v -coverage-file /usr/home/Project-OSRM/build/CMakeFiles/CMakeTmp/CMakeFiles/cmTryCompileExec4007365468.dir/src.cxx.o -resource-dir /usr/bin/../lib/clang/3.4.1 -D LUABIND_WORKS -D NDEBUG -I /usr/local/include/c++/v1/ -I /usr/local/include -I /usr/local/include/luabind -I /usr/local/include/lua52 -internal-isystem /usr/include/c++/4.2 -internal-isystem /usr/include/c++/4.2/backward -O3 -Wall -Wunreachable-code -pedantic -std=c++11 -fdeprecated-macro -fdebug-compilation-dir /usr/home/Project-OSRM/build/CMakeFiles/CMakeTmp -ferror-limit 19 -fmessage-length 0 -mstackrealign -fobjc-runtime=gnustep -fcxx-exceptions -fexceptions -fdiagnostics-show-option -vectorize-loops -vectorize-slp -o CMakeFiles/cmTryCompileExec4007365468.dir/src.cxx.o -x c++ /home/Project-OSRM/build/CMakeFiles/CMakeTmp/src.cxx
clang -cc1 version 3.4.1 based upon LLVM 3.4.1 default target x86_64-unknown-freebsd9.3
ignoring nonexistent directory "/usr/bin/../lib/clang/3.4.1/include"

include "..." search starts here:

include <...> search starts here:

/usr/local/include/c++/v1
/usr/local/include
/usr/local/include/luabind
/usr/local/include/lua52
/usr/include/c++/4.2
/usr/include/c++/4.2/backward
/usr/include/clang/3.4.1
/usr/include
End of search list.
In file included from /home/Project-OSRM/build/CMakeFiles/CMakeTmp/src.cxx:2:
In file included from /usr/local/include/luabind/luabind.hpp:28:
In file included from /usr/local/include/luabind/class.hpp:93:
In file included from /usr/local/include/luabind/back_reference.hpp:27:
In file included from /usr/local/include/luabind/wrapper_base.hpp:31:
In file included from /usr/local/include/luabind/detail/call_member.hpp:30:
In file included from /usr/local/include/luabind/detail/convert_to_lua.hpp:28:
In file included from /usr/local/include/luabind/detail/policy.hpp:51:
/usr/local/include/luabind/detail/object_rep.hpp:77:11: error: no member named 'malloc' in namespace 'std'; did you mean 'valloc'?
return std::malloc(size);
^~~~~~~~~~~
valloc
/usr/include/unistd.h:581:7: note: 'valloc' declared here
void valloc(size_t); / obsoleted by malloc() /
^
In file included from /home/Project-OSRM/build/CMakeFiles/CMakeTmp/src.cxx:2:
In file included from /usr/local/include/luabind/luabind.hpp:28:
In file included from /usr/local/include/luabind/class.hpp:93:
In file included from /usr/local/include/luabind/back_reference.hpp:27:
In file included from /usr/local/include/luabind/wrapper_base.hpp:31:
In file included from /usr/local/include/luabind/detail/call_member.hpp:30:
In file included from /usr/local/include/luabind/detail/convert_to_lua.hpp:28:
In file included from /usr/local/include/luabind/detail/policy.hpp:51:
/usr/local/include/luabind/detail/object_rep.hpp:84:9: error: no type named 'free' in namespace 'std'
std::free(storage);
~~~~~^
In file included from /home/Project-OSRM/build/CMakeFiles/CMakeTmp/src.cxx:2:
In file included from /usr/local/include/luabind/luabind.hpp:28:
In file included from /usr/local/include/luabind/class.hpp:93:
In file included from /usr/local/include/luabind/back_reference.hpp:27:
In file included from /usr/local/include/luabind/wrapper_base.hpp:31:
In file included from /usr/local/include/luabind/detail/call_member.hpp:30:
In file included from /usr/local/include/luabind/detail/convert_to_lua.hpp:28:
/usr/local/include/luabind/detail/policy.hpp:748:52: error: use of undeclared identifier 'lua_strlen'
return std::string(lua_tostring(L, index), lua_strlen(L, index));
^
In file included from /home/Project-OSRM/build/CMakeFiles/CMakeTmp/src.cxx:2:
In file included from /usr/local/include/luabind/luabind.hpp:28:
In file included from /usr/local/include/luabind/class.hpp:93:
In file included from /usr/local/include/luabind/back_reference.hpp:27:
In file included from /usr/local/include/luabind/wrapper_base.hpp:31:
In file included from /usr/local/include/luabind/detail/call_member.hpp:34:
/usr/local/include/luabind/object.hpp:214:27: error: use of undeclared identifier 'lua_equal'; did you mean 'lua_rawequal'?
LUABIND_BINARY_OP_DEF(==, lua_equal)
^~~~~~~~~
lua_rawequal
/usr/local/include/luabind/object.hpp:211:14: note: expanded from macro 'LUABIND_BINARY_OP_DEF'
return fn(L, -1, -2) != 0;
^
/usr/local/include/lua52/lua.h:198:16: note: 'lua_rawequal' declared here
LUA_API int (lua_rawequal) (lua_State *L, int idx1, int idx2);
^
In file included from /home/Project-OSRM/build/CMakeFiles/CMakeTmp/src.cxx:2:
In file included from /usr/local/include/luabind/luabind.hpp:28:
In file included from /usr/local/include/luabind/class.hpp:93:
In file included from /usr/local/include/luabind/back_reference.hpp:27:
In file included from /usr/local/include/luabind/wrapper_base.hpp:31:
In file included from /usr/local/include/luabind/detail/call_member.hpp:34:
/usr/local/include/luabind/object.hpp:215:26: error: use of undeclared identifier 'lua_lessthan'
LUABIND_BINARY_OP_DEF(<, lua_lessthan)
^
/usr/local/include/luabind/object.hpp:211:14: note: expanded from macro 'LUABIND_BINARY_OP_DEF'
return fn(L, -1, -2) != 0;
^
/usr/local/include/luabind/object.hpp:228:27: error: use of undeclared identifier 'lua_strlen'
std::size_t len = lua_strlen(interpreter, -1);
^
/usr/local/include/luabind/object.hpp:1210:32: error: use of undeclared identifier 'LUA_GLOBALSINDEX'
lua_pushvalue(interpreter, LUA_GLOBALSINDEX);
^
In file included from /home/Project-OSRM/build/CMakeFiles/CMakeTmp/src.cxx:2:
In file included from /usr/local/include/luabind/luabind.hpp:28:
In file included from /usr/local/include/luabind/class.hpp:94:
In file included from /usr/local/include/luabind/function.hpp:10:
In file included from /usr/local/include/luabind/detail/call_function.hpp:320:
In file included from /usr/local/include/boost/preprocessor/iteration/detail/iter/forward1.hpp:47:
/usr/local/include/luabind/detail/call_function.hpp:351:19: error: use of undeclared identifier 'LUA_GLOBALSINDEX'
lua_gettable(L, LUA_GLOBALSINDEX);
^
/usr/local/include/luabind/detail/call_function.hpp:394:19: error: use of undeclared identifier 'LUA_GLOBALSINDEX'
lua_gettable(L, LUA_GLOBALSINDEX);
^
In file included from /home/Project-OSRM/build/CMakeFiles/CMakeTmp/src.cxx:2:
In file included from /usr/local/include/luabind/luabind.hpp:28:
In file included from /usr/local/include/luabind/class.hpp:94:
In file included from /usr/local/include/luabind/function.hpp:10:
In file included from /usr/local/include/luabind/detail/call_function.hpp:320:
In file included from /usr/local/include/boost/preprocessor/iteration/detail/iter/forward1.hpp:52:
/usr/local/include/luabind/detail/call_function.hpp:351:19: error: use of undeclared identifier 'LUA_GLOBALSINDEX'
lua_gettable(L, LUA_GLOBALSINDEX);
^
/usr/local/include/luabind/detail/call_function.hpp:394:19: error: use of undeclared identifier 'LUA_GLOBALSINDEX'
lua_gettable(L, LUA_GLOBALSINDEX);
^
In file included from /home/Project-OSRM/build/CMakeFiles/CMakeTmp/src.cxx:2:
In file included from /usr/local/include/luabind/luabind.hpp:28:
In file included from /usr/local/include/luabind/class.hpp:94:
In file included from /usr/local/include/luabind/function.hpp:10:
In file included from /usr/local/include/luabind/detail/call_function.hpp:320:
In file included from /usr/local/include/boost/preprocessor/iteration/detail/iter/forward1.hpp:57:
/usr/local/include/luabind/detail/call_function.hpp:351:19: error: use of undeclared identifier 'LUA_GLOBALSINDEX'
lua_gettable(L, LUA_GLOBALSINDEX);
^
/usr/local/include/luabind/detail/call_function.hpp:394:19: error: use of undeclared identifier 'LUA_GLOBALSINDEX'
lua_gettable(L, LUA_GLOBALSINDEX);
^
In file included from /home/Project-OSRM/build/CMakeFiles/CMakeTmp/src.cxx:2:
In file included from /usr/local/include/luabind/luabind.hpp:28:
In file included from /usr/local/include/luabind/class.hpp:94:
In file included from /usr/local/include/luabind/function.hpp:10:
In file included from /usr/local/include/luabind/detail/call_function.hpp:320:
In file included from /usr/local/include/boost/preprocessor/iteration/detail/iter/forward1.hpp:62:
/usr/local/include/luabind/detail/call_function.hpp:351:19: error: use of undeclared identifier 'LUA_GLOBALSINDEX'
lua_gettable(L, LUA_GLOBALSINDEX);
^
/usr/local/include/luabind/detail/call_function.hpp:394:19: error: use of undeclared identifier 'LUA_GLOBALSINDEX'
lua_gettable(L, LUA_GLOBALSINDEX);
^
In file included from /home/Project-OSRM/build/CMakeFiles/CMakeTmp/src.cxx:2:
In file included from /usr/local/include/luabind/luabind.hpp:28:
In file included from /usr/local/include/luabind/class.hpp:94:
In file included from /usr/local/include/luabind/function.hpp:10:
In file included from /usr/local/include/luabind/detail/call_function.hpp:320:
In file included from /usr/local/include/boost/preprocessor/iteration/detail/iter/forward1.hpp:67:
/usr/local/include/luabind/detail/call_function.hpp:351:19: error: use of undeclared identifier 'LUA_GLOBALSINDEX'
lua_gettable(L, LUA_GLOBALSINDEX);
^
/usr/local/include/luabind/detail/call_function.hpp:394:19: error: use of undeclared identifier 'LUA_GLOBALSINDEX'
lua_gettable(L, LUA_GLOBALSINDEX);
^
In file included from /home/Project-OSRM/build/CMakeFiles/CMakeTmp/src.cxx:2:
In file included from /usr/local/include/luabind/luabind.hpp:28:
In file included from /usr/local/include/luabind/class.hpp:94:
In file included from /usr/local/include/luabind/function.hpp:10:
In file included from /usr/local/include/luabind/detail/call_function.hpp:320:
In file included from /usr/local/include/boost/preprocessor/iteration/detail/iter/forward1.hpp:72:
/usr/local/include/luabind/detail/call_function.hpp:351:19: error: use of undeclared identifier 'LUA_GLOBALSINDEX'
lua_gettable(L, LUA_GLOBALSINDEX);
^
/usr/local/include/luabind/detail/call_function.hpp:394:19: error: use of undeclared identifier 'LUA_GLOBALSINDEX'
lua_gettable(L, LUA_GLOBALSINDEX);
^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
CMakeFiles/cmTryCompileExec4007365468.dir/build.make:57: recipe for target 'CMakeFiles/cmTryCompileExec4007365468.dir/src.cxx.o' failed
gmake[1]: Leaving directory '/usr/home/Project-OSRM/build/CMakeFiles/CMakeTmp'
gmake[1]: *
* [CMakeFiles/cmTryCompileExec4007365468.dir/src.cxx.o] Error 1
Makefile:117: recipe for target 'cmTryCompileExec4007365468/fast' failed
gmake: *** [cmTryCompileExec4007365468/fast] Error 2

Source file was:

include "lua.h"

include <luabind/luabind.hpp>

int main() { lua_State *myLuaState = luaL_newstate(); luabind::open(myLuaState); return 0;}
Performing C++ SOURCE FILE Test LUABIND51_WORKS failed with the following output:
Change Dir: /home/Project-OSRM/build/CMakeFiles/CMakeTmp

Run Build Command:"/usr/local/bin/gmake" "cmTryCompileExec1893240544/fast"
/usr/local/bin/gmake -f CMakeFiles/cmTryCompileExec1893240544.dir/build.make CMakeFiles/cmTryCompileExec1893240544.dir/build
gmake[1]: Entering directory '/usr/home/Project-OSRM/build/CMakeFiles/CMakeTmp'
/usr/local/bin/cmake -E cmake_progress_report /home/Project-OSRM/build/CMakeFiles/CMakeTmp/CMakeFiles 1
Building CXX object CMakeFiles/cmTryCompileExec1893240544.dir/src.cxx.o
/usr/bin/clang++ -I/usr/local/include/c++/v1/ -v -Wall -Wunreachable-code -pedantic -fPIC -std=c++11 -DLUABIND51_WORKS -O3 -DNDEBUG -I/usr/local/include -I/usr/local/include/luabind -I/usr/local/include/lua51 -o CMakeFiles/cmTryCompileExec1893240544.dir/src.cxx.o -c /home/Project-OSRM/build/CMakeFiles/CMakeTmp/src.cxx
FreeBSD clang version 3.4.1 (tags/RELEASE_34/dot1-final 208032) 20140512
Target: x86_64-unknown-freebsd9.3
Thread model: posix
Selected GCC installation:
"/usr/bin/clang++" -cc1 -triple x86_64-unknown-freebsd9.3 -emit-obj -disable-free -main-file-name src.cxx -mrelocation-model pic -pic-level 2 -mdisable-fp-elim -masm-verbose -mconstructor-aliases -munwind-tables -target-cpu x86-64 -v -coverage-file /usr/home/Project-OSRM/build/CMakeFiles/CMakeTmp/CMakeFiles/cmTryCompileExec1893240544.dir/src.cxx.o -resource-dir /usr/bin/../lib/clang/3.4.1 -D LUABIND51_WORKS -D NDEBUG -I /usr/local/include/c++/v1/ -I /usr/local/include -I /usr/local/include/luabind -I /usr/local/include/lua51 -internal-isystem /usr/include/c++/4.2 -internal-isystem /usr/include/c++/4.2/backward -O3 -Wall -Wunreachable-code -pedantic -std=c++11 -fdeprecated-macro -fdebug-compilation-dir /usr/home/Project-OSRM/build/CMakeFiles/CMakeTmp -ferror-limit 19 -fmessage-length 0 -mstackrealign -fobjc-runtime=gnustep -fcxx-exceptions -fexceptions -fdiagnostics-show-option -vectorize-loops -vectorize-slp -o CMakeFiles/cmTryCompileExec1893240544.dir/src.cxx.o -x c++ /home/Project-OSRM/build/CMakeFiles/CMakeTmp/src.cxx
clang -cc1 version 3.4.1 based upon LLVM 3.4.1 default target x86_64-unknown-freebsd9.3
ignoring nonexistent directory "/usr/bin/../lib/clang/3.4.1/include"

include "..." search starts here:

include <...> search starts here:

/usr/local/include/c++/v1
/usr/local/include
/usr/local/include/luabind
/usr/local/include/lua51
/usr/include/c++/4.2
/usr/include/c++/4.2/backward
/usr/include/clang/3.4.1
/usr/include
End of search list.
In file included from /home/Project-OSRM/build/CMakeFiles/CMakeTmp/src.cxx:2:
In file included from /usr/local/include/luabind/luabind.hpp:28:
In file included from /usr/local/include/luabind/class.hpp:93:
In file included from /usr/local/include/luabind/back_reference.hpp:27:
In file included from /usr/local/include/luabind/wrapper_base.hpp:31:
In file included from /usr/local/include/luabind/detail/call_member.hpp:30:
In file included from /usr/local/include/luabind/detail/convert_to_lua.hpp:28:
In file included from /usr/local/include/luabind/detail/policy.hpp:51:
/usr/local/include/luabind/detail/object_rep.hpp:77:11: error: no member named 'malloc' in namespace 'std'; did you mean 'valloc'?
return std::malloc(size);
^~~~~~~~~~~
valloc
/usr/include/unistd.h:581:7: note: 'valloc' declared here
void valloc(size_t); / obsoleted by malloc() /
^
In file included from /home/Project-OSRM/build/CMakeFiles/CMakeTmp/src.cxx:2:
In file included from /usr/local/include/luabind/luabind.hpp:28:
In file included from /usr/local/include/luabind/class.hpp:93:
In file included from /usr/local/include/luabind/back_reference.hpp:27:
In file included from /usr/local/include/luabind/wrapper_base.hpp:31:
In file included from /usr/local/include/luabind/detail/call_member.hpp:30:
In file included from /usr/local/include/luabind/detail/convert_to_lua.hpp:28:
In file included from /usr/local/include/luabind/detail/policy.hpp:51:
/usr/local/include/luabind/detail/object_rep.hpp:84:9: error: no type named 'free' in namespace 'std'
std::free(storage);
~~~~~^
2 errors generated.
CMakeFiles/cmTryCompileExec1893240544.dir/build.make:57: recipe for target 'CMakeFiles/cmTryCompileExec1893240544.dir/src.cxx.o' failed
gmake[1]: Leaving directory '/usr/home/Project-OSRM/build/CMakeFiles/CMakeTmp'
gmake[1]: *
* [CMakeFiles/cmTryCompileExec1893240544.dir/src.cxx.o] Error 1
Makefile:117: recipe for target 'cmTryCompileExec1893240544/fast' failed
gmake: *** [cmTryCompileExec1893240544/fast] Error 2

Source file was:

include "lua.h"

include <luabind/luabind.hpp>

int main() { lua_State *myLuaState = luaL_newstate(); luabind::open(myLuaState); return 0;}

@daniel-j-h
Copy link
Member

Your clang build uses the C++ stdlib libstdc++ bundled with gcc 4.2 (!), which does not have C++11 support needed for the type_traits header (among others).

You could try telling clang to use the libc++ stdlib instead, using the compiler flag -stdlib=libc++.

What you did with adding a different stdlib's include path using the -I switch does not work since you would also have to tell the linker to link against the appropriate stdlib.

You also seem to have gcc 4.8 installed --- what is your problem in using it?

@GhOsTMZ
Copy link
Author

GhOsTMZ commented Jul 3, 2015

With gcc 4.8 compile finish successfully... But, osrm-routed have seg-fault on startup:
#0 0x0000000000000000 in ?? ()
#1 0x00000008026558c8 in __cxxabiv1::__dynamic_cast (src_ptr=0x8029011c0 <(anonymous namespace)::ctype_c>, src_type=0x8028e5fb0 ,
dst_type=0x8028e5d40 <typeinfo for std::ctype>, src2dst=0) at ../../.././../gcc-4.8.5/libstdc++-v3/libsupc++/dyncast.cc:72
#2 0x0000000802681650 in std::has_facetstd::ctype (__loc=...) at /usr/ports/lang/gcc48/work/build/x86_64-portbld-freebsd10.1/libstdc++-v3/include/bits/locale_classes.tcc:110
#3 0x0000000802676634 in std::basic_ios<char, std::char_traits >::_M_cache_locale (this=this@entry=0x8028ffea8 std::cout+8, __loc=...)
at /usr/ports/lang/gcc48/work/build/x86_64-portbld-freebsd10.1/libstdc++-v3/include/bits/basic_ios.tcc:159
#4 0x0000000802676780 in std::basic_ios<char, std::char_traits >::init (this=this@entry=0x8028ffea8 std::cout+8, __sb=0x8028ff780 <__gnu_internal::buf_cout_sync>)
at /usr/ports/lang/gcc48/work/build/x86_64-portbld-freebsd10.1/libstdc++-v3/include/bits/basic_ios.tcc:132
#5 0x0000000802668b91 in basic_ostream (__sb=, this=, __in_chrg=, __vtt_parm=)
at /usr/ports/lang/gcc48/work/build/x86_64-portbld-freebsd10.1/libstdc++-v3/include/ostream:85
#6 std::ios_base::Init::Init (this=) at ../../../.././../gcc-4.8.5/libstdc++-v3/src/c++98/ios_init.cc:91
#7 0x00000008018e9a90 in _GLOBAL__sub_I_compiler_log_formatter.cpp () from /usr/local/lib/libboost_unit_test_framework.so.1.49.0
#8 0x00000008006ba7a0 in ?? () from /libexec/ld-elf.so.1
#9 0x00000008006b9d17 in ?? () from /libexec/ld-elf.so.1
#10 0x00000008006b8129 in ?? () from /libexec/ld-elf.so.1
#11 0x0000000000000000 in ?? ()

@TheMarex
Copy link
Member

TheMarex commented Jul 3, 2015

/usr/local/lib/libboost_unit_test_framework.so.1.49.0

You seem to still have an install of libboost 1.49.0 on your machine. Probably the wrong boost version is linked into your binary.

@GhOsTMZ
Copy link
Author

GhOsTMZ commented Jul 6, 2015

what version compatible? I tried 1.53, the same error.

@daniel-j-h
Copy link
Member

As outlined above,you are mixing different compilers and their stdlibs --- this won't work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants