[yoshimi] Build errors on Mint 17, and a possible fix

  • From: Frank Neumann <beachnase@xxxxxx>
  • To: yoshimi@xxxxxxxxxxxxx
  • Date: Sat, 4 Jun 2016 14:43:45 +0200


Hi,

haven't been building Yoshimi from source for quite a while, I tried it again
today on my LinuxMint 17 (Qiana), using gcc4.8.

I found hundreds of error messages like this:

/usr/lib/gcc/x86_64-linux-gnu/4.8/include/mmintrin.h: In function ‘__m64 
_mm_cvtsi32_si64(int)’:
/usr/lib/gcc/x86_64-linux-gnu/4.8/include/mmintrin.h:61:54: error: can’t 
convert between vector values of different size
   return (__m64) __builtin_ia32_vec_init_v2si (__i, 0);
                                                      ^
/usr/lib/gcc/x86_64-linux-gnu/4.8/include/mmintrin.h: In function ‘int 
_mm_cvtsi64_si32(__m64)’:
/usr/lib/gcc/x86_64-linux-gnu/4.8/include/mmintrin.h:104:53: error: cannot 
convert ‘__m64 {aka int}’ to ‘__vector(2) int’ for argument ‘1’ to ‘int 
__builtin_ia32_vec_ext_v2si(__vector(2) int, int)’
   return __builtin_ia32_vec_ext_v2si ((__v2si)__i, 0);
..
make[2]: *** [CMakeFiles/yoshimi.dir/Misc/Config.cpp.o] Error 1
make[2]: Leaving directory `/home/franky/src/audio/yoshimi-git/build/src'
make[1]: *** [CMakeFiles/yoshimi.dir/all] Error 2


but wasn't sure at first what changed. Then, a bit of googling brought me to
the recently introduced C++11 standard changes.
This page: 
http://stackoverflow.com/questions/19043109/gcc-4-8-1-combining-c-code-with-c11-code
stated that:
"...As it is not practical to comment a system header, a workaround is to use 
g++ --std=gnu++11 instead of g++ --std=c++11 as it does not define 
__STRICT_ANSI__. It worked in my case.

It seems to be a bug in gcc."


So, I tried this:
franky@silence:~/src/audio/yoshimi-git/build/src> diff -u CMakeLists.txt.orig 
CMakeLists.txt
--- CMakeLists.txt.orig 2016-06-04 14:29:38.518835880 +0200
+++ CMakeLists.txt      2016-06-04 14:30:53.324831450 +0200
@@ -24,7 +24,7 @@
     cmake_policy (SET CMP0046 OLD)
 endif (POLICY CMP0046)
 set (CMAKE_CXX_STANDARD 11) # we seem to need both for
-add_definitions(-std=c++11) # various versions of cmake
+add_definitions(-std=gnu++11) # various versions of cmake
 set (YOSHIMI_VERSION "1.4.0 rc2")
 file (WRITE version.txt "${YOSHIMI_VERSION}")

and was able to build Yoshimi fine again afterwards.

Not sure whether this can be regarded as an actual fix or just a workaround,
but I thought you might want to know.

Greetings,
Frank

Yoshimi source code is available from either: 
http://sourceforge.net/projects/yoshimi
Or: https://github.com/Yoshimi/yoshimi
Our list archive is at: https://www.freelists.org/archive/yoshimi
To post, email to yoshimi@xxxxxxxxxxxxx

Other related posts: