Editing Compiling
From BRL-CAD
Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.
The edit can be undone.
Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 6: | Line 6: | ||
== Step 1: Install Dev Tools == | == Step 1: Install Dev Tools == | ||
− | To build, you | + | To build, you need at least [https://cmake.org/download/ CMake], a compiler, and at least 3GB of disk space. You will also want [https://git-scm.com/downloads/guis Git] to obtain the latest source code. |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
* '''Windows''': Install [https://gitforwindows.org Git], [https://cmake.org/download/ CMake], and [https://visualstudio.microsoft.com/vs/community/ Visual Studio Community] or Professional. VS Code should also work, but you will need to install the "[https://visualstudio.microsoft.com/downloads/ Build Tools for Visual Studio]" also. | * '''Windows''': Install [https://gitforwindows.org Git], [https://cmake.org/download/ CMake], and [https://visualstudio.microsoft.com/vs/community/ Visual Studio Community] or Professional. VS Code should also work, but you will need to install the "[https://visualstudio.microsoft.com/downloads/ Build Tools for Visual Studio]" also. | ||
− | |||
* '''Mac''': Install [https://cmake.org/download/ CMake] and XCode or run this in Terminal: <pre>xcode-select --install</pre> | * '''Mac''': Install [https://cmake.org/download/ CMake] and XCode or run this in Terminal: <pre>xcode-select --install</pre> | ||
− | |||
* '''Linux''' and Windows Subsystem for Linux ('''WSL'''): | * '''Linux''' and Windows Subsystem for Linux ('''WSL'''): | ||
Installing is easiest with a package management system like apt, brew, yum, and dnf that install for you. Alas, the tools and names change frequently, so the following are platform-specific recommendations that may need to be adjusted for your system. | Installing is easiest with a package management system like apt, brew, yum, and dnf that install for you. Alas, the tools and names change frequently, so the following are platform-specific recommendations that may need to be adjusted for your system. | ||
− | |||
− | |||
** Debian/Ubuntu: <pre>apt install build-essential make cmake</pre> | ** Debian/Ubuntu: <pre>apt install build-essential make cmake</pre> | ||
− | |||
− | |||
** Fedora: <pre>yum install clang++ make cmake</pre> | ** Fedora: <pre>yum install clang++ make cmake</pre> | ||
** CentOS: <pre>yum install python3-pip devtoolset-9</pre><pre>pip3 install cmake</pre><pre>scl enable devtoolset-9 bash</pre> | ** CentOS: <pre>yum install python3-pip devtoolset-9</pre><pre>pip3 install cmake</pre><pre>scl enable devtoolset-9 bash</pre> | ||
− | |||
* BSD: we assume you know what you're doing and can follow the gist | * BSD: we assume you know what you're doing and can follow the gist | ||
Line 51: | Line 34: | ||
** Debian/Ubuntu: <pre>apt install libc6-dev libfreetype-dev libfontconfig-dev</pre><pre>apt install xserver-xorg-dev libx11-dev libxi-dev libglu1-mesa-dev</pre> | ** Debian/Ubuntu: <pre>apt install libc6-dev libfreetype-dev libfontconfig-dev</pre><pre>apt install xserver-xorg-dev libx11-dev libxi-dev libglu1-mesa-dev</pre> | ||
− | ** Fedora: <pre>yum install | + | ** Fedora: <pre>yum install libx11-devel</pre> |
== Step 3: Download BRL-CAD == | == Step 3: Download BRL-CAD == | ||
Line 57: | Line 40: | ||
We recommend obtaining BRL-CAD by forking or cloning our repository on [https://github.com/BRL-CAD/brlcad GitHub]. | We recommend obtaining BRL-CAD by forking or cloning our repository on [https://github.com/BRL-CAD/brlcad GitHub]. | ||
− | * '''Windows''': | + | * '''Windows''': Run the Git GUI specifying this as the repository to clone: <pre>https://github.com/BRL-CAD/brlcad.git</pre> |
* '''Mac''': You can either run the Git GUI, or you can run this in Terminal: <pre>git clone https://github.com/BRL-CAD/brlcad.git</pre> | * '''Mac''': You can either run the Git GUI, or you can run this in Terminal: <pre>git clone https://github.com/BRL-CAD/brlcad.git</pre> | ||
− | * '''Linux | + | * '''Linux''': <pre>git clone https://github.com/BRL-CAD/brlcad.git</pre> |
The "brlcad" folder created after cloning is a full source checkout of BRL-CAD and contains a README with additional info. If you run into trouble cloning from git, snapshot source releases [https://sourceforge.net/projects/brlcad/files/BRL-CAD%20Source/ are available]. | The "brlcad" folder created after cloning is a full source checkout of BRL-CAD and contains a README with additional info. If you run into trouble cloning from git, snapshot source releases [https://sourceforge.net/projects/brlcad/files/BRL-CAD%20Source/ are available]. | ||
− | |||
== Step 4: Create a Build directory == | == Step 4: Create a Build directory == | ||
Line 77: | Line 59: | ||
== Step 5: Configure == | == Step 5: Configure == | ||
− | + | Next, you'll run CMake to configure and generate a build system. CMake needs to know the top-level source dir (i.e., "brlcad" dir you cloned) and "build" dir you made are located. For your first time, we also recommend setting these CMake variables to avoid trivial issues: | |
− | |||
− | Next, you'll run CMake to configure and generate a build system. | ||
− | |||
− | CMake needs to know the top-level source dir (i.e., "brlcad" dir you cloned) and "build" dir you made are located. For your first time, we also recommend setting these CMake variables to avoid trivial issues: | ||
BRLCAD_ENABLE_STRICT=OFF | BRLCAD_ENABLE_STRICT=OFF | ||
BRLCAD_ENABLE_COMPILER_WARNINGS=OFF | BRLCAD_ENABLE_COMPILER_WARNINGS=OFF | ||
Line 90: | Line 68: | ||
* '''Mac''': You can either run CMake GUI like described for Windows, specifying your source dir, build dir, and the above variables, or you can follow the steps below for Linux in Terminal. | * '''Mac''': You can either run CMake GUI like described for Windows, specifying your source dir, build dir, and the above variables, or you can follow the steps below for Linux in Terminal. | ||
− | * '''Linux''': <pre>cd brlcad/ | + | * '''Linux''': <pre>cd brlcad/bulid</pre><pre>cmake .. -DBRLCAD_ENABLE_STRICT=NO -DBRLCAD_BUNDLED_LIBS=ON -DCMAKE_BUILD_TYPE=Release</pre> |
See [https://github.com/BRL-CAD/brlcad/blob/main/INSTALL INSTALL] for more CMake options. | See [https://github.com/BRL-CAD/brlcad/blob/main/INSTALL INSTALL] for more CMake options. | ||
− | If CMake was successful, there will be a summary of the build printed at the end | + | If CMake was successful, there will be a summary of the build printed at the end and it will have generated a build system for compiling BRL-CAD. |
− | |||
− | |||
== Step 6: Compile == | == Step 6: Compile == | ||
− | '''Windows''': navigate to your build directory and open the BRLCAD.sln file with Visual Studio. | + | '''Windows''': navigate to your build directory and open the BRLCAD.sln file with Visual Studio. Compile the ALL_BUILD solution. |
− | '''Mac''', '''Linux''': while still in the build directory from Step 4, run <pre>make | + | '''Mac''', '''Linux''': while still in the build directory from Step 4, run <pre>make</pre> |
If the build fails, re-run while capturing all output to a log: make 2>&1 | tee build.log | If the build fails, re-run while capturing all output to a log: make 2>&1 | tee build.log |