Unverified Commit fd937abf authored by Ian Humphrey's avatar Ian Humphrey Committed by GitHub
Browse files

Merge pull request #525 from USGS-Astrogeology/dev

Update kaguya branch from dev
parents 715155b9 a3e2b23b
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -42,3 +42,12 @@ print.prt
*/tsts/*/input/*
*/tsts/*/truth/*
*/tsts/*/output/*
*/build/
*/install/






CONTRIBUTING.md

0 → 100644
+76 −0
Original line number Diff line number Diff line
# Contributing to ISIS3
# Under Construction

#### Table of Contents
[I have a question or a problem!](#i-have-a-question-or-a-problem)

[How can I contribute?](#how-can-i-contribute)
  * [Suggesting enhancements](#redmine-issues)
  * [Working on an existing issue or enhancement](#working-on-an-existing-issue-or-enhancement)
  * [Working on a new issue or enhancement](#working-on-a-new-issue)

[Code Base Contribution Guidelines](#code-base-contribution-guidelines)

[What can I expect from the ISIS3 development team](#What-can-I-expect-from-the-ISIS3-development-team)
  * [Response time](#Response-time)
  * [Feedback](#feedback)

[Development Process Checklists](https://github.com/USGS-Astrogeology/ISIS3/wiki/Developer-Checklists)

[References](#references)

## I have a question or a problem!
If you have a question about or a problem with ISIS3, please see the [Redmine Issues](#redmine-issues) section.

If you have a question or a problem with contributing to our software please contact mshepherd@usgs.gov

## How can I contribute?

### Redmine Issues
Redmine is our ticket tracking tool. If you have a question about, a problem with, or a suggestion for ISIS3, please read our [Guidelines for reporting Redmine issues](https://isis.astrogeology.usgs.gov/fixit/projects/isis/wiki/Guidelines_for_Reporting_Issues). Once you have read that please [submit](https://isis.astrogeology.usgs.gov/fixit/projects/isis/issues/new) a Redmine issue.

### Working on an issue or enhancement
1. Find a issue or enhancement that you want to work on. Check Redmine [issues](https://isis.astrogeology.usgs.gov/fixit/projects/isis/issues) to see if there has been a ticket reported about it. If one does not exist that addresses what you want to work on, make a ticket.
2. Assign the Redmine issue to yourself. If you don't have the permission to do this, please make a note on the issue indicating that you would like to work on it. 
3. Propose a solution on the redmine issue. 
4. Work with an ISIS3 developer, the issue reporter, and any other interested parties to get feedback on your solution. This may be an iterative process.
5. Add an [impact statement](https://isis.astrogeology.usgs.gov/fixit/projects/isis/wiki/Impact_Statement) to the redmine issue. If you don't have the permission to do this, please make a note on the issue with the impact statement.
6. Make the changes on your fork of the ISIS3 main GitHub repo. Follow the [Code Base Contribution Guidelines](#code-base-contribution-guidelines).
7. Follow the Developer's Checklist to ensure your changes are ready for review.
8. Make a pull request. Include the redmine issue number in the title of the pull request. Use the "Fixes #0000" format.
9. Work with your code reviewer, tester, and reporter to improve your changes. Your pull request will not be merged in until all parties approve the changes.
10. Check in your test data. If you are an outside contributer, work with your code reviewer to ensure your tests and test data get checked in.

### Working on a new issue or enhancement
1. Please create a [Redmine issue](#redmine-issues).
2. Indicate in the comments of your issue that you would like to work on the issue or enhancement.
3. Follow the [Working on an existing issue or enhancement](#working-on-an-existing-issue-or-enhancement) steps.
 
## Code Base Contribution Guidelines
The following is a set of guidelines for contributing to ISIS3. 
* Personal style changes will not be accepted.
* Changes to bring code closer to our [Coding Standards and Style Guide](https://isis.astrogeology.usgs.gov/documents/CodingStandards/CodingStandards.html) are encouraged.
* Please be professional, even in comments.
* Variable names must be meaningful.
* All modified code is required to pass our [Coding Standards and Style Guide](https://isis.astrogeology.usgs.gov/documents/CodingStandards/CodingStandards.html).
* You must write or update tests to exercise any modified code.
* You must provide test data for any new or modified tests.
* You must have a Redmine issue assigned to you before submitting a pull request.
* You must complete the Developer Checklist before submitting your pull request.
* When submitting a pull request, you must include the Redmine issue number in the title of the pull request. Use the "Fixes #0000" format (#0000 being the Redmine ticket number).

## What can I expect from the ISIS3 development team?
### Response Time
Our response time will depend on availability and scheduling.
### Feedback
Our feedback will address any discrepancies related to the contribution guidelines, our coding standards and style guide, and our code review checklist.

## References
  * [ISIS3 API Reference](https://isis.astrogeology.usgs.gov/Object/Developer/index.html)
  * [Tutorials](https://isis.astrogeology.usgs.gov/fixit/projects/isis/wiki/ISIS_Online_Workshops)
  * [Application Documentation](https://isis.astrogeology.usgs.gov/Application/index.html)
  * [Coding Standards and Style Guide](https://isis.astrogeology.usgs.gov/documents/CodingStandards/CodingStandards.html)
  * [Documentation](https://isis.astrogeology.usgs.gov/documents/CodingStandards/CodingStandards.html#documentation)
  * [Redmine Issue Lifecycle](https://isis.astrogeology.usgs.gov/fixit/projects/isis/wiki/Life_Cycle_of_an_ISIS_Issue)
  

Jenkinsfile

0 → 100644
+76 −0
Original line number Diff line number Diff line
pipeline { 
    agent none 
    environment {
        ISISROOT="${workspace}" + "/build/"
        ISIS3TESTDATA="/usgs/cpkgs/isis3/testData/"
        ISIS3DATA="/usgs/cpkgs/isis3/data/"
    }
    stages {
        stage('Fedora25') {
            agent {
                docker {
                    label 'cmake'
                    image 'chrisryancombs/docker_isis'
                    args  '''\
                            -v /usgs/cpkgs/isis3/data:/usgs/cpkgs/isis3/data \
                            -v /usgs/cpkgs/isis3/testData:/usgs/cpkgs/isis3/testData\
                            -v /usgs/cpkgs/isis3/isis3mgr_scripts:/usgs/cpkgs/isis3/isis3mgr_scripts
                          '''  
                }
            }
            steps { 
                sh """
                    conda env create -n isis3 -f environment.yml
                    source activate isis3
                    mkdir -p ./install ./build && cd build
                    source /usgs/cpkgs/isis3/isis3mgr_scripts/initIsisCmake.sh .
                    cmake -GNinja -DJP2KFLAG=OFF -Dpybindings=OFF -DCMAKE_INSTALL_PREFIX=../install -Disis3Data=/usgs/cpkgs/isis3/data -Disis3TestData=/usgs/cpkgs/isis3/testData ../isis
                    set +e
                    ninja -j8 && ninja install
                    source /usgs/cpkgs/isis3/isis3mgr_scripts/initIsisCmake.sh .
                    ctest -V -R _unit_ --timeout 500
                    ctest -V -R _app_ --timeout 500
                    ctest -V -R _module_ --timeout 500
                    """
            }
        }
        stage('CentOS7') {
            agent {
                docker {
                    label 'cmake_cool'
                    image 'chrisryancombs/docker_isis_centos'
                    args  '''\
                            -v /usgs/cpkgs/isis3/data:/usgs/cpkgs/isis3/data \
                            -v /usgs/cpkgs/isis3/testData:/usgs/cpkgs/isis3/testData\
                            -v /usgs/cpkgs/isis3/isis3mgr_scripts:/usgs/cpkgs/isis3/isis3mgr_scripts
                          '''  
                }
            }
            steps {
                sh """
                    conda env create -n isis3 -f environment.yml
                    source activate isis3
                    cd build
                    set +e
                    source /usgs/cpkgs/isis3/isis3mgr_scripts/initIsisCmake.sh .
                    ctest -V -R _unit_ --timeout 500
                    ctest -V -R _app_ --timeout 500
                    ctest -V -R _module_ --timeout 500
                """
            }
        }
    }
//    post {
//        success {
//            sh 'pwd && ls'
//            archiveArtifacts artifacts: "build/objects/*.o"
//        }
//        always {
//            mail to: 'ccombs@usgs.gov',
//                    subject: "Build Finished: ${currentBuild.fullDisplayName}",
//                    body: "Link: ${env.BUILD_URL}"
//            sh "rm -rf build/* && rm -rf install/*"
//            cleanWs()
//        }
//    }
} 
+3 −0
Original line number Diff line number Diff line
# ISIS3

[![Join the chat at https://gitter.im/USGS-Astrogeology/isis3_cmake](https://badges.gitter.im/USGS-Astrogeology/isis3_cmake.svg)](https://gitter.im/USGS-Astrogeology/isis3_cmake?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)

Integrated Software for Imagers and Spectrometers ISIS3 public release site

configure.py

0 → 100644
+88 −0
Original line number Diff line number Diff line
import os
import sys
import sipconfig
import sipdistutils
import PyQt5
import subprocess
import argparse

from os.path import splitext
from os.path import dirname
from glob import glob
from distutils.spawn import find_executable

from PyQt5.QtCore import PYQT_CONFIGURATION
from plio.utils.utils import find_in_dict
from PyQt5.QtCore import PYQT_CONFIGURATION as qtconfigdict
from sipconfig import ModuleMakefile

def main (module):
    # The name of the SIP build file generated by SIP and used by the build
    # system.
    sipy_sip_dir = "sipfiles/"
    module = sipy_sip_dir+module + '.sip'
    build_file = "bundle"+".sbf"
    target = module+".so"

    # Get the extra SIP flags needed by the imported qt module.  Note that
    # this normally only includes those flags (-x and -t) that relate to SIP's
    # versioning system.
    qt_sip_flags = qtconfigdict["sip_flags"]

    # sip_bin = current_env_path + "/bin/sip"
    sip_bin = find_executable('sip')
    pyqt_sip_dir = dirname(dirname(sip_bin)) + "/share/sip/PyQt5"

    # Get the PyQt configuration information.
    config = sipconfig.Configuration()

    # Run SIP to generate the code.  Note that we tell SIP where to find the qt
    # module's specification files using the -I flag.

    errcode = os.system(" ".join([sip_bin, "-e","-c", ".", "-b", build_file, "-I",
        pyqt_sip_dir, qt_sip_flags, module]))

    if errcode != 0:
        print('sip exited with non zero error code: {}'.format(errcode))

    # We are going to install the SIP specification file for this module and
    # its configuration module.
    installs = []
    installs.append([module, os.path.join(pyqt_sip_dir, "isis3")])

    isis_root = os.getenv("ISISROOT")
    if not isis_root:
        raise("Please set ISIS")

    extra_libs = ["$(ALLLIBS)", "-Wl,-rpath,"+isis_root+"/lib", "-Wl,-rpath,"+isis_root+"/3rdParty/lib"]

    makefile = ModuleMakefile(configuration=config, build_file=build_file, installs=installs)
    makefile.extra_cxxflags = ["$(ALLINCDIRS)", "-Wstrict-aliasing=0", "-Wno-unused-variable"]
    makefile.extra_lflags =  ["$(ALLLIBDIRS)"]
    makefile.extra_include_dirs = [x[0] for x in os.walk('incs/')]
    makefile.extra_lib_dirs = [isis_root + '/3rdParty/lib', isis_root + 'lib']
    makefile.generate()

    # add import line for isismake.os
    isis_makefile = "include " + isis_root + "/make/isismake.os"

    with open("Makefile", 'r+') as f:
        content = f.read()
        content = content.replace("LIBS =", "LIBS = " + ' '.join(extra_libs))
        f.seek(0, 0)
        f.write(isis_makefile + '\n\n' + content)

if __name__ == "__main__":
    clean = ['cpp', 'c', 'h', 'hpp', 'o', 'sbf']

    # If clean is passed in, clear up all the files genreated by the scripts
    if len(sys.argv) > 1 and sys.argv[1] == 'clean':
        files = []
        for filetype in clean:
            files.extend(glob('*.{}'.format(filetype)))

        for f in files:
            os.remove(f)
        exit()

    main('master')
Loading