Building Atmosphère on Windows using MSYS2

Sometimes you need to build the binaries for Atmosphère, or you want to change something on the source code, for building your starting point should be: https://github.com/Atmosphere-NX/Atmosphere/blob/master/docs/building.md
On that document you can read:
Building Atmosphère is a very straightforward process that relies almost exclusively on tools provided by the devkitPro organization.​
Dependencies:
  • devkitA64
  • devkitARM
  • Python 2 (Python 3 may work as well, but this is not guaranteed)
  • LZ4
  • PyCryptodome (optional)
  • Hactool
Setup a DevKitPro environment: (https://devkitpro.org/wiki/Getting_Started)
Install the following packages via (dkp-)pacman:​
  • switch-dev
  • switch-glm
  • switch-libjpeg-turbo
  • devkitARM
  • devkitarm-rules
  • hactool
Install the following library via python's package manager pip, required by exosphere:​
  • lz4
Finally, clone the Atmosphère repository and run make under its root directory.​

That instructions are a little plain for we the noobs.

First you need Install a MSYS environment:
The latest instructions for install the MSYS environment are on https://gbatemp.net/threads/install-msys-environment.652234/ if you don't have one working, use them.

After you have the MSYS environment working you need to install DevKitPro
For that you can follow the instructions on the tutorial https://gbatemp.net/threads/setup-a-devkitpro-environment-on-windows.652238/

Now you can install DevKitPro packages:
Bash:
pacman -S --noconfirm switch-dev devkitA64 dkp-toolchain-vars libnx switch-tools switch-mesa switch-libdrm_nouveau switch-sdl2

And Atmosphère prerequisites
Bash:
Pacman -Sy --noconfirm devkitA64 devkitARM devkitarm-rules hactool mingw-w64-x86_64-python mingw-w64-x86_64-python-lz4 mingw-w64-x86_64-python-pycryptodome switch-dev switch-glm switch-libjpeg-turbo mingw-w64-x86_64-python-pip

For me I had to add zip package because even if wasn't explicit indicated on the build page, the code needs it.

Additional you need the packages git make lz4 for all to work, use the command:

Bash:
Pacman -Sy --noconfirm zip git make lz4


The package hactool need you to copy your own prod.keys file on $HOME/.switch folder. (c:\msys64\home\USERNAME\.switch if you use the default installation folder)

LibNX Dependency
Atmosphère depends heavily on LibNX, generally when a major version of firmware is released or great changes on the code are made, changes to LibNX are also made.
The Atmosphère team works on their own repo of LibNX (https://github.com/Atmosphere-NX/libnx) and forward Pull Request to official SwitchBrew LibNX repo (https://github.com/switchbrew/libnx).

So if there are changes on LibNX you need to build it and install on your setup.
If you haven't done already, setup the environment variables

Bash:
export DEVKITPRO=/opt/devkitpro
export DEVKITARM=${DEVKITPRO}/devkitARM
export DEVKITPPC=${DEVKITPRO}/devkitPPC
export PATH=${DEVKITPRO}/tools/bin:$PATH
Then go to the Atmosphere-NX/LibNX repo and look what is the new branch for the current firmware, by example, for Firmware 16.0.0 the branch name is "1600_Support"

1677718224337.png

Then go to your MSYS MinGW64 window and clone the Atmosphere-NX/LibNX repo

Bash:
cd ~
git clone --recursive https://github.com/Atmosphere-NX/libnx.git
cd libnx

And checkout the needed branch:

Bash:
git checkout 1600_support

Then build and install the new LibNX libraries

Bash:
make install -j$(nproc)

Now you can build Atmosphère with latest LibNX code; remember if you update the pacman LibNX package the changes get reversed and you need to build LibNX again.

Now is time to build the binaries
Clone the repository:
Bash:
cd ~
git clone --recursive https://github.com/Atmosphere-NX/Atmosphere

Go to new created Atmosphère folder
Bash:
cd Atmosphere

Never forget to create the environment variables for DevKitPro
Bash:
export DEVKITPRO=/opt/devkitpro
export DEVKITARM=/opt/devkitpro/devkitARM
export DEVKITPPC=/opt/devkitpro/devkitPPC

And now you are ready to start the building process:
Bash:
make -j$(nproc)

I do use the "-j$(nproc)" parameter to "bleed" all the available CPU to run the compiler, without that the whole process could take up to 1 hour.

I want to thank a lot to @binkinator and @godreborn for all the help and inspiration to make this guide, and want to ask you for help improving this guide.

Also special thanks to @godreborn for been a support of the users replies and suggestions to the OP.

Remember, as you are getting a new set of binaries, you need new set of sigpatches if you use it. So the great tool from @mrdude comes in hand, the latest release can be downloaded from: https://github.com/mrdude2478/IPS_Patch_Creator/releases/; you use the program to generate a new set of patches for your recently build package3 file.


Latest IPS Patch Creator:
Sigpatch-IPS-Creator_1.5.7_Yandex.png





-Edited: add sigpatches step and clean up a little-
-Edit 2, add LibNX build-
 

Attachments

  • 1695782853186.png
    1695782853186.png
    62.7 KB · Views: 58
  • 1695782902542.png
    1695782902542.png
    6.4 KB · Views: 59
Last edited by impeeza,

gdavies

Well-Known Member
Newcomer
Joined
Mar 1, 2023
Messages
67
Trophies
0
XP
115
Country
United Kingdom
yeah, I'm on windows 11 as well. I tested building it. after installing the libnx, I had no issues with the latest atmosphere. btw, do not run the commands on the first page again unless you reinstall libnx from github, because it will overwrite the github libnx and error again during either stratosphere or mesosphere building iirc.
Noted, I gave it a go just out of curiosity more than anything, but it would be fun one day to give it a full days attention to tweak every part just so i could get the switch too boot quicker, but think that would be like trying to run before you can walk haha
 

impeeza

¡Kabito!
OP
Member
Joined
Apr 5, 2011
Messages
6,425
Trophies
3
Age
46
Location
At my chair.
XP
19,111
Country
Colombia
For building Atmosphère on UBUNTU, I had to run this commands:

DevKitPro Installation
Bash:
sudo apt install wget
wget https://apt.devkitpro.org/install-devkitpro-pacman
chmod +x ./install-devkitpro-pacman
sudo ./install-devkitpro-pacman


Base packages
Bash:
sudo apt install lz4 zip git make gcc python3 python-is-python3 python3-pip
sudo pip install pycryptodome lz4
sudo dkp-pacman -Sy --noconfirm --needed libnx devkitA64 devkitARM devkitarm-rules hactool switch-dev dkp-toolchain-vars switch-tools switch-mesa switch-libdrm_nouveau switch-sdl2 switch-libjpeg-turbo switch-glm
sudo dkp-pacman -Syuu --noconfirm

You need to copy prod.keys file on $HOME/.switch

Building
Bash:
export DEVKITPRO=/opt/devkitpro
export DEVKITARM=${DEVKITPRO}/devkitARM
export DEVKITPPC=${DEVKITPRO}/devkitPPC
export PATH=${DEVKITPRO}/tools/bin:$PATH
git clone --recursive https://github.com/Atmosphere-NX/Atmosphere
cd Atmosphere
make -j$(nproc)
 

godreborn

Welcome to the Machine
Member
Joined
Oct 10, 2009
Messages
38,471
Trophies
3
XP
29,180
Country
United States
For building Atmosphère on UBUNTU, I had to run this commands:

DevKitPro Installation
Bash:
sudo apt install wget
wget https://apt.devkitpro.org/install-devkitpro-pacman
chmod +x ./install-devkitpro-pacman
sudo ./install-devkitpro-pacman


Base packages
Bash:
sudo apt install lz4 zip git make gcc python3 python-is-python3 python3-pip
sudo pip install pycryptodome lz4
sudo dkp-pacman -Sy --noconfirm --needed libnx devkitA64 devkitARM devkitarm-rules hactool switch-dev dkp-toolchain-vars switch-tools switch-mesa switch-libdrm_nouveau switch-sdl2 switch-libjpeg-turbo switch-glm
sudo dkp-pacman -Syuu --noconfirm

You need to copy prod.keys file on $HOME/.switch

Building
Bash:
export DEVKITPRO=/opt/devkitpro
export DEVKITARM=${DEVKITPRO}/devkitARM
export DEVKITPPC=${DEVKITPRO}/devkitPPC
export PATH=${DEVKITPRO}/tools/bin:$PATH
git clone --recursive https://github.com/Atmosphere-NX/Atmosphere
cd Atmosphere
make -j$(nproc)
I would put the export portion in the .bashrc, so you don't have to do it each time you open the terminal.
 

impeeza

¡Kabito!
OP
Member
Joined
Apr 5, 2011
Messages
6,425
Trophies
3
Age
46
Location
At my chair.
XP
19,111
Country
Colombia
you need to compile and install the official master branch:

Bash:
git clone --recursive https://github.com/switchbrew/libnx.git
cd libnx
make all -j$(nproc)
make install -j$(nproc)

has been updated with all commits up to 2 days ago.
Post automatically merged:

@impeeza The 16_Support branch is no longer available.
Yes was commited on the main branch, I am trying to build the latest commit of Atmosphère, will let you to know.
Post automatically merged:

Just finished to build the latest Atmosphère commit (476d658) just build and install the latest LIBNX commit (c09a21d) before start the process.
 
Last edited by impeeza,

Jandresquiroga

New Member
Newbie
Joined
Sep 27, 2023
Messages
2
Trophies
0
Age
37
XP
101
Country
Chile
friends I'm new to this
When I am installing the dependencies at this point I get these errors, how would I solve it?


Pacman -Sy --noconfirm devkitA64 devkitARM devkitarm-rules hactool mingw-w64-x86_64-python mingw-w64-x86_64-python-lz4 mingw-w64-x86_64-python-pycryptodome switch-dev switch-glm switch-libjpeg-turbo mingw-w64-x86_64-python-pip

For me I had to add zip package because even if wasn't explicit indicated on the build page, the code needs it.
 

Attachments

  • IMG_20230926_212711.jpg
    IMG_20230926_212711.jpg
    2.7 MB · Views: 17

s1m0n

New Member
Newbie
Joined
Oct 7, 2023
Messages
3
Trophies
0
Age
37
XP
31
Country
Germany
I just want to leave a quick thank you here... since last night, deep into the night and since the morning I tried to compile Atmosphere to be able to change the boot splash (boot_splash_screen_notex.inc) and despaired !!!! Then I found this wonderful tutorial and suddenly everything went so fast 🤍
 
  • Love
Reactions: impeeza

impeeza

¡Kabito!
OP
Member
Joined
Apr 5, 2011
Messages
6,425
Trophies
3
Age
46
Location
At my chair.
XP
19,111
Country
Colombia
I just want to leave a quick thank you here... since last night, deep into the night and since the morning I tried to compile Atmosphere to be able to change the boot splash (boot_splash_screen_notex.inc) and despaired !!!! Then I found this wonderful tutorial and suddenly everything went so fast 🤍
I am very glad this tutorial helped you, thanks for the kind message.
 
  • Like
Reactions: s1m0n

s1m0n

New Member
Newbie
Joined
Oct 7, 2023
Messages
3
Trophies
0
Age
37
XP
31
Country
Germany
All your posts here on gbatemp regarding boot-/splashscreen helped me a lot.
But the correct installation of devkitPro I am desperate 😂... tried Windows 11. Windows + WSL, Parrot (Debian based), installed Python, Pip and lz4 in Msys...all exactly according to GitHub instructions and still every time an error occurred when linking the kernel.... each time waiting an hour 😂. Then once followed your instructions here and suddenly the compilation process was finished after 10min 👍

Thanks also to the creators of "nintendomo" and "nintendont".... i can't remember where exactly i found them, but they fit perfectly. Maybe later I will change Nintendo Switch and Nintendont Switch. A GIF would also be a great thing💭
Too bad it wasn't my Switch (it's for a family friend) and I have to give it back to him. 😁
 

Attachments

  • lv_0_20231009162958.mp4
    21 MB
  • Love
Reactions: impeeza

impeeza

¡Kabito!
OP
Member
Joined
Apr 5, 2011
Messages
6,425
Trophies
3
Age
46
Location
At my chair.
XP
19,111
Country
Colombia
All your posts here on gbatemp regarding boot-/splashscreen helped me a lot.
But the correct installation of devkitPro I am desperate 😂... tried Windows 11. Windows + WSL, Parrot (Debian based), installed Python, Pip and lz4 in Msys...all exactly according to GitHub instructions and still every time an error occurred when linking the kernel.... each time waiting an hour 😂. Then once followed your instructions here and suddenly the compilation process was finished after 10min 👍

Thanks also to the creators of "nintendomo" and "nintendont".... i can't remember where exactly i found them, but they fit perfectly. Maybe later I will change Nintendo Switch and Nintendont Switch. A GIF would also be a great thing💭
Too bad it wasn't my Switch (it's for a family friend) and I have to give it back to him. 😁
Yeah, the DevKitPro instructions are somehow no noob proof, but I am glad this instructions worked for you.
Post automatically merged:

All your posts here on gbatemp regarding boot-/splashscreen helped me a lot.
But the correct installation of devkitPro I am desperate 😂... tried Windows 11. Windows + WSL, Parrot (Debian based), installed Python, Pip and lz4 in Msys...all exactly according to GitHub instructions and still every time an error occurred when linking the kernel.... each time waiting an hour 😂. Then once followed your instructions here and suddenly the compilation process was finished after 10min 👍

Thanks also to the creators of "nintendomo" and "nintendont".... i can't remember where exactly i found them, but they fit perfectly. Maybe later I will change Nintendo Switch and Nintendont Switch. A GIF would also be a great thing💭
Too bad it wasn't my Switch (it's for a family friend) and I have to give it back to him. 😁
I don't have NintendoMO splash but I do have the NintendoNT bootlogo.:

there are a lot of bootlogos on the thread https://gbatemp.net/threads/custom-boot-logo-for-switch.569031/
 

Attachments

  • NintendoNTSwitch.png
    NintendoNTSwitch.png
    25.6 KB · Views: 17
  • NintendoNTSwitch.zip
    672.7 KB · Views: 19
Last edited by impeeza,
  • Love
Reactions: s1m0n

Muxi

Well-Known Member
Member
Joined
Jun 1, 2016
Messages
606
Trophies
0
Age
52
XP
2,140
Country
Germany
So far, compiling Atmosphere via Msys2 has worked wonderfully. However, since today (I have read the prod.keys from FW 17.0.0 and replaced them in the msys64/home/ml/.switch/ folder) I have been getting these error messages regarding the keys when compiling (see attachment). Now the question to the professionals here: What is the reason for this? Thank you for any feedback.
 

Attachments

  • Compiling_Atmosphere.txt
    23.1 KB · Views: 33

josete2k

Well-Known Member
Member
Joined
Apr 24, 2009
Messages
680
Trophies
1
Age
43
Location
Spain
XP
1,625
Country
Spain
Keys are ok.


You need the 1700_support libnx from atmosphere's repo

Code:
git clone --recursive https://github.com/Atmosphere-NX/libnx/

cd libnx

git checkout 1700_support
make install
 
  • Love
  • Like
Reactions: Muxi and impeeza

impeeza

¡Kabito!
OP
Member
Joined
Apr 5, 2011
Messages
6,425
Trophies
3
Age
46
Location
At my chair.
XP
19,111
Country
Colombia
I haven't try to build latest Atmosphère commit but as far I see you need to update LIBNX manually.


Bash:
git clone --recursive https://github.com/Atmosphere-NX/libnx
cd ~/libnx
git checkout 1700_support
make all -j$(nproc)
make install -j$(nproc)

sorry for the typo, corrected.
 
Last edited by impeeza,
  • Like
Reactions: Muxi and josete2k

Muxi

Well-Known Member
Member
Joined
Jun 1, 2016
Messages
606
Trophies
0
Age
52
XP
2,140
Country
Germany
Doesn't seem to work. Error messages appear.


Edit:
I think I forgot the "export" lines
 

Attachments

  • Compiling_libnx.txt
    5.1 KB · Views: 17
Last edited by Muxi,

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • No one is chatting at the moment.
  • K3Nv2 @ K3Nv2:
    Too bad Hitler didn't make camps for immigrants oh wait
  • Psionic Roshambo @ Psionic Roshambo:
    Isn't the latest method for slim like self right?
  • Psionic Roshambo @ Psionic Roshambo:
    Like a 1 wire mod?
  • K3Nv2 @ K3Nv2:
    Still two wire with resistor if you don't count the 7 wire pc probes cause hardware likes a good probing
    +1
  • BigOnYa @ BigOnYa:
    2 wires left on motherboard, 7 temp soldered to a flasher, then removed after flashed
  • K3Nv2 @ K3Nv2:
    Technically don't even have to remove it could just keep it on
    +1
  • K3Nv2 @ K3Nv2:
    I don't really mess with hard mods due to neuro issues
  • realtimesave @ realtimesave:
    I tried to get a slim on a black friday once, but they ran out of stock for the $100 one
  • realtimesave @ realtimesave:
    many ages ago
  • BigOnYa @ BigOnYa:
    You can find them $50-75 nowdays if catch a deal
  • K3Nv2 @ K3Nv2:
    Still remember grabbing this ps4 slim on black Friday for $200 when the msrp was still around 300
    +1
  • BigOnYa @ BigOnYa:
    I went to auction at a mom/pops video game store few months ago that was closing, and bought 11 slims for $200, 1 was DOA but 10 work fine. so hella deal. Already rgh3'ed 8 of them. But most younger kids don't even want anymore, unless it plays stupid "fortnight", or newer shit.
  • K3Nv2 @ K3Nv2:
    Think I'm gonna use my giftcard balance on a nice pair of headphones but $100 is still limited
  • K3Nv2 @ K3Nv2:
    Soundcore q30s are nice but they leak so much sound it sounds like speakers
  • Psionic Roshambo @ Psionic Roshambo:
    Ken spend the 100 on a gun and skii mask, wait for a jogger at the park jewelry money and headphones!
    +1
  • K3Nv2 @ K3Nv2:
    If only Amazon sold guns
  • K3Nv2 @ K3Nv2:
    Fucking dick heads think it's a bad idea to get a gun 2 days later
  • BigOnYa @ BigOnYa:
    Wait, I thought you were the dickhe...nvm
  • K3Nv2 @ K3Nv2:
    I got balls on my chin and two dicks on my forehead sir
    +1
  • BigOnYa @ BigOnYa:
    Sorry, no offense there double dickhead chinballs.
  • K3Nv2 @ K3Nv2:
    Chicks still love it
    +1
  • BigOnYa @ BigOnYa:
    "Mommy, look, what is that?". "That's your soon to be daddy."
    +1
  • K3Nv2 @ K3Nv2:
    That you'll only see once
    +2
    K3Nv2 @ K3Nv2: That you'll only see once +2