Skip to content

Commit

Permalink
Merge pull request #119 from jhmatthews/dev
Browse files Browse the repository at this point in the history
Changing dev to contain the whole structure, minus data
  • Loading branch information
jhmatthews committed Oct 7, 2014
2 parents ecaf30d + 6355051 commit f43e33d
Show file tree
Hide file tree
Showing 2,845 changed files with 903,589 additions and 76 deletions.
49 changes: 12 additions & 37 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,8 @@
#
# Procedure:
# - travis automatically clones the main dev branch of the repository
# - we clone the rest of the directory structure into a folder called structure
# - note this is different from normal directory layout, but facilitates the build
# - Cfitsio and gsl are built
# - we then cd into the main build directory and do make test_tr.
# - we clone the rest the atomic data from the data repository
# - we then run some simple test models to check we are reading in data and so on
#
#####################################################################################

Expand All @@ -26,50 +24,27 @@ branches:
dev

install:
# clone the structure branch into a sub directory
- git clone --depth=50 --branch=structure git://github.com/agnwinds/python.git structure
- cd structure
- export PYTHON=$TRAVIS_BUILD_DIR/structure
- echo $PYTHON
- echo $PWD

# make cfitsio library
- cd software/cfitsio3040
- ./configure
- make
- mv libcfitsio.a ../../lib
- make clean
# first configure
- export PYTHON=$TRAVIS_BUILD_DIR
- export PATH=$PATH:$PYTHON/bin
- ./configure

