The E-MicroM software 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
- externaLibraries contains external libraries needed (sources & build)
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:
It contains also makefile to configure the compiling (see makefiles files configuration.):
- makefile_env.mdl to configure the paths, flags, compiler commands...
- makefile_lib.mdl to configure the thirdParty library paths
- makefile_body.mk to compile the code thanks to the preceedind environnement variables
- Makefile is the main makefile to define the command make clean lib prog
- install.sh script to install the code using the preceeding make files
code
The source codes are available here .
The compiled codes are available here .
This code is protected under GNU License Legal
To run the compiled code on your platform, download the corresponding EMicroM_<platform>_V.vv.tar.gz and untar it in your computer and run if it is explained in the section man. If it does not work, you have to compile the code
The code are composed of modules. A module name is "path"_name. the .c .cpp files of the module are located in src/path/name and the .h .hpp files aere locate in include/path/name.
Pre-Required
The doxygen software must be installed on your computer to generate the documentation http://www.doxygen.nl/
The libraries needed for the program is boost :
The optional library for using the parallel version of the code is OpenMP. To disable this module, set the USE_OPENMP_MODULE=0 in the makefile_env.mk otherwise set it to 1
Those libraries are furnished by default in the ThirdParty path. You can also get it from the dedicated web site and install it on your computer.
On mac operating system, to use the OpenMP module, the gcc-x (x=7,8,9..) version must be installed.
Boost need not to be compiled because only the include file are used. Optionally, to compile boost, go to the source code of boost and:
- execute : sh bootstrap.sh –prefix=install_path
- add using gcc : 9.2.0 : /usr/ocal/bin/gcc-9 at the first line of project-config.jam
- execute ./b2
- execute ./b2 install
To compile fxt :
- modify the makefile in order to set the CXX variable to g++-x and eliminate the -u option from the command cp
- execute 'make clean' 'make' and 'make install PREFIX=install_path'
To compile fftw with gcc-x, do as follow:
- configure the makefile by the command './configure CC=g++-x CXX=g++-x –enable-shared –enable-openmp –with-pic –prefix=install_path'
- make clean lib install
makefiles files configuration.
to compile the program, it is necessary to copy the 2 files in .mk extension and to change all the string finishing by _VAR by the corresponding value.
- makefile_env.mdl
- makefile_lib.mdl
This files may be build by the install.sh script.
Note that on windows, the compilation is done by mingw by cross compilation with x64_84-w64-mingw32
makefile_env
The makefile_env.mdl defines the environment variables
- OS_TYPE_VAR : target os (linux|win|mac)
- ARCH: architecture of the target os (64|' ')
- INSTALL-DIR_VAR : the absolute path whre to find the makefile_env.mk
- CC_VAR : the C-compiler
- CC_FLAGS_VAR : flags for the C Compiler
- CXX_VAR : the C++ compiler
- CXX_FLAGS_VAR : flags for the C++ Compiler
- AR_VAR : the bin to build the lib (ar)
- RANLIB_VAR : the bin to build the lib (ranlib)
- D_FLAGS_VAR : the define values to give to the compiler
This file contains variables to define the module used in the code
- USE_OPENMP_MODULE (0|1) 1: to use the module, 0 otherwise.
This file contains variables to define the computational types:
- USE_FLOAT: to define a real as a float
- USE_DOUBLE: to define a real as a double
- USE_LDOUBLE: to define a real as a long double
- USE_SINT: to define an integer as a short int
- USE_INT: to define an integer as an int
- USE_LINT: to define an integer as a long int
- USE_LLINT: to define an integer as a long long int (for 64 bit machine)
makefile_lib
The makefile_lib.mdl contained the location of the pre-required libraries:
- for boost system & boost system library locations, modifing the path where to find the include files & lib files:
- BOOST_LIB_HPATH defines where to find the include files
- BOOST_LIB_LPATH defines where to find the lib files
- for fftw location, modifing the path where to find the include files & lib files:
- FFTW_LIB_HPATH defines where to find the include files
- FFTW_LIB_LPATH defines where to find the lib files
- for fxt location, modifing the path where to find the include files & lib files:
- FXT_LIB_HPATH defines where to find the include files
- FXT_LIB_LPATH defines where to find the lib files
makefile_body
The makefile_body.mk defines the makefile available commands.
Makefile
The Makefile defines the main makefile.
When the environnement & library variables are set, compile the program by :
- make depend : to build the dependance of .c .cpp file
- make clean : to clean the object & lib files
- make lib : to build the library of each package
- make document : to make the html documentation, the main index file is doc/emicrom/main/html/index.html
- make prog : to compile the main programs
- make install : to install in exe
file : install.sh
This install script build the .mk file from command line as indicated by the man ./install.sh –help
script for creation :
- makefile_env.mk from makefile_env.mdl
- makefile_lib.mk from makefile_lib.mdl
set the VAR variables in the makefile_env.mdl & makefile_lib.mdl
options are
--help: print this help
--target : the target platform in {linux,mac,win}
--release : the compilation option in {true,false}
--third-party : default third party path (thirdParty)
--use-float : to set the real type to float
--use-double : to set the real type to double
--use-ldouble : to set the real type to long double
--use-sint : to set the integer type to short int
--use-int : to set the integer type to int
--use-lint : to set the integer type to long int
--use-llint : to set the integer type to long long int
--cxx : the c++ compiler
--cxx-flags : the flags of c++ compiler
--c : the c compiler
--c-flags : the flags of c compiler
--d-flags : the define variables of the code at compilation
--ddd : the debugger
--ar : the archive bin
--ranlib : the ranlib bin
--ld : the ld bin
--ldd : the ldd bin
--nm : the nm bin
--libname-hdir : the path to find the lib of the library with name libname
--libname-ldir : the path to find the include of the library with name libname
--libname-dir : the parent path to find the include/lib paths for the library with name libname
libname may be:
- boost
- MinGW
- zlib
- dl
- mpi
- openmp
- fftw
- fxt
usage:
./install.sh --libname-dir=<path to include files of libname library > --os=linux64 --release in {true,false}, true by default
for example: ./install.sh --boost-dir=/usr/local/lib/boost --release=true
The install script for linux is done by install-linux64.sh
#!/bin/sh
#
#RELEASE=false
RELEASE=true
OS=linux
ARCH=64
CC=gcc
CXX=g++
AR=ar
RANLIB=ranlib
FXT_DIR=/externalLibraries/math/fxt/linux64/
FFTW_DIR=/externalLibraries/math/fftw/linux64/
BOOST_HDIR=
BOOST_LDIR=
MODULES=
#MODULES+="--use-openmp "
#REAL=--use-float
#REAl=--use-double
#REAL=--use-ldouble
REAL=
#INT=--use-sint
#INT=--use-int
#INT=--use-lint
#INT=--use-llint
INT=
./install.sh --target=$OS --arch=$ARCH --fftw-dir=$FFTW_DIR --fxt-dir=$FXT_DIR --boost-hdir=$BOOST_HDIR --boost-ldir=$BOOST_LDIR --release=$RELEASE $REAL $INT $MODULES --cxx=$CXX --c=$CC --ar=$AR --ranlib=$RANLIB
The install script for windows cross compilation is done by install-mac64.sh
#!/bin/sh
#RELEASE=false
RELEASE=true
OS=mac
ARCH=64
CC=gcc-7
CXX=g++-7
AR=ar
RANLIB=ranlib
MODULES=
#MODULES+="--use-openmp "
ZLIB_DIR=
DL_DIR=
LAPACK_DIR=
BOOST_DIR=/usr/local/opt/boost
FFTW_DIR=/usr/local/opt/fftw
FXT_DIR=/usr/local/opt/fxt
#REAL=--use-float
#REAl=--use-double
#REAL=--use-ldouble
REAL=
#INT=--use-sint
#INT=--use-int
#INT=--use-lint
#INT=--use-llint
INT=
./install.sh --target=$OS --arch=$ARCH --fxt-dir=$FXT_DIR --dl-dir=$DL_DIR --zlib-dir=$ZLIB_DIR --fftw-dir=$HDF5_DIR --boost-dir=$BOOST_DIR --release=$RELEASE $REAL $INT $MODULES --cxx=$CXX --c=$CC --ar=$AR --ranlib=$RANLIB
The install script for windows cross compilation is done by install-win64.sh
/bin/bash
#
#RELEASE=false
RELEASE=true
OS=win
ARCH=64
BIN_PATH=x86_64-w64-mingw32-
CC=${BIN_PATH}gcc
CXX=${BIN_PATH}g++
AR=${BIN_PATH}ar
RANLIB=${BIN_PATH}ranlib
MODULES=" "
#MODULES+="--use-openmp "
#HDF5_DIR=
#BOOST_DIR=
#REAL=--use-float
#REAl=--use-double
#REAL=--use-ldouble
REAL=
#INT=--use-sint
#INT=--use-int
#INT=--use-lint
#INT=--use-llint
INT=
./install.sh --target=$OS --arch=$ARCH --release=$RELEASE $REAL $INT $MODULES --cxx=$CXX --c=$CC --ar=$AR --ranlib=$RANLIB
type make clean lib prog install document tests to :
- clean the lib, obj, bin paths
- build the .lib for all packages
- make the program in bin path
- install the main program in exe path
- generate the documentation
- test the program