Skip to content

Commit

Permalink
scotch_6.0.3: Applied the patches needed for building Scotch with blu…
Browse files Browse the repository at this point in the history
…eCFD-Core's stack.
  • Loading branch information
wyldckat committed Aug 9, 2016
1 parent 2a601b4 commit b642512
Show file tree
Hide file tree
Showing 7 changed files with 88 additions and 22 deletions.
Empty file.
4 changes: 3 additions & 1 deletion scotch_6.0.3/src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ Makefile.inc :

include Makefile.inc

CPLIB ?= $(LIB)

prefix ?= /usr/local
bindir ?= $(prefix)/bin
includedir ?= $(prefix)/include
Expand Down Expand Up @@ -115,7 +117,7 @@ install : required $(bindir) $(includedir) $(libdir) $(mandir)/man1
-$(CP) -f ../bin/[agm]*$(EXE) $(bindir)
-$(CP) -f ../bin/d[agm]*$(EXE) $(bindir)
-$(CP) -f ../include/*scotch*.h $(includedir)
-$(CP) -f ../lib/*scotch*$(LIB) $(libdir)
-$(CP) -f ../lib/*scotch*$(CPLIB) $(libdir)
-$(CP) -Rf ../man/* $(mandir)

clean : required
Expand Down
43 changes: 42 additions & 1 deletion scotch_6.0.3/src/Makefile.inc
24 changes: 13 additions & 11 deletions scotch_6.0.3/src/libscotch/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ libdir = ../../lib

include ../Makefile.inc

CPLIB ?= $(LIB)

%$(OBJ) : %.c
$(CC) $(CFLAGS) $(CLIBFLAGS) -c $(<) -o $(@)

Expand All @@ -55,17 +57,17 @@ scotch :
$(MAKE) CC="$(CCS)" CCD="$(CCS)" \
scotch.h \
scotchf.h \
libscotch$(LIB) \
libscotcherr$(LIB) \
libscotcherrexit$(LIB)
libscotcherrexit$(LIB) \
libscotch$(LIB)

ptscotch : scotch
$(MAKE) CFLAGS="$(CFLAGS) -DSCOTCH_PTSCOTCH" CC="$(CCP)" \
ptscotch.h \
ptscotchf.h \
libptscotch$(LIB) \
libptscotcherr$(LIB) \
libptscotcherrexit$(LIB)
libptscotcherrexit$(LIB) \
libptscotch$(LIB)

install : $(includedir)/scotch.h \
$(includedir)/scotchf.h \
Expand All @@ -77,7 +79,7 @@ ptinstall : install \
$(libdir)/libptscotch$(LIB)

clean :
-$(RM) *~ *$(OBJ) lib*$(LIB) parser_yy.c parser_ly.h parser_ll.c *scotch.h *scotchf.h y.output *dummysizes$(EXE)
-$(RM) *~ *$(OBJ) lib*$(LIB) lib*.def lib*.a parser_yy.c parser_ly.h parser_ll.c *scotch.h *scotchf.h y.output *dummysizes$(EXE)

realclean : clean

Expand All @@ -99,10 +101,10 @@ $(includedir)/ptscotchf.h : ptscotchf.h
-$(CP) ptscotchf.h $(includedir)

$(libdir)/libscotch$(LIB) : libscotch$(LIB)
-$(CP) libscotch$(LIB) libscotcherr*$(LIB) $(libdir)
-$(CP) libscotch$(CPLIB) libscotcherr*$(CPLIB) $(libdir)

$(libdir)/libptscotch$(LIB) : libptscotch$(LIB)
-$(CP) libptscotch$(LIB) libptscotcherr*$(LIB) $(libdir)
-$(CP) libptscotch$(CPLIB) libptscotcherr*$(CPLIB) $(libdir)

##
## Library dependencies.
Expand Down Expand Up @@ -2963,7 +2965,7 @@ ptscotchf.h : ptdummysizes$(EXE) \
./ptdummysizes$(EXE) library_pt_f.h ptscotchf.h

libscotch$(LIB) : $(LIBSCOTCHDEPS)
$(AR) $(ARFLAGS) $(@) $(?)
$(AR) $(ARFLAGS) $(@) $(?) $(ARSFLAGS)
-$(RANLIB) $(@)

libscotcherr$(LIB) : library_error$(OBJ)
Expand All @@ -2975,13 +2977,13 @@ libscotcherrexit$(LIB) : library_error_exit$(OBJ)
-$(RANLIB) $(@)

libptscotch$(LIB) : $(LIBPTSCOTCHDEPS)
$(AR) $(ARFLAGS) $(@) $(?)
$(AR) $(ARFLAGS) $(@) $(?) $(ARPFLAGS)
-$(RANLIB) $(@)

libptscotcherr$(LIB) : library_error_pt$(OBJ)
$(AR) $(ARFLAGS) $(@) $(?)
$(AR) $(ARFLAGS) $(@) $(?) $(LDFLAGS_P1_PT)
-$(RANLIB) $(@)

libptscotcherrexit$(LIB) : library_error_exit_pt$(OBJ)
$(AR) $(ARFLAGS) $(@) $(?)
$(AR) $(ARFLAGS) $(@) $(?) $(LDFLAGS_P1_PT)
-$(RANLIB) $(@)
14 changes: 13 additions & 1 deletion scotch_6.0.3/src/libscotch/library_dgraph_stat.c
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,14 @@
** The static variables.
*/

#if defined(WIN32) || defined(WIN64)
#define DEFERRED_ADDRESS(address) 0
#else
#define DEFERRED_ADDRESS(address) address
#endif

static int dgraphstatblentab[2] = { 7, 3 };
static MPI_Datatype dgraphstattypetab[2] = { GNUM_MPI, MPI_DOUBLE };
static MPI_Datatype dgraphstattypetab[2] = { DEFERRED_ADDRESS(GNUM_MPI), DEFERRED_ADDRESS(MPI_DOUBLE) };

/************************************/
/* */
Expand Down Expand Up @@ -147,6 +153,12 @@ double * edlodltptr)
double edlolocdlt;
int o;

#if defined(WIN32) || defined(WIN64)
//Had to re-route the initiallization of dgraphstattypetab, for compatibility with MinGW dllimports
dgraphstattypetab[0] = GNUM_MPI;
dgraphstattypetab[1] = MPI_DOUBLE;
#endif

srcgrafptr = (Dgraph *) grafptr;

velolocdlt = 0.0L;
Expand Down
12 changes: 7 additions & 5 deletions scotch_6.0.3/src/libscotchmetis/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ libdir = ../../lib

include ../Makefile.inc

CPLIB ?= $(LIB)

%$(OBJ) : %.c
$(CC) $(CFLAGS) $(CLIBFLAGS) -I$(includedir) -I../libscotch -c $(<) -o $(@)

Expand All @@ -62,14 +64,14 @@ ptscotch :

install : scotch
-$(CP) metis.h $(includedir)
-$(CP) libscotchmetis$(LIB) $(libdir)
-$(CP) libscotchmetis$(CPLIB) $(libdir)

ptinstall : ptscotch
-$(CP) parmetis.h $(includedir)
-$(CP) libptscotchparmetis$(LIB) $(libdir)
-$(CP) libptscotchparmetis$(CPLIB) $(libdir)

clean :
-$(RM) *~ *$(OBJ) lib*$(LIB)
-$(RM) *~ *$(OBJ) lib*$(LIB) lib*.a lib*.def

realclean : clean

Expand Down Expand Up @@ -129,12 +131,12 @@ libptscotchparmetis$(LIB) : parmetis_dgraph_order$(OBJ) \
parmetis_dgraph_order_f$(OBJ) \
parmetis_dgraph_part$(OBJ) \
parmetis_dgraph_part_f$(OBJ)
$(AR) $(ARFLAGS) $(@) $(^)
$(AR) $(ARFLAGS) $(@) $(^) $(ARPMFLAGS)
-$(RANLIB) $(@)

libscotchmetis$(LIB) : metis_graph_order$(OBJ) \
metis_graph_order_f$(OBJ) \
metis_graph_part$(OBJ) \
metis_graph_part_f$(OBJ)
$(AR) $(ARFLAGS) $(@) $(^)
$(AR) $(ARFLAGS) $(@) $(^) $(ARSMFLAGS)
-$(RANLIB) $(@)
13 changes: 10 additions & 3 deletions scotch_6.0.3/src/scotch/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,21 @@ libdir = ../../lib

include ../Makefile.inc

ifeq ("$(SCOTCHLIB)","ptscotch")
LDFLAGS_PT ?= $(LDFLAGS)
LDFLAGSX = $(LDFLAGS_PT)
else
LDFLAGSX = $(LDFLAGS)
endif

%$(EXE) : %$(OBJ)
$(CC) $(CFLAGS) -I$(includedir) -I../libscotch $(<) -o $(@) -L$(libdir) -l$(SCOTCHLIB) -lscotch -l$(SCOTCHLIB)errexit $(LDFLAGS)
$(CC) $(CFLAGS) -I$(includedir) -I../libscotch $(<) -o $(@) -L$(libdir) -l$(SCOTCHLIB) -lscotch -l$(SCOTCHLIB)errexit $(LDFLAGSX)

%$(OBJ) : %.c
$(CC) $(CFLAGS) -I$(includedir) -I../libscotch -c $(<) -o $(@)

%$(EXE) : %.c
$(CC) $(CFLAGS) -I$(includedir) -I../libscotch $(<) -o $(@) -L$(libdir) -l$(SCOTCHLIB) -lscotch -l$(SCOTCHLIB)errexit $(LDFLAGS)
$(CC) $(CFLAGS) -I$(includedir) -I../libscotch $(<) -o $(@) -L$(libdir) -l$(SCOTCHLIB) -lscotch -l$(SCOTCHLIB)errexit $(LDFLAGSX)

##
## Project rules.
Expand Down Expand Up @@ -205,7 +212,7 @@ dgpart$(EXE) : dgmap.c \
$(libdir)/libptscotch$(LIB) \
$(libdir)/libptscotcherrexit$(LIB) \
dgmap.h
$(CC) $(CFLAGS) -I$(includedir) -I../libscotch $(<) -DSCOTCH_COMPILE_PART -o $(@) -L$(libdir) -lptscotch -lscotch -lptscotcherrexit $(LDFLAGS)
$(CC) $(CFLAGS) -I$(includedir) -I../libscotch $(<) -DSCOTCH_COMPILE_PART -o $(@) -L$(libdir) -lptscotch -lscotch -lptscotcherrexit $(LDFLAGSX)

dgscat$(EXE) : dgscat.c \
../libscotch/module.h \
Expand Down

0 comments on commit b642512

Please sign in to comment.