Preparation for Building PHOENIX - Schumacher-Group-UPB/PHOENIX GitHub Wiki
To build PHOENIX, you must prepare your system with the necessary tools and dependencies. The process varies slightly between Linux and Windows. Follow the steps below for your platform.
On Linux, you need to install GCC and CUDA. Here's how:
-
Update the Package Index
Open a terminal and update the package index:sudo apt update
-
Install GCC
Install thebuild-essential
package, which includes GCC:sudo apt install build-essential
-
Verify Installation
Check the GCC version to confirm installation:gcc --version
-
Download the CUDA Toolkit
Visit the CUDA Toolkit download page and select the appropriate version for your system. Follow the instructions to download the.deb
package. -
Install the CUDA Toolkit
Use the downloaded.deb
file to install CUDA. Example for Ubuntu:sudo dpkg -i cuda-repo-<distro>_<version>_amd64.deb sudo apt-key adv --fetch-keys http://developer.download.nvidia.com/compute/cuda/repos/<distro>/x86_64/7fa2af80.pub sudo apt update sudo apt install cuda
Replace
<distro>
with your distribution (e.g.,ubuntu2004
) and<version>
with the version you downloaded. -
Set Environment Variables
Add CUDA to your PATH and library paths by editing your.bashrc
file:echo 'export PATH=/usr/local/cuda/bin${PATH:+:${PATH}}' >> ~/.bashrc echo 'export LD_LIBRARY_PATH=/usr/local/cuda/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}' >> ~/.bashrc source ~/.bashrc
-
Verify Installation
Check the CUDA compiler version:nvcc --version
Commands might vary slightly depending on your Linux distribution:
-
GCC:
sudo dnf install @development-tools
-
CUDA:
Follow the NVIDIA instructions for
.rpm
files.
-
GCC:
sudo pacman -S base-devel
-
CUDA:
sudo pacman -S cuda
Reboot to ensure all environment variables are loaded:
sudo reboot
On Windows, preparation requires installing Visual Studio, CUDA Toolkit, and MSYS2.
-
Download Visual Studio
Go to the Visual Studio download page and download the installer. -
Install Visual Studio
- Select the "Desktop Development with C++" workload.
- Complete the installation.
-
Add
cl.exe
to PATH- Open "Environment Variables" from the Start Menu.
- Edit the
Path
variable and add:C:\Program Files (x86)\Microsoft Visual Studio\<version>\VC\Tools\MSVC\<version>\bin\Hostx64\x64
-
Verify Installation
Open Command Prompt and type:cl
-
Download CUDA Toolkit
Download the installer from the CUDA Toolkit page. -
Install CUDA Toolkit
Run the installer and follow the prompts. -
Set Environment Variables
Verify that the installer added the following to the PATH variable:C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.x\bin C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.x\libnvvp
-
Verify Installation
Open Command Prompt and check:nvcc --version
-
Download MSYS2
Visit the MSYS2 website and download the installer. -
Install MSYS2
Run the installer and complete the setup. -
Update MSYS2
Open the MSYS2 shell and update the package database:pacman -Syu
-
Install Required Packages
Install development tools and the MinGW toolchain:pacman -S base-devel mingw-w64-x86_64-toolchain
-
Add MSYS2 to PATH
Add the following to your PATH variable:C:\msys64\usr\bin
-
Verify Installation
Open Command Prompt and type:gcc --version
By following these steps, your system will be ready to build and run PHOENIX. If you encounter any issues, refer to the official documentation for CUDA, Visual Studio, or MSYS2.