Report this

What is the reason for this report?

How to run a C++ app in Linux

Posted on January 4, 2022

Hi,

I have a numerical application written in C++, the Nonuniform Frequency-Dependent Out-of-Order Fast Fourier Transform. I would like to deploy a driver for it which hits it hard, comparing results with a “direct algorithm” that computes the result in a more straightforward way.

Bottom line. I want to set up a Debian virtual machine (well any Linux distro would most likely do), compile my code using g++, and run it. How do I do this?

Thanks, Matt Fulkerson



This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Hi there,

What you could do is to follow these steps:

  • Install the C++ compiler:
sudo apt install g++
  • Then install the build-essential package:
sudo apt install build-essential
  • Then verify your G++ version:
g++ --version
  • Once you have the compiler in place you could upload your code to the server either using SFTP, SSH or by cloning your GitHub repository.

Then finally you could compile the code using the g++ compiler.

Hope that this helps. Best, Bobby

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.