How to create a new project in Yambo
If you are about to start a new project with Yambo, you will be interested in knowing how to move the first steps in the code:
1) Edit the file config/mk/targets.mk
In the following np stands for your new project. NP_PROJ = yambo_np ypp_np
Choose two letters which will inequivocally identify your project. Example: "df" stands for "defects". DF_PROJ = yambo_df ypp_df
2) Edit the file config/mk/actions/compile_yambo.mk
and config/mk/actions/compile_ypp.mk
by adding the new executables:
yambo_df: ext-libs @+LIBS2DO="$(INT_LIBS)"; DIR2GO="lib" ; VPATH="$(topdir)/lib" ; $(mk_internal_lib) @+LIBS2DO="$(YLIBDRIVER)"; NAME="yambo_df_driver_"; DIR2GO="lib/yambo/driver/src"; VPATH="$(topdir)/lib/yambo/driver/src";\ ADF="-D_DF -D_SC -D_yambo"; $(mk_external_yambo_lib) @+LIBS2DO="$(PJ_DFLIBS)"; XPATH="src"; VPATH="$(topdir)/src"; ADF="-D_DF -D_SC"; $(mk_src) @+X2DO="yambo_df"; XPATH="driver"; VPATH="$(topdir)/driver"; XLIBS="$(PJ_DFLIBS_LD)" ; DRILIBS="$(YLIBDRIVER_LD)"; \ ADF="-D_DF -D_SC"; $(mk_yambo)
ypp_df: ext-libs @+LIBS2DO="$(INT_LIBS)"; DIR2GO="lib" ; VPATH="$(topdir)/lib" ; $(mk_internal_lib) @+LIBS2DO="$(YLIBDRIVER)"; NAME="ypp_df_driver_"; DIR2GO="lib/yambo/driver/src"; VPATH="$(topdir)/lib/yambo/driver/src"; \ ADF="-D_DF -D_SC -D_ypp"; $(mk_external_yambo_lib) @+LIBS2DO="$(YPPDF_MAIN_LIBS)"; XPATH="src"; VPATH="$(topdir)/src"; ADF="-D_DF -D_SC "; $(mk_src) @+LIBS2DO="$(YPP_LIBS)"; XPATH="ypp"; VPATH="$(topdir)/ypp"; ADF="-D_YPP_DF"; $(mk_ypp_src) @+X2DO="ypp_df"; XPATH="driver"; VPATH="$(topdir)/driver"; XLIBS="$(YPPDF_MAIN_LIBS_LD)"; \ X_ypp_LIBS="$(YPP_LIBS_LD)"; DRILIBS="$(YLIBDRIVER_LD)"; ADF="-D_YPP_DF"; $(mk_ypp)
3) Edit the file config/mk/libraries.mk
by adding the libraries you need for your project, for example in this example we will use the main libs, plus "hamiltonian" and "sc":
PJ_DFLIBS = $(MAIN_LIBS) collisions hamiltonian sc PJ_DFLIBS_LD = $(MAIN_LIBS_LD) hamiltonian collisions sc
in the same you set also the libraries for ypp:
YPPDF_MAIN_LIBS = $(YPP_MAIN_LIBS) collisions hamiltonian sc YPPDF_MAIN_LIBS_LD = $(YPP_MAIN_LIBS_LD) collisions hamiltonian sc
4) edit the file driver/.objects
objs = yambo.o #if defined _ypp || _ypp_ph || _ypp_rt || _ypp_surf || _ypp_magnetic || _ypp_sc || _ypp_nl || _ypp_df objs = ypp.o #endif
5) Edit the file: lib/yambo/driver/src/main/tool_init.c
#if defined _YPP_DF || defined _DF pj="df"; #endif