Skip to content

Commit

Permalink
Added setup and Travis (#16)
Browse files Browse the repository at this point in the history
  • Loading branch information
ewu63 authored Jul 2, 2020
1 parent 3b76ac2 commit 49e5413
Show file tree
Hide file tree
Showing 10 changed files with 223 additions and 188 deletions.
52 changes: 52 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
os:
- linux

branches:
only:
- master

language: generic

services:
- docker
env:
global:
- REPO_NAME=cgnsutilities
- DOCKER_WORKING_DIR=/home/mdolabuser/repos/$REPO_NAME
- DOCKER_MOUNT_DIR=/home/mdolabuser/travis/$REPO_NAME
jobs:
- DOCKER_TAG=py2-latest
- DOCKER_TAG=py3-stable
- DOCKER_TAG=py3-latest
- DOCKER_TAG=py3-impi
- DOCKER_TAG=py3-centos7-impi

before_install:
- docker pull mdolab/public:$DOCKER_TAG
# run Docker, key is we mount the current Travis directory into Docker to access content of repo
- docker run -t -d
--name app
--mount "type=bind,src=$(pwd),target=$DOCKER_MOUNT_DIR"
mdolab/public:$DOCKER_TAG
/bin/bash

install:
# We thrown away the existing repo in Docker, and copy the new one in-place
- docker exec -it app /bin/bash -c "rm -rf $DOCKER_WORKING_DIR && cp -r $DOCKER_MOUNT_DIR $DOCKER_WORKING_DIR"
# Copy over the correct config file and modify as needed
- docker exec -it app /bin/bash -c ". \$HOME/.bashrc_mdolab && cd $DOCKER_WORKING_DIR && cp config.mk.info config.mk";
- if [[ "$DOCKER_TAG" == "py2"* ]]; then
docker exec -it app /bin/bash -c ". \$HOME/.bashrc_mdolab && cd $DOCKER_WORKING_DIR && sed -i 's/python3-config/python-config/g' config.mk";
elif [[ "$DOCKER_TAG" == "py3-centos7-impi" ]]; then
docker exec -it app /bin/bash -c ". \$HOME/.bashrc_mdolab && cd $DOCKER_WORKING_DIR && sed -i 's/gfortran/ifort/g' config.mk && sed -i 's/gcc/icc/g' config.mk";
fi
# Compile
- docker exec -it app /bin/bash -c ". \$HOME/.bashrc_mdolab && cd $DOCKER_WORKING_DIR && make && pip install ."

script:
# There are no tests for cgnsutilities
# we just check that we can run the command line script here
- docker exec -it app /bin/bash -c ". \$HOME/.bashrc_mdolab && cd \$HOME && cgns_utils -h"

after_script:
- docker rm -f app
50 changes: 50 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# cgnsUtilities

This repository contains a single program called `cgns_utils` that
provides many useful functions for working with cgns grids.

## Installation Instructions

First, copy the default configuration file to the required name:

cp config.mk.info config.mk

Open and edit the config file.
You many have to adjust the `CGNS_INCLUDE_FLAGS` and `CGNS_LINKER_FLAGS` to match your installation of the CGNS library.
You may also specify the c-compiler with the `CC` variable and the flags for the c-compiler with `CFLAGS`.
The C-compiler is only used for the compiler `f2py` wrapper.
The Fortran compiler may be specified with the `FC` variable and the corresponding flags with the `FFLAGS` variable.
It has been tested with both Intel and GNU Fortran compilers.

To compile, simply type

make

If all goes well, you will see

Testing if module libcgns_utils can be imported...
Module libcgns_utils was successfully imported.

which indicates a successful compilation.

To install, type

pip install .

or optionally with the `--user` flag if you are not using a virtual environment.
A console script called `cgns_utils` is provided, which should be installed automatically and available without modifying your `$PATH`.

## Usage

All of the `cgnsUtilties` functionality is accessible through the `cgns_utils` command.
To see a list of the available sub-commands, type

cgns_utils -h

To get further help for a sub-command, type for example:

cgns_utils scale -h

## License

Copyright 2020 MDO Lab. See the LICENSE file for details
88 changes: 0 additions & 88 deletions Readme.rst

This file was deleted.

1 change: 0 additions & 1 deletion __init__.py

This file was deleted.

1 change: 0 additions & 1 deletion bin/__init__.py

This file was deleted.

1 change: 1 addition & 0 deletions cgnsutilities/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
__version__ = "2.2.0"
Loading

0 comments on commit 49e5413

Please sign in to comment.