Skip to content

ggrbill/hello-world

Repository files navigation

hello-world

Basic hello world project in C++, Python, Rust and FORTRAN

This project is my first work/contribution into a GitHub repository in my own account.

Setup and activate the environment

This project is based in a conda environment using conda-devenv tool. For miniconda package installation follow the instructions here and for conda-devenv installation instructions click here.

To create and activate the conda environment called hw_env execute the following commands into project root folder

$ conda devenv
$ conda activate hw_env

The command conda-devenv must be installed to create/update the environment. Installation instructions can be found here.

Build HelloWorld in C++

To build the C++ project enter into HelloWorld_CPP folder using:

$ cd HelloWorld_CPP

and execute the following commands:

$ mkdir build
$ cd build
$ cmake ../ [extra options]

Depending on the OS will be available a MSVC solution file (Windows) or a Makefile (Unix based).

Running HelloWorld in Python

To run the Python version of HelloWorld is necessary to enter into HelloWorld_PY folder and execute the HelloWorld.py file. The following commands make all those steps:

$ cd HelloWorld_PY
$ python HelloWorld.py

Also, it is available two PyDev project files inside of HelloWorld_PY folder.

Build HelloWorld in Rust

To build the Rust project enter into HelloWorld_Rust folder using:

$ cd HelloWorld_Rust

And execute the following commands:

$ mkdir build
$ cd build
$ rustc ../main.rs

Build HelloWorld in FORTRAN

To build the FORTRAN project enter into HelloWorld_Fortran folder using:

$ cd HelloWorld_Fortran

And execute the following commands:

$ mkdir build
$ cd build
$ gfortran ../hello.f95

also can compile the Fortran code using:

$ f95 ../hello.f95