# ----- MAKE FILE machine definitions (AddOns) -----
# Mario A. Rodriguez-Meza, Ciudad de Mexico, 5.05.2023
#
#

# user not need to make any changes in this file

#B Set of settings
#
# The AddOns are switched on/off here:
include $(MACHINES_DIR)/addons/Makefile_addons_settings
#

#B Here insert AddOns´ Makefile modules

# KDTREEOMP
# For computing 3pcf using kdtree-omp method
ifeq ($(KDTREEOMPON),1)
include $(MACHINES_DIR)/addons/kdtree_omp/Makefile_kdtree_omp
endif
#

# OCTREEGGGOMP
# For computing 3pcf using octree-ggg-omp
ifeq ($(OCTREEGGGOMPON),1)
include $(MACHINES_DIR)/addons/octree_ggg_omp/Makefile_octree_ggg_omp
endif
#

# OCTREEGGGCROSSOMP
# For computing cross-3pcf using octree-ggg-cross-omp
ifeq ($(OCTREEGGGCROSSOMPON),1)
include $(MACHINES_DIR)/addons/octree_ggg_cross_omp/Makefile_octree_ggg_cross_omp
endif
#

# KDTREEBOXOMP
# For computing 2pcf using kdtree_box_omp methods
ifeq ($(KDTREEBOXOMPON),1)
include $(MACHINES_DIR)/addons/kdtree_box_omp/Makefile_kdtree_box_omp
endif
#

# NEIGHBORBOXESOMP
# For computing 2pcf using neighbor-boxes-omp method
ifeq ($(NEIGHBORBOXESOMPON),1)
include $(MACHINES_DIR)/addons/neighbor_boxes_omp/Makefile_neighbor_boxes_omp
endif
#

# COSMOLIB
# For computing several cosmology functions
ifeq ($(COSMOLIBON),1)
include $(MACHINES_DIR)/addons/cosmolib/Makefile_cosmolib
endif
#

# Gadget I/O
# For computing 3pcf using balls method
ifeq ($(GADGETIOON),1)
include $(MACHINES_DIR)/addons/gadget_io/Makefile_gadget_io
endif
#

# CLASSLIB
ifeq ($(CLASSLIBON),1)
include $(MACHINES_DIR)/addons/class_lib/Makefile_class_lib
endif
#

# IOLIB
# To input several columns ascii catalog file
ifeq ($(IOLIBON),1)
include $(MACHINES_DIR)/addons/iolib/Makefile_iolib
endif
#

# CFITSIOLIB
# internal cfitsio lib
ifeq ($(CFITSIOLIBON),1)
include $(MACHINES_DIR)/addons/cfitsiolib/Makefile_cfitsiolib
endif
#

# CFITSIO
# To IO fit format
ifeq ($(CFITSIOON),1)
include $(MACHINES_DIR)/addons/cfitsio/Makefile_cfitsio
endif
#

# PXD
# For cython interfacing...
ifeq ($(PXDON),1)
include $(MACHINES_DIR)/addons/pxd/Makefile_pxd
endif
#

#E Set of settings

#
# ------------------------
# DO NOT DO ANYTHING BELOW
# ------------------------
#

#B AddOns section
ADDONS_ON = 1
#
ifeq ($(ADDONS_ON),1)
ADDONSDIR = ../addons
HEADERFILES = $(wildcard $(ADDONSDIR)/*.h)
ADDONS = addons
vpath %.c $(ADDONS)
INCLUDES += -I$(ADDONSDIR)
INCLUDES += -I$(ADDONSDIR)/addons_include/addons
INCLUDES += -I$(ADDONSDIR)/addons_include
INCLUDES += -I$(ADDONSDIR)/addons_include/general_libs
INCLUDES += -I$(ADDONSDIR)/addons_include/include
INCLUDES += -I$(ADDONSDIR)/addons_include/source/search
INCLUDES += -I$(ADDONSDIR)/addons_include/source/startrun
INCLUDES += -I$(ADDONSDIR)/addons_include/source/testdata
INCLUDES += -I$(ADDONSDIR)/addons_include/source/cballs
INCLUDES += -I$(ADDONSDIR)/addons_include/source/cballsio
INCLUDES += -I$(ADDONSDIR)/addons_include/source/tree
INCLUDES += -I$(ADDONSDIR)/addons_include/source/cballsutils
HEADERFILES = $(wildcard $(ADDONSDIR)/*.h)
HEADERFILES = $(wildcard $(ADDONSDIR)/addons/*.h)
HEADERFILES = $(wildcard $(ADDONSDIR)/addons_include/*.h)
HEADERFILES = $(wildcard $(ADDONSDIR)/addons_include/general_libs/*.h)
HEADERFILES = $(wildcard $(ADDONSDIR)/addons_include/include/*.h)
HEADERFILES = $(wildcard $(ADDONSDIR)/addons_include/source/search/*.h)
HEADERFILES = $(wildcard $(ADDONSDIR)/addons_include/source/startrun/*.h)
HEADERFILES = $(wildcard $(ADDONSDIR)/addons_include/source/testdata/*.h)
HEADERFILES = $(wildcard $(ADDONSDIR)/addons_include/source/cballs/*.h)
HEADERFILES = $(wildcard $(ADDONSDIR)/addons_include/source/cballsio/*.h)
HEADERFILES = $(wildcard $(ADDONSDIR)/addons_include/source/tree/*.h)
HEADERFILES = $(wildcard $(ADDONSDIR)/addons_include/source/cballsutils/*.h)
endif
#
#E


############################
#B Special behavior settings
# In some searching methods
#   it will be possible to set the following flags

# No Limber aproximation
ifeq ($(NOLIMBERON),1)
OPT2 += -DNOLIMBER
endif

# WKAvg switch...
ifeq ($(WKAvgON),1)
OPT2 += -DWKAvg
endif
#

# NMultipoles switch (multipoles for counting)
ifeq ($(NMultipolesON),1)
OPT2 += -DNMultipoles
endif
#

# NONORMHIST switch (do not use normalization of histograms)
ifeq ($(NONORMHISTON),1)
OPT2 += -DNONORMHIST
endif
#

# POLARAXIS switch (set north pole as the axis of reference...)
#   this is for pixel catalogs on the unit sphere: (0,0,1)
ifeq ($(POLARAXISON),1)
OPT2 += -DPOLARAXIS
endif
#

# Compute and add pivot neighbours
ifeq ($(ADDPIVOTNEIGHBOURSON),1)
OPT2 += -DADDPIVOTNEIGHBOURS
endif

# To remove overcounting pairs:
ifeq ($(OVERCOUNTINGON),1)
OPT2 += -DOVERCOUNTING
endif

# SAVERESTORE
# For save/restore options
ifeq ($(SAVERESTOREON),1)
include $(MACHINES_DIR)/addons/save_restore/Makefile_save_restore
endif

# NOSTANDARNORMHIST switch
ifeq ($(NOSTANDARNORMHISTON),1)
OPT2 += -DNOSTANDARNORMHIST
endif
#

# CMDLINE_DEFS_UNITSPHERE
# set of useful default values for the unit sphere
ifeq ($(CMDLINE_DEFS_UNITSPHERE_ON),1)
include $(MACHINES_DIR)/addons/cmdline_defs_settings/Makefile_cmdline_defs_settings
endif
#

#E
############################


############################
#B Addendum of some not important
#   modules or that are in
#   development phase
# Normally they will be switched OFF

# DIRECTMETHOD
# For computing 3pcf using direct method
ifeq ($(DIRECTMETHODON),1)
include $(MACHINES_DIR)/addons/direct_method/Makefile_direct_method
endif
#

# OCTREEGGG
# For computing 3pcf using octree-ggg
ifeq ($(OCTREEGGGON),1)
include $(MACHINES_DIR)/addons/octree_ggg/Makefile_octree_ggg
endif
#

# DIRECTMETHODSIMPLE
# For computing 3pcf using direct method simple
ifeq ($(DIRECTMETHODSIMPLEON),1)
include $(MACHINES_DIR)/addons/direct_method_simple/Makefile_direct_method_simple
endif
#

# DIRECTMETHODSIMPLELOOPID
# For computing 3pcf using direct method simple loopId
ifeq ($(DIRECTMETHODSIMPLELOOPIDON),1)
include $(MACHINES_DIR)/addons/direct_method_simple_loopId/Makefile_direct_method_simple_loopId
endif
#

# OCTREEGGGOMPTRIANGLES
# For computing 3pcf using octree-ggg-omp-triangles
ifeq ($(OCTREEGGGOMPTRIANGLESON),1)
include $(MACHINES_DIR)/addons/octree_ggg_omp_triangles/Makefile_octree_ggg_omp_triangles
endif
#

# KDTREECUTEBOX
# For computing 2pcf using cute_box methods
ifeq ($(KDTREECUTEBOXON),1)
include $(MACHINES_DIR)/addons/kdtree_cute_box/Makefile_kdtree_cute_box
endif
#

# OCTREEKKKBALLS4OMP
# For computing 3pcf using octree-kkk-balls4-omp
ifeq ($(OCTREEKKKBALLS4OMPON),1)
include $(MACHINES_DIR)/addons/octree_kkk_balls4_omp/Makefile_octree_kkk_balls4_omp
endif
#

# OCTREEKKKBALLS4OMPTRIANGLES
# For computing 3pcf using octree-kkk-balls4-omp-triangles
ifeq ($(OCTREEKKKBALLS4OMPTRIANGLESON),1)
include $(MACHINES_DIR)/addons/octree_kkk_balls4_omp_triangles/Makefile_octree_kkk_balls4_omp_triangles
endif
#

# OCTREESMOOTHING
# some utils and definitions useful to smooth octree cells
ifeq ($(OCTREESMOOTHINGON),1)
include $(MACHINES_DIR)/addons/octree_smoothing/Makefile_octree_smoothing
endif
#

# TREEOMPSINCOS
# First developed searching engine
# For computing (2,3)pcf using tree-omp-sincos
ifeq ($(TREEOMPSINCOSON),1)
include $(MACHINES_DIR)/addons/tree_omp_sincos/Makefile_tree_omp_sincos
endif
#

# OCTREESINCOSOMP
# For computing (2,3)pcf using octree-sincos-omp
ifeq ($(OCTREESINCOSOMPON),1)
include $(MACHINES_DIR)/addons/octree_sincos_omp/Makefile_octree_sincos_omp
endif
#

# BALLSOMP
# For computing 3pcf using balls method
ifeq ($(BALLSON),1)
include ./addons/balls_omp/Makefile_settings_balls_omp
include $(MACHINES_DIR)/addons/balls_omp/Makefile_balls_omp
endif
#

# OCTREEKKKOMP
# For computing 3pcf using octree-kkk-omp
ifeq ($(OCTREEKKKOMPON),1)
include $(MACHINES_DIR)/addons/octree_kkk_omp/Makefile_octree_kkk_omp
endif
#

# OCTREEBOXOMP
# For computing 2pcf using octree_box_omp methods
ifeq ($(OCTREEBOXOMPON),1)
include $(MACHINES_DIR)/addons/octree_box_omp/Makefile_octree_box_omp
endif
#

# COMPLEXLIB
# Library for complex computation
ifeq ($(COMPLEXLIBON),1)
include $(MACHINES_DIR)/addons/complex_lib/Makefile_complex_lib
endif
#

#E
############################
