-
Notifications
You must be signed in to change notification settings - Fork 4
/
Makefile.chpc
47 lines (35 loc) · 911 Bytes
/
Makefile.chpc
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
# Makefile for compiling Parellized version of the NSGA-II source code
USE_MPI = ""
USE_OPENMP = ""
ifdef USE_MPI
CC=mpicc
CXX=mpicxx
LD=mpicxx
$(info MPI is enabled)
else
CC=gcc
CXX=g++
LD=g++
$(info MPI is disabled)
endif
INCDIRS = -I/uufs/chpc.utah.edu/sys/installdir/intel/compilers_and_libraries_2017.0.098/linux/mpi/include64
#INCDIRS = -I/uufs/chpc.utah.edu/sys/installdir/gcc/4.9.2/include
CUSTOMDEFINES =""
ifdef USE_OPENMP
CUSTOMDEFINES = -fopenmp -g
$(info OpenMP is enabled)
else
$(info OpenMP is disabled)
endif
RM=rm -f
CXXFLAGS =-Wall -Werror -pedantic -g $(CUSTOMDEFINES) -std=c++11 $(INCDIRS)
LDFLAGS = $(CUSTOMDEFINES)
OBJS:=$(patsubst %.c,%.o,$(wildcard *.c)) $(patsubst %.cpp,%.o,$(wildcard *.cpp))
MAIN=parallelnsga2r
all:$(MAIN)
$(MAIN):$(OBJS)
$(LD) $(LDFLAGS) $(OBJS) -o $(MAIN) -lm
%.o: %.c %.cpp global.h rand.h
$(CC) $(CFLAGS) -c $<
clean:
$(RM) $(OBJS)