Skip to content

Commit

Permalink
Adding Files for package generation and configuring Makevars
Browse files Browse the repository at this point in the history
  • Loading branch information
rocanale committed Oct 22, 2014
1 parent f95f55c commit 62b31ba
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 27 deletions.
9 changes: 9 additions & 0 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
Package: RElem
Type: Package
Title: Wrappers to use Elemental library www.elemental.org
Version: 0.01.85
Date: 2014-10-22
Author: Rodrigo Canales
Maintainer: Rodrigo Canales <[email protected]>
Description: Wrappers to use Elemental library
License: MIT
2 changes: 2 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
exportPattern("^[[:alpha:]]+")
useDynLib(RElem)
10 changes: 0 additions & 10 deletions R/RElem.R
Original file line number Diff line number Diff line change
@@ -1,13 +1,3 @@
libraryName ="RElemental.so"

#-----------------
#Load the library
#-----------------

if ( is.loaded(libraryName) )
dyn.unload(libraryName)
dyn.load(libraryName)

#------------------
# Class Definitions
#------------------
Expand Down
24 changes: 7 additions & 17 deletions src/Makevars
Original file line number Diff line number Diff line change
@@ -1,23 +1,13 @@
include /usr/local/conf/ElVars

SRCS = $(wildcard *.c)
OBJS = $(patsubst %.c,%.o,$(SRCS))

CC_FLAGS = -std=c99 -O3 -fPIC -Wall

R_INC = -I/usr/share/R/include
ELEM_LIB_PATH = /usr/local/lib
ELEM_INC_PATH = /usr/local/include

MPI_COMPILE = $(shell mpicc -show:compile)
include /usr/local/conf/ElVars

CC_FLAGS = -std=c99 -O3
EL_PATH=-L$(EL_LIB) -L$(EL_LIB)/external/pmrrr
LINK_FLAGS = -Wl,-rpath,$(EL_LIB):$(EL_LIB)/external/pmrrr

all: RElemental.so

%.o: %.c
$(CC) $(CC_FLAGS) -I/$(EL_INC) $(R_INC) $(MPI_CXX_INCSTRING) -o $@ -c $<

RElemental.so: $(OBJS)
$(CC) $(CC_FLAGS) -shared -Wl,-soname,$@ -o $@ $(OBJS) $(EL_PATH) $(EL_LIBS) $(LINK_FLAGS)

clean:
rm -f *.o *.so
PKG_CFLAGS = $(CC_FLAGS) -I/$(EL_INC) $(R_INC) $(MPI_CXX_INCSTRING)
PKG_LIBS = $(EL_PATH) $(EL_LIBS)

0 comments on commit 62b31ba

Please sign in to comment.