Closed lemzwerg closed 6 years ago
Compilation fails with gcc 5.3.1 also, see attached log file.
Compilation fails with gcc 6.2.1 also, see attached log file.
This means there is a real compilation problem, since compilation must succeed with gcc 6 – this is what recent GNU/Linux distributions actually use.
Note that complete C++11 support was introduced in gcc version 4.8.1 (however, you need option -std=c++11
; since gcc version 6.0 C++14 is activated by default).
Hello lemzwerg,
I added a test for GCC and Clang, and asked Dominique as to which versions of the MicroSoft compilers provide C++11 features.
JM
Le 29 oct. 2017 à 07:43, lemzwerg notifications@github.com a écrit :
Compilation fails with gcc 6.2.1 also, see attached log file https://github.com/grame-cncm/libmusicxml/files/1424823/make-gcc6.2.1.zip.
This means there is a real compilation problem, since compilation must succeed with the gcc 6 – this is what recent GNU/Linux distributions actually use.
Note that complete C++11 support was introduced in gcc version 4.8.1 (however, you need option -std=c++11; since gcc version 6.0 C++14 is activated by default).
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/grame-cncm/libmusicxml/issues/15#issuecomment-340241283, or mute the thread https://github.com/notifications/unsubscribe-auth/AGKb-oRZKt3M-ZQQeQF5UFyycF7VQnC8ks5sxB6TgaJpZM4QKHCW.
I added a test for GCC and Clang, and asked Dominique as to which versions of the MicroSoft compilers provide C++11 features.
Thanks. However, I still get a compilation error with gcc 4.8.5 (this time using commit 3f3131024), see attachment.
Werner
Scanning dependencies of target musicxml2
[ 1%] Building CXX object CMakeFiles/musicxml2.dir/home/wl/git/libmusicxml/src/factory/musicxmlfactory.o
[ 2%] Building CXX object CMakeFiles/musicxml2.dir/home/wl/git/libmusicxml/src/factory/sortvisitor.o
[ 3%] Building CXX object CMakeFiles/musicxml2.dir/home/wl/git/libmusicxml/src/files/xmlfile.o
[ 5%] Building CXX object CMakeFiles/musicxml2.dir/home/wl/git/libmusicxml/src/files/xmlreader.o
[ 6%] Building CXX object CMakeFiles/musicxml2.dir/home/wl/git/libmusicxml/src/interface/libmusicxml.o
[ 7%] Building CXX object CMakeFiles/musicxml2.dir/home/wl/git/libmusicxml/src/interface/musicxml2guido.o
[ 8%] Building CXX object CMakeFiles/musicxml2.dir/home/wl/git/libmusicxml/src/interface/lpsr2LilypondInterface.o
[ 10%] Building CXX object CMakeFiles/musicxml2.dir/home/wl/git/libmusicxml/src/interface/msr2LpsrInterface.o
[ 11%] Building CXX object CMakeFiles/musicxml2.dir/home/wl/git/libmusicxml/src/interface/musicXML2mxmlTreeInterface.o
[ 12%] Building CXX object CMakeFiles/musicxml2.dir/home/wl/git/libmusicxml/src/interface/mxmlTree2MsrSkeletonBuilderInterface.o
[ 13%] Building CXX object CMakeFiles/musicxml2.dir/home/wl/git/libmusicxml/src/interface/mxmlTree2MsrTranslatorInterface.o
[ 15%] Building CXX object CMakeFiles/musicxml2.dir/home/wl/git/libmusicxml/src/elements/factory.o
[ 16%] Building CXX object CMakeFiles/musicxml2.dir/home/wl/git/libmusicxml/src/elements/unrolled_xml_tree_browser.o
[ 17%] Building CXX object CMakeFiles/musicxml2.dir/home/wl/git/libmusicxml/src/elements/versions.o
[ 18%] Building CXX object CMakeFiles/musicxml2.dir/home/wl/git/libmusicxml/src/elements/xml.o
[ 20%] Building CXX object CMakeFiles/musicxml2.dir/home/wl/git/libmusicxml/src/elements/xml_treebrowser.o
[ 21%] Building CXX object CMakeFiles/musicxml2.dir/home/wl/git/libmusicxml/src/guido/guido.o
[ 22%] Building CXX object CMakeFiles/musicxml2.dir/home/wl/git/libmusicxml/src/guido/xml2guidovisitor.o
In file included from /home/wl/git/libmusicxml/cmake/../src/lib/ctree.h:21:0,
from /home/wl/git/libmusicxml/cmake/../src/elements/xml.h:20,
from /home/wl/git/libmusicxml/cmake/../src/elements/types.h:17,
from /home/wl/git/libmusicxml/cmake/../src/elements/typedefs.h:23,
from /home/wl/git/libmusicxml/cmake/../src/visitors/notevisitor.h:24,
from /home/wl/git/libmusicxml/cmake/../src/visitors/partsummaryvisitor.h:19,
from /home/wl/git/libmusicxml/src/guido/xml2guidovisitor.cpp:21:
/home/wl/git/libmusicxml/cmake/../src/lib/smartpointer.h: In instantiation of ‘MusicXML2::SMARTP
Hello Werner,
A const_iterator is used:
for (
list<S_msrElement>::const_iterator i=fTupletElements.begin ();
i!=fTupletElements.end ();
++i) {
if ((*i) == note) {
// found note, erase it
fTupletElements.erase (i);
erase() changed from C++98 to C++11:
iterator erase (iterator position); iterator erase (iterator first, iterator last);
iterator erase (const_iterator position); iterator erase (const_iterator first, const_iterator last);
The same holds for insert().
I’ll use try_compile() to do a better job and let you know when it’s done.
Thanks for your help, I do appreciate it a lot!
JM
Le 30 oct. 2017 à 00:07, lemzwerg notifications@github.com a écrit :
I added a test for GCC and Clang, and asked Dominique as to which versions of the MicroSoft compilers provide C++11 features.
Thanks. However, I still get a compilation error with gcc 4.8.5 (this time using commit 3f3131024), see attachment.
erase() changed from C++98 to C++11:
iterator erase (iterator position); iterator erase (iterator first, iterator last);
iterator erase (const_iterator position); iterator erase (const_iterator first, const_iterator last);
OK. Looking at
it seems that cmake doesn't test the compiler's C++11 support properly – gcc 4.8.5 probably doesn't have this fixed, so cmake should reject anything older than 4.9.0 (or whatever the first supported version is).
On the other hand: Are you sure that this is the issue? I've again tried compilation with g++ 5.3.1 and g++ 6.2.1 – both which should have this `const_iterator' problem fixed, and it still fails.
Attached the recent log file for gcc 6, compiling commit 3f31310. Searching for the first occurrence of the word `error' I see
libmusicxml/src/lilypond/msr.cpp: In member function
‘virtual void MusicXML2::msrStaffDetails::print(std::ostream&)’:
libmusicxml/src/lilypond/msr.cpp:25415:44: error:
no match for ‘operator<<’ (operand types are
‘std::basic_ostream
setw (fieldWidth) <<
"staffTypeKind" << " = " <<
~~~~~~~~~~~~~~~~~~~~~~~~~~~
staffTypeKindAsString (fStaffTypeKind) <<
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~
// print the staff lines number if any
os << left <<
~~
For me, this is not related at all to the `const_iterator' thing...
Werner
Ah, I used the wrong compression format while replying by e-mail so that the attachment isn't automatically added. Here it is.
LilyDev 4 provides:
gcc version 4.9.2 (Debian 4.9.2-10)
Let’s go for this version as a minimum, since this version is not quite new.
What do you think?
JM
Sounds OK.
Note, however, that issues like the const_iterator
problem are the reason why I prefer the autoconf way, this is, testing for compiler capabilities instead of looking for a certain compiler version...
Le 29 oct. 2017 à 00:07, lemzwerg notifications@github.com a écrit :
[d539b71 https://github.com/grame-cncm/libmusicxml/commit/d539b7163f6fe51ce602e7838cff6f461b9495be, branch 'lilypond']
Using gcc 4.8.5 (and cmake 3.5.2) on my GNU/Linux box, I get a compilation error, see attached log file https://github.com/grame-cncm/libmusicxml/files/1424659/make.zip.
Maybe version 4.8.5 is too old – if this is true, there should be a proper cmake check to request the necessary C++11 features.
this is likely due to the iterator type: const_iterator with list::erase is specific to C++11 while list::erase (iterator) should work even with gcc 4.8.5
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/grame-cncm/libmusicxml/issues/15, or mute the thread https://github.com/notifications/unsubscribe-auth/AAaTw_VuOxBePDzK2ZSUoG8wuh5Jwuklks5sw6WsgaJpZM4QKHCW.
Le 29 oct. 2017 à 07:43, lemzwerg notifications@github.com a écrit :
Compilation fails with gcc 6.2.1 also, see attached log file https://github.com/grame-cncm/libmusicxml/files/1424823/make-gcc6.2.1.zip.
This means there is a real compilation problem, since compilation must succeed with the gcc 6 – this is what recent GNU/Linux distributions actually use.
Note that complete C++11 support was introduced in gcc version 4.8.1 (however, you need option -std=c++11; since gcc version 6.0 C++14 is activated by default).
it looks like all that is just a matter of compiler options...
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/grame-cncm/libmusicxml/issues/15#issuecomment-340241283, or mute the thread https://github.com/notifications/unsubscribe-auth/AAaTw-6v9ox-lJJFYlcsJJDq_uKJmWSNks5sxB6TgaJpZM4QKHCW.
Le 29 oct. 2017 à 17:08, jacques-menu notifications@github.com a écrit :
Hello lemzwerg,
I added a test for GCC and Clang, and asked Dominique as to which versions of the MicroSoft compilers provide C++11 features.
I’m using Visual studio express 2013 (or 2015) both support C++11. I think you can safely assume that current compilers are supporting C++11.
JM
Le 29 oct. 2017 à 07:43, lemzwerg notifications@github.com a écrit :
Compilation fails with gcc 6.2.1 also, see attached log file https://github.com/grame-cncm/libmusicxml/files/1424823/make-gcc6.2.1.zip.
This means there is a real compilation problem, since compilation must succeed with the gcc 6 – this is what recent GNU/Linux distributions actually use.
Note that complete C++11 support was introduced in gcc version 4.8.1 (however, you need option -std=c++11; since gcc version 6.0 C++14 is activated by default).
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/grame-cncm/libmusicxml/issues/15#issuecomment-340241283, or mute the thread https://github.com/notifications/unsubscribe-auth/AGKb-oRZKt3M-ZQQeQF5UFyycF7VQnC8ks5sxB6TgaJpZM4QKHCW.
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/grame-cncm/libmusicxml/issues/15#issuecomment-340273443, or mute the thread https://github.com/notifications/unsubscribe-auth/AAaTw_t3nAPyfYQWCTaqp6pqIsvnGTo2ks5sxKLigaJpZM4QKHCW.
Note that I’m using C++11 on the dev branch and it compiles without problem on all platforms (linux, windows and macOS) You should consider a merge from dev -> to lilypond. You’ll benefit from the last changes, especially regarding the build process and the validation process. However, I guess that won’t be trivial, the lily branch is diverging for a while, apparently without intermediate merge. If you need some help to do that, feel free to ask. — Dom
Le 30 oct. 2017 à 10:51, jacques-menu notifications@github.com a écrit :
Hello Werner,
A const_iterator is used:
for ( list
::const_iterator i=fTupletElements.begin (); i!=fTupletElements.end (); ++i) { if ((*i) == note) { // found note, erase it fTupletElements.erase (i); erase() changed from C++98 to C++11:
iterator erase (iterator position); iterator erase (iterator first, iterator last);
iterator erase (const_iterator position); iterator erase (const_iterator first, const_iterator last);
The same holds for insert().
I’ll use try_compile() to do a better job and let you know when it’s done.
Thanks for your help, I do appreciate it a lot!
JM
Le 30 oct. 2017 à 00:07, lemzwerg notifications@github.com a écrit :
I added a test for GCC and Clang, and asked Dominique as to which versions of the MicroSoft compilers provide C++11 features.
Thanks. However, I still get a compilation error with gcc 4.8.5 (this time using commit 3f3131024), see attachment. — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/grame-cncm/libmusicxml/issues/15#issuecomment-340394734, or mute the thread https://github.com/notifications/unsubscribe-auth/AAaTwzsxfeOztIclRbumZpG_UYP0afSsks5sxZwLgaJpZM4QKHCW.
Le 30 oct. 2017 à 11:38, jacques-menu notifications@github.com a écrit :
LilyDev 4 provides:
gcc version 4.9.2 (Debian 4.9.2-10)
I can compile the ‘dev’ branch on an old ubuntu 14 using gcc 4.8.4 without problem (and using C++11). You should not introduce useless limitation, rather find what’s the real issue.
Let’s go for this version as a minimum, since this version is not quite new.
What do you think?
JM
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/grame-cncm/libmusicxml/issues/15#issuecomment-340406224, or mute the thread https://github.com/notifications/unsubscribe-auth/AAaTw90Z4Ofhf6cz0UOOghAAlrUriU0qks5sxac1gaJpZM4QKHCW.
Well, the const_iterator
issue is a real and known problem with gcc 4.8.x, so asking for gcc 4.9.x is not unreasonable.
However, there are other compilation problems (as reported above), and hopefully this can be easily fixed.
Le 30 oct. 2017 à 20:57, lemzwerg notifications@github.com a écrit :
Well, the const_iterator issue is a real and known problem with gcc 4.8.x, so asking for gcc 4.9.x is not unreasonable.
agree However, there are other compilation problems (as reported above), and hopefully this can be easily fixed.
I’ve fixed a set of warnings and a syntax error. It compiles now on my side, on linux and macOS. There are still some unix specific calls that prevent compiling on windows.
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/grame-cncm/libmusicxml/issues/15#issuecomment-340565524, or mute the thread https://github.com/notifications/unsubscribe-auth/AAaTw4s-TxESNHGn-AAoLYjF2eltWWUwks5sxio9gaJpZM4QKHCW.
Confirmed! Commit d76599a30 now builds with both gcc 5 and 6.
Thanks for fixing!
[d539b7163f6fe51ce602e7838cff6f461b9495be, branch 'lilypond']
Using gcc 4.8.5 (and cmake 3.5.2) on my GNU/Linux box, I get a compilation error, see attached log file.
Maybe version 4.8.5 is too old – if this is true, there should be a proper cmake check to request the necessary C++11 features.