[odb-users] Building odb-tests-2.2.0 on Mac with gcc-4.8.0: make errors

skh skh1002 at gmail.com
Fri May 10 23:46:35 EDT 2013


	Hallo Boris,

Today, I just removed everything related to odb from /usr, deleted all the
source/build folders and started from scratch:

1. Try installing libcutl-1.7.1 with C++11 option (no external Boost)
	
	$ cd /Developer/libcutl-1.7.1 && mkdir build && cd build
	$ ../configure CC=gcc-4.8 CXX=g++-4.8 CPP=cpp-4.8 CXXFLAGS=-std=c++0x
--prefix=/usr/odb
	$ make

Make errors out:
	../../cutl/details/boost/smart_ptr/shared_ptr.hpp:305:9: error: use of
deleted function 
	'cutl_details_boost::shared_ptr<cutl_details_boost::re_detail::named_subex
pressions>::
	shared_ptr(const cutl_details_boost::
	shared_ptr<cutl_details_boost::re_detail::named_subexpressions>&)’
 
		this_type(r).swap(*this);
		^
Building without C++11 option:
	$ make clean
 	$ ../configure CC=gcc-4.8 CXX=g++-4.8 CPP=cpp-4.8 --prefix=/usr/odb
	$ make && sudo make install

2. Install libodb-2.2.2 with C++11 option

	$ cd /Developer/libodb-2.2.2 && mkdir build && cd build
	$ ../configure CC=gcc-4.8 CXX=g++-4.8 CPP=cpp-4.8 $ ../configure
CC=gcc-4.8 
		CXX=g++-4.8 CPP=cpp-4.8 CXXFLAGS=-std=c++0x
--prefix=/usr/odb--prefix=/usr/odb
	$ make && sudo make install

3. Install libodb-sqlite-2.2.1 with C++11 option

	$ cd /Developer/libodb-sqlite-2.2.1 && mkdir build && cd build
	$ ../configure CC=gcc-4.8 CXX=g++-4.8 CPP=cpp-4.8 CXXFLAGS=-std=c++0x
		CPPFLAGS=-I/usr/odb/include LDFLAGS=-L/usr/odb/lib --prefix=/usr/odb
	$ make && sudo make install

4. Install libodb-qt-2.2.0 with C++11 option. By the way, I recommend
including into the INSTALL file a line about linking against QtCore on
Mac: it took me a while to figure out that Qt is built with frameworks and
not libraries by default. I also could not use the option
--with-libodb=../../libodb-2.2.2/build because libodb was only found if it
was specified in CPPFLAGS and LDFLAGS.

	$ cd /Developer/libodb-qt-2.2.0 && mkdir build && cd build
	$ ../configure CC=gcc-4.8 CXX=g++-4.8 CPP=cpp-4.8 CXXFLAGS=-std=c++0x
		CPPFLAGS='-I/usr/odb/include
-I/Developer/Qt5.0.2/5.0.2/clang_64/include’
		LDFLAGS='-L/usr/odb/lib -F/Developer/Qt5.0.2/5.0.2/clang_64/lib’
		--prefix=/usr/odb --with-libodb=../../libodb-2.2.2/build
	$ make && sudo make install

5. Install libodb-boost-2.2.0 with C++11 option.

 	$ cd /Developer/libodb-boost-2.2.0 && mkdir build && cd build
	$ ../configure CC=gcc-4.8 CXX=g++-4.8 CPP=cpp-4.8 CXXFLAGS=-std=c++0x
		CPPFLAGS='-I/usr/odb/include -I/Developer/boost_1_53_0’
		LDFLAGS='-L/usr/odb/lib -L/Developer/boost_1_53_0/stage/lib'
--prefix=/usr/odb
	$ make && sudo make install


6. Try installing odb-2.2.1 compiler with C++11 option.

	$ cd /Developer/odb-2.2.1 && mkdir build && cd build
	$ ../configure CC=gcc-4.8 CXX=g++-4.8 CPP=cpp-4.8 CXXFLAGS=-std=c++0x
		CPPFLAGS=-I/usr/odb/include LDFLAGS=-L/usr/odb/lib --prefix=/usr/odb
	$ make

Make borks out with a C++ compiler error:

	../../odb/parser.cxx:1821:7: error: reference to 'array' is ambiguous
		array& a (unit_->new_node<array> (file, line, clmn, t, size));
		^
	In file included from…
	../../odb/semantics/derived.hxx:384:9: note: candidates are: class
semantics::array
		class array: public derived_type
		^
	In file included from…
	/usr/gcc-4.8.0/include/c++/4.8.0/array:81:12: note:
template<class _Tp,
	long unsigned int _Nm> struct std::array
		struct array
		^
	...
	
	../../odb/semantics/unit.hxx:109:5: note:   template argument
	deduction/substitution failed:
	../../odb/parser.cxx:1821:66: error: template argument 1 is invalid
		array& a (unit_->new_node<array> (file, line, clmn, t, size));
		^
	../../odb/parser.cxx:1821:67: error: 'a' was not declared in this scope
		array& a (unit_->new_node<array> (file, line, clmn, t, size));
									    ^
Compiling odb without C++11 option.
	$ make clean
	$ ../configure CC=gcc-4.8 CXX=g++-4.8 CPP=cpp-4.8
CPPFLAGS=-I/usr/odb/include
		LDFLAGS=-L/usr/odb/lib --prefix=/usr/odb
	$ make && sudo make install

7. Build odb-examples-2.2.0 with C++11 option, libodb-qt, and
libodb-boost. 

	$ cd /Developer/odb-examples-2.2.0 && mkdir build && cd build
	$ ../configure ODB=/usr/odb/bin/odb CC=gcc-4.8 CXX=g++-4.8 CPP=cpp-4.8
		CXXFLAGS=-std=c++0x CPPFLAGS='-I/usr/odb/include
		-I/Developer/boost_1_53_0 -I/Developer/Qt5.0.2/5.0.2/clang_64/include’
		LDFLAGS='-L/usr/odb/lib -L/Developer/boost_1_53_0
		-F/Developer/Qt5.0.2/5.0.2/clang_64/lib' --prefix=/usr/odb
--with-database=sqlite
	$ make && sudo make install
	
For some reason, runnig examples or ‘make check’ fails with an error like
this:

	dyld: Library not loaded: libboost_system.dylib
	Referenced from: 
/Developer/odb-examples-2.2.0/build/./inheritance/polymorphism/driver
	Reason: image not found
	Trace/BPT trap: 5

Maybe, the problem is in my Boost configuration, but I noticed that
configure fails to detect date-time and system libraries from Boost, even
though it does detect Boost itself. In the log it seems that configure
looks for names like ‘boost_date_time’, whereas in the Boost lib folder
the names are ‘libboost_date_time’. I fixed this with the following
band-aid:

	$ export DYLD_FALLBACK_LIBRARY_PATH=/Developer/boost_1_53_0/stage/lib

After this, I can run all the examples without problems.


8. Build odb-tests-2.2.0 with C++11 option.


	$ cd /Developer/odb-examples-2.2.0 && mkdir build && cd build
	$ ../configure ODB=/usr/odb/bin/odb CC=gcc-4.8 CXX=g++-4.8 CPP=cpp-4.8
CXXFLAGS=-std=c++0x
		CPPFLAGS='-I/usr/odb/include -I/Developer/boost_1_53_0
		-I/Developer/Qt5.0.2/5.0.2/clang_64/include’
		LDFLAGS='-L/usr/odb/lib -L/Developer/boost_1_53_0
		-F/Developer/Qt5.0.2/5.0.2/clang_64/lib’
		--prefix=/usr/odb --with-database=sqlite
	$ make

Unfortunately, make terminates with one of the errors I already mentioned
in the previous message:

	g++-4.8 -DHAVE_CONFIG_H   -I'../../libcommon' -I'../../../libcommon'
-I'.’ 
		-I'../../../common/definition' -I/usr/odb/include
		-I/Developer/boost_1_53_0 -I/Developer/Qt5.0.2/5.0.2/clang_64/include
		-std=c++0x -D_THREAD_SAFE  -MT driver.o -MD -MP -MF $depbase.Tpo -c -o
driver.o 			../../../common/definition/driver.cxx &&\
	mv -f $depbase.Tpo $depbase.Po
	In file included from ../../../common/definition/driver.cxx:19:0:
	./test-odb.hxx:109:7: error: ‘image_type’ in ‘class
		odb::access::composite_value_traits<timeval, (odb::database_id)1u>’
		does not name a type
	composite_value_traits< ::timeval, id_sqlite >::image_type time_value;
	^ 

I may try building libodb and tests both without C++11 option tomorrow,
especially if you think it makes sense. Maybe, everything is Ok with ODB,
but I would still like to run the tests just to double-check.

	Thank you for your time,
	S.


On 10-05-13 8:16 a, "Boris Kolpackov" <boris at codesynthesis.com> wrote:

>Hi,
>
>skh <skh1002 at gmail.com> writes:
>
>> If I specify CXXFLAGS=-std=c++0x, then make bombs out with this
>>message: 
>>
>> Undefined symbols for architecture x86_64:
>> "odb::vector_base::vector_base(odb::vector_base&&)²,
>> referenced from: odb::vector<item, std::allocator<item>
>> >::vector(odb::vector<item, std::allocator<item> >&&)
>> in driver.o
>
>This is actually a bug in libodb. A workaround would be to build libodb
>in the C++11 mode as well.
>
>
>> I don't specify CXXFLAGS, the error message is different:
>> Making all in access
>> make  all-am
>> 
>> test-odb.cxx:2463:13: error: `move' is not a member of `std' o.p2
>>(std::move
>> (v));
>
>I am pretty sure you didn't run make clean before re-building in the C++98
>mode and test-odb.cxx is the old file generated for C++11.
> 
> 
>> In this case, CXXFLAGS=-std=c++0x option produces the same error
>>message as
>> before, but if I omit it, the following is generated:
>> 
>> make all-am
>> In file included from
>> ../../../odb-tests-2.2.0/common/definition/driver.cxx:19:0:
>> ./test-odb.hxx:109:7:
>> error: 'image_type' in 'class
>>odb::access::composite_value_traits<timeval,
>> (odb::database_id)1u>'
>> does not name a type
>> composite_value_traits< ::timeval, id_sqlite >::image_type time_value;
>
>I am not sure about this one though it can also be an artifact of dirty
>rebuild. Can you try these steps using clean source/build directories?
>
>
>Boris





More information about the odb-users mailing list