Installation
graphstruc can be built using either the Fortran Package Manager (fpm) or CMake.
Requirements
Compiler: GCC gfortran 14.1.0 or later
Build tool: fpm or CMake 3.17.5+
Dependencies: coreutils (fetched automatically)
Using fpm (Recommended)
The simplest way to use graphstruc is as a dependency in your fpm project.
As a Dependency
Add to your project’s fpm.toml:
[dependencies]
graphstruc = { git = "https://github.com/nedtaylor/graphstruc.git" }
Then use in your code:
use graphstruc, only: graph_type
fpm will automatically fetch and build graphstruc and its dependencies.
Direct Installation
To build graphstruc directly:
git clone https://github.com/nedtaylor/graphstruc.git
cd graphstruc
fpm build
Run the test suite:
fpm test
Run the example programme:
fpm run --example
Using CMake
For projects using CMake:
git clone https://github.com/nedtaylor/graphstruc.git
cd graphstruc
mkdir build && cd build
cmake ..
make
Run tests:
make test
Verifying Installation
Test your installation with this simple programme:
program test
use graphstruc, only: graph_type
implicit none
type(graph_type) :: g
call g%add_vertex(feature=[1.0])
write(*,*) 'Success! Vertices:', g%num_vertices
call g%clear()
end program
Compile and run:
fpm run test