Compiling from source - stakira/OpenUtau GitHub Wiki
Compiling OpenUtau from source
Compiling OpenUtau can be done easily.
Prerequisites
You will need the .NET 6.0 SDK.
For Windows and Mac you can get it here
On Ubuntu, Debian, or any derivatives (e.g. Linux Mint):
sudo apt install dotnet-sdk-6.0
On an Arch-based distro:
sudo pacman -S dotnet-sdk
For other instructions see the link above.
You will also neet Git. Windows | Mac | Linux
Download source code
Once you have the prerequisites set up, run the following command to clone the repository
git clone https://github.com/stakira/OpenUtau.git
Building in Visual Studio
Visual Studio is an IDE for .NET that supports Windows.
Download and install Visual Studio Community 2022 from Visual Studio Official Website. Choose ".NET Desktop Development" workload when installing.
Open "OpenUtau.sln" with Visual Studio.
Choose "OpenUtau" and click the green ▶ icon to run.
Building in Visual Studio Code
Visual Studio Code (aka. VSCode) is a lightweight code editor that supports Windows, MacOS and Linux.
Download and install VSCode from VSCode official website
Launch VSCode, search and install the C# extension.
Open the directory where you've downloaded the source code of OpenUtau and open any .cs file. A notification saying "Required assets to build and debug are missing from 'OpenUtau'. Add them?" will pop up. Click "Yes".
Open .vscode/launch.json
, change the "OpenUtau.dll" to the executable file name on your OS, like "OpenUtau.exe" on windows.
Click "Run → Start Debugging"
Building in GitHub Codespaces
GitHub Codespaces is an online linux environment provided by GitHub with a vscode webui. Users can access to GitHub Codespaces from any device with a browser.
On OpenUtau's repo page, click "Code → Codespaces → +"
Open any .cs file under the OpenUtau
folder, and click the Debug button
Ports → Add Port → input 6080
→ Open In Browser
In the noVNC page poped up, connect → input vscode
Successfully connected to the remote desktop of GitHub Codespaces.
Building from command line
Navigate to the directory via command line
cd OpenUtau
And finally, to compile, run the following commands:
dotnet restore OpenUtau
dotnet build OpenUtau
The executable files will be in the directory OpenUtau/OpenUtau/bin/Debug/net6.0
Building worldline
Worldline is the c++ part of OpenUtau.
- Install Bazelisk
- In commond line, cd to cpp folder
- Run
bazelisk build //worldline
to build .dll on Windows, .dylib on macOS or .so on Linux. You can also runbazelisk build //worldline:main
to build a executable version, though curve expressions won't be available.
Notes:
- On Windows omits // in commands.
- Recommends Visual Studio Code to leverage IntelliSense.
- If Bazel ever freezes on Windows, open up Task Manager and kill the Java process.
- bazelisk clean cleans up build cache.
- bazelisk clean --expunge cleans up build cache and dependencies.
Debugging worldline in visual studio
- Build worldline with
bazelisk build worldline -c dbg
- Copy the compiled dll and pdb (in
<path to your openutau repo>\cpp\bazel-out\x64_windows-dbg\bin\worldline
) intoruntimes\win-x64\native
- In visual studio, open OpenUtau.sln, right click on the OpenUtau project -> properties -> Debug -> Open debug launch profiles UI -> enable native code debugging
- In visual studio, debug -> options -> debugging -> symbols, add
<path to your openutau repo>\cpp\bazel-out\x64_windows-dbg\bin\worldline
- run
Testing pull requests from other developer
- navigate to your openutau development folder
git stash
to save any uncommitted changesgit fetch https://github.com/{author}/OpenUtau {branch}; git checkout FETCH_HEAD
, replacing {author} and {branch} with the author and branch you want to test(e.g. git fetch https://github.com/lennyservant/OpenUtau improve-classic-pitch-timing; git checkout FETCH_HEAD)- open visual studio, build and run
You can find the author and branch name in the pull request on github, which usually have a line with the format author:branch just below the pull request title
After testing, you can switch back to your branch and pop/apply your stashed changes through visual studio (menu -> view -> git changes), or you can type git checkout {branch}
to switch branches and git stash pop
to pop stashed changes