How to Compile CEN64

Discuss frequently asked questions and post guides here.
Post Reply
User avatar
Devin
Posts: 14
Joined: Sun Oct 27, 2013 12:58 am

How to Compile CEN64

Post by Devin » Sat Nov 02, 2013 5:21 pm

Thank you to Snowstorm64, Nacho, and Presence for helping me improve the guide.

Note: To enable SSE 4.1 search for and remove the "-DSSSE3_ONLY" flag in the RSP and RDP makefiles.

Windows

Things you will need.

Git: http://windows.github.com/

A GCC Compiler: http://sourceforge.net/projects/tdm-gcc ... e/download

If you use mingw64 be sure that the mingw64\bin directory is added to your system path.
The system path variable can be found by right clicking My Computer and clicking property's then click Advanced system settings under the advanced tab and finally clicking on environment variables.

Edit path and add the mingw64\bin directory path to the line while separating any other paths with a semicolon at the end.

Example Path: C:\Program Files\mingw-builds\x64-4.8.1-posix-seh-rev5\mingw64\bin;

Needed libraries and headers: http://wwww.cen64.com/windows-binaries.zip

With Git Shell enter either of these.

Code: Select all

Stable: git clone https://github.com/tj90241/cen64.git cen64
Unstable: git clone -b next-version https://github.com/tj90241/cen64.git cen64_unstable
Copy and paste the files and folders from windows-binaries.zip into your cen64 folder.

If you get this error "Makefile:201: recipe for target 'liprsp' failed." then cen64-rsp has to be downloaded and added manually.
https://github.com/tj90241/cen64-rsp/archive/master.zip
Just copy and paste the files from the zip into the rsp folder.

With Git Shell enter the following commands.

Code: Select all

cd cen64

git submodule init (Only needed once.)

To update Git Repository:
git submodule update
Unneeded but will result in more up to date submodules.

Code: Select all

Stable: git submodule foreach git pull origin master
Unstable: git submodule foreach git pull origin next-version
To compile the code:
Goto the following directory: C:\Users\YourUsername\Documents\GitHub\cen64\windows
Run release or debug and if all went well it should spew out a shiny new cen64 executable.
Be sure to keep the OpenAL32.dll file in the same directory as the cen64 executable.

Linux

First install git, libglfw-dev, and the libalut-dev package.
On Debian based systems like Ubuntu use "sudo apt-get install git libglfw-dev libalut-dev".
On Redhat based systems like Fedora use "sudo yum install git libglfw-devel libalut-devel".
On Arch you can use this PKGBuild by Presence. https://aur.archlinux.org/packages/cen64-git/

Open a terminal in a new folder named lets say Cen64-Source. Then enter the commands below.

Code: Select all

Stable: git clone https://github.com/tj90241/cen64.git cen64
Unstable: git clone -b next-version https://github.com/tj90241/cen64.git cen64_unstable

Set your directory into the cen64 folder with cd or open a new terminal there.

git submodule init (Only needed once.)

To update Git Repository:
git submodule update
Unneeded but will result in more up to date submodules.

Code: Select all

Stable: git submodule foreach git pull origin master
Unstable: git submodule foreach git pull origin next-version
Now to compile the code:

Code: Select all

make clean && make
For Debug Build:
make clean && make -e debug
If all went well a file simply called cen64 should be in your build directory.
Last edited by Devin on Fri Jan 10, 2014 7:29 pm, edited 11 times in total.

User avatar
The Extremist
Posts: 29
Joined: Sun Nov 03, 2013 6:11 pm
Location: Canadian Prairie

Re: How to Compile Cen64

Post by The Extremist » Sun Nov 03, 2013 6:29 pm

Don't want the "double-click to run" idiots using it, eh? ;)

User avatar
Devin
Posts: 14
Joined: Sun Oct 27, 2013 12:58 am

Re: How to Compile Cen64

Post by Devin » Sun Nov 03, 2013 6:46 pm

The Extremist wrote:Don't want the "double-click to run" idiots using it, eh? ;)
I changed it. I don't want to be insulting anyone by over simplifying it.

User avatar
Nacho
Posts: 66
Joined: Thu Nov 07, 2013 9:25 am

Re: How to Compile Cen64

Post by Nacho » Fri Nov 22, 2013 12:01 pm

If you have a SSE4.1 capable processor and you want CEN64 to use these features, you should edit the Makefiles in cen64/rsp and in cen64/rdp.

Just remove the word -DSSSE3_ONLY
Testing CEN64 on: Intel Core i5 520M 2.4 GHz. SSE2 SSE3 SSE4.1 SSE4.2 SSSE3, but no AVX. Ubuntu Linux

Presence
Posts: 51
Joined: Fri Oct 18, 2013 9:27 am

Re: How to Compile Cen64

Post by Presence » Fri Nov 22, 2013 12:18 pm

Something to add here: When fetching from github, if you just use `git submodule update` it will only fetch the submodule commit that cen64 repository is pointed at. If you would like to fetch all the latest changes from the submodules as well, you can run this:

Code: Select all

git submodule foreach git pull origin master

beannaich
Posts: 149
Joined: Mon Oct 21, 2013 2:43 pm

Re: How to Compile Cen64

Post by beannaich » Sat Nov 23, 2013 1:45 am

Presence wrote:Something to add here: When fetching from github, if you just use `git submodule update` it will only fetch the submodule commit that cen64 repository is pointed at. If you would like to fetch all the latest changes from the submodules as well, you can run this:

Code: Select all

git submodule foreach git pull origin master
How about:

Code: Select all

$ git submodule init && git submodule update
? :)

Presence
Posts: 51
Joined: Fri Oct 18, 2013 9:27 am

Re: How to Compile Cen64

Post by Presence » Sat Nov 23, 2013 12:06 pm

beannaich wrote:How about:

Code: Select all

$ git submodule init && git submodule update
? :)
That wouldn't pull in all the lastest changes. For example, right now there are several commits in the vr4300 repository that the main repository hasn't been updated to pull in (currently its pulling commit 91703f4845). If you want, you can fetch those:

Code: Select all

From git://github.com/tj90241/cen64-vr4300
 * branch            master     -> FETCH_HEAD
Updating 91703f4..162c7d7
Fast-forward
 CPU.c          |   3 ++
 CPU.h          |   2 +
 DCStage.c      | 511 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++------------------------------------------------------
 DCStage.h      |  60 ++++++++++++++++++------------
 DCache.c       |  86 +++++++++++++++++++++++++++++++++++++++++++
 DCache.h       |  34 +++++++++++++++++
 EXStage.c      |  98 ++++++++++++++++++++++++++++++++++++++++--------
 Fault.c        |  52 ++++++++++++++++++++++----
 Fault.h        |  26 +++++++++++--
 ICStage.c      |   4 ++
 ICache.c       |   8 ++--
 ICache.h       |   3 +-
 Pipeline.c     |  78 +++++++++++++++++++++++++++++++++------
 RFStage.c      |  21 ++++++-----
 osSyncPrintf.h |  70 +++++++++++++++++++++++++++++++++++
 15 files changed, 869 insertions(+), 187 deletions(-)
 create mode 100644 DCache.c
 create mode 100644 DCache.h
 create mode 100644 osSyncPrintf.h
So the full command list would be:

Code: Select all

$ git submodule init
$ git submodule update
$ git submodule foreach git pull origin master
It's not necessary, but useful if there is a new commit you want to test but the submodule hasn't been updated yet.

User avatar
Snowstorm64
Posts: 303
Joined: Sun Oct 20, 2013 8:22 pm

Re: How to Compile Cen64

Post by Snowstorm64 » Sat Nov 23, 2013 9:07 pm

Actually, there are two branches: master and next-version.

master is the branch for stable versions (currently it is 0.1), while next-version is used for developing future versions. So if you want to test unstable versions, you need to switch to next-version.
OS: Debian GNU/Linux Jessie (8.0)
CPU: Intel i7 4770K @ 3.5 GHz
Build: AVX (compiled from git)

Presence
Posts: 51
Joined: Fri Oct 18, 2013 9:27 am

Re: How to Compile Cen64

Post by Presence » Mon Nov 25, 2013 11:49 pm

Look's like you are right. I didn't notice there was another branch ahead of master.

User avatar
chriztr
Posts: 38
Joined: Sun Oct 06, 2013 4:15 pm

Re: How to Compile Cen64

Post by chriztr » Sun Jan 05, 2014 8:43 am

I'm having a hard time compiling the next-version build.
Compiling the stable release went fine but the unstable one just stops after a few seconds of compiling.
Is there something I should edit before compiling the unstable builds?

Specs:
Windows 8.1 x64
Intel Core i5 3210M @ 2.50 GHz
6 GB Ram and Intel HD 4000 (worlds best gpu, right...)

I tried to do as this guide tells me to do without any success =/

User avatar
MarathonMan
Site Admin
Posts: 691
Joined: Fri Oct 04, 2013 4:49 pm

Re: How to Compile Cen64

Post by MarathonMan » Sun Jan 05, 2014 3:36 pm

The Windows directions listed above are out of date (for the unstable build, anyways).

Follow the directions here: https://github.com/tj90241/cen64/tree/next-version

Also, run release.cmd from a new `cmd` window and paste the output. If you just double-click on the batch script from Windows Explorer, it'll close the command prompt window as soon as something either fails or builds successfully and it's harder to diagnose.

User avatar
Iconoclast
Posts: 47
Joined: Fri Oct 04, 2013 8:00 pm

Re: How to Compile Cen64

Post by Iconoclast » Sun Jan 05, 2014 4:31 pm

Or append the statements in `release.cmd` with a PAUSE command so that it won't close automatically.

User avatar
chriztr
Posts: 38
Joined: Sun Oct 06, 2013 4:15 pm

Re: How to Compile Cen64

Post by chriztr » Sun Jan 05, 2014 5:28 pm

Thanks guys I finally made it compile. All I was missing was the 'bin'-folder from mingw64.

User avatar
max_power
Posts: 6
Joined: Sat Oct 05, 2013 6:01 am

Re: How to Compile Cen64

Post by max_power » Thu Aug 21, 2014 1:41 pm

Hey, I just wanted to compile the newest version with gcc 4.8. I did

Code: Select all

> cmake CMakeLists.txt
> make clean
> make
and got a bunch of errors, all seeming to stem from

Code: Select all

/usr/lib/gcc/x86_64-linux-gnu/4.8/include/tmmintrin.h:31:3: error: #error "SSSE3 instruction set not enabled"
Adding -msse4 to the compile options fixes that.

Code: Select all

> git diff
diff --git a/CMakeLists.txt b/CMakeLists.txt
index ab076d9..022b2c9 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -13,7 +13,7 @@ find_package(OpenGL REQUIRED)
 
 # If using GCC, configure it accordingly.
 if ("${CMAKE_C_COMPILER_ID}" MATCHES "GNU")
-  set(CMAKE_C_FLAGS "-Wall -Wextra -Wno-unused-parameter -std=c99")
+  set(CMAKE_C_FLAGS "-Wall -Wextra -Wno-unused-parameter -std=c99 -msse4")
 
   # Enable processor-specific optimizations?
   option(NATIVE_BUILD "Build binary for native architecture?" OFF)
Is this the right place to add the option to? I have absolutely no knowledge of cmake to tell...

Btw, it would be awesome if the first start post could be edited to reflect the new build system :-)

EDIT: And repo structure, no more subrepos.

User avatar
MarathonMan
Site Admin
Posts: 691
Joined: Fri Oct 04, 2013 4:49 pm

Re: How to Compile Cen64

Post by MarathonMan » Thu Aug 21, 2014 2:20 pm

Thanks, I forgot to add -mssse3 if "native" build is not selected. I will try to get that commit in soon.

User avatar
max_power
Posts: 6
Joined: Sat Oct 05, 2013 6:01 am

Re: How to Compile Cen64

Post by max_power » Wed Sep 10, 2014 3:07 pm

Just wondering: which repo is the current one? CEN64 or CEN64-backport? Both got commits recently. And wouldn't it be better to have the backport simply as a branch in the main repo?

beannaich
Posts: 149
Joined: Mon Oct 21, 2013 2:43 pm

Re: How to Compile Cen64

Post by beannaich » Wed Sep 10, 2014 6:51 pm

max_power wrote:Just wondering: which repo is the current one? CEN64 or CEN64-backport? Both got commits recently. And wouldn't it be better to have the backport simply as a branch in the main repo?
CEN64 is the "main" repo. CEN64-backport is the new VR4300 along with the previous RSP/RDP code to test which games still work with the new core. Both receive the same VR4300 commits to keep in sync.

User avatar
flavenstein
Posts: 2
Joined: Fri Nov 29, 2013 9:36 pm
Location: Lurking

Re: How to Compile Cen64

Post by flavenstein » Mon Sep 22, 2014 4:27 pm

The Windows binary links for the dependencies are broken. However, it turns out that since freealut, glfw and cen64 all use CMake, the process is pretty straightforward to build these dependencies from source.

In the end, I was able to compile cen64 pretty easily (get MinGW x64, "CMake" then "make" dependencies, put libraries in the right place, "CMake" then "make" cen64). Maybe the guide should be updated to reflect all the changes?

User avatar
MarathonMan
Site Admin
Posts: 691
Joined: Fri Oct 04, 2013 4:49 pm

Re: How to Compile Cen64

Post by MarathonMan » Mon Sep 22, 2014 9:11 pm

flavenstein wrote:In the end, I was able to compile cen64 pretty easily (get MinGW x64, "CMake" then "make" dependencies, put libraries in the right place, "CMake" then "make" cen64). Maybe the guide should be updated to reflect all the changes?
TBH, I haven't bothered to build with MinGW x64 on Windows anymore now that MSVC is supported. If someone wants to compile a guide, I'm more than happy to edit posts/etc. to reflect that.

User avatar
chriztr
Posts: 38
Joined: Sun Oct 06, 2013 4:15 pm

Re: How to Compile Cen64

Post by chriztr » Sun Nov 16, 2014 8:44 am

MarathonMan wrote: TBH, I haven't bothered to build with MinGW x64 on Windows anymore now that MSVC is supported. If someone wants to compile a guide, I'm more than happy to edit posts/etc. to reflect that.
Yes, please!

User avatar
MarathonMan
Site Admin
Posts: 691
Joined: Fri Oct 04, 2013 4:49 pm

Re: How to Compile Cen64

Post by MarathonMan » Mon Nov 17, 2014 1:27 pm

OK... I'll look into having the server build both Linux and Windows (gcc/mingw-w64) builds and get some kind of instructional up...

User avatar
MarathonMan
Site Admin
Posts: 691
Joined: Fri Oct 04, 2013 4:49 pm

Re: How to Compile Cen64

Post by MarathonMan » Thu Dec 18, 2014 2:06 am

Finally got to this. Windows/Linux builds are now fully automated! You can always find bleeding edge binaries on: http://downloads.cen64.com

Automating them in this fashion led to me find a few bugs along the way, so as of right now, 32-bit builds are broken. :)

EDIT: I'll try and get detailed build instructions up later, too...

User avatar
chriztr
Posts: 38
Joined: Sun Oct 06, 2013 4:15 pm

Re: How to Compile Cen64

Post by chriztr » Thu Dec 18, 2014 12:01 pm

Aw Jizz!

I'll check this out later today!

User avatar
Breadwinka
Posts: 54
Joined: Fri Oct 04, 2013 11:35 pm

Re: How to Compile Cen64

Post by Breadwinka » Thu Dec 18, 2014 12:32 pm

I tried all the windows build seem to instantly crash when loading a rom. Get not responding on Windows 8.1

User avatar
MarathonMan
Site Admin
Posts: 691
Joined: Fri Oct 04, 2013 4:49 pm

Re: How to Compile Cen64

Post by MarathonMan » Thu Dec 18, 2014 1:48 pm

Works for me. *

*EDIT: The new core still isn't able to run most commercial ROMs if that's what you're attempting to do... It did, however, manage to run the sample binaries I test with from within a virtual machine environment for me.
Attachments
cen64-win64.png
cen64-win64.png (156.13 KiB) Viewed 25563 times

User avatar
Breadwinka
Posts: 54
Joined: Fri Oct 04, 2013 11:35 pm

Re: How to Compile Cen64

Post by Breadwinka » Thu Dec 18, 2014 2:55 pm

ahh gotcha that's the problem.

User avatar
Breadwinka
Posts: 54
Joined: Fri Oct 04, 2013 11:35 pm

Re: How to Compile Cen64

Post by Breadwinka » Mon Dec 22, 2014 2:12 am

My only question what build would be best for an i5 3570k@ 4.2Ghz. My guess is the AVX since its newer.

User avatar
MarathonMan
Site Admin
Posts: 691
Joined: Fri Oct 04, 2013 4:49 pm

Re: How to Compile Cen64

Post by MarathonMan » Mon Dec 22, 2014 1:51 pm

Breadwinka wrote:My only question what build would be best for an i5 3570k@ 4.2Ghz. My guess is the AVX since its newer.
The more features CEN64 can take advantage of, the better the performance will be. In your case, yes, AVX would be best.

I compile the other variants as it seems a lot of the community is still riding on things that only support SSE2/SSE3 (not SSSE3).

User avatar
Breadwinka
Posts: 54
Joined: Fri Oct 04, 2013 11:35 pm

Re: How to Compile Cen64

Post by Breadwinka » Mon Dec 22, 2014 7:01 pm

man isn't sse2 like from the stone age around 10 years ago. I just upgraded my GPU to the gtx 970 and cpu when broadwell comes out, only downside is the switch to DDR4.

I've noticed with cen64 with latest version i'm running same fire demo, that on windows I don't get any info in the console showing V/I's cause it does crash weirdly saying not responding but the animation is still playing. but otherwise great work on the emulator, cant wait to start booting commercial roms.

User avatar
Fishaman P
Posts: 1
Joined: Wed Jan 07, 2015 5:08 am

Re: How to Compile Cen64

Post by Fishaman P » Wed Jan 07, 2015 10:24 pm

I'm trying to get CEN64 built on my machine (Windows), but I'm completely new to MSVC and have only built Dolphin with it so far.
Anyone know how to compile with MSVC?
I'm using the angrylion-rdp branch, if that matters.

beannaich
Posts: 149
Joined: Mon Oct 21, 2013 2:43 pm

Re: How to Compile Cen64

Post by beannaich » Wed Jan 07, 2015 10:41 pm

Fishaman P wrote:I'm trying to get CEN64 built on my machine (Windows), but I'm completely new to MSVC and have only built Dolphin with it so far.
Anyone know how to compile with MSVC?
I'm using the angrylion-rdp branch, if that matters.
When I was automating builds for MarathonMan, I had to generate the *.sln files with CMake, and then run the *.sln file through MSBuild for it to build with MSVC. I can't remember the exact CMake commands to accomplish that though, it was something like:

Code: Select all

cmake -G "Visual Studio 12 2013 Win64"
That should generate the appropriate solution file which you can open in Visual Studio and build by pressing F5.

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest