Pages: 12345 »
Posted on 12-11-13, 07:43 pm

Snifit
Normal user

Posts: 232/288
Since: 12-31-09

Last post: 832 days
Last view: 670 days
Hello rvlutionaires, my hard drive was wiped a short time ago, so I thought I'd setup the Newer source for compiling from a clean install (OSX 10.9 Mavericks) and write what I did while I did it. If you're running a Mac system, this should work as is. If you're on Linux, no doubt you can figure it out, it's about the same. Windows - good luck with cygwin >.>. I will also be including a partial shell script for Linux, courtesy of megazig.

Without further ado...

Compiling Newer on Mac, from a clean install
(Additional Instructions in brackets for users unfamiliar with the terminal)
Total Time: about 3h, depending on your download speeds

Installing GCC:
- Install XCode via Mac App Store
- Run Xcode once, and click all the agreement things that pop up

Installing cmake:
- Open a terminal
- Install homebrew with: ruby -e "$(curl -fsSL https://raw.github.com/mxcl/homebrew/go/install)"
- Follow instructions
- In terminal, run: brew install cmake

Installing DevKitPPC:
- Download DevKit PPC - http://sourceforge.net/projects/devkitp ... devkitPPC/
- Extract the archive
- Place devkitPPC folder into /usr/local/ (use the "Go to Folder" menu item in the finder and type /usr/local/)

Installing PyElfTools and PyYAML:
- Open a terminal
- Type: easy_install pyelftools (if it errors, type "sudo easy_install pyelftools", and type your password when prompted)
- Type: easy_install pyyaml (if it errors, see above)

Downloading the Newer Sources:
- Download the Newer Source: https://github.com/Treeki/NewerSMBW
- Choose either the 'Clone to Desktop' or the 'Download zip' options on the right side
- If you downloaded the zip, extract it

Downloading, Patching, and compiling Clang/LLVM:
- Open a terminal (or use one you already have open, whatever)
- Type the following commands:

svn co -r 184655 http://llvm.org/svn/llvm-project/llvm/trunk llvm cd llvm/tools svn co -r 184655 http://llvm.org/svn/llvm-project/cfe/trunk clang cd ../projects svn co -r 184655 http://llvm.org/svn/llvm-project/compiler-rt/trunk compiler-rt cd ../tools/clang
- Then we apply the newer patches
- Type: patch -p0 -i /path/to/NewerSMBW-master/ClangPatches/clang_cw_patches_r184655.diff (you can easily find the path to something by dragging the file from the finder into the terminal window)

- Now for some more terminal commands to build llvm/clang. Use the same terminal

cd ../.. mkdir -p build cd build mkdir -p /usr/local/kamek-llvm cmake -DLLVM_DEFAULT_TARGET_TRIPLE=powerpc-unknown-unknown-unknown -DPYTHON_EXECUTABLE=/usr/bin/python -DLLVM_TARGETS_TO_BUILD="PowerPC" -DLLVM_INCLUDE_EXAMPLES=OFF -DLLVM_INCLUDE_TESTS=OFF -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX="/usr/local/kamek-llvm" .. make make install
Compiling Newer
- Open a terminal, and navigate to the Kamek directory in the NewerSMBW download (cd is change directory, remember you can drag and drop a folder for the path)
- Type the following commands:

mkdir -p processed mkdir -p NewerASM python tools/mapfile_tool.py python tools/kamek.py NewerProjectKP.yaml --no-rels --use-clang --gcc-type=/usr/local/devkitPPC/bin/powerpc-eabi --llvm-path=/usr/local/kamek-llvm/bin

Finishing:

This will output a number of bin files into the "NewerASM" folder in kamek. Rename the ones for your region, and then plop them into the 'NewerRes' folder in the Newer pack, and you should be sailing! If you want to automate the process further, take a look at the file "makeNewerKP" in the Kamek folder in a text editor. Change the commands at the top to match the ones in the code block just above, and change the directory paths below to output directly to your test folder destination. You can integrate the script with wit and Dolphin, or with riifs to get ultra speedy testing runs.

- - - - - - - - - - - - - - - - - - - - -

And lastly, megazig's shell script (python installs as python2):

#sudo apt-get install build-tools libpython-dev python2 CURDIR=`pwd` CLANG_VERSION=184655; PROJECT_DIR=${CURDIR}/NewerLlvm; LLVM_DIR=${PROJECT_DIR}/llvm CLANG_DIR=${LLVM_DIR}/tools/clang RT_DIR=${LLVM_DIR}/projects/compiler-rt BUILD_DIR=${PROJECT_DIR}/build echo "mkdir -p ${BUILD_DIR}" mkdir -p ${BUILD_DIR} echo "cd ${PROJECT_DIR}" cd ${PROJECT_DIR} echo "svn co -r ${CLANG_VERSION} http://llvm.org/svn/llvm-project/llvm/trunk llvm" svn co -r ${CLANG_VERSION} http://llvm.org/svn/llvm-project/llvm/trunk llvm echo "cd ${LLVM_DIR}/tools" cd ${LLVM_DIR}/tools echo "svn co -r ${CLANG_VERSION} http://llvm.org/svn/llvm-project/cfe/trunk clang" svn co -r ${CLANG_VERSION} http://llvm.org/svn/llvm-project/cfe/trunk clang echo "cd ${LLVM_DIR}/tools/clang" cd ${LLVM_DIR}/tools/clang echo "cp ${CURDIR}/clang_cw_patches_r184655.diff ." cp ${CURDIR}/clang_cw_patches_r184655.diff . echo "patch -p0 < clang_cw_patches_r184655.diff" patch -p0 < clang_cw_patches_r184655.diff echo "rm clang_cw_patches_r184655.diff" rm clang_cw_patches_r184655.diff echo "NOW DO SOMETHING COOL" cd ${BUILD_DIR} echo "cmake -DLLVM_DEFAULT_TARGET_TRIPLE=powerpc-unknown-unknown-unknown -DPYTHON_EXECUTABLE=/usr/bin/python2 -DLLVM_TARGETS_TO_BUILD="PowerPC" -DLLVM_INCLUDE_EXAMPLES=OFF -DLLVM_INCLUDE_TESTS=OFF -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX="/opt/kamek-llvm" ../llvm" cmake -DLLVM_DEFAULT_TARGET_TRIPLE=powerpc-unknown-unknown-unknown -DPYTHON_EXECUTABLE=/usr/bin/python2 -DLLVM_TARGETS_TO_BUILD="PowerPC" -DLLVM_INCLUDE_EXAMPLES=OFF -DLLVM_INCLUDE_TESTS=OFF -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX="/opt/kamek-llvm" ../llvm
Posted on 12-11-13, 07:51 pm

Snifit
Normal user

Posts: 234/288
Since: 12-31-09

Last post: 832 days
Last view: 670 days
If you find any of the above instructions unclear, let me know, and I will clarify them within reason. Of course, compiling the Newer sources is useless if you can't program, so I'm not gonna go full retard with the instructions, but any reasonable suggestions to improve the tutorial will be taken.
Posted on 12-11-13, 09:10 pm

Iggy Koopa
Local moderator

Posts: 1263/2646
Since: 01-04-13

Last post: 168 days
Last view: 27 days
Thanks, I'll try this and see if it works then. Also, can I compile Newer so I can test my changes with Dolphin without having to test everything on my Wii?
Posted on 12-12-13, 01:46 pm
Normal user

Posts: 694/877
Since: 04-23-11

Last post: 865 days
Last view: 835 days
Nice documentation, it will help us a lot .
_________________________
If you live for money, you never will be really happy.
If you live for success, you never will find an end.
If you live for your hobby, your life will be colorless.
If you live for your own/amusement, you won't find a sense in your life or you'll get problems.
Though, if you live for others, life will be precious and can also be positive.
Posted on 12-12-13, 03:43 pm

Iggy Koopa
Local moderator

Posts: 1266/2646
Since: 01-04-13

Last post: 168 days
Last view: 27 days
Compiling LLVM worked when I did exactly what you did Tempus.
But I got an error compiling Newer:
Andreass-MacBook-Pro:build Yannik$ cd .. Andreass-MacBook-Pro:llvm Yannik$ cd .. Andreass-MacBook-Pro:Downloads Yannik$ cd NewerSMBW -bash: cd: NewerSMBW: No such file or directory Andreass-MacBook-Pro:Downloads Yannik$ cd NewerSMBW-master Andreass-MacBook-Pro:NewerSMBW-master Yannik$ cd Kamek Andreass-MacBook-Pro:Kamek Yannik$ mkdir -p processed Andreass-MacBook-Pro:Kamek Yannik$ mkdir -p NewerASM Andreass-MacBook-Pro:Kamek Yannik$ python tools/mapfile_tool.py Andreass-MacBook-Pro:Kamek Yannik$ python tools/kamek.py NewerProjectKP.yaml --no-rels --use-clang --gcc- type=/usr/local/devkitPPC/bin/powerpc-eabi --llvm-path=/usr/local/kamek-llvm/bin Kamek 0.4 by Treeki * Starting build * Project will be built in: /Users/Yannik/Downloads/NewerSMBW-master/Kamek/NewerASM * --- * Building for configuration: New Super Mario Bros. Wii * Temp files for this configuration are in: /var/folders/qs/vmyc875d1z16fv3f_pq1p2v40000gp/T/tmppqYeN9 * --- * Compiling modules * Compiling prolog.yaml : ../src/prolog.S Traceback (most recent call last): File "tools/kamek.py", line 588, in <module> main() File "tools/kamek.py", line 583, in main project.build() File "tools/kamek.py", line 562, in build builder.build() File "tools/kamek.py", line 212, in build self._compile_modules() File "tools/kamek.py", line 339, in _compile_modules errorVal = subprocess.call(new_command) File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 522, in call return Popen(*popenargs, **kwargs).wait() File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 709, in __init__ errread, errwrite) File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 1326, in _execute_child raise child_exception OSError: [errno 2] No such file or directory Andreass-MacBook-Pro:Kamek Yannik$
What's Megazig shell script for?
Posted on 12-12-13, 04:26 pm
Evil Santa

Posts: 302/391
Since: 03-19-10

Last post: 411 days
Last view: 405 days
for automated setting up of the compiler environment on linux (specifically debian once I get the apt packages configured)
_________________________
powered by phpBB
Posted on 12-12-13, 06:27 pm

Bandit
Internet dog person


Posts: 704/817
Since: 12-01-09

Last post: 356 days
Last view: 15 days
Add the "--show-cmd" argument to your Kamek call. This will show the exact command that's failing, and it may help to pinpoint the issue.
_________________________
Posted on 12-12-13, 07:31 pm

Iggy Koopa
Local moderator

Posts: 1268/2646
Since: 01-04-13

Last post: 168 days
Last view: 27 days
Here:
Andreass-MacBook-Pro:kamek Yannik$ python tools/kamek.py NewerProjectKP.yaml --no-rels --use-clang --gcc- type=/usr/local/devkitPPC/bin/powerpc-eabi --llvm-path=/usr/local/kamek-llvm/bin --show-cmd Kamek 0.4 by Treeki * Starting build * Project will be built in: /Users/Yannik/Downloads/NewerSMBW-master/Kamek/NewerASM * --- * Building for configuration: New Super Mario Bros. Wii * Temp files for this configuration are in: /var/folders/qs/vmyc875d1z16fv3f_pq1p2v40000gp/T/tmpZrfnln * --- * Compiling modules * Compiling prolog.yaml : ../src/prolog.S * ['powerpc-eabi-gcc', '-nodefaultlibs', '-I.', '-fno-builtin', '-Os', '-fno-exceptions', '-fno-rtti', '-mno-sdata', '-c', '-Iinclude', '-Isrc', '-o', '/var/folders/qs/vmyc875d1z16fv3f_pq1p2v40000gp/T/tmpZrfnln/1.o', '/Users/Yannik/Downloads/NewerSMBW-master/Kamek/processed/../src/prolog.S'] Traceback (most recent call last): File "tools/kamek.py", line 588, in <module> main() File "tools/kamek.py", line 583, in main project.build() File "tools/kamek.py", line 562, in build builder.build() File "tools/kamek.py", line 212, in build self._compile_modules() File "tools/kamek.py", line 339, in _compile_modules errorVal = subprocess.call(new_command) File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 522, in call return Popen(*popenargs, **kwargs).wait() File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 709, in __init__ errread, errwrite) File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 1326, in _execute_child raise child_exception OSError: [errno 2] No such file or directory Andreass-MacBook-Pro:kamek Yannik$
Posted on 12-12-13, 07:34 pm

Bandit
Internet dog person


Posts: 705/817
Since: 12-01-09

Last post: 356 days
Last view: 15 days
You have a space in "--gcc- type" which shouldn't be there.
_________________________
Posted on 12-12-13, 07:36 pm

Iggy Koopa
Local moderator

Posts: 1269/2646
Since: 01-04-13

Last post: 168 days
Last view: 27 days
I removed it, but I still get exactly the same error. Also, thanks for quick reply!
Posted on 12-12-13, 07:40 pm

Bandit
Internet dog person


Posts: 706/817
Since: 12-01-09

Last post: 356 days
Last view: 15 days
This was the command shown in the debug output from your previous post:
* Compiling prolog.yaml : ../src/prolog.S * ['powerpc-eabi-gcc', '-nodefaultlibs', '-I.', '-fno-builtin', '-Os', '-fno-exceptions', '-fno-rtti', '-mno-sdata', '-c', '-Iinclude', '-Isrc', '-o', '/var/folders/qs/vmyc875d1z16fv3f_pq1p2v40000gp/T/tmpZrfnln/1.o', '/Users/Yannik/Downloads/NewerSMBW-master/Kamek/processed/../src/prolog.S']

After fixing -gcc-type, has the first part changed? The line should begin with the following, to match your setup:
* ['/usr/local/devkitPPC/bin/powerpc-eabi-gcc', '-nodefaultlibs', ...]

Additionally, if you try to run "/usr/local/devkitPPC/bin/powerpc-eabi-gcc" from the terminal, what happens? If it exists and is installed properly, you should get a message like this:
~ /opt/devkitpro/devkitPPC/bin/powerpc-eabi-gcc powerpc-eabi-gcc: fatal error: no input files compilation terminated.

_________________________
Posted on 12-12-13, 07:44 pm

Iggy Koopa
Local moderator

Posts: 1270/2646
Since: 01-04-13

Last post: 168 days
Last view: 27 days
You're right, it changed, I didn't notice it first. When I run the other command it says no such file or directory. That's the cause for the error! I'll see what I can do about it.
Posted on 12-12-13, 07:45 pm

Bandit
Internet dog person


Posts: 707/817
Since: 12-01-09

Last post: 356 days
Last view: 15 days
Either you haven't installed devkitPPC properly, or it's ended up in a different path.

Actually, if you followed Tempus's tutorial, you'd just have extracted it somewhere -- where did you put it? :p Go find it and amend the --gcc-path value in the Kamek command line to use the correct location.
_________________________
Posted on 12-12-13, 07:46 pm

Iggy Koopa
Local moderator

Posts: 1271/2646
Since: 01-04-13

Last post: 168 days
Last view: 27 days
I only downloaded it and forgot to extract it. Sometimes I'm a little bit stupid. :oops:
I hope it works now.

edit:
I think it worked, it didn't throw errors, there was something like "unknown symbol => (v:0)". I hope that isn't bad.
Posted on 12-12-13, 08:33 pm

Snifit
Normal user

Posts: 237/288
Since: 12-31-09

Last post: 832 days
Last view: 670 days
If you got it compiled, there should be bins in the NewerASM folder you can test. Rename those and replace the ones in Newer, then test the game with em'. If those work, then you're set!

If a couple people manage to get this beast compiling and are interested, I'll do a tutorial or two for programming with the Newer source. Doesn't make much sense unless there are a few programmers with a little C++ knowledge willing to take a look at it, though.
Posted on 12-12-13, 08:37 pm

Iggy Koopa
Local moderator

Posts: 1273/2646
Since: 01-04-13

Last post: 168 days
Last view: 27 days
I'll try it with Newer tomorrow. If it works I'll take a look at the source code and try to modify some very simple things if I can. I'm not good at C++, I only have very basic C++ knowledge.
Posted on 12-12-13, 08:45 pm

Bandit
Internet dog person


Posts: 708/817
Since: 12-01-09

Last post: 356 days
Last view: 15 days
One link error with unknown symbol, blank name, address 0 is normal.
_________________________
Posted on 12-12-13, 10:28 pm

Koopa
Normal user

Posts: 51/116
Since: 06-27-13

Last post: 1 day
Last view: 1 day
tomorow, i will install Ubuntu in dual boot on my pc to see if a can reach to compile
thx for the step by step
Posted on 12-12-13, 10:34 pm

Koopa
Normal user

Posts: 52/116
Since: 06-27-13

Last post: 1 day
Last view: 1 day
Posted by Tempus
If a couple people manage to get this beast compiling and are interested, I'll do a tutorial or two for programming with the Newer source. Doesn't make much sense unless there are a few programmers with a little C++ knowledge willing to take a look at it, though.

i've looked a little bit in you sources but not more cause, if can't compile, don't need to code... but if i get to compile, will be very interested to know if you know where i can change the color (red, green, bleu and yelow) around the "in game pause menu" linked with the player who pressed pause... thx
Posted on 12-14-13, 08:40 am

Iggy Koopa
Local moderator

Posts: 1278/2646
Since: 01-04-13

Last post: 168 days
Last view: 27 days
I have got a bunch of questions:
What's riiv.xml, all it contains is a bunch of <Memory Offset=xxxxxx value=xxxxx/> tags.
The same with ocarina.txt, what am I supposed to do with this?
And what are object.plf and linkmap.map?
Why is the size of loader.bin, dlcode.bin and dlrelocs.bin different from the Newer download? I didn't change anything in Newer's source code. Why is there a loader.bin for every region? Newer only has one. Should it work when I put all these files into the NeweRes folder? Do I have to put loader.bin in the NeweRes folder too or do I replace the existing one?
Pages: 12345 »