# Then make GSL library
- cd ../../software/gsl-1.15
- ./configure --disable-shared --prefix=$PYTHON/software/gsl-1.15
- make
# do installation
- make install
- make clean
- mkdir $PYTHON/include/gsl
- mv $PYTHON/software/gsl-1.15/include/gsl/* $PYTHON/include/gsl/
- mv $PYTHON/software/gsl-1.15/lib/* $PYTHON/lib/


#Then clone data
- cd ../..
- mkdir data
- cd data
- git clone --depth=50 --branch=data git://github.com/agnwinds/python.git .
# cd back into right directory for making source code
- cd ../../
- cp $PYTHON/py_progs/setup_scripts/Setup_Py_Dir $PYTHON/bin
- export PATH=$PATH:$PYTHON/bin

- git clone --depth=50 git://github.com/agnwinds/data.git data


script:
- echo $PWD
# these long strings of variables are required because we have a different directory layout to normal
- make CC=gcc LIB=structure/lib LIB2=structure/gsl/lib BIN=structure/bin INCLUDE=structure/include INCLUDE2=structure/gsl/include python
- cd source/
- make clean
- make CC=gcc LIB=structure/lib LIB2=structure/gsl/lib BIN=structure/bin INCLUDE=structure/include INCLUDE2=structure/gsl/include py_wind
- make CC=gcc py_wind
- make clean
- cd structure/examples/travis
- cd ../examples/travis
- Setup_Py_Dir
- py test1 > test1.out
- py balmer_test > balmer_test.out
Expand Down
66 changes: 66 additions & 0 deletions Makefile.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
#
# This is the makefile for the python related programs
#
# Make sure you have defined $PYTHON as this directory first
# then type
# make [GIT=False] install
#
# if this fails, consult https://github.com/agnwinds/python/wiki/Installing-Python
# for manual install.

CFITSIO = $(PYTHON)/software/cfitsio3040
CMAKE = mpicc
GSL = $(PYTHON)/software/gsl-1.15
GIT = True
LIBS = True


ifeq (True, $(GIT))
CLONE_DATA = mkdir $(PYTHON)/data; cd $(PYTHON)/data; git clone https://github.com/agnwinds/python.git -b data .
CLONE_RELEASE = mkdir $(PYTHON)/progs; cd $(PYTHON)/progs; git clone https://github.com/agnwinds/python.git; cd python; make CC=$(CMAKE) python; make CC=$(CMAKE) py_wind
PRINT_CLONE = 'Cloning Git Release'
else
CLONE_DATA =
CLONE_RELEASE =
PRINT_CLONE = 'No git installed- have to obtain release and data manually from releases page on github. Exiting.'
endif

MAKE_SOURCE = cd $(PYTHON)/source; make CC=$(CMAKE) python; make CC=$(CMAKE) py_wind;



ifeq (True, $(LIBS))
INSTALL_CFITSIO = cd $(CFITSIO); ./configure; make; mv libcfitsio.a ../../lib; make clean
INSTALL_GSL = cd $(GSL); ./configure --disable-shared --prefix=$(GSL); make; make check 2>&1; make install; make clean;
MOVE_GSL = mkdir $(PYTHON)/include/gsl/; mv $(GSL)/include/gsl/* $(PYTHON)/include/gsl; mv $(GSL)/lib/* $(PYTHON)/lib/;
else
INSTALL_CFITSIO =
INSTALL_GSL =
MOVE_GSL =
endif

install:
@echo 'Installing Python. the radiative transfer code'
@echo 'Installing in directory '$(PYTHON)
# First make cfitsio library
@echo 'Installing CFITSIO library...'
$(INSTALL_CFITSIO)

# Then make GSL library
@echo 'Installing GSL library...'
$(INSTALL_GSL)
$(MOVE_GSL)


#finally, make the latest release
@echo 'Making source code...'
$(MAKE_SOURCE)


@echo 'all done'

clean:
rm -f *.o *~
cd $(CFITSIO); make clean
cd $(GSL); make clean
cd $(PYTHON)/source/; make clean
60 changes: 26 additions & 34 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,65 +6,57 @@ It has been developed by Knox Long, Christian Knigge, Stuart Sim, Nick Higginbot
The code is not yet ready for use and should not be installed yet. If you are interested in using
Python please contact [email protected].

# Travis Build Status

Simple build checks are carried out on Travis. The latest status shows up below:
## Travis Build Status

[![Build Status](https://travis-ci.org/agnwinds/python.png?branch=dev)](https://travis-ci.org/agnwinds/python)


# Getting the radiative transfer code 'Python'

You can download the required structure under the structure branch. e.g.
git clone https://github.com/agnwinds/python.git -b structure
or simply click on the 'zip' button!


Releases of progs can be found under [tags](https://github.com/agnwinds/python/tags "Wiki").

Consult the [wiki](https://github.com/agnwinds/python/wiki/_pages "Wiki") for how to install Python.

## Installation

# Installation
Python and the various routines associated are set up in a self-contained directory structure. The basic directory structure and the data files that one needs to run Python need to be retrieved and compiled.

Python and the various routines associated are set up in a self-contained directory structure. The basic directory structure and the data files that one needs to run Python need to be retrieved (and most likely recompiled).
If you want to obtain a stable (!) release, go to the [Releases](https://github.com/agnwinds/python/releases) page.

If you want to download the latest dev version, you can zip up the git repository by clicking on the zip icon to the right of the GitHub page. Aternatively, you can clone the repository using

**If you have git installed:** To obtain the directory structure, simply retrieve it using git as follows to clone the directory structure:
$ git clone https://github.com/agnwinds/python.git

$ git clone https://github.com/agnwinds/python.git -b structure
If you anticipate contributing to development we suggest Forking the repository and submitting pull requests with any proposed changes.

You then need to cd to the new directory and set your environment variables
Once you have the files, you need to cd to the new directory and set your environment variables

$ export PYTHON = /path/to/python/
$ cd $PYTHON
$ ./configure
$ make install
$ make clean

note that export syntax is for bash- for csh use

$ setenv PYTHON /path/to/python/

Atomic data is stored in our [data repository](https://github.com/agnwinds/data) with it's own releases page. one should unzip these files and place them in a $PYTHON/data folder.

**Without git:** Use the ZIP function under the [structures](https://github.com/agnwinds/python/tree/structure "Structure") branch, and then download .tar.gz versions of the python source under [releases](https://github.com/agnwinds/python/releases).
A development user may want to work on atomic data as part of their work, and pull in changes as they are made, in which case we recommend cloning the data repository:

Once you have a directory /path/to/python/ which contains the structure, place the unpacked tar.gz python source folder under /path/to/python/progs/
$ cd $PYTHON; git clone https://github.com/agnwinds/data data

$ export PYTHON = /path/to/python/
$ cd $PYTHON
$ make GIT=False install
$ make clean
$ cd progs/python_xx #replace xx version you download
$ make clean
$ make CC=gcc python # if you want to use mpicc, ignore the CC=gcc
$ make clean
## Running python

Again, for csh use

$ setenv PYTHON /path/to/python/
To run python you need to add the following to your $PATH variable:

$PYTHON/bin

You can then setup your symbolic links by running

$ Setup_Py_Dir

and run the code by typing, e.g.

$ py root.pf

As you can tell, the git install is simpler!

Please see the (wiki)[https://github.com/agnwinds/python/wiki/Installing-and-Running-Python] for how to use the code.
Please see the [wiki](https://github.com/agnwinds/python/wiki/Installing-and-Running-Python) and docs folder for how to use the code.

Any comments, email [email protected] or [email protected].
Any comments, email [email protected] or [email protected].
9 changes: 9 additions & 0 deletions bin/CheckComplete
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
find . -name *.sig -print > tmpCheck
rm tmpCheck1
awk '{print "grep COMPLETE "$1" >> tmpCheck1.out"}'<tmpCheck >>tmpCheck1
rm tmpCheck1.out
source tmpCheck1
echo 'Total sig files'
wc tmpCheck
echo 'Total completed'
wc tmpCheck1.out
14 changes: 14 additions & 0 deletions bin/Readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
python/bin README

====================

This is where binaries are stored once versions of python have been compiled using make.

Setup_Py_Dir can be used to set up the links to the data directories in a given working folder.


This should be set up with your bash configuration file (or similar)
export PYTHON=/path/to/python
PATH=${PATH}:$PYTHON/bin
export PATH

26 changes: 26 additions & 0 deletions bin/Setup_Py_Dir
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#! /bin/bash

# This is a simple routine to set up links so that python can be run in
# a directory
# 05aug ksl Coded
# 0603 ksl Modified so others could use this as well
# 1306 jm Modified structure to close issue #13


# please make sure your $PYTHON path is setup to use this script
top=$PYTHON
xdata=data

# Note that we now have standard73, standard39, h20 and so on in the top level data directory
# that way atomic/standard73 now links to $PYTHON/data/standard73
# and standard73 then links to the subfolder atomic73

ln -s -f $top/$xdata
#ln -s -f $top/$xdata atomic

## the other data is the same
#ln -s -f $top/$xdata/kurucz91
#ln -s -f $top/$xdata/hutdisk93
#ln -s -f $top/$xdata/disk06


Loading

0 comments on commit f43e33d

Please sign in to comment.