Skip to content

Commit b719a44

Browse files
committed
Fix
Changed the way MPI compiler and library paths are configured. Resolves #1.
1 parent af7220a commit b719a44

File tree

1 file changed

+11
-12
lines changed

1 file changed

+11
-12
lines changed

Makefile.in

+11-12
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,45 @@
11
#--------------------------------------------------------------------------
2-
# Which make to use
2+
# Which make to use
33
make = make
44

55
# Which compiler to use
66
# CC is the compiler for the serial code
77
# PARCC is the compiter for the parallel code
88
CC = clang
9-
PARCC = /usr/local/opt/open-mpi/bin/mpicc
9+
PARCC = $(shell which mpicc)
1010

1111
# What optimization level to use
1212
OPTFLAGS = -O3
1313

1414
# What options to be used by the compiler
15-
COPTIONS =
15+
COPTIONS =
1616

1717
# Which loader to use
18-
LD = cc
19-
PARLD = cc
18+
LD = clang
19+
PARLD = $(shell which mpicc)
2020

2121
# What options to be used by the loader
2222
LDOPTIONS = -O3
2323

24-
# Where to put the executable
24+
# Where to put the executable
2525
BINDIR = ../../bin
2626

2727
# Additional libraries
28-
DMALLOCDIR =
28+
DMALLOCDIR =
2929
IMLIBDIR = ../../MGridGen/IMlib
3030

3131
# Include directories for the compiler
32-
INCDIR =
32+
INCDIR =
3333

3434
# In which directories to look for any additional libraries
35-
LIBDIR = -L../.. \
36-
-L/usr/local/lib
35+
LIBDIR = -L../.. $(patsubst %,-L%,$(shell $(PARCC) --showme:libdirs))
3736

3837
# Set some flags
3938
DEBUGFLAGS =
4039

4140
# What additional libraries to link the programs with (eg., -lmpi)
4241
LIBS = -lmgrid -lm
43-
PARLIBS = -lparmgrid -lmgrid -lmpi -lm
42+
PARLIBS = -lparmgrid -lmgrid -l$(shell $(PARCC) --showme:libs) -lm
4443

4544

4645
# What archiving to use
@@ -51,7 +50,7 @@ AR = ar rv
5150
RANLIB = ar -ts
5251

5352
#--------------------------------------------------------------------------
54-
#
53+
#
5554
# Do not change any of the following
5655
#
5756
VERNUM = 1.0

0 commit comments

Comments
 (0)