Re: Install Galera from the sources

177 views
Skip to first unread message

Ignacio Nin

unread,
Jun 21, 2012, 12:43:18 PM6/21/12
to percona-d...@googlegroups.com
Hi,

You're compiling with -Werror, which treats warnings as errors (check
line cc1plus: warnings being treated as errors). Usage of fwrite(3)
issues a warning if the result is ignored:

galera/src/saved_state.cpp:238:40: error: ignoring return value of
'size_t fwrite(const void*, size_t, size_t, FILE*)', declared with
attribute warn_unused_result

Try removing it from CXXFLAGS if you've set it there -- or if galera is
setting it itself, try setting your own CXXFLAGS before compiling. I'm
not familiar on how the build is performed in gentoo (steps?) so if you
can elaborate maybe I can pinpoint it.


N.

El 21/06/12 07:05, LeCouz escribi�:
> Hi.
>
> I tried to compil Galera from the bzr repository on a Gentoo server.
> But I have this error:
>
> g++ -o galera/src/saved_state.o -c -Wno-long-long -Wno-deprecated
> -ansi -pipe -Weffc++ -Wold-style-cast -g -O3 -DNDEBUG -m64 -Wall
> -Wextra -Werror -Wno-unused-parameter -pedantic -D_XOPEN_SOURCE=600
> -DHAVE_COMMON_H -DGALERA_USE_GU_NETWORK -DHAVE_BYTESWAP_H
> -DHAVE_ENDIAN_H -DHAVE_BOOST_SHARED_PTR_HPP
> -DHAVE_BOOST_UNORDERED_MAP_HPP
> -DBOOST_DATE_TIME_POSIX_TIME_STD_CONFIG=1
> -DGALERA_USE_BOOST_POOL_ALLOC=1 -DHAVE_ASIO_HPP -DHAVE_ASIO_SSL_HPP
> -Icommon -Iasio -Igalerautils/src -Igcomm/src -Igcomm/src/gcomm
> -Igcache/src -Igcs/src -Iwsdb/src -Igalera/src galera/src/saved_state.cpp
> cc1plus: warnings being treated as errors
> galera/src/saved_state.cpp: In member function 'void
> galera::SavedState::write_and_flush(const wsrep_uuid_t&, wsrep_seqno_t)':
> galera/src/saved_state.cpp:238:40: error: ignoring return value of
> 'size_t fwrite(const void*, size_t, size_t, FILE*)', declared with
> attribute warn_unused_result
> scons: *** [galera/src/saved_state.o] Error 1
> scons: building terminated because of errors.
>
> Is anybody have an idea?
> Dependences missing?
>
> Thanks.
> --
> You received this message because you are subscribed to the Google
> Groups "Percona Discussion" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/percona-discussion/-/ceIhfnJ5x_EJ.
> To post to this group, send email to percona-d...@googlegroups.com.
> To unsubscribe from this group, send email to
> percona-discuss...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/percona-discussion?hl=en.


--
Ignacio Nin
Build Engineer, Percona Inc.

http://www.percona.com/
(+1 877) 862-4316 ext 524
skype ignacio-nin

Our blog: http://www.mysqlperformanceblog.com/

Got MySQL support?
http://tinyurl.com/mysql-support

Alex Yurchenko

unread,
Jun 21, 2012, 1:33:36 PM6/21/12
to percona-d...@googlegroups.com
Hi,

This is a compiler warning policy issue, and different GCC versions
have it different. What GCC version are you using?

I guess the quickest workaround in your case would be to find the
following lines in the top-level SConstruct file:

env.Replace(CCFLAGS = opt_flags + compile_arch +
' -Wall -Wextra -Werror -Wno-unused-parameter')

and append -Wno-unused-result after -Wno-unused-parameter

Regards,
Alex
Alexey Yurchenko,
Codership Oy, www.codership.com
Skype: alexey.yurchenko, Phone: +358-400-516-011

LeCouz

unread,
Jun 25, 2012, 2:22:46 AM6/25/12
to percona-d...@googlegroups.com
Hi.

Thanks for your answers.

If you want to test, here is the overlay to install Percona Xtradb Cluster on Gentoo

Stewart Smith

unread,
Jul 25, 2012, 3:13:11 AM7/25/12
to Alex Yurchenko, percona-d...@googlegroups.com
Alex Yurchenko <alexey.y...@codership.com> writes:

> Hi,
>
> This is a compiler warning policy issue, and different GCC versions
> have it different. What GCC version are you using?

It'll actually be libc headers, as whatever version must have added
__attribute__((warn_unused_result)) for fwrite.

Quite rightly, the warning is pointing out a bug, it's just that we're
probably all sitting at slightly older libc or something.

> I guess the quickest workaround in your case would be to find the
> following lines in the top-level SConstruct file:
>
> env.Replace(CCFLAGS = opt_flags + compile_arch +
> ' -Wall -Wextra -Werror -Wno-unused-parameter')
>
> and append -Wno-unused-result after -Wno-unused-parameter

--
Stewart Smith
Reply all
Reply to author
Forward
0 new messages