Skip to content

Commit

Permalink
Fix for conda recipe
Browse files Browse the repository at this point in the history
  • Loading branch information
sdebionne committed Jul 16, 2020
1 parent e0cc552 commit 0e4711b
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 14 deletions.
12 changes: 7 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ PGPLOTDIR = /usr/local/pgplot
DISLIN = /usr/local/dislin
GSLDIR = /usr/local/lib
CGRAPHDIR = /usr/local/lib
BINDIR = /home/gwyndaf/bin
INCLUDE = /usr/local/pgplot
X11LIBDIR = /usr/X11R6/lib
######################################
Expand All @@ -27,6 +26,10 @@ PGLIBS = -lcpgplot -lpgplot
DISLINLIBS= -ldislnc
EXE = chooch-$(VERSION).$(ARCH)
EXEPG = chooch-$(VERSION)-pg.$(ARCH)

PYTHON_INCLUDE_DIR ?= $(shell python -c 'from distutils.sysconfig import get_python_inc; print(get_python_inc())')
PYTHON_DEST_DIR ?= $(shell python -c 'import site; print(site.getsitepackages()[0])')

#
# How to compile and link
#
Expand Down Expand Up @@ -58,7 +61,7 @@ chooch : clean ${OBJECTS} Makefile
$(CC) -o ${EXE} ${CFLAGS} ${OBJECTS} $(LDFLAGS)

pychooch : clean ${OBJECTS}
$(CC) -shared -o ./$(OSTYPE)/PyChooch.so PyChooch.c ${CFLAGS} ${PYOBJECTS} $(LDFLAGS)
$(CC) -shared -o PyChooch.so PyChooch.c ${CFLAGS} ${PYOBJECTS} $(LDFLAGS)

chooch-pg :
make chooch-with-pgplot "CFLAGS = -I$(INCLUDE) $(CFLAGS) -DPGPLOT"
Expand All @@ -68,9 +71,8 @@ chooch-with-pgplot : clean ${OBJECTS} Makefile
#
all: chooch chooch-pg
#
install :
$(MV) $(EXE) $(BINDIR)
$(MV) $(EXEPG) $(BINDIR)
install : pychooch
$(MV) PyChooch.so $(PYTHON_DEST_DIR)
#
clean :
${RM} -f *.o
Expand Down
10 changes: 2 additions & 8 deletions Makefile.Linux
Original file line number Diff line number Diff line change
@@ -1,8 +1,2 @@
FOPTIM = -O2
FFLAGS = $(FOPTIM)
#LDFLAGS = -static -L$(PGPLOTDIR) $(PGLIBS) -L$(X11LIBDIR) -L$(GSLDIR) \
# -L$(CGRAPHDIR) -L$(DISLIN) $(DISLINLIBS) $(CGRAPH) $(LIBS) -lm -ldl -lpthread
LDFLAGS=-L$(GSLDIR) $(LIBS) -lm -ldl -lpthread -L$(CONDA_PREFIX)/lib -L$(CONDA_PREFIX)/lib
CFLAGS = -fPIC -I$(CONDA_PREFIX)/include -I$(CONDA_PREFIX)/include/python3.7m
FC = g77
CC = gcc
LDFLAGS = $(LIBS) -lm -ldl -lpthread -L$(PREFIX)/lib
CFLAGS = -fPIC -I$(PREFIX)/include -I$(PYTHON_INCLUDE_DIR)
2 changes: 1 addition & 1 deletion test_pychooch.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ def main():
with open(filename) as f:
for _ in range(2):
next(f)
data = [map(float, line.split()) for line in f]
data = [list(map(float, line.split())) for line in f]
result = PyChooch.calc(data, "Se", "K")
print(result)

Expand Down

0 comments on commit 0e4711b

Please sign in to comment.