-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
separate makefiles for gtests and add makefile for the examples.
- Loading branch information
Showing
9 changed files
with
101 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
CXX :=g++ | ||
#CXX :=clang++ | ||
|
||
CXX_FLAGS:=-Wextra -Wall -Wpedantic -O3 -std=c++20 -pthread -fopenmp | ||
|
||
ifeq ($(BLAS_FLAG), OPENBLAS) | ||
include ../openblas.mk | ||
else ifeq ($(BLAS_FLAG), MKL) | ||
include ../mkl.mk | ||
endif | ||
|
||
TLIB_INC :=-I../include | ||
|
||
CXX_FLAGS += $(BLAS_FLAGS) | ||
INCS += $(TLIB_INC) $(BLAS_INC) | ||
LIBS += $(BLAS_LIB) -lgomp -lpthread | ||
|
||
# Source files | ||
SRC1 := interface1.cpp | ||
SRC2 := interface2.cpp | ||
SRC3 := interface3.cpp | ||
|
||
# Object files | ||
OBJ1 := $(SRC1:.cpp=.o) | ||
OBJ2 := $(SRC2:.cpp=.o) | ||
OBJ3 := $(SRC3:.cpp=.o) | ||
|
||
# Targets | ||
all: interface1 interface2 interface3 | ||
|
||
interface1: $(OBJ1) | ||
$(CXX) $(CXX_FLAGS) -o $@ $^ $(LIBS) | ||
|
||
interface2: $(OBJ2) | ||
$(CXX) $(CXX_FLAGS) -o $@ $^ $(LIBS) | ||
|
||
interface3: $(OBJ3) | ||
$(CXX) $(CXX_FLAGS) -o $@ $^ $(LIBS) | ||
|
||
# Generic rule to build object files | ||
%.o: %.cpp | ||
$(CXX) $(CXX_FLAGS) $(INCS) -c $< -o $@ | ||
|
||
# Clean rule | ||
clean: | ||
rm -f interface1 interface2 interface3 $(OBJ1) $(OBJ2) $(OBJ3) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#MKL_ROOT_DIR=/opt/intel/oneapi | ||
#MKL_BLAS_DIR=${MKL_ROOT_DIR}/mkl/latest | ||
#MKL_COMP_DIR="${MKL_ROOT_DIR}/compiler/2023.2.0/linux/compiler" | ||
##MKL_COMP_DIR=${MKL_ROOT_DIR}/compiler/2024.0 | ||
#MKL_BLAS_INC=-I${MKL_BLAS_DIR}/include | ||
#MKL_BLAS_LIB=-Wl,--start-group ${MKL_BLAS_DIR}/lib/libmkl_intel_ilp64.a ${MKL_BLAS_DIR}/lib/libmkl_intel_thread.a ${MKL_BLAS_DIR}/lib/libmkl_core.a ${MKL_COMP_DIR}/lib/intel64_lin/libiomp5.a -Wl,--end-group | ||
#MKL_BLAS_LIB+=-lpthread -lm -ldl -m64 #-L${MKL_COMP_DIR}/lib -liomp5 | ||
#MKL_BLAS_FLAGS=-DMKL_ILP64 -m64 | ||
|
||
|
||
MKL_BLAS_DIR=/usr/lib/x86_64-linux-gnu | ||
BLAS_INC=-I/usr/include/mkl | ||
BLAS_LIB=-Wl,--start-group ${MKL_BLAS_DIR}/libmkl_intel_ilp64.a ${MKL_BLAS_DIR}/libmkl_intel_thread.a ${MKL_BLAS_DIR}/libmkl_core.a -Wl,--end-group -liomp5 -lm -ldl -m64 | ||
BLAS_FLAGS=-DMKL_ILP64 -m64 -lpthread -DUSE_MKLBLAS |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
BLAS_INC:=-I/usr/include/x86_64-linux-gnu/openblas64-pthread | ||
BLAS_LIB:=-lopenblas | ||
BLAS_FLAGS:=-DUSE_OPENBLAS |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
GTEST_LIB :=-lgtest -lpthread |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters