swh:1:snp:dc81ca0c8a95588bd21c92e4ae16e6010fcae214
Raw File
Tip revision: 0912775758c647fe1d656a75e33c56776b88fa6e authored by Tim Warburton on 04 December 2023, 23:43:32 UTC
WIP: reduced SSBDF3 to second order
Tip revision: 0912775
make.top
#####################################################################################
#
#The MIT License (MIT)
#
#Copyright (c) 2017-2022 Tim Warburton, Noel Chalmers, Jesse Chan, Ali Karakus
#
#Permission is hereby granted, free of charge, to any person obtaining a copy
#of this software and associated documentation files (the "Software"), to deal
#in the Software without restriction, including without limitation the rights
#to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
#copies of the Software, and to permit persons to whom the Software is
#furnished to do so, subject to the following conditions:
#
#The above copyright notice and this permission notice shall be included in all
#copies or substantial portions of the Software.
#
#THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
#IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
#FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
#AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
#LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
#OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
#SOFTWARE.
#
#####################################################################################

#can be GNU or INTEL
LIBP_ARCH=GNU

#absolute path to LIBP
export LIBP_DIR:=$(patsubst %/,%,$(dir $(abspath $(lastword $(MAKEFILE_LIST)))))

export LIBP_INCLUDE_DIR=${LIBP_DIR}/include
export LIBP_LIBS_DIR=${LIBP_DIR}/libs
export LIBP_TEST_DIR=${LIBP_DIR}/test

export LIBP_BLAS_DIR?=/usr/lib/x86_64-linux-gnu/openblas-serial
export LIBP_BLAS_LIB=-L${LIBP_BLAS_DIR} -lopenblas

#include OCCA
export OCCA_DIR=${LIBP_DIR}/occa

#compilers to use for C/C++
export LIBP_CC = mpicc
export LIBP_CXX= mpic++
export LIBP_LD = mpic++

export LIBP_INCLUDES=-I${LIBP_INCLUDE_DIR} -I${OCCA_DIR}/include
export LIBP_LIBS= -Wl,-rpath,$(LIBP_BLAS_DIR) ${LIBP_BLAS_LIB}  \
                  -Wl,-rpath,$(OCCA_DIR)/lib -L$(OCCA_DIR)/lib -locca


ifneq (,${debug})
  export LIBP_CFLAGS=-O0 -g -Wall -Wshadow -Wno-unused-function -Wno-unknown-pragmas
  export LIBP_CXXFLAGS=-O0 -g -Wall -Wshadow -Wno-unused-function -Wno-unknown-pragmas -std=c++17
  export LIBP_DEFINES=-DLIBP_DEBUG
else
  export LIBP_CFLAGS=-fopenmp -O3 -Wall -Wshadow -Wno-unused-function
  export LIBP_CXXFLAGS=-fopenmp -O3 -Wall -Wshadow -Wno-unused-function -std=c++17
  export LIBP_DEFINES=

  ifeq (GNU,${LIBP_ARCH})
    LIBP_CFLAGS+= -mavx2 -ftree-vectorize -march=native -DGLIBCXX_PARALLEL
    LIBP_CXXFLAGS+= -mavx2 -ftree-vectorize -march=native -DGLIBCXX_PARALLEL
  else ifeq (INTEL,${LIBP_ARCH})
    LIBP_CFLAGS+=-funroll-loops -xHost
    LIBP_CXXFLAGS+=-funroll-loops -xHost
  else
    $(error unknown arch for [LIBP_ARCH] specified)
  endif
endif

ifeq (1,${LIBP_COVERAGE})
  export LIBP_CXXFLAGS+= --coverage -fprofile-abs-path
endif

export OBJ_COLOR = \033[0;36m
export LIB_COLOR = \033[0;34m
export EXE_COLOR = \033[0;32m
export SOL_COLOR = \033[0;33m
export TEST_COLOR= \033[0;35m
export NO_COLOR  = \033[m

export LIBP_MAKETOP_LOADED=true
back to top