-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
51 lines (40 loc) · 1.04 KB
/
Copy pathMakefile
File metadata and controls
51 lines (40 loc) · 1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# Makefile for program
# Uses Libint2 and Eigen libraries
# Compiler and flags
CXX = g++
CXXFLAGS = -std=c++11 -O3 -march=native -fopenmp -Wall
CXXFLAGS_DBG = -std=c++11 -g -march=native -Wall
CPPFLAGS = -I. -I/home/zhaixy/libint/libint2/include -I/usr/include/eigen3
# Libraries
LDFLAGS = -fopenmp
LDLIBS = -L/home/zhaixy/libint/libint2/lib -lint2 -lpthread
# Source files
SRCS = main.cpp utils.cpp integrals.cpp linalg.cpp globals.cpp ao2mo.cpp
OBJS = $(SRCS:.cpp=.o)
DEPS = hartree_fock.h
# Target executable
TARGET = MP2
# Default target
all: $(TARGET)
# Release build
$(TARGET): $(OBJS)
$(CXX) $(CXXFLAGS) $(LDFLAGS) -o $@ $^ $(LDLIBS)
# Debug build
debug: CXXFLAGS = $(CXXFLAGS_DBG)
debug: LDFLAGS =
debug: $(TARGET)
# Compile source files
%.o: %.cpp $(DEPS)
$(CXX) $(CXXFLAGS) $(CPPFLAGS) -c $< -o $@
# Clean up
clean:
rm -f $(OBJS) $(TARGET)
# Phony targets
.PHONY: all clean debug
# Dependencies
main.o: hartree_fock.h
utils.o: hartree_fock.h
integrals.o: hartree_fock.h
linalg.o: hartree_fock.h
globals.o: hartree_fock.h
ao2mo.o: hartree_fock.h