Could not read serialized diagnostics file:

• Mar 29, 2020 - 17:09

I'm trying to compile musescore. And I don't understand what to do about a compile error.

I'm following the instructions I find here. https://musescore.org/en/handbook/developers-handbook/compilation/compi…

When I get down to the step described here,
Screenshot 2020-03-29 at 18.05.13.png
I'm trying to install the master branch. Is that the right one to compile?

I get an error in building the "ALL_BUILD" scheme.

error: Build input file cannot be found: '/Users/jimka/Repos/MuseScore/build.xcode/mtest/testutils_automoc.cpp' (in target 'testutils' from project 'mscore')
warning: Could not read serialized diagnostics file: Cannot Load File: Failed to open diagnostics file (in target 'testutils' from project 'mscore')

Screenshot 2020-03-29 at 18.08.22.png

I'm including the build log file below.


Comments

I can't help with the specific error, but it is not actually necessary to build the XCode project in order to compile, run, and edit MuseScore's code on macOS.

Simply run the revision, release and install targets from Makefile.osx and don't bother with the package or xcode targets. You should end up with an mscore binary in a subdirectory of the "applebuild" directory. You can run this binary from the command line, edit some code in your favourite text editor or IDE, then run the compilation again and try the new binary.

If that fails, you can try to bypass Makefile.osx and call CMake directly:

mkdir my_build_dir
cd my_build_dir
cmake .. -DCMAKE_INSTALL_PREFIX=my_install_dir  # configure
cmake --build .                                 # compile
cmake --build . --target install                # install

This builds MuseScore in the folder "my_build_dir" and installs it to "my_build_dir/my_install_dir". You can call the folders anything you want, including "build.release" and "../applebuild" if you want to match the values given in Makefile.osx.

P.S. The above commands will build any CMake project (not just MuseScore) on any platform (not just MacOS). I don't know why MuseScore supplies platform-dependent Makefiles when the above code is simpler and platform-independent, but there you go!

P.P.S. I do the coding in Qt Creator rather than XCode. If you compile on the command line then it doesn't actually matter which IDE you use, but Qt Creator has various advantages.

In reply to by shoogle

trying to take the advise of shoogle, cmake .. -DCMAKE_INSTALL_PREFIX=my_install_dir produces the following error messages.

-- Precompiled header generation
Configuring telemetry
CMake Error at telemetry/CMakeLists.txt:22 (find_package):
Could not find a package configuration file provided by "Qt5" with any of
the following names:

Qt5Config.cmake
qt5-config.cmake

Add the installation prefix of "Qt5" to CMAKE_PREFIX_PATH or set "Qt5_DIR"
to a directory containing one of the above files. If "Qt5" provides a
separate development package or SDK, be sure it has been installed.

-- Configuring incomplete, errors occurred!
See also "/Users/jimka/Repos/MuseScore/my_build_dir/CMakeFiles/CMakeOutput.log".

In reply to by jim.newton.562

updated my environment variable Qt5_DIR to ~/Qt/5.9.9/clang_64/lib/cmake/Qt5/
and retry: cmake .. -DCMAKE_INSTALL_PREFIX=my_install_dir

I get the following error:
Telemetry feature is disabled
Build is unstable = TRUE
Telemetry track id is empty
MuseScore SoundFont is up to date.
-- ALSA support disabled
-- PulseAudio support disabled
-- Found lame: /usr/local/Cellar/lame/3.99.5/lib/libmp3lame.dylib
-- JACK (Jack Audio Connection Kit) >= 0.98.0 found. jack support enabled.
PortAudio found. PortAudio support enabled. INCDIR /usr/local/Cellar/portaudio/19.20140130/include, LIBDIR /usr/local/Cellar/portaudio/19.20140130/lib, LIB -L/usr/local/Cellar/portaudio/19.20140130/lib -lportaudio -framework CoreAudio -framework AudioToolbox -framework AudioUnit -framework Carbon
libvorbis detected /usr/local/Cellar/libvorbis/1.3.5/include /usr/local/Cellar/libvorbis/1.3.5/lib -L/usr/local/Cellar/libvorbis/1.3.5/lib -lvorbis
libogg detected /usr/local/Cellar/libogg/1.3.2/include /usr/local/Cellar/libogg/1.3.2/lib -L/usr/local/Cellar/libogg/1.3.2/lib -logg
libsndfile detected /usr/local/Cellar/libsndfile/1.0.26/include /usr/local/Cellar/libsndfile/1.0.26/lib -L/usr/local/Cellar/libsndfile/1.0.26/lib -lsndfile
-- Precompiled header generation
Configuring telemetry
Configuring google_analytics
Configuring global
CMake Error at mscore/CMakeLists.txt:89 (QT5_WRAP_UI):
Unknown CMake command "QT5_WRAP_UI".

BTW, I installed QT as explained here: Is something missing from these instructions?
https://musescore.org/en/handbook/developers-handbook/compilation/compi…

In reply to by jim.newton.562

Perhaps the instructions to add the environment variable Qt5_DIR is missing from https://musescore.org/en/handbook/developers-handbook/compilation/compi… ?

I've added the env var to my environment, and restarted xcode via: open build.xcode/mscore.xcodeproj
Then I tried to run the "mscore" scheme. Alas that fails for new reasons.
Screenshot 2020-03-30 at 09.56.23.png

In reply to by jim.newton.562

Don't bother with the Qt5_DIR variable. Instead, run this to make sure that Qt is found in your PATH:

qmake --version

If it's not found, do:

export PATH="${PATH}:${HOME}/Qt/5.9.9/clang_64/bin"

and then run the commands I gave above.

If that works then add the export line to ~/.bash_profile to make it permanent. (If you've already written it in ~/.bash_profile then make sure the version matches the one you have installed.)

In reply to by shoogle

Great!. Thanks for the clue. I had added /Qt/5.9.9/clang_64/bin to my PATH rather than ${HOME}/Qt/5.9.9/clang_64/bin
It was my copy/paste error.

Now I can run cmake .. -DCMAKE_INSTALL_PREFIX=my_install_dir
as you suggested.
However, cmake --build . fails.

The log includes lots and lots of warnings and a few errors which look quite similar.
Here are a few, and the log file is attached.

Screenshot 2020-03-30 at 10.11.01.png
Screenshot 2020-03-30 at 10.12.13.png

In reply to by jim.newton.562

I'm on Windows right now so can't test, but you can experiment adding these option to the configure line:

-G Xcode                     # build with xcodebuild instead of make
-DCMAKE_BUILD_TYPE=RELEASE   # not a debug build (also skips building mtest on macOS)

So that would make it:

cmake .. -G Xcode -DCMAKE_BUILD_TYPE=RELEASE -DCMAKE_INSTALL_PREFIX=my_install_dir

In reply to by shoogle

ok, that cmake succeeded, thanks.
Now when I try to run cmake --build . I get the following error.

warning: Could not read serialized diagnostics file: Cannot Load File: Failed to open diagnostics file (in target 'effects' from project 'mscore')

** BUILD FAILED **


The following build commands failed:
    CompileC /Users/jimka/Repos/MuseScore/my_build_dir/effects/mscore.build/Debug/effects.build/Objects-normal/x86_64/qrc_zita.o /Users/jimka/Repos/MuseScore/my_build_dir/effects/qrc_zita.cpp normal x86_64 c++ com.apple.compilers.llvm.clang.1_0.compiler
    CompileC /Users/jimka/Repos/MuseScore/my_build_dir/effects/mscore.build/Debug/effects.build/Objects-normal/x86_64/effects_automoc.o /Users/jimka/Repos/MuseScore/my_build_dir/effects/effects_automoc.cpp normal x86_64 c++ com.apple.compilers.llvm.clang.1_0.compiler
(2 failures)

Screenshot 2020-03-30 at 11.08.21.png

Attachment Size
Screenshot 2020-03-30 at 11.08.21.png 111.91 KB

In reply to by jim.newton.562

Try deleting the build directory and then start again.

rm -rf my_build_dir
mkdir my_build_dir
etc.

Use the new configure command I gave you last time:

cmake .. -G Xcode -DCMAKE_BUILD_TYPE=RELEASE -DCMAKE_INSTALL_PREFIX=my_install_dir

Once you have a successful build you only need to run the compile and install steps to update it in future, but its best to run all steps if you have problems.

In reply to by shoogle

OK, I did as you suggested.

rm -rf my_build_dir
mkdir my_build_dir
cd my_build_dir
cmake .. -G Xcode -DCMAKE_BUILD_TYPE=RELEASE -DCMAKE_INSTALL_PREFIX=my_install_dir

Seems to work great to this point, but then

cmake --build . 

gives the following error

warning: Could not read serialized diagnostics file: Cannot Load File: Failed to open diagnostics file (in target 'portmidi' from project 'mscore')

** BUILD FAILED **


The following build commands failed:
    CompileC /Users/jimka/Repos/MuseScore/my_build_dir/thirdparty/portmidi/mscore.build/Debug/portmidi.build/Objects-normal/x86_64/portmidi_automoc.o /Users/jimka/Repos/MuseScore/my_build_dir/thirdparty/portmidi/portmidi_automoc.cpp normal x86_64 c++ com.apple.compilers.llvm.clang.1_0.compiler
(1 failure)

Do you still have an unanswered question? Please log in first to post your question.