C++ main module for stochmagnet Package  1.0
Installation

Source code

The source codes are available here .
This code is protected under GNU License Legal

2 Prerequired Pre-Required

The doxygen software must be installed on your computer to generate the documentation http://www.doxygen.nl/

  • for linux: sudo apt-get install doxygen graphviz
  • for mac: brew install doxygen graphviz

A G++ compiler have to be installed and a compiler tool as makedepend

  • for linux: sudo apt-get install g++ xutils-dev
  • for mac: brew install g++ makedepend

The libraries needed for the program are :

  • boost for random functions
    • for linux: sudo apt-get libboost-all-dev
    • for mac: brew install boost

code structure and installation

The StochMagnetsoftware contains following source paths:

  • include contains all the .h .hpp files
  • src contains all the .c .cpp files
  • doc contains the doc files and cdoxygen configuration file for generating the html/latex documentation
  • exe : contains the compiled code

The following paths are automatically created:

  • bin : to generate all binary files
  • doc : to generate the html doc by make doc command
  • obj : the compiled object files for all packages

The licence files are:

  • COPYING
  • COPYING.LESSER

It contains also model makefile files to configure the compiling:

  • makefile_env.mdl to configure the paths, flags, compiler commands...
  • makefile_lib.mdl to configure the thirdParty library paths
  • makefile_body.mdl to compile the code thanks to the preceedind environnement variables
  • Makefile is the main makefile to define the command make clean lib prog

The installation script install.sh generate the makefile for compiling the code.

the main part to change is the compiler and he library used

For example to compile on mac platform, the install script is :

#!/bin/sh
#the type of operating system to compile for
OS=mac
#the version in debug or release mode
RELEASE=true
#without OpenMP module
OPENMP=
#with OpenMP module
#OPENMP=--use-openmp
#the path where to find the boost library. Let it empty for taking the default library
# must be installed on the machine
BOOST_INC_PATH=/usr/local/opt/boost
BOOST_LIB_PATH= /usr/local/opt/boost
#the compiler; The compileation of the program needs at least the Modern C++ 20
CXX=g++-12
#the flag of compilatop,
CXX_FLAGS="-std=c++20 -Wunused-local-typedefs"
#run the install script
./install.sh --cxx=$CXX --cxx-flags="$CXX_FLAGS" --boost-hdir=$BOOST_INC_PATH --boost-ldir=$BOOST_LIB_PATH --target=$OS --release=$RELEASE $OPENMP
#compile the program
make clean lib prog
#copy the compiled exe to main exe path
cp bin/mac64/*.exe exe

To install the doc, run

make doc

The genarated index file is located here : [softPath]/doc/stochmagnet/main/html/index.html