-
Notifications
You must be signed in to change notification settings - Fork 40
Compile
To compile mu
, it is quite different under different operating system. This documentation records the way to compile mu
on Windows, Mac OS X and Linux.
We suggest you to compile mu
using the official MSVC version Qt 5 releases for 64-bit Windows, and MinGW version Qt 5 releases for 32-bit Windows. You can downloaded the latest open source Qt 5 versions from its official site.
With the default configuration, it needs FFMpeg
library for media file analysis. To get FFMpeg
source code (GPLv3 License version), you can get it from its homepage. To get the binary compiled version of FFMpeg, you can get it from Zeranoe.
In the official mu
releases, we are using the binary compiled version from Zeranoe. You need the 'Shared' and 'Dev' version of FFMpeg for the correct version of your compiler. If you are using MinGW version Qt release, you need to choose 32-bit version. If you are using MSVC version Qt release, you will need the 64-bit version.
Notice: the version of compiler is different from the version of your operating system. You can use 32-bit compiler under 64-bit operating system. e.g. running 32-bit MinGW under 64-bit Windows 7. So, all the following 32-bit and 64-bit is talking about the version of compiler, but not the operating system.
After download those files, you need to ensure that Qt could find those library. Extract the 'Dev' and 'Shared' zipped files to a single folder. At that folder, it should contains directories like 'bin' and 'include'. One way to ensure that Qt could find the files is to copy all these folders to the Qt's directory.
Suppose the installation directory of Qt is at D:\Qt5.8.0
, the directory should has the following sub-directories or files:
5.8 (Which is the version of the Qt)
dist
Docs
Examples
Licenses
Tools
vcredist
components.xml
installationLog.txt
MaintenanceTool.dat
MaintenanceTool.exe
MaintenanceTool.ini
network.xml
The content might be changed for different versions, but mainly it should has the same framework. Open the 5.8
(the version of the Qt) folder, it should have only one directory which is the name of the compiler. For example, mingw53_32
. Open the directory, you can find the following sub-directories or files:
bin
doc
include
lib
mkspecs
phrasebooks
plugins
qml
translations
.tag
The same, for different versions it might be different, but it should have bin
, include
and lib
. The path of this folder should be D:\Qt5.8.0\5.8\mingw53_32\
. In the following of this tutorial, this path will be used as the example path. You have to replace the folder to the actual place you installed the Qt.
Copy all these directories ('bin', 'include', etc.) to D:\Qt5.8.0\5.8\mingw53_32\
. After this operation, all the FFMpeg files should be found by Qt.
For a simple notice, path D:\Qt5.8.0\5.8\mingw53_32\
will be used as the example path in this chapter. In the folder, it should have folder bin
, include
and lib
. You have to replace the folder to the actual place you installed the Qt.
First, you have to download the Bass library for Windows from un4seen. It is a zip file named as bass24.zip
. Then, decompress the file.
For 32-bit compiler, you can find bass.dll
in the new directory. For 64-bit compiler, you can find bass.dll
in the x64
directory in the new directory. This is the dynamic linked library version bass. Copy the correct version of bass.dll
to D:\Qt5.8.0\5.8\mingw53_32\bin
.
Open the c
folder in the decompressed directory of bass.zip
, you should find bass.h
. Copy bass.h
to D:\Qt5.8.0\5.8\mingw53_32\include
. If you are using the 32-bit version compiler, copy the bass.lib
in the same directory of bass.h
to D:\Qt5.8.0\5.8\mingw53_32\lib
. If you are using a 64-bit version compiler, copy the bass.lib
in the x64
folder under the bass.h
directory to D:\Qt5.8.0\5.8\mingw53_32\lib
.
Launch Qt Creator, open the mu.pro
file at the root of the source code. Click 'Run qmake'. After it done, click 'Build All' or 'Rebuild All'.
We suggest you to use multi-process compiling for shorten the compiling time. To use multi-process compiling, please check the section in FAQ.
With the default configuration, it needs FFMpeg
library for media file analysis and bass
for playing. You can compile FFMpeg from the source code. To get FFMpeg source code (GPLv3 License version), you can get it from its homepage. However, we suggest you to use home brew to manage all these libraries.
First, you need to install the Qt 5. It is quite the same as Windows version. First, you need to download the Qt 5 official release from its official site. This version is the GPL and LGPL open source version. You can download the other version for your own needs.
The official release is compiled by Qt for Mac OS X on 10.9.5.
Also, you need XCode for its command line tools. To install XCode, you have to install it from the Mac App Store. Or you can download it from Apple Developer.
To install Command Line Tools, we provide two ways here:
-
Launch terminal, execute
xcode-select --install
. Clickinstall
, and follow the wizard, then it will help you install the right version of the Command Line Tools. -
Access Apple Developer. Click the
Account
tab at the banner. Use your Apple ID to log in. ClickDownload
at the left bar, it will bring you to a new page with the latest beta version of XCode and the latest official release of XCode. At the bottom of the page, click the link called 'See More Downloads'. There you can find the history version of XCode and Command Line Tools. Install the correct version for your Mac OS X.
If you want to manage the libraries using Homebrew, you need to install it. If you want to manage all the libraries manually, you can skip this part.
Follow the instruction at the homepage of Homebrew, you can install the Homebrew easily. It could be quite slow in China for the public known reason.
If you already installed Homebrew, you may need to launch brew update
and brew upgrade
for updating all the packages to the latest version.
You can compile and install the FFMpeg manually by download and following the instructions in the source code of FFMpeg from its official website.
Or you can use Homebrew to install the FFMpeg library. Launch the terminal and execute:
brew install ffmpeg
Homebrew will install FFMpeg or update FFMpeg if you installed it before. We suggest you to use the latest version of FFMpeg library.
You may got curl: (60) SSL certificate problem: Invalid certificate chain
error when you executing the FFMpeg installation (Test on Dec 13th, 2016). You have to use Safari to access https://ffmpeg.org
. Safari will pop up a dialog whose title is Safari can't verify the identity of the website "ffmpeg.org"
. Click Show Certificate
, and tick Always trust
, then 'Continue'. And this problem should be solved. For graphics tutorial, check the section in FAQ.
First, you have to download the Bass library for Mac OS X from un4seen. It is a zip file named as bass24-osx.zip
. Decompress the file. In the new directory, you can find libbass.dylib
and bass.h
.
Copy libbass.dylib
to /usr/local/lib
. Copy bass.h
to /usr/local/include
. However, you don't actually need to copy bass.h
, because µ's source code has already contained the bass.h
.
Launch Qt Creator, open the mu.pro
file at the root of the source code. Click 'Run qmake'. After it done, click 'Build All' or 'Rebuild All'.
We suggest you to use multi-process compiling for shorten the compiling time. To use multi-process compiling, please check the section in FAQ.
We have translated compile tutorial on our website:
- 简体中文: http://kreogist.github.io/Mu/cn/developers/index.html#CompileHowTo
- 繁體中文: http://kreogist.github.io/Mu/hk/developers/index.html#CompileHowTo
- English: http://kreogist.github.io/Mu/en/developers/index.html#CompileHowTo
This document will take Linux distribution based on Debian for instance, Linux with other package management application could use this as an instruction.
The following steps needs administrator privileges to install the dependence (sudo), you may need to input your adminitrator password.
First, you have to install GCC 4.8
or later for compiling. You can install all the essential staffs by:
sudo apt-get install build-essential
μ is dependent on Qt 5.3
or later, partial FFMpeg 1.0
or later and GStreamer 1.0
or later under Linux. It's simple to install those three dependences with the following command:
sudo apt-get install qt5-default libmpv-dev libavformat-dev libavutil-dev
Now, all the essential dependences of μ is ready.
We suggest you to compile μ with Qt Creator
. It's convienient to change the source code of μ. If you don't want to install Qt Creator, you can compile Mu with pure commands and view section Compile via Terminal below. You can install Qt Creator
by the following command:
sudo apt-get install qtcreator
You can compile via Qt Creator
or terminal. We suggest you to compile via Qt Creator
.
First, open the mu.pro
file under the source code directory in Qt Creator
.
For the first time you open the mu.pro
file, you have to click Configure Project button to enter the edit page.
Click the Project button on the left, Choose Release
in the Edit build configure combo box. Click the Details on the right of the step Make
.
According to your CPU logical threads number, Fill the Make arguments
with -jx
, x
is your CPU logical threads number. e.g., if you are using a dual core, quad threads CPU, you have to fill -j4
.
Click the Rebuild All item in the Build menu to start compile.
First, you have to create a new folder(we will call it build folder) out side the source code folder. Launch the terminal and switch to the build folder. Then use qmake
to generate Makefile
.
qmake (path to mu.pro)
The mu.pro
file is at the root of source code folder.
After the previous command finishs, you can use make
command to compile. We suggest you to enable multithread compiling, i.e. argument -j
. We suggest you to set the threads number to be the same as your logical threads number. e.g. if you are using a dual core quad threads CPU, you can execute:
make -j4
When make
finished, it will generate a bin
folder, there's the compiled binary mu
.
© 2013-2017 Kreogist Dev Team.
All other trademarks are the property of their respective owners. Hosted on GitHub. Powered by MarkDown.