Skip to content

Commit

Permalink
Merge pull request #6 from CDAT/new_license
Browse files Browse the repository at this point in the history
Moving recipe into repo
  • Loading branch information
doutriaux1 authored Dec 21, 2018
2 parents 304e0e5 + a108e85 commit 64babf1
Show file tree
Hide file tree
Showing 9 changed files with 208 additions and 133 deletions.
177 changes: 122 additions & 55 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,42 +2,43 @@ version: 2

checkout:
post:
- ./scripts/checkout_merge_commit.sh
- ./ci-support/checkout_merge_commit.sh

aliases:

- &setup_miniconda
name: setup_miniconda
command: |
mkdir -p workspace
git clone -b validateNightly [email protected]:CDAT/cdat workspace/cdat
git clone -b validateNightly --depth 1 [email protected]:CDAT/cdat workspace/cdat
ls workspace/cdat
python workspace/cdat/scripts/install_miniconda.py -w $WORKDIR -p 'py3'
python workspace/cdat/scripts/install_miniconda.py -w $WORKDIR -p $PY_VER
- &create_conda_env
name: create_conda_env
environment:
CHANNELS: "-c cdat/label/nightly -c conda-forge -c cdat"
PKGS: "hdf5 libnetcdf lapack clapack curl ossuuid numpy"
command: |
export PATH=$HOME/project/$WORKDIR/miniconda/bin:$PATH
conda config --set always_yes yes --set changeps1 no
conda update -y -q conda
conda config --set anaconda_upload no
conda create -q -n py2 -c conda-forge hdf5 libnetcdf lapack clapack curl ossuuid gcc "python<3" "numpy>1.14"
conda create -q -n py3 -c conda-forge hdf5 libnetcdf lapack clapack curl ossuuid gcc "python>3" "numpy>1.14"
if [ $(uname) == "Linux" ]; then
conda install -n py3 -c cdat/label/unstable -c cdat/label/nightly -c conda-forge gcc_linux-64
conda install -n py2 -c cdat/label/unstable -c cdat/label/nightly -c conda-forge gcc_linux-64
if [[ $PY_VER = 'py2' ]]; then
conda create -n $PY_VER -c conda-forge "python<3"
conda install -n $PY_VER $CHANNELS $PKGS
conda install -n $PY_VER $CONDA_COMPILER
else
conda install -n py3 -c cdat/label/unstable -c cdat/label/nightly -c conda-forge gcc
conda install -n py2 -c cdat/label/unstable -c cdat/label/nightly -c conda-forge gcc
conda create -n $PY_VER -c conda-forge "python>3"
conda install -n $PY_VER $CHANNELS $PKGS
conda install -n $PY_VER $CONDA_COMPILER
fi
source activate py2
conda list
- &run_libcf_tests
name: run_libcf_tests
- &setup_libcf
name: upload_libcf
command: |
export PATH=$WORKDIR/miniconda/bin:$PATH
export PATH=$HOME/project/$WORKDIR/miniconda/bin:$PATH
export CDAT_ANONYMOUS_LOG=False
echo "CIRCLE CI BRANCH: "$CIRCLE_BRANCH
echo "CI_PULL_REQUESTS: "$CI_PULL_REQUESTS
echo "CI_PULL_REQUEST: "$CI_PULL_REQUEST
Expand All @@ -46,88 +47,154 @@ aliases:
export LFLAGS="-fPIC ${LFLAGS}"
# somehow looks for fortran but doesn't seem to need it it's pure C
# looking for fortran makes mac fail
source activate base
export FC=""
export FC=""
pwd
ls
echo "xxx running configure py2"
source activate py2
export PREFIX=$CONDA_PREFIX
export CPPFLAGS="-I${PREFIX}/include ${CPPFLAGS}"
export LDFLAGS="-L${PREFIX}/lib ${LDFLAGS}"
./configure --prefix=${PREFIX}
echo "xxx running python install"
if [ $(uname) == "Linux" ]; then
LDSHARED="$CC -shared -pthread" python setup.py install
else
python setup.py install
fi
echo "xxx running configure py3"
source activate py3
echo "xxx running configure $PY_VER"
export CDAT_ANONYMOUS_LOG=False
. $HOME/project/$WORKDIR/miniconda/etc/profile.d/conda.sh
conda activate $PY_VER
conda list
export PREFIX=$CONDA_PREFIX
export CPPFLAGS="-I${PREFIX}/include ${CPPFLAGS}"
export LDFLAGS="-L${PREFIX}/lib ${LDFLAGS}"
./configure --prefix=${PREFIX}
make
make install
echo "xxx running python install"
if [ $(uname) == "Linux" ]; then
LDSHARED="$CC -shared -pthread" python setup.py install
else
python setup.py install
fi
echo "py3 test command exit result:",$RESULT
echo "$PY_VER test command exit result:",$RESULT
- &upload_libcf
name: upload_libcf
- &run_libcf_tests
name: run_libcf_tests
command: |
export PATH=$HOME/project/$WORKDIR/miniconda/bin:$PATH
export CDAT_ANONYMOUS_LOG=False
source activate $PY_VER
python -c "import pycf"
python -c "import pycf.libCFConfig"
RESULT=$?
echo "*** $PY_VER test result: ",${RESULT}
exit $RESULT
- &conda_upload
name: conda_upload
command: |
export PATH=$HOME/project/$WORKDIR/miniconda/bin:$PATH
export LABEL="nightly"
if [ $CIRCLE_BRANCH == "master" ]; then conda install -n root conda-build anaconda-client ; fi
if [ $CIRCLE_BRANCH == "master" ]; then bash ./ci-support/conda_upload.sh ; fi
export LABEL="nightly";
if [ $CIRCLE_BRANCH == "master" ]; then
conda install -n root conda-build anaconda-client
bash ./ci-support/conda_upload.sh
fi
if [ $CIRCLE_BRANCH != "master" ]; then
export LABEL="unstable";
echo "NOTE: upload LABEL="${LABEL}
conda install -n root conda-build anaconda-client;
bash ./ci-support/conda_upload.sh;
fi
jobs:
macos_libcf:
macos_libcf_py2:
macos:
xcode: "9.2.0"
environment:
WORKDIR: "test_macos_libcf_py2"
PY_VER: "py2"
CONDA_COMPILER: "gcc"
steps:
- checkout
- run: *setup_miniconda
- run: *create_conda_env
- run: *setup_libcf
- run: *run_libcf_tests
- run: *conda_upload
- store_artifacts:
path: tests_html
destination: tests_html
- store_artifacts:
path: tests_png
destination: tests_png

