Skip to content

User routines

The functionality of numgeo can be extended via user defined subroutines, e.g. by linking your own constitutive model to numgeo or by prescribing a complicated load pattern using a small self-written Fortran code. A Fortran compiler is required to be able to use user-defined subroutines. There are various options for this, which are explained below.

Windows: MinGW

For users of the Windows operating system and the portable version of numgeo, this is probably the easiest option. MinGW-w64 ports the GNU GCC/gfortran, which was originally developed for Linux, to Windows.

More information about MinGW-w64 can be found here.

In addition to a classic installation, WinLibs offers standalone builds of GCC and MinGW-w64 for Windows. An installation is not necessary in this case. With a size of approx. 1.2 GB, this version of MinGW is a space-saving variant compared to other compilers.

The portable version of MinGW-w64 can be downloaded here. Make sure to download the correct version for your operating system (64bit vs 32bit). After downloading the zip archive, it simply needs to be unpacked and is ready for use.

Subroutine Interface

As you will see in the tutorials, the interfaces of the user-defined routines differ slightly depending on the operating system used. See e.g. in this example here. Since MinGW-x64 is based on the GNU GCC/gfortran developed for Linux, the Linux interface must also be used in this case!

Windows: OneAPI

The second option for using user-defined subroutines under Windows is via the programmes/libraries Intel OneAPI and Visual Studio. Compared to the variant with MinGW-x64, the installation of Intel oneAPI requires a lot of space. If the entire toolkit is installed, the total size of the installation is approx. 20 GB. It is therefore important to select only the required parts of the toolkit, as described in the following sections. With these settings, the space requirement is reduced to 13 GB (which is still quite high).

If you are not using the portable version of numgeo and have installed the required dependencies as described here, you can skip the following steps. All required packages are already installed.

The installation steps are as follows:

  1. Install Intel Visual Studio as described here
  2. Install oneAPI Base Toolkit following the procedure given in this section
  3. Install oneAPI HPC Toolkit following these instructions

Visual Studio

Visual Studio (Community) is free to use and can be downloaded here.

When installing Visual Studio, make sure to install "Desktop development with C++"


oneAPI Base Toolkit

The oneAPI Base Toolkit can be installed either using the Graphical User Interface (GUI) or using the package manager apt. I used the GUI with the following steps:

  1. Download the oneAPI Base Toolkit from here
  2. Installation Linux:

    i. Launch the installer with administrator rights

    ii. Follow the installer instructions, but choose "Custom" installation. The only packages required are:

    • Intel® oneAPI DPC++/C++ Compiler
    • Intel® oneAPI DPC++ Library
    • Intel® oneAPI Math Kernel Library
    • Intel® oneAPI Threading Building Blocks (not sure, maybe we can skip this one if not required by other module)
    • Intel® Distribution for GDB*
    • Intel® Integrated Performance Primitives
    • Intel® VTune™ Profiler
    • Intel® Advisor

oneAPI HPC Toolkit

The oneAPI HPC Toolkit can be installed either using the Graphical User Interface (GUI) or using the package manager apt. I used the GUI with the following steps:

  1. Download the oneAPI HPC Toolkit from here

  2. Installation Linux:

    i. Launch the installer as administrator

    ii. Follow the installer instructions, but choose "Custom" installation. The only packages required are:

    • Intel oneAPI DPC++/C++ Compiler (the installation from the Base Toolkit will be extended)
    • Intel® Fortran Compiler
    • Intel® Fortran Compiler Classic
    • Intel® Inspector
    • Intel® MPI Library (I think currently not needed, but in future)
    • Intel® Trace Analyzer and Collector (I think currently not needed, but in future)

Linux: GNU GCC/gfortran

For Ubuntu users, probably the easiest way to use custom routines is to use GNU GCC/gfortran. GCC is already pre-installed on all Ubuntu distributions. Only an installation of gfortran and the build-essentials is required and can be done easily via the package manager:

sudo apt-get install build-essentials -y
sudo apt-get install gfortran -y

For more information on gcc/gfortran visit:

If you need a debugger, consider installing gdb:

sudo apt-get install gdb -y

Linux: OneAPI

As with the Windows version, you can also work with Intel OneAPI under Linux. However, it is not necessary to install Visual Studio in this case (and also not possible, as Linux-based OS are not supported).

If you are not using the portable version of numgeo and have installed the required dependencies as described here, you can skip the following steps. All required packages are already installed.

The installation steps are as follows:

  1. Install oneAPI Base Toolkit following the procedure given below
  2. Install oneAPI HPC Toolkit following below instructions
  3. numgeo is now ready to use

oneAPI Base Toolkit

The oneAPI Base Toolkit can be installed either using the Graphical User Interface (GUI) or using the package manager apt. I used the GUI with the following steps:

  1. Download the oneAPI Base Toolkit from here
  2. Installation Linux:

    i. Launch the installer as root with the following command:

    sudo sh ./l_[Toolkit Name]Kit_[version].sh 
    

    ii. Follow the installer instructions, but choose "Custom" installation. The only packages required are:

    • Intel® oneAPI DPC++/C++ Compiler
    • Intel® oneAPI DPC++ Library
    • Intel® oneAPI Math Kernel Library
    • Intel® oneAPI Threading Building Blocks (not sure, maybe we can skip this one if not required by other module)
    • Intel® Distribution for GDB*
    • Intel® Integrated Performance Primitives
    • Intel® VTune™ Profiler
    • Intel® Advisor

    iii. If you are using Eclipse you might want to install the integration package into Eclipse as well (separate prompt)

  3. Once the installation is complete, verify that your toolkit is installed to the correct installation directory (/opt/intel/oneapi)

oneAPI HPC Toolkit

The oneAPI HPC Toolkit can be installed either using the Graphical User Interface (GUI) or using the package manager apt. I used the GUI with the following steps:

  1. Download the oneAPI HPC Toolkit from here

  2. Installation Linux:

    i. Launch the installer as root with the following command:

    sudo sh ./l_[Toolkit Name]Kit_[version].sh 
    

    ii. Follow the installer instructions, but choose "Custom" installation. The only packages required are:

    • Intel oneAPI DPC++/C++ Compiler (the installation from the Base Toolkit will be extended)
    • Intel® Fortran Compiler
    • Intel® Fortran Compiler Classic
    • Intel® Inspector
    • Intel® MPI Library (I think currently not needed, but in future)
    • Intel® Trace Analyzer and Collector (I think currently not needed, but in future)

    iii. If you are using Eclipse you might want to install the integration package into Eclipse as well (separate prompt)

  3. Once the installation is complete, verify that your toolkit is installed to the correct installation directory (/opt/intel/oneapi)