Skip to content

Commit

Permalink
Merge pull request #2 from CDAT/use_flags
Browse files Browse the repository at this point in the history
Use flags
  • Loading branch information
doutriaux1 authored Jan 4, 2019
2 parents b5c714f + 21c29cc commit 0cc011a
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 10 deletions.
21 changes: 11 additions & 10 deletions Makefile.gfortran.in
Original file line number Diff line number Diff line change
Expand Up @@ -79,13 +79,14 @@ MANDIR=$(prefix)/man
PARMDIR=$(prefix)/lib/lats

#CC = cc
CFLAGS = -I. -I@cdat_EXTERNALS@/include $(DEBUG) -I/usr/include/malloc
CPPFLAGS = -DHAVE_NETCDF -DLATS_CHANGE_GRADS_NAMES -DSTNDALN=1 -DBYTEORDER=1 -DGRADS_CRAY=0
#CFLAGS = -I. -I@cdat_EXTERNALS@/include $(DEBUG) -I/usr/include/malloc
COPTS = -I. -I@cdat_EXTERNALS@/include $(DEBUG) -I/usr/include/malloc
CPPOPTS = -DHAVE_NETCDF -DLATS_CHANGE_GRADS_NAMES -DSTNDALN=1 -DBYTEORDER=1 -DGRADS_CRAY=0
DEBUG = -O
DEFS = -DOS_NAME=Linux -DOS_MAJOR=2
#FC = gfortran
FDEBUG =
FFLAGS = -I. $(FDEBUG)A -Wno-all
#FDEBUG =
#FFLAGS = -I. $(FDEBUG) -Wno-all
INSTALL = /usr/bin/install -c
INSTALL_PROGRAM = /usr/bin/install -c
LDFLAGS = -L. -llats -L@cdat_EXTERNALS@/lib -lnetcdf -lm
Expand All @@ -110,7 +111,7 @@ OBJS = lats.o latsint.o latsnc.o latsgrib.o latstime.o latsstat.o latsfort.o fg
all: $(LIBRARY) latsls

latsls: latsls.o latsint.o
$(CC) latsls.o latsint.o $(CPPFLAGS) $(CFLAGS) -o latsls
$(CC) latsls.o latsint.o $(CPPFLAGS) $(CPPOPTS) $(CFLAGS) $(COPTS) -o latsls

$(LIBRARY): $(OBJS)
ar rv $(LIBRARY) $?
Expand Down Expand Up @@ -172,25 +173,25 @@ gagmap.o: grads.h gagmap.h
gamach.o: grads.h
gautil.o: grads.h
latsls.o: latsint.h latsls.c latsint.o
$(CC) -c latsls.c $(CPPFLAGS) $(DEFS) $(CFLAGS) -DLATSLS_VERSION=\"$(LATSLSVER)\"
$(CC) -c latsls.c $(CPPFLAGS) $(CPPOPTS) $(DEFS) $(CFLAGS) $(COPTS) -DLATSLS_VERSION=\"$(LATSLSVER)\"

.SUFFIXES: .F

.c.o:
$(CC) $(CPPFLAGS) $(DEFS) $(CFLAGS) -c $<
$(CC) $(CPPFLAGS) $(CPPOPTS) $(DEFS) $(CFLAGS) $(COPTS) -c $<

.c:
$(CC) $(CPPFLAGS) $(DEFS) $(CFLAGS) -o $@ $< $(LDFLAGS)
$(CC) $(CPPFLAGS) $(CPPOPTS) $(DEFS) $(CFLAGS) $(COPTS) -o $@ $< $(LDFLAGS)

.F:
case $(OS) in \
'aix') \
/usr/ccs/lib/cpp -P $(CPPFLAGS) $(CFLAGS) $(INCLUDES) $(DEFS) $< [email protected]; \
/usr/ccs/lib/cpp -P $(CPPFLAGS) $(CPPOPTS) $(CFLAGS) $(COPTS) $(INCLUDES) $(DEFS) $< [email protected]; \
$(FC) $(FFLAGS) $(LDFLAGS) $(LIBS) [email protected] -o $@; \
rm [email protected]; \
;; \
*) \
$(FC) $(CPPFLAGS) $(INCLUDES) $(DEFS) $(FFLAGS) -o $@ $< $(LDFLAGS) $(LIBS); \
$(FC) $(CPPFLAGS) $(CPPOPTS) $(INCLUDES) $(DEFS) $(FFLAGS) -o $@ $< $(LDFLAGS) $(LIBS); \
;; \
esac

Expand Down
13 changes: 13 additions & 0 deletions recipe/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#export CFLAGS="-Wall -g -m64 -pipe -O2 -fPIC"
#export CXXLAGS="${CFLAGS}"
#export CPPFLAGS="-I${PREFIX}/include"
#export LDFLAGS="-L${PREFIX}/lib"

if [ `uname` == Linux ]; then
echo "Linux "${PREFIX}
else
echo "Mac "${PREFIX}
fi
sed "s#@cdat_EXTERNALS@#${PREFIX}#g;" Makefile.gfortran.in > Makefile.gfortran
make -f Makefile.gfortran
make -f Makefile.gfortran install
27 changes: 27 additions & 0 deletions recipe/meta.yaml.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
package:
name: lats
version: 1.0.2

source:
git_rev: @UVCDAT_BRANCH@
git_url: git://github.com/cdat/lats.git

build:
number: @BUILD_NUMBER@

requirements:
build:
- {{ compiler('c') }}
- {{ compiler('fortran') }}
host:
- libnetcdf 4.*
- hdf5 1.10.*
run:
- libnetcdf 4.*
- hdf5 1.10.*

about:
home: http://github.com/cdat/lats



0 comments on commit 0cc011a

Please sign in to comment.