macos_libcf_py3:
macos:
xcode: "9.2.0"
environment:
WORKDIR: "workspace/test_macos_libcf"
WORKDIR: "test_macos_libcf_py3"
PY_VER: "py3"
CONDA_COMPILER: "gcc"
steps:
- checkout
- run: *setup_miniconda
- run: *create_conda_env
- run: *setup_libcf
- run: *run_libcf_tests
- run: *upload_libcf
- run: *conda_upload
- store_artifacts:
path: tests_html
destination: tests_html
- store_artifacts:
path: tests_png
destination: tests_png

linux_libcf:
linux_libcf_py2:
machine:
image: circleci/classic:latest
image: circleci/classic
environment:
WORKDIR: "workspace/test_linux_libcf"
WORKDIR: "test_linux_libcf_py2"
PY_VER: "py2"
CONDA_COMPILER: "gcc_linux-64"
steps:
- checkout
- run: *setup_miniconda
- run: *create_conda_env
- run: *setup_libcf
- run: *run_libcf_tests
- run: *upload_libcf
- run: *conda_upload
- store_artifacts:
path: tests_html
destination: tests_html
- store_artifacts:
path: tests_png
destination: tests_png

workflows:
version: 2
libcf:
jobs:
- macos_libcf
- linux_libcf
linux_libcf_py3:
machine:
image: circleci/classic
environment:
WORKDIR: "test_linux_libcf_py3"
PY_VER: "py3"
CONDA_COMPILER: "gcc_linux-64"
COVERAGE: "-c /home/circleci/project/tests/coverage.json"
steps:
- checkout
- run: pwd
- run: ls -l
- run: *setup_miniconda
- run: *create_conda_env
- run: *setup_libcf
- run: *run_libcf_tests
- run: *conda_upload
- store_artifacts:
path: tests_html
destination: tests_html
- store_artifacts:
path: tests_png
destination: tests_png

workflows:
version: 2
libcf_test:
jobs:
- macos_libcf_py2
- macos_libcf_py3:
requires:
- macos_libcf_py2
- linux_libcf_py2
- linux_libcf_py3:
requires:
- linux_libcf_py2


4 changes: 2 additions & 2 deletions cf_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
#define HAVE_STRING_H 1

/* Define this if you have strlcat() */
/* #undef HAVE_STRLCAT */
#define HAVE_STRLCAT 1

/* Define to 1 if `st_blksize' is a member of `struct stat'. */
#define HAVE_STRUCT_STAT_ST_BLKSIZE 1
Expand All @@ -89,7 +89,7 @@
#define HAVE_UNISTD_H 1

/* Define if uuid is found */
/* #undef HAVE_UUID_H */
#define HAVE_UUID_H 1

/* if true, turn on logging */
/* #undef LOGGING */
Expand Down
14 changes: 9 additions & 5 deletions ci-support/conda_upload.sh
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
#!/usr/bin/env bash
PKG_NAME=libcf
USER=cdat
export VERSION="3.0"
export VERSION="3.1.0"
echo "Trying to upload to conda"
echo ""
echo "Activating base env"
source activate base
echo "Making sure conda-build is installed"
#conda install "conda-build<3.10"
conda install "conda-build"
echo "Updating conda"
conda update -y -q conda
Expand All @@ -26,10 +25,15 @@ echo "Cloning recipes"
git clone git://github.com/CDAT/conda-recipes
cd conda-recipes
# uvcdat creates issues for build -c uvcdat confises package and channel
rm -rf uvcdat
if [[ -d uvcdat ]]; then
rm -rf uvcdat
fi
if [[ -d libcf ]]; then
rm -rf libcf
fi
ln -s ../recipe libcf
export BRANCH=${CIRCLE_BRANCH}
python ./prep_for_build.py -b ${BRANCH}

conda build $PKG_NAME -c conda-forge -c cdat -c uvcdat --python=27
conda build $PKG_NAME -c cdat/label/nightly -c conda-forge -c cdat -c uvcdat --python=3.6
conda build $PKG_NAME -c conda-forge -c cdat --python=3.6
anaconda -t $CONDA_UPLOAD_TOKEN upload -u $USER -l $LABEL $CONDA_BLD_PATH/$OS/$PKG_NAME-$VERSION.`date +%Y*`0.tar.bz2 --force
16 changes: 16 additions & 0 deletions recipe/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#source activate "${CONDA_DEFAULT_ENV}"
export CFLAGS="-Wall -m64 -pipe -O2 -fPIC ${CFLAGS}"
export CXXFLAGS="${CFLAGS} ${CXXFLAGS}"
export CPPFLAGS="-I${PREFIX}/include ${CPPFLAGS}"
export LDFLAGS="-L${PREFIX}/lib ${LDFLAGS}"
export LFLAGS="-fPIC ${LFLAGS}"
export FC=""
./configure --prefix=${PREFIX}
make
make install
if [ $(uname) == "Linux" ];then
export LDSHARED="$CC -shared -pthread"
LDSHARED="$CC -shared -pthread" python setup.py install
else
python setup.py install
fi
59 changes: 59 additions & 0 deletions recipe/meta.yaml.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
{% set name = "libcf" %}
{% set variant = "openblas" %}

package:
name: libcf
version: @VERSION@

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

# url: http://uvcdat.llnl.gov/cdat/resources/{{ name }}-1.0.1-beta12.tar.gz
# sha256: de3f16c515198eba596f5e52fc69ce7fd18230c043711ff4c1934d76dbbc8259

build:
number: @BUILD_NUMBER@

requirements:
build:
- {{ compiler('c') }}
- {{ compiler('fortran') }}
host:
- libnetcdf
- blas 1.1 {{ variant }}
- curl >=7.44.0,<8
- python
- ossuuid
run:
- libnetcdf
- blas 1.1 {{ variant }}
- curl >=7.44.0,<8
- python
- ossuuid

test:
imports:
- pycf
- pycf.libCFConfig

about:
home: http://www.unidata.ucar.edu/software/libcf/
license: 'UCAR/UNIDATA'
license_file: 'COPYRIGHT'
summary: 'LibCF library access data files in accordance with the CF Conventions.'
description: |
By using libcf, a data producer can produce files that conform to the CF
standards, without having to write netCDF code to create and decode all
the attributes that the CF convention uses to store meta-data. A data consumer
can use libcf to read any file which conforms to the CF conventions; the
file does not need to be created with libcf to be read by libcf
dev_url: https://sourceforge.net/projects/libcf/

extra:
recipe-maintainers:
- dnadeau4
- doutriaux1



Loading

0 comments on commit 64babf1

Please sign in to comment.