diff --git a/.gitignore b/.gitignore index 77c2ea2d819fa17b120547f321769e3dc4d66a25..c47e1b7744bcabe1c8f1b361199005c7ec1d8e9b 100644 --- a/.gitignore +++ b/.gitignore @@ -42,3 +42,12 @@ print.prt */tsts/*/input/* */tsts/*/truth/* */tsts/*/output/* +*/build/ +*/install/ + + + + + + + diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000000000000000000000000000000000000..70035ab9a956394822950817e5ea49a78d9e8e51 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,76 @@ +# 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) + + diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 0000000000000000000000000000000000000000..dbd8245a00167dd3754b3cd4146b1ab49ab009cc --- /dev/null +++ b/Jenkinsfile @@ -0,0 +1,76 @@ +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() +// } +// } +} diff --git a/README.md b/README.md index 6c1a4a93bf15232bd6d91e36949d91fd94ad1276..29d650272517c5836ef07dfba9a3c2344ca58475 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,5 @@ # 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 diff --git a/configure.py b/configure.py new file mode 100644 index 0000000000000000000000000000000000000000..4a3c84d735029595149855b4528648a990ba8748 --- /dev/null +++ b/configure.py @@ -0,0 +1,88 @@ +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') diff --git a/environment.yml b/environment.yml new file mode 100644 index 0000000000000000000000000000000000000000..c96c1247c61961f5177826fdefc71c22abd29a76 --- /dev/null +++ b/environment.yml @@ -0,0 +1,70 @@ +channels: + - usgs-astrogeology + - conda-forge + - probcomp + - defaults + +dependencies: + - armadillo==8.200.0 + - blas==1.1=openblas + - bullet==2.86.1=0 + - bz2file==0.98 + - bzip2==1.0.6=1 + - cmake==3.9.1=0 + - cspice==66=h470a237_3 + - curl==7.60.0=0 + - doxygen==1.8.14=0 + - eigen==3.3.3=0 + - embree==2.14.0=0 + - geos==3.5.1 + - geotiff==1.4.2=1 + - gmm==5.0 + - gmp==6.1.2=0 + - gsl==2.2.1=blas_openblas_3 + - hdf5==1.8.18=2 + - icu==58.2=0 + - jama==125 + - jpeg==9b=2 + - kakadu==1 + - krb5==1.14.2=0 + - libpng>=1.6.34 + - libprotobuf==3.5.2 + - libtiff==4.0.9=0 + - libxml2==2.9.7=0 + - make + - mesalib==17.2.0=0 + - mysql==5.7.20 + - mysql-connector-c==6.1.6=0 + - nanoflann==1.2.2 + - ninja==1.7.2=0 + - conda-forge/label/gcc7::nn + # - numpy==1.13.3=py36_blas_openblas_200 + - openblas==0.2.19=2 + - opencv + - openssl==1.0.2n=0 + - patchelf==0.9 + - pcl==1.8.1 + - pip==9.0.1 + - protobuf==3.5.2 + # - pyqt==5.6.0 + - python==3.6 + - qhull==7.2.0=0 + - qt=5.9.6 + - qwt=6.1.3 + - setuptools=38.5.1 + - sip==4.18 + - sqlite==3.13.0=1 + - suitesparse==4.5.4=blas_openblas_200 + - superlu==5.2.1=blas_openblas_201 + - tnt==126=0 + - wheel==0.30.0 + - x264==20131218 + - xalan-c==1.11 + - xerces-c==3.1.4=0 + - xorg-kbproto==1.0.7=1 + - xorg-libice + - xorg-libsm + - xorg-libx11==1.6.4=6 + - xorg-libxi + - zlib==1.2.11=0 + diff --git a/environment_gcc4.yml b/environment_gcc4.yml new file mode 100644 index 0000000000000000000000000000000000000000..658ab336d367df47c51c22c35d7e7c2befe47c93 --- /dev/null +++ b/environment_gcc4.yml @@ -0,0 +1,71 @@ +channels: + - jessemapel + - usgs-astrogeology + - conda-forge + - probcomp + - defaults + +dependencies: + - armadillo==8.200.0 + - blas==1.1=openblas + - bullet==2.86.1=0 + - bz2file==0.98 + - bzip2==1.0.6=1 + - cmake==3.9.1=0 + - cspice==66=h470a237_3 + - curl==7.60.0=0 + - doxygen==1.8.14=0 + - eigen==3.3.3=0 + - embree==2.14.0=0 + - geos==3.5.1 + - geotiff==1.4.2=1 + - gmm==5.0 + - gmp==6.1.2=0 + - gsl==2.2.1=blas_openblas_3 + - hdf5==1.8.18=2 + - icu==58.2=0 + - jama==125 + - jpeg==9b=2 + - kakadu==1 + - krb5==1.14.2=0 + - libpng>=1.6.34 + - libprotobuf==3.5.2 + - libtiff==4.0.9=0 + - libxml2==2.9.7=0 + - make + - mesalib==17.2.0=0 + - mysql==5.7.20 + - mysql-connector-c==6.1.6=0 + - nanoflann==1.2.2 + - ninja==1.7.2=0 + - nn==1.86.0=2 + # - numpy==1.13.3=py36_blas_openblas_200 + - openblas==0.2.19=2 + - opencv + - openssl==1.0.2n=0 + - patchelf==0.9 + - pcl==1.8.1 + - pip==9.0.1 + - protobuf==3.5.2 + # - pyqt==5.6.0 + - python==3.6 + - qhull==7.2.0=0 + - qt=5.9.6 + - qwt=6.1.3 + - setuptools=38.5.1 + - sip==4.18 + - sqlite==3.13.0=1 + - suitesparse==4.5.4=blas_openblas_200 + - superlu==5.2.1=blas_openblas_201 + - tnt==126=0 + - wheel==0.30.0 + - x264==20131218 + - xalan-c==1.11 + - xerces-c==3.1.4=0 + - xorg-kbproto==1.0.7=1 + - xorg-libice + - xorg-libsm + - xorg-libx11==1.6.4=6 + - xorg-libxi + - zlib==1.2.11=0 + diff --git a/isis/CMakeLists.txt b/isis/CMakeLists.txt new file mode 100644 index 0000000000000000000000000000000000000000..bb510329611d0bf5b7e5e0d27875192019b8d706 --- /dev/null +++ b/isis/CMakeLists.txt @@ -0,0 +1,461 @@ +#=============================================================================== +# The main build file for building ISIS using CMake. +#=============================================================================== +# CMake initialization + +# Specify the required version of CMake. If your machine does not +# have this, it should be easy to build from https://cmake.org/download/ +cmake_minimum_required(VERSION 3.4) + +# Point cmake to our other CMake files. +list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake") + +set(CMAKE_FIND_FRAMEWORK LAST) + +include(AddIsisModule) +include(Utilities) +include(TestSetup) +include(InstallThirdParty) + +#=============================================================================== +#=============================================================================== +# Project information + +project (USGS_ISIS) + +# Short and long name of this package +set(PACKAGE "ISIS") +set(PACKAGE_NAME "USGS ISIS") + +# Version number +set(VERSION "3.5.00.0") +set(PACKAGE_VERSION ${VERSION}) + +# Full name and version number +set(PACKAGE_STRING "${PACKAGE_NAME} ${VERSION}") + +# Other release information +set(VERSION_DATE "2017-04-24") +set(THIRD_PARTY_LIBS_VERSION "v007") +set(RELEASE_STAGE "alpha") # (alpha, beta, stable) + +# Define to the address where bug reports for this package should be sent. +set(PACKAGE_BUGREPORT "https://isis.astrogeology.usgs.gov/fixit") + +# Main website associated with the software package +set(PACKAGE_URL "https://isis.astrogeology.usgs.gov/") + +# Retrieve a string describing the OS this is built on. +get_os_version(osVersionString) +message("Detected Operating System: ${osVersionString}") + +#=============================================================================== +#=============================================================================== +# Configuration options + +# All libraries are build as shared. The main library is also built +# as a static library using some specialized code in Utilities.cmake. +set(BUILD_SHARED_LIBS ON) + +# make sure to leave rpaths untouched on install +set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE) + +# Specify user options that can be passed in with the initial CMake command. +option(isis3Data "Directory containing Isis3Data" OFF ) +option(isis3TestData "Directory containing Isis3TestData" OFF ) +option(testOutputDir "Directory to store app test output folders" OFF ) +option(buildCore "Build the core ISIS modules" ON ) +option(buildMissions "Build the mission specific modules" ON ) +option(buildStaticCore "Build libisis3 static as well as dynamic" OFF ) +option(buildTests "Set up unit, application, and module tests." ON ) +option(JP2KFLAG "Whether or not to build using JPEG2000 support" OFF ) +option(pybindings "Turn on to build Python bindings" OFF ) + +# if cmake install prefix is not set, and conda env is activated, use the +# conda env as the install directory +if(DEFINED ENV{CONDA_PREFIX} AND CMAKE_INSTALL_PREFIX STREQUAL "/usr/local") + set(CMAKE_INSTALL_PREFIX $ENV{CONDA_PREFIX}) +endif() + +# Prioritize passed in variables over env vars, probably a better way to do this +if(DEFINED ENV{ISIS3DATA} AND NOT isis3Data) + set(isis3Data $ENV{ISIS3DATA}) +endif() +if(DEFINED ENV{ISIS3TESTDATA} AND NOT isis3TestData) + set(isis3TestData $ENV{ISIS3TESTDATA}) +endif() + +if(EXISTS ${isis3Data}) + set(ENV{ISIS3DATA} "${isis3Data}") +else() + message(WARNING "Isis3Data directory ${isis3Data} not found, unit tests will fail.") + set(isis3Data OFF) +endif() + +if(EXISTS ${isis3TestData}) + set(ENV{ISIS3TESTDATA} "${isis3TestData}") +else() + message(WARNING "Isis3TestData directory ${isis3TestData} not found, application and module tests will fail.") + set(isis3TestData OFF) +endif() + +if(${testOutputDir} STREQUAL "OFF") + message("Writing test data folders to = ${CMAKE_BINARY_DIR}/testOutputDir") + set(testOutputDir "${CMAKE_BINARY_DIR}/testOutputDir") + execute_process(COMMAND mkdir -p ${CMAKE_BINARY_DIR}/testOutputDir) +else() + # User specified a test output folder, make sure it exists. + message("Writing test data folders to = ${testOutputDir}") + execute_process(COMMAND mkdir -p ${testOutputDir}) +endif() + +# inject ISISROOT +add_definitions( -DISISROOT="${CMAKE_SOURCE_DIR}" ) +add_definitions( -DISISBUILDDIR="${CMAKE_BINARY_DIR}" ) + +message("CONFIGURATION") +message("\tBUILD STATIC CORE: ${buildStaticCore}") +message("\tBUILD TESTS: ${buildTests}") +message("\tBUILD CORE: ${buildCore}") +message("\tBUILD MISSIONS: ${buildMissions}") +message("\tJP2K SUPPORT: ${JP2KFLAG}") +message("\tPYTHON BINDINGS: ${pybindings}") +message("\tISIS3DATA: ${isis3Data}") +message("\tISISTESTDATA: ${isis3TestData}") +message("\tTEST OUTPUT DIR: ${testOutputDir}") +message("\tINSTALL PREFIX: ${CMAKE_INSTALL_PREFIX}") + +#=============================================================================== +#=============================================================================== + +# Set up the ctest tool which is used to run all of the tests. +enable_testing() +include(CTest) + +# Set up Anaconda prefix in the case with a non-default conda env is activated +if(EXISTS $ENV{CONDA_PREFIX}) + message("CONDA PREFIX: $ENV{CONDA_PREFIX}") + list(APPEND CMAKE_FIND_ROOT_PATH $ENV{CONDA_PREFIX} + $ENV{CONDA_PREFIX}/lib/cmake/Qt5) +endif() + +# options only allow on/off but this flag is piped into ISIS as ENABLEJP2K +# needs to be either 1 or 0 for C style true false +if(JP2KFLAG) + set(JP2KFLAG 1) +endif() + +# Set up the ctest tool which is used to run all of the tests. +enable_testing() +include(CTest) + +# Specify flags used +# on linux, add the conda prefix to handle possible issues with rpaths at link time +# sometimes third parties do not set their rpaths correctly +set(thirdPartyCppFlags -Wall + -fPIC + -std=c++11 + -DISIS_LITTLE_ENDIAN=1 + -Wno-unused-parameter + -Wno-overloaded-virtual + -Wno-strict-aliasing + -Wno-strict-overflow + -DGMM_USES_SUPERLU + -DENABLEJP2K=${JP2KFLAG} + ) + + # Append CPP flags set in the third party lib file to the string set in this file. + string(REPLACE ";" " " FLAGS_STR "${thirdPartyCppFlags}") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${FLAGS_STR}" ) + + +# Flag to fix numeric literals problem with boost on linux +# Add gold linker (and therefore, phtread) to speed up linux (spec. Ubuntu18.04) builds +if(NOT APPLE) + set(thirdPartyCppFlags ${thirdPartyCppFlags} -fuse-ld=gold + -pthread + -fext-numeric-literals + -Wl,-rpath,$ENV{CONDA_PREFIX}/lib) +endif() + + # Append CPP flags set in the third party lib file to the string set in this file. + string(REPLACE ";" " " FLAGS_STR "${thirdPartyCppFlags}") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${FLAGS_STR}" ) + + +# Paths to required executables +find_program(XALAN Xalan REQUIRED) +find_program(LATEX latex) +find_program(DOXYGEN NAME doxygen PATH_SUFFIXES doxygen REQUIRED) +find_program(UIC uic REQUIRED) +find_program(MOC moc REQUIRED) +find_program(RCC rcc REQUIRED) +find_program(PROTOC protoc REQUIRED) + +find_package(Qt5 COMPONENTS + Core + Concurrent + Gui + Multimedia + MultimediaWidgets + Network + OpenGL # Needed to install mesa-common-dev for this! + PrintSupport + Qml + Quick + Script + ScriptTools + Sql + Svg + Test + WebChannel + Widgets + Xml + XmlPatterns + # Search this path explicitly for MacOS OpenGL Framework + PATHS /System/Library/Frameworks/ REQUIRED) + +# Some of these will have non-traditional installs with version numbers in the paths in v007 +# For these, we pass in a version number, and use it in the path suffix +# This only applies to v007, and outside of the building, we should only expect standard installs +# The v007-specific installs are listed beside their find_package calls below: +find_package(Boost 1.59.0 REQUIRED) +find_package(Bullet 2.86 REQUIRED) +find_package(Cholmod 4.4.5 REQUIRED) +find_package(CSPICE 65 REQUIRED) +find_package(Eigen REQUIRED) +find_package(Embree 2.15.0 REQUIRED) +find_package(GeoTIFF 2 REQUIRED) +find_package(GMM 5.0 REQUIRED) +find_package(GSL 19 REQUIRED) +find_package(HDF5 1.8.15 REQUIRED) +find_package(Jama 125 REQUIRED) +find_package(NN REQUIRED) +find_package(OpenCV 3.1.0 REQUIRED) +find_package(PCL 1.8 REQUIRED) +find_package(Protobuf 2.6.1 REQUIRED) +find_package(Qwt 6 REQUIRED) +find_package(SuperLU 4.3 REQUIRED) +find_package(TIFF 4.0.5 REQUIRED) +find_package(TNT 126 REQUIRED) +find_package(XercesC 3.1.2 REQUIRED) +find_package(X11 6 REQUIRED) +find_package(nanoflann REQUIRED) +find_package(PNG REQUIRED) +find_package(Kakadu) +find_package(Geos 3.5.0 REQUIRED) +find_package(Armadillo REQUIRED) + +if(pybindings) + find_package(Python REQUIRED) + find_package(Sip REQUIRED) +endif() + +# Iterate through all variables and extract the libraries and include directories +get_cmake_property(_variableNames VARIABLES) # Get All VARIABLES + +set(ALLLIBDIRS "") +set(ALLLIBS "") +set(ALLINCDIRS "") + +# Get all include dir variables +foreach (_variableName ${_variableNames}) +#message("VAR=${_variableName}") + if (_variableName MATCHES ".+_INCLUDE_DIR$") + list(APPEND ALLINCDIRS "${${_variableName}}") + elseif (_variableName MATCHES ".+_INCLUDE_PATH$") + list(APPEND ALLINCDIRS "${${_variableName}}") + endif(_variableName MATCHES ".+_INCLUDE_DIR$") +endforeach() + +# get all Library variables +foreach (_variableName ${_variableNames}) + get_filename_component(LIBDIR "${${_variableName}}" DIRECTORY) + if (_variableName MATCHES "^CMAKE+") + elseif (_variableName MATCHES ".+_LIB$") + list(APPEND ALLLIBDIRS "${LIBDIR}") + list(APPEND ALLLIBS "${${_variableName}}") + elseif (_variableName MATCHES ".+_LIBRARY$") + list(APPEND ALLLIBDIRS "${LIBDIR}") + list(APPEND ALLLIBS "${${_variableName}}") + elseif (_variableName MATCHES ".+_LIBRARIES$") + list(APPEND ALLLIBDIRS "${LIBDIR}") + list(APPEND ALLLIBS "${${_variableName}}") + endif() +endforeach() + +# Sometimes we add the same lib more than once (especially with LIBDIRS) +list(REMOVE_DUPLICATES ALLLIBDIRS) +list(REMOVE_DUPLICATES ALLLIBS) +list(REMOVE_DUPLICATES ALLINCDIRS) + +#=============================================================================== +#=============================================================================== + +# Set python bindings configuration and set target for generating C++ files +if(pybindings) + message("Configuring Python Bindings") + + if (NOT DEFINED PYINSTALL_DIR) + set(PYINSTALL_DIR ${PYTHON_SITE_PACKAGES_DIR}) + endif() + message(STATUS "PYTHON BINDINGS INSTALL DIR: ${PYINSTALL_DIR}") + + # We need to get the locations for sip files, modules, etc. + set(ISIS_SIP_DIR "${CMAKE_SOURCE_DIR}/sipfiles") + set(ISIS_SIP_MODULE "${CMAKE_SOURCE_DIR}/sipfiles/master.sip") + set(SIP_BUILD_FILE "isispy.sbf") + set(ISIS_SIP_CODE_DIR ${CMAKE_BINARY_DIR}/sipsrc) + + # Create the output directory for the new .CPP files + execute_process(COMMAND mkdir -p "${ISIS_SIP_CODE_DIR}") + + # get list of output files exepected from sip + + # get the PYQT configuration based flags from Python + execute_process(COMMAND ${PYTHON_EXECUTABLE} -c + "from PyQt5.QtCore import PYQT_CONFIGURATION as qtconfigdict;print(qtconfigdict['sip_flags'])" + OUTPUT_VARIABLE PYQT_SIP_FLAGS) + + # CMAKE doesn't handle spaces from python well when piping that into the + # command because of white space and a trailing new line, + # so we turn it into a list + message(STATUS "Getting SIP config...") + message(STATUS "Attempting 'python -c \"from PyQt5.QtCore import PYQT_CONFIGURATION as qtconfigdict; print(qtconfigdict['sip_flags'])\"'") + + if (${PYQT_SIP_FLAGS} STREQUAL "") + message(FATAL_ERROR "print(qtconfigdict['sip_flags']) returned empty string, is sip installed? Python binding can be disabled with pybindings=OFF") + endif() + string(STRIP ${PYQT_SIP_FLAGS} PYQT_SIP_FLAGS) + string(REPLACE " " ";" PYQT_SIP_FLAGS ${PYQT_SIP_FLAGS}) + + message(STATUS "FLAGS: ${PYQT_SIP_FLAGS}") + message(STATUS "Generating C++ code from sip files") + message(STATUS "SIP BUILD FILE: ${SIP_BUILD_FILE}") + message(STATUS "SIP MODULE: ${ISIS_SIP_MODULE}") + message(STATUS "SIP GENERATED CODE DIR: ${ISIS_SIP_CODE_DIR}") + + execute_process(COMMAND ${SIP_BINARY_PATH} -e -o -c ${ISIS_SIP_CODE_DIR} -I ${SIP_DEFAULT_SIP_DIR}/PyQt5 ${PYQT_SIP_FLAGS} ${ISIS_SIP_MODULE}) + + # add target so users can run the command after initial configuration + add_custom_target(sipfiles + COMMAND ${SIP_BINARY_PATH} -e -o -c ${ISIS_SIP_CODE_DIR} -I ${SIP_DEFAULT_SIP_DIR}/PyQt5 ${PYQT_SIP_FLAGS} ${ISIS_SIP_MODULE} + COMMENT "Generating C++ code from sip files") + + file(GLOB SIP_GENERATED_SOURCE_FILES ${ISIS_SIP_CODE_DIR}/*.cpp) + add_library(isispy MODULE ${SIP_GENERATED_SOURCE_FILES}) + target_link_libraries(isispy ${ALLLIBS}) + target_link_libraries(isispy isis3) + set_target_properties(isispy PROPERTIES LINK_DEPENDS isis3 INSTALL_RPATH ${CMAKE_INSTALL_PREFIX}) + add_dependencies(isispy sipfiles) + + install(TARGETS isispy DESTINATION ${PYINSTALL_DIR}) +endif() + + +#=============================================================================== +#=============================================================================== + +# Start setting up the build +# Add extension to find fortran until .so symlink can be added to /usr/lib64 +list(APPEND CMAKE_FIND_LIBRARY_SUFFIXES .so.3 .so.6 .so.5) + +# Allow everything to include the 3rd party libraries +include_directories(SYSTEM ${ALLINCDIRS}) +link_directories(${ALLLIBDIRS}) + +include_directories(${CMAKE_BINARY_DIR}/inc) +set(CORE_LIB_NAME isis3) + +# Specify relative library include paths which will be set up on +# the installed files. +if(APPLE) + set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_RPATH};@loader_path/../lib;@loader_path/../3rdParty/lib") +else() + set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_RPATH};$ORIGIN/../lib;$ORIGIN/../3rdParty/lib") +endif() + +# We will set up some links with these files at the end of the install process so +# make sure they are cleared at the start of the install process. +install(CODE "EXECUTE_PROCESS(COMMAND rm -f ${CMAKE_INSTALL_PREFIX}/lib/libisis3.6.0${SO})") +install(CODE "EXECUTE_PROCESS(COMMAND rm -f ${CMAKE_INSTALL_PREFIX}/lib/libisis3.6${SO})") +install(CODE "EXECUTE_PROCESS(COMMAND rm -f ${CMAKE_INSTALL_PREFIX}/lib/libisis3.${SO})") +EXECUTE_PROCESS(COMMAND cp -f ${CMAKE_SOURCE_DIR}/TestPreferences ${CMAKE_BINARY_DIR}/) +install(CODE "EXECUTE_PROCESS(COMMAND cp -f ${CMAKE_SOURCE_DIR}/src/base/objs/Preference/TestPreferences ${CMAKE_INSTALL_PREFIX}/)") +install(CODE "EXECUTE_PROCESS(COMMAND cp -f ${CMAKE_SOURCE_DIR}/IsisPreferences ${CMAKE_INSTALL_PREFIX}/)") + +# Delete any existing plugin files in the build folder so they +# don't get filled with duplicate entries. +file(GLOB existingPlugins "${CMAKE_BINARY_DIR}/plugins/*.plugin") +if(existingPlugins) + file(REMOVE ${existingPlugins}) +endif() + +# Add a config file to the install bin directory so that QT can find the plugin libraries. +file(WRITE "${CMAKE_BINARY_DIR}/qt.conf" "[Paths]\nPlugins=../3rdParty/plugins/\n") +install(FILES "${CMAKE_BINARY_DIR}/qt.conf" DESTINATION ${CMAKE_INSTALL_PREFIX}/bin/xml) + +#Create the inc directory +execute_process(COMMAND mkdir -p ${CMAKE_BINARY_DIR}/inc) + +# Create an xml folder in the source directory that we will need later +set(sourceXmlFolder ${CMAKE_BINARY_DIR}/bin/xml) +execute_process(COMMAND mkdir -p ${CMAKE_BINARY_DIR}/bin/xml) + +# Set up install of the templates folder. +install(DIRECTORY ${CMAKE_SOURCE_DIR}/templates DESTINATION .) + +# Set up install of the make folder. +install(DIRECTORY ${CMAKE_SOURCE_DIR}/make DESTINATION ${CMAKE_INSTALL_PREFIX}) + +# Have CMake process all of the source code and tests. +add_subdirectory(src objects) + +if(APPLE) + set(SO ".dylib") +else() + set(SO ".so") +endif() + +# Set up documentation build target. +# - This script is called by running "ninja docs". +# - This long call passes all desired variables to the script. +add_custom_target(docs COMMAND ${CMAKE_COMMAND} + -DPROJECT_SOURCE_DIR=${PROJECT_SOURCE_DIR} + -DDOXYGEN=${DOXYGEN} -DXALAN=${XALAN} + -DLATEX=${LATEX} + -DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX} + -P ${CMAKE_MODULE_PATH}/BuildDocs.cmake) + +# Add custom build target to copy modified header files to the build/incs directory. +# ALL is specified so that the target is added to the default build target, i.e. the copy command +# will be executed when running "ninja install" +# On a clean build, all files will be copied over. +add_custom_target(incs ALL COMMAND ${CMAKE_COMMAND} -E copy_if_different + ${CMAKE_SOURCE_DIR}/src/*/objs/*/*.h ${CMAKE_SOURCE_DIR}/src/*/objs/*/*.hpp ${CMAKE_BINARY_DIR}/inc) +add_dependencies(isis3 incs) + +# Add a custom build target to clean out everything that gets added to the source +# directory during the build process. +# - Only a few things are added in order to make the tests work properly so +# this is very straightforward. +add_custom_target(clean_source COMMAND rm -rf "${CMAKE_BINARY_DIR}/*" "${CMAKE_INSTALL_PREFIX}/*") + +# Set up a few top level files for installation. +EXECUTE_PROCESS(COMMAND cp -f ${CMAKE_SOURCE_DIR}/IsisPreferences ${CMAKE_BINARY_DIR}) +EXECUTE_PROCESS(COMMAND cp -rf ${CMAKE_SOURCE_DIR}/scripts ${CMAKE_BINARY_DIR}) +EXECUTE_PROCESS(COMMAND cp -f ${CMAKE_SOURCE_DIR}/license.txt ${CMAKE_BINARY_DIR}) +EXECUTE_PROCESS(COMMAND cp -f ${CMAKE_SOURCE_DIR}/version ${CMAKE_BINARY_DIR}) +EXECUTE_PROCESS(COMMAND cp -rf ${CMAKE_SOURCE_DIR}/make ${CMAKE_BINARY_DIR}) + +# Copy the files on make install as well +install(FILES ${CMAKE_SOURCE_DIR}/IsisPreferences DESTINATION ${CMAKE_INSTALL_PREFIX}) +install(FILES ${CMAKE_SOURCE_DIR}/license.txt DESTINATION ${CMAKE_INSTALL_PREFIX}) +install(FILES ${CMAKE_SOURCE_DIR}/version DESTINATION ${CMAKE_INSTALL_PREFIX}) +install(DIRECTORY ${CMAKE_SOURCE_DIR}/scripts DESTINATION ${CMAKE_INSTALL_PREFIX}) + +# Trigger all post-install behavior. +# - The only way to run commands post-install in CMake is to add a subdirectory at +# the end of this file containing a CMakeLists.txt file which includes all of +# the desired post-install commands inside. +add_subdirectory(cmake) diff --git a/isis/TestPreferences b/isis/TestPreferences new file mode 100644 index 0000000000000000000000000000000000000000..8c0ef67098a0923f7bf7065b0394377225cb5fb1 --- /dev/null +++ b/isis/TestPreferences @@ -0,0 +1,216 @@ +####################################################### +# This file allows the user to customize their Isis +# configuration. See the Isis Preference Dictionary +# on our website isis.astrogeology.usgs.gov for a +# full description of each group. +######################################################## + +######################################################## +# Customize elements of the user interface +# +# ProgressBarPercent = 1 | 2 | 5 | 10 +# ProgressBar = On | Off +# GuiStyle = windows | motif | cde | motifplus | +# platinum | sgi | kde | aqua +# GuiHelpBrowser = { your preferred browser, may need path } +# GuiFontName = helvetica | times | charter | any legal font +# GuiFontSize = 10 | 12 | 14 | any font point size +# HistoryPath = { your preferred loaction for the application +# .par files } +# HistoryRecording = On | Off +# HistoryLength = (your preferred count of history entries +# to remember) +######################################################## + +Group=UserInterface + ProgressBarPercent = 10 + ProgressBar = Off + GuiHelpBrowser = firefox + GuiFontName = helvetica + GuiFontSize = 10 + GuiWidth = 460 + GuiHeight = 600 + HistoryPath = $HOME/.Isis/history + HistoryRecording = Off + HistoryLength = 10 +EndGroup + +######################################################## +# Customize how errors are reported +# +# FileLine = On | Off +# Format = Standard | Pvl +# StackTrace = On | Off +######################################################## + +Group = ErrorFacility + FileLine = Off + Format = Standard + StackTrace = Off +EndGroup + +######################################################## +# Specify which ray-tracing engine to use for shape +# models. +# +# Leave the ShapeModel Group commented-out to continue +# using the ISIS3 default. +# +# RayTraceEngine = Bullet | Embree +# OnError = Continue | Fail +# Tolerance = { numerical value that will be set as the +# tolerance for the Bullet or Embree shape +# model } +# +######################################################## + +#Group = ShapeModel +# RayTraceEngine = Embree +# OnError = Continue +# CubeSupported = False +# Tolerance = DBL_MAX +#EndGroup + +######################################################## +# Customize how session logging is handled +# +# TerminalOutput = On | Off +# On - in command-line mode - user input parameters, +# results, and accounting are +# reported to the terminal. +# Errors are reported in Pvl +# also to the terminal. +# - in interactive mode - same as command-line +# mode, but output is directed +# to the gui. In the case of +# an error, nothing is reported +# to the gui except a pop-up +# window displaying the error. +# Off - in command-line mode - only the results are +# reported to the terminal, or +# in the case of an error, +# the error is reported in Pvl +# to the terminal. +# - in interactive mode - same as command-line mode, +# but the error is reported in +# a pop-up window in the gui. +# FileOutput = On | Off +# FileName = print.prt | /mydirectory/myfile.prt +# FileAccess = Append | Overwrite +######################################################## + +Group = SessionLog + TerminalOutput = Off + FileOutput = On + FileName = print.prt + FileAccess = Append +EndGroup + +######################################################## +# Customize how cubes are created +# +# Overwrite = Error | Allow +# Format = Attached | Detached +# History = On | Off +# MaximumSize = max # of gigabytes +######################################################## + +Group = CubeCustomization + Overwrite = Allow + Format = Attached + History = On + MaximumSize = 12 +EndGroup + +######################################################## +# Customize how other files are created +# +# Overwrite = Error | Allow +# +# If Error, then overwrites of any non-cube +# file will be disallowed and an error will be thrown +######################################################## + +Group = FileCustomization + Overwrite = Allow +EndGroup + +######################################################## +# Customize how Isis uses your computer's resources. +# +# CubeWriteThread = Always | Optimized | Never +# Always - Override Isis program defaults and always +# use a separate thread for writing out cubes. This +# will probably improve performance for some +# programs, will probably negatively impact programs +# that read/write the same file. This option should +# be used with caution. +# Optimized - Let the Isis program decide based on +# it's own internal knowledge. +# Never - Revert to the original method of writing +# cubes always. +# +# GlobalThreads = Optimized | N +# Optimized - The number of global (active processing) +# threads used will match the current system's number +# of CPU cores. +# N - +# Global (processing threads) encapsulate most of Isis' +# CPU-intensive operations. This should be a +# positive whole number greater than 0. This number +# does not cull the number of other thread-types in +# Isis, for example the cube write thread, but it +# should fairly accurately reflect overall potential +# CPU usage in Isis. +######################################################## +Group = Performance + CubeWriteThread = Optimized + GlobalThreads = 2 +EndGroup + +######################################################## +# Customize the location of mission specific data +# files (calibration and spice kernels). Usually this +# should be left to the Isis administrator +######################################################## + +Group = DataDirectory + Apollo15 = $ISIS3DATA/apollo15 + Apollo16 = $ISIS3DATA/apollo16 + Apollo17 = $ISIS3DATA/apollo17 + Base = $ISIS3DATA/base + Cassini = $ISIS3DATA/cassini + Chan1 = $ISIS3DATA/chan1 + Chandrayaan1 = $ISIS3DATA/chandrayaan1 + Clementine1 = $ISIS3DATA/clementine1 + Control = $ISIS3DATA/control + Dawn = $ISIS3DATA/dawn + Galileo = $ISIS3DATA/galileo + Hayabusa = $ISIS3DATA/hayabusa + Hayabusa2 = $ISIS3DATA/hayabusa2 + Juno = $ISIS3DATA/juno + Kaguya = $ISIS3DATA/kaguya + Lo = $ISIS3DATA/lo + Lro = $ISIS3DATA/lro + Mariner10 = $ISIS3DATA/mariner10 + Mer = $ISIS3DATA/mer + Mex = $ISIS3DATA/mex + Messenger = $ISIS3DATA/messenger + Mgs = $ISIS3DATA/mgs + Mro = $ISIS3DATA/mro + Near = $ISIS3DATA/near + NewHorizons = $ISIS3DATA/newhorizons + Odyssey = $ISIS3DATA/odyssey + OsirisRex = $ISIS3DATA/../datalocal/osirisrex + Rolo = $ISIS3DATA/rolo + Rosetta = $ISIS3DATA/rosetta + Smart1 = $ISIS3DATA/smart1 + Tgo = $ISIS3DATA/tgo + Viking1 = $ISIS3DATA/viking1 + Viking2 = $ISIS3DATA/viking2 + Voyager1 = $ISIS3DATA/voyager1 + Voyager2 = $ISIS3DATA/voyager2 + Temporary = . +EndGroup + +End diff --git a/isis/cmake/AddIsisModule.cmake b/isis/cmake/AddIsisModule.cmake new file mode 100644 index 0000000000000000000000000000000000000000..f4a87169d2ef54cc69ac0624b98919caac206a32 --- /dev/null +++ b/isis/cmake/AddIsisModule.cmake @@ -0,0 +1,292 @@ +#=============================================================================== +# Functions to add ISIS modules to the CMake build +#=============================================================================== + +include(CodeGeneration) + +# Incorporate an application folder +function(add_isis_app folder libDependencies) + + # The internal build name will be different than the output name + # - This deals with problems compiling same-named targets on case-insensitive machines. + get_filename_component(appName ${folder} NAME) + set(internalAppName ${appName}_app) + + # Get the source and header files + file(GLOB headers "${folder}/*.h" "${folder}/*.hpp") + file(GLOB sources "${folder}/*.c" "${folder}/*.cpp") + file(GLOB xmlFiles "${folder}/*.xml") + + # All the XML files need to be copied to the install directory + # - They also need be put in the source folder for the app tests + install(FILES ${xmlFiles} DESTINATION "${CMAKE_INSTALL_PREFIX}/bin/xml") + if(NOT EXISTS ${CMAKE_BINARY_DIR}/bin/xml) + execute_process(COMMAND mkdir ${CMAKE_BINARY_DIR}/bin/xml) + endif() + + foreach(xml ${xmlFiles}) + get_filename_component(folder ${xml} DIRECTORY) + get_filename_component(name ${folder} NAME) + if(NOT EXISTS ${CMAKE_BINARY_DIR}/bin/xml/${name}.xml) + execute_process(COMMAND ln -s "${xml}" "${name}.xml" + WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/bin/xml) + endif() + endforeach() + + # Generate required QT files + generate_moc_files(mocFiles ${folder}) + set (CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) + + # Set up the executable + add_executable(${internalAppName} ${headers} ${sources} ${mocFiles}) + set_target_properties(${internalAppName} PROPERTIES LINKER_LANGUAGE CXX) + + # Have the app install with the real name, not the internal name. + target_link_libraries(${internalAppName} ${libDependencies}) + + set_target_properties(${internalAppName} PROPERTIES OUTPUT_NAME ${appName}) + install(TARGETS ${internalAppName} DESTINATION bin) + + if(${buildTests}) + # Set up the app tests + # - There may be multiple test folders in the /tsts directory, each + # with its own Makefile describing the test. + set(testFolder ${folder}/tsts) + file(GLOB tests "${testFolder}/*") + foreach(f ${tests}) + add_makefile_test_folder(${f} ${appName}_app) + endforeach() + endif() +endfunction(add_isis_app) + + +# Set up the lone unit test in an obj folder +function(make_obj_unit_test moduleName testFile truthFile reqLibs pluginLibs) + + # Get the object name (last folder part) + get_filename_component(folder ${testFile} DIRECTORY) + get_filename_component(filename ${folder} NAME) + + # See if there are any plugin libraries that match the name + # - If there are, we need to link to them! + set(matchedLibs) + foreach (f ${pluginLibs}) + if(${f} STREQUAL ${filename}) + set(matchedLibs ${f}) + endif() + endforeach() + + # Generate a name for the executable + set(executableName "${moduleName}_unit_test_${filename}") + + # Create the executable and link it to the module library + add_executable( ${executableName} ${testFile}) + set(depLibs "${reqLibs};${matchedLibs}") + target_link_libraries(${executableName} ${moduleName} ${depLibs}) + + # Call function to add the test + add_unit_test_target(${executableName} ${truthFile} ${moduleName}) + +endfunction(make_obj_unit_test) + + +# Incorporate a single obj folder +function(add_isis_obj folder reqLibs) + + get_filename_component(folderName ${folder} NAME) + + # Look inside this folder for include files + + # Find the source and header files + file(GLOB headers "${folder}/*.h" "${folder}/*.hpp") + file(GLOB sources "${folder}/*.c" "${folder}/*.cpp") + file(GLOB truths "${folder}/*.truth") + file(GLOB plugins "${folder}/*.plugin") + + # Generate protobuf, ui, and moc files if needed. + generate_protobuf_files(protoFiles ${folder}) + generate_ui_files(uiFiles ${folder}) + generate_moc_files(mocFiles ${folder}) + + # Don't include the unit test in the main source list + set(unitTest ${folder}/unitTest.cpp) + list(REMOVE_ITEM sources "${unitTest}") + + # Add the unit test file for this folder if it exists. + if(EXISTS "${unitTest}") + set(thisTestFiles ${unitTest}) + else() + set(thisTestFiles) + endif() + + set(thisSourceFiles ${headers} ${sources} ${protoFiles} ${uiFiles} ${mocFiles}) + set(thisTruthFiles ${truths} ) + + # If there are multiple truth files, select based on the OS. + list(LENGTH thisTestFiles numTest) + list(LENGTH thisTruthFiles numTruth) + if(NOT (${numTest} EQUAL ${numTruth}) ) + + # Look for a truth file that contains the OS string + set(matchedTruth "NONE") + foreach(truthFile ${thisTruthFiles}) + + # If the truth file contains the OS string, use it. + string(FIND ${truthFile} ${osVersionString} position) + if(NOT ${position} EQUAL -1) + set(matchedTruth ${truthFile}) + break() + endif() + + endforeach() + + # If no OS matched, use the default truth file. + if(${matchedTruth} STREQUAL "NONE") + set(matchedTruth "${folder}/${folderName}.truth") + endif() + set(thisTruthFiles ${matchedTruth}) + endif() + + # Always pass the test and truth files to the caller + set(newTestFiles ${thisTestFiles} PARENT_SCOPE) + set(newTruthFiles ${thisTruthFiles} PARENT_SCOPE) + + list(LENGTH plugins numPlugins) + if(${numPlugins} EQUAL 0) + # No plugins, pass the source files back to the caller to add to the larger library. + set(newSourceFiles ${thisSourceFiles} PARENT_SCOPE) + else() + # Folder with a plugin means that this is a separate library! + # Add it here and then we are done with the source files. + + set(newSourceFiles ${thisSourceFiles} PARENT_SCOPE) + if(NOT (${numPlugins} EQUAL 1)) + message( FATAL_ERROR "Error: Multiple plugins found in folder!" ) + endif() + + get_filename_component(libName ${folder} NAME) + get_filename_component(pluginName ${plugins} NAME) + message("Adding plugin library: ${libName}") + + add_library_wrapper(${libName} "${thisSourceFiles}" "${reqLibs}") + + # Append the plugin file to a single file in the build directory + # where the .so files will be created. During installation copy these + # plugin files to the installation library folder. + set(pluginPath ${CMAKE_BINARY_DIR}/lib/${pluginName}) + cat(${plugins} ${pluginPath}) + install(PROGRAMS ${pluginPath} DESTINATION ${CMAKE_INSTALL_PREFIX}/lib/) + # Record this library name for the caller + set(newPluginLib ${libName} PARENT_SCOPE) + endif() + + +endfunction(add_isis_obj) + + + + +# Adds an entire module folder. +# - This includes the "base" folder and all the mission specific folders. +# - Each call of this function generates one library. +function(add_isis_module name) + + # First argument is the module name. + # Arguments after the first are the folders to look in. + set(topFolders ${ARGN}) + + message("Adding ISIS module with folders: ${topFolders}") + + set(objFolders) + set(appFolders) + set(tstFolders) + foreach(f ${topFolders}) + + # Folders: apps, lib, tests + set(objsDir "${CMAKE_CURRENT_LIST_DIR}/${f}/objs") + set(appsDir "${CMAKE_CURRENT_LIST_DIR}/${f}/apps") + set(tstsDir "${CMAKE_CURRENT_LIST_DIR}/${f}/tsts") + + # Start with the objs folder + get_subdirectory_list(${objsDir} thisObjFolders) + get_subdirectory_list(${appsDir} thisAppFolders) + get_subdirectory_list(${tstsDir} thisTstFolders) + + set(objFolders ${objFolders} ${thisObjFolders}) + set(appFolders ${appFolders} ${thisAppFolders}) + set(tstFolders ${tstFolders} ${thisTstFolders}) + + endforeach() + + # Now that we have the library info, call function to add it to the build! + # - Base module depends on 3rd party libs, other libs also depend on base. + # - Only the base module gets both a static and shared library. + if(${name} STREQUAL ${CORE_LIB_NAME}) + set(reqLibs ${ALLLIBS}) + set(alsoStatic ON) + else() + set(reqLibs "${CORE_LIB_NAME};${ALLLIBS}") + set(alsoStatic OFF) + endif() + + set(sourceFiles) + set(unitTestFiles) + set(truthFiles) + set(pluginLibs) + foreach(f ${objFolders}) + set(newSourceFiles) + set(newTestFiles) + set(newTruthFiles) + set(newPluginLib) + add_isis_obj(${f} "${reqLibs}") # Library add function + set(sourceFiles ${sourceFiles} ${newSourceFiles}) + set(unitTestFiles ${unitTestFiles} ${newTestFiles}) + set(truthFiles ${truthFiles} ${newTruthFiles}) + set(pluginLibs ${pluginLibs} ${newPluginLib}) + + endforeach(f) + + # Some modules don't generate a library + list(LENGTH sourceFiles temp) + if (NOT ${temp} EQUAL 0) + message("Adding library: ${name}") + add_library_wrapper(${name} "${sourceFiles}" "${reqLibs}" ${alsoStatic}) + + # Have the plugin libraries depend on the module library + foreach(plug ${pluginLibs}) + target_link_libraries(${plug} ${name}) + endforeach() + + # For everything beyond the module library, require the module library. + set(reqLibs "${reqLibs};${name}") + + if(${buildTests}) + set (CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/unitTest) + + # Now that the library is added, add all the unit tests for it. + list(LENGTH unitTestFiles temp) + math(EXPR numTests "${temp} - 1") + foreach(val RANGE ${numTests}) + list(GET unitTestFiles ${val} testFile ) + list(GET truthFiles ${val} truthFile) + + make_obj_unit_test(${name} ${testFile} ${truthFile} "${reqLibs}" "${pluginLibs}") + endforeach() + endif() + + endif() + + # Process the apps (core library always required) + foreach(f ${appFolders}) + add_isis_app(${f} "${reqLibs}") + endforeach() + + if(${buildTests}) + # Process the tests + # - The test suite in qisis/SquishTests are not properly located or handled by this code! + foreach(f ${tstFolders}) + add_makefile_test_folder(${f} ${name}_module) + endforeach() + endif() + +endfunction(add_isis_module) diff --git a/isis/cmake/BuildDocs.cmake b/isis/cmake/BuildDocs.cmake new file mode 100644 index 0000000000000000000000000000000000000000..64f5dc58f139110c583c22960be26a7ce1ccfd2b --- /dev/null +++ b/isis/cmake/BuildDocs.cmake @@ -0,0 +1,519 @@ +#============================================================================== +# File for building the ISIS documentation. +# - This is one of the most complicated parts of the build system! +# It makes heavy use of the Xalan XML tool and also requires Latex and Doxygen. +# - This file is called as a stand-alone script when "make docs" is executed. +#============================================================================== + + +cmake_minimum_required(VERSION 3.3) + +list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake") +list(APPEND CMAKE_PREFIX_PATH "${PROJECT_SOURCE_DIR}/cmake") +include(Utilities) + +# Set up Xalan's command-line option names. +set(XALAN_VALIDATE_OPTION "-v") +set(XALAN_OUTFILE_OPTION "-o") +set(XALAN_PARAM_OPTION "-p") +set(XALAN_INFILE_OPTION "" ) +set(XALAN_XSL_OPTION "" ) + +# TODO: How should this be set? +set(MODE "") + + +#------------------------------------------------------------------------ + + +# Populate application doc files into "isis/doc/Application/presentation" +function(copy_app_docs_info) + + # Go through all application folders, copy .xml and assets + get_subdirectory_list("${PROJECT_SOURCE_DIR}/src" moduleFolders) + foreach(f ${moduleFolders}) + get_filename_component(moduleName ${f} NAME_WE) + + # Only need to process app folders, not obj folders. + if ((${moduleName} STREQUAL "docsys") OR (NOT EXISTS "${f}/apps")) + continue() # Skip this folder + endif() + + file(MAKE_DIRECTORY ${appDataFolder}/${moduleName}) + + get_subdirectory_list(${f}/apps appFolders) + foreach(appF ${appFolders}) + # Each app gets its own folder in the build directory + get_filename_component(appName ${appF} NAME_WE) + set(thisDataFolder ${appDataFolder}/${moduleName}/${appName}) + file(MAKE_DIRECTORY ${thisDataFolder}) + + # Copy the .xml file and the asset folder if it exists. + copy_file(${appF}/${appName}.xml ${thisDataFolder}/${appName}.xml) + if(EXISTS ${appF}/assets) + copy_folder(${appF}/assets ${thisDataFolder}) + endif() + endforeach() # End loop through apps + + endforeach() # End loop through modules + +endfunction(copy_app_docs_info) + + + + + +# Build the top level of the documents directory +function(build_upper_level) + + # Copy existing folders to the install directory + copy_folder(${docBuildFolder}/assets ${docInstallFolder}) + copy_folder(${docBuildFolder}/w3c ${docInstallFolder}) + + # Make new (empty) output folders + set(newFolders UserDocs AboutIsis General Guides Installation TechnicalInfo) + foreach(f ${newFolders}) + file(MAKE_DIRECTORY "${docInstallFolder}/${f}") + endforeach() + + # These folders are populated inside "build_documents_folder" + + # Create index.html file + execute_process(COMMAND ${XALAN} ${XALAN_VALIDATE_OPTION} ${XALAN_PARAM_OPTION} menuPath \"\" ${XALAN_OUTFILE_OPTION} ${docInstallFolder}/index.html ${XALAN_INFILE_OPTION} ${docBuildFolder}/build/homepage.xml ${XALAN_XSL_OPTION} ${docBuildFolder}/build/main.xsl) + + # This folder just gets copied as-is + execute_process(COMMAND cp -r ${PROJECT_SOURCE_DIR}/src/docsys/Schemas ${docInstallFolder}/Schemas) + +endfunction(build_upper_level) + + + + + +# Build src/docsys/documents folder. +function(build_documents_folder) + + message("Building documents folder...") + message(" Building table of contents XML...") + + # Create RealeaseNotes.xml, ApiChanges.xml and ParameterChanges.xml if need-be + if(EXISTS "${docBuildFolder}/documents/ReleaseNotes/ReleaseNotesList.xml") + execute_process(COMMAND ${XALAN} ${XALAN_PARAM_OPTION} dirParam \"ReleaseNotes\" ${XALAN_INFILE_OPTION} ${docBuildFolder}/documents/ReleaseNotes/ReleaseNotesList.xml ${XALAN_XSL_OPTION} ${docBuildFolder}/build/ReleaseNotes.xsl OUTPUT_FILE ${docBuildFolder}/documents/ReleaseNotes/ReleaseNotes.xml) + execute_process(COMMAND ${XALAN} ${XALAN_PARAM_OPTION} dirParam \"ParameterChanges\" ${XALAN_INFILE_OPTION} ${docBuildFolder}/documents/ReleaseNotes/ReleaseNotesList.xml ${XALAN_XSL_OPTION} ${docBuildFolder}/build/ParameterChanges.xsl OUTPUT_FILE ${docBuildFolder}/documents/ParameterChanges/ParameterChanges.xml) + execute_process(COMMAND ${XALAN} ${XALAN_PARAM_OPTION} dirParam \"ApiChanges\" ${XALAN_INFILE_OPTION} ${docBuildFolder}/documents/ReleaseNotes/ReleaseNotesList.xml ${XALAN_XSL_OPTION} ${docBuildFolder}/build/ApiChanges.xsl OUTPUT_FILE ${docBuildFolder}/documents/ApiChanges/ApiChanges.xml) + else() + # Confirm that empty directories are not going to be traversed in loops coming up + message(" ReleaseNotesList.xml does not exist. Removing ReleaseNotes/ ParameterChanges/ and ApiChanges/ directories...") + execute_process(COMMAND rm -rf ${docBuildFolder}/documents/ReleaseNotes ${docBuildFolder}/documents/ParameterChanges ${docBuildFolder}/documents/ApiChanges) + endif() + + # Get list of folders of interest + get_subdirectory_list(${docBuildFolder}/documents docFolders) + + # Build doctoc.xml, the documents table of contents file. + set(doctocPath ${docBuildFolder}/build/doctoc.xml) + file(REMOVE ${doctocPath}) + cat(${docBuildFolder}/build/doctoc_header.xml ${doctocPath}) + foreach(f ${docFolders}) + + # Each folder in documents gets a section added to doctoc + get_filename_component(docName ${f} NAME_WE) + + execute_process(COMMAND ${XALAN} ${XALAN_PARAM_OPTION} dirParam \"${docName}\" ${XALAN_INFILE_OPTION} ${f}/${docName}.xml ${XALAN_XSL_OPTION} ${docBuildFolder}/build/IsisDocumentTOCbuild.xsl OUTPUT_VARIABLE result) + file(APPEND ${doctocPath} ${result}) + + endforeach() + cat(${docBuildFolder}/build/doctoc_footer.xml ${doctocPath}) + + # Write out a modified .xsl file with the correct location of the Xalan executable. + set(modDocBuildXslFile ${docBuildFolder}/build/IsisInlineDocumentBuild_mod.xsl) + file(READ ${PROJECT_SOURCE_DIR}/scripts/IsisInlineDocumentBuild_mod.xsl xslContents) + string(REPLACE XALAN_BIN_LOCATION ${XALAN} xslContents "${xslContents}") + file(WRITE ${modDocBuildXslFile} "${xslContents}") + + # Build individual documents folders + message(" Building individual documents...") + file(MAKE_DIRECTORY ${docInstallFolder}/documents) + foreach(f ${docFolders}) + + message("Building documents folder: ${f}") + + # Handle paths for this folder + get_filename_component(docName ${f} NAME_WE) + set(thisOutputFolder ${docInstallFolder}/documents/${docName}) + file(MAKE_DIRECTORY ${thisOutputFolder}) + + # Use Xalan to generate an intermediate makefile, then execute that makefile + # to generate the output documentation files. + + set(xalanCommand ${XALAN} ${XALAN_PARAM_OPTION} menuPath "../../" ${XALAN_PARAM_OPTION} dirParam "'${docName}'" ${XALAN_OUTFILE_OPTION} ${f}/Makefile_temp ${XALAN_INFILE_OPTION} ${docName}.xml ${XALAN_XSL_OPTION} ${modDocBuildXslFile}) + execute_process(COMMAND ${xalanCommand} WORKING_DIRECTORY ${f}) + + execute_process(COMMAND make -f Makefile_temp docs WORKING_DIRECTORY ${f}) + execute_process(COMMAND rm -f ${f}/Makefile_temp) # Clean up + + # Copy all generated html files and any assets to the install folder + file(GLOB htmlFiles ${f}/*.html) + file(COPY ${htmlFiles} DESTINATION ${thisOutputFolder}) + if(EXISTS "${f}/assets") + copy_folder(${f}/assets ${thisOutputFolder}/assets) + endif() + if(EXISTS "${f}/images") + copy_folder(${f}/images ${thisOutputFolder}/images) + endif() + + endforeach() + + message(" Building table of contents files...") + # These go in top level folders in /doc/ + + # ABOUT ISIS TOC + execute_process(COMMAND ${XALAN} ${XALAN_PARAM_OPTION} menuPath \"../\" ${XALAN_OUTFILE_OPTION} ${docInstallFolder}/AboutIsis/index.html ${XALAN_INFILE_OPTION} ${doctocPath} ${XALAN_XSL_OPTION} ${docBuildFolder}/build/AboutIsis.xsl) + + # GENERAL TOC + execute_process(COMMAND ${XALAN} ${XALAN_PARAM_OPTION} menuPath \"../\" ${XALAN_OUTFILE_OPTION} ${docInstallFolder}/General/index.html ${XALAN_INFILE_OPTION} ${doctocPath} ${XALAN_XSL_OPTION} ${docBuildFolder}/build/General.xsl) + + # GUIDES TOC + execute_process(COMMAND ${XALAN} ${XALAN_PARAM_OPTION} menuPath \"../\" ${XALAN_OUTFILE_OPTION} ${docInstallFolder}/Guides/index.html ${XALAN_INFILE_OPTION} ${doctocPath} ${XALAN_XSL_OPTION} ${docBuildFolder}/build/Guides.xsl) + + # INSTALLATION TOC + execute_process(COMMAND ${XALAN} ${XALAN_PARAM_OPTION} menuPath \"../\" ${XALAN_OUTFILE_OPTION} ${docInstallFolder}/Installation/index.html ${XALAN_INFILE_OPTION} ${doctocPath} ${XALAN_XSL_OPTION} ${docBuildFolder}/build/Installation.xsl) + + # TECHNICAL INFO TOC + execute_process(COMMAND ${XALAN} ${XALAN_PARAM_OPTION} menuPath \"../\" ${XALAN_OUTFILE_OPTION} ${docInstallFolder}/TechnicalInfo/index.html ${XALAN_INFILE_OPTION} ${doctocPath} ${XALAN_XSL_OPTION} ${docBuildFolder}/build/TechnicalInfo.xsl) + + # USER DOCS TOC + execute_process(COMMAND ${XALAN} ${XALAN_PARAM_OPTION} menuPath \"../\" ${XALAN_OUTFILE_OPTION} ${docInstallFolder}/UserDocs/index.html ${XALAN_INFILE_OPTION} ${doctocPath} ${XALAN_XSL_OPTION} ${docBuildFolder}/build/UserDocs.xsl) + +endfunction(build_documents_folder) + + + + + +# Supporting files should already be in /src/docsys/Application +function(build_application_docs) + + # Is there any reason not to just generate all these files from their original + # locations instead of copying them to a temporary build directory? + + set(appFolder "${docBuildFolder}/Application") + set(printerStyleFolder "${appFolder}/presentation/PrinterFriendly/styles") + set(tabbedStyleFolder "${appFolder}/presentation/Tabbed/styles") + + set(installAppFolder "${docInstallFolder}/Application") + set(installPrinterFolder "${installAppFolder}/presentation/PrinterFriendly") + set(installTabbedFolder "${installAppFolder}/presentation/Tabbed") + + # Make output directories and copy the styles + file(MAKE_DIRECTORY "${installPrinterFolder}") + file(MAKE_DIRECTORY "${installTabbedFolder}") + file(MAKE_DIRECTORY "${installPrinterFolder}/styles") + file(MAKE_DIRECTORY "${installTabbedFolder}/styles") + copy_wildcard("${printerStyleFolder}/*.css" ${installPrinterFolder}/styles/) + copy_wildcard("${tabbedStyleFolder}/*.css" ${installTabbedFolder}/styles/ ) + + # Loop through module folders + get_subdirectory_list(${appDataFolder} moduleFolders) + foreach(mod ${moduleFolders}) + get_filename_component(moduleName ${mod} NAME) + + # Loop through application folders + get_subdirectory_list(${mod} appDataFolders) + foreach(f ${appDataFolders}) + get_filename_component(appName ${f} NAME) + + # Get printer-friendly and tabbed output folders + set(pfAppFolder ${installPrinterFolder}/${appName}) + set(tbAppFolder ${installTabbedFolder}/${appName}) + file(MAKE_DIRECTORY "${pfAppFolder}") + file(MAKE_DIRECTORY "${tbAppFolder}") + + if(EXISTS ${f}/assets) + copy_folder(${f}/assets ${pfAppFolder}) + copy_folder(${f}/assets ${tbAppFolder}) + endif() + + execute_process(COMMAND ${XALAN} ${XALAN_PARAM_OPTION} menuPath \"../../../../\" ${XALAN_OUTFILE_OPTION} ${pfAppFolder}/${appName}.html ${XALAN_INFILE_OPTION} ${f}/${appName}.xml ${XALAN_XSL_OPTION} ${printerStyleFolder}/IsisApplicationDocStyle.xsl) + execute_process(COMMAND ${XALAN} ${XALAN_PARAM_OPTION} menuPath \"../../../../\" ${XALAN_OUTFILE_OPTION} ${tbAppFolder}/${appName}.html ${XALAN_INFILE_OPTION} ${f}/${appName}.xml ${XALAN_XSL_OPTION} ${tabbedStyleFolder}/IsisApplicationDocStyle.xsl) + + endforeach() # End loop through app folders + + endforeach() # End loop through module folders + + # Make the table of contents that goes in the /bin/xml folder + + # Set up the file + set(appTocPath "${CMAKE_INSTALL_PREFIX}/bin/xml/applicationTOC.xml") + file(REMOVE ${appTocPath}) + cat(${docBuildFolder}/Application/build/toc_header.xml ${appTocPath}) + get_subdirectory_list(${appDataFolder} moduleFolders) + + # Loop through module folders + foreach(mod ${moduleFolders}) + get_filename_component(moduleName ${mod} NAME_WE) + + # Loop through application folders + get_subdirectory_list(${mod} appDataFolders) + foreach(f ${appDataFolders}) + + get_filename_component(docName ${f} NAME_WE) + + # Use Xalan to generate a piece of the TOC and append it to the file + execute_process(COMMAND ${XALAN} ${XALAN_INFILE_OPTION} ${f}/${docName}.xml ${XALAN_XSL_OPTION} ${docBuildFolder}/Application/build/IsisApplicationTOCbuild.xsl OUTPUT_VARIABLE result) + file(APPEND ${appTocPath} ${result}) + endforeach() + endforeach() + + # Append the footer to complete the TOC file! + cat(${docBuildFolder}/Application/build/toc_footer.xml ${appTocPath}) + +endfunction(build_application_docs) + + + + + +# Use the application TOC file to build some other TOCs +function(add_extra_tocs) + + set(TOCDIR "${docInstallFolder}/Application") + set(buildFolder "${docBuildFolder}/Application/build") + set(tocXml "${CMAKE_INSTALL_PREFIX}/bin/xml/applicationTOC.xml") + + # Build alpha.html + execute_process(COMMAND ${XALAN} ${XALAN_PARAM_OPTION} menuPath \"../\" ${XALAN_OUTFILE_OPTION} ${TOCDIR}/alpha.html ${XALAN_INFILE_OPTION} ${tocXml} ${XALAN_XSL_OPTION} ${buildFolder}/TOCindex_alpha.xsl) + + # Build index.html + execute_process(COMMAND ${XALAN} ${XALAN_PARAM_OPTION} menuPath \"../\" ${XALAN_OUTFILE_OPTION} ${TOCDIR}/index.html ${XALAN_INFILE_OPTION} ${tocXml} ${XALAN_XSL_OPTION} ${buildFolder}/TOCindex_category.xsl) + + # Build oldvnew.html + execute_process(COMMAND ${XALAN} ${XALAN_PARAM_OPTION} menuPath \"../\" ${XALAN_OUTFILE_OPTION} ${TOCDIR}/oldvnew.html ${XALAN_INFILE_OPTION} ${tocXml} ${XALAN_XSL_OPTION} ${buildFolder}/TOCindex_oldvnew.xsl) + + # Build applicationCategories.xml + execute_process(COMMAND ${XALAN} ${XALAN_OUTFILE_OPTION} ${CMAKE_INSTALL_PREFIX}/bin/xml/applicationCategories.xml ${XALAN_INFILE_OPTION} ${docBuildFolder}/Schemas/Application/application.xsd ${XALAN_XSL_OPTION} ${buildFolder}/IsisApplicationCategoriesbuild.xsl) + +endfunction(add_extra_tocs) + + + + + +# Set up three Doxygen configuration files +function(build_object_conf) + + message("Building apps configuration...") + + # Make a list of each object folder with an assets folder + get_subdirectory_list(moduleFolders ${PROJECT_SOURCE_DIR}) + set(OBJECTASSETS) + foreach(mod ${moduleFolders}) + get_subdirectory_list(objFolders ${mod}/objs) + foreach(obj ${objFolders}) + if(EXISTS ${obj}/assets) + set(OBJECTASSETS ${OBJECTASSETS} ${obj}/assets) + endif() + endforeach() # End obj loop + endforeach() # End module loop + + set(objConfDir ${docBuildFolder}/src/docsys/Object/build) + file(MAKE_DIRECTORY ${objConfDir}/apps) + + # The three conf files start from an input base file and append more options + set(appsConf ${objConfDir}/apps_tag_temp.conf ) + set(programmerConf ${objConfDir}/Programmer_temp.conf) + set(developerConf ${objConfDir}/Developer_temp.conf ) + set(docInstallDir ${docInstallFolder}/Object ) + + # Copy settings files from the source folder to the build folder + copy_wildcard("${PROJECT_SOURCE_DIR}/src/docsys/Object/build/*" ${objConfDir}) + + # Append to the app conf file + # apps_tag.conf doesnt exist? + cat(${objConfDir}/apps_tag.conf ${appsConf}) + file(APPEND ${appsConf} "LATEX_CMD_NAME = ${LATEX}\n") + file(APPEND ${appsConf} "OUTPUT_DIRECTORY = ${docInstallDir}\n") + file(APPEND ${appsConf} "STRIP_FROM_PATH = ${PROJECT_SOURCE_DIR}/\n") + file(APPEND ${appsConf} "INPUT = ${PROJECT_SOURCE_DIR}/src/ ${objConfDir}/isisDoxyDefs.doxydef\n") + file(APPEND ${appsConf} "HTML_HEADER = ${objConfDir}/IsisObjectHeader.html\n") + file(APPEND ${appsConf} "HTML_FOOTER = ${objConfDir}/IsisObjectFooter.html\n") + file(APPEND ${appsConf} "PROJECT_LOGO = ${docBuildFolder}/assets/icons/USGS_logo55h.png\n") + file(APPEND ${appsConf} "HTML_OUTPUT = apps\n") + + if(NOT ${DOT_PATH} STREQUAL "") + file(APPEND ${appsConf} "DOT_PATH = /opt/local/bin\n") + endif() + + # Append to the programmer conf file + cat(${objConfDir}/Programmer.conf ${programmerConf}) + file(APPEND ${programmerConf} "OUTPUT_DIRECTORY = ${docInstallDir}\n") + file(APPEND ${programmerConf} "FILE_PATTERNS = *objs*.h") + file(APPEND ${programmerConf} " *objs*.cpp") + file(APPEND ${programmerConf} " *build/isisDoxyDefs.doxydef\n") + file(APPEND ${programmerConf} "STRIP_FROM_PATH = ${PROJECT_SOURCE_DIR}/\n") + file(APPEND ${programmerConf} "INPUT = ${PROJECT_SOURCE_DIR}/src/ ${objConfDir}/isisDoxyDefs.doxydef\n") + file(APPEND ${programmerConf} "HTML_HEADER = ${objConfDir}/IsisObjectHeader.html\n") + file(APPEND ${programmerConf} "HTML_FOOTER = ${objConfDir}/IsisObjectFooter.html\n") + file(APPEND ${programmerConf} "PROJECT_LOGO = ${docBuildFolder}/assets/icons/USGS_logo55h.png\n") + file(APPEND ${programmerConf} "HTML_OUTPUT = Programmer\n") + file(APPEND ${programmerConf} "IMAGE_PATH = \n") + + string(FIND "${MODE}" "LOUD" pos) + if (NOT ${pos} STREQUAL "-1") + file(APPEND ${programmerConf} "QUIET = NO\n") + file(APPEND ${programmerConf} "WARNINGS = YES\n") + file(APPEND ${programmerConf} "WARN_IF_UNDOCUMENTED = NO\n") + file(APPEND ${programmerConf} "WARN_IF_DOC_ERROR = YES\n") + file(APPEND ${programmerConf} "WARN_NO_PARAMDOC = YES\n") + else() + file(APPEND ${programmerConf} "QUIET = YES\n") + file(APPEND ${programmerConf} "WARN_IF_UNDOCUMENTED = NO\n") + file(APPEND ${programmerConf} "WARN_IF_DOC_ERROR = YES\n") + file(APPEND ${programmerConf} "WARN_NO_PARAMDOC = YES\n") + endif() + + if (NOT ${DOT_PATH} STREQUAL "") + file(APPEND ${programmerConf} "DOT_PATH = /opt/local/bin\n") + endif() + + foreach(dirname ${OBJECTASSETS}) + file(APPEND ${programmerConf} "${dirname} \\\n") + endforeach() + + # Append to the developer conf file + cat(${objConfDir}/Developer.conf ${developerConf}) + file(APPEND ${developerConf} "LATEX_CMD_NAME = ${LATEX}\n") + file(APPEND ${developerConf} "OUTPUT_DIRECTORY = ${docInstallDir}\n") + file(APPEND ${developerConf} "STRIP_FROM_PATH = ${CMAKE_INSTALL_PREFIX}/\n") + file(APPEND ${developerConf} "INPUT = ${PROJECT_SOURCE_DIR}/src/ ${objConfDir}/isisDoxyDefs.doxydef\n") + file(APPEND ${developerConf} "HTML_HEADER = ${objConfDir}/IsisObjectHeader.html\n") + file(APPEND ${developerConf} "HTML_FOOTER = ${objConfDir}/IsisObjectFooter.html\n") + file(APPEND ${developerConf} "PROJECT_LOGO = ${docBuildFolder}/assets/icons/USGS_logo55h.png\n") + file(APPEND ${developerConf} "HTML_OUTPUT = Developer\n") + file(APPEND ${developerConf} "IMAGE_PATH = \n") + string(FIND "${MODE}" "LOUD" pos) + if (NOT ${pos} STREQUAL "-1") + file(APPEND ${developerConf} "QUIET = NO\n") + file(APPEND ${developerConf} "WARNINGS = YES\n") + file(APPEND ${developerConf} "WARN_IF_UNDOCUMENTED = NO\n") + file(APPEND ${developerConf} "WARN_IF_DOC_ERROR = YES\n") + file(APPEND ${developerConf} "WARN_NO_PARAMDOC = YES\n") + else() + file(APPEND ${developerConf} "QUIET = YES\n") + file(APPEND ${developerConf} "WARNINGS = NO\n") + file(APPEND ${developerConf} "WARN_IF_UNDOCUMENTED = NO\n") + file(APPEND ${developerConf} "WARN_IF_DOC_ERROR = NO\n") + file(APPEND ${developerConf} "WARN_NO_PARAMDOC = NO\n") + endif() + + foreach(dirname ${OBJECTASSETS}) + file(APPEND ${developerConf} "${dirname} \\\n") + endforeach() + +endfunction(build_object_conf) + + + + +# Build doxygen output for ISIS code +function(build_object_docs) + + # Create app, developer, and programmer Doxygen configuration files. + build_object_conf() + + # TODO: Do prog_tester conf here as well? + + set(objConfDir ${docBuildFolder}/src/docsys/Object/build) + + message("Copying object assets...") + file(MAKE_DIRECTORY "${docInstallFolder}/Object") + execute_process(COMMAND cp -r ${docBuildFolder}/Object/assets ${docInstallFolder}/Object/) + + + message("Creating Object Documentation") + file(MAKE_DIRECTORY ${docInstallFolder}/Object/apps) + file(MAKE_DIRECTORY ${docInstallFolder}/Object/Developer) + file(MAKE_DIRECTORY ${docInstallFolder}/Object/Programmer) + file(MAKE_DIRECTORY ${docInstallFolder}/documents/DocStyle/assets) + copy_wildcard("${docBuildFolder}/Object/*.html" ${docInstallFolder}/Object/) + #copy_file(${objBuildDir}/isisDoxyDefs.doxydef ${docInstallFolder}/documents/DocStyle/assets/isisDoxyDefs.doxydef) + + + message("Building Apps documentation..") + execute_process(COMMAND ${DOXYGEN} "${objConfDir}/apps_tag_temp.conf" + WORKING_DIRECTORY ${docBuildFolder}/src/docsys/Object/) + message("Finished building Apps documentation.") + + message("Building Programmer documentation...") + execute_process(COMMAND ${DOXYGEN} "${objConfDir}/Programmer_temp.conf" + WORKING_DIRECTORY ${docBuildFolder}/src/docsys/Object/) + message("Finished building Programmer documentation.") + + message("Building Developer documentation...") + execute_process(COMMAND ${DOXYGEN} "${objConfDir}/Developer_temp.conf" + WORKING_DIRECTORY ${docBuildFolder}/src/docsys/Object/) + message("Finished building Developer documentation.") + +endfunction(build_object_docs) + + + + + +# Build all the documentation +function(build_docs) + + message("Building Isis Documentation...") + + # Set up output directory and a temporary directory for building + set(docBuildFolder ${CMAKE_BINARY_DIR}/docBuild) + set(appDataFolder ${docBuildFolder}/Application/data) + set(docInstallFolder ${CMAKE_BINARY_DIR}/docs) # Final output documentation + + # Clean up existing files + execute_process(COMMAND rm -rf ${docBuildFolder}) + execute_process(COMMAND rm -rf ${docInstallFolder}) + + message("XALAN = ${XALAN}") + message("DOXYGEN = ${DOXYGEN}") + message("LATEX = ${LATEX}") + + # Copy everything from src/docsys to docBuildFolder + execute_process(COMMAND cp -r ${PROJECT_SOURCE_DIR}/src/docsys ${docBuildFolder}) + + file(MAKE_DIRECTORY "${docBuildFolder}/Application") + file(MAKE_DIRECTORY "${docBuildFolder}/Application/data") + file(MAKE_DIRECTORY "${docInstallFolder}") + + message("Copying application information...") + copy_app_docs_info() + + message("Building upper level directories...") + build_upper_level() + + build_documents_folder() + + message("Building application docs...") + build_application_docs() + + message("Building additional TOCs...") + add_extra_tocs() + + # This step requires Latex and Doxygen + message("Building object documentation") + build_object_docs() + + # copy the built docs in the build directory over to the install directory on install + execute_process(COMMAND cp -rf ${docInstallFolder} ${CMAKE_INSTALL_PREFIX}) + + message("Finished building object documentation!") + + +endfunction(build_docs) + + + + +# This file gets called as a script, so call this function to run +# all the code in the file. +build_docs() diff --git a/isis/cmake/CMakeFiles/CMakeDirectoryInformation.cmake b/isis/cmake/CMakeFiles/CMakeDirectoryInformation.cmake new file mode 100644 index 0000000000000000000000000000000000000000..67565806264baf0177c6b7b6561fa722e33cf643 --- /dev/null +++ b/isis/cmake/CMakeFiles/CMakeDirectoryInformation.cmake @@ -0,0 +1,16 @@ +# CMAKE generated file: DO NOT EDIT! +# Generated by "Unix Makefiles" Generator, CMake Version 3.9 + +# Relative path conversion top directories. +set(CMAKE_RELATIVE_PATH_TOP_SOURCE "/scratch/isiscmake/isis") +set(CMAKE_RELATIVE_PATH_TOP_BINARY "/scratch/isiscmake/isis") + +# Force unix paths in dependencies. +set(CMAKE_FORCE_UNIX_PATHS 1) + + +# The C and CXX include file regular expressions for this directory. +set(CMAKE_C_INCLUDE_REGEX_SCAN "^.*$") +set(CMAKE_C_INCLUDE_REGEX_COMPLAIN "^$") +set(CMAKE_CXX_INCLUDE_REGEX_SCAN ${CMAKE_C_INCLUDE_REGEX_SCAN}) +set(CMAKE_CXX_INCLUDE_REGEX_COMPLAIN ${CMAKE_C_INCLUDE_REGEX_COMPLAIN}) diff --git a/isis/cmake/CMakeFiles/progress.marks b/isis/cmake/CMakeFiles/progress.marks new file mode 100644 index 0000000000000000000000000000000000000000..573541ac9702dd3969c9bc859d2b91ec1f7e6e56 --- /dev/null +++ b/isis/cmake/CMakeFiles/progress.marks @@ -0,0 +1 @@ +0 diff --git a/isis/cmake/CMakeLists.txt b/isis/cmake/CMakeLists.txt new file mode 100644 index 0000000000000000000000000000000000000000..85bfcdc541d056a33eb5a493608b399b900e795c --- /dev/null +++ b/isis/cmake/CMakeLists.txt @@ -0,0 +1,21 @@ +# This file contains everything that should be exectuted AFTER the installation +# step has completed. + +message("Setting up post-install behavior...") + +# Set up format version numbers for the main shared library on install +install(CODE "EXECUTE_PROCESS(COMMAND cp -f ${CMAKE_BINARY_DIR}/lib/libisis3${SO} ${CMAKE_INSTALL_PREFIX}/lib/libisis3.5.0${SO})") +install(CODE "EXECUTE_PROCESS(COMMAND ln -sf libisis3.5.0${SO} ${CMAKE_INSTALL_PREFIX}/lib/libisis3.5${SO})") +install(CODE "EXECUTE_PROCESS(COMMAND ln -sf libisis3.5${SO} ${CMAKE_INSTALL_PREFIX}/lib/libisis3${SO})") +install(CODE "EXECUTE_PROCESS(COMMAND ln -sf libisis3${SO} ${CMAKE_INSTALL_PREFIX}/lib/libisis${SO})") + +# On OSX, need to correct all the paths encoded in each of the distributed library files so +# that they properly find the distruted files using relative paths. +if (APPLE) + # Also need to get the plugin folders + get_subdirectory_list(${CMAKE_SOURCE_DIR}/3rdParty/plugins pluginFolders) + foreach(f ${pluginFolders}) + get_filename_component(name ${f} NAME) + install(CODE "EXECUTE_PROCESS(COMMAND python ${CMAKE_SOURCE_DIR}/scripts/finalizeInstalledOsxRpaths.py ${CMAKE_INSTALL_PREFIX}/3rdParty/plugins/${name} resetRpath)") + endforeach() +endif() diff --git a/isis/cmake/CTestTestfile.cmake b/isis/cmake/CTestTestfile.cmake new file mode 100644 index 0000000000000000000000000000000000000000..d19043d1b2c790da1feda3153854760881a4e0f1 --- /dev/null +++ b/isis/cmake/CTestTestfile.cmake @@ -0,0 +1,6 @@ +# CMake generated Testfile for +# Source directory: /scratch/isiscmake/isis/cmake +# Build directory: /scratch/isiscmake/isis/cmake +# +# This file includes the relevant testing commands required for +# testing this directory and lists subdirectories to be tested as well. diff --git a/isis/cmake/CodeGeneration.cmake b/isis/cmake/CodeGeneration.cmake new file mode 100644 index 0000000000000000000000000000000000000000..9f48041afcb693e5217fa516c90f1553f6e5e157 --- /dev/null +++ b/isis/cmake/CodeGeneration.cmake @@ -0,0 +1,138 @@ +#================================================================== +# Contains functions for generating code files +#================================================================== + +# TODO: Can we consolidate the following three functions? + + +# Generate ui_*.h files from *.ui files using QT tool uic. +# - ${UIC} must point to the uic tool +function( generate_ui_files uiGenOut folder) + + # Finds all .ui files in the current dir + file(GLOB uiInput "${folder}/*.ui") + + # If no .ui files in this folder we are finished. + list(LENGTH uiInput numFiles) + if (${numFiles} EQUAL 0) + set(${uiGenOut} "" PARENT_SCOPE) + return() + endif() + + # Set where generated files go to and add that directory to the include path + get_code_gen_dir(${folder} uiGenDir) + + # For each input ui file + foreach(uiFile ${uiInput}) + # Get the name of the file without extension + get_filename_component(uiName ${uiFile} NAME_WE) + + # Add the generated file to UI_GEN variable + set(outUiFile "${uiGenDir}/ui_${uiName}.h") + set(uiGen ${uiGen} ${outUiFile}) + + # Add the custom command that will generate this file + # - The generated files will be put in the CMake build directory, + # not the source tree + add_custom_command(OUTPUT ${outUiFile} + COMMAND ${UIC} ${uiFile} -o ${outUiFile} && cp ${outUiFile} ${CMAKE_BINARY_DIR}/inc + DEPENDS ${uiFile} + WORKING_DIRECTORY ${folder} + COMMENT "Generating UI headers...") + endforeach() + + + set(${uiGenOut} ${uiGen} PARENT_SCOPE) # Set up output variable + +endfunction() + + + + +# Generate moc_*.cpp files from *.h files using Q_OBJECT using the moc tool. +# - ${MOC} must point to the moc tool +function( generate_moc_files mocGenOut folder) + + # Finds all .h files in the current dir including the text Q_OBJECT + file(GLOB candidateFiles "${folder}/*.h") + set(mocInput) + foreach(f ${candidateFiles}) + execute_process(COMMAND grep Q_OBJECT ${f} + OUTPUT_VARIABLE result + RESULT_VARIABLE code) + if("${code}" STREQUAL "0") + set(mocInput ${mocInput} ${f}) + endif() + endforeach() + + # If no Q_OBJECT files in this folder we are finished. + list(LENGTH mocInput numFiles) + if (${numFiles} EQUAL 0) + set(${mocGenOut} "" PARENT_SCOPE) + return() + endif() + + # Set where generated files go to and add that directory to the include path + get_code_gen_dir(${folder} mocGenDir) + + # For each input moc file + foreach(mocFile ${mocInput}) + # Get the name of the file without extension + get_filename_component(mocName ${mocFile} NAME_WE) + + # Add the generated file to mocGen variable + set(outMocFile "${mocGenDir}/moc_${mocName}.cpp") + set(mocGen ${mocGen} ${outMocFile}) + + # Add the custom command that will generate this file + # - The generated files will be put in the CMake build directory, + # not the source tree + add_custom_command(OUTPUT ${outMocFile} + COMMAND ${MOC} ${mocFile} -o ${outMocFile} + DEPENDS ${mocFile} + WORKING_DIRECTORY ${folder} + COMMENT "Generating MOC files...") + endforeach() + set(${mocGenOut} ${mocGen} PARENT_SCOPE) # Set up output variable +endfunction() + +# Generate ProtoBuf output files for an obj folder. +# - ${PROTOC} must point to the protobuf tool +function(generate_protobuf_files protoGenOut folder) + + # Finds all .proto files in the current dir + file(GLOB protoInput "${folder}/*.proto") + + # If no .proto files in this folder we are finished. + list(LENGTH protoInput numFiles) + if (${numFiles} EQUAL 0) + set(${protoGenOut} "" PARENT_SCOPE) + return() + endif() + + # Set where generated files go to and add that directory to the include path + get_code_gen_dir(${folder} protoGenDir) + + # For each input protobuf file + foreach(protoFile ${protoInput}) + # Get the name of the file without extension + get_filename_component(protoName ${protoFile} NAME_WE) + + # Add the two generated files to PROTO_GEN variable + set(protoGen ${protoGen} + ${protoGenDir}/${protoName}.pb.h + ${protoGenDir}/${protoName}.pb.cc) + + set(PROTO_HEADERS ${PROTO_HEADERS} ${protoGenDir}/${protoName}.pb.h) + endforeach() + + # Add the custom command that will generate all the files + # - The generated files will be put in the CMake build directory, not the source tree. + add_custom_command(OUTPUT ${protoGen} + COMMAND ${PROTOC} --proto_path ${folder} --cpp_out ${protoGenDir} ${protoInput} && cp ${PROTO_HEADERS} ${CMAKE_BINARY_DIR}/inc + DEPENDS ${protoInput} + WORKING_DIRECTORY ${folder} + COMMENT "Generating Protocol Buffers...") + + set(${protoGenOut} ${protoGen} PARENT_SCOPE) # Set up output variable +endfunction() diff --git a/isis/cmake/FindBoost.cmake b/isis/cmake/FindBoost.cmake new file mode 100644 index 0000000000000000000000000000000000000000..b8c4db1228bf72c749414c8df9cd81be91f09c96 --- /dev/null +++ b/isis/cmake/FindBoost.cmake @@ -0,0 +1,138 @@ +# CMake module for find_package(Boost) +# Finds include directory and all applicable libraries +# +# Sets the following: +# BOOST_INCLUDE_DIR + +find_path(BOOST_INCLUDE_DIR + NAME flyweight.hpp + PATH_SUFFIXES "boost/boost${Boost_FIND_VERSION}/boost/" "boost" +) + +get_filename_component(BOOST_ROOT_INCLUDE_DIR "${BOOST_INCLUDE_DIR}" DIRECTORY) + +find_library(BOOST_ATOMIC_MT_LIBRARY + NAMES boost_atomic-mt boost_atomic +) + +find_library(BOOST_LOG_MT_LIBRARY + NAMES boost_log-mt boost_log +) + +find_library(BOOST_REGEX_MT_LIBRARY + NAMES boost_regex-mt boost_regex +) + +find_library(BOOST_LOG_SETUP_MT_LIBRARY + NAMES boost_log_setup-mt boost_log_setup +) + +find_library(BOOST_SERIALIZATION_MT_LIBRARY + NAMES boost_serialization-mt boost_serialization +) + +find_library(BOOST_CHRONO_MT_LIBRARY + NAMES boost_chrono-mt boost_chrono +) + +find_library(BOOST_MATH_C99_MT_LIBRARY + NAMES boost_math_c99-mt boost_math_c99 +) + +find_library(BOOST_SIGNALS_MT_LIBRARY + NAMES boost_signals-mt boost_signals +) + +find_library(BOOST_CONTAINER_MT_LIBRARY + NAMES boost_container-mt boost_container +) + +find_library(BOOST_MATH_C99F_MT_LIBRARY + NAMES boost_math_c99f-mt boost_math_c99f +) + +find_library(BOOST_CONTEXT_MT_LIBRARY + NAMES boost_context-mt boost_context +) + +find_library(BOOST_MATH_C99L_MT_LIBRARY + NAMES boost_math_c99l-mt boost_math_c99l +) + +find_library(BOOST_SYSTEM_MT_LIBRARY + NAMES boost_system-mt boost_system +) + +find_library(BOOST_COROUTINE_MT_LIBRARY + NAMES boost_coroutine-mt boost_coroutine +) + +find_library(BOOST_MATH_TR1_MT_LIBRARY + NAMES boost_math_tr1-mt boost_math_tr1 +) + +find_library(BOOST_MATH_TR1F_MT_LIBRARY + NAMES boost_math_tr1f-mt boost_math_tr1f +) + +find_library(BOOST_MATH_TR1L_MT_LIBRARY + NAMES boost_math_tr1l-mt boost_math_tr1l +) + +find_library(BOOST_TEST_EXEC_MONITOR_MT_LIBRARY + NAMES boost_test_exec_monitor-mt boost_test_exec_monitor +) + +find_library(BOOST_DATE_TIME_MT_LIBRARY + NAMES boost_date_time-mt boost_date_time +) + +find_library(BOOST_THREAD_MT_LIBRARY + NAMES boost_thread-mt boost_thread +) + +find_library(BOOST_EXCEPTION_MT_LIBRARY + NAMES boost_exception-mt boost_exception +) + +find_library(BOOST_TIMER_MT_LIBRARY + NAMES boost_timer-mt boost_timer +) + +find_library(BOOST_FILESYSTEM_MT_LIBRARY + NAMES boost_filesystem-mt boost_filesystem +) + +find_library(BOOST_PRG_EXEC_MONITOR_MT_LIBRARY + NAMES boost_prg_exec_monitor-mt boost_prg_exec_monitor +) + +find_library(BOOST_PROGRAM_OPTIONS_MT_LIBRARY + NAMES boost_program_options-mt boost_program_options +) + +find_library(BOOST_UNIT_TEST_FRAMEWORK_MT_LIBRARY + NAMES boost_unit_test_framework-mt boost_unit_test_framework +) + +find_library(BOOST_IOSTREAMS_MT_LIBRARY + NAMES boost_iostreams-mt boost_iostreams +) + +#message("BOOST_IOSTREAMS_MT_LIBRARY = ${BOOST_IOSTREAMS_MT_LIBRARY}") +#tjw: Not sure if needed...commenting out because library is missing +#find_library(BOOST_PYTHON_MT_LIBRARY +# NAMES boost_python-mt boost_python +#) + +find_library(BOOST_WAVE_MT_LIBRARY + NAMES boost_wave-mt boost_wave +) + +find_library(BOOST_RANDOM_MT_LIBRARY + NAMES boost_random-mt boost_random +) + +find_library(BOOST_WSERIALIZATION_MT_LIBRARY + NAMES boost_wserialization-mt boost_wserialization +) diff --git a/isis/cmake/FindBullet.cmake b/isis/cmake/FindBullet.cmake new file mode 100644 index 0000000000000000000000000000000000000000..efec236cd67a92bbdf65c0d92c5bfd674f8d6df5 --- /dev/null +++ b/isis/cmake/FindBullet.cmake @@ -0,0 +1,35 @@ +# CMake module for find_package(Bullet) +# Finds include directory and all applicable libraries +# +# Sets the following: +# BULLET_INCLUDE_DIR +# BULLET_LIBRARY + +find_path(BULLET_INCLUDE_DIR + NAME btBulletCollisionCommon.h + PATH_SUFFIXES bullet +) + +find_library(BULLET_OPENCL_LIBRARY NAMES Bullet3OpenCL_clew) +find_library(BULLET_SOFTBODY_LIBRARY NAMES BulletSoftBody) +find_library(BULLET_INVERSEDYNAMICS_LIBRARY NAMES BulletInverseDynamics) +find_library(BULLET_COMMON_LIBRARY NAMES Bullet3Common) +find_library(BULLET_DYNAMICS_LIBRARY NAMES BulletDynamics) +find_library(BULLET3_COLLISION_LIBRARY NAMES BulletCollision) +find_library(BULLET3_3GEOMETRY_LIBRARY NAMES Bullet3Geometry) +find_library(BULLET3_3DYNAMICS_LIBRARY NAMES Bullet3Dynamics) +find_library(BULLET3_3COLLISION_LIBRARY NAMES Bullet3Collision) +find_library(BULLET3_LINEARMATH_LIBRARY NAMES LinearMath) + +get_filename_component(BULLET_ROOT_INCLUDE_DIR "${BULLET_INCLUDE_DIR}" DIRECTORY) + +message(STATUS "BULLET INCLUDE: " ${BULLET_INCLUDE_DIR} ) +message(STATUS "BULLET OPENCL: " ${BULLET_OPENCL_LIBRARY} ) +message(STATUS "BULLET SOFTBODY: " ${BULLET_SOFTBODY_LIBRARY}) +message(STATUS "BULLET INVERSE DYNAMICS: " ${BULLET_INVERSEDYNAMICS_LIBRARY} ) +message(STATUS "BULLET DYNAMICS: " ${BULLET3_DYNAMICS_LIBRARY} ) +message(STATUS "BULLET COLLISION: " ${BULLET3_COLLISION_LIBRARY} ) +message(STATUS "BULLET GEOMETRY: " ${BULLET3_GEOMETRY_LIBRARY} ) +message(STATUS "BULLET3 3DYNAMICS: " ${BULLET3_3DYNAMICS_LIBRARY} ) +message(STATUS "BULLET3 3COLLISION: " ${BULLET3_3COLLISION_LIBRARY} ) +message(STATUS "BULLET3 LINEARMATH: " ${BULLET3_LINEARMATH_LIBRARY} ) diff --git a/isis/cmake/FindCSPICE.cmake b/isis/cmake/FindCSPICE.cmake new file mode 100644 index 0000000000000000000000000000000000000000..3df2e1ff87011639449528ca1c3dd69db6e550a2 --- /dev/null +++ b/isis/cmake/FindCSPICE.cmake @@ -0,0 +1,18 @@ +# CMake module for find_package(CSPICE) +# Finds include directory and all applicable libraries +# +# Sets the following: +# CSPICE_INCLUDE_DIR +# CSPICE_LIBRARY + +find_path(CSPICE_INCLUDE_DIR + NAME SpiceUsr.h + PATH_SUFFIXES naif cspice +) + +find_library(CSPICE_LIBRARY + NAMES cspice +) + +message(STATUS "CSPICE INCLUDE: " ${CSPICE_INCLUDE_DIR} ) +message(STATUS "CSPICE LIB: " ${CSPICE_LIBRARY} ) diff --git a/isis/cmake/FindCholmod.cmake b/isis/cmake/FindCholmod.cmake new file mode 100644 index 0000000000000000000000000000000000000000..61bf96609c9a05745d2069b8e83801e55384be19 --- /dev/null +++ b/isis/cmake/FindCholmod.cmake @@ -0,0 +1,39 @@ +# CMake module for find_package(Cholmod) +# Finds include directory and all applicable libraries +# +# Sets the following: +# CHOLMOD_INCLUDE_DIR +# CHOLMOD_LIBLIST + +find_path(CHOLMOD_INCLUDE_DIR + NAME cholmod.h + PATH_SUFFIXES "SuiteSparse/SuiteSparse${Cholmod_FIND_VERSION}/SuiteSparse/" "SuiteSparse" +) + +find_library(CHOLMOD_LIBRARY NAMES cholmod) +find_library(CCOLAMD_LIBRARY NAMES ccolamd) +find_library(COLAMD_LIBRARY NAMES colamd) +find_library(CAMD_LIBRARY NAMES camd) +find_library(AMD_LIBRARY NAMES amd) +find_library(SUITESPARSE_LIBRARY NAMES suitesparseconfig) +find_library(BLAS_LIBRARY NAMES blas) + +# OSX does not link against lapack +if(NOT APPLE) + find_library(LAPACK_LIBRARY NAMES lapack) +endif() + +# Dependencies for lapack +get_filename_component(CHOLMOD_ROOT_INCLUDE_DIR "${CHOLMOD_INCLUDE_DIR}" DIRECTORY) + +message(STATUS "CHOLMOD INCLUDE: " ${CHOLMOD_INCLUDE_DIR} ) +message(STATUS "CHOLMOD LIB: " ${CHOLMOD_LIBRARY} ) +message(STATUS "CCOLMOD LIB: " ${CCOLAMD_LIBRARY} ) +message(STATUS "CAMD LIB: " ${CAMD_LIBRARY} ) +message(STATUS "AMD LIB: " ${AMD_LIBRARY} ) +message(STATUS "SUITESPARSE LIB: " ${SUITESPARSE_LIBRARY} ) +message(STATUS "BLAS LIB: " ${BLAS_LIBRARY} ) + +if(NOT APPLE) + message(STATUS "LAPACK LIB: " ${LAPACK_LIBRARY}) +endif() diff --git a/isis/cmake/FindEigen.cmake b/isis/cmake/FindEigen.cmake new file mode 100644 index 0000000000000000000000000000000000000000..154a23cd591e21f1299cc89abddeed052019539b --- /dev/null +++ b/isis/cmake/FindEigen.cmake @@ -0,0 +1,17 @@ +# CMake module for find_package(PCL) +# Finds include directory and all applicable libraries +# +# Sets the following: +# PCL_INCLUDE_DIR + +#find_path(EIGEN_INCLUDE_DIR +# NAME Core +# PATH_SUFFIXES eigen/Eigen eigen3/Eigen +#) + +find_path(EIGEN_ROOT_INCLUDE_DIR + NAME Eigen + PATH_SUFFIXES eigen eigen3 +) + +message(STATUS "EIGEN INCLUDE DIR: " ${EIGEN_ROOT_INCLUDE_DIR} ) diff --git a/isis/cmake/FindEmbree.cmake b/isis/cmake/FindEmbree.cmake new file mode 100644 index 0000000000000000000000000000000000000000..d7af1d78d6ebb668679ad8ea3c7a71157cb3f123 --- /dev/null +++ b/isis/cmake/FindEmbree.cmake @@ -0,0 +1,20 @@ +# CMake module for find_package(Embree) +# Finds include directory and all applicable libraries +# +# Sets the following: +# EMBREE_INCLUDE_DIR +# EMBREE_LIBRARY + +find_path(EMBREE_INCLUDE_DIR + NAME rtcore.h + PATH_SUFFIXES embree2 +) + +find_library(EMBREE_LIBRARY + NAMES embree +) + +get_filename_component(EMBREE_ROOT_INCLUDE_DIR "${EMBREE_INCLUDE_DIR}" DIRECTORY) + +message(STATUS "EMBREE INCLUDE: " ${EMBREE_INCLUDE_DIR}) +message(STATUS "EMBREE LIB: " ${EMBREE_LIBRARY}) diff --git a/isis/cmake/FindGMM.cmake b/isis/cmake/FindGMM.cmake new file mode 100644 index 0000000000000000000000000000000000000000..3787fa9534a6dbd9869e52383136848bc550e02d --- /dev/null +++ b/isis/cmake/FindGMM.cmake @@ -0,0 +1,14 @@ +# CMake module for find_package(GMM) +# Finds include directory and all applicable libraries +# +# Sets the following: +# GMM_INCLUDE_DIR + +find_path(GMM_INCLUDE_DIR + NAMES gmm.h + PATH_SUFFIXES "/gmm/gmm-${GMM_FIND_VERSION}/gmm/" "gmm" +) + +get_filename_component(GMM_ROOT_INCLUDE_DIR "${GMM_INCLUDE_DIR}" DIRECTORY) + +message(STATUS "GMM INCLUDE DIR: ${GMM_INCLUDE_DIR}") diff --git a/isis/cmake/FindGSL.cmake b/isis/cmake/FindGSL.cmake new file mode 100644 index 0000000000000000000000000000000000000000..105dad800e6f5bc253e3415c87b1745dba62c7d0 --- /dev/null +++ b/isis/cmake/FindGSL.cmake @@ -0,0 +1,25 @@ +# CMake module for find_package(GSL) +# Finds include directory and all applicable libraries +# +# Sets the following: +# GSL_INCLUDE_DIR +# GSL_LIBLIST + +find_path(GSL_INCLUDE_DIR + NAMES gsl_math.h + PATH_SUFFIXES gsl +) + +find_library(GSL_LIBRARY + NAMES gsl +) + +find_library(GSL_CBLAS_LIBRARY + NAMES gslcblas +) + +get_filename_component(GSL_ROOT_INCLUDE_DIR "${GSL_INCLUDE_DIR}" DIRECTORY) + +message(STATUS "GSL INCLUDE DIR: ${GSL_INCLUDE_DIR}") +message(STATUS "GSL LIB: ${GSL_LIBRARY}") +message(STATUS "GSL CBLAS LIB: ${GSL_CBLAS_LIBRARY}") diff --git a/isis/cmake/FindGeoTIFF.cmake b/isis/cmake/FindGeoTIFF.cmake new file mode 100644 index 0000000000000000000000000000000000000000..9bfbb68cacc9605611855886a1b450aee255ae30 --- /dev/null +++ b/isis/cmake/FindGeoTIFF.cmake @@ -0,0 +1,20 @@ +# CMake module for find_package(GeoTIFF) +# Finds include directory and all applicable libraries +# +# Sets the following: +# GEOTIFF_INCLUDE_DIR +# GEOTIFF_LIBRARY + +find_path(GEOTIFF_INCLUDE_DIR + NAMES geotiff.h + PATH_SUFFIXES geotiff +) + +find_library(GEOTIFF_LIBRARY + NAMES geotiff +) + +get_filename_component(GEOTIFF_ROOT_INCLUDE_DIR "${GEOTIFF_INCLUDE_DIR}" DIRECTORY) + +message(STATUS "GEOTIFF INCLUDE DIR: ${GEOTIFF_INCLUDE_DIR}") +message(STATUS "GEOTIFF LIB: ${GEOTIFF_LIBRARY}") diff --git a/isis/cmake/FindGeos.cmake b/isis/cmake/FindGeos.cmake new file mode 100644 index 0000000000000000000000000000000000000000..dc2df58ec29cada16fbdce15762998d30a5ce64c --- /dev/null +++ b/isis/cmake/FindGeos.cmake @@ -0,0 +1,24 @@ +# CMake module for find_package(Geos) +# Finds include directory and all applicable libraries +# +# Sets the following: +# GEOS_INCLUDE_DIR +# GEOS_LIBRARY + +find_path(GEOS_INCLUDE_DIR + NAME geos.h + PATH_SUFFIXES "geos/geos${Geos_FIND_VERSION}" "geos" +) + +find_library(GEOS_LIBRARY + NAMES geos +) +find_library(GEOS_C_LIBRARY + NAMES geos_c +) + +message(STATUS "GEOS INCLUDE DIR: " ${GEOS_INCLUDE_DIR} ) +message(STATUS "GEOS LIB: " ${GEOS_LIBRARY} ) +message(STATUS "GEOS C LIB: " ${GEOS_C_LIBRARY} ) + +get_filename_component(GEOS_ROOT_INCLUDE_DIR "${GEOS_INCLUDE_DIR}" DIRECTORY) diff --git a/isis/cmake/FindHDF5.cmake b/isis/cmake/FindHDF5.cmake new file mode 100644 index 0000000000000000000000000000000000000000..1ebf7edcd332b3dd4d3d2d959711fcb3c3962627 --- /dev/null +++ b/isis/cmake/FindHDF5.cmake @@ -0,0 +1,24 @@ +# CMake module for find_package(HDF5) +# Finds include directory and all applicable libraries +# +# Sets the following: +# HDF5_INCLUDE_DIR +# HDF5_LIBRARY + +find_path(HDF5_INCLUDE_DIR + NAME hdf5.h + PATH_SUFFIXES hdf5 +) + +find_library(HDF5_LIBRARY NAMES hdf5) +find_library(HDF5_CPP_LIBRARY NAMES hdf5_cpp) +find_library(HDF5_HL_LIBRARY NAMES hdf5_hl) +find_library(HDF5_HLCPP_LIBRARY NAMES hdf5_hl_cpp) + +get_filename_component(HDF5_ROOT_INCLUDE_DIR "${HDF5_INCLUDE_DIR}" DIRECTORY) + +message(STATUS "HDF5 INCLUDE DIR: ${HDF5_INCLUDE_DIR}") +message(STATUS "HDF5 LIB: ${HDF5_LIBRARY}") +message(STATUS "HDF5 CPP LIB: ${HDF5_CPP_LIBRARY}") +message(STATUS "HDF5 HL LIB: ${HDF5_HL_LIBRARY}") +message(STATUS "HDF5 HLCPP LIB: ${HDF5_HLCPP_LIBRARY}") diff --git a/isis/cmake/FindJama.cmake b/isis/cmake/FindJama.cmake new file mode 100644 index 0000000000000000000000000000000000000000..c547d3b27d8f6778fef5d2a65aea10c2e4c4ac06 --- /dev/null +++ b/isis/cmake/FindJama.cmake @@ -0,0 +1,14 @@ +# CMake module for find_package(Jama) +# Finds include directory and all applicable libraries +# +# Sets the following: +# JAMA_INCLUDE_DIR + +find_path(JAMA_INCLUDE_DIR + NAMES jama_cholesky.h + PATH_SUFFIXES "jama/jama${Jama_FIND_VERSION}/jama" "/jama" +) + +get_filename_component(JAMA_ROOT_INCLUDE_DIR "${JAMA_INCLUDE_DIR}" DIRECTORY) + +message(STATUS "JAMA INCLUDE DIR: ${JAMA_INCLUDE_DIR}") diff --git a/isis/cmake/FindKakadu.cmake b/isis/cmake/FindKakadu.cmake new file mode 100644 index 0000000000000000000000000000000000000000..cb2842751228902515b9bba04c748dc79a081858 --- /dev/null +++ b/isis/cmake/FindKakadu.cmake @@ -0,0 +1,30 @@ +# CMake module for find_package(Kakadu) +# Finds include directory and all applicable libraries +# +# Sets the following: +# KAKADU_INCLUDE_DIR +# KAKADU_A_LIBRARY +# KAKADU_V_LIBRARY + +if(JP2KFLAG) + find_path(KAKADU_INCLUDE_DIR + NAME kdu_kernels.h + PATHS /usgs/apps/kakadu/v7_9_1-01762L/managed/all_includes/ + ) + + find_library(KAKADU_A_LIBRARY + NAMES kdu_a79R + ) + + find_library(KAKADU_V_LIBRARY + NAMES kdu_v79R + ) + + get_filename_component(KAKADU_ROOT_INCLUDE_DIR "${KAKADU_INCLUDE_DIR}" DIRECTORY) + + message(STATUS "KAKADU INC DIR: ${KAKADU_INCLUDE_DIR}") + message(STATUS "KAKADU A LIB: ${KAKADU_A_LIBRARY}") + message(STATUS "KAKADU V LIB: ${KAKADU_V_LIBRARY}") +else() + message(STATUS "KAKADU DISABLED") +endif() diff --git a/isis/cmake/FindLibPython.py b/isis/cmake/FindLibPython.py new file mode 100644 index 0000000000000000000000000000000000000000..38ae93fd3b3c8ad5fa58ade18a1615c4105b8a3f --- /dev/null +++ b/isis/cmake/FindLibPython.py @@ -0,0 +1,10 @@ +# Borrowed mostly from the QGIS project: https://github.com/qgis/QGIS + +import sys +import distutils.sysconfig + +print("exec_prefix:%s" % sys.exec_prefix) +print("short_version:%s" % sys.version[:3]) +print("long_version:%s" % sys.version.split()[0]) +print("py_inc_dir:%s" % distutils.sysconfig.get_python_inc()) +print("site_packages_dir:%s" % distutils.sysconfig.get_python_lib(plat_specific=1)) diff --git a/isis/cmake/FindNN.cmake b/isis/cmake/FindNN.cmake new file mode 100644 index 0000000000000000000000000000000000000000..fa2b59627865e2bb9974ed9dae25b1c4de97c135 --- /dev/null +++ b/isis/cmake/FindNN.cmake @@ -0,0 +1,19 @@ +# CMake module for find_package(TNT) +# Finds include directory and all applicable libraries +# +# Sets the following: +# TNT_INCLUDE_DIR + +find_path(NN_INCLUDE_DIR + NAMES nn.h + PATH_SUFFIXES nn +) + +find_library(NN_LIBRARY + NAMES nn +) + +get_filename_component(NN_ROOT_INCLUDE_DIR "${NN_INCLUDE_DIR}" DIRECTORY) + +message(STATUS "NN INCLUDE DIR: ${NN_INCLUDE_DIR}") +message(STATUS "NN LIB: ${NN_LIBRARY}") diff --git a/isis/cmake/FindOpenCV.cmake b/isis/cmake/FindOpenCV.cmake new file mode 100644 index 0000000000000000000000000000000000000000..0450572ef0795f270da6eaac9e1ac84ee5e94e3a --- /dev/null +++ b/isis/cmake/FindOpenCV.cmake @@ -0,0 +1,44 @@ +# CMake module for find_package(OpenCV) +# Finds include directory and all applicable libraries +# +# Sets the following: +# OPENCV_INCLUDE_DIR +# OPENCV_LIBLSIT + +find_path(OPENCV_INCLUDE_DIR + NAMES cv.h + PATH_SUFFIXES opencv +) + +find_library(OPENCV_CORE_LIBRARY NAMES opencv_core) +find_library(OPENCV_VIDEOSTAB_LIBRARY NAMES opencv_videostab) +find_library(OPENCV_VIDEO_LIBRARY NAMES opencv_video) +find_library(OPENCV_SUPERRES_LIBRARY NAMES opencv_superres) +find_library(OPENCV_STITCHING_LIBRARY NAMES opencv_stitching) +find_library(OPENCV_PHOTO_LIBRARY NAMES opencv_photo) +find_library(OPENCV_OBJDETECT_LIBRARY NAMES opencv_objdetect) +find_library(OPENCV_ML_LIBRARY NAMES opencv_ml) +find_library(OPENCV_IMGCODECS_LIBRARY NAMES opencv_imgcodecs) +find_library(OPENCV_IMGPROC_LIBRARY NAMES opencv_imgproc) +find_library(OPENCV_CALIB3D_LIBRARY NAMES opencv_calib3d) +find_library(OPENCV_FEATURES2D_LIBRARY NAMES opencv_features2d) +find_library(OPENCV_XFEATURES2D_LIBRARY NAMES opencv_xfeatures2d) +find_library(OPENCV_HIGHGUI_LIBRARY NAMES opencv_highgui) +find_library(OPENCV_FLANN_LIBRARY NAMES opencv_flann) + +get_filename_component(OPENCV_ROOT_INCLUDE_DIR "${OPENCV_INCLUDE_DIR}" DIRECTORY) + +message(STATUS "OPENCV INCLUDE DIR: ${OPENCV_INCLUDE_DIR}") +message(STATUS "OPENCV CORE LIB: ${OPENCV_CORE_LIBRARY}") +message(STATUS "OPENCV VIDEOSTAB LIB: ${OPENCV_VIDEOSTAB_LIBRARY}") +message(STATUS "OPENCV SUPERRES LIB: ${OPENCV_SUPERRES_LIBRARY}") +message(STATUS "OPENCV STITCHING LIB: ${OPENCV_STITCHING_LIBRARY}") +message(STATUS "OPENCV PHOTO LIB: ${OPENCV_PHOTO_LIBRARY}") +message(STATUS "OPENCV OBJDETECT LIB: ${OPENCV_OBJDETECT_LIBRARY}") +message(STATUS "OPENCV IMGCODECS LIB: ${OPENCV_IMGCODECS_LIBRARY}") +message(STATUS "OPENCV IMGPROC LIB: ${OPENCV_IMGPROC_LIBRARY}") +message(STATUS "OPENCV CALIB3D LIB: ${OPENCV_CALIB3D_LIBRARY}") +message(STATUS "OPENCV FEATURES2D LIB: ${OPENCV_FEATURES2D_LIBRARY}") +message(STATUS "OPENCV xFEATURES2D LIB: ${OPENCV_XFEATURES2D_LIBRARY}") +message(STATUS "OPENCV HIGHGUI LIB: ${OPENCV_HIGHGUI_LIBRARY}") +message(STATUS "OPENCV FLANN LIB: ${OPENCV_FLANN_LIBRARY}") diff --git a/isis/cmake/FindPCL.cmake b/isis/cmake/FindPCL.cmake new file mode 100644 index 0000000000000000000000000000000000000000..902b5b6b1cfeb377f774a2d5ee96bc043f37a833 --- /dev/null +++ b/isis/cmake/FindPCL.cmake @@ -0,0 +1,27 @@ +# CMake module for find_package(PCL) +# Finds include directory and all applicable libraries +# +# Sets the following: +# PCL_INCLUDE_DIR +# PCL_LIBRARY + +find_path(PCL_ROOT_INCLUDE_DIR + NAME pcl + PATH_SUFFIXES "pcl-${PCL_FIND_VERSION}" +) + +find_path(PCL_INCLUDE_DIR + NAME pcl_base.h + PATH_SUFFIXES "pcl-${PCL_FIND_VERSION}/pcl" +) + +find_library(PCL_COMMON_LIBRARY NAMES pcl_common) +find_library(PCL_OCTREE_LIBRARY NAMES pcl_octree) +find_library(PCL_IO_LIBRARY NAMES pcl_io) + +get_filename_component(PCL_ROOT_INCLUDE_DIR "${PCL_INCLUDE_DIR}" DIRECTORY) + +message(STATUS "PCL INCLUDE DIR: ${PCL_INCLUDE_DIR}") +message(STATUS "PCL COMMON LIB: ${PCL_COMMON_LIBRARY}") +message(STATUS "PCL OCTREE LIB: ${PCL_OCTREE_LIBRARY}") +message(STATUS "PCL IO LIB: ${PCL_IO_LIBRARY}") diff --git a/isis/cmake/FindPNG.cmake b/isis/cmake/FindPNG.cmake new file mode 100644 index 0000000000000000000000000000000000000000..6c2439f113c82f0228781a974ae02850f4111553 --- /dev/null +++ b/isis/cmake/FindPNG.cmake @@ -0,0 +1,17 @@ +# Finds include directory and all applicable libraries +# +# Sets the following: +# PNG_INCLUDE_DIR +# PNG_LIBRARY + +find_path(PNG_INCLUDE_DIR + NAMES png.h + PATH_SUFFIXES png +) + +find_library(PNG_LIBRARY + NAMES png +) + +message(STATUS "PNG INCLUDE DIR: ${PNG_INCLUDE_DIR}") +message(STATUS "PNG LIB: ${PNG_LIBRARY}") diff --git a/isis/cmake/FindProtobuf.cmake b/isis/cmake/FindProtobuf.cmake new file mode 100644 index 0000000000000000000000000000000000000000..74db9e434262e517759a454d4dcc1e4ec1ca616b --- /dev/null +++ b/isis/cmake/FindProtobuf.cmake @@ -0,0 +1,11 @@ +find_path(PROTOBUF_INCLUDE_DIR + NAMES google/ + PATH_SUFFIXES "google-protobuf/protobuf${Protobuf_FIND_VERSION}/" +) + +find_library(PROTOBUF_LIBRARY NAMES protobuf) + +get_filename_component(PROTOBUF_ROOT_INCLUDE_DIR "${PROTOBUF_INCLUDE_DIR}" DIRECTORY) + +message(STATUS "PROTOBUF INCLUDE DIR: ${PROTOBUF_INCLUDE_DIR}") +message(STATUS "PROTOBUF LIB: ${PROTOBUF_LIBRARY}") diff --git a/isis/cmake/FindPython.cmake b/isis/cmake/FindPython.cmake new file mode 100644 index 0000000000000000000000000000000000000000..5f5a64a98ddfd2a640dd3581cbcd917fddb5cf6d --- /dev/null +++ b/isis/cmake/FindPython.cmake @@ -0,0 +1,108 @@ +# Borrowed mostly from the QGIS project: https://github.com/qgis/QGIS +# +# PYTHON_EXECUTABLE - The path and filename of the Python interpreter. +# +# PYTHON_SHORT_VERSION - The version of the Python interpreter found, +# excluding the patch version number. (e.g. 2.5 and not 2.5.1)) +# +# PYTHON_LONG_VERSION - The version of the Python interpreter found as a human +# readable string. +# +# PYTHON_SITE_PACKAGES_DIR - Location of the Python site-packages directory. +# +# PYTHON_INCLUDE_PATH - Directory holding the python.h include file. +# +# PYTHON_LIBRARY, PYTHON_LIBRARIES- Location of the Python library. + +INCLUDE(CMakeFindFrameworks) + +if(EXISTS "${PYTHON_INCLUDE_PATH}" AND EXISTS "${PYTHON_LIBRARY}" AND EXISTS "${PYTHON_SITE_PACKAGES_DIR}") + # Already in cache, be silent + set(PYTHONLIBRARY_FOUND TRUE) +else(EXISTS "${PYTHON_INCLUDE_PATH}" AND EXISTS "${PYTHON_LIBRARY}" AND EXISTS "${PYTHON_SITE_PACKAGES_DIR}") + + FIND_PACKAGE(PythonInterp 3) + + if(PYTHONINTERP_FOUND) + FIND_FILE(_find_lib_python_py FindLibPython.py PATHS ${CMAKE_MODULE_PATH}) + + EXECUTE_PROCESS(COMMAND ${PYTHON_EXECUTABLE} ${_find_lib_python_py} OUTPUT_VARIABLE python_config) + if(python_config) + STRING(REGEX REPLACE ".*exec_prefix:([^\n]+).*$" "\\1" PYTHON_PREFIX ${python_config}) + STRING(REGEX REPLACE ".*\nshort_version:([^\n]+).*$" "\\1" PYTHON_SHORT_VERSION ${python_config}) + STRING(REGEX REPLACE ".*\nlong_version:([^\n]+).*$" "\\1" PYTHON_LONG_VERSION ${python_config}) + STRING(REGEX REPLACE ".*\npy_inc_dir:([^\n]+).*$" "\\1" PYTHON_INCLUDE_PATH ${python_config}) + if(NOT PYTHON_SITE_PACKAGES_DIR) + if(NOT PYTHON_LIBS_WITH_KDE_LIBS) + STRING(REGEX REPLACE ".*\nsite_packages_dir:([^\n]+).*$" "\\1" PYTHON_SITE_PACKAGES_DIR ${python_config}) + else(NOT PYTHON_LIBS_WITH_KDE_LIBS) + set(PYTHON_SITE_PACKAGES_DIR ${KDE4_LIB_INSTALL_DIR}/python${PYTHON_SHORT_VERSION}/site-packages) + endif(NOT PYTHON_LIBS_WITH_KDE_LIBS) + endif(NOT PYTHON_SITE_PACKAGES_DIR) + STRING(REGEX REPLACE "([0-9]+).([0-9]+)" "\\1\\2" PYTHON_SHORT_VERSION_NO_DOT ${PYTHON_SHORT_VERSION}) + set(PYTHON_LIBRARY_NAMES python${PYTHON_SHORT_VERSION} python${PYTHON_SHORT_VERSION_NO_DOT} python${PYTHON_SHORT_VERSION}m python${PYTHON_SHORT_VERSION_NO_DOT}m) + if(WIN32) + STRING(REPLACE "\\" "/" PYTHON_SITE_PACKAGES_DIR ${PYTHON_SITE_PACKAGES_DIR}) + FIND_LIBRARY(PYTHON_LIBRARY NAMES ${PYTHON_LIBRARY_NAMES} PATHS ${PYTHON_PREFIX}/lib ${PYTHON_PREFIX}/libs) + endif(WIN32) + FIND_LIBRARY(PYTHON_LIBRARY NAMES ${PYTHON_LIBRARY_NAMES}) + set(PYTHON_INCLUDE_PATH ${PYTHON_INCLUDE_PATH} CACHE FILEPATH "Directory holding the python.h include file" FORCE) + set(PYTHONLIBRARY_FOUND TRUE) + endif(python_config) + + # adapted from cmake's builtin FindPythonLibs + if(APPLE) + # If a framework has been detected in the include path, make sure + # framework's versioned library (not any .dylib) is used for linking + # NOTE: don't rely upon Python.framework/Versions/Current, since that may be 2.7 + if("${PYTHON_INCLUDE_PATH}" MATCHES "Python\\.framework") + set(PYTHON_LIBRARY "") + set(PYTHON_DEBUG_LIBRARY "") + # get clean path to just framework + STRING(REGEX REPLACE "^(.*/Python\\.framework).*$" "\\1" _py_fw "${PYTHON_INCLUDE_PATH}") + if("${_py_fw}" MATCHES "Cellar/python") + # Appears to be a Homebrew Python install; do specific fix ups + # get Homebrew prefix (may not be /usr/local) + STRING(REGEX REPLACE "^(.+)/Cellar.*$" "\\1" _hb_prefix "${_py_fw}") + # prefer the Homebrew prefix framework over only versioned Python keg + set(_py_fw "${_hb_prefix}/Frameworks/Python.framework") + # prefer the symlinked-to Homebrew site-packages over only versioned Python keg + set(PYTHON_SITE_PACKAGES_DIR "${_hb_prefix}/lib/python${PYTHON_SHORT_VERSION}/site-packages") + endif("${_py_fw}" MATCHES "Cellar/python") + # prefer the Headers subdirectory for includes + if(EXISTS "${_py_fw}/Versions/${PYTHON_SHORT_VERSION}/Headers") + set(PYTHON_INCLUDE_PATH "${_py_fw}/Versions/${PYTHON_SHORT_VERSION}/Headers" CACHE FILEPATH "Directory holding the python.h include file" FORCE) + endif(EXISTS "${_py_fw}/Versions/${PYTHON_SHORT_VERSION}/Headers") + endif("${PYTHON_INCLUDE_PATH}" MATCHES "Python\\.framework") + if(NOT PYTHON_LIBRARY) + # ensure the versioned framework's library is defined, instead of relying upon -F search paths + if(EXISTS "${_py_fw}/Versions/${PYTHON_SHORT_VERSION}/Python") + set(PYTHON_LIBRARY "${_py_fw}/Versions/${PYTHON_SHORT_VERSION}/Python" CACHE FILEPATH "Python framework library" FORCE) + endif(EXISTS "${_py_fw}/Versions/${PYTHON_SHORT_VERSION}/Python") + endif(NOT PYTHON_LIBRARY) + if(PYTHON_LIBRARY) + set(PYTHONLIBRARY_FOUND TRUE) + endif(PYTHON_LIBRARY) + endif(APPLE) + endif(PYTHONINTERP_FOUND) + + if(PYTHONLIBRARY_FOUND) + if(APPLE) + # keep reference to system or custom python site-packages + # useful during app-bundling operations + set(PYTHON_SITE_PACKAGES_SYS ${PYTHON_SITE_PACKAGES_DIR}) + endif(APPLE) + set(PYTHON_LIBRARIES ${PYTHON_LIBRARY}) + if(NOT PYTHONLIBRARY_FIND_QUIETLY) + message(STATUS "Found Python executable: ${PYTHON_EXECUTABLE}") + message(STATUS "Found Python version: ${PYTHON_LONG_VERSION}") + message(STATUS "Found Python library: ${PYTHON_LIBRARY}") + message(STATUS "Found Python site-packages: ${PYTHON_SITE_PACKAGES_DIR}") + endif(NOT PYTHONLIBRARY_FIND_QUIETLY) + else(PYTHONLIBRARY_FOUND) + if(PYTHONLIBRARY_FIND_REQUIRED) + message(FATAL_ERROR "Could not find Python") + endif(PYTHONLIBRARY_FIND_REQUIRED) + endif(PYTHONLIBRARY_FOUND) + +endif (EXISTS "${PYTHON_INCLUDE_PATH}" AND EXISTS "${PYTHON_LIBRARY}" AND EXISTS "${PYTHON_SITE_PACKAGES_DIR}") diff --git a/isis/cmake/FindQwt.cmake b/isis/cmake/FindQwt.cmake new file mode 100644 index 0000000000000000000000000000000000000000..8262a57b6928bf83be08969138cf2e30b1be13e4 --- /dev/null +++ b/isis/cmake/FindQwt.cmake @@ -0,0 +1,20 @@ +# CMake module for find_package(Qwt) +# Finds include directory and all applicable libraries +# +# Sets the following: +# QWT_INCLUDE_DIR +# QWT_LIBRARY + +FIND_PATH(QWT_INCLUDE_DIR + NAMES qwt.h + PATH_SUFFIXES "qwt-qt5" "qwt" "qwt6" "qwt${Qwt_FIND_VERSION}" +) + +find_library(QWT_LIBRARY + NAMES qwt +) + +get_filename_component(QWT_ROOT_INCLUDE_DIR "${QWT_INCLUDE_DIR}" DIRECTORY) + +message(STATUS "QWT INCLUDE LIB: ${QWT_INCLUDE_DIR}") +message(STATUS "QWT LIB: ${QWT_LIBRARY}") diff --git a/isis/cmake/FindSip.cmake b/isis/cmake/FindSip.cmake new file mode 100644 index 0000000000000000000000000000000000000000..8ede37c8d7bc7d514e664f475be47d1ce9129b3c --- /dev/null +++ b/isis/cmake/FindSip.cmake @@ -0,0 +1,44 @@ +# Borrowed mostly from the QGIS project: https://github.com/qgis/QGIS +# +# SIP_VERSION - The version of SIP found expressed as a 6 digit hex number +# suitable for comparison as a string. +# +# SIP_VERSION_STR - The version of SIP found as a human readable string. +# +# SIP_BINARY_PATH - Path and filename of the SIP command line executable. +# +# SIP_INCLUDE_DIR - Directory holding the SIP C++ header file. +# +# SIP_DEFAULT_SIP_DIR - Default directory where .sip files should be installed +# into. + +IF(SIP_VERSION) + # Already in cache, be silent + SET(SIP_FOUND TRUE) +ELSE(SIP_VERSION) + + FIND_FILE(_find_sip_py FindSip.py PATHS ${CMAKE_MODULE_PATH}) + + EXECUTE_PROCESS(COMMAND ${PYTHON_EXECUTABLE} ${_find_sip_py} OUTPUT_VARIABLE sip_config) + IF(sip_config) + STRING(REGEX REPLACE "^sip_version:([^\n]+).*$" "\\1" SIP_VERSION ${sip_config}) + STRING(REGEX REPLACE ".*\nsip_version_num:([^\n]+).*$" "\\1" SIP_VERSION_NUM ${sip_config}) + STRING(REGEX REPLACE ".*\nsip_version_str:([^\n]+).*$" "\\1" SIP_VERSION_STR ${sip_config}) + STRING(REGEX REPLACE ".*\nsip_bin:([^\n]+).*$" "\\1" SIP_BINARY_PATH ${sip_config}) + STRING(REGEX REPLACE ".*\ndefault_sip_dir:([^\n]+).*$" "\\1" SIP_DEFAULT_SIP_DIR ${sip_config}) + STRING(REGEX REPLACE ".*\nsip_inc_dir:([^\n]+).*$" "\\1" SIP_INCLUDE_DIR ${sip_config}) + STRING(REGEX REPLACE ".*\nsip_mod_dir:([^\n]+).*$" "\\1" SIP_MOD_DIR ${sip_config}) + SET(SIP_FOUND TRUE) + ENDIF(sip_config) + + IF(SIP_FOUND) + IF(NOT SIP_FIND_QUIETLY) + MESSAGE(STATUS "Found SIP version: ${SIP_VERSION_STR}") + ENDIF(NOT SIP_FIND_QUIETLY) + ELSE(SIP_FOUND) + IF(SIP_FIND_REQUIRED) + MESSAGE(FATAL_ERROR "Could not find SIP") + ENDIF(SIP_FIND_REQUIRED) + ENDIF(SIP_FOUND) + +ENDIF(SIP_VERSION) diff --git a/isis/cmake/FindSip.py b/isis/cmake/FindSip.py new file mode 100644 index 0000000000000000000000000000000000000000..8cbb00fa5caa49ba7b30156ad3a2278d158060b7 --- /dev/null +++ b/isis/cmake/FindSip.py @@ -0,0 +1,13 @@ +# Borrowed mostly from the QGIS project: https://github.com/qgis/QGIS + + +import sipconfig + +sipcfg = sipconfig.Configuration() +print("sip_version:%06.0x" % sipcfg.sip_version) +print("sip_version_num:%d" % sipcfg.sip_version) +print("sip_version_str:%s" % sipcfg.sip_version_str) +print("sip_bin:%s" % sipcfg.sip_bin) +print("default_sip_dir:%s" % sipcfg.default_sip_dir) +print("sip_inc_dir:%s" % sipcfg.sip_inc_dir) +print("sip_mod_dir:%s" % sipcfg.sip_mod_dir) diff --git a/isis/cmake/FindSuperLU.cmake b/isis/cmake/FindSuperLU.cmake new file mode 100644 index 0000000000000000000000000000000000000000..2c588bd138b2a0e87fe2a680ad41a1046ae9121c --- /dev/null +++ b/isis/cmake/FindSuperLU.cmake @@ -0,0 +1,21 @@ +# CMake module for find_package(SuperLU) +# Finds include directory and all applicable libraries +# +# Sets the following: +# SUPERLU_INCLUDE_DIR +# SUPERLU_LIBRARY + +find_path(SUPERLU_INCLUDE_DIR + NAME supermatrix.h + PATH_SUFFIXES "superlu/superlu${SuperLU_FIND_VERSION}/superlu/" "superlu" +) + +find_library(SUPERLU_LIBRARY + NAMES "superlu_${SuperLU_FIND_VERSION}" "superlu" +) + +get_filename_component(SUPERLU_ROOT_INCLUDE_DIR "${SUPERLU_INCLUDE_DIR}" DIRECTORY) + + +message(STATUS "SUPERLU INCLUDE DIR: ${SUPERLU_INCLUDE_DIR}") +message(STATUS "SUPERLU LIB: ${SUPERLU_LIBRARY}") diff --git a/isis/cmake/FindTIFF.cmake b/isis/cmake/FindTIFF.cmake new file mode 100644 index 0000000000000000000000000000000000000000..f483f587789ef811e2183f39ba7c4f69492018de --- /dev/null +++ b/isis/cmake/FindTIFF.cmake @@ -0,0 +1,9 @@ +find_path(TIFF_INCLUDE_DIR + NAMES tiff.h + PATH_SUFFIXES "tiff/tiff-${TIFF_FIND_VERSION}" +) + +find_library(TIFF_LIBRARY NAMES tiff) + +message(STATUS "TIFF INCLUDE DIR: ${TIFF_INCLUDE_DIR}") +message(STATUS "TIFF LIB: ${TIFF_LIBRARY}") diff --git a/isis/cmake/FindTNT.cmake b/isis/cmake/FindTNT.cmake new file mode 100644 index 0000000000000000000000000000000000000000..0bbfb154c0b590ea8cf5a4c1d212cdd3b8717a2c --- /dev/null +++ b/isis/cmake/FindTNT.cmake @@ -0,0 +1,14 @@ +# CMake module for find_package(TNT) +# Finds include directory and all applicable libraries +# +# Sets the following: +# TNT_INCLUDE_DIR + +find_path(TNT_INCLUDE_DIR + NAMES tnt.h + PATH_SUFFIXES "tnt/tnt${TNT_FIND_VERSION}/tnt" "tnt/" +) + +get_filename_component(TNT_ROOT_INCLUDE_DIR "${TNT_INCLUDE_DIR}" DIRECTORY) + +message(STATUS "TNT INCLUDE DIR: ${TNT_INCLUDE_DIR}" ) diff --git a/isis/cmake/FindX11.cmake b/isis/cmake/FindX11.cmake new file mode 100644 index 0000000000000000000000000000000000000000..fe25ac13150d49500487b695465118a7861e00e2 --- /dev/null +++ b/isis/cmake/FindX11.cmake @@ -0,0 +1,11 @@ +# CMake module for find_package(X11) +# Finds include directory and all applicable libraries +# +# Sets the following: +# X11_LIBRARY + +find_library(X11_LIBRARY + NAMES X11 +) + +message(STATUS "X11 LIB: " ${X11_LIBRARY} ) diff --git a/isis/cmake/FindXercesC.cmake b/isis/cmake/FindXercesC.cmake new file mode 100644 index 0000000000000000000000000000000000000000..335dca4fdab6cbe2be448d9c10139b9f9be9c2b7 --- /dev/null +++ b/isis/cmake/FindXercesC.cmake @@ -0,0 +1,10 @@ +find_path(XERCESC_INCLUDE_DIR + NAMES xercesc/ + PATH_SUFFIXES "xercesc/xercesc-${XercesC_FIND_VERSION}/" +) +# message("XERCESC_INCLUDE_DIR = ${XERCESC_INCLUDE_DIR}") + +find_library(XercesC_LIBRARY NAMES xerces-c) + +message(STATUS "XERCES LIB: " ${XercesC_LIBRARY} ) +message(STATUS "XERCES INCLUDE DIR: " ${XERCESC_INCLUDE_DIR} ) diff --git a/isis/cmake/Findnanoflann.cmake b/isis/cmake/Findnanoflann.cmake new file mode 100644 index 0000000000000000000000000000000000000000..3c05e57013bca3b9b926844e4850f1e423846b73 --- /dev/null +++ b/isis/cmake/Findnanoflann.cmake @@ -0,0 +1,15 @@ +# CMake module for find_package(GSL) +# Finds include directory and all applicable libraries +# +# Sets the following: +# GSL_INCLUDE_DIR +# GSL_LIBLIST + +find_path(NANOFLANN_INCLUDE_DIR + NAMES nanoflann.hpp + PATH_SUFFIXES nanoflann/ +) + +get_filename_component(NANOFLANN_ROOT_INCLUDE_DIR "${NANOFLANN_INCLUDE_DIR}" DIRECTORY) + +message(STATUS "NANOFLANN INCLUDE DIR: ${NANOFLANN_INCLUDE_DIR}") diff --git a/isis/cmake/InstallThirdParty.cmake b/isis/cmake/InstallThirdParty.cmake new file mode 100644 index 0000000000000000000000000000000000000000..209b3610a631b4630f08b2cdfc41dc5d442c1063 --- /dev/null +++ b/isis/cmake/InstallThirdParty.cmake @@ -0,0 +1,75 @@ +#=========================================================================== +# Code for installing the third part libraries to the output folder. +#=========================================================================== + +# Library portion of the installation +function(install_third_party_libs) + + # Where all the library files will go + set(installLibFolder "${CMAKE_INSTALL_PREFIX}/3rdParty/lib") + execute_process(COMMAND mkdir -p ${installLibFolder}) + + # Loop through all the library files in our list + foreach(library ${ALLLIBS}) + if (EXISTS ${library}) + #get path to library in libararypath + get_filename_component(librarypath ${library} PATH) + + # Copy file to output directory + file(RELATIVE_PATH relPath "${thirdPartyDir}/lib" ${library}) + + # Check if the file is a symlink + #execute_process(COMMAND readlink ${library} OUTPUT_VARIABLE link) + message(STATUS "${library}") + execute_process(COMMAND cp -L ${library} ${installLibFolder}) + endif() + endforeach() +endfunction() + +# Plugin portion of the installation +function(install_third_party_plugins) + + # Where all the plugin files will go + set(installPluginFolder "${CMAKE_INSTALL_PREFIX}/3rdParty/plugins") + + # Copy all of the plugin files + foreach(plugin ${THIRDPARTYPLUGINS}) + file(RELATIVE_PATH relPath "${PLUGIN_DIR}" ${plugin}) + get_filename_component(relPath ${relPath} DIRECTORY) # Strip filename + install(PROGRAMS ${plugin} DESTINATION ${installPluginFolder}/${relPath}) + endforeach() + +endfunction() + +# License portion of the installation +function(install_third_party_license) + # Specify top level directories + if(APPLE) + set(LIC_DIR "/opt/usgs/v007/3rdParty/license") + else() + set(LIC_DIR "/usgs/pkgs/local/v007/license") + endif() + if(NOT EXISTS ${CMAKE_INSTALL_PREFIX}/3rdParty) + install(CODE "execute_process(COMMAND mkdir -p ${CMAKE_INSTALL_PREFIX}/3rdParty/)") + endif() + install(CODE "execute_process(COMMAND cp -r ${LIC_DIR} ${CMAKE_INSTALL_PREFIX}/3rdParty/license)") +endfunction() + + +# Install all third party libraries and plugins +function(install_third_party) + + # The files are available pre-build but are not copied until make-install is called. + message("Setting up 3rd party lib installation...") + install_third_party_libs() + + message("Setting up 3rd party plugin installation...") + install_third_party_plugins() + + message("Obtaining licenses...") + install_third_party_license() + + # Finish miscellaneous file installation + file(WRITE "${CMAKE_INSTALL_PREFIX}/3rdParty/lib/README" "This directory contains O/S and hardware specific shared libraries needed\nto execute ISIS applications") + +endfunction() diff --git a/isis/cmake/MacPlistMacros.cmake b/isis/cmake/MacPlistMacros.cmake new file mode 100644 index 0000000000000000000000000000000000000000..b12387277131a6a243f405a80e4706d63c12633b --- /dev/null +++ b/isis/cmake/MacPlistMacros.cmake @@ -0,0 +1,12 @@ +# Mac Plist Macros + +FUNCTION (GET_VERSION_PLIST PLISTFILE OUTVAR) + SET (PVERSION "") + IF (EXISTS ${PLISTFILE}) + FILE (READ "${PLISTFILE}" info_plist) + STRING (REGEX REPLACE "\n" "" info_plist "${info_plist}") + STRING (REGEX MATCH "CFBundleShortVersionString[ \t]*([0-9\\.]*)" PLISTVERSION "${info_plist}") + STRING (REGEX REPLACE "CFBundleShortVersionString[ \t]*([0-9\\.]*)" "\\1" PVERSION "${PLISTVERSION}") + ENDIF (EXISTS ${PLISTFILE}) + SET (${OUTVAR} ${PVERSION} PARENT_SCOPE) +ENDFUNCTION (GET_VERSION_PLIST) diff --git a/isis/cmake/Makefile b/isis/cmake/Makefile new file mode 100644 index 0000000000000000000000000000000000000000..0e95c7b314bbe8bcfba1cc032ca73d84e4d9103d --- /dev/null +++ b/isis/cmake/Makefile @@ -0,0 +1,196 @@ +# CMAKE generated file: DO NOT EDIT! +# Generated by "Unix Makefiles" Generator, CMake Version 3.9 + +# Default target executed when no arguments are given to make. +default_target: all + +.PHONY : default_target + +# Allow only one "make -f Makefile2" at a time, but pass parallelism. +.NOTPARALLEL: + + +#============================================================================= +# Special targets provided by cmake. + +# Disable implicit rules so canonical targets will work. +.SUFFIXES: + + +# Remove some rules from gmake that .SUFFIXES does not remove. +SUFFIXES = + +.SUFFIXES: .hpux_make_needs_suffix_list + + +# Suppress display of executed commands. +$(VERBOSE).SILENT: + + +# A target that is always out of date. +cmake_force: + +.PHONY : cmake_force + +#============================================================================= +# Set environment variables for the build. + +# The shell in which to execute make rules. +SHELL = /bin/sh + +# The CMake executable. +CMAKE_COMMAND = /usr/bin/cmake + +# The command to remove a file. +RM = /usr/bin/cmake -E remove -f + +# Escaping for special characters. +EQUALS = = + +# The top-level source directory on which CMake was run. +CMAKE_SOURCE_DIR = /scratch/isiscmake/isis + +# The top-level build directory on which CMake was run. +CMAKE_BINARY_DIR = /scratch/isiscmake/isis + +#============================================================================= +# Targets provided globally by CMake. + +# Special rule for the target install/strip +install/strip: preinstall + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Installing the project stripped..." + /usr/bin/cmake -DCMAKE_INSTALL_DO_STRIP=1 -P cmake_install.cmake +.PHONY : install/strip + +# Special rule for the target install/strip +install/strip/fast: preinstall/fast + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Installing the project stripped..." + /usr/bin/cmake -DCMAKE_INSTALL_DO_STRIP=1 -P cmake_install.cmake +.PHONY : install/strip/fast + +# Special rule for the target install/local +install/local: preinstall + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Installing only the local directory..." + /usr/bin/cmake -DCMAKE_INSTALL_LOCAL_ONLY=1 -P cmake_install.cmake +.PHONY : install/local + +# Special rule for the target install/local +install/local/fast: preinstall/fast + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Installing only the local directory..." + /usr/bin/cmake -DCMAKE_INSTALL_LOCAL_ONLY=1 -P cmake_install.cmake +.PHONY : install/local/fast + +# Special rule for the target test +test: + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running tests..." + /usr/bin/ctest --force-new-ctest-process $(ARGS) +.PHONY : test + +# Special rule for the target test +test/fast: test + +.PHONY : test/fast + +# Special rule for the target edit_cache +edit_cache: + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running CMake cache editor..." + /usr/bin/ccmake -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) +.PHONY : edit_cache + +# Special rule for the target edit_cache +edit_cache/fast: edit_cache + +.PHONY : edit_cache/fast + +# Special rule for the target rebuild_cache +rebuild_cache: + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running CMake to regenerate build system..." + /usr/bin/cmake -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) +.PHONY : rebuild_cache + +# Special rule for the target rebuild_cache +rebuild_cache/fast: rebuild_cache + +.PHONY : rebuild_cache/fast + +# Special rule for the target install +install: preinstall + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Install the project..." + /usr/bin/cmake -P cmake_install.cmake +.PHONY : install + +# Special rule for the target install +install/fast: preinstall/fast + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Install the project..." + /usr/bin/cmake -P cmake_install.cmake +.PHONY : install/fast + +# Special rule for the target list_install_components +list_install_components: + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Available install components are: \"Unspecified\"" +.PHONY : list_install_components + +# Special rule for the target list_install_components +list_install_components/fast: list_install_components + +.PHONY : list_install_components/fast + +# The main all target +all: cmake_check_build_system + cd /scratch/isiscmake/isis && $(CMAKE_COMMAND) -E cmake_progress_start /scratch/isiscmake/isis/CMakeFiles /scratch/isiscmake/isis/cmake/CMakeFiles/progress.marks + cd /scratch/isiscmake/isis && $(MAKE) -f CMakeFiles/Makefile2 cmake/all + $(CMAKE_COMMAND) -E cmake_progress_start /scratch/isiscmake/isis/CMakeFiles 0 +.PHONY : all + +# The main clean target +clean: + cd /scratch/isiscmake/isis && $(MAKE) -f CMakeFiles/Makefile2 cmake/clean +.PHONY : clean + +# The main clean target +clean/fast: clean + +.PHONY : clean/fast + +# Prepare targets for installation. +preinstall: all + cd /scratch/isiscmake/isis && $(MAKE) -f CMakeFiles/Makefile2 cmake/preinstall +.PHONY : preinstall + +# Prepare targets for installation. +preinstall/fast: + cd /scratch/isiscmake/isis && $(MAKE) -f CMakeFiles/Makefile2 cmake/preinstall +.PHONY : preinstall/fast + +# clear depends +depend: + cd /scratch/isiscmake/isis && $(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 1 +.PHONY : depend + +# Help Target +help: + @echo "The following are some of the valid targets for this Makefile:" + @echo "... all (the default if no target is provided)" + @echo "... clean" + @echo "... depend" + @echo "... install/strip" + @echo "... install/local" + @echo "... test" + @echo "... edit_cache" + @echo "... rebuild_cache" + @echo "... install" + @echo "... list_install_components" +.PHONY : help + + + +#============================================================================= +# Special targets to cleanup operation of make. + +# Special rule to run CMake to check the build system integrity. +# No rule that depends on this can have commands that come from listfiles +# because they might be regenerated. +cmake_check_build_system: + cd /scratch/isiscmake/isis && $(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 0 +.PHONY : cmake_check_build_system + diff --git a/isis/cmake/RunMakeFileTest.cmake b/isis/cmake/RunMakeFileTest.cmake new file mode 100644 index 0000000000000000000000000000000000000000..242a9dc1ca6c464cb6721fe256a43dec47624479 --- /dev/null +++ b/isis/cmake/RunMakeFileTest.cmake @@ -0,0 +1,80 @@ +#============================================================================ +# Script to read in a MakeFile based test and run it without relying on any +# of the old Makefile infrastructure. +#============================================================================ + +cmake_minimum_required(VERSION 3.3) +list(APPEND CMAKE_MODULE_PATH "${CODE_ROOT}/cmake") +list(APPEND CMAKE_PREFIX_PATH "${CODE_ROOT}/cmake") +include(Utilities) + + +# Function to run the test and check the results +function(run_app_makefile_test makefile inputFolder outputFolder truthFolder binFolder) + + # Build the test name + get_filename_component(sourceFolder ${makefile} DIRECTORY) +# get_filename_component(testName ${sourceFolder} NAME) +# get_filename_component(folder ${sourceFolder} DIRECTORY) +# get_filename_component(folder ${folder} DIRECTORY) +# get_filename_component(appName ${folder} NAME) + set(appName ${appName}_${testName}) + + # Check if there are copies of the input/truth folders in the source folder, + # if so use those instead of the original location. + if(EXISTS ${sourceFolder}/input) + set(inputFolder ${sourceFolder}/input) + endif() + if(EXISTS ${sourceFolder}/truth) + set(truthFolder ${sourceFolder}/truth) + endif() + +# # Read in the MakeFile +# if(NOT EXISTS ${makefile}) +# message(FATAL_ERROR "App test MakeFile ${makefile} was not found!") +# endif() +# file(READ ${makefile} makefileContents) +# # Replace include line with a short list of definitions +# set(newDefinitions "INPUT=${inputFolder}\nOUTPUT=${outputFolder}\nRM=rm -f\nCP=cp\nLS=ls\nMV=mv\nSED=sed\nTAIL=tail\nECHO=echo\nCAT=cat\nLS=ls") +# string(REPLACE "include ${CODE_ROOT}/make/isismake.tsts" "${newDefinitions}" newFileContents "${makefileContents}") +# +# # Set required environment variables +# set(ENV{PATH} "${binFolder}:$ENV{PATH}") +# +# # Select the log file +# set(logFile "${binFolder}/${appName}.output") +# message("logFile = ${logFile}") +# +# # Execute the Makefile we just generated +# set(code "") +# execute_process(COMMAND rm -rf ${outputFolder}) +# execute_process(COMMAND rm -f ${logFile}) + message("SOURCE FOLDER ${sourceFolder}") + execute_process(COMMAND make test WORKING_DIRECTORY ${sourceFolder} OUTPUT_VARIABLE result) + message("result: ${result}") + if (result MATCHES "OK") + set(failed "OFF") + else() + set(failed "ON") + endif() + + + # If any file failed, the test is a failure. + if(${failed}) + message("TRUTH: ${TRUTH}") + message(FATAL_ERROR "Test failed. Result:\n ${result}") + endif() + +endfunction() + + + + +#=================================================================================== +# This is the main script that gets run during the test. +# - Just redirect to the main function call. + +# Needed for IsisPreferences and other test data to be found +set(ENV{ISIS3DATA} "${DATA_ROOT}") + +run_app_makefile_test(${MAKEFILE} ${INPUT_DIR} ${OUTPUT_DIR} ${TRUTH_DIR} ${BIN_DIR}) diff --git a/isis/cmake/RunUnitTest.cmake b/isis/cmake/RunUnitTest.cmake new file mode 100644 index 0000000000000000000000000000000000000000..c64d10584496fbbff918378172346a4cf8a31977 --- /dev/null +++ b/isis/cmake/RunUnitTest.cmake @@ -0,0 +1,77 @@ +#========================================================================= +# Script to run a basic unit test and compare the result to a truth file. +# - This replaces the ISIS UnitTester script. +#========================================================================= + +# Multiple ISIS files need to find things relative to ISISROOT +# and ISIS3DATA so make sure those are set. +set(ENV{ISIS3DATA} "${DATA_ROOT}") + +message(STATUS "ISISROOT = $ENV{ISISROOT}") +message(STATUS "ISIS3DATA = $ENV{ISIS3DATA}") + +# Set up a file for program output +set(outputFile "${TEST_PROG}.output") +message("outputFile = ${outputFile}") +file(REMOVE ${outputFile}) # Make sure no old file exists + +# The test programs need to be run from their source folders +# so that they can find input data files. +get_filename_component(truthFolder ${TRUTH_FILE} DIRECTORY) + +# Test programs also need to be run with the EXACT name "unitTest", +# otherwise a GUI will pop up and ruin the test. +get_filename_component(binFolder ${TEST_PROG} DIRECTORY) +get_filename_component(binName ${TEST_PROG} NAME) +set(tempDir ${binFolder}/${binName}_temp) +execute_process(COMMAND rm -rf ${tempDir}) +execute_process(COMMAND mkdir -p ${tempDir}) +execute_process(COMMAND ln -s ${TEST_PROG} ${truthFolder}/unitTest) + +# Run the unit test executable and pipe the output to a text file. +execute_process(COMMAND ./unitTest + WORKING_DIRECTORY ${truthFolder} + OUTPUT_FILE ${outputFile} + ERROR_FILE ${outputFile} + OUTPUT_VARIABLE result + RESULT_VARIABLE code) +if(result) + message("Test failed: ${result}, ${code}") +endif() + +# If an exclusion file is present, use it to filter out selected lines. +# - Do this by comparing filtered versions of the two files, then +# running the diff on those two temporary files. +set(comp1 ${outputFile}) +set(comp2 ${TRUTH_FILE}) +set(exclusionPath ${truthFolder}/unitTest.exclude) +if(EXISTS ${exclusionPath}) + set(comp1 ${tempDir}/output_exclude.txt) + set(comp2 ${tempDir}/truth_exclude.txt) + # This throws out all lines containing a word from the exclusion file. + execute_process(COMMAND cat ${outputFile} COMMAND grep -v -f ${exclusionPath} + OUTPUT_FILE "${comp1}") + execute_process(COMMAND cat ${TRUTH_FILE} COMMAND grep -v -f ${exclusionPath} + OUTPUT_FILE "${comp2}") + +endif() + +# Verify that the files are exactly the same +execute_process(COMMAND ${CMAKE_COMMAND} -E compare_files + ${comp1} ${comp2} + RESULT_VARIABLE DIFFERENT) + +if(DIFFERENT) + message("------------------ DIFFERENCES ------------------ ") + execute_process(COMMAND diff ${comp1} ${comp2} OUTPUT_VARIABLE compdiff) + message("${compdiff}") + message("------------------------------------------------- ") + message(FATAL_ERROR "Test failed - files differ") + # On error the result file is left around to aid in debugging. +else() + file(REMOVE ${outputFile}) # On success, clean out the result file. + execute_process(COMMAND rm -rf ${tempdir}) +endif() + +# Clean up our temporary folder +execute_process(COMMAND rm -f ${truthFolder}/unitTest) diff --git a/isis/cmake/TestSetup.cmake b/isis/cmake/TestSetup.cmake new file mode 100644 index 0000000000000000000000000000000000000000..c3c3e202b1c8d568eb8220c989cca8e3dd38484e --- /dev/null +++ b/isis/cmake/TestSetup.cmake @@ -0,0 +1,83 @@ +#============================================================ +# This file contains functions to help set tests. +#============================================================ + + +# Generate a test from a folder containing a Makefile and specific sub folders. +# - These are used for application and module tests. +function(add_makefile_test_folder folder prefix_name) + + # For convenience, quietly ignore Makefiles that get passed in instead of folders. + get_filename_component(subName ${folder} NAME) + if("${subName}" STREQUAL "Makefile") + return() + endif() + + # Figure out the input, output, and truth paths + file(RELATIVE_PATH relPath ${CMAKE_SOURCE_DIR} ${folder}) + set(dataDir $ENV{ISIS3TESTDATA}/isis/${relPath}) + set(inputDir ${dataDir}/input) + set(truthDir ${dataDir}/truth) + set(makeFile ${folder}/Makefile) + + # TODO: Improve variable name (from top level file) + # The output folder may be in a different directory + + set(outputDir ${testOutputDir}/${relPath}/output) + + # Define the name CTest will use to refer to this test. + set(testName ${prefix_name}_test_${subName}) + + ## Some tests don't need an input folder but the others must exist + #if(NOT EXISTS ${makeFile}) + # message(FATAL_ERROR "Required file does not exist: ${makeFile}") + #endif() + #if(NOT EXISTS ${truthDir}) + # message(FATAL_ERROR "Required data folder does not exist: ${truthDir}") + #endif() + + # Call lower level function to finish adding the test. + add_makefile_test_target(${testName} ${makeFile} ${inputDir} ${outputDir} ${truthDir}) +endfunction() + + +# Add a Makefile based test to the CMake test list. +macro(add_makefile_test_target testName makeFile inputDir outputDir truthDir) + + set(thisFolder "${PROJECT_SOURCE_DIR}/cmake") + # Set up a cmake script which will execute the command in the makefile + # and then check the results against the truth folder. + add_test(NAME ${testName} + COMMAND ${CMAKE_COMMAND} + -DMAKEFILE=${makeFile} + -DCMAKE_BINARY_DIR=${CMAKE_BINARY_DIR} + -DCODE_ROOT=${PROJECT_SOURCE_DIR} + -DDATA_ROOT=$ENV{ISIS3DATA} + -DINPUT_DIR=${inputDir} + -DOUTPUT_DIR=${outputDir} + -DTRUTH_DIR=${truthDir} + -DBIN_DIR=${CMAKE_BINARY_DIR}/bin + -P ${thisFolder}/RunMakeFileTest.cmake) + set_tests_properties(${testName} PROPERTIES LABELS "app") + +endmacro() + + +# Add a class based unit test with an executable and a truth file. +macro(add_unit_test_target testFile truthFile labels) + + set(thisFolder "${PROJECT_SOURCE_DIR}/cmake") + set(fullTestPath "${CMAKE_BINARY_DIR}/unitTest/${testFile}") # The binary that the script will execute + + # Set up a cmake script which will run the executable + # and then check the results against the truth file. + set(testName ${testFile}) + add_test(NAME ${testName} + COMMAND ${CMAKE_COMMAND} + -DTEST_PROG=${fullTestPath} + -DTRUTH_FILE=${truthFile} + -DDATA_ROOT=$ENV{ISIS3DATA} + -DCODE_ROOT=${PROJECT_SOURCE_DIR} + -P ${thisFolder}/RunUnitTest.cmake) + set_tests_properties(${testName} PROPERTIES LABELS "unit;${labels}") +endmacro() diff --git a/isis/cmake/Utilities.cmake b/isis/cmake/Utilities.cmake new file mode 100644 index 0000000000000000000000000000000000000000..513668a6304e22833bea29f62831fd6c6741767d --- /dev/null +++ b/isis/cmake/Utilities.cmake @@ -0,0 +1,315 @@ +#================================================================================== +# This file contains small utility functions +#================================================================================== + +# Copy one file +function(copy_file src dest) + configure_file(${src} ${dest} COPYONLY) +endfunction() + +# Copy one folder +function(copy_folder src dest) + execute_process(COMMAND cp -r ${src} ${dest}) +endfunction() + +# Copy all files matching a wildcard to the output folder. +function(copy_wildcard wildcard outputFolder) + file(GLOB files ${wildcard}) + file(COPY ${files} DESTINATION ${outputFolder}) +endfunction() + +# Copy all input files to the output folder +function(copy_files_to_folder files folder) + foreach(f ${files}) + get_filename_component(filename ${f} NAME) + set(outputPath "${folder}/${filename}") + configure_file(${f} ${outputPath} COPYONLY) + endforeach() +endfunction() + +# Quit if the file does not exist +function(verify_file_exists path) + if(NOT EXISTS ${path}) + message( FATAL_ERROR "Required file ${path} does not exist!" ) + endif() +endfunction() + +# Set result to ON if the file contains "s", OFF otherwise. +function(file_contains path s result) + file(READ ${path} contents) + string(FIND "${contents}" "${s}" position) + set(${result} ON PARENT_SCOPE) + if(${position} EQUAL -1) + set(${result} OFF PARENT_SCOPE) + endif() +endfunction() + + +# Set result to a list of all the subdirectories in the given directory. +function(get_subdirectory_list curdir result) + file(GLOB children RELATIVE ${curdir} ${curdir}/*) + set(dirlist "") + foreach(child ${children}) + # Skip files and hidden folders. + string(SUBSTRING ${child} 0 1 firstChar) + if( (IS_DIRECTORY ${curdir}/${child}) AND (NOT ${firstChar} STREQUAL ".") ) + list(APPEND dirlist ${curdir}/${child}) + endif() + endforeach() + set(${result} ${dirlist} PARENT_SCOPE) +endfunction() + +# Append the contents of IN_FILE to the end of OUT_FILE +function(cat inFile outFile) + + # If the output file does not exist, init with an empty file. + if(NOT EXISTS "${outFile}") + file(WRITE ${outFile} "") + endif() + + # Perform the file concatenation. + if(EXISTS "${inFile}") + file(READ ${inFile} contents) + file(APPEND ${outFile} "${contents}") + endif() +endfunction() + +# Get the correct location to generate code for items in a given input folder +# - Generated code includes uic, moc, and protobuf files. +function(get_code_gen_dir inputFolder codeGenFolder) + file(RELATIVE_PATH relPath ${PROJECT_SOURCE_DIR} ${inputFolder}) + string(REPLACE "src" "objects" relPath ${relPath}) + set(${codeGenFolder} "${PROJECT_BINARY_DIR}/${relPath}" PARENT_SCOPE) + file(MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/${relPath}") + + # Also add this folder to the include path + # include_directories("${PROJECT_BINARY_DIR}/${relPath}") +endfunction() + +# Determine the text string used to describe this OS version +function(get_os_version text) + + if(UNIX AND NOT APPLE) + + # Fetch OS information + execute_process(COMMAND cat "/etc/os-release" + RESULT_VARIABLE code + OUTPUT_VARIABLE result + ERROR_VARIABLE result) + if ("${code}" STREQUAL "0") + # Extract OS name and version from generic Linux system + string(REGEX MATCH "NAME=[A-Za-z\"]+" name "${result}") + string(REGEX MATCH "VERSION_ID=[0-9\\.\"]+" version "${result}") + string(SUBSTRING ${name} 5 -1 name) + string(SUBSTRING ${version} 11 -1 version) + string(REPLACE "\"" "" name ${name}) + string(REPLACE "\"" "" version ${version}) + string(REPLACE "." "_" version ${version}) + else() + # Try the Red Hat specific command. + execute_process(COMMAND cat "/etc/redhat-release" + RESULT_VARIABLE code + OUTPUT_VARIABLE result + ERROR_VARIABLE result) + if ("${code}" STREQUAL "0") + # Extract OS name and version from Red Hat Linux system + string(REGEX MATCH "[0-9\\.]+" version "${result}") + set(name RedHatEnterprise) # This part is easy + else() + # TODO: Test! + # Try another command + execute_process(COMMAND cat "/etc/lsb-release" + RESULT_VARIABLE code + OUTPUT_VARIABLE result + ERROR_VARIABLE result) + + message("code = ${code}") + message("result = ${result}") + + if ("${code}" STREQUAL "0") + # Extract OS name and version + string(REGEX MATCH "Description:[ A-Za-z0-9\\.]+" version "${result}") # Get the line + string(REPLACE "release" "" version ${version}) # Strip unwanted text + string(REPLACE " " "" version ${version}) + string(REPLACE "Description:" "" version ${version}) + set(name "") # Included in version + else() + # TODO: Test! + # Try the debian specific command + execute_process(COMMAND cat "/etc/debian_version" + RESULT_VARIABLE code + OUTPUT_VARIABLE result + ERROR_VARIABLE result) + + message("code = ${code}") + message("result = ${result}") + if ("${code}" STREQUAL "0") + set(version "${result}") + set(name Debian) + else() + + message( FATAL_ERROR "Did not recognize UNIX operating system!" ) + + endif() + endif() + endif() + endif() + + #message("name = ${name}") + #message("version = ${version}") + + set(prefix "Linux_x86_64_") + + # Build the final output string + elseif(APPLE) + + # Fetch OS information + execute_process(COMMAND sw_vers + OUTPUT_VARIABLE result + ERROR_VARIABLE result) + + # Format the string + string(REGEX MATCH "[0-9]+.[0-9]+.[0-9]+" version "${result}") + string(REGEX MATCH "^[0-9]+.[0-9]+" version "${version}") + string(REPLACE "." "_" version ${version}) + + set(name "MacOSX") + set(prefix "Darwin_x86_64_") + + else() + message( FATAL_ERROR "Did not recognize a supported operating system!" ) + endif() + + # Final string assembly + set(${text} ${prefix}${name}${version} PARENT_SCOPE) +endfunction() + + +# Delete the first N lines of a file +function(apply_skiplines path number) + + if(${number} EQUAL 0) + return() + endif() + + # The first line counts as line 1 for the tail command + MATH(EXPR number "${number}+1") + + set(temp ${path}_temp) + file(RENAME ${path} ${temp}) + message("tail -n +${number} ${temp} OUTPUT_FILE ${path}") + execute_process(COMMAND tail -n +${number} ${temp} OUTPUT_FILE ${path}) + #file(REMOVE ${temp}) +endfunction() + +# Strip all lines beginning with one of the words +function(apply_ignorelines path words) + + set(temp ${path}_temp) + file(RENAME ${path} ${temp}) + + #Set up special grep command to remove these lines + message("words = ${words}") + string(REPLACE " " "|" fullS "${words}") + + message("COMMAND grep -vEw ${fullS} ${temp}") + execute_process(COMMAND grep -vEw ${fullS} ${temp} OUTPUT_FILE ${path}) + + #file(REMOVE ${temp}) +endfunction() + + +#------------------------------------------------------------ + +# Wrapper function to add a library and its components +function(add_library_wrapper name sourceFiles libDependencies) + + # The only optional argument is "alsoStatic", which indicates that + # the library should be build both shared and static. + set(alsoStatic ${ARGN}) + + set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib) + set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib) + + # Add library, set dependencies, and add to installation list. + add_library(${name} SHARED ${sourceFiles}) + set_target_properties(${name} PROPERTIES LINKER_LANGUAGE CXX) + target_link_libraries(${name} ${libDependencies}) + install(TARGETS ${name} DESTINATION lib) + + # buildStaticCore is a command line option specified in the top CMakeLists.txt file. + if(alsoStatic AND ${buildStaticCore}) + # The static version needs a different name, but in the end the file + # needs to have the same name as the shared lib. + set(staticName "${name}_static") + message("Adding static library ${staticName}") + + add_library("${staticName}" STATIC ${sourceFiles}) + set_target_properties(${staticName} PROPERTIES LINKER_LANGUAGE CXX) + target_link_libraries(${staticName} ${libDependencies}) + + # Use a copy -> install combo to get the file to the correct place. + add_custom_command(TARGET ${staticName} POST_BUILD + COMMAND mv ${CMAKE_BINARY_DIR}/src/lib${staticName}.a + ${CMAKE_BINARY_DIR}/src/lib${name}.a) + + install(CODE "EXECUTE_PROCESS(COMMAND cp ${CMAKE_BINARY_DIR}/lib/lib${name}.a + ${CMAKE_INSTALL_PREFIX}/lib/lib${name}.a)") + endif() + +endfunction() + +function(get_version libFile returnVar) + set(${returnVar} "") + set(FOUND_VERSION "") + # Get the File name + get_filename_component(VERSION_FILE ${libFile} NAME_WE) + # message("VERSION_FILE = ${VERSION_FILE}") + # Get the path to the dylib file as the so with version info is in the same area + string(REGEX MATCH "^/(([a-z or A-Z or 0-9])*/)*" PATH_TO_VERSION ${libFile}) + # message("PATH_TO_VERSION= ${PATH_TO_VERSION}") + # Glob for the dylib file with the version number + # message("CURRENT PREFIX = ${PATH_TO_VERSION}${VERSION_FILE}") + file(GLOB FOUND_FILES + "${PATH_TO_VERSION}${VERSION_FILE}-[0-9].[0-9].[0-9]*" + "${PATH_TO_VERSION}${VERSION_FILE}-[0-9].[0-9]*" + "${PATH_TO_VERSION}${VERSION_FILE}-3.1.so" + "${PATH_TO_VERSION}${VERSION_FILE}.[0-9].[0-9].[0-9]*" + "${PATH_TO_VERSION}${VERSION_FILE}_[0-9].[0-9].[0-9]*" + "${PATH_TO_VERSION}${VERSION_FILE}.so.[0-9]*.[0-9]*.[0-9]*" + "${PATH_TO_VERSION}${VERSION_FILE}.so.[0-9]*.[0-9]*" + "${PATH_TO_VERSION}${VERSION_FILE}.[0-9].dylib" + "${PATH_TO_VERSION}${VERSION_FILE}.[0-9]*.[0-9]*.dylib" + ) + # message("FOUND_FILES = ${FOUND_FILES}") + foreach(f ${FOUND_FILES}) + # Ideally glob found a single file and grep for the version number found + get_filename_component(VERSION_FILE ${f} NAME) + + string(REGEX MATCH "[\\.,-][0-9]+\\.[0-9]+\\.[0-9]+" CURR_VERSION ${VERSION_FILE}) + + if(NOT CURR_VERSION) + string(REGEX MATCH "[\\.,-][0-9]+\\.[0-9]+" CURR_VERSION ${VERSION_FILE}) + endif(NOT CURR_VERSION) + + + if(NOT CURR_VERSION) + string(REGEX MATCH "[\\.,-][0-9]+\\." CURR_VERSION ${VERSION_FILE}) + string(SUBSTRING ${CURR_VERSION} 0 2 CURR_VERSION) + endif(NOT CURR_VERSION) + + string(SUBSTRING ${CURR_VERSION} 1 -1 CURR_VERSION) + + if(FOUND_VERSION) + # message("VERSION = ${CURR_VERSION}") + # message("FOUND_VERSION = ${FOUND_VERSION}") + if(${FOUND_VERSION} VERSION_LESS ${CURR_VERSION}) + set(FOUND_VERSION ${CURR_VERSION}) + endif() + else(FOUND_VERSION) + set(FOUND_VERSION ${CURR_VERSION}) + endif(FOUND_VERSION) + + endforeach() + set(${returnVar} ${FOUND_VERSION} PARENT_SCOPE) +endfunction() diff --git a/isis/cmake/cmake_install.cmake b/isis/cmake/cmake_install.cmake new file mode 100644 index 0000000000000000000000000000000000000000..c66bc846889856012f5050787464fd818f5ef576 --- /dev/null +++ b/isis/cmake/cmake_install.cmake @@ -0,0 +1,50 @@ +# Install script for directory: /scratch/isiscmake/isis/cmake + +# Set the install prefix +if(NOT DEFINED CMAKE_INSTALL_PREFIX) + set(CMAKE_INSTALL_PREFIX "/scratch/isiscmake/isis/build") +endif() +string(REGEX REPLACE "/$" "" CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}") + +# Set the install configuration name. +if(NOT DEFINED CMAKE_INSTALL_CONFIG_NAME) + if(BUILD_TYPE) + string(REGEX REPLACE "^[^A-Za-z0-9_]+" "" + CMAKE_INSTALL_CONFIG_NAME "${BUILD_TYPE}") + else() + set(CMAKE_INSTALL_CONFIG_NAME "") + endif() + message(STATUS "Install configuration: \"${CMAKE_INSTALL_CONFIG_NAME}\"") +endif() + +# Set the component getting installed. +if(NOT CMAKE_INSTALL_COMPONENT) + if(COMPONENT) + message(STATUS "Install component: \"${COMPONENT}\"") + set(CMAKE_INSTALL_COMPONENT "${COMPONENT}") + else() + set(CMAKE_INSTALL_COMPONENT) + endif() +endif() + +# Install shared libraries without execute permission? +if(NOT DEFINED CMAKE_INSTALL_SO_NO_EXE) + set(CMAKE_INSTALL_SO_NO_EXE "0") +endif() + +if("${CMAKE_INSTALL_COMPONENT}" STREQUAL "Unspecified" OR NOT CMAKE_INSTALL_COMPONENT) + EXECUTE_PROCESS(COMMAND cp -f /scratch/isiscmake/isis/lib/libisis3.so /scratch/isiscmake/isis/build/lib/libisis3.5.0.so) +endif() + +if("${CMAKE_INSTALL_COMPONENT}" STREQUAL "Unspecified" OR NOT CMAKE_INSTALL_COMPONENT) + EXECUTE_PROCESS(COMMAND ln -sf libisis3.5.0.so /scratch/isiscmake/isis/build/lib/libisis3.5.so) +endif() + +if("${CMAKE_INSTALL_COMPONENT}" STREQUAL "Unspecified" OR NOT CMAKE_INSTALL_COMPONENT) + EXECUTE_PROCESS(COMMAND ln -sf libisis3.5.so /scratch/isiscmake/isis/build/lib/libisis3.so) +endif() + +if("${CMAKE_INSTALL_COMPONENT}" STREQUAL "Unspecified" OR NOT CMAKE_INSTALL_COMPONENT) + EXECUTE_PROCESS(COMMAND ln -sf libisis3.so /scratch/isiscmake/isis/build/lib/libisis.so) +endif() + diff --git a/isis/make/config.darwin-MacOSX10_11 b/isis/make/config.darwin-MacOSX10_11 index 2b600ac626ea5eac65da848fbe326f8212c42dcc..ecd72e9532edda40449fc3792a9217c7ad746bfb 100644 --- a/isis/make/config.darwin-MacOSX10_11 +++ b/isis/make/config.darwin-MacOSX10_11 @@ -39,6 +39,7 @@ endif ISISCPPFLAGS += -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE ISISCPPFLAGS += -fPIC ISISCPPFLAGS += -DGMM_USES_SUPERLU +ISISCPPFLAGS += -std=c++11 #ifeq ($(findstring DEBUG, $(MODE)),DEBUG) ISISCPPFLAGS += -g @@ -373,14 +374,10 @@ NNLIB = -lnn #--------------------------------------------------------------------------- # Setup for Bullet Physics library #--------------------------------------------------------------------------- -#BULLETLIB = -lBullet2FileLoader -lBullet3Collision -lBullet3Common \ -# -lBullet3Dynamics -lBullet3Geometry -lBullet3OpenCL_clew \ -# -lBulletCollision -lBulletDynamics -lBulletInverseDynamics \ -# -lBulletSoftBody -lLinearMath BULLETLIB = -lBullet3OpenCL_clew -lBullet3Common -lBullet3Geometry \ -lBulletSoftBody -lBulletDynamics -lBullet3Dynamics \ -lBulletInverseDynamics -lBulletCollision -lBullet3Collision \ - -lLinearMath + -lLinearMath BULLETINCDIR = -I$(ISIS3LOCAL)/include/bullet BULLETLIBDIR = -L$(ISIS3LOCAL)/lib @@ -394,7 +391,7 @@ ifeq (,$(findstring $(PCLPYFRAMES)/Python.framework,$(wildcard $(PCLPYFRAMES)/Py endif #--------------------------------------------------------------------------- -# Set up for PCL libraries +# Set up for PCL libraries #--------------------------------------------------------------------------- PCLINCDIR = -I$(ISIS3LOCAL)/include/pcl-1.8 PCLLIBDIR = -L$(ISIS3LOCAL)/lib @@ -404,7 +401,7 @@ VTKLIB = -lvtksys-7.0.1 EMBREELIB = -lembree #--------------------------------------------------------------------------- -# Set up for Eigen (link to include files only, no library) +# Set up for Eigen (link to include files only, no library) #--------------------------------------------------------------------------- EIGENINCDIR = -I$(ISIS3OPT)/include/eigen3 diff --git a/isis/make/config.darwin-MacOSX10_13 b/isis/make/config.darwin-MacOSX10_13 new file mode 100644 index 0000000000000000000000000000000000000000..a2134dfcd3098e92c6fcc08ff9ea088c8a25b2bc --- /dev/null +++ b/isis/make/config.darwin-MacOSX10_13 @@ -0,0 +1,602 @@ +# $Id: config.darwin,v 1.47 2010/04/07 00:07:52 kbecker Exp $ +#-------------------------------------------------------------------------- +# Compiler options +#--------------------------------------------------------------------------- +# Build architecture now automatically determined at build time via isis.conf +# include $(ISISROOT)/make/isis.conf + +MAC_ARCH=-arch x86_64 +MAC_XARCH=-Xarch_x86_64 +MAC_OS_MIN=-mmacosx-version-min=10.11 +MAC_ARCH_FLAGS = $(MAC_ARCH) $(MAC_XARCH) $(MAC_OS_MIN) + +QTDEFINES= -DQT_GUI_LIB -DQT_CORE_LIB DQT_NO_DEBUG + +ISIS_MACOSX_TARGET=10.11 + +ISIS_CFLAGS= -pipe -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk -Wall -W -Wno-unused-parameter -fPIC $(MAC_ARCH_FLAGS) $(QTDEFINES) + +ISIS_CPPFLAGS= -pipe -stdlib=libc++ -std=c++11 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk -Wall -W -Wno-unused-parameter -fPIC $(MAC_ARCH_FLAGS) $(QTDEFINES) + +ISIS_LFLAGS=-headerpad_max_install_names -stdlib=libc++ -Wl,-syslibroot,/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk $(MAC_ARCH_FLAGS) + +ISIS_INC_PATH= -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/System/Library/Frameworks/OpenGL.framework/Headers -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/System/Library/Frameworks/AGL.framework/Headers + +# flags to be used only when compiling protobuf generated source files +ISIS_PROTOBUF_FLAGS= -w + +# Basically is GNU g++/gcc +CXX = g++ +CC = gcc + +ifeq ($(HOST_PROC), powerpc) + # Powerpc support + ISISCPPFLAGS += -DISIS_LITTLE_ENDIAN=0 +else + # Assumes Intel Mac + ISISCPPFLAGS += -DISIS_LITTLE_ENDIAN=1 +endif +ISISCPPFLAGS += -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE +ISISCPPFLAGS += -fPIC +ISISCPPFLAGS += -DGMM_USES_SUPERLU +ISISCPPFLAGS += -std=c++11 + +#ifeq ($(findstring DEBUG, $(MODE)),DEBUG) + ISISCPPFLAGS += -g + ISISCPPFLAGS += -O0 +#else + ISISCPPFLAGS += -O2 +#endif +ISISCFLAGS = $(ISIS_CFLAGS) + +#--------------------------------------------------------------------------- +# Linker options. Runtime paths for Mac is rooted to $ISISROOT +#--------------------------------------------------------------------------- +#ISISLDFLAGS = -headerpad_max_install_names $(MAC_ARCH_FLAGS) -bind_at_load -Wl,-w +#ISISLDFLAGS += $(ISIS_LFLAGS) -bind_at_load -Wl,-w +ISISLDFLAGS += $(ISIS_LFLAGS) -Wl,-w +ISISLDRPATH = -Wl,-rpath,@loader_path/.. -Wl,-rpath,$(ISISROOT) +ISISSYSLIBS = -lz -lm -framework ApplicationServices +ISISSTATIC = +ISISDYNAMIC = + +#--------------------------------------------------------------------------- +# Shared library options +#--------------------------------------------------------------------------- +#RANLIB = /usr/bin/ranlib +RANLIB = /usr/bin/true +SHAREDLIBEXT = dylib +DYLIBVERSION = -compatibility_version $(ISISMAJOR).$(ISISMINOR) \ + -current_version $(ISISLIBVERSION) +DYLIBFLAGS = $(MAC_ARCH_FLAGS) -dynamiclib -flat_namespace \ + -single_module -undefined suppress +ISISSHAREDFLAGS = $(MAC_ARCH_FLAGS) -bundle -flat_namespace -dynamic \ + -undefined suppress +ISISSHAREDON = +ISISSHAREDOFF = +ISISARFLAGS = + +#--------------------------------------------------------------------------- +# Set ISIS Dev Kit (IDK) paths. This setting of ISISLOCALVERSION here will +# override this macro set in isismake.os (KJB 2013-12-12) +#--------------------------------------------------------------------------- +#ISISLOCALVERSION := v006 +IDK_ROOT ?= /opt/usgs/$(ISISLOCALVERSION) +ISIS3OPT ?= $(IDK_ROOT)/ports +ISIS3EXEC ?= $(ISIS3OPT)/libexec +ISIS3LOCAL ?= $(IDK_ROOT)/3rdparty +ISIS3PROP ?= $(IDK_ROOT)/proprietary + +# Set up paths to needed for doxygen +DOXYGEN = $(ISIS3OPT)/bin/doxygen +DOT_PATH = $(ISIS3OPT)/bin +GREP = /usr/local/bin/grep + +# Set up path for OS specific locations of 3rd party licenses +THIRDPARTYLICPATH := /opt/usgs/$(ISISLOCALVERSION)/3rdParty/license/ + +#--------------------------------------------------------------------------- +# Set up for cwd +#--------------------------------------------------------------------------- +CWDINCDIR = +CWDLIBDIR = +CWDLIB = + +#--------------------------------------------------------------------------- +# Set up for Qt +#--------------------------------------------------------------------------- +QTDIR = $(ISIS3EXEC)/qt5 + +QTFRAMEWORKDIR = $(QTDIR)/lib + +QTINCDIR = -I$(QTDIR)/mkspecs/macx-clang +QTINCDIR += -isystem $(QTFRAMEWORKDIR)/QtCore.framework/Headers +QTINCDIR += -isystem $(QTFRAMEWORKDIR)/QtConcurrent.framework/Headers +QTINCDIR += -isystem $(QTFRAMEWORKDIR)/QtDBus.framework/Headers +QTINCDIR += -isystem $(QTFRAMEWORKDIR)/QtGui.framework/Headers +QTINCDIR += -isystem $(QTFRAMEWORKDIR)/QtMultimedia.framework/Headers +QTINCDIR += -isystem $(QTFRAMEWORKDIR)/QtMultimediaWidgets.framework/Headers +QTINCDIR += -isystem $(QTFRAMEWORKDIR)/QtNetwork.framework/Headers +QTINCDIR += -isystem $(QTFRAMEWORKDIR)/QtNfc.framework/Headers +QTINCDIR += -isystem $(QTFRAMEWORKDIR)/QtOpenGL.framework/Headers +QTINCDIR += -isystem $(QTFRAMEWORKDIR)/QtPositioning.framework/Headers +QTINCDIR += -isystem $(QTFRAMEWORKDIR)/QtPrintSupport.framework/Headers +QTINCDIR += -isystem $(QTFRAMEWORKDIR)/QtQml.framework/Headers +QTINCDIR += -isystem $(QTFRAMEWORKDIR)/QtQuick.framework/Headers +QTINCDIR += -isystem $(QTFRAMEWORKDIR)/QtQuickParticles.framework/Headers +QTINCDIR += -isystem $(QTFRAMEWORKDIR)/QtQuickTest.framework/Headers +QTINCDIR += -isystem $(QTFRAMEWORKDIR)/QtQuickWidgets.framework/Headers +QTINCDIR += -isystem $(QTFRAMEWORKDIR)/QtScript.framework/Headers +QTINCDIR += -isystem $(QTFRAMEWORKDIR)/QtScriptTools.framework/Headers +QTINCDIR += -isystem $(QTFRAMEWORKDIR)/QtSensors.framework/Headers +QTINCDIR += -isystem $(QTFRAMEWORKDIR)/QtSerialPort.framework/Headers +QTINCDIR += -isystem $(QTFRAMEWORKDIR)/QtSql.framework/Headers +QTINCDIR += -isystem $(QTFRAMEWORKDIR)/QtSvg.framework/Headers +QTINCDIR += -isystem $(QTFRAMEWORKDIR)/QtTest.framework/Headers +QTINCDIR += -isystem $(QTFRAMEWORKDIR)/QtWebChannel.framework/Headers +QTINCDIR += -isystem $(QTFRAMEWORKDIR)/QtWebEngine.framework/Headers +QTINCDIR += -isystem $(QTFRAMEWORKDIR)/QtWebKit.framework/Headers +QTINCDIR += -isystem $(QTFRAMEWORKDIR)/QtWebKitWidgets.framework/Headers +QTINCDIR += -isystem $(QTFRAMEWORKDIR)/QtWebSockets.framework/Headers +QTINCDIR += -isystem $(QTFRAMEWORKDIR)/QtWidgets.framework/Headers +QTINCDIR += -isystem $(QTFRAMEWORKDIR)/QtXml.framework/Headers +QTINCDIR += -isystem $(QTFRAMEWORKDIR)/QtXmlPatterns.framework/Headers +#QTINCDIR += -isystem $(QTFRAMEWORKDIR)/QtAssistant.framework/Headers +#QTINCDIR += -isystem $(QTFRAMEWORKDIR)/QtUiPlugin.framework/Headers + +QTINCDIR += -iframework $(QTFRAMEWORKDIR) + +# turn -isystem to -I and -framework to -F for QT MOC includes +QTINCDIR_MOC = $(subst -iframework ,-F,$(subst -isystem ,-I,$(QTINCDIR))) + +QTLIBDIR = -L$(QTFRAMEWORKDIR) -F$(QTFRAMEWORKDIR) + +QTFRAMEWORKS = -framework QtXmlPatterns -framework QtXml -framework QtNetwork \ + -framework QtSql -framework QtGui -framework QtCore -framework QtSvg \ + -framework QtTest -framework QtWebKit -framework QtOpenGL \ + -framework QtConcurrent -framework QtDBus \ + -framework QtMultimedia -framework QtMultimediaWidgets \ + -framework QtNfc -framework QtPositioning -framework QtPrintSupport \ + -framework QtQml -framework QtQuick -framework QtQuickParticles \ + -framework QtQuickTest -framework QtQuickWidgets -framework QtScript \ + -framework QtScriptTools -framework QtSensors -framework QtSerialPort \ + -framework QtWebKitWidgets -framework QtWebSockets -framework QtWidgets \ + -framework QtTest -framework QtWebChannel -framework QtWebEngine + +QTCOMMONFRAMEWORKS = -framework DiskArbitration -framework IOKit +QTLIB = $(QTFRAMEWORKS) $(QTCOMMONFRAMEWORKS) + +QTOPENGL = -framework OpenGL -framework AGL + +UIC = $(QTDIR)/bin/uic +RCC = $(QTDIR)/bin/rcc +RCCDEFINES = +MOC = $(QTDIR)/bin/moc +MOCDEFINES += $(QTDARWINFLAGS) +MOCDEFINES += $(QTINCDIR_MOC) # Moc may not need QT includes +MOCDEFINES += -D__APPLE__ -D__GNUC__ + +#--------------------------------------------------------------------------- +# Set up for Qwt +#--------------------------------------------------------------------------- +QWTDIR = $(ISIS3OPT) +QWTFRAMES = $(QWTDIR)/Library/Frameworks +ifeq (,$(findstring $(QWTFRAMES)/qwt.framework,$(wildcard $(QWTFRAMES)/qwt.framework ))) + QWTFRAMES = $(ISIS3OPT)/lib +endif + +QWTINCDIR = -I$(QWTFRAMES)/qwt.framework/Headers +QWTLIBDIR = -L$(QWTFRAMES) -F$(QWTFRAMES) +QWTLIB = -framework qwt + +#--------------------------------------------------------------------------- +# Set up for Xerces +#--------------------------------------------------------------------------- +XERCESINCDIR = -I$(ISIS3OPT)/include/xercesc +XERCESLIBDIR = -L$(ISIS3OPT)/lib +XERCESLIB = -lxerces-c + +XALAN = $(ISIS3OPT)/bin/Xalan + +#--------------------------------------------------------------------------- +# Set up for GeoTiff +#--------------------------------------------------------------------------- +GEOTIFFINCDIR = -I$(ISIS3OPT)/include +GEOTIFFLIBDIR = -L$(ISIS3OPT)/lib +GEOTIFFLIB = -lgeotiff + +#--------------------------------------------------------------------------- +# Set up for proj (Needed on Macs for geotiff) +#--------------------------------------------------------------------------- +PROJINCDIR = -I$(ISIS3OPT)/include +PROJLIBDIR = -L$(ISIS3OPT)/lib +PROJLIB = -lproj + +#--------------------------------------------------------------------------- +# Set up for Tiff +#--------------------------------------------------------------------------- +TIFFINCDIR = -I$(ISIS3OPT)/include +TIFFLIBDIR = -L$(ISIS3OPT)/lib +TIFFLIB = -ltiff + +#--------------------------------------------------------------------------- +# Set up for naif cspice libraries. Update for N0066 Release (KJB 2017-06-28) +#--------------------------------------------------------------------------- +NAIFINCDIR = -I$(ISIS3LOCAL)/include/naif/ +NAIFLIBDIR = -L$(ISIS3LOCAL)/lib +NAIFLIB = -lcspice + +#--------------------------------------------------------------------------- +# Set up for TNT +#--------------------------------------------------------------------------- +TNTINCDIR = -I$(ISIS3LOCAL)/include/tnt +TNTLIBDIR = +TNTLIB = + +#--------------------------------------------------------------------------- +# Set up for JAMA +#--------------------------------------------------------------------------- +JAMAINCDIR = -I$(ISIS3LOCAL)/include/jama +JAMALIBDIR = +JAMALIB = + +#--------------------------------------------------------------------------- +# Set up for GEOS +#--------------------------------------------------------------------------- +GEOSINCDIR = -isystem $(ISIS3OPT)/include/geos +GEOSLIBDIR = -L$(ISIS3OPT)/lib +GEOSLIB = -lgeos -lgeos_c + +#--------------------------------------------------------------------------- +# Set up for the GNU Scientific Library (GSL). Note that this setup +# suppports include patterns such as . With this +# format, any other include spec that points to the general include +# directory, such as GEOS, will suffice. Therefore, an explicit +# include directive is ommitted but provided as an empty reference +# in cases where it may be located elsewhere. This also goes for the +# library reference. +#--------------------------------------------------------------------------- +GSLINCDIR = -I$(ISIS3OPT)/include/gsl +GSLLIBDIR = -L$(ISIS3OPT)/lib +GSLLIB = -lgsl -lgslcblas + +#--------------------------------------------------------------------------- +# Set up for GMM +#--------------------------------------------------------------------------- +GMMINCDIR = -isystem $(ISIS3LOCAL)/include +GMMLIBDIR = +GMMLIB = + +#--------------------------------------------------------------------------- +# Set up for SuperLU +#--------------------------------------------------------------------------- +SUPERLUINCDIR = -I$(ISIS3LOCAL)/include/superlu +SUPERLULIBDIR = -L$(ISIS3LOCAL)/lib +ifeq ($(HOST_PROC), powerpc) +# Powerpc support + SUPERLULIB = -lsuperlu_3.0 -framework vecLib +else +# Assumes Intel Mac + SUPERLULIB = -lsuperlu -lblas +endif + +#--------------------------------------------------------------------------- +# Set up for Google Protocol Buffers (ProtoBuf) +#--------------------------------------------------------------------------- +PROTOBUFINCDIR = -isystem $(ISIS3OPT)/include/google +PROTOBUFLIBDIR = -L$(ISIS3OPT)/lib +PROTOBUFLIB = -lprotobuf +PROTOC = $(ISIS3OPT)/bin/protoc + +#--------------------------------------------------------------------------- +# Set up for kakadu +# The Kakadu library is proprietary. The source files cannot be distributed +# with ISIS3. If you need to rebuild ISIS3 on your system, then you will +# need to modify the lines below that pertain to the location of the +# header files and library on your system. The compilation flag, ENABLEJP2K, +# should be set to true if you are building with the Kakadu library and +# you want to use the JPEG2000 specific code in the ISIS3 system. Otherwise, +# set the ENABLEJP2K flag to false. +# +# Added abililty to automatically detect the existance of the Kakadu include +# directory. One can set the environment variable JP2KFLAG with a 1 or 0 +# depending upon need. Developers can define appropriate enviroment variables +# for the complete JP2K environment. Just redefine them based upon the usage +# below (i.e., be sure to add -I, -L and -l to the variables for KAKADUINCDIR, +# KAKADULIBDIR and KAKADULIB, respectively). +#--------------------------------------------------------------------------- +KAKADUINCDIR := "-isystem$(ISIS3PROP)/include/kakadu/v7_9_1-01762L" +KAKADULIBDIR := -L$(ISIS3PROP)/lib +KAKADULIB := -lkdu_a79R -lkdu_v79R +# Strip -I from Kakadu include directory macro and check for existance +JP2KFLAG ?= $(shell if [ -d $(subst -isystem,,$(KAKADUINCDIR)) ]; then echo "1"; else echo "0"; fi;) +ISISCPPFLAGS += -DENABLEJP2K=$(JP2KFLAG) + +#--------------------------------------------------------------------------- +# Set up for Boost Library +#--------------------------------------------------------------------------- +BOOSTINCDIR = "-isystem $(ISIS3OPT)/include" +BOOSTLIBDIR = -L$(ISIS3OPT)/lib +BOOSTLIB = -lboost_date_time-mt -lboost_filesystem-mt -lboost_graph-mt \ + -lboost_math_c99f-mt -lboost_math_c99l-mt -lboost_math_c99-mt \ + -lboost_math_tr1f-mt -lboost_math_tr1l-mt -lboost_math_tr1-mt \ + -lboost_prg_exec_monitor-mt -lboost_program_options-mt \ + -lboost_regex-mt -lboost_serialization-mt -lboost_signals-mt \ + -lboost_system-mt -lboost_thread-mt -lboost_unit_test_framework-mt \ + -lboost_wave-mt -lboost_wserialization-mt -lboost_timer-mt \ + -lboost_chrono-mt + +#--------------------------------------------------------------------------- +# Set up for Cholmod Libraries +#--------------------------------------------------------------------------- +CHOLMODINCDIR = -I$(ISIS3LOCAL)/include/SuiteSparse +CHOLMODLIBDIR = -L$(ISIS3LOCAL)/lib +CHOLMODLIB = -lcholmod -lamd -lcolamd -lcamd -framework Accelerate + +#--------------------------------------------------------------------------- +# Set up for HDF5 libraries +#--------------------------------------------------------------------------- +#HDF5INCDIR = -I$(ISIS3OPT)/include +HDF5LIBDIR = -L$(ISIS3OPT)/lib +HDF5LIB = -lhdf5 -lhdf5_hl -lhdf5_cpp -lhdf5_hl_cpp + +#--------------------------------------------------------------------------- +# Set up for OpenCV libraries +# +# Add the following line to your app's Makefile (see the NN notes) +# ALLLIBS += $(OPENCVLIBS) +#--------------------------------------------------------------------------- +#OPENCVINCDIR = -I$(ISIS3OPT)/include +#OPENCVLIBDIR = -L$(ISIS3OPT)/lib # Redundant +OPENCVLIBS = -lopencv_calib3d -lopencv_core \ + -lopencv_features2d -lopencv_xfeatures2d \ + -lopencv_flann -lopencv_highgui \ + -lopencv_imgproc -lopencv_imgcodecs \ + -lopencv_ml -lopencv_objdetect \ + -lopencv_photo -lopencv_stitching -lopencv_superres \ + -lopencv_video -lopencv_videostab + +#--------------------------------------------------------------------------- +# Set up for Natural Neighbor Library (NN) +# +# * Note that NNINCDIR is not added to ALLINCDIRS in isismake.os +# * and NNLIB is not added to ALLLIBDIRS in isismake.os +# +# For now, if you want to use this library, modify your app's Makefile. +# Add an empty line after the last line in the Makefile, then add +# ALLLIBS += $(NNLIB) +# on a new line. +#--------------------------------------------------------------------------- +NNINCDIR = -I$(ISIS3LOCAL)/include/nn +#NNLIBDIR = -L$(ISIS3LOCAL)/lib +NNLIB = -lnn + +#--------------------------------------------------------------------------- +# Setup for Bullet Physics library +#--------------------------------------------------------------------------- +BULLETLIB = -lBullet3OpenCL_clew -lBullet3Common -lBullet3Geometry \ + -lBulletSoftBody -lBulletDynamics -lBullet3Dynamics \ + -lBulletInverseDynamics -lBulletCollision -lBullet3Collision \ + -lLinearMath +BULLETINCDIR = -I$(ISIS3LOCAL)/include/bullet +BULLETLIBDIR = -L$(ISIS3LOCAL)/lib + +#--------------------------------------------------------------------------- +# Set up for PCL Python framework +#--------------------------------------------------------------------------- +PCLPYDIR = $(ISIS3OPT) +PCLPYFRAMES = $(PCLPYDIR)/Library/Frameworks +ifeq (,$(findstring $(PCLPYFRAMES)/Python.framework,$(wildcard $(PCLPYFRAMES)/Python.framework ))) + PCLPYFRAMES = $(ISIS3OPT)/lib +endif + +#--------------------------------------------------------------------------- +# Set up for PCL libraries +#--------------------------------------------------------------------------- +PCLINCDIR = -I$(ISIS3LOCAL)/include/pcl-1.8 +PCLLIBDIR = -L$(ISIS3LOCAL)/lib +PCLLIB = -lpcl_common -lpcl_octree -lpcl_io \ + -framework Python -lintl +VTKLIB = -lvtksys-7.0.1 +EMBREELIB = -lembree + +#--------------------------------------------------------------------------- +# Set up for Eigen (link to include files only, no library) +#--------------------------------------------------------------------------- +EIGENINCDIR = -I$(ISIS3OPT)/include/eigen3 + +#--------------------------------------------------------------------------- +# Final generic setup for includes at the top level +#--------------------------------------------------------------------------- +DEFAULTINCDIR = -I$(ISIS3LOCAL)/include + +#--------------------------------------------------------------------------- +# Define the third party distribution libraries (patterns) +#--------------------------------------------------------------------------- + +# Qt Libraries +THIRDPARTYLIBS += "$(QTFRAMEWORKDIR)/QtXmlPatterns.framework" +THIRDPARTYLIBS += "$(QTFRAMEWORKDIR)/QtXml.framework" +THIRDPARTYLIBS += "$(QTFRAMEWORKDIR)/QtNetwork.framework" +THIRDPARTYLIBS += "$(QTFRAMEWORKDIR)/QtSql.framework" +THIRDPARTYLIBS += "$(QTFRAMEWORKDIR)/QtGui.framework" +THIRDPARTYLIBS += "$(QTFRAMEWORKDIR)/QtCore.framework" +THIRDPARTYLIBS += "$(QTFRAMEWORKDIR)/QtSvg.framework" +THIRDPARTYLIBS += "$(QTFRAMEWORKDIR)/QtTest.framework" +THIRDPARTYLIBS += "$(QTFRAMEWORKDIR)/QtWebEngine.framework" +THIRDPARTYLIBS += "$(QTFRAMEWORKDIR)/QtWebEngineCore.framework" +THIRDPARTYLIBS += "$(QTFRAMEWORKDIR)/QtWebKit.framework" +THIRDPARTYLIBS += "$(QTFRAMEWORKDIR)/QtOpenGL.framework" +THIRDPARTYLIBS += "$(QTFRAMEWORKDIR)/QtConcurrent.framework" +THIRDPARTYLIBS += "$(QTFRAMEWORKDIR)/QtDBus.framework" +THIRDPARTYLIBS += "$(QTFRAMEWORKDIR)/QtMultimedia.framework" +THIRDPARTYLIBS += "$(QTFRAMEWORKDIR)/QtMultimediaWidgets.framework" +THIRDPARTYLIBS += "$(QTFRAMEWORKDIR)/QtNfc.framework" +THIRDPARTYLIBS += "$(QTFRAMEWORKDIR)/QtPositioning.framework" +THIRDPARTYLIBS += "$(QTFRAMEWORKDIR)/QtPrintSupport.framework" +THIRDPARTYLIBS += "$(QTFRAMEWORKDIR)/QtQml.framework" +THIRDPARTYLIBS += "$(QTFRAMEWORKDIR)/QtQuick.framework" +THIRDPARTYLIBS += "$(QTFRAMEWORKDIR)/QtQuickParticles.framework" +THIRDPARTYLIBS += "$(QTFRAMEWORKDIR)/QtQuickTest.framework" +THIRDPARTYLIBS += "$(QTFRAMEWORKDIR)/QtQuickWidgets.framework" +THIRDPARTYLIBS += "$(QTFRAMEWORKDIR)/QtScript.framework" +THIRDPARTYLIBS += "$(QTFRAMEWORKDIR)/QtScriptTools.framework" +THIRDPARTYLIBS += "$(QTFRAMEWORKDIR)/QtSensors.framework" +THIRDPARTYLIBS += "$(QTFRAMEWORKDIR)/QtSerialPort.framework" +THIRDPARTYLIBS += "$(QTFRAMEWORKDIR)/QtWebKitWidgets.framework" +THIRDPARTYLIBS += "$(QTFRAMEWORKDIR)/QtWebSockets.framework" +THIRDPARTYLIBS += "$(QTFRAMEWORKDIR)/QtWidgets.framework" +THIRDPARTYLIBS += "$(QTFRAMEWORKDIR)/QtWebChannel.framework" +THIRDPARTYLIBS += "$(QWTFRAMES)/qwt.framework" + +# Qt dependencies +THIRDPARTYLIBS += "$(ISIS3OPT)/lib/libpcre16*.dylib" +THIRDPARTYLIBS += "$(ISIS3OPT)/lib/libgthread-*.dylib" +THIRDPARTYLIBS += "$(ISIS3OPT)/lib/libpcre.*dylib" +THIRDPARTYLIBS += "$(ISIS3OPT)/lib/libharfbuzz*.dylib" +THIRDPARTYLIBS += "$(ISIS3OPT)/lib/libgraphite2.*dylib" +THIRDPARTYLIBS += "$(ISIS3OPT)/lib/libleveldb*.dylib*" +THIRDPARTYLIBS += "$(ISIS3OPT)/lib/libsnappy.*dylib" +THIRDPARTYLIBS += "$(ISIS3OPT)/lib/libwebp*.dylib" +THIRDPARTYLIBS += "$(ISIS3OPT)/lib/libdbus*.dylib" + +THIRDPARTYLIBS += "$(ISIS3LOCAL)/lib/libcspice*.dylib" +THIRDPARTYLIBS += "$(ISIS3LOCAL)/lib/libsuperlu*.dylib" +THIRDPARTYLIBS += "$(ISIS3OPT)/lib/libprotobuf*.dylib" +THIRDPARTYLIBS += "$(ISIS3OPT)/lib/libiconv*.dylib" +THIRDPARTYLIBS += "$(ISIS3OPT)/lib/libxerces-c*.dylib" +THIRDPARTYLIBS += "$(ISIS3OPT)/lib/libgeotiff*.dylib" +THIRDPARTYLIBS += "$(ISIS3OPT)/lib/libtiff*.dylib" +THIRDPARTYLIBS += "$(ISIS3OPT)/lib/liblzma*.dylib" +THIRDPARTYLIBS += "$(ISIS3OPT)/lib/libgsl*.dylib" +THIRDPARTYLIBS += "$(ISIS3OPT)/lib/libz*.dylib" +THIRDPARTYLIBS += "$(ISIS3OPT)/lib/libssl*.dylib" +THIRDPARTYLIBS += "$(ISIS3OPT)/lib/libcrypto*.dylib" +THIRDPARTYLIBS += "$(ISIS3OPT)/lib/libpng*.dylib" +THIRDPARTYLIBS += "$(ISIS3OPT)/lib/libtiff.*dylib" +THIRDPARTYLIBS += "$(ISIS3OPT)/lib/libjpeg.*dylib" +THIRDPARTYLIBS += "$(ISIS3OPT)/lib/libmng.*dylib" +THIRDPARTYLIBS += "$(ISIS3OPT)/lib/liblcms2.*dylib" +THIRDPARTYLIBS += "$(ISIS3OPT)/lib/libgeos*.dylib" +THIRDPARTYLIBS += "$(ISIS3OPT)/lib/libsqlite3.*dylib" +THIRDPARTYLIBS += "$(ISIS3OPT)/lib/postgresql*/libpq.*dylib" +THIRDPARTYLIBS += "$(ISIS3OPT)/lib/mysql56/mysql/libmysqlclient*.dylib" +THIRDPARTYLIBS += "$(ISIS3OPT)/lib/libiodbc*.dylib" +THIRDPARTYLIBS += "$(ISIS3PROP)/lib/libkdu_a79R.dylib" +THIRDPARTYLIBS += "$(ISIS3PROP)/lib/libkdu_v79R.dylib" + + +THIRDPARTYLIBS += "$(ISIS3LOCAL)/lib/libamd*.dylib" +THIRDPARTYLIBS += "$(ISIS3LOCAL)/lib/libcamd*.dylib" +THIRDPARTYLIBS += "$(ISIS3LOCAL)/lib/libcholmod*.dylib" +THIRDPARTYLIBS += "$(ISIS3LOCAL)/lib/libsuitesparseconfig*.dylib" +THIRDPARTYLIBS += "$(ISIS3LOCAL)/lib/libccolamd*.dylib" +THIRDPARTYLIBS += "$(ISIS3LOCAL)/lib/libcolamd*.dylib" +#THIRDPARTYLIBS += "/System/Library/Frameworks/Accelerate.framework" + +THIRDPARTYLIBS += "$(ISIS3OPT)/lib/libhdf5*.dylib" + +# Add all the OpenCV libraries and its dependancies +THIRDPARTYLIBS += "$(ISIS3OPT)/lib/libopencv_*.dylib" +THIRDPARTYLIBS += "$(ISIS3OPT)/lib/libtbb*.dylib" +THIRDPARTYLIBS += "$(ISIS3OPT)/lib/libjasper*.dylib" +THIRDPARTYLIBS += "$(ISIS3OPT)/lib/libImath*.dylib" +THIRDPARTYLIBS += "$(ISIS3OPT)/lib/libIlmImf*.dylib" +THIRDPARTYLIBS += "$(ISIS3OPT)/lib/libIex*.dylib" +THIRDPARTYLIBS += "$(ISIS3OPT)/lib/libHalf*.dylib" +THIRDPARTYLIBS += "$(ISIS3OPT)/lib/libIlmThread*.dylib" +THIRDPARTYLIBS += "$(ISIS3OPT)/lib/libavcodec*.dylib" +THIRDPARTYLIBS += "$(ISIS3OPT)/lib/libavformat*.dylib" +THIRDPARTYLIBS += "$(ISIS3OPT)/lib/libavutil*.dylib" +THIRDPARTYLIBS += "$(ISIS3OPT)/lib/libswscale*.dylib" + +# Secondary requirements to all OpenCV dependancies (Yuck!) +THIRDPARTYLIBS += "$(ISIS3OPT)/lib/libSDL-1*.dylib" +THIRDPARTYLIBS += "$(ISIS3OPT)/lib/libnettle*.dylib" +THIRDPARTYLIBS += "$(ISIS3OPT)/lib/libhogweed*.dylib" +THIRDPARTYLIBS += "$(ISIS3OPT)/lib/libgmp*.dylib" +THIRDPARTYLIBS += "$(ISIS3OPT)/lib/libxvidcore*.dylib" +THIRDPARTYLIBS += "$(ISIS3OPT)/lib/libx264*.dylib" +THIRDPARTYLIBS += "$(ISIS3OPT)/lib/libvorbisenc*.dylib" +THIRDPARTYLIBS += "$(ISIS3OPT)/lib/libvorbis*.dylib" +THIRDPARTYLIBS += "$(ISIS3OPT)/lib/libogg*.dylib" +THIRDPARTYLIBS += "$(ISIS3OPT)/lib/libtheoraenc*.dylib" +THIRDPARTYLIBS += "$(ISIS3OPT)/lib/libtheoradec*.dylib" +THIRDPARTYLIBS += "$(ISIS3OPT)/lib/libspeex*.dylib" +THIRDPARTYLIBS += "$(ISIS3OPT)/lib/libschroedinger-1*.dylib" +THIRDPARTYLIBS += "$(ISIS3OPT)/lib/libopus*.dylib" +THIRDPARTYLIBS += "$(ISIS3OPT)/lib/libopenjpeg*.dylib" +THIRDPARTYLIBS += "$(ISIS3OPT)/lib/libmp3lame*.dylib" +THIRDPARTYLIBS += "$(ISIS3OPT)/lib/libmodplug*.dylib" +THIRDPARTYLIBS += "$(ISIS3OPT)/lib/libfreetype*.dylib" +THIRDPARTYLIBS += "$(ISIS3OPT)/lib/libbluray*.dylib" +THIRDPARTYLIBS += "$(ISIS3OPT)/lib/libass*.dylib" +THIRDPARTYLIBS += "$(ISIS3OPT)/lib/libgnutls*.dylib" +THIRDPARTYLIBS += "$(ISIS3OPT)/lib/libbz2*.dylib" +THIRDPARTYLIBS += "$(ISIS3OPT)/lib/libXrandr*.dylib" +THIRDPARTYLIBS += "$(ISIS3OPT)/lib/libXext*.dylib" +THIRDPARTYLIBS += "$(ISIS3OPT)/lib/libXrender*.dylib" +THIRDPARTYLIBS += "$(ISIS3OPT)/lib/libX11*.dylib" +THIRDPARTYLIBS += "$(ISIS3OPT)/lib/libxcb*.dylib" +THIRDPARTYLIBS += "$(ISIS3OPT)/lib/libXau*.dylib" +THIRDPARTYLIBS += "$(ISIS3OPT)/lib/libXdmcp*.dylib" +THIRDPARTYLIBS += "$(ISIS3OPT)/lib/liborc-0*.dylib" +THIRDPARTYLIBS += "$(ISIS3OPT)/lib/libxml2*.dylib" +THIRDPARTYLIBS += "$(ISIS3OPT)/lib/libfribidi*.dylib" +THIRDPARTYLIBS += "$(ISIS3OPT)/lib/libfontconfig*.dylib" +#THIRDPARTYLIBS += "$(ISIS3OPT)/lib/libenca*.dylib" +THIRDPARTYLIBS += "$(ISIS3OPT)/lib/libexpat*.dylib" +THIRDPARTYLIBS += "$(ISIS3OPT)/lib/libintl*.dylib" +THIRDPARTYLIBS += "$(ISIS3OPT)/lib/libglib-*.dylib" +THIRDPARTYLIBS += "$(ISIS3OPT)/lib/libp11-kit*.dylib" +THIRDPARTYLIBS += "$(ISIS3OPT)/lib/libffi*.dylib" + +# OpenCV3 dependencies +THIRDPARTYLIBS += "$(ISIS3OPT)/lib/libavresample*.dylib" +THIRDPARTYLIBS += "$(ISIS3OPT)/lib/libxcb-shm*.dylib" +THIRDPARTYLIBS += "$(ISIS3OPT)/lib/libsoxr*.dylib" +THIRDPARTYLIBS += "$(ISIS3OPT)/lib/libopenjp2*.dylib" +THIRDPARTYLIBS += "$(ISIS3OPT)/lib/libOpenNI*.dylib" +THIRDPARTYLIBS += "$(ISIS3OPT)/lib/libswresample*.dylib" +THIRDPARTYLIBS += "$(ISIS3OPT)/lib/libidn*.dylib" +THIRDPARTYLIBS += "$(ISIS3OPT)/lib/libtasn1*.dylib" +THIRDPARTYLIBS += "$(ISIS3OPT)/lib/libusb*.dylib" + +# libxerces-c depends on these libraries +THIRDPARTYLIBS += "$(ISIS3OPT)/lib/libicui18n*.dylib" +THIRDPARTYLIBS += "$(ISIS3OPT)/lib/libicuuc*.dylib" +THIRDPARTYLIBS += "$(ISIS3OPT)/lib/libicudata*.dylib" + +# libgeotiff depends on these libraries +THIRDPARTYLIBS += "$(ISIS3OPT)/lib/libproj*.dylib" + +# Bullet Libraries +THIRDPARTYLIBS += "$(ISIS3LOCAL)/lib/libLinearMath*.dylib" +THIRDPARTYLIBS += "$(ISIS3LOCAL)/lib/libBullet2FileLoader*.dylib" +THIRDPARTYLIBS += "$(ISIS3LOCAL)/lib/libBullet3Collision*.dylib" +THIRDPARTYLIBS += "$(ISIS3LOCAL)/lib/libBullet3Common*.dylib" +THIRDPARTYLIBS += "$(ISIS3LOCAL)/lib/libBullet3Dynamics*.dylib" +THIRDPARTYLIBS += "$(ISIS3LOCAL)/lib/libBullet3Geometry*.dylib" +THIRDPARTYLIBS += "$(ISIS3LOCAL)/lib/libBullet3OpenCL_clew*.dylib" +THIRDPARTYLIBS += "$(ISIS3LOCAL)/lib/libBulletCollision*.dylib" +THIRDPARTYLIBS += "$(ISIS3LOCAL)/lib/libBulletDynamics*.dylib" +THIRDPARTYLIBS += "$(ISIS3LOCAL)/lib/libBulletInverseDynamics*.dylib" +THIRDPARTYLIBS += "$(ISIS3LOCAL)/lib/libBulletSoftBody*.dylib" + +# Add the Point Cloud Libraries and PCL dependencies +THIRDPARTYLIBS += "$(ISIS3LOCAL)/lib/libpcl_*.dylib" +THIRDPARTYLIBS += "$(ISIS3OPT)/lib/libflann*.dylib" +THIRDPARTYLIBS += "$(ISIS3OPT)/lib/libqhull*.dylib" +THIRDPARTYLIBS += "$(ISIS3OPT)/lib/libvtk*.dylib" +THIRDPARTYLIBS += "$(PCLPYFRAMES)/Python.framework" + +# Add the Embree library +THIRDPARTYLIBS += "$(ISIS3LOCAL)/lib/libembree*.dylib" +THIRDPARTYLIBS += "$(ISIS3OPT)/lib/libtbb*.dylib" + +# Add the Boost libraries +#THIRDPARTYLIBS += "$(ISIS3OPT)/lib/libboost_system-mt*.dylib" +THIRDPARTYLIBS += "$(ISIS3OPT)/lib/libboost*.dylib" + +# Plugins +THIRDPARTYPLUGINS += "$(QTDIR)/plugins/" diff --git a/isis/make/config.linux-x86_32 b/isis/make/config.linux-x86_32 index 4546d52eff783cc76614d8d21c7e98292d22d88b..9f6edeb255ac067eb738af73c36a2d3b037235ca 100644 --- a/isis/make/config.linux-x86_32 +++ b/isis/make/config.linux-x86_32 @@ -77,6 +77,7 @@ endif #--------------------------------------------------------------------------- QTINCDIR = -I$(ISIS3LOCAL)/include/qt/qt4.6.2 QTINCDIR += -I$(ISIS3LOCAL)/include/qt/qt4.6.2/Qt +QTINCDIR += -I$(ISIS3LOCAL)/include/qt/qt4.6.2/QtChrats QTINCDIR += -I$(ISIS3LOCAL)/include/qt/qt4.6.2/QtCore QTINCDIR += -I$(ISIS3LOCAL)/include/qt/qt4.6.2/QtAssistant QTINCDIR += -I$(ISIS3LOCAL)/include/qt/qt4.6.2/QtGui diff --git a/isis/make/config.linux-x86_64 b/isis/make/config.linux-x86_64 index 57e96f2cb275d1f6c855d76415e2dca6cf0c532d..f9d039a5236c59684e61524ccbcb988b429b251e 100644 --- a/isis/make/config.linux-x86_64 +++ b/isis/make/config.linux-x86_64 @@ -115,7 +115,6 @@ QTINCDIR += -I$(ISIS3LOCAL)/include/qt/qt5.7.1/QtXml QTINCDIR += -I$(ISIS3LOCAL)/include/qt/qt5.7.1/QtXmlPatterns QTLIBDIR = -L$(ISIS3LOCAL)/lib QTLIB = -lQt5Core -lQt5Concurrent -lQt5XmlPatterns -lQt5Xml -lQt5Network -lQt5Sql -lQt5Gui -lQt5PrintSupport -lQt5Positioning -lQt5Qml -lQt5Quick -lQt5Sensors -lQt5Svg -lQt5Test -lQt5OpenGL -lQt5Widgets -lQt5Multimedia -lQt5MultimediaWidgets -lQt5WebChannel -lQt5WebEngine -lQt5WebEngineWidgets -lQt5DBus - UIC = $(ISIS3LOCAL)/bin/uic MOC = $(ISIS3LOCAL)/bin/moc RCC = $(ISIS3LOCAL)/bin/rcc @@ -300,14 +299,14 @@ FLANNINCDIR = -I$(ISIS3LOCAL)/include/flann QHULLINCDIR = -I$(ISIS3LOCAL)/include/qhull #--------------------------------------------------------------------------- -# Set up for Embree libraries +# Set up for Embree libraries #--------------------------------------------------------------------------- EMBREEINCDIR = -I$(ISIS3LOCAL)/include/embree2 EMBREELIBDIR = -L$(ISIS3LOCAL)/lib EMBREELIB = -lembree #--------------------------------------------------------------------------- -# Set up for OpenCV libraries +# Set up for OpenCV libraries # # Add the following line to your app's Makefile (see the NN notes) # ALLLIBS += $(OPENCVLIBS) @@ -344,11 +343,11 @@ NNLIB = -lnn #BULLETLIB = -lBullet3Collision -lBullet3Common \ # -lBullet3Dynamics -lBullet3Geometry -lBullet3OpenCL_clew \ # -lBulletCollision -lBulletDynamics -lBulletInverseDynamics \ -# -lBulletSoftBody -lLinearMath +# -lBulletSoftBody -lLinearMath BULLETLIB = -lBullet3OpenCL_clew -lBullet3Common -lBullet3Geometry \ -lBulletSoftBody -lBulletDynamics -lBullet3Dynamics \ -lBulletInverseDynamics -lBulletCollision -lBullet3Collision \ - -lLinearMath + -lLinearMath BULLETINCDIR = -I$(ISIS3LOCAL)/include/bullet BULLETLIBDIR = -L$(ISIS3LOCAL)/lib @@ -526,5 +525,8 @@ THIRDPARTYLIBS += "$(ISIS3LOCAL)/lib/libtbb*.so*" # Add the Boost libraries THIRDPARTYLIBS += "$(ISIS3LOCAL)/lib/libboost*.so*" +# Add srtp deps (Qt5WebEngine deps) -- see #5365 +THIRDPARTYLIBS += "$(ISIS3SYSLIB)/libsrtp*.so*" + # Plugins THIRDPARTYPLUGINS += "$(ISIS3LOCAL)/plugins/" diff --git a/isis/make/config.linux-x86_64_Debian8 b/isis/make/config.linux-x86_64_Debian8 index ba893d58d02c7a8505f4c28e290e9685178dc912..376ef9c0cdcdcd7b74186c6bf456f6b51490e9d9 100644 --- a/isis/make/config.linux-x86_64_Debian8 +++ b/isis/make/config.linux-x86_64_Debian8 @@ -115,7 +115,6 @@ QTINCDIR += -I$(ISIS3LOCAL)/include/qt/qt5.7.1/QtXml QTINCDIR += -I$(ISIS3LOCAL)/include/qt/qt5.7.1/QtXmlPatterns QTLIBDIR = -L$(ISIS3LOCAL)/lib QTLIB = -lQt5Core -lQt5Concurrent -lQt5XmlPatterns -lQt5Xml -lQt5Network -lQt5Sql -lQt5Gui -lQt5PrintSupport -lQt5Positioning -lQt5Qml -lQt5Quick -lQt5Sensors -lQt5Svg -lQt5Test -lQt5OpenGL -lQt5Widgets -lQt5Multimedia -lQt5MultimediaWidgets -lQt5WebChannel -lQt5WebEngine -lQt5WebEngineWidgets -lQt5DBus - UIC = $(ISIS3LOCAL)/bin/uic MOC = $(ISIS3LOCAL)/bin/moc RCC = $(ISIS3LOCAL)/bin/rcc @@ -298,7 +297,7 @@ FLANNINCDIR = -I$(ISIS3LOCAL)/include/flann QHULLINCDIR = -I$(ISIS3LOCAL)/include/qhull #--------------------------------------------------------------------------- -# Set up for Embree libraries +# Set up for Embree libraries #--------------------------------------------------------------------------- EMBREEINCDIR = -I$(ISIS3LOCAL)/include/embree2 EMBREELIBDIR = -L$(ISIS3LOCAL)/lib @@ -346,7 +345,7 @@ NNLIB = -lnn BULLETLIB = -lBullet3OpenCL_clew -lBullet3Common -lBullet3Geometry \ -lBulletSoftBody -lBulletDynamics -lBullet3Dynamics \ -lBulletInverseDynamics -lBulletCollision -lBullet3Collision \ - -lLinearMath + -lLinearMath BULLETINCDIR = -I$(ISIS3LOCAL)/include/bullet #--------------------------------------------------------------------------- @@ -359,6 +358,7 @@ DEFAULTINCDIR = -I$(ISIS3LOCAL)/include #--------------------------------------------------------------------------- # Qt Libraries + THIRDPARTYLIBS += "$(ISIS3LOCAL)/lib/libQt5Concurrent.so" THIRDPARTYLIBS += "$(ISIS3LOCAL)/lib/libQt5Concurrent.so.5" THIRDPARTYLIBS += "$(ISIS3LOCAL)/lib/libQt5Concurrent.so.5.7.*[^g]" diff --git a/isis/make/config.linux-x86_64_Fedora21 b/isis/make/config.linux-x86_64_Fedora21 index 558089c7f155485a6b3d993916735fd6e9131f96..b2bbbcf5091bd424abf577facead3b517465f977 100644 --- a/isis/make/config.linux-x86_64_Fedora21 +++ b/isis/make/config.linux-x86_64_Fedora21 @@ -301,14 +301,14 @@ FLANNINCDIR = -I$(ISIS3LOCAL)/include/flann #QHULLINCDIR = -I$(ISIS3LOCAL)/include/qhull #--------------------------------------------------------------------------- -# Set up for Embree libraries +# Set up for Embree libraries #--------------------------------------------------------------------------- EMBREEINCDIR = -I$(ISIS3LOCAL)/include/embree2 EMBREELIBDIR = -L$(ISIS3LOCAL)/lib EMBREELIB = -lembree #--------------------------------------------------------------------------- -# Set up for OpenCV libraries +# Set up for OpenCV libraries # # Add the following line to your app's Makefile (see the NN notes) # ALLLIBS += $(OPENCVLIBS) @@ -345,11 +345,11 @@ NNLIB = -lnn BULLETLIB = -lBullet3Collision -lBullet3Common \ -lBullet3Dynamics -lBullet3Geometry -lBullet3OpenCL_clew \ -lBulletCollision -lBulletDynamics -lBulletInverseDynamics \ - -lBulletSoftBody -lLinearMath + -lBulletSoftBody -lLinearMath #BULLETLIB = -lBullet3OpenCL_clew -lBullet3Common -lBullet3Geometry \ # -lBulletSoftBody -lBulletDynamics -lBullet3Dynamics \ # -lBulletInverseDynamics -lBulletCollision -lBullet3Collision \ -# -lLinearMath +# -lLinearMath BULLETINCDIR = -I$(ISIS3LOCAL)/include/bullet BULLETLIBDIR = -L$(ISIS3LOCAL)/lib @@ -368,6 +368,7 @@ DEFAULTINCDIR = -I$(ISIS3LOCAL)/include #--------------------------------------------------------------------------- # Qt Libraries + THIRDPARTYLIBS += "$(ISIS3LOCAL)/lib/libQt5Concurrent.so" THIRDPARTYLIBS += "$(ISIS3LOCAL)/lib/libQt5Concurrent.so.5" THIRDPARTYLIBS += "$(ISIS3LOCAL)/lib/libQt5Concurrent.so.5.7.*[^g]" diff --git a/isis/make/config.linux-x86_64_Fedora25 b/isis/make/config.linux-x86_64_Fedora25 index fc5d1f12b1490859ff9e728dcf198a710b46a7f0..54e80fe6c089d46b35d4481d991342bfc388116d 100644 --- a/isis/make/config.linux-x86_64_Fedora25 +++ b/isis/make/config.linux-x86_64_Fedora25 @@ -301,14 +301,14 @@ FLANNINCDIR = -I$(ISIS3LOCAL)/include/flann #QHULLINCDIR = -I$(ISIS3LOCAL)/include/qhull #--------------------------------------------------------------------------- -# Set up for Embree libraries +# Set up for Embree libraries #--------------------------------------------------------------------------- EMBREEINCDIR = -I$(ISIS3LOCAL)/include/embree2 EMBREELIBDIR = -L$(ISIS3LOCAL)/lib EMBREELIB = -lembree #--------------------------------------------------------------------------- -# Set up for OpenCV libraries +# Set up for OpenCV libraries # # Add the following line to your app's Makefile (see the NN notes) # ALLLIBS += $(OPENCVLIBS) @@ -345,11 +345,11 @@ NNLIB = -lnn BULLETLIB = -lBullet3Collision -lBullet3Common \ -lBullet3Dynamics -lBullet3Geometry -lBullet3OpenCL_clew \ -lBulletCollision -lBulletDynamics -lBulletInverseDynamics \ - -lBulletSoftBody -lLinearMath + -lBulletSoftBody -lLinearMath #BULLETLIB = -lBullet3OpenCL_clew -lBullet3Common -lBullet3Geometry \ # -lBulletSoftBody -lBulletDynamics -lBullet3Dynamics \ # -lBulletInverseDynamics -lBulletCollision -lBullet3Collision \ -# -lLinearMath +# -lLinearMath BULLETINCDIR = -I$(ISIS3LOCAL)/include/bullet BULLETLIBDIR = -L$(ISIS3LOCAL)/lib @@ -368,6 +368,7 @@ DEFAULTINCDIR = -I$(ISIS3LOCAL)/include #--------------------------------------------------------------------------- # Qt Libraries + THIRDPARTYLIBS += "$(ISIS3LOCAL)/lib/libQt5Concurrent.so" THIRDPARTYLIBS += "$(ISIS3LOCAL)/lib/libQt5Concurrent.so.5" THIRDPARTYLIBS += "$(ISIS3LOCAL)/lib/libQt5Concurrent.so.5.7.*[^g]" @@ -479,7 +480,6 @@ THIRDPARTYLIBS += "$(ISIS3LOCAL)/lib/libsuperlu*.so" THIRDPARTYLIBS += "$(ISIS3LOCAL)/lib/libsuitesparseconfig.so" THIRDPARTYLIBS += "$(ISIS3LOCAL)/lib/liblapack.so" THIRDPARTYLIBS += "$(ISIS3SYSLIB)/libblas*.so*" -THIRDPARTYLIBS += "$(ISIS3ALTSYSLIB)/libgfortran.so*" THIRDPARTYLIBS += "$(ISIS3LOCAL)/lib/libxerces-c*.so*" THIRDPARTYLIBS += "$(ISIS3LOCAL)/lib/libgeotiff*.so*" THIRDPARTYLIBS += "$(ISIS3LOCAL)/lib/libtiff*.so*" @@ -533,5 +533,9 @@ THIRDPARTYLIBS += "$(ISIS3LOCAL)/lib/libtbb*.so*" # Add the Boost libraries THIRDPARTYLIBS += "$(ISIS3LOCAL)/lib/libboost*.so*" +# Add and patch the gfortran's rpath to $ORIGIN (so it can find its quadmath dependency) -- #4610 +PATCHLIBS += "$(ISIS3ALTSYSLIB)/libgfortran.so*" +THIRDPARTYLIBS += "$(ISIS3SYSLIB)/libquadmath*.so*" + # Plugins THIRDPARTYPLUGINS += "$(ISIS3LOCAL)/plugins/" diff --git a/isis/make/config.linux-x86_64_Ubuntu14_04 b/isis/make/config.linux-x86_64_Ubuntu14_04 index c2a0d1e46d1f9d976977c0a6e0b5f061f3ed0c64..5cd34f75518182576ffdc29d81e9943d564d6b8f 100644 --- a/isis/make/config.linux-x86_64_Ubuntu14_04 +++ b/isis/make/config.linux-x86_64_Ubuntu14_04 @@ -298,7 +298,7 @@ FLANNINCDIR = -I$(ISIS3LOCAL)/include/flann QHULLINCDIR = -I$(ISIS3LOCAL)/include/qhull #--------------------------------------------------------------------------- -# Set up for Embree libraries +# Set up for Embree libraries #--------------------------------------------------------------------------- EMBREEINCDIR = -I$(ISIS3LOCAL)/include/embree2 EMBREELIBDIR = -L$(ISIS3LOCAL)/lib @@ -355,6 +355,7 @@ DEFAULTINCDIR = -I$(ISIS3LOCAL)/include #--------------------------------------------------------------------------- # Qt Libraries + THIRDPARTYLIBS += "$(ISIS3LOCAL)/lib/libQt5Concurrent.so" THIRDPARTYLIBS += "$(ISIS3LOCAL)/lib/libQt5Concurrent.so.5" THIRDPARTYLIBS += "$(ISIS3LOCAL)/lib/libQt5Concurrent.so.5.7.*[^g]" diff --git a/isis/make/isismake.tsts b/isis/make/isismake.tsts index 76155b0af953014618cbb2f5ac3cfa93733f0fb9..fd840c31c8ae1352fee3bae23715309fa0f120c4 100644 --- a/isis/make/isismake.tsts +++ b/isis/make/isismake.tsts @@ -83,7 +83,7 @@ endif # Make sure all apps use the correct preferences file when testing, unless # they have set NOPREFERENCES. This is valid for non-Isis apps. ifeq ($(origin NOPREFERENCES), undefined) - APPNAME += -preference=$(ISISROOT)/src/base/objs/Preference/TestPreferences + APPNAME += -preference=$(ISISROOT)/TestPreferences endif # set the output variable to the output directory @@ -105,7 +105,7 @@ FILECOUNTMISMATCH =echo Failed ... Number of files in truth and output folder do NOTALLMATCH =echo Failed ... Not all files in truth and output folders match # Set test arguments for use in category tests -TSTARGS = -preference=$(ISISROOT)/src/base/objs/Preference/TestPreferences +TSTARGS = -preference=$(ISISROOT)/TestPreferences DIRPATTERN=2774 FILEPATTERN=2664 @@ -113,7 +113,7 @@ DIRLISTPATTERN="drwxrwsr--" #---------------------------------------------------------------------------- # Target = help -# Dependencies = +# Dependencies = # # Displays a list of targets and their descriptions. #---------------------------------------------------------------------------- @@ -190,19 +190,19 @@ test: FORCE clean if [ "$(findstring $(TESTNOCLEAN), $(MODE))" != "$(TESTNOCLEAN)" ]; \ then \ $(MAKE) ccsafeclean; \ - fi; - + fi; + #------------------------------------------------------------------------- --- -# Target = compare -# Dependencies = All files in the truth and output directories -# -# Iterates over the list of files in the truth directory and -# compares the files against the files in the output directory. -# If successful (indicated by presence of casesucceeded.txt), -# prints success message. If not, prints all errors that were -# encountered (found in errors.txt). +# Target = compare +# Dependencies = All files in the truth and output directories +# +# Iterates over the list of files in the truth directory and +# compares the files against the files in the output directory. +# If successful (indicated by presence of casesucceeded.txt), +# prints success message. If not, prints all errors that were +# encountered (found in errors.txt). #------------------------------------------------------------------------- --- -compare: FORCE +compare: FORCE if [ -d "$(OUTPUT)" ]; then \ if [ -d "$(TRUTH)" ]; then \ TRUTHDIR=`$(LS) $(TRUTH)`; \ @@ -249,7 +249,7 @@ compare: FORCE # Target = comparefiles # Dependencies = All files in the truth and output directories # -# Iterates over the list of files in the truth directory and +# Iterates over the list of files in the truth directory and # compares the files against the files in the output # directory. If there are any files that are not recognized # then an unknown file message is printed. If and only if all @@ -260,7 +260,7 @@ compare: FORCE # # Some parts of this target are not very straightforward. For comparing cubes, # users may specify make variables within their tests to indicate tolerance or -# to ignore special pixels when running cubediff +# to ignore special pixels when running cubediff # (i.e. test_cube.cub.TOLERANCE=0.0000001). The problem here is that within # this target, we have the current filename that is being compared stored in a # bash variable. We know that the *make* tolerance variable, if it exists, will @@ -279,7 +279,7 @@ compare: FORCE # # The workaround is to use make's special variable that is a space-separated # list of currently defined make variable *names* (NOT values). This variable -# is .VARIABLES. The names of each of the currently defined make .TOLERANCE +# is .VARIABLES. The names of each of the currently defined make .TOLERANCE # variables are extracted from this list, and their values are looked up as # well. A new bash variable is used to hold these name/values pairs for each of # the tolerances (the name and value is separated by a semicolon). The list of @@ -292,11 +292,11 @@ compare: FORCE # This is only a workaround. The real solution would be to completely get rid # of make variable tolerances from all tests and force the use of .DIFF files # (like pvldiff uses). However, around 138 tests are currently using make -# variables to do this, so it would be a considerable undertaking. -# -# +# variables to do this, so it would be a considerable undertaking. +# +# # 2012-06-26 - Jeannie Backer - Sent stderr of pvldiff and cnetdiff to error -# files instead of /dev/null. If errors exist, test fails and +# files instead of /dev/null. If errors exist, test fails and # error messages are reported to stdout. This was already # being handled for cubediff. #---------------------------------------------------------------------------- @@ -502,7 +502,7 @@ comparefiles: FORCE #---------------------------------------------------------------------------- # Target = truthdata -# Dependencies = +# Dependencies = # # Copies the contents of the output directory to the truth # directory. If the truth directory doesn't exist it is created. @@ -514,10 +514,10 @@ truthdata: FORCE #---------------------------------------------------------------------------- # Target = ostruthdata -# Dependencies = +# Dependencies = # # Copies the contents of the output directory to the truth -# directory. If the truth directory corresponding to the +# directory. If the truth directory corresponding to the # OS the test is being run on doesn't exist it is created. #---------------------------------------------------------------------------- ostruthdata: FORCE @@ -536,12 +536,12 @@ ostruthdata: FORCE # Target = output # Dependencies = FORCE commands modifyFiles # -# Masks target command with a better name to just run the -# commands. If the output directory doesn't exist it is +# Masks target command with a better name to just run the +# commands. If the output directory doesn't exist it is # created. The force target is needed because the directory # output causes make to check the directory output if there # is no dependency. Runs the commands and then -# modifies the output files based on the variables set +# modifies the output files based on the variables set # in the test. #---------------------------------------------------------------------------- output: FORCE clean @@ -550,14 +550,14 @@ output: FORCE clean $(MAKE) modifyFiles; #---------------------------------------------------------------------------- -# This target is needed to make the output target work. When used as a +# This target is needed to make the output target work. When used as a # dependency to a target, it forces make to always execute that target. #---------------------------------------------------------------------------- FORCE: #---------------------------------------------------------------------------- # Target = clean -# Dependencies = +# Dependencies = # # Deletes the output directory and all temporary files. #---------------------------------------------------------------------------- @@ -567,7 +567,7 @@ clean: FORCE #---------------------------------------------------------------------------- # Target = ccsafeclean -# Dependencies = +# Dependencies = # # Deletes the output directory and all temporary files except the code # coverage files. @@ -580,11 +580,11 @@ ccsafeclean: FORCE # Target = modifyFiles # Dependencies = modText modBin # -# Performs the modifications to the files in the output -# directory. Iterates over the output files and modifies +# Performs the modifications to the files in the output +# directory. Iterates over the output files and modifies # the file based on variables such as .SKIPLINES # Utilizes the modText and modBin targets to carryout -# the modifactions. +# the modifactions. #---------------------------------------------------------------------------- modifyFiles: FORCE files="$(notdir $(wildcard $(OUTPUT)/*.txt) )"; \ @@ -602,7 +602,7 @@ modifyFiles: FORCE #---------------------------------------------------------------------------- # Target = modText -# Dependencies = +# Dependencies = # # Handles the modifactions of text files in the output # directory. Looks at variables .SKIPLINES and .IGNORELINES. @@ -637,12 +637,12 @@ modText: FORCE #---------------------------------------------------------------------------- # Target = modBin -# Dependencies = +# Dependencies = # # Handles the modifactions of bin files in the output # directory. Looks at variables .BINSKIP and .BINCOUNT. # The variable FILE must be set to the name of the file in -# the output directory to be modified. +# the output directory to be modified. #---------------------------------------------------------------------------- modBin: FORCE if [ "$(FILE)" != "" ]; \ @@ -665,7 +665,7 @@ modBin: FORCE # Target = checkin # Dependencies = copyInTruth # -# Copies data from the test into the test data area. +# Copies data from the test into the test data area. # ISIS3TESTDATA needs to be set to know where to copy # data for this test to. Data in the input and all of the truth # directories are copied to the test data area. @@ -720,12 +720,12 @@ checkin: FORCE #---------------------------------------------------------------------------- # Target = copyInTruth -# Dependencies = +# Dependencies = # -# Copies all of the truth directories to the value in the +# Copies all of the truth directories to the value in the # variable DEST. Iterates over all of the directories in the # test that have truth in it. Creates the directory in DEST -# and then copies all of the files in the truth directory to +# and then copies all of the files in the truth directory to # directory in DEST. #---------------------------------------------------------------------------- copyInTruth: FORCE @@ -744,11 +744,11 @@ copyInTruth: FORCE # Target = checkout # Dependencies = dirs copyOutTruth # -# Copies data from the test data area into the test. +# Copies data from the test data area into the test. # ISIS3TESTDATA needs to be set to know where to get the # test data from. Uses the TESTDATA_PATH to get the data -# for this test. Copies the files from the input directory in the -# TESTDATA_PATH to the input directory of the test. Then +# for this test. Copies the files from the input directory in the +# TESTDATA_PATH to the input directory of the test. Then # copies all of the truth directories and their contents to the test. # If the input or truth directories exist in the local test a warning # is printed and no copying takes place. @@ -773,7 +773,7 @@ checkout: FORCE if [ "$$inputdir" != "" ]; \ then \ $(MAKE) dirs; \ - $(RSYNC) -rt --delete $(TESTDATA_PATH)/input/ input; \ + $(RSYNC) -rt --copy-links --delete $(TESTDATA_PATH)/input/ input; \ fi; \ fi; \ $(MAKE) copyOutTruth DEST=$(TESTDATA_PATH); \ @@ -781,10 +781,10 @@ checkout: FORCE #---------------------------------------------------------------------------- # Target = copyOutTruth -# Dependencies = +# Dependencies = # -# Copies all of the truth directories from the value in the -# variable DEST. Iterates over all of the directories in +# Copies all of the truth directories from the value in the +# variable DEST. Iterates over all of the directories in # DEST that have truth in it. Creates the directory in test # and then copies all of the files from the DEST directory # to the one in the test. @@ -795,7 +795,7 @@ copyOutTruth: FORCE files=`$(LS) $(DEST)/$$i`; \ if [ "$$files" != "" ]; \ then \ - $(RSYNC) -rt --delete $(DEST)/$$i/ $$i; \ + $(RSYNC) -rt --copy-links --delete $(DEST)/$$i/ $$i; \ fi; \ done; @@ -850,7 +850,7 @@ release: FORCE clean #---------------------------------------------------------------------------- # Target = dirs -# Dependencies = +# Dependencies = # # Creates the necessary directories for the test. #---------------------------------------------------------------------------- @@ -859,14 +859,14 @@ dirs: FORCE #---------------------------------------------------------------------------- # Target=changePerms -# Dependencies = +# Dependencies = # # Changes the directory permissions starting at DEST_PATH # and preceding up the directory path till a directory is found -# that matches the DIRLISTPATTERN variable. Both the +# that matches the DIRLISTPATTERN variable. Both the # LOOKUP and DEST_PATH variables need to be set in order -# to work properly. LOOKUP is the first directory to start checking -# folder permissions on, and DEST_PATH is the full directory +# to work properly. LOOKUP is the first directory to start checking +# folder permissions on, and DEST_PATH is the full directory # path above the LOOKUP directory. #---------------------------------------------------------------------------- changePerms: FORCE diff --git a/isis/scripts/IsisInlineDocumentBuild_mod.xsl b/isis/scripts/IsisInlineDocumentBuild_mod.xsl new file mode 100644 index 0000000000000000000000000000000000000000..bcf90f1f5a9588f2551e47b6dc70d84c6d2d9479 --- /dev/null +++ b/isis/scripts/IsisInlineDocumentBuild_mod.xsl @@ -0,0 +1,50 @@ + + + + + + + + + + + + + + + + + +# Set up Xalan's command-line option names. +XALAN := XALAN_BIN_LOCATION +XALAN_VALIDATE_OPTION := -v +XALAN_OUTFILE_OPTION := -o +XALAN_PARAM_OPTION := -p +XALAN_INFILE_OPTION := +XALAN_XSL_OPTION := + +docs: + echo " Constructing []" + + $(XALAN) $(XALAN_PARAM_OPTION) menuPath "'../../'" $(XALAN_PARAM_OPTION) filenameParam "''" $(XALAN_OUTFILE_OPTION) $(XALAN_INFILE_OPTION) .xml $(XALAN_XSL_OPTION) ../../build/IsisPrimaryPageBuild.xsl + $(XALAN) $(XALAN_PARAM_OPTION) menuPath "'../../'" $(XALAN_PARAM_OPTION) filenameParam "''" $(XALAN_OUTFILE_OPTION) $(XALAN_INFILE_OPTION) .xml $(XALAN_XSL_OPTION) ../../build/IsisSubPageBuild.xsl + + + + + + + + diff --git a/isis/scripts/fetchRequiredData.py b/isis/scripts/fetchRequiredData.py new file mode 100644 index 0000000000000000000000000000000000000000..38e6c608b0faa464842888442fcb643fe4b389e2 --- /dev/null +++ b/isis/scripts/fetchRequiredData.py @@ -0,0 +1,645 @@ + +import sys, os + +def main(): + + # Hardcoded list of downloadable files needed to run tests + fileList = ''' +cassini/testData/CM_1540484927_1_001.ir.cub +mer/testData/mer.img +mer/testData/mer.lab +galileo/testData/1213r.img +messenger/kernels/ck/msgr20111020.bc +cassini/calibration/vims/RC19/solar-spectrum/ +base/templates/labels/ +galileo/calibration/conversionFactors_v001.sav +galileo/calibration/conversionFactors_v002.sav +galileo/calibration/weightTables_v001.sav +messenger/kernels/ck/msgr20111019.bc +lro/kernels/ck/lrolc_2009181_2009213_v02.bc +clementine1/calibration/nir/nirmodeflats/strip015_set4_061_065_33_a_n.cub +clementine1/calibration/uvvis/lub_comp_flat_long.cub +clementine1/calibration/uvvis/uvvisTemperature.tbl +newhorizons/calibration/target-wavelengths-expanded.csv +odyssey/testData/I50695002EDR.proj.reduced.cub +galileo/calibration/shutter/calibration.so02F.cub +messenger/testData/EW0089570936I.IMG +lro/apps/mrf2pds/tsts/CH_Lev2/input/FSR_CDR_LV2_01921_0R_Lev2.cub +mer/calibration/REFPIXVAR_105.cub +mer/calibration/REFPIXVAR_110.cub +lro/apps/mrf2pds/tsts/CH_Lev2/input/FSR_CDR_LV2_01921_0R_Lev2.cub +messenger/kernels/ck/msgr20111018.bc +lro/kernels/ck/lrolc_2009181_2009213_v02.bc +base/dems/ulcn2005_lpo_0004.cub +clementine1/calibration/nir/clemnircal.def +calibration/uvvis/uvvisTemperature.tbl +odyssey/testData/I56969027EDR.proj.reduced.cub +galileo/calibration/gain/redf.cal04.cub +galileo/calibration/gain/clrf.cal04.cub +mro/testData/ctx_pmoi_i_00003.bottom.cub +messenger/testData/EW0031592574E.IMG +lro/apps/mrf2pds/tsts/CH_Lev2/input/FSR_CDR_LV2_01921_0R_Lev2.cub +cassini/calibration/darkcurrent/ +apollo15/templates/apolloPanFiducialFinder.pvl +base/dems/ulcn2005_lpo_0004.cub +clementine1/translations/ +lro/translations/ +viking1/translations/ +mgs/translations/ +mariner10/translations/ +mariner10/calibration/mariner_10_CLE_A_coef.cub +mariner10/calibration/mariner_10_ORA_A_coef.cub +mariner10/calibration/mariner_10_CLE_B_coef.cub +mariner10/calibration/mariner_10_ORA_B_coef.cub +mariner10/calibration/mariner_10_UV_B_coef.cub +clementine1/calibration/hires/lhd_flat.cub +clementine1/calibration/nir/nir.addflats.dat +clementine1/calibration/uvvis/lua_comp_flat_long.cub +clementine1/calibration/uvvis/lue_uncomp_flat_long.cub +messenger/translations/ +messenger/templates/ +lo/templates/ +chandrayaan1/bandBin/ +chandrayaan1/translations/ +chandrayaan1/kernels/ +mer/translations/ +mro/templates/ +mro/calibration/ +mgs/calibration/ +mer/calibration/ +newhorizons/translations/ +rolo/translations/ +mex/translations/ +kaguya/translations/ +hayabusa/translations/ +galileo/translations/ +dawn/translations/ +rosetta/translations/ +clementine1/kernels/ +viking1/kernels/ +viking2/kernels/ +apollo15/kernels/ +cassini/calibration/darkcurrent/ +hayabusa/kernels/ +mariner10/kernels/ +odyssey/calibration/ +odyssey/testData/I51718010EDR.crop.proj.reduced.cub +cassini/testData/vims2.cub +galileo/calibration/gll_gain.sav +lro/apps/mrf2pds/tsts/CH_Lev2/input/FSR_CDR_LV2_01921_0R_Lev2.cub +base/dems/ulcn2005_lpo_0004.cub +lro/kernels/ck/lrolc_2009181_2009213_v02.bc +messenger/kernels/ck/msgr20080110.bc +mro/kernels/spk/mro_psp7.bsp +messenger/kernels/ck/msgr20111017.bc +mer/translations/merInstrument.trn +mer/translations/merInstrument.trn +odyssey/testData/I25685003EDR.crop.proj.reduced.cub +odyssey/testData/I25685003EDR.crop.proj.reduced.cub +odyssey/testData/I25685003EDR.crop.proj.reduced.cub +cassini/testData/vims2.cub+100 +base/translations/ +mro/testData/ctx_pmoi_i_00003.bottom.cub +mrg_Global_512ppd_radius-demprep.cub +cassini/translations/ +chandrayaan1/translations/m3Instrument.trn +Clementine1/calibration/hires/lhd_flat.cub +clementine1/calibration/nir/nirorbitflats/nir_orbflat_284_a.cub +clementine1/calibration/uvvis/dark_5_15_96.cub +dawn/translations/dawnfcArchive.trn +dawn/translations/dawnvirArchive.trn +galileo/translations/galileoNIMSInstrument.trn +galileo/calibration/darkcurrent/2f8.dc04.cub +galileo/calibration/darkcurrent/4f8.dc04.cub +hayabusa/translations/amicaArchive.trn +hayabusa/translations/nirsArchive.trn +kaguya/translations/kaguyamiInstrument.trn +kaguya/translations/tcmapInstrument.trn +kaguya/translations/mimapBandBin.trn +base/translations/pdsExportImageImage.typ +lro/translations/lronacArchive.trn +lro/translations/lronacPdsLabelExport.trn +lro/translations/lrowacArchive.trn +lro/translations/lrowacPdsLabelExport.trn +lro/translations/mrflev1Archive.trn +lro/translations/mrflev2Archive.trn +base/translations/pdsExportImageImage.typ +mariner10/calibration/mariner_10_blem_A.cub +mariner10/calibration/mariner_10_blem_B.cub +mer/translations/merInstrument.trn +messenger/translations/mdisBandBin.trn +base/translations/pdsExportImageImage.typ +messenger/translations/mdisBandBin.trn +mex/translations/hrscBandBin.trn +mex/translations/hrscBandBin.trn +base/translations/pdsExportImageImage.typ +mro/calibration/psf/PSF_IR.cub +newhorizons/translations/leisaArchive_fit.trn +newhorizons/translations/lorriBandBin_fit.trn +rolo/translations/roloInstrument.trn +rosetta/translations/osirisBandBin.trn +viking2/reseaus/nominal.pvl +apollo15/kernels/pck/moon_assoc_me.tf +base/dems/ulcn2005_lpo_0004.cub +cassini/kernels/pck/cpck21Apr2005.tpc +lro/kernels/ck/lrolc_2009181_2009213_v02.bc +odyssey/kernels/sclk/ORB1_SCLKSCET.00200.tsc +odyssey/kernels/sclk/ORB1_SCLKSCET.00203.tsc +apollo/DEM/LRO_LOLA-KaguyaLPF3-mrg_Global_512ppd_radius-demprep.cub +hayabusa/dawn/DEM/vesta512.bds +messenger/kernels/ck/msgr20080109.bc +messenger/kernels/ck/msgr20111016.bc +apollo15/templates/apolloPanFiducialFinder.pvl +base/dems/ulcn2005_lpo_0004.cub +mer/translations/merInstrument.trn +mer/translations/merInstrument.trn +odyssey/testData/I25685003EDR.crop.proj.reduced.cub +cassini/testData/vims2.cub+100 +base/translations/pdsExportImageImage.typ +mro/testData/ctx_pmoi_i_00003.bottom.cub +cassini/translations/narrowAngle.def +cassini/translations/wideAngle.def +chandrayaan1/translations/m3Instrument.trn +Clementine1/calibration/hires/lhd_flat.cub +clementine1/calibration/nir/nirorbitflats/nir_orbflat_284_a.cub +clementine1/calibration/uvvis/dark_5_15_96.cub +hayabusa/dawn/DEM/vesta512.bds +dawn/translations/dawnfcArchive.trn +dawn/translations/dawnvirArchive.trn +galileo/translations/galileoNIMSInstrument.trn +galileo/calibration/darkcurrent/2f8.dc04.cub +galileo/calibration/darkcurrent/4f8.dc04.cub +hayabusa/translations/amicaArchive.trn +hayabusa/translations/nirsArchive.trn +kaguya/translations/kaguyamiInstrument.trn +kaguya/translations/tcmapInstrument.trn +kaguya/translations/mimapBandBin.trn +base/translations/pdsExportImageImage.typ +cassini/translations/narrowAngle.def +lro/translations/lronacArchive.trn +lro/translations/lronacPdsLabelExport.trn +lro/translations/lrowacArchive.trn +lro/translations/lrowacPdsLabelExport.trn +lro/translations/mrflev1Archive.trn +lro/translations/mrflev2Archive.trn +base/translations/pdsExportImageImage.typ +mariner10/calibration/mariner_10_blem_A.cub +mariner10/calibration/mariner_10_blem_B.cub +mer/translations/merInstrument.trn +messenger/translations/mdisBandBin.trn +base/translations/pdsExportImageImage.typ +messenger/translations/mdisBandBin.trn +mex/translations/hrscBandBin.trn +base/translations/pdsExportImageImage.typ +mro/calibration/psf/PSF_IR.cub +newhorizons/translations/leisaArchive_fit.trn +newhorizons/translations/lorriBandBin_fit.trn +rolo/translations/roloInstrument.trn +rosetta/translations/osirisBandBin.trn +rosetta/translations/osirisBandBin.trn +viking2/reseaus/nominal.pvl +apollo15/calibration/METRIC_flatfield.cub +apollo15/calibration/ApolloPanFiducialMark.cub +base/dems/ulcn2005_lpo_0004.cub +mer/translations/merStructure.trn +newhorizons/calibration/target-wavelengths-expanded.csv. +odyssey/testData/I10047011EDR.proj.reduced.cub +viking1/reseaus/vo1.visb.template.cub +cassini/testData/vims1.cub +base/translations/pdsExportRootGen.typ +mro/testData/ctx_pmoi_i_00003.bottom.cub +Apollo/DEM/LRO_LOLA-KaguyaLPF3-mrg_Global_512ppd_radius-demprep.cub +base/templates/maps/polarstereographic.map +base/templates/maps/simplecylindrical.map +cassini/translations/cassiniIss.trn +cassini/translations/vimsPds.trn +chandrayaan1/translations/m3Archive.trn +clementine1/translations/clementine.trn +Clementine1/calibration/hires/lhd_flat.cub +clementine1/calibration/nir/newnir_flat_a.cub +clementine1/calibration/uvvis/uvvis.def +base/templates/cnet_validmeasure/validmeasure.def +base/templates/cnetref/cnetref_nooperator.def +base/templates/cnetref/cnetref_operator.def +base/templates/cnetref/cnetref_nooperator.def +base/templates/cnetstats/cnetstats.def +hayabusa/dawn/DEM/vesta512.bds +dawn/translations/dawnfcBandBin.trn +dawn/translations/dawnvirBandBin.trn +dawn/translations/dawnvirBandBin.trn +galileo/translations/galileoNIMSArchive.trn +galileo/translations/galileoSsi.trn +galileo/calibration/gll_dc.sav +hayabusa/translations/amicaBandBin.trn +hayabusa/translations/nirsInstrument.trn +kaguya/translations/kaguyamiArchive.trn +kaguya/translations/tcmapBandBin.trn +base/translations/pdsExportRootGen.typ +cassini/translations/cissua2isis.trn +lro/translations/lronacInstrument.trn +lro/translations/pdsExportRootGen.typ +lro/translations/lrowacInstrument.trn +lro/translations/pdsExportRootGen.typ +lro/translations/mrflev1BandBin.trn +lro/translations/mrflev2BandBin.trn +lro/translations/mrfExportRoot.typ +mariner10/reseaus/mar10VenusNominal.pvl +mariner10/translations/mariner10isis2.trn +mariner10/calibration/mariner_10_A_dc.cub +mariner10/calibration/mariner_10_B_dc.cub +mariner10/reseaus/mar10b.template.cub +mer/translations/merStructure.trn +messenger/translations/mdisInstrument.trn +messenger/translations/mdisInstrument.trn +base/translations/pdsExportRootGen.typ +messenger/testData/EW0031509051D.cub +messenger/testData/EN0089576657M.IMG +messenger/translations/mdisInstrument.trn +mex/translations/hrscInstrument.trn +mro/calibration/ctxFlat_0001.cub +mro/calibration/HiRISE_Gain_Drift_Correction_Bin2.0001.csv +mro/calibration/HiRISE_Gain_Drift_Correction_Bin4.0001.csv +mro/calibration/HiccdstitchOffsets.def +base/translations/pdsExportRootGen.typ +mro/calibration/hijitreg.p1745.s3070.def +output/PSP_007556_2010_RED4.balance.cropped.cub +mro/calibration/psf/PSF_BG.cub +near/translations/nearImportPdsLabel.trn +newhorizons/translations/leisaInstrument_fit.trn +newhorizons/translations/lorriInstrument_fit.trn +newhorizons/translations/mvicInstrument_fit.trn +rolo/translations/roloMapping.trn +rosetta/translations/osirisArchive.trn +viking1/reseaus/nominal.pvl +iking2/reseaus/nominal.pvl +voyager1/calibration/voylin.pvl +apollo15/kernels/pck/moon_080317.tf +viking1/kernels/sclk/vo1_fsc.tsc +base/dems/ulcn2005_lpo_0004.cub +cassini/kernels/fk/cas_v40.tf +lro/kernels/ck/lrolc_2009181_2009213_v02.bc +lro/kernels/spk/fdf29r_2009182_2009213_v01.bsp +odyssey/kernels/fk/m01_v29.tf +cassini/kernels/sclk/cas00110.tsc +hayabusa/dawn/DEM/vesta512.bds +odyssey/kernels/sclk/ORB1_SCLKSCET.00174.tsc +galileo/kernels/sclk/mk00062b.tsc +messenger/kernels/ck/msgr20111015.bc +lro/kernels/spk/fdf29r_2012275_2012306_v01.bsp +apollo15/kernels/tspk/de421.bsp +viking1/kernels/sclk/vo1_fict.tsc +base/dems/ulcn2005_lpo_0004.cub +viking1/kernels/ck/vo1_sedr_ck2.bc +cassini/kernels/ck/05047_05052ra.bc +mro/kernels/ck/mro_sc_psp_061114_061120.bc +lro/kernels/tspk/de421.bsp +odyssey/kernels/ck/m01_sc_map7.bc +odyssey/kernels/ck/m01_sc_map5_rec_nadir.bc +odyssey/kernels/sclk/ORB1_SCLKSCET.00160.tsc +cassini/kernels/iak/vimsAddendum02.ti +viking1/kernels/sclk/vo1_fict.tsc +Apollo/DEM/LRO_LOLA-KaguyaLPF3-mrg_Global_512ppd_radius-demprep.cub +cassini/kernels/sclk/cas00106.tsc +clementine1/kernels/fk/clem_v10.tf +clementine1/kernels/iak/nirAddendum002.ti +hayabusa/dawn/DEM/vesta512.bds +odyssey/kernels/sclk/ORB1_SCLKSCET.00174.tsc +galileo/kernels/sclk/mk00062b.tsc +messenger/kernels/ck/msgr20111014.bc +apollo15/kernels/tspk/moon_pa_de421_1900-2050.bpc +viking1/kernels/iak/vikingAddendum003.ti +base/dems/ulcn2005_lpo_0004.cub +viking1/kernels/spk/vik1_ext.bsp +cassini/kernels/spk/050414RB_SCPSE_05034_05060.bsp +mro/kernels/spk/mro_psp1.bsp +lro/kernels/tspk/moon_pa_de421_1900-2050.bpc +odyssey/kernels/spk/m01_map7.bsp +odyssey/kernels/spk/m01_map5.bsp +odyssey/kernels/iak/themisAddendum003.ti +cassini/kernels/pck/cpck19Sep2007.tpc +mgs/kernels/iak/mocAddendum003.ti +viking1/kernels/fk/vo1_v10.tf +Apollo/DEM/LRO_LOLA-KaguyaLPF3-mrg_Global_512ppd_radius-demprep.cub +cassini/kernels/pck/cpck01Dec2006.tpc +base/dems/Ceres_Dawn_FC_HAMO_DTM_DLR_Global_60ppd_Oct2016_prep.cub +cassini/kernels/pck/cpck01Dec2006.tpc +mgs/kernels/sclk/MGS_SCLKSCET.00060.tsc +hayabusa/dawn/DEM/vesta512.bds +odyssey/kernels/iak/themisAddendum003.ti +galileo/kernels/iak/ssiAddendum004.ti +mro/kernels/spk/mro_psp22.bsp +messenger/kernels/ck/msgr20111013.bc +mro/kernels/spk/mro_psp22.bsp +base/templates/autoreg/findrx.def +viking2/reseaus/vo2.visb.template.cub +viking2/calibration/vik2evenMask.cub +voyager1/kernels/ +voyager1/calibration/NA1CLR.CAL.cub +voyager1/calibration/NA1OFF.CAL.cub +voyager1/calibration/voycal.pvl +voyager1/reseaus/vg1naMasterReseaus.pvl +voyager2/translations/ +voyager2/kernels/ +voyager2/reseaus/nominal.pvl +base/templates/maps/sinusoidal.map +base/applications/noprojInstruments001.pvl +base/applications/noprojInstruments002.pvl +base/applications/noprojInstruments003.pvl +messenger/kernels/ck/1018221575_197834_mdis_pivot_pvtres.bc +messenger/kernels/ck/1018290560_1175_mdis_atthist.bc +messenger/kernels/ck/msgr20120630.bc +messenger/kernels/ck/msgr20120629.bc +messenger/kernels/ck/msgr20120628.bc +messenger/kernels/ck/msgr20120627.bc +messenger/kernels/ck/msgr20120626.bc +messenger/kernels/ck/msgr20120625.bc +messenger/kernels/ck/msgr20120624.bc +messenger/kernels/ck/msgr20120623.bc +messenger/kernels/ck/msgr20120622.bc +messenger/kernels/ck/msgr20120621.bc +messenger/kernels/pck/kernels.0001.db +messenger/kernels/pck/kernels.0002.db +messenger/kernels/pck/kernels.0003.db +messenger/kernels/pck/kernels.0004.db +messenger/kernels/tspk/ +messenger/testData/EW0131770376G.equi.cub +mgs/calibration +mro/kernels/fk/ +mro/kernels/ik/ +mro/kernels/sclk/ +base/kernels/lsk/ +base/kernels/pck/ +base/kernels/spk/de118.bsp +base/kernels/spk/de245.bsp +base/kernels/spk/de405.bsp +base/testData/kernels/de405.bsp +base/kernels/spk/kernels.0001.db +base/kernels/spk/kernels.0002.db +base/testData/kernels/moc.bsp +base/testData/kernels/naif0007.tls +base/testData/kernels/moc.bc +base/testData/kernels/pck00006.tpc +base/testData/kernels/mocSpiceUnitTest.ti +base/testData/kernels/mocAddendum.ti +base/testData/kernels/MGS_SCLKSCET.00045.tsc +base/testData/kernels/moc13.ti +base/kernels/pck/pck00009.tpc +base/kernels/lsk/naif0009.tls +base/kernels/spk/de405.bsp +base/kernels/lsk/naif0009.tls +base/kernels/pck/pck00009.tpc +base/dems/kernels.0003.db +base/dems/kernels.0004.db +base/dems/kernels.0005.db +mgs/testData/ab102401.cub +base/templates/labels/CubeFormatTemplate.pft +mariner10/testData/0027399_clean_equi.cub +mgs/testData/ab102401.lev2.cub +odyssey/testData/I00824006RDR.lev2.cub +base/testData/blobTruth.cub +base/testData/isisTruth.cub +base/testData/isisTruth2.cub +base/testData/xmlTestLabel.xml +base/testData/f319b18_ideal.cub +base/translations/MissionName2DataDir.trn +base/translations/MissionName2DataDir.trn +messenger/testData/EW0211286081G.lev1.cub +messenger/testData/EW0131770376G.equi.cub +base/translations/NaifErrors.trn +mariner10/testData/0027399_clean_equi.cub +dawn/testData/FC21B0001010_09049002212F5D.cub +base/testData/LRONAC_M139722912RE_cropped.cub +base/dems/molaMarsPlanetaryRadius0004.cub +base/dems/molaMarsPlanetaryRadius0005.cub +viking2/testData/f348b26.cub +viking2/kernels/sclk/vo2_fict.tsc +viking2/kernels/iak/vikingAddendum003.ti +clementine1/testData/lna1391h.cub +base/testData/ab102401_ideal.cub +lo/testData/3133_h1.cub +mgs/kernels/ik/moc20.ti +mgs/kernels/iak/mocAddendum004.ti +mgs/kernels/sclk/MGS_SCLKSCET.00061.tsc +viking2/kernels/sclk/vo2_fsc.tsc +hayabusa/kernels/dsk/hay_a_amica_5_itokawashape_v1_0_512q.bds +hayabusa/kernels/pck/itokawa_gaskell_n3.tpc +hayabusa/kernels/tspk/de403s.bsp +hayabusa/kernels/tspk/sb_25143_140.bsp +hayabusa/kernels/spk/hay_jaxa_050916_051119_v1n.bsp +hayabusa/kernels/spk/hay_osbj_050911_051118_v1n.bsp +hayabusa/kernels/ck/hayabusa_itokawarendezvous_v02n.bc +hayabusa/kernels/fk/hayabusa_hp.tf +hayabusa/kernels/fk/itokawa_fixed.tf +hayabusa/kernels/ik/amica31.ti +hayabusa/kernels/iak/amicaAddendum001.ti +hayabusa/kernels/sclk/hayabusa.tsc +base/kernels/spk/de405.bsp +mgs/kernels/spk/mgs_ab1.bsp +mgs/testData/ab102402.lev2.cub +odyssey/testData/I02609002RDR.lev2.cub +mgs/kernels/ck/mgs_sc_ab1.bc +viking2/kernels/spk/vo2_rcon.bsp +apollo15/testData/AS15-M-0533.cropped.cub +apollo15/testData/TL.cub +cassini/testData/W1294561261_1.c2i.nospice.cub +cassini/testData/N1525100863_2.cub +cassini/testData/W1525116136_1.cub +odyssey/testData/I01523019RDR.lev2.cub +odyssey/testData/I01523019RDR.lev2.cub +messenger/testData/EW0131770381F.equi.cub +mariner10/testData/0166613_clean_equi.cub +lo/testData/3133_h1.cropped.cub +lo/testData/3083_med_tohi.cub +mgs/testData/fha00491.lev1.cub +mro/testData/frt0001cfd8_07_if124s_trr3_b24.cub +mro/testData/ctx_pmoi_i_00003.bottom.cub +mro/testData/PSP_001446_1790_BG12_0.cub +mro/testData/P12_005911_3396_MA_00N009W.cropped.cub +mro/kernels/ck/mro_crm_psp_080101_080131.bc +mro/kernels/ck/mro_sc_psp_080108_080114.bc +mro/kernels/spk/mro_psp6.bsp +mro/kernels/ck/mro_sc_psp_080304_080310.bc +mro/kernels/iak/hiriseAddendum006.ti +cassini/testData/N1355543510_1.c2i.nospice.cub +base/dems/ldem_128ppd_Mar2011_clon180_radius_pad.cub +cassini/testData/CM_1515951157_1.ir.cub +clementine1/testData/lub5992r.292.lev1.phot.cub +messenger/testData/EW0213634118G.lev1.cub +galileo/testData/1213r.cub +lo/testData/3083_med_raw.cub +base/dems/ldem_128ppd_Mar2011_clon180_radius_pad.cub +lo/testData/4008_med_res.cropped.cub +mro/testData/ctx_pmoi_i_00003.top.cub +base/dems/ldem_128ppd_Mar2011_clon180_radius_pad.cub +lro/kernels/pck/moon_080317.tf +viking2/kernels/ck/vo2_sedr_ck2.bc +base/dems/ldem_128ppd_Mar2011_clon180_radius_pad.cub +mariner10/kernels/iak/mariner10Addendum002.ti +base/kernels/fk/lunarMeanEarth001.tf +viking2/kernels/fk/vo2_v10.tf +lro/kernels/pck/moon_assoc_me.tf +mro/kernels/iak/mroctxAddendum004.ti +cassini/testData/N1536363784_1.c2i.spice.cub +apollo16/testData/AS16-M-0533.reduced.cub +lo/testData/4164H_Full_mirror.cub +lo/testData/5072_med_res.cropped.cub +cassini/testData/N1313633704_1.c2i.nospice.cub +clementine1/kernels/iak/uvvisAddendum003.ti +clementine1/kernels/ck/clem_5sc.bck +apollo15/kernels/iak/apolloPanAddendum001.ti +mariner10/kernels/sclk/mariner10.0001.tsc +hayabusa/testData/st_2530292409_v.cub +lo/testData/5006_high_res_1.cropped.cub +cassini/testData/CM_1514390782_1.ir.cub +clementine1/kernels/sclk/dspse002.tsc +cassini/kernels/pck/cpck14Feb2006.tpc +apollo15/testData/BL.cub +mro/testData/G02_019106_1390_XN_41S257W.cub +apollo17/testData/AS17-M-0543.reduced.cub +cassini/kernels/iak/vimsAddendum03.ti +base/dems/ulcn2005_lpo_0004.cub +base/dems/molaMarsPlanetaryRadius0001.cub +apollo15/testData/M.cub +mro/apps/hiequal/tsts/default/input/RED0.cub +cassini/kernels/sclk/cas00130.tsc +cassini/kernels/sclk/cas00112.tsc +cassini/testData/CM_1514390782_1.vis.cub +cassini/testData/CM_1515945709_1.ir.cub +cassini/kernels/pck/cpck21Mar2006.tpc +cassini/testData/CM_1515945709_1.vis.cub +cassini/testData/C1465336166_1.ir.cub +apollo15/testData/TR.cub +apollo15/testData/BR.cub +mgs/testData/ab102401.cub +base/templates/labels/MappingGroupKeywords.pft +odyssey/testData/I00824006RDR.lev2.cub +odyssey/testData/I56632006EDR.lev2.cub +odyssey/testData/I02609002RDR.lev2.cub +odyssey/testData/I01523019RDR.lev2.cub +viking2/reseaus/vik2bMasterReseaus.pvl +mgs/testData/m0402852.cub +mariner10/reseaus/mar10aMasterReseaus.pvl +lo/testData/3133_h1.cub +base/translations/NaifErrors.trn +base/testData/blobTruth.cub +base/testData/isisTruthNoSpacecraftName.cub +base/testData/isisTruthNoInstrumentId.cub +lo/testData/5106_h1.cropped.cub +lo/testData/5106_h2.cropped.cub +mgs/calibration/MGSC_1246_wago.tab +mgs/calibration/MGSC_1290_wago.tab +mgs/calibration/MGSC_1428_wago.tab +mgs/calibration/MGSC_1546_wago.tab +mgs/calibration/MGSC_1578_wago.tab +clementine1/kernels/ck/clem_ulcn2005_type2_1sc.bc +clementine1/kernels/fk/clem_v11.tf +clementine1/kernels/sclk/dspse002.tsc +clementine1/kernels/spk/SPKMERGE_940219_940504_CLEMV001b.bsp +clementine1/kernels/iak/uvvisAddendum003.ti +base/templates/maps/equirectangular.map +newhorizons/calibration/NHSmileDefinitionNew.cub +messenger/kernels/tspk/de423s.bsp +messenger/kernels/tspk/kernels.0001.db +messenger/kernels/tspk/kernels.0002.db +messenger/kernels/tspk/kernels.0003.db +messenger/kernels/spk/msgr_20040803_20150328_od332sc_0.bsp +messenger/kernels/spk/msgr_20040803_20150430_od431sc_2.bsp +messenger/kernels/sclk/messenger_1930.tsc +base/translations/pdsProjectionLineSampToXY.def +dawn/kernels/fk/ +dawn/kernels/iak/ +dawn/kernels/ik/ +dawn/kernels/pck/ +dawn/kernels/sclk/ +dawn/kernels/tspk/ +mro/kernels/fk/ +mro/kernels/iak/ +mro/kernels/ik/ +mro/kernels/sclk/ +cassini/kernels/spk/050105RB_SCPSE_04247_04336.bsp +newhorizons/kernels/fk/ +newhorizons/kernels/iak/ +newhorizons/kernels/ik/ +newhorizons/kernels/pck/ +newhorizons/kernels/sclk/ +newhorizons/kernels/spk/ +lro/kernels/ck/lrolc_2009243_2009274_v01.bc +mro/kernels/spk/mro_psp8.bsp +newhorizons/kernels/tspk/de413.bsp +lro/kernels/ck/moc42r_2009243_2009274_v08.bc +mro/kernels/ck/mro_sc_psp_080923_080929.bc +newhorizons/kernels/tspk/jup260.bsp +near/kernels/fk/ +newhorizons/kernels/ck/merged_nhpc_2007_v006.bc +''' + + dbList = ''' +newhorizons/kernels/ck/ +near/kernels/ck/ +dawn/kernels/ck/ +dawn/kernels/pck/ +mro/kernels/ +messenger/kernels/ +messenger/kernels/spk/ +apollo15/kernels/ +base/translations/ +lo/translations/ +mgs/translations/ +odyssey/translations/ +odyssey/kernels/ck/ +odyssey/kernels/ik/ +odyssey/kernels/iak/ +odyssey/kernels/sclk/ +odyssey/kernels/fk/ +odyssey/kernels/spk/ +mro/translations/ +voyager1/kernels/ +mgs/kernels/ +cassini/kernels/ +cassini/calibration/ +lro/calibration/ +lro/kernels/ +messenger/calibration/ +newhorizons/kernels/ +base/dems/ +base/translations/ +''' + + fileList = fileList.split() + dbList = dbList.split() + + # TODO: Input argument + installDir = '/home/smcmich1/release_isis/isis3data/' + #installDir = '/Users/smcmich1/release_isis/isis3data/' + + cmd = 'rsync -azv --delete --partial ' + remote = 'isisdist.astrogeology.usgs.gov::isis3data/data/' + + for f in fileList: + + # Set up commands + target = installDir + f + + print target + + # Don't refetch existing files + if os.path.exists(target) and (not os.path.isdir(target)): + continue + + # Fetch the file + fullCmd = cmd + remote + f +' '+ target + print fullCmd + os.system('mkdir -p ' + os.path.dirname(target)) + os.system(fullCmd) + + # This is for folders where we want just the small files + for f in dbList: + fullCmd = (cmd + remote + f+' --max-size=3m ' + installDir+f) + print fullCmd + os.system('mkdir -p '+ installDir +f) + os.system(fullCmd) + + + +if __name__ == '__main__': + sys.exit( main() ) diff --git a/isis/scripts/isis3Startup.sh b/isis/scripts/isis3Startup.sh index de0dfcac526bde1be8ee6a78f93d00dbe827351a..d9728383d52d8c9e1d84269efde4b705156cc6a7 100755 --- a/isis/scripts/isis3Startup.sh +++ b/isis/scripts/isis3Startup.sh @@ -37,7 +37,3 @@ else PATH="$ISISROOT/bin" fi export PATH - -# Create QT_PLUGIN_PATH env variable -QT_PLUGIN_PATH="$ISISROOT/3rdParty/plugins" -export QT_PLUGIN_PATH diff --git a/isis/scripts/isis3VarInit.py b/isis/scripts/isis3VarInit.py new file mode 100755 index 0000000000000000000000000000000000000000..ec6431691f0b80d29875696ce03e4e4b15c02402 --- /dev/null +++ b/isis/scripts/isis3VarInit.py @@ -0,0 +1,52 @@ +#!/usr/bin/env python +import argparse +import os +import sys +#Author: Tyler Wilson +#Date : 2018-10-05 +#Description: This script sets ISISROOT/ISIS3DATA/ISIS3TESTDATA for the user and is executed +#within the conda environment created for the ISIS3 installation. +#The data directory and test directory are optional command line arguments. If the user chooses +#not to set them, they will both be placed created on the same level as the $ISISROOT directory +#within the conda environment. + +parser = argparse.ArgumentParser(description='Usage: ./isis3VarInit --data_dir --test_dir "+isisroot+"/etc/conda/activate.d/env_vars.sh") +os.popen("echo -n '' >"+isisroot+"/etc/conda/deactivate.d/env_vars.sh") +os.popen('touch '+isisroot+'/etc/conda/activate.d/env_vars.sh') +os.popen('touch '+isisroot+'/etc/conda/activate.d/env_vars.sh') + +os.popen("echo '#!/bin/sh' >> "+isisroot+ "/etc/conda/activate.d/env_vars.sh") +os.popen("echo 'export ISISROOT="+isisroot+"' >>"+isisroot+"/etc/conda/activate.d/env_vars.sh") +os.popen("echo 'export ISIS3DATA="+data_dir+"' >>"+isisroot+"/etc/conda/activate.d/env_vars.sh") +os.popen("echo 'export ISIS3TESTDATA="+testdata_dir+"' >>"+isisroot+"/etc/conda/activate.d/env_vars.sh") + +os.popen("echo '#!/bin/sh' >> "+isisroot+ "/etc/conda/deactivate.d/env_vars.sh") +os.popen("echo 'unset ISISROOT' >>"+isisroot+"/etc/conda/deactivate.d/env_vars.sh") +os.popen("echo 'unset ISIS3DATA' >>"+isisroot+"/etc/conda/deactivate.d/env_vars.sh") +os.popen("echo 'unset ISIS3TESTDATA' >>"+isisroot+"/etc/conda/deactivate.d/env_vars.sh") + diff --git a/isis/scripts/makeOutput.py b/isis/scripts/makeOutput.py new file mode 100755 index 0000000000000000000000000000000000000000..387be1f3ecb76eceff13f726bbaab37960457a6f --- /dev/null +++ b/isis/scripts/makeOutput.py @@ -0,0 +1,90 @@ +''' +Script to create truthData for tests. + +For output it expects the command in the form of: + python3 makeOutput.py test + +where test is the cmake name for the unit or app test + +To check in truth data the command should be in the form of: + python makeOutput.py -t test + +The -t option checks in truth data + +The unit tests are pretty trivial because the executable outputs the results of +the unitTest to stdout and stderr so we just redirect the streams to the file +named object.truth where object is the ISIS object being tested. + +The app tests output has to rely on the old make system because the app test +infrastructure relies on the old make system. Otherwise all the logic for the old +makesystem would need to be reimplemented here. Because we wish to replace the testing +system with something that allows unit and app test to live in the same space the effort +to recreate the logic is not worth the outcome. +''' + +import argparse +import sys +import os + +try: + builddir = os.environ['ISISROOT'] +except KeyError: + print("The $ISISROOT environment variable is not set") + +parser = argparse.ArgumentParser() +parser.add_argument('test', action='store', help='Provide the name of the Test to create output of') +parser.add_argument('-t', action='store_true', default=False, dest='truth', help='Flag whether output is sent to truth data') +userInput = parser.parse_args() +testInput = userInput.test + +if "_unit_" in testInput: + unitTestName = testInput.split("_test_")[1] + truthFileName = unitTestName + ".truth" + + # We need to run the unit test from the object's directory because + # some tests have an xml file in the object's directory. If we ran the + # unit test from /unitTest, these files would not be able to be opened. + with open(builddir + "/objects/CTestTestfile.cmake") as testFile: + for line in testFile: + if "/" + unitTestName + "/" in line: + unitTestSrcPath = line.split("\" \"")[2][13:].split(unitTestName + "/")[0] + unitTestName + "/" + if not os.path.exists(unitTestSrcPath + "unitTest"): + os.system("ln -s " + builddir + "/unitTest/" + testInput + " " + unitTestSrcPath + "unitTest") + os.system(unitTestSrcPath + "unitTest" + ">& " + builddir + "/testOutputDir/" + truthFileName) + print("Unit Test Output In " + builddir + "/testOutputDir/ As " + truthFileName) + break + + if userInput.truth: + os.system("cp -f " + builddir + "/testOutputDir/" + truthFileName + " " + unitTestSrcPath + truthFileName) + print("Checked In Truth Data To " + unitTestSrcPath) + +else: + apptest = testInput + makefilePath = "" + with open(builddir + "/objects/CTestTestfile.cmake") as testFile: + for line in testFile: + if apptest in line: + makefilePath = line.split("\" \"")[1][11:] + break + + makefilePath = makefilePath.split("/") + del makefilePath[-1] + makefilePath = "/".join(makefilePath) + + # change dir to test dir and run make commands + os.chdir(makefilePath) + os.system("make checkout") + os.system("make output") + os.system("make truthdata") + os.system("rm -rf " + builddir + "/testOutputDir/truth") + os.system("cp -rf truth " + builddir + "/testOutputDir") + print("App Test Output In " + builddir + "/testOutputDir/truth") + + # check if the user wants data checked in + if userInput.truth: + os.system("make checkin") + print("Checked In Truth Data") + + # doing this instead of make release because make release + # can give feedback to the user that we would rather avoid + os.system("rm -rf input output truth print.prt") diff --git a/isis/sipfiles/BundleAdjust.sip b/isis/sipfiles/BundleAdjust.sip new file mode 100644 index 0000000000000000000000000000000000000000..3365780bffaf8064cb210379cd5485f3b3766d44 --- /dev/null +++ b/isis/sipfiles/BundleAdjust.sip @@ -0,0 +1,42 @@ +// SIP Wrapper to the ISIS3 bundle class +%Include type_conversions.sip + + +namespace Isis { + class BundleAdjust : public QObject { + %TypeHeaderCode + #include "BundleAdjust.h" + #include "IException.h" + %End + + public: + // Stuff in the square brackets [] indicate the C++ interface while the sip + // function name indicates the C python function interface + BundleAdjust(PyObject* settings, const QString &cnetFile, const QString &cubeList, bool printSummary = true) throw(Isis::IException) [(QSharedPointer, QString, QString, bool)]; + %MethodCode + int sipErr = 0; + QSharedPointer *wrappedSettings = new QSharedPointer(); + + Isis::BundleSettings *settings = (Isis::BundleSettings*) sipConvertToType(a0, sipType_Isis_BundleSettings, NULL, SIP_NOT_NONE, NULL, &sipErr); + wrappedSettings->reset(settings); + try { + sipCpp = new sipIsis_BundleAdjust(*wrappedSettings, *a1, *a2, a3); + } + catch (Isis::IException &error) { + PyErr_SetString(sipException_Isis_IException, error.what()); + return NULL; + } + %End + + Isis::BundleSolutionInfo* solveCholeskyBR(); + %MethodCode + try { + return sipConvertFromType(sipCpp->solveCholeskyBR(), sipType_Isis_BundleSolutionInfo, NULL); + } + catch (Isis::IException &error) { + PyErr_SetString(sipException_Isis_IException, error.what()); + return NULL; + } + %End + }; +}; diff --git a/isis/sipfiles/BundleControlPoint.sip b/isis/sipfiles/BundleControlPoint.sip new file mode 100644 index 0000000000000000000000000000000000000000..934b00bc9426ee359e0df5212b041f4614dc29f3 --- /dev/null +++ b/isis/sipfiles/BundleControlPoint.sip @@ -0,0 +1,68 @@ +namespace Isis { + class BundleControlPoint { + + %TypeHeaderCode + #include "BundleControlPoint.h" + #include + %End + + public: + + SIP_PYTYPE measures() throw(Isis::IException); + %MethodCode + size_t size = sipCpp->size(); + + PyObject *l = PyList_New(size); + for (size_t i = 0; i < size; ++i) { + Isis::BundleMeasure* cppMeasure = sipCpp->at(i).data(); + + PyObject *pyMeasure = sipConvertFromType((void*)(cppMeasure), sipType_Isis_BundleMeasure, NULL); + PyList_SetItem(l, i, pyMeasure); + } + + return l; + + %End + + // BundleControlPoint(ControlPoint *point); // default constructor + BundleControlPoint(const Isis::BundleControlPoint &src) throw(Isis::IException); + ~BundleControlPoint(); + + // copy + void copy(const Isis::BundleControlPoint &src) throw(Isis::IException); + + // mutators + // QSharedPointer addMeasure(ControlMeasure *controlMeasure); + void computeResiduals() throw(Isis::IException); + void setNumberOfRejectedMeasures(int numRejected) throw(Isis::IException); + void setRejected(bool reject) throw(Isis::IException); + void setWeights(const QSharedPointer settings, double metersToRadians) throw(Isis::IException); + void zeroNumberOfRejectedMeasures() throw(Isis::IException); + + // accessors + bool isRejected() const throw(Isis::IException); + int numberOfMeasures() const throw(Isis::IException); + int numberOfRejectedMeasures() const throw(Isis::IException); + double residualRms() const throw(Isis::IException); + QString id() const throw(Isis::IException); + Isis::ControlPoint::PointType type() const throw(Isis::IException); + + // string format methods + QString formatBundleOutputSummaryString(bool errorPropagation) const throw(Isis::IException); + QString formatBundleOutputDetailString(bool errorPropagation, double RTM, bool solveRadius=false) throw(Isis::IException) /KeywordArgs="Optional"/; + QString formatValue(double value, int fieldWidth, int precision) throw(Isis::IException); + QString formatAprioriSigmaString(int type, int fieldWidth, int precision, bool solveRadius=false) throw(Isis::IException) /KeywordArgs="Optional"/; + QString formatLatitudeAprioriSigmaString(int fieldWidth, int precision) const throw(Isis::IException); + QString formatLongitudeAprioriSigmaString(int fieldWidth, int precision) const throw(Isis::IException); + QString formatRadiusAprioriSigmaString(int fieldWidth, int precision, bool solveRadius=false) throw(Isis::IException) /KeywordArgs="Optional"/; + QString formatAdjustedSigmaString(int type, int fieldWidth, int precision, + bool errorPropagation) const throw(Isis::IException); + QString formatLatitudeAdjustedSigmaString(int fieldWidth, int precision, + bool errorPropagation) const throw(Isis::IException); + QString formatLongitudeAdjustedSigmaString(int fieldWidth, int precision, + bool errorPropagation) const throw(Isis::IException); + QString formatRadiusAdjustedSigmaString(int fieldWidth, int precision, + bool errorPropagation) const throw(Isis::IException); + + }; +}; diff --git a/isis/sipfiles/BundleImage.sip b/isis/sipfiles/BundleImage.sip new file mode 100644 index 0000000000000000000000000000000000000000..bf8d975d4c0a4b5153298bcd2170bd53cba8449c --- /dev/null +++ b/isis/sipfiles/BundleImage.sip @@ -0,0 +1,16 @@ +namespace Isis { + class BundleImage /NoDefaultCtors/ { + %TypeHeaderCode + #include "BundleImage.h" + %End + %InstanceCode + sipCpp = new Isis::BundleImage(NULL, "", ""); + %End + public: + + + // QSharedPointer parentObservation(); + QString serialNumber() throw(Isis::IException); + QString fileName() throw(Isis::IException); + }; +}; diff --git a/isis/sipfiles/BundleMeasure.sip b/isis/sipfiles/BundleMeasure.sip new file mode 100644 index 0000000000000000000000000000000000000000..fd2a02942c43eeb0ffa8b4eed656df4059059041 --- /dev/null +++ b/isis/sipfiles/BundleMeasure.sip @@ -0,0 +1,30 @@ +%Include type_conversions.sip + +namespace Isis { + class BundleMeasure /NoDefaultCtors/ { + %TypeHeaderCode + #include "BundleMeasure.h" + %End + + public: + + bool isRejected() const throw(Isis::IException); + // Camera *camera() const; + // Isis::BundleControlPoint *parentControlPoint(); + QSharedPointer parentBundleImage() throw(Isis::IException); + // QSharedPointer parentBundleObservation(); + // const QSharedPointer observationSolveSettings(); + + double sample() const throw(Isis::IException); + double sampleResidual() const throw(Isis::IException); + double line() const throw(Isis::IException); + double lineResidual() const throw(Isis::IException); + double residualMagnitude() const throw(Isis::IException); + QString cubeSerialNumber() const throw(Isis::IException); + double focalPlaneComputedX() const throw(Isis::IException); + double focalPlaneComputedY() const throw(Isis::IException); + double focalPlaneMeasuredX() const throw(Isis::IException); + double focalPlaneMeasuredY() const throw(Isis::IException); + int observationIndex() const throw(Isis::IException); + }; +}; diff --git a/isis/sipfiles/BundleObservationSolveSettings.sip b/isis/sipfiles/BundleObservationSolveSettings.sip new file mode 100644 index 0000000000000000000000000000000000000000..89b28277c0d18004d5feb9c4c3f7542cb84cf7b6 --- /dev/null +++ b/isis/sipfiles/BundleObservationSolveSettings.sip @@ -0,0 +1,59 @@ + +%Import QtCore/QtCoremod.sip +%Import QtXml/QtXmlmod.sip + +namespace Isis{ + class BundleObservationSolveSettings { + %TypeHeaderCode + #include "BundleObservationSolveSettings.h" + %End + public: + + enum InstrumentPointingSolveOption { + NoPointingFactors = 0, /**< Solve for none of the pointing factors.*/ + AnglesOnly = 1, /**< Solve for pointing angles: right ascension, declination + and, optionally, twist.*/ + AnglesVelocity = 2, //!< Solve for pointing angles and their angular velocities. + AnglesVelocityAcceleration = 3, /**< Solve for pointing angles, their velocities and their + accelerations.*/ + AllPointingCoefficients = 4 /**< Solve for all coefficients in the polynomials fit to + the pointing angles.*/ + }; + + //! Options for how to solve for instrument position + enum InstrumentPositionSolveOption { + NoPositionFactors = 0, /**< Solve for none of the position factors.*/ + PositionOnly = 1, /**< Solve for instrument positions only.*/ + PositionVelocity = 2, /**< Solve for instrument positions and velocities.*/ + PositionVelocityAcceleration = 3, /**< Solve for instrument positions, velocities, and + accelerations.*/ + AllPositionCoefficients = 4 /**< Solve for all coefficients in the polynomials fit to + the instrument positions.*/ + }; + + BundleObservationSolveSettings() throw(Isis::IException); + InstrumentPositionSolveOption stringToInstrumentPositionSolveOption(QString option) throw(Isis::IException); + InstrumentPointingSolveOption stringToInstrumentPointingSolveOption(QString option) throw(Isis::IException); + + void setInstrumentPositionSettings(InstrumentPositionSolveOption option, + int spkDegree = 2, + int spkSolveDegree = 2, + bool positionOverHermite = false, + double positionAprioriSigma = -1.0, + double velocityAprioriSigma = -1.0, + double accelerationAprioriSigma = -1.0) throw(Isis::IException) /KeywordArgs="Optional"/; + + + void setInstrumentPointingSettings(InstrumentPointingSolveOption option, + bool solveTwist, + int ckDegree = 2, + int ckSolveDegree = 2, + bool solvePolynomialOverExisting = false, + double anglesAprioriSigma = -1.0, + double angularVelocityAprioriSigma = -1.0, + double angularAccelerationAprioriSigma = -1.0) throw(Isis::IException) /KeywordArgs="Optional"/; + + + + }; +}; diff --git a/isis/sipfiles/BundleResults.sip b/isis/sipfiles/BundleResults.sip new file mode 100644 index 0000000000000000000000000000000000000000..777ae54aedd4579a6d2b6f4e3311083cf0a911ac --- /dev/null +++ b/isis/sipfiles/BundleResults.sip @@ -0,0 +1,125 @@ +%Include Statistics.sip +%Include type_conversions.sip + + +namespace Isis { + class BundleResults : public QObject { + %TypeHeaderCode + #include "BundleResults.h" + %End + + public: + BundleResults(const Isis::BundleResults &src); + void initialize(); + + void resizeSigmaStatisticsVectors(int numberImages); + // void setRmsImageResidualLists(QList rmsImageLineResiduals, + // QList rmsImageSampleResiduals, + // QList rmsImageResiduals); + // void setRmsImageResidualLists(QVector rmsImageLineResiduals, + // QVector rmsImageSampleResiduals, + // QVector rmsImageResiduals); + // void setSigmaLatitudeRange(Distance minLatDist, Distance maxLatDist, + // QString minLatPointId, QString maxLatPointId); + // void setSigmaLongitudeRange(Distance minLonDist, Distance maxLonDist, + // QString minLonPointId, QString maxLonPointId); + // void setSigmaRadiusRange(Distance minRadDist, Distance maxRadDist, + // QString minRadPointId, QString maxRadPointId); + void setRmsFromSigmaStatistics(double rmsFromSigmaLatStats, + double rmsFromSigmaLonStats, + double rmsFromSigmaRadStats); + + void printMaximumLikelihoodTierInformation() throw(Isis::IException); + void incrementMaximumLikelihoodModelIndex() throw(Isis::IException); + + void incrementFixedPoints() throw(Isis::IException); + int numberFixedPoints() const throw(Isis::IException); + void incrementHeldImages() throw(Isis::IException); + int numberHeldImages() const throw(Isis::IException); + void incrementIgnoredPoints() throw(Isis::IException); + int numberIgnoredPoints() const throw(Isis::IException); // currently unused ??? + void setRejectionLimit(double rejectionLimit) throw(Isis::IException); + void setRmsXYResiduals(double rx, double ry, double rxy) throw(Isis::IException); + + void setNumberRejectedObservations(int numberObservations) throw(Isis::IException); + void setNumberObservations(int numberObservations) throw(Isis::IException); + void setNumberImageParameters(int numberParameters) throw(Isis::IException); // ??? this is the same value an m_nRank + void resetNumberConstrainedPointParameters() throw(Isis::IException); + void incrementNumberConstrainedPointParameters(int incrementAmount) throw(Isis::IException); + void resetNumberConstrainedImageParameters() throw(Isis::IException); + void incrementNumberConstrainedImageParameters(int incrementAmount) throw(Isis::IException); + void resetNumberConstrainedTargetParameters() throw(Isis::IException); + void incrementNumberConstrainedTargetParameters(int incrementAmount) throw(Isis::IException); + void setNumberUnknownParameters(int numberParameters) throw(Isis::IException); + void computeDegreesOfFreedom() throw(Isis::IException); + + void computeSigma0(double dvtpv, Isis::BundleSettings::ConvergenceCriteria criteria) throw(Isis::IException); + void setDegreesOfFreedom(double degreesOfFreedom) throw(Isis::IException); + void setSigma0(double sigma0) throw(Isis::IException); + void setElapsedTime(double time) throw(Isis::IException); + void setElapsedTimeErrorProp(double time) throw(Isis::IException); + void setRadiansToMeters(double rtm) throw(Isis::IException); + void setConverged(bool converged) throw(Isis::IException); // or initialze method + // void setBundleControlPoints(QVector controlPoints); + // void setOutputControlNet(QSharedPointer outNet); + void setIterations(int iterations) throw(Isis::IException); + // void setObservations(BundleObservationVector observations) throw(Isis::IException); + + QList rmsImageSampleResiduals() const throw(Isis::IException); + QList rmsImageLineResiduals() const throw(Isis::IException); + QList rmsImageResiduals() const throw(Isis::IException); + QVector rmsImageXSigmas() const throw(Isis::IException); // currently unused ??? + QVector rmsImageYSigmas() const throw(Isis::IException); // currently unused ??? + QVector rmsImageZSigmas() const throw(Isis::IException); // currently unused ??? + QVector rmsImageRASigmas() const throw(Isis::IException); // currently unused ??? + QVector rmsImageDECSigmas() const throw(Isis::IException); // currently unused ??? + QVector rmsImageTWISTSigmas() const throw(Isis::IException); // currently unused ??? + + // Distance minSigmaLatitudeDistance() const throw(Isis::IException); + // Distance maxSigmaLatitudeDistance() const throw(Isis::IException); + // Distance minSigmaLongitudeDistance() const throw(Isis::IException); + // Distance maxSigmaLongitudeDistance() const throw(Isis::IException); + // Distance minSigmaRadiusDistance() const throw(Isis::IException); + // Distance maxSigmaRadiusDistance() const throw(Isis::IException); + + QString maxSigmaLatitudePointId() const throw(Isis::IException); + QString minSigmaLatitudePointId() const throw(Isis::IException); + QString minSigmaLongitudePointId() const throw(Isis::IException); + QString maxSigmaLongitudePointId() const throw(Isis::IException); + QString minSigmaRadiusPointId() const throw(Isis::IException); + QString maxSigmaRadiusPointId() const throw(Isis::IException); + double sigmaLatitudeStatisticsRms() const throw(Isis::IException); + double sigmaLongitudeStatisticsRms() const throw(Isis::IException); + double sigmaRadiusStatisticsRms() const throw(Isis::IException); + double rmsRx() const throw(Isis::IException); // currently unused ??? + double rmsRy() const throw(Isis::IException); // currently unused ??? + double rmsRxy() const throw(Isis::IException); // currently unused ??? + double rejectionLimit() const throw(Isis::IException); + double radiansToMeters() const throw(Isis::IException); + int numberRejectedObservations() const throw(Isis::IException); + int numberObservations() const throw(Isis::IException); + + int numberImageParameters() const throw(Isis::IException); // ??? this is the same value an m_nRank + int numberConstrainedPointParameters() const throw(Isis::IException); + int numberConstrainedImageParameters() const throw(Isis::IException); + int numberConstrainedTargetParameters() const throw(Isis::IException); + int numberUnknownParameters() const throw(Isis::IException); + int degreesOfFreedom() const throw(Isis::IException); + double sigma0() const throw(Isis::IException); + double elapsedTime() const throw(Isis::IException); + double elapsedTimeErrorProp() const throw(Isis::IException); + bool converged() const throw(Isis::IException); // or initialze method + + QVector > &bundleControlPoints(); + QSharedPointer outputControlNet() const throw(Isis::IException); + + int iterations() const throw(Isis::IException); + + int numberMaximumLikelihoodModels() const throw(Isis::IException); + int maximumLikelihoodModelIndex() const throw(Isis::IException); + double maximumLikelihoodMedianR2Residuals() const throw(Isis::IException); + double maximumLikelihoodModelQuantile(int modelIndex) const throw(Isis::IException); + + }; + +}; diff --git a/isis/sipfiles/BundleSettings.sip b/isis/sipfiles/BundleSettings.sip new file mode 100644 index 0000000000000000000000000000000000000000..b6f9799ab4ee37c1413122dbb13b4cd5c1959683 --- /dev/null +++ b/isis/sipfiles/BundleSettings.sip @@ -0,0 +1,113 @@ +%Include BundleObservationSolveSettings.sip +%Include MaximumLikelihoodWFunctions.sip + +%Include type_conversions.sip + +namespace Isis { + + class BundleSettings { + %TypeHeaderCode + #include "BundleSettings.h" + #include "BundleObservationSolveSettings.h" + #include + %End + public: + + enum ConvergenceCriteria { + Sigma0, /**< The value of sigma0 will be used to determine that the bundle + adjustment has converged.*/ + ParameterCorrections /**< All parameter corrections will be used to determine that the + bundle adjustment has converged.*/ + }; + + // enum MaximumLikelihoodModel { + // NoMaximumLikelihoodEstimator, + // Huber, + // ModifiedHuber, + // Welsch, + // Chen + // }; + + BundleSettings() throw(Isis::IException); + + void setValidateNetwork(bool) throw(Isis::IException); + + void setSolveOptions(bool solveObservationMode = false, + bool updateCubeLabel = false, + bool errorPropagation = false, + bool solveRadius = false, + double globalLatitudeAprioriSigma = Isis::Null, + double globalLongitudeAprioriSigma = Isis::Null, + double globalRadiusAprioriSigma = Isis::Null) throw(Isis::IException) /KeywordArgs="Optional"/; + + void setOutlierRejection(bool outlierRejection, + double multiplier = 1.0) throw(Isis::IException); + + bool solveObservationMode() const throw(Isis::IException); + bool solveRadius() const throw(Isis::IException); + bool updateCubeLabel() const throw(Isis::IException); + bool errorPropagation() const throw(Isis::IException); + bool outlierRejection() const throw(Isis::IException); + double outlierRejectionMultiplier() const throw(Isis::IException); + double globalLatitudeAprioriSigma() const throw(Isis::IException); + double globalLongitudeAprioriSigma() const throw(Isis::IException); + double globalRadiusAprioriSigma() const throw(Isis::IException); + + int numberSolveSettings() const throw(Isis::IException); + Isis::BundleObservationSolveSettings observationSolveSettings(QString instrumentId) const throw(Isis::IException); + Isis::BundleObservationSolveSettings observationSolveSettings(int n) const throw(Isis::IException); + + void setObservationSolveOptions(QList); + // %MethodCode + // Py_ssize_t size = PyList_Size(a0); + // QList *cppSettingsList = new QList(); + // int sipErr = 0; + // for(int i = 0; i < size; i++) { + // PyObject *pyStat = PyList_GET_ITEM(a0, i); + // Isis::BundleObservationSolveSettings *settings = (Isis::BundleObservationSolveSettings*)sipConvertToType(pyStat, sipType_Isis_BundleObservationSolveSettings, NULL, SIP_NOT_NONE, NULL, &sipErr); + // cppSettingsList->append(*settings); + // } + // + // sipCpp->setObservationSolveOptions(*cppSettingsList); + // %End + + SIP_PYLIST maximumLikelihoodEstimatorModels() const throw(Isis::IException); + %MethodCode // convert QList to Python list if tuples + typedef Isis::MaximumLikelihoodWFunctions::Model Model; + size_t size = sipCpp->maximumLikelihoodEstimatorModels().size(); + PyObject *l = PyList_New(size); + for (size_t i = 0; i < size; ++i) { + // get the two items from the QPair + Model *model = new Model(sipCpp->maximumLikelihoodEstimatorModels()[i].first); + double doubl = sipCpp->maximumLikelihoodEstimatorModels()[i].second; + + // Convert the two items to PyObjects + PyObject *first = sipConvertFromType((void*)(model), sipType_Isis_MaximumLikelihoodWFunctions_Model, NULL); + PyObject *second = PyFloat_FromDouble(doubl); + + // set the tuple items + PyObject *tuple = PyTuple_New(2); + PyTuple_SetItem(tuple, 0, first); + PyTuple_SetItem(tuple, 1, second); + + // Add new tuple to list + PyList_SetItem(l, i, tuple); + } + return l; + %End + + + int numberTargetBodyParameters() const throw(Isis::IException); + bool solveTargetBody() const throw(Isis::IException); + bool solvePoleRA() const throw(Isis::IException); + bool solvePoleRAVelocity() const throw(Isis::IException); + bool solvePoleDec() const throw(Isis::IException); + bool solvePoleDecVelocity() const throw(Isis::IException); + bool solvePM() const throw(Isis::IException); + bool solvePMVelocity() const throw(Isis::IException); + bool solvePMAcceleration() const throw(Isis::IException); + bool solveTriaxialRadii() const throw(Isis::IException); + bool solveMeanRadius() const throw(Isis::IException); + + }; +}; diff --git a/isis/sipfiles/BundleSolutionInfo.sip b/isis/sipfiles/BundleSolutionInfo.sip new file mode 100644 index 0000000000000000000000000000000000000000..a43fba1bd763c1169b861bc4bccdda657682f149 --- /dev/null +++ b/isis/sipfiles/BundleSolutionInfo.sip @@ -0,0 +1,26 @@ + +%Include type_conversions.sip + +namespace Isis{ + +class BundleSolutionInfo : public QObject { + %TypeHeaderCode + #include "BundleSolutionInfo.h" + %End + + public: + // do constructor since at the moment there doesn't seem to be a reason to contruct it directly in the python side + void setOutputStatistics(Isis::BundleResults statisticsResults) throw(Isis::IException); + void setRunTime(QString runTime) throw(Isis::IException); + + QString id() const throw(Isis::IException); + QSharedPointer bundleSettings() throw(Isis::IException); + Isis::BundleResults bundleResults() throw(Isis::IException); + QString runTime() const throw(Isis::IException); + + bool outputText() throw(Isis::IException); + bool outputPointsCSV() throw(Isis::IException); + bool outputResiduals() throw(Isis::IException); + + }; // end namespace Isis +}; diff --git a/isis/sipfiles/ControlNet.sip b/isis/sipfiles/ControlNet.sip new file mode 100644 index 0000000000000000000000000000000000000000..73408334cfc579dcb622c8376853677b9ff805d2 --- /dev/null +++ b/isis/sipfiles/ControlNet.sip @@ -0,0 +1,31 @@ +namespace Isis { + class ControlNet : public QObject { + %TypeHeaderCode + #include "ControlNet.h" + %End + public: + ControlNet() throw(Isis::IException); + ControlNet(const Isis::ControlNet &other) throw(Isis::IException); + + void clear() throw(Isis::IException); + + void Write(const QString &filename, bool pvl = false) throw(Isis::IException); + + double GetMaximumResidual() throw(Isis::IException); + QString GetNetworkId() const throw(Isis::IException); + int GetNumEditLockMeasures() throw(Isis::IException); + int GetNumEditLockPoints() throw(Isis::IException); + int GetNumIgnoredMeasures() throw(Isis::IException); + int GetNumberOfValidMeasuresInImage(const QString &serialNumber) throw(Isis::IException); + int GetNumberOfJigsawRejectedMeasuresInImage(const QString &serialNumber) throw(Isis::IException); + void ClearJigsawRejected() throw(Isis::IException); + void IncrementNumberOfRejectedMeasuresInImage(const QString &serialNumber) throw(Isis::IException); + void DecrementNumberOfRejectedMeasuresInImage(const QString &serialNumber) throw(Isis::IException); + int GetNumMeasures() const throw(Isis::IException); + int GetNumPoints() const throw(Isis::IException); + int GetNumValidMeasures() throw(Isis::IException); + int GetNumValidPoints() throw(Isis::IException); + QString GetTarget() const throw(Isis::IException); + QString GetUserName() const throw(Isis::IException); + }; +}; diff --git a/isis/sipfiles/ControlPoint.sip b/isis/sipfiles/ControlPoint.sip new file mode 100644 index 0000000000000000000000000000000000000000..8dd80250aa2d52a8f4348137ae41d44a05a76e34 --- /dev/null +++ b/isis/sipfiles/ControlPoint.sip @@ -0,0 +1,302 @@ +namespace Isis { + + class ControlPoint : public QObject { + %TypeHeaderCode + #include "ControlPoint.h" + %End + public: + enum PointType { + Fixed = 0, + Constrained = 1, + Free = 2 + }; + + + enum Status { + Failure, + Success, + PointLocked + }; + + enum ConstraintStatus { + LatitudeConstrained = 0, + LongitudeConstrained = 1, + RadiusConstrained = 2, +// XConstrained = 3, +// YConstrained = 4, +// ZConstrained = 5; + }; + + // This stuff input to jigsaw + // How did apriori source get computed?? + struct SurfacePointSource { + enum Source { + None, + User, + AverageOfMeasures, + Reference, + Basemap, + BundleSolution + }; + }; + + struct RadiusSource { + enum Source { + None, + User, + AverageOfMeasures, + Ellipsoid, + DEM, + BundleSolution + }; + }; + + ControlPoint() throw(Isis::IException); + ControlPoint(const QString &id) throw(Isis::IException); + + // Isis::ControlNet *Parent() { return parentNetwork; } + + // void Load(PvlObject &p) throw(Isis::IException); + + // void Add(ControlMeasure *measure) throw(Isis::IException); + // int Delete(ControlMeasure *measure) throw(Isis::IException); + // int Delete(QString serialNumber) throw(Isis::IException); + // int Delete(int index) throw(Isis::IException); + // Status ResetApriori() throw(Isis::IException); + + // const Isis::ControlMeasure *GetMeasure(QString serialNumber) const throw(Isis::IException); + // ControlMeasure *GetMeasure(QString serialNumber) throw(Isis::IException); + + // const ControlMeasure *GetMeasure(int index) const throw(Isis::IException); + // ControlMeasure *GetMeasure(int index) throw(Isis::IException); + + // const ControlMeasure *GetRefMeasure() const throw(Isis::IException); + // ControlMeasure *GetRefMeasure() throw(Isis::IException); + + // Status SetChooserName(QString name) throw(Isis::IException); + // Status SetDateTime(QString newDateTime) throw(Isis::IException); + // Status SetEditLock(bool editLock) throw(Isis::IException); + // Status SetId(QString id) throw(Isis::IException); + // Status SetRefMeasure(ControlMeasure *cm) throw(Isis::IException); + // Status SetRefMeasure(int index) throw(Isis::IException); + // Status SetRefMeasure(QString sn) throw(Isis::IException); + // Status SetRejected(bool rejected) throw(Isis::IException); + // Status SetIgnored(bool newIgnoreStatus) throw(Isis::IException); + // Status SetAdjustedSurfacePoint(SurfacePoint newSurfacePoint) throw(Isis::IException); + // Status SetType(PointType newType) throw(Isis::IException); + // + // Status SetAprioriRadiusSource(RadiusSource::Source source) throw(Isis::IException); + // Status SetAprioriRadiusSourceFile(QString sourceFile) throw(Isis::IException); + // Status SetAprioriSurfacePoint(SurfacePoint aprioriSP) throw(Isis::IException); + // Status SetAprioriSurfacePointSource(SurfacePointSource::Source source) throw(Isis::IException); + // Status SetAprioriSurfacePointSourceFile(QString sourceFile) throw(Isis::IException); + + // Status UpdateSphericalPointCoordinates(const Latitude &lat, const Longitude &lon, + // const Distance &radius) throw(Isis::IException); + + // Status ComputeApriori() throw(Isis::IException); + // Status ComputeResiduals() throw(Isis::IException); + // Status ComputeResiduals_Millimeters() throw(Isis::IException); + // + // SurfacePoint GetAdjustedSurfacePoint() const throw(Isis::IException); + // SurfacePoint GetBestSurfacePoint() const throw(Isis::IException); + + QString GetChooserName() const throw(Isis::IException); + QString GetDateTime() const throw(Isis::IException); + bool IsEditLocked() const throw(Isis::IException); + bool IsRejected() const throw(Isis::IException); + QString GetId() const throw(Isis::IException); + bool IsIgnored() const throw(Isis::IException); + bool IsValid() const throw(Isis::IException); + bool IsInvalid() const throw(Isis::IException); + bool IsFixed() const throw(Isis::IException); + + bool HasAprioriCoordinates() throw(Isis::IException); + bool IsConstrained() throw(Isis::IException); + bool IsLatitudeConstrained() throw(Isis::IException); + bool IsLongitudeConstrained() throw(Isis::IException); + bool IsRadiusConstrained() throw(Isis::IException); + int NumberOfConstrainedCoordinates() throw(Isis::IException); + + static QString PointTypeToString(PointType type) throw(Isis::IException); + static PointType StringToPointType(QString pointTypeString) throw(Isis::IException); + + QString GetPointTypeString() const throw(Isis::IException); + // PointType GetType() const throw(Isis::IException); + + static QString RadiusSourceToString(RadiusSource::Source source) throw(Isis::IException); + static RadiusSource::Source StringToRadiusSource(QString str) throw(Isis::IException); + QString GetRadiusSourceString() const throw(Isis::IException); + static QString SurfacePointSourceToString(SurfacePointSource::Source source) throw(Isis::IException); + // static SurfacePointSource::Source StringToSurfacePointSource(QString str) throw(Isis::IException); + QString GetSurfacePointSourceString() const throw(Isis::IException); + + // SurfacePoint GetAprioriSurfacePoint() const throw(Isis::IException); + // RadiusSource::Source GetAprioriRadiusSource() const throw(Isis::IException); + // QString GetAprioriRadiusSourceFile() const throw(Isis::IException); + // SurfacePointSource::Source GetAprioriSurfacePointSource() const throw(Isis::IException); + // QString GetAprioriSurfacePointSourceFile() const throw(Isis::IException); + + int GetNumMeasures() const throw(Isis::IException); + int GetNumValidMeasures() const throw(Isis::IException); + int GetNumLockedMeasures() const throw(Isis::IException); + bool HasSerialNumber(QString serialNumber) const throw(Isis::IException); + // int IndexOf(ControlMeasure *, bool throws = true) const throw(Isis::IException); + int IndexOf(QString sn, bool throws = true) const throw(Isis::IException); + int IndexOfRefMeasure() const throw(Isis::IException); + bool IsReferenceExplicit() const throw(Isis::IException); + QString GetReferenceSN() const throw(Isis::IException); + + // Statistics GetStatistic(double(ControlMeasure::*statFunc)() const) const throw(Isis::IException); + // Statistics GetStatistic(long dataType) const throw(Isis::IException); + + // QList< ControlMeasure * > getMeasures(bool excludeIgnored = false) const throw(Isis::IException); + // QList< QString > getCubeSerialNumbers() const throw(Isis::IException); + + // const ControlMeasure *operator[](QString serialNumber) const throw(Isis::IException); + // ControlMeasure *operator[](QString serialNumber) throw(Isis::IException); + + // const ControlMeasure *operator[](int index) const throw(Isis::IException); + // ControlMeasure *operator[](int index) throw(Isis::IException); + + // bool operator!=(const ControlPoint &pPoint) const throw(Isis::IException); + // bool operator==(const ControlPoint &pPoint) const throw(Isis::IException); + // const ControlPoint &operator=(const ControlPoint &pPoint) throw(Isis::IException); + + // The next 7 methods are specifically to support BundleAdjust + void ZeroNumberOfRejectedMeasures() throw(Isis::IException); + void SetNumberOfRejectedMeasures(int numRejected) throw(Isis::IException); + int GetNumberOfRejectedMeasures() const throw(Isis::IException); + double GetSampleResidualRms() const throw(Isis::IException); + double GetLineResidualRms() const throw(Isis::IException); + double GetResidualRms() const throw(Isis::IException); + void ClearJigsawRejected() throw(Isis::IException); + + // ControlPointFileEntryV0002 ToFileEntry() const throw(Isis::IException); + + private: + // void SetExplicitReference(ControlMeasure *measure) throw(Isis::IException); + void ValidateMeasure(QString serialNumber) const throw(Isis::IException); + // void AddMeasure(ControlMeasure *measure) throw(Isis::IException); + void PointModified() throw(Isis::IException); + + + // private: + // ControlNet *parentNetwork; + // + // //!< List of Control Measures + // QHash< QString, ControlMeasure * > * measures; + // + // QStringList *cubeSerials; + // + // ControlMeasure *referenceMeasure; + // + // /** + // * This is the control point ID. This is supposed to be a unique + // * identifier for control points. This often has a number in it, and + // * looks like "T0052" where the next one is "T0053" and so on. + // */ + // QString id; + // + // /** + // * This is the user name of the person who last modified this control + // * point. Modifications are things like updating the surface point, but + // * not things like updating the last modified time. The calculations + // * relating to this control point have to actually change for this to + // * be updated. This is an empty string if we need to dynamically + // * get the username of the caller when asked for (or written to file). + // */ + // QString chooserName; + // + // /** + // * This is the last modified date and time. This is updated automatically + // * and works virtually in the same way as chooserName. + // */ + // QString dateTime; + // + // /** + // * What this control point is tying together. + // * @see PointType + // */ + // PointType type; + // + // /** + // * If we forced a build that we would normally have thrown an exception + // * for then this is set to true. Otherwise, and most of the time, this + // * is false. + // */ + // bool invalid; + // + // /** + // * This stores the edit lock state. + // * @see SetEditLock + // */ + // bool editLock; + // + // /** + // * This stores the jigsaw rejected state. + // * @see SetJigsawReject + // */ + // bool jigsawRejected; + // + // /** + // * This stores the constraint status of the a priori SurfacePoint + // * @todo Eventually add x, y, and z + // */ + // std::bitset<6> constraintStatus; + // + // /** + // * This indicates if a program has explicitely set the reference in this + // * point or the implicit reference is still the current reference. This + // * is useful for programs that want to choose the reference for all + // * points where this hasn't happened yet. + // */ + // bool referenceExplicitlySet; + // + // /** + // * True if we should preserve but ignore the entire control point and its + // * measures. + // */ + // bool ignore; + // + // //! Where the apriori surface point originated from + // SurfacePointSource::Source aprioriSurfacePointSource; + // + // //! FileName where the apriori surface point originated from + // QString aprioriSurfacePointSourceFile; + // + // /** + // * Where the apriori surface point's radius originated from, most commonly + // * used by jigsaw. + // */ + // RadiusSource::Source aprioriRadiusSource; + // + // /** + // * The name of the file that derives the apriori surface point's radius + // */ + // QString aprioriRadiusSourceFile; + // + // /** + // * The apriori surface point. This is the "known truth" or trustworthy + // * point that should not be modified unless done very explicitely. This + // * comes from places like hand picking where you really don't want the + // * surface point to vary far from this point, but some variation is + // * okay (1/10th of a pixel is fair for human accuracy for example). Very + // * often this point does not exist. + // */ + // SurfacePoint aprioriSurfacePoint; + // + // /** + // * This is the calculated, or aposterori, surface point. This is what most + // * programs should be working with and updating. + // */ + // SurfacePoint adjustedSurfacePoint; + // + // /** + // * This parameter is used and maintained by BundleAdjust for the jigsaw + // * application. It is stored here because ControlPoint contains the index + // * of the measures. + // */ + // int numberOfRejectedMeasures; + }; +}; diff --git a/isis/sipfiles/MaximumLikelihoodWFunctions.sip b/isis/sipfiles/MaximumLikelihoodWFunctions.sip new file mode 100644 index 0000000000000000000000000000000000000000..cbc668d80d58796b89d7039716272285704aad0e --- /dev/null +++ b/isis/sipfiles/MaximumLikelihoodWFunctions.sip @@ -0,0 +1,52 @@ +namespace Isis { + + class MaximumLikelihoodWFunctions { + %TypeHeaderCode + #include "MaximumLikelihoodWFunctions.h" + %End + + public: + + enum Model { + Huber, + HuberModified, + Welsch, + Chen + }; + + static QString modelToString(Model model) throw(Isis::IException); + static Isis::MaximumLikelihoodWFunctions::Model stringToModel(QString modelName) throw(Isis::IException); + + MaximumLikelihoodWFunctions() throw(Isis::IException); + MaximumLikelihoodWFunctions(Model modelSelection) throw(Isis::IException); + MaximumLikelihoodWFunctions(Model modelSelection, double tweakingConstant) throw(Isis::IException); + MaximumLikelihoodWFunctions(const Isis::MaximumLikelihoodWFunctions &other) throw(Isis::IException); + + void setModel(Model modelSelection) throw(Isis::IException); // uses default tweaking constant + void setTweakingConstantDefault() throw(Isis::IException); + + void setModel(Model modelSelection, double tweakingConstant) throw(Isis::IException); + void setTweakingConstant(double tweakingConstant) throw(Isis::IException); + + Model model() const throw(Isis::IException); + double tweakingConstant() const throw(Isis::IException); + + // the W functions provide an additional weighting factor W which is used + // to 're-weight' each observation dynamically during an adjustment, the + // scalar functions provide access to various flavors of this scalar (as + // a function of the residual divided by the residuals sigma) + + double sqrtWeightScaler(double residualZScore) throw(Isis::IException); //it is often convient to use square roots of + //weights when building normals, this function + // provides the scaler for the square root of + // the weight directly + double tweakingConstantQuantile() throw(Isis::IException); // returns which quantile of the residuals is recommended to + // use as the tweaking constant, this varies as a function of + // the model being employed + + QString weightedResidualCutoff() throw(Isis::IException); + + QDataStream &write(QDataStream &stream) const throw(Isis::IException); + QDataStream &read(QDataStream &stream) throw(Isis::IException); + }; +}; diff --git a/isis/sipfiles/Statistics.sip b/isis/sipfiles/Statistics.sip new file mode 100644 index 0000000000000000000000000000000000000000..089b76a636977a614cae8812eacdf742b74263e7 --- /dev/null +++ b/isis/sipfiles/Statistics.sip @@ -0,0 +1,41 @@ + +namespace Isis { + class Statistics : public QObject { + %TypeHeaderCode + #include "Statistics.h" + %End + public: + Statistics(const Isis::Statistics &other) throw(Isis::IException); + + void Reset() throw(Isis::IException); + + void AddData(const double *data, const unsigned int count) throw(Isis::IException); + void AddData(const double data) throw(Isis::IException); + + void RemoveData(const double *data, const unsigned int count) throw(Isis::IException); + void RemoveData(const double data) throw(Isis::IException); + + double ValidMinimum() const throw(Isis::IException); + double ValidMaximum() const throw(Isis::IException); + bool InRange(const double value) throw(Isis::IException); + bool AboveRange(const double value) throw(Isis::IException); + bool BelowRange(const double value) throw(Isis::IException); + + double Average() const throw(Isis::IException); + double StandardDeviation() const throw(Isis::IException); + double Variance() const throw(Isis::IException); + double Sum() const throw(Isis::IException); + double SumSquare() const throw(Isis::IException); + double Rms() const throw(Isis::IException); + + double Minimum() const throw(Isis::IException); + double Maximum() const throw(Isis::IException); + double ChebyshevMinimum(const double percent = 99.5) const throw(Isis::IException); + double ChebyshevMaximum(const double percent = 99.5) const throw(Isis::IException); + double BestMinimum(const double percent = 99.5) const throw(Isis::IException); + double BestMaximum(const double percent = 99.5) const throw(Isis::IException); + double ZScore(const double value) const throw(Isis::IException); + + bool RemovedData() const throw(Isis::IException); + }; +}; diff --git a/isis/sipfiles/master.sip b/isis/sipfiles/master.sip new file mode 100644 index 0000000000000000000000000000000000000000..2cdb950c9cb1b90d2b3d9339ffc009ad26cbee7c --- /dev/null +++ b/isis/sipfiles/master.sip @@ -0,0 +1,75 @@ +%Module(name=libisispy, + version=0, + keyword_arguments="Optional") + +%ExportedHeaderCode + #include + #include + #include + #include + #include + + using namespace std; + + // Wraps glob to return a STD vector to avoid dealing with C style globbing + inline vector glob(const QString& pat){ + glob_t glob_result; + glob(pat.toLatin1().data(),GLOB_TILDE,NULL,&glob_result); + vector ret; + for(unsigned int i=0;i libs = glob(pat); + QLibrary lib_loader; + + for (vector::const_iterator i = libs.begin(); i != libs.end(); ++i) { + // Strip extension + QFileInfo file(*i); + QString lib_dir = file.path() + "/" + file.completeBaseName(); + + lib_loader.setFileName(lib_dir); + + // Load hint required for symbols to be accessible to other libraries loaded later + lib_loader.setLoadHints(QLibrary::ExportExternalSymbolsHint); + + bool load_ok = lib_loader.load(); + + // if verbose is true, print out load info + if (verbose) { + if (load_ok) { + cout << "Loaded " + lib_dir.toStdString() + " : OK" << endl; + } + else if (!load_ok) { + cout << "Loaded " + lib_dir.toStdString() + " : FAILED" << endl + << lib_loader.errorString().toStdString() << endl; + } + } + } + } +%End + +%Include type_conversions.sip + +%Include ControlPoint.sip +%Include BundleMeasure.sip +%Include BundleControlPoint.sip +%Include BundleImage.sip +%Include ControlNet.sip +%Include Statistics.sip +%Include BundleResults.sip +%Include BundleSolutionInfo.sip +%Include BundleObservationSolveSettings.sip +%Include BundleSettings.sip +%Include BundleAdjust.sip +%Include MaximumLikelihoodWFunctions.sip diff --git a/isis/sipfiles/type_conversions.sip b/isis/sipfiles/type_conversions.sip new file mode 100644 index 0000000000000000000000000000000000000000..7a337c444f80e475d9510e0081d7551d46f24f74 --- /dev/null +++ b/isis/sipfiles/type_conversions.sip @@ -0,0 +1,292 @@ + +%Import QtCore/QtCoremod.sip +%Import QtXml/QtXmlmod.sip + + + +%Exception Isis::IException(SIP_Exception) /PyName=IException/ +{ +%TypeHeaderCode +#include "IException.h" +%End +%RaiseCode + const char *detail = sipExceptionRef.what(); + + SIP_BLOCK_THREADS + PyErr_SetString(sipException_Isis_IException, detail); + SIP_UNBLOCK_THREADS +%End +}; + + +%MappedType QVector > +{ + %TypeHeaderCode + #include "BundleControlPoint.h" + #include + %End + + %ConvertFromTypeCode + size_t size = sipCpp->size(); + PyObject *l = PyList_New(size); + for (size_t i = 0; i < size; ++i) { + + Isis::BundleControlPoint* cppCPoint = sipCpp->at(i).data(); + + PyObject *pyCPoint = sipConvertFromType((void*)(cppCPoint), sipType_Isis_BundleControlPoint, NULL); + PyList_SetItem(l, i, pyCPoint); + } + + return l; + %End + + %ConvertToTypeCode + Py_ssize_t size = PyList_Size(sipPy); + QVector > *cppPointList = new QVector > (); + int sipErr = 0; + for(int i = 0; i < size; i++) { + PyObject *pyCPoint = PyList_GET_ITEM(sipPy, i); + Isis::BundleControlPoint *cppCPoint = (Isis::BundleControlPoint*)sipConvertToType(pyCPoint, sipType_Isis_BundleControlPoint, NULL, SIP_NOT_NONE, NULL, &sipErr); + cppPointList->append(QSharedPointer(cppCPoint)); + } + + *sipCppPtr = cppPointList; + return sipGetState(sipTransferObj); + %End + +}; + +%MappedType QList +{ + %TypeHeaderCode + #include "Statistics.h" + #include + %End + + %ConvertFromTypeCode + size_t size = sipCpp->size(); + PyObject *l = PyList_New(size); + for (size_t i = 0; i < size; ++i) { + Isis::Statistics* cppStats = new Isis::Statistics(sipCpp->at(i)); + PyObject *pyStats = sipConvertFromType((void*)(cppStats), sipType_Isis_Statistics, NULL); + PyList_SetItem(l, i, pyStats); + } + + return l; + %End + + %ConvertToTypeCode + Py_ssize_t size = PyList_Size(sipPy); + QList *cppStatList = new QList(); + int sipErr = 0; + for(int i = 0; i < size; i++) { + PyObject *pyStat = PyList_GET_ITEM(sipPy, i); + Isis::Statistics *stats = (Isis::Statistics*)sipConvertToType(pyStat, sipType_Isis_Statistics, NULL, SIP_NOT_NONE, NULL, &sipErr); + cppStatList->append(*stats); + } + + *sipCppPtr = cppStatList; + return sipGetState(sipTransferObj); + %End +}; + + + +%MappedType QList +{ + %TypeHeaderCode + #include "BundleObservationSolveSettings.h" + #include + %End + + %ConvertFromTypeCode + PyObject *l; + + // Create the Python list of the correct length. + if ((l = PyList_New(sipCpp->size())) == NULL) + return NULL; + + for (int i = 0; i < sipCpp->size(); ++i) { + Isis::BundleObservationSolveSettings *settings = new Isis::BundleObservationSolveSettings(sipCpp->at(i)); + + PyObject *pySettings = sipConvertFromType((void*)(settings), sipType_Isis_BundleObservationSolveSettings, NULL); + PyList_SetItem(l, i, pySettings); + } + + return l; + %End + + + %ConvertToTypeCode + if (!sipIsErr) { + if (!PyList_Check(sipPy)) + return 0; + + for (int i = 0; i < PyList_GET_SIZE(sipPy); ++i) + if (!sipCanConvertToType(PyList_GET_ITEM(sipPy, i), + sipType_Isis_BundleObservationSolveSettings, SIP_NOT_NONE)) + return 0; + + return 1; + } + + Py_ssize_t size = PyList_Size(sipPy); + + QList *cppSettingsList = new QList(); + int state; + + for(Py_ssize_t i = 0; i < size; i++) { + PyObject *pySettings = PyList_GET_ITEM(sipPy, i); + Isis::BundleObservationSolveSettings *settings; + + settings = (Isis::BundleObservationSolveSettings*)sipConvertToType(pySettings, sipType_Isis_BundleObservationSolveSettings, 0, SIP_NOT_NONE, &state, sipIsErr); + + if (*sipIsErr) { + sipReleaseType(pySettings, sipType_Isis_BundleObservationSolveSettings, state); + delete cppSettingsList; + return 0; + } + + cppSettingsList->append(*settings); + sipReleaseType(pySettings, sipType_Isis_BundleObservationSolveSettings, state); + } + + *sipCppPtr = cppSettingsList; + return sipGetState(sipTransferObj); + %End +}; + +// convert Bundlesettings wrapped in a QSharedPointer in Isis +%MappedType QSharedPointer +{ + %TypeHeaderCode + #include "BundleImage.h" + #include + %End + + %ConvertFromTypeCode + Isis::BundleImage *cpp = sipCpp->data(); + PyObject *py = sipConvertFromType(cpp, sipType_Isis_BundleImage, NULL); + return py; + %End + + %ConvertToTypeCode + int sipErr = 0; + QSharedPointer* cpp_qsp = new QSharedPointer(); + Isis::BundleImage *cpp = (Isis::BundleImage*)sipConvertToType(sipPy, sipType_Isis_BundleImage, NULL, SIP_NOT_NONE, NULL, &sipErr); + cpp_qsp->reset(cpp); + *sipCppPtr = cpp_qsp; + + return sipGetState(sipTransferObj); + %End +}; + + +// convert Bundlesettings wrapped in a QSharedPointer in Isis +%MappedType QSharedPointer +{ + %TypeHeaderCode + #include "BundleSettings.h" + #include + using namespace std; + %End + + %ConvertFromTypeCode + Isis::BundleSettings *settings = sipCpp->data(); + PyObject *pySettings = sipConvertFromType(settings, sipType_Isis_BundleSettings, NULL); + return pySettings; + %End + + %ConvertToTypeCode + int sipErr = 0; + QSharedPointer* wrappedSettings = new QSharedPointer(); + + Isis::BundleSettings *settings = (BundleSettings*) sipConvertToType(sipPy, sipType_Isis_BundleSettings, NULL, SIP_NOT_NONE, NULL, &sipErr); + wrappedSettings->reset(settings); + *sipCppPtr = wrappedSettings; + + return sipGetState(sipTransferObj); + %End +}; + + +// convert Bundlesettings wrapped in a QSharedPointer in Isis +%MappedType QSharedPointer +{ + %TypeHeaderCode + #include "ControlNet.h" + #include + using namespace std; + %End + + %ConvertFromTypeCode + PyObject *pySettings = sipConvertFromType(sipCpp, sipType_Isis_ControlNet, NULL); + return pySettings; + %End + + %ConvertToTypeCode + int sipErr = 0; + QSharedPointer *qspControlNet = NULL; + if (!sipCanConvertToType(sipPy, sipType_Isis_ControlNet, SIP_NOT_NONE)) { + sipErr = 1; + } + else { + Isis::ControlNet *cppControlNet = (Isis::ControlNet*)sipConvertToType(sipPy, sipType_Isis_ControlNet, NULL, SIP_NOT_NONE, NULL, &sipErr); + qspControlNet->reset(cppControlNet); + } + + *sipCppPtr = qspControlNet; + return sipGetState(sipTransferObj); + %End +}; + + + +// Convert a python str object to a std::string. +%MappedType std::string +{ + %TypeHeaderCode + #include + %End + + %ConvertFromTypeCode + // convert an std::string to a Python (unicode) string + PyObject* newstring; + newstring = PyUnicode_DecodeUTF8(sipCpp->c_str(), sipCpp->length(), NULL); + if(newstring == NULL) { + PyErr_Clear(); + newstring = PyBytes_FromString(sipCpp->c_str()); + } + return newstring; + %End + + %ConvertToTypeCode + // Allow a Python string (or a unicode string) whenever a string is + // expected. + // If argument is a Unicode string, just decode it to UTF-8 + // If argument is a Python string, assume it's UTF-8 + if (sipIsErr == NULL) + return (PyBytes_Check(sipPy) || PyUnicode_Check(sipPy)); + + if (sipPy == Py_None) + { + *sipCppPtr = new std::string; + return 1; + } + + if (PyUnicode_Check(sipPy)) + { + PyObject* s = PyUnicode_AsEncodedString(sipPy, "UTF-8", ""); + *sipCppPtr = new std::string(PyBytes_AS_STRING(s)); + Py_DECREF(s); + return 1; + } + + if (PyBytes_Check(sipPy)) + { + *sipCppPtr = new std::string(PyBytes_AS_STRING(sipPy)); + return 1; + } + return 0; + %End +}; diff --git a/isis/src/CMakeLists.txt b/isis/src/CMakeLists.txt new file mode 100644 index 0000000000000000000000000000000000000000..2fe7b579c9e7514bf0c276766a057c24f880b85c --- /dev/null +++ b/isis/src/CMakeLists.txt @@ -0,0 +1,17 @@ +#=============================================================================== +set(CORE_LIST base database control qisis system) + +get_subdirectory_list(${CMAKE_CURRENT_LIST_DIR} modules) + +# build core into isis library +add_isis_module(${CORE_LIB_NAME} ${CORE_LIST}) + +# remove duplicates so we dont build to the core targets twice +foreach(core ${CORE_LIST}) + list(REMOVE_ITEM modules "${CMAKE_CURRENT_LIST_DIR}/${core}") +endforeach() + +foreach( mod ${modules} ) + string(REPLACE "${CMAKE_CURRENT_LIST_DIR}/" "" strippedmod ${mod}) + add_isis_module(${strippedmod} ${strippedmod}) +endforeach() diff --git a/isis/src/Makefile b/isis/src/Makefile index 150207051b52e2054a379fb956d9f806bc626228..1652458951a6de671316e9593bec4f5c25e6d352 100644 --- a/isis/src/Makefile +++ b/isis/src/Makefile @@ -7,7 +7,7 @@ else .NOTPARALLEL: endif -PACKAGES = $(filter-out Makefile docsys CVS IsisObjectConvert.xsl, $(wildcard *)) +PACKAGES = $(filter-out Makefile CMakeLists.txt docsys CVS IsisObjectConvert.xsl, $(wildcard *)) PACKAGESCLEAN := $(PACKAGES:%=%-clean) PACKAGESQUICKCLEAN := $(PACKAGES:%=%-quickclean) @@ -21,7 +21,7 @@ PACKAGESCATTEST := $(filter-out qisis-catTest, $(PACKAGES:%=%-catTest)) # Allow parallel builds of applications applications: $(PACKAGESAPPS) - + %-apps: PACKAGE=`$(ECHO) $@ | $(SED) 's/-apps//'`; \ echo $(CURTIMESTAMP) " Working on Package [$$PACKAGE]"; \ diff --git a/isis/src/base/apps/automos/automos.xml b/isis/src/base/apps/automos/automos.xml index 395cd9141f11ddd1dc9ee202aad3e8632f6927af..bbf9c17508bc81130062f82d22709ba346a0fee7 100644 --- a/isis/src/base/apps/automos/automos.xml +++ b/isis/src/base/apps/automos/automos.xml @@ -49,7 +49,7 @@

MATCHDEM = FALSE, the default does not check the SHAPEMODEL keyword of the input cube - files and does not propogate what DEM Shapemodel that was used when the input files were + files and does not propagate what DEM Shapemodel that was used when the input files were projected.

@@ -61,19 +61,43 @@ options is explained in the tables and descriptions below.

- The Track feature creates a band in the output mosaic file containing the index - values for every pixel in the output mosaic. The Track-band can only be used appropriately through - the QVIEW-AdvancedTracking tool. As the user interactively pans across the displayed - mosaic band (Band1), for every mosaic pixel location QVIEW-AdvancedTracking will report - the source cube filename that was input to automos. The Track-band cannot be used outside - the QVIEW-AdvancedTracking tool. The file (byte) size of the mosaic is increased due to - the track-band. + The TRACK feature creates a separate tracking cube in addition to the mosaic cube, and + contains information for the source files of every pixel within the output mosaic. + This cube will have the same base-name as the mosaic cube but will end in + "_tracking.cub". The tracking cube must always reside in the same directory as the + mosaic cube to be properly accessed; this means that if the mosaic cube is copied or + moved, then its associated tracking cube must be copied or moved to the same location. + The tracking cube will always be of type unsigned integer. Depending on the + bit-type of the mosaic cube and/or the number of bands it contains, the tracking cube + may be as much as four times the size of the mosaic cube itself.

- The Track feature works with Priority options ONTOP (with HIGHSATURATION and - LOWSATURATION parameters) and BENEATH for single band input cubes. It does NOT support - multiple band input cubes with these priority options. It does work for multiband cubes - when PRIORITY=BAND. Furthermore, this feature is NOT supported when PRIORITY=AVERAGE. + The tracking cube can be used appropriately through the QVIEW-AdvancedTracking + tool. As the user pans across the displayed mosaic, for every mosaic pixel location, + QVIEW-AdvancedTracking will interactively report the index, the filename and the + serial number of the input cube that was input to automos for that specific pixel + location. Since the tracking cube is of bit-type unsigned integer, the DN values of + 0, 1 and 2 are reserved for NULL, LRS and LIS, respectively, so valid pixel DN values + will begin at an offset of 3. In other words, a pixel of DN value 3 in the tracking + cube means that this same pixel within the mosaic was taken from the first input + image. The tracking cube cannot be used outside of the QVIEW-AdvancedTracking tool + except as a visual representation of the source cubes for the different pixels. +

+

+ The TRACK feature works with Priority options ONTOP and BENEATH for single band input + cubes. It works for multiband cubes for PRIORITY=ONTOP only when the NULL, + HIGHSATURATION and LOWSATURATION options are set to true. It also works for multiband + cubes when PRIORITY=BAND. Furthermore, this feature is NOT supported when + PRIORITY=AVERAGE. +

+

+ Please Note: Prior to ISIS version 3.6.0, tracking for the various mosaicking apllications + was being handled with an internal tracking band. Tracking is now being handled by an + external tracking cube that contains the associated tracking information. This application + can no longer add to mosaics of the old format. In order to continue to use these + older mosaics with the updated mosaicking applications, you must first use the + trackextract utility application to extract the tracking band and the associated + tracking information into an external tracking cube.

@@ -90,8 +114,17 @@ current input image will appear in the output mosaic (it replaces the output mosaic pixel). Invalid input Special Pixels (NULL,HRS,HIS,LRS,LIS) will NOT - replace an existing Valid output mosaic pixel. Refer to parameters HIGHSATURATION, - LOWSATURATION, and NULL to override replacement of Valid output mosaic pixels. + replace an existing Valid output mosaic pixel unless the optional flags are set. Refer + to parameters HIGHSATURATION,LOWSATURATION, and NULL to override replacement of Valid + output mosaic pixels. +

+ NOTE: When using this priority with multi-band mosaics and with the TRACK + option set, all Special Pixel flags must be set as well. This is because the same + pixel within different bands of a single input image may hold both Valid and Special + Pixel values, and since our Tracking capabilities can only track one input image per + pixel (as it is a single band), it must accept the values for that particular pixel + from every band in the input image being placed on top. +

@@ -120,7 +153,7 @@ Overlapping Valid pixel values from the current input image and output mosaic will be averaged for the new mosaic pixel values. A count-band is created with the output mosaic file. The count-band keeps track of the number of images involved in the - averaging of the input dn values for each pixel in the mosaic. Invalid input pixel + averaging of the input DN values for each pixel in the mosaic. Invalid input pixel values will not be included in the average. In the case where only one Valid pixel exists between the input image pixels or the current mosaic pixel, the Valid pixel is retained in the current output mosaic. Refer to parameters HIGHSATURATION, @@ -474,6 +507,11 @@ Added parameter checking to XML MAXLON and MAXLAT to check if they are greater than their minimum counterpart. Fixes #5148 + + Updated documentation to reflect new handling of tracking capabilities with an external + tracking cube as well as clarify why special pixel flags are required when priority=ontop for + multiband mosaics. References #2092 + @@ -489,7 +527,7 @@ the same ProjectionName, PixelResolution (or MapScale), EquatorialRadius, PolarRadius, LatitudeType, LongitudeDirection and specific map projection keywords such as CenterLatitude and CenterLongitude. This includes the output mosaic - if it already exists. The latitude and longtiude extents of each input file may + if it already exists. The latitude and longitude extents of each input file may vary. @@ -588,11 +626,11 @@ If the Input and Mosaic pixel of the priority band, specified by NUMBER or KEYNAME and KEYVALUE, are valid, a less than or greater than comparison is done. Depending on the CRITERIA selected, the lower or higher of the two pixels is placed on top - (i.e., replaces the mosaic pixel). This applies to all the corresponding Valid band + (i.e., replaces the mosaic pixel). This applies to all the corresponding Valid band pixels. Special pixels in the corresponding bands will not replace the output mosaic pixel unless the HIGHSATURATION, LOWSATURATION and NULL flags are set to TRUE. Refer - to parameters HIGHSATURATION, LOWSATURATION, and NULL. This means, if the results - of the priority band comparison says that the input pixel should be on top, but the + to parameters HIGHSATURATION, LOWSATURATION, and NULL. This means, if the results + of the priority band comparison shows that the input pixel should be on top, but the input pixel on any other band is NULL, without the NULL=TRUE, the output mosaic pixel will remain unchanged for that band. @@ -697,7 +735,7 @@ The keyword values can be found on the labels of the input files under the "BandBin" Group. For instance, KEYNAME=NAME where the KEYVALUE can then be set to "Phase Angle", "Emission Angle", "Incidence Angle", - "Pixel Resolution". Refer to the phocube application that will + "Pixel Resolution". Refer to the phocube application that will create these 'Named' Bands. @@ -722,7 +760,7 @@ The lower DN value of the input priority band will replace the mosaic pixel - If the dn value of a pixel in the priority band of the input cube + If the DN value of a pixel in the priority band of the input cube is lesser than the corresponding pixel in the mosaic priority band, then the output pixel of the mosaic will be replaced by the input cube pixel. This will apply to all bands at this pixel location. @@ -732,7 +770,7 @@ The greater DN value of the input priority band will replace the mosaic pixel - If the dn value of a pixel in the priority band of the input cube + If the DN value of a pixel in the priority band of the input cube is greater than the corresponding pixel in the mosaic priority band, then the output pixel of the mosaic will be retained on NOT be replaced by the input cube pixel. This will apply to all bands at @@ -824,7 +862,7 @@ double Maximum Longitude - The maximum longitude value bounary extent for the output mosaic. + The maximum longitude value boundary extent for the output mosaic. MINLON @@ -841,27 +879,26 @@

- The Track feature creates a band in the output mosaic file containing the index - values for every pixel in the output mosaic. The Track-band can only be used - appropriately through the QVIEW-AdvancedTracking tool. As the user interactively - pans across the displayed mosaic band (Band1), for every mosaic pixel location - QVIEW-AdvancedTracking will report the source cube filename that was input to - automos. The Track-band cannot be used outside the QVIEW-AdvancedTracking tool. - TRACK must be set to TRUE at the time of mosaic creation only and cannot be turned - on after the mosaic is created. When a mosaic is created with TRACK=TRUE, all - subsequent runs will default to TRACK=TRUE. When a mosaic is created with - TRACK=FALSE, an error will be encountered if subsequent runs have TRACK=TRUE. - The file (byte) size of the mosaic is increased due to - the track-band. -

-

- A table, called InputImages, containing the names of the images used in the mosaic - will be added to the cube when TRACK=TRUE. + The Track feature creates a separate tracking cube containing the index values for + the source of every pixel in the output mosaic. The tracking cube can only be used + appropriately through the QVIEW-AdvancedTracking tool. As the user pans across the + displayed mosaic, for every mosaic pixel location QVIEW-AdvancedTracking will + interactively report the filename, the serial number and the index of the input cube + that was input to automos for that specific pixel location. The tracking cube cannot + be used outside the QVIEW-AdvancedTracking tool except as a visual representation of + the source cubes for the different pixels. TRACK must be set to TRUE at the time of + mosaic creation only and cannot be turned on after the mosaic is created. When a + mosaic is created with TRACK=TRUE, all subsequent runs will default to TRACK=TRUE. + When a mosaic is created with TRACK=FALSE, an error will be encountered if subsequent + runs have TRACK=TRUE. The tracking cube will always be of type unsigned integer. + Depending on the bit-type of the mosaic cube and/or the number of bands it contains, + the tracking cube may be as much as four times the size of the mosaic cube itself.

WARNING: - If Tracking is turned on in a mosaic, any subsequent applications that modify "dn" - values will corrupt the track-band, for instance the application reduce. + If Tracking is turned on in a mosaic, any subsequent applications that modify DN + values, such as the applicationreduce, will corrupt the DN values in the + tracking cube.

@@ -887,8 +924,8 @@ The default is FALSE. If set to TRUE, this application will create a Mosaic Group in the keyword labels of the new output mosaic cube including a ShapeModel keyword. The output mosaic is created with the first input - cube listed in the FROMLIST file, the ShapeModel keyword and it's value - will be propogated to the the Mosaic Group of the output mosaic cube file. + cube listed in the FROMLIST file, the ShapeModel keyword and its value + will be propagated to the Mosaic Group of the output mosaic cube file. Subsequently, the ShapeModel keyword value of the remaining input cubes will be checked against the ShapeModel value in the mosaic cube. This application will fail if the ShapeModel keywords don't match. @@ -950,7 +987,7 @@ clarify what happens during the mosaic process.

- The output mosaic shows the result of the second input image being mosaiced with the + The output mosaic shows the result of the second input image being mosaicked with the first input image. You can see in band one that none of the special pixels were retained because none of the special pixel flags were set. In other words, regardless of whether there was a valid comparison at that pixel of the priority band, all other bands will @@ -959,7 +996,7 @@

In band two, you can still see where the special pixels were in the second input image. The second image would have been "on top" because in band two, the pixels are less than - those of the mosaic. However, the valid data in the mosaic was left alone because the + those of the mosaic. However, the valid data in the mosaic was disregarded because the special pixel flags were not set. You cannot see the special pixels from the first image because the valid pixels from the second image were kept instead.

diff --git a/isis/src/base/apps/cam2cam/cam2cam.cpp b/isis/src/base/apps/cam2cam/cam2cam.cpp index ce6be30660cc5062b805382a3648eece39a47279..5ad273102e3e79a43cee0f85cf611cd07ea837d4 100644 --- a/isis/src/base/apps/cam2cam/cam2cam.cpp +++ b/isis/src/base/apps/cam2cam/cam2cam.cpp @@ -1,6 +1,7 @@ #include "Isis.h" #include "CameraFactory.h" #include "Camera.h" +#include "Distance.h" #include "ProcessRubberSheet.h" #include "IException.h" #include "cam2cam.h" @@ -118,7 +119,13 @@ bool cam2cam::Xform(double &inSample, double &inLine, // Get the universal lat/lon and see if it can be converted to input line/samp double lat = p_outcam->UniversalLatitude(); double lon = p_outcam->UniversalLongitude(); - if(!p_incam->SetUniversalGround(lat, lon)) return false; + Distance rad = p_outcam->LocalRadius(); + if (rad.isValid()) { + if(!p_incam->SetUniversalGround(lat, lon, rad.meters())) return false; + } + else { + if(!p_incam->SetUniversalGround(lat, lon)) return false; + } // Make sure the point is inside the input image if(p_incam->Sample() < 0.5) return false; diff --git a/isis/src/base/apps/cam2cam/cam2cam.xml b/isis/src/base/apps/cam2cam/cam2cam.xml index 9700441f44b5f2bd92ee6fdc0079b55d882373f5..469b534622d2cb46028a7e55762504e411c4cdbb 100644 --- a/isis/src/base/apps/cam2cam/cam2cam.xml +++ b/isis/src/base/apps/cam2cam/cam2cam.xml @@ -6,7 +6,7 @@ - This program will convert a input camera cube to a different camera geometry. For example, given overlapping MGS MOC and Odyssey Themis cubes, + This program will convert a input camera cube to a different camera geometry. For example, given overlapping MGS MOC and Odyssey Themis cubes, this program can convert the MOC image to have the same geometric camera characteristics as the Themis cube (or vice versa). Another use is to align bands in a camera cube which has independent bands. For example, a raw Themis cube (after thm2isis) will not have aligned pixels. This program can be used to align the pixels without going to a map projection. To prevent pixels from falling off the edge of the cube you can run pad on the cube prior to @@ -37,14 +37,19 @@ Fixed typo in documentation - Fixed an access on an invalid pointer that caused segmentation faults on + Fixed an access on an invalid pointer that caused segmentation faults on cubes in which the camera is band-dependant. Fixed problems with reference bands on band-dependent instruments - Removed references to CubeInfo + Removed references to CubeInfo + + + Changed transform to use the local radius computed by the output camera instead of + having the input camera re-compute it (sometimes incorrectly) from the latitude and + longitude. Fixes #5425. @@ -104,13 +109,13 @@ middle Reference Band - This is the reference band to be used in the MATCH cube. - That is, all bands in the FROM cube will be matched to + This is the reference band to be used in the MATCH cube. + That is, all bands in the FROM cube will be matched to this band. The default is to use the middle band; however, the user can enter any band number which is valid for the instrument, regardless of whether the band is in the cube - or not. - This only applies to band dependent camera models such as + or not. + This only applies to band dependent camera models such as Themis. 1 @@ -152,4 +157,3 @@
- diff --git a/isis/src/base/apps/cam2map/tsts/targCodeFromNaifKeywordsObj/Makefile b/isis/src/base/apps/cam2map/tsts/targCodeFromNaifKeywordsObj/Makefile deleted file mode 100644 index 068d99b44ba1e240065544d1133817a762895a23..0000000000000000000000000000000000000000 --- a/isis/src/base/apps/cam2map/tsts/targCodeFromNaifKeywordsObj/Makefile +++ /dev/null @@ -1,17 +0,0 @@ -APPNAME = cam2map - -cam2mapTruth.cub.TOLERANCE = .000001 -cam2mapCheckRange.cub.TOLERANCE = .000001 - -include $(ISISROOT)/make/isismake.tsts - -commands: - $(APPNAME) from=$(INPUT)/test.cub \ - to=$(OUTPUT)/cam2mapTruth.cub \ - map=$(INPUT)/test.map \ - lonseam=continue \ - pixres=map \ - >& /dev/null; - catlab from=$(OUTPUT)/cam2mapTruth.cub \ - to=$(OUTPUT)/cubeLabel.pvl \ - >& /dev/null; diff --git a/isis/src/base/apps/campt/campt.cpp b/isis/src/base/apps/campt/campt.cpp index 0e306bbd70750e68b3c607c224461b8d1b7264ac..897b4742c26c8e4efd19f8eaa519ded26ab378eb 100644 --- a/isis/src/base/apps/campt/campt.cpp +++ b/isis/src/base/apps/campt/campt.cpp @@ -30,7 +30,7 @@ void writePoints(const UserInterface &ui, QList camPoints); void IsisMain() { UserInterface &ui = Application::GetUserInterface(); - + // Setup our input cube CameraPointInfo campt; @@ -40,15 +40,15 @@ void IsisMain() { else campt.SetCSVOutput(true); - campt.SetCube(ui.GetFileName("FROM") + "+" + ui.GetInputAttribute("FROM").toString()); + campt.SetCube( ui.GetFileName("FROM") + "+" + ui.GetInputAttribute("FROM").toString() ); // Grab the provided points (coordinates) QList< QPair > points = getPoints(ui, ui.WasEntered("COORDLIST")); - + // Get the camera point info for coordiante QList camPoints = getCameraPointInfo(ui, points, campt); - + writePoints(ui, camPoints); } @@ -60,25 +60,25 @@ QList< QPair > getPoints(const UserInterface &ui, bool usePointL double point2 = 0.0; QList< QPair > points; QString pointType = ui.GetString("TYPE"); - + // Check if the provided coordinate list is valid, i.e. a Samp/Line or Lat/Long coordinate per row if (usePointList) { - + CSVReader reader; reader.read(FileName(ui.GetFileName("COORDLIST")).expanded()); - + if (!reader.isTableValid(reader.getTable()) || reader.columns() != 2) { QString msg = "Coordinate file formatted incorrectly.\n" "Each row must have two columns: a sample,line or a latitude,longitude pair."; - throw IException(IException::User, msg, _FILEINFO_); + throw IException(IException::User, msg, _FILEINFO_); } - + for (int row = 0; row < reader.rows(); row++) { point1 = toDouble(reader.getRow(row)[0]); point2 = toDouble(reader.getRow(row)[1]); points.append(QPair(point1, point2)); } - + } // Grab the coordinate from the ui position parameters if no coordinate list is provided else { @@ -94,12 +94,12 @@ QList< QPair > getPoints(const UserInterface &ui, bool usePointL } points.append(QPair(point1, point2)); } - + return points; } -// Gets the camera information for each point (coordinate). +// Gets the camera information for each point (coordinate). // Passed in a list of coordinates, passed in by reference a CameraPointInfo object. // Returns a list of PvlGroup pointers - these groups contain the camera info for each coordinate. QList getCameraPointInfo(const UserInterface &ui, @@ -117,7 +117,7 @@ QList getCameraPointInfo(const UserInterface &ui, type = ui.GetString("TYPE"); } PvlGroup *camPoint = NULL; - + // Depending on what type is selected, set values accordingly for (int i = 0; i < points.size(); i++) { @@ -166,13 +166,18 @@ void writePoints(const UserInterface &ui, QList camPoints) { bool append = ui.GetBoolean("APPEND"); QString fileFormat = ui.GetString("FORMAT"); PvlGroup *point = NULL; - + for (int p = 0; p < camPoints.size(); p++) { bool fileExists = FileName(outFile).fileExists(); prog.CheckStatus(); point = camPoints[p]; - + + // Remove units on look direction vectors + point -> findKeyword("LookDirectionBodyFixed").setUnits(""); + point -> findKeyword("LookDirectionJ2000").setUnits(""); + point -> findKeyword("LookDirectionCamera").setUnits(""); + // write to output file if (ui.WasEntered("TO")) { // Write the pvl group out to the file @@ -180,16 +185,15 @@ void writePoints(const UserInterface &ui, QList camPoints) { Pvl temp; temp.setTerminator(""); temp.addGroup((*point)); - + // we don't want to overwrite successive points in outfile if (append || p > 0) { temp.append(outFile); } else { temp.write(outFile); - } + } } - // Create a flatfile from PVL data // The flatfile is comma delimited and can be imported into Excel else { @@ -205,7 +209,7 @@ void writePoints(const UserInterface &ui, QList camPoints) { os.open(outFile.toLatin1().data(), ios::out); writeHeader = true; } - + if (writeHeader) { for (int i = 0; i < (*point).keywords(); i++) { if ((*point)[i].size() == 3) { @@ -216,14 +220,14 @@ void writePoints(const UserInterface &ui, QList camPoints) { else { os << (*point)[i].name(); } - + if (i < point->keywords() - 1) { os << ","; } } os << endl; } - + for (int i = 0; i < (*point).keywords(); i++) { @@ -235,7 +239,7 @@ void writePoints(const UserInterface &ui, QList camPoints) { else { os << (QString)(*point)[i]; } - + if (i < (*point).keywords() - 1) { os << ","; } @@ -243,15 +247,16 @@ void writePoints(const UserInterface &ui, QList camPoints) { os << endl; } } - + // No output file specified else { - // don't log data - + // don't log data - if (ui.GetString("FORMAT") == "FLAT") { string msg = "Flat file must have a name."; throw IException(IException::User, msg, _FILEINFO_); } } + // we still want to output the results Application::Log((*point)); delete point; diff --git a/isis/src/base/apps/campt/campt.xml b/isis/src/base/apps/campt/campt.xml index ac0a0d7200163a42b6e553adda39569329d506b5..86e43926e3ba01991018e1b1de5d5c13401ce934 100644 --- a/isis/src/base/apps/campt/campt.xml +++ b/isis/src/base/apps/campt/campt.xml @@ -9,12 +9,12 @@ xsi:noNamespaceSchemaLocation=

- Campt computes geometric and photometric information at a given pixel - location or list of pixel locations in the input image cube. - The program computes spacecraft and instrument related information, and other types of - coordinates as described later in this document. The user will have a choice of coordinates - in which to output the information as well as a choice in the output format of the - information acquired. + Campt computes geometric and photometric information at a given pixel + location or list of pixel locations in the input image cube. + The program computes spacecraft and instrument related information, and other types of + coordinates as described later in this document. The user will have a choice of coordinates + in which to output the information as well as a choice in the output format of the + information acquired.

Note the input image cube has preliminary requirements: @@ -26,42 +26,42 @@ xsi:noNamespaceSchemaLocation=

The point of interest in the image can be entered as Latitude/Longitude - coordinates or Sample/Line coordinates. Keep in mind - that the input Latitude and Longitude values entered - will be interpreted as Universal - Coordinates (ISIS default) regardless of the target body. In the + coordinates or Sample/Line coordinates. Keep in mind + that the input Latitude and Longitude values entered + will be interpreted as Universal + Coordinates (ISIS default) regardless of the target body. In the output, all positions are in Body-Fixed - Coordinates. Multiple points of interest may be specified by providing a comma-delimited - flatfile of coordinates. + Coordinates. Multiple points of interest may be specified by providing a comma-delimited + flatfile of coordinates.

-

+

The following is a partial list of coordinates computed in the campt application:

- Geometric Information: Latitude, Longitude, Oblique Detector Resolution, + Geometric Information: Latitude, Longitude, Oblique Detector Resolution, Line Resolution, Oblique Line Resolution

- Photometric Information: Phase, - Emission, and Phase, + Emission, and Incidence Angles

- In addition, this application will return a list of other spacecraft, - sun and instrument-related information including but not limited to - Spacecraft Position, Spacecraft Azimuth, - Sub-Spacecraft Longitude, - SubSolar Latitude, SubSolar Longitude, and + In addition, this application will return a list of other spacecraft, + sun and instrument-related information including but not limited to + Spacecraft Position, Spacecraft Azimuth, + Sub-Spacecraft Longitude, + SubSolar Latitude, SubSolar Longitude, and Time information (Ephemeris Time, UTC).

-

- You may choose the format of the output file. The option list includes - a choice of a PVL file or a flat file. A PVL file is a text - file in label format, while the flat file is a comma-delimited text file - that is easily imported into most databases and digital spreadsheets +

+ You may choose the format of the output file. The option list includes + a choice of a PVL file or a flat file. A PVL file is a text + file in label format, while the flat file is a comma-delimited text file + that is easily imported into most databases and digital spreadsheets such as Microsoft Excel. Below is an example of campt output in PVL - format. You can skim the left column of this PVL-formatted output file for - a thorough listing of the types of coordinates, sun and instrument-related - information computed when using campt. + format. You can skim the left column of this PVL-formatted output file for + a thorough listing of the types of coordinates, sun and instrument-related + information computed when using campt.

- +
 Group = GroundPoint
   Filename                   = /usgs/cpkgs/isis3/data/mgs/testData/ab102401.cub
@@ -115,10 +115,10 @@ Group = GroundPoint
   Error                      = NULL
 End_Group
     
- +

Note: The "Error" keyword will only appear when using a coordinate list. The value of - "Error" will be NULL unless an error occurs during the processing of a coordinate in the + "Error" will be NULL unless an error occurs during the processing of a coordinate in the coordinate list. Then, the value of this keyword will be the error message.

@@ -151,19 +151,19 @@ End_Group Added additional output - Modified to use OffNadirAngle instead of SpacecraftRoll angle due to + Modified to use OffNadirAngle instead of SpacecraftRoll angle due to changes made to the camera class Added RightAscension and Declination to PVL output. Program now requires - user to specify a filename when using FLAT option. Increased precision in + user to specify a filename when using FLAT option. Increased precision in flatfile output and updated appTest truthdata. Added default values for the lines and samples - Removed references to CubeInfo + Removed references to CubeInfo Removed unnecessary duplicate cube creation @@ -171,9 +171,9 @@ End_Group Added SubSolarGroundAzimuth and SubSpacecraftGroundAzimuth to PVL output. The SubSolarGroundAzimuth is the clockwise - angle on the ground between a line drawn from the ground - point to the North pole of the body and a line drawn from - the ground point to the subsolar point. The + angle on the ground between a line drawn from the ground + point to the North pole of the body and a line drawn from + the ground point to the subsolar point. The SubSpacecraftGroundAzimuth is defined similarly except it uses the subspacecraft point. @@ -193,8 +193,8 @@ End_Group Modified the documentation, fixes #1173 - Removed links to applications imbedded in text and replaced with - italicized application name. Added application links to the + Removed links to applications imbedded in text and replaced with + italicized application name. Added application links to the "Related Objects and Documents" section of the documentation. Fixes mantis ticket #1525. @@ -205,18 +205,21 @@ End_Group Updated documentation. References #1449. - + Checked in new test data, and added support for changes made to the CameraPointInfo and Camera classes that incorporate new estimates for Pixel/Line/Sample/Detetctor resolution and now allow a developer to control the order in which fields are output in both PVL and CSV format. References #476, #4100. - - Resolved issue where the default value for the "allowoutside" parameter was supposed - to be set to "true", but the default _behavior_ of campt was instead consistent with a - setting of "false". In addition, corrected behavior where + + Resolved issue where the default value for the "allowoutside" parameter was supposed + to be set to "true", but the default _behavior_ of campt was instead consistent with a + setting of "false". In addition, corrected behavior where manually setting "allowoutside" to "false" was ignored. Ref # 2258. + + Removed units on look direction vectors to make them unitless. Fixes #5125. + @@ -249,7 +252,7 @@ End_Group *.cub - + boolean FALSE @@ -257,10 +260,10 @@ End_Group Enable coordinate list parameters in the GUI - Selecting this parameter will enable the 'COORDLIST' and 'COORDTYPE' parameters in the - GUI. + Selecting this parameter will enable the 'COORDLIST' and 'COORDTYPE' parameters in the + GUI.

- Note that this parameter is optional when running campt on the + Note that this parameter is optional when running campt on the command line.

@@ -276,7 +279,7 @@ End_Group LONGITUDE
- + filename input @@ -286,7 +289,7 @@ End_Group None An input comma-delimited flatfile of image coordinates or ground coordinates. - This allows the program to process multiple coordinates in a single run of campt, + This allows the program to process multiple coordinates in a single run of campt, and output the results to the specified output file.

Expected order for image coordinates: sample, line
@@ -294,14 +297,14 @@ End_Group

The "Error" keyword will only appear when using a coordinate list. The value of "Error" - will then be NULL unless an error occurs during the processing of a coordinate in the + will then be NULL unless an error occurs during the processing of a coordinate in the coordinate list. Then, the value of this keyword will be the error message. This allows for campt to continue processing the remaining coordinates in the coordinate list. -

+

- For the input of Latitude and Longitude, campt expects - Planetocentric Latitude (within -90 to 90 boundary) and + For the input of Latitude and Longitude, campt expects + Planetocentric Latitude (within -90 to 90 boundary) and Positive East Longitude (with 0-360 boundary) to find the location in the input camera image.

@@ -314,7 +317,7 @@ End_Group LONGITUDE
- + string Coordinate type selection (Image or Ground) for 'COORDLIST' @@ -343,29 +346,29 @@ End_Group TYPE - + filename output Output text filename None - A text file in label format (PVL) which will + A text file in label format (PVL) which will contain the results of campt. This file can - be used in conjunction with the getkey application - in order to pass the results to another program when developing + be used in conjunction with the getkey application + in order to pass the results to another program when developing scripts. - + string - Output format (PVL or FLAT) + Output format (PVL or FLAT) Format type for output file. PVL format is default. - +
PVL - This parameter is used to select the type of coordinate entered, + This parameter is used to select the type of coordinate entered, which will be used to determine the method to compute the geometric and photometric information. @@ -471,7 +474,7 @@ End_Group Center sample - This is the Sample position used to compute information + This is the Sample position used to compute information at a given pixel location in the input image cube. @@ -484,7 +487,7 @@ End_Group Center line - This is the Line position used to compute information + This is the Line position used to compute information at a given pixel location in the input image cube. @@ -495,7 +498,7 @@ End_Group Latitude (planetocentric) position - This is the Planetocentric Latitude (within -90 to 90 + This is the Planetocentric Latitude (within -90 to 90 boundary) used to find the location in the input camera image.

Refer to Latitude Type. @@ -514,7 +517,7 @@ End_Group This is the Positive East Longitude (with 0-360 boundary) used to find the location in the input camera image.

- Refer to Longitude Direction and + Refer to Longitude Direction and Longitude Domain.

diff --git a/isis/src/base/apps/csv2table/Makefile b/isis/src/base/apps/csv2table/Makefile new file mode 100644 index 0000000000000000000000000000000000000000..7578f0b21d038db6a5042c095cda9b34b6bb2570 --- /dev/null +++ b/isis/src/base/apps/csv2table/Makefile @@ -0,0 +1,7 @@ +ifeq ($(ISISROOT), $(BLANK)) +.SILENT: +error: + echo "Please set ISISROOT"; +else + include $(ISISROOT)/make/isismake.apps +endif \ No newline at end of file diff --git a/isis/src/base/apps/csv2table/csv2table.cpp b/isis/src/base/apps/csv2table/csv2table.cpp new file mode 100644 index 0000000000000000000000000000000000000000..439e274d9c3a6facbba616004ba9a02837424c9f --- /dev/null +++ b/isis/src/base/apps/csv2table/csv2table.cpp @@ -0,0 +1,120 @@ +/** + * @file + * $Revision: 1.8 $ + * $Date: 2010/04/08 15:28:20 $ + * + * Unless noted otherwise, the portions of Isis written by the USGS are public + * domain. See individual third-party library and package descriptions for + * intellectual property information,user agreements, and related information. + * + * Although Isis has been used by the USGS, no warranty, expressed or implied, + * is made by the USGS as to the accuracy and functioning of such software + * and related material nor shall the fact of distribution constitute any such + * warranty, and no responsibility is assumed by the USGS in connection + * therewith. + * + * For additional information, launch + * $ISISROOT/doc//documents/Disclaimers/Disclaimers.html in a browser or see + * the Privacy & Disclaimers page on the Isis website, + * http://isis.astrogeology.usgs.gov, and the USGS privacy and disclaimers on + * http://www.usgs.gov/privacy.html. + */ + +#include "Isis.h" + +#include + +#include "Cube.h" +#include "CSVReader.h" +#include "IException.h" +#include "IString.h" +#include "Pvl.h" +#include "PvlObject.h" +#include "Table.h" +#include "TableField.h" +#include "TableRecord.h" + +using namespace Isis; + + +void IsisMain() { + UserInterface &ui = Application::GetUserInterface(); + + // Read the CSV file and get the header + QString csvFileName = ui.GetFileName("csv"); + CSVReader reader; + try { + reader = CSVReader(csvFileName, true); + } + catch(IException &e) { + QString msg = "Failed to read CSV file [" + csvFileName + "]."; + throw IException(e, IException::Io, msg, _FILEINFO_); + } + int numColumns = reader.columns(); + int numRows = reader.rows(); + if (numColumns < 1 || numRows < 1) { + QString msg = "CSV file does not have data.\nFile has [" + toString(numRows) + + "] rows and [" + toString(numColumns) +"] columns."; + throw IException(IException::User, msg, _FILEINFO_); + } + CSVReader::CSVAxis header = reader.getHeader(); + + // Construct an empty table with the CSV header as field names + TableRecord tableRow; + for (int columnIndex = 0; columnIndex < numColumns; columnIndex++) { + TableField columnField(QString(header[columnIndex]), TableField::Double); + tableRow += columnField; + } + QString tableName = ui.GetString("tablename"); + Table table(tableName, tableRow); + + // Fill the table + for (int rowIndex = 0; rowIndex < numRows; rowIndex++) { + CSVReader::CSVAxis csvRow = reader.getRow(rowIndex); + for (int columnIndex = 0; columnIndex < numColumns; columnIndex++) { + tableRow[columnIndex] = toDouble(csvRow[columnIndex]); + } + table += tableRow; + } + + // If a set of label keywords was passed add them to the table + if (ui.WasEntered("label")) { + QString labelPvlFilename = ui.GetFileName("label"); + Pvl labelPvl; + try { + labelPvl.read(labelPvlFilename); + } + catch(IException &e) { + QString msg = "Failed to read PVL label file [" + labelPvlFilename + "]."; + throw IException(e, IException::Io, msg, _FILEINFO_); + } + + PvlObject &tableLabel = table.Label(); + for (int keyIndex = 0; keyIndex < labelPvl.keywords(); keyIndex++) { + tableLabel.addKeyword(labelPvl[keyIndex]); + } + } + + // Write the table to the cube + QString outCubeFileName(ui.GetFileName("to")); + Cube outCube; + try { + outCube.open(outCubeFileName, "rw"); + } + catch(IException &e) { + QString msg = "Could not open output cube [" + outCubeFileName + "]."; + throw IException(e, IException::Io, msg, _FILEINFO_); + } + + try { + outCube.write(table); + } + catch(IException &e) { + QString msg = "Could not write output table [" + tableName + + "] to output cube [" + outCubeFileName + "]."; + throw IException(e, IException::Io, msg, _FILEINFO_); + } + + outCube.close(); + +} diff --git a/isis/src/base/apps/csv2table/csv2table.xml b/isis/src/base/apps/csv2table/csv2table.xml new file mode 100644 index 0000000000000000000000000000000000000000..a2bd1a7c0f1779d4ca0bc449b568d613ff383ac0 --- /dev/null +++ b/isis/src/base/apps/csv2table/csv2table.xml @@ -0,0 +1,103 @@ + + + + + Convert a CSV file to a table and attach it to a cube + + + + This application converts a CSV file to a table and attaches it to a cube + The first row of the CSV will be used as the fieldnames for the table. + The contents of the CSV file will be converted to floating point numbers + before they are inserted into the table. + + + + Scripting + + + + + tabledump + + + + + + Original version + + + + + + + filename + input + Input CSV filename + + Input CSV filename. The first row of this file will be used as the + table field names. + + + *.csv + + + + + filename + input + Input table label PVL filename + + Input table label PVL filename. This is expected to be a flat PVL + file where all of the keywords and their values will be added to + the tabel label. + + None + + *.pvl + + + + + cube + output + Output cube filename + + Output cube filename that the table will be attached to + + + *.cub + + + + + + + string + The name of the table + + A table will be created with this name on the output cube using the + data from the CSV file. If a table with this name already exists on + the cube it will be overwritten. + + + + + + + + + Write a simple table + Write a simple csv file to a cube. + + csv=test.csv tablename=TestTable to=isisTruth.cub + + + In this example, csv2table will write a table called TestTable on + isisTruth.cub with the contents of test.csv. + + + + + + diff --git a/isis/src/base/apps/csv2table/tsts/Label/Makefile b/isis/src/base/apps/csv2table/tsts/Label/Makefile new file mode 100644 index 0000000000000000000000000000000000000000..48d2f26e42e878485e2bf9c82cc5c2e16a9808e7 --- /dev/null +++ b/isis/src/base/apps/csv2table/tsts/Label/Makefile @@ -0,0 +1,14 @@ +APPNAME = csv2table + +include $(ISISROOT)/make/isismake.tsts + +commands: + cp $(INPUT)/isisTruth.cub $(OUTPUT)/isisTruth.cub; + $(APPNAME) csv=$(INPUT)/test.csv \ + label=$(INPUT)/label.pvl \ + tablename="TestTable" \ + to=$(OUTPUT)/isisTruth.cub > /dev/null; + catlab from=$(OUTPUT)/isisTruth.cub | \ + sed -n '/Object = Table/,/End_Object/p' > \ + $(OUTPUT)/table.pvl; + rm $(OUTPUT)/isisTruth.cub; diff --git a/isis/src/base/apps/csv2table/tsts/Makefile b/isis/src/base/apps/csv2table/tsts/Makefile new file mode 100644 index 0000000000000000000000000000000000000000..46d84c74c297304e943452a44e06b111f179a92b --- /dev/null +++ b/isis/src/base/apps/csv2table/tsts/Makefile @@ -0,0 +1,4 @@ +BLANKS = "%-6s" +LENGTH = "%-40s" + +include $(ISISROOT)/make/isismake.tststree diff --git a/isis/src/base/apps/csv2table/tsts/NewTable/Makefile b/isis/src/base/apps/csv2table/tsts/NewTable/Makefile new file mode 100644 index 0000000000000000000000000000000000000000..183ba78dfbb2a7655a7922f6a76834cc9f207bbf --- /dev/null +++ b/isis/src/base/apps/csv2table/tsts/NewTable/Makefile @@ -0,0 +1,13 @@ +APPNAME = csv2table + +include $(ISISROOT)/make/isismake.tsts + +commands: + cp $(INPUT)/isisTruth.cub $(OUTPUT)/isisTruth.cub; + $(APPNAME) csv=$(INPUT)/test.csv \ + tablename="TestTable" \ + to=$(OUTPUT)/isisTruth.cub > /dev/null; + tabledump from=$(OUTPUT)/isisTruth.cub \ + to=$(OUTPUT)/output.csv \ + NAME="TestTable" > /dev/null; + rm $(OUTPUT)/isisTruth.cub; diff --git a/isis/src/base/apps/csv2table/tsts/OverwriteTable/Makefile b/isis/src/base/apps/csv2table/tsts/OverwriteTable/Makefile new file mode 100644 index 0000000000000000000000000000000000000000..183ba78dfbb2a7655a7922f6a76834cc9f207bbf --- /dev/null +++ b/isis/src/base/apps/csv2table/tsts/OverwriteTable/Makefile @@ -0,0 +1,13 @@ +APPNAME = csv2table + +include $(ISISROOT)/make/isismake.tsts + +commands: + cp $(INPUT)/isisTruth.cub $(OUTPUT)/isisTruth.cub; + $(APPNAME) csv=$(INPUT)/test.csv \ + tablename="TestTable" \ + to=$(OUTPUT)/isisTruth.cub > /dev/null; + tabledump from=$(OUTPUT)/isisTruth.cub \ + to=$(OUTPUT)/output.csv \ + NAME="TestTable" > /dev/null; + rm $(OUTPUT)/isisTruth.cub; diff --git a/isis/src/base/apps/csv2table/tsts/errors/Makefile b/isis/src/base/apps/csv2table/tsts/errors/Makefile new file mode 100644 index 0000000000000000000000000000000000000000..ab23c6904b4931eacf0058f1b90df3ad1f8ccbb6 --- /dev/null +++ b/isis/src/base/apps/csv2table/tsts/errors/Makefile @@ -0,0 +1,33 @@ +APPNAME = csv2table + +include $(ISISROOT)/make/isismake.tsts + +commands: + cp $(INPUT)/isisTruth.cub $(OUTPUT)/isisTruth.cub; + + if [ `$(APPNAME) csv=$(INPUT)/not_a_file.csv \ + tablename="TestTable" \ + to=$(OUTPUT)/isisTruth.cub 2> $(OUTPUT)/errors.txt` ]; \ + then \ + true; \ + fi; + + if [ `$(APPNAME) csv=$(INPUT)/empty.csv \ + tablename="TestTable" \ + to=$(OUTPUT)/isisTruth.cub 2>> $(OUTPUT)/errors.txt` ]; \ + then \ + true; \ + fi; + + if [ `$(APPNAME) csv=$(INPUT)/test.csv \ + label=$(INPUT)/not_a_file.pvl \ + tablename="TestTable" \ + to=$(OUTPUT)/isisTruth.cub 2>> $(OUTPUT)/errors.txt` ]; \ + then \ + true; \ + fi; + + cat $(OUTPUT)/errors.txt | sed 's+\[.*input/+[+' \ + > $(OUTPUT)/clean_errors.txt; + + rm $(OUTPUT)/isisTruth.cub $(OUTPUT)/errors.txt; diff --git a/isis/src/base/apps/ddd2isis/ddd2isis.cpp b/isis/src/base/apps/ddd2isis/ddd2isis.cpp index 2db7e354feeb2e57923dccac114418755af89893..efae0dc7aa3568117bdb73a438859d6330fb2681 100644 --- a/isis/src/base/apps/ddd2isis/ddd2isis.cpp +++ b/isis/src/base/apps/ddd2isis/ddd2isis.cpp @@ -4,26 +4,19 @@ #include "SpecialPixel.h" #include "FileName.h" #include "Pvl.h" +#include using namespace std; using namespace Isis; void IsisMain() { + UserInterface &ui = Application::GetUserInterface(); - ProcessImport p; IString from = ui.GetFileName("FROM"); - EndianSwapper swp("MSB"); - int nsamples = 0, nlines = 0, nbands = 1, noffset = 0, bittype = 0, nbytes = 0; - - union { - char readChars[4]; - long readLong; - float readFloat; - } readBytes; - ifstream fin; + fin.open(from.c_str(), ios::in | ios::binary); - if(!fin.is_open()) { + if( !fin.is_open() ) { string msg = "Cannot open input file [" + from + "]"; throw IException(IException::Io, msg, _FILEINFO_); } @@ -41,86 +34,146 @@ void IsisMain() { * */ - // Verify the magic number + // ifstream read() needs a char* to read values into, so the union + // is used to store read values + union { + char readChars[4]; + long readLong; + float readFloat; + } readBytes; + + // ddd files are LSB + EndianSwapper swp("MSB"); + + // Verify that the file is a ddd by reading in the first 4 bytes and + // comparing the magic numbers. The magic number for a ddd file is 1659. readBytes.readLong = 0; fin.seekg(0); fin.read(readBytes.readChars, 4); + if( fin.fail() || fin.eof() ) { + string msg = "Could not read the magic number in the input file [" + from + "]"; + throw IException(IException::Io, msg, _FILEINFO_); + } readBytes.readFloat = swp.Float(readBytes.readChars); - if(readBytes.readLong != 0x67B) { + if(readBytes.readLong != 1659) { string msg = "Input file [" + from + "] does not appear to be in ddd format"; throw IException(IException::Io, msg, _FILEINFO_); } + // Read bytes 4-7 to get number of lines fin.read(readBytes.readChars, 4); + if( fin.fail() || fin.eof() ) { + string msg = "Could not read the number of lines in the input file [" + from + "]"; + throw IException(IException::Io, msg, _FILEINFO_); + } readBytes.readFloat = swp.Float(readBytes.readChars); - nlines = (int)readBytes.readLong; + int nLines = (int) readBytes.readLong; + // Read bytes 8-11 to get number of bytes fin.read(readBytes.readChars, 4); + if( fin.fail() || fin.eof() ) { + string msg = "Could not read the number of bytes in the input file [" + from + "]"; + throw IException(IException::Io, msg, _FILEINFO_); + } readBytes.readFloat = swp.Float(readBytes.readChars); - nbytes = (int)readBytes.readLong; + int nBytes = (int) readBytes.readLong; + // Read bytes 12-15 to get the total number of bits out of all the bands fin.read(readBytes.readChars, 4); - readBytes.readFloat = swp.Float(readBytes.readChars); - - if(fin.fail() || fin.eof()) { - string msg = "An error ocurred when reading the input file [" + from + "]"; + if( fin.fail() || fin.eof() ) { + string msg = "Could not read the number of bits in the input file [" + from + "]"; throw IException(IException::Io, msg, _FILEINFO_); } - - bittype = readBytes.readLong; - - fin.read(readBytes.readChars, 4); readBytes.readFloat = swp.Float(readBytes.readChars); - + int totalBandBits = readBytes.readLong; + + // Maps the bit type of the file to the number of bytes of that type + // Taken directly from a given python program that reads in ddd data + QMap dataTypes; + dataTypes.insert(1450901768, 1); + dataTypes.insert(1450902032, 2); + dataTypes.insert(1450902288, 2); + dataTypes.insert(1450902560, 4); + dataTypes.insert(1450902816, 4); + dataTypes.insert(1450903072, 4); + dataTypes.insert(1450903360, 8); + dataTypes.insert(8, 1); + dataTypes.insert(16, 2); + dataTypes.insert(48, 2); + + // Read bytes 16-19 to get the bit type + // Map the bit type to the number of bytes of that data type fin.read(readBytes.readChars, 4); readBytes.readFloat = swp.Float(readBytes.readChars); - noffset = (int)readBytes.readLong; - if (noffset < 1024) { - noffset = 1024; + int bitType = (int) readBytes.readLong; + + int dataTypeBytes; + int nOffset; + // Check for new header format. Taken from the python program. + if ( (bitType & 0xfffff000) == 0x567b0000 ) { + dataTypeBytes = dataTypes.value(bitType); + + // Read bytes 20-23 to get offset + // New header format may have different offsets + fin.read(readBytes.readChars, 4); + readBytes.readFloat = swp.Float(readBytes.readChars); + nOffset = (int) readBytes.readLong; + if (nOffset < 1024) { + nOffset = 1024; + } + } + else { + // Old header format does not have a bit type + // Old header format's offset is always 1024. + dataTypeBytes = dataTypes.value(totalBandBits); + nOffset = 1024; } + fin.close(); + PvlGroup results("FileInfo"); - results += PvlKeyword("NumberOfLines", toString(nlines)); - results += PvlKeyword("NumberOfBytesPerLine", toString(nbytes)); - results += PvlKeyword("BitType", toString(bittype)); - nsamples = nbytes / (bittype / 8); - results += PvlKeyword("NumberOfSamples", toString(nsamples)); - nbands = nbytes / nsamples; - results += PvlKeyword("NumberOfBands", toString(nbands)); - results += PvlKeyword("LabelBytes", toString(noffset)); + results += PvlKeyword( "NumberOfLines", toString(nLines) ); + results += PvlKeyword( "NumberOfBytesPerLine", toString(nBytes) ); + results += PvlKeyword( "BitType", toString(bitType) ); + int nSamples = nBytes / (totalBandBits / 8); + results += PvlKeyword( "NumberOfSamples", toString(nSamples) ); + int nBands = (totalBandBits / 8) / dataTypeBytes; + results += PvlKeyword( "NumberOfBands", toString(nBands) ); + results += PvlKeyword( "LabelBytes", toString(nOffset) ); Application::Log(results); - fin.close(); - - if (ui.WasEntered("TO")) { - switch(bittype) { - case 8: - p.SetPixelType(Isis::UnsignedByte); - break; - case 16: - p.SetPixelType(Isis::UnsignedWord); - break; - case 32: - p.SetPixelType(Isis::Real); - break; - default: - IString msg = "Unsupported bit per pixel count [" + IString(bittype) + "]. "; - msg += "(Use the raw2isis and crop programs to import the file in case it is "; - msg += "line or sample interleaved.)"; - throw IException(IException::Io, msg, _FILEINFO_); - } + ProcessImport p; - p.SetDimensions(nsamples, nlines, nbands); - p.SetFileHeaderBytes(noffset); - p.SetByteOrder(Isis::Msb); - p.SetInputFile(ui.GetFileName("FROM")); - p.SetOutputCube("TO"); + int bitsPerBand = totalBandBits / nBands; + switch(bitsPerBand) { + case 8: + p.SetPixelType(Isis::UnsignedByte); + break; + case 16: + p.SetPixelType(Isis::UnsignedWord); + break; + case 32: + p.SetPixelType(Isis::Real); + break; + default: + IString msg = "Unsupported bit per pixel count [" + IString(bitsPerBand) + "] "; + msg += "from [" + from + "]"; + throw IException(IException::Io, msg, _FILEINFO_); + } - p.StartProcess(); - p.EndProcess(); + // ddd files with more than one band are pixel interleaved + // Having one band is similar to BIP, but this is here for clarification + if (nBands > 1) { + p.SetOrganization(ProcessImport::BIP); } - return; -} + p.SetDimensions(nSamples, nLines, nBands); + p.SetFileHeaderBytes(nOffset); + p.SetByteOrder(Isis::Msb); + p.SetInputFile( ui.GetFileName("FROM") ); + p.SetOutputCube("TO"); + p.StartProcess(); + p.EndProcess(); +} diff --git a/isis/src/base/apps/ddd2isis/ddd2isis.xml b/isis/src/base/apps/ddd2isis/ddd2isis.xml index e35ea4decf63a2909a8f699198bd113543c33d30..19548a0aff53048f4a06974e0accc43b0cb2c968 100644 --- a/isis/src/base/apps/ddd2isis/ddd2isis.xml +++ b/isis/src/base/apps/ddd2isis/ddd2isis.xml @@ -7,7 +7,8 @@ - This program will import a ddd image into an Isis cube. The ddd format files are created by Malin Space Science Systems. + This program will import a ddd image into an Isis cube. The ddd format files + are created by Malin Space Science Systems. @@ -30,6 +31,16 @@ will need to be read in using a combination of the raw2isis and crop programs. Fixes #1713. + + We were given a python program that reads in data from a ddd file + to use as an example. In the python program, the formula they used to + calculate the number of bands is different from the one we previously used. + The old formula did the number of total band bits / 8; the formula is now + (the number of total band bits / 8) / the number of bytes of the data type + of the file's bit type. Added the ability to process files with multiple + bands. Removed the internal default of the output parameter set to None so + that an output file is now requried. Fixes #703. + @@ -55,7 +66,6 @@ cube output - None Output Isis cube diff --git a/isis/src/base/apps/ddd2isis/tsts/default/Makefile b/isis/src/base/apps/ddd2isis/tsts/default/Makefile index a1ac8f27297b69f98b7d719b691b7fe4275918df..1272a0aca97f291f6610d723012c9419628a2a33 100644 --- a/isis/src/base/apps/ddd2isis/tsts/default/Makefile +++ b/isis/src/base/apps/ddd2isis/tsts/default/Makefile @@ -4,3 +4,5 @@ include $(ISISROOT)/make/isismake.tsts commands: $(APPNAME) FROM=$(INPUT)/vis1flat.ddd TO=$(OUTPUT)/vis1flat.cub > /dev/null; + $(APPNAME) FROM=$(INPUT)/0023MD0000140000101507C00_DXXX_16b.ddd \ + TO=$(OUTPUT)/0023MD0000140000101507C00_DXXX_16b.cub > /dev/null; diff --git a/isis/src/base/apps/ddd2isis/tsts/errors/Makefile b/isis/src/base/apps/ddd2isis/tsts/errors/Makefile new file mode 100644 index 0000000000000000000000000000000000000000..4aa6202f90433c5ba1d0021e8d55518ffd45e6ab --- /dev/null +++ b/isis/src/base/apps/ddd2isis/tsts/errors/Makefile @@ -0,0 +1,24 @@ +APPNAME = ddd2isis + +include $(ISISROOT)/make/isismake.tsts + +commands: + # TEST: Throws an error when trying to open the file + if [ `$(APPNAME) \ + FROM=$(INPUT)/vis1flat.ddd \ + TO=$(OUTPUT)/vis1flat.cub \ + 2> $(OUTPUT)/temp.txt > /dev/null` ]; \ + then true; \ + fi; + + # TEST: Throws an error when trying to read from a cub instead of ddd + if [ `$(APPNAME) \ + FROM=$(INPUT)/vis1flat.cub \ + TO=$(OUTPUT)/vis1flat.cub \ + 2>> $(OUTPUT)/temp.txt > /dev/null` ]; \ + then true; \ + fi; + + # Removes input file path up until input + $(SED) 's+\[.*/input+[input+' $(OUTPUT)/temp.txt > $(OUTPUT)/errorTruth.txt; + $(RM) $(OUTPUT)/temp.txt diff --git a/isis/src/base/apps/dsk2isis/dsk2isis.cpp b/isis/src/base/apps/dsk2isis/dsk2isis.cpp index 5ffd77828ce0652865dd2d5b806bec277fb9c162..e897fa848829ca05ddf2035024caba0e2711fda6 100755 --- a/isis/src/base/apps/dsk2isis/dsk2isis.cpp +++ b/isis/src/base/apps/dsk2isis/dsk2isis.cpp @@ -113,6 +113,7 @@ void IsisMain() { // computation. NaifVertex observer(3); point.ToNaifArray(&observer[0]); + NaifStatus::CheckErrors(); vscl_c(1.5, &observer[0], &observer[0]); NaifStatus::CheckErrors(); diff --git a/isis/src/base/apps/dsk2isis/dsk2isis.xml b/isis/src/base/apps/dsk2isis/dsk2isis.xml index 3378468635f2b3bca5bcfc85aaa26f7a94ed8bc3..003b304c6fcc6c8dcc88af620f922b7670027ff9 100755 --- a/isis/src/base/apps/dsk2isis/dsk2isis.xml +++ b/isis/src/base/apps/dsk2isis/dsk2isis.xml @@ -7,9 +7,9 @@ - This application will convert a NAIF DSK plate model to an ISIS cube. - Users must provide a valid map file to use for allocation of the ISIS - cube. The scale and type of projection determine the size of the output + This application will convert a NAIF DSK plate model to an ISIS cube. + Users must provide a valid map file to use for allocation of the ISIS + cube. The scale and type of projection determine the size of the output cube. @@ -24,10 +24,13 @@ Process data tiles instead of a pixel at a time; Test for valid output map coordinate at every map pixel. References #2035 + + Changed the category to Import and Export. Fixes #5188. + - Map Projection + Import and Export @@ -37,9 +40,9 @@ input Name of NAIF DSK DEM file - This parameter provides the name of the NAIF DSK file to convert to - ISIS format. It is assumed to be in body fixed coordinates from which - intersections for each output map grid point will be computed using + This parameter provides the name of the NAIF DSK file to convert to + ISIS format. It is assumed to be in body fixed coordinates from which + intersections for each output map grid point will be computed using NAIF's DSK toolkit. @@ -52,8 +55,8 @@ input Name of file containing map description - This paramter provides the name of a file containing a valid map - projection defintion. One can use the ISIS maptemplate application + This paramter provides the name of a file containing a valid map + projection defintion. One can use the ISIS maptemplate application to create a map template. @@ -69,8 +72,8 @@ Output cube - Name of the output ISIS file created by this application containing - the rendering of the DSK DEM into and ISIS compatible DEM for use in + Name of the output ISIS file created by this application containing + the rendering of the DSK DEM into and ISIS compatible DEM for use in the ISIS system. @@ -82,8 +85,8 @@

- This parameter provides two different methods to compute the - output radius value for a given latitude, longitude map grid + This parameter provides two different methods to compute the + output radius value for a given latitude, longitude map grid point.

@@ -91,27 +94,27 @@ diff --git a/isis/src/base/apps/equalizer/equalizer.cpp b/isis/src/base/apps/equalizer/equalizer.cpp index ab5e714d554a2497aaa93b270cd025f751a3742d..35ba79383aff6f5c2093589ee60d611b03da8c02 100644 --- a/isis/src/base/apps/equalizer/equalizer.cpp +++ b/isis/src/base/apps/equalizer/equalizer.cpp @@ -111,4 +111,4 @@ void IsisMain() { equalizer.applyCorrection(ui.WasEntered("TOLIST") ? ui.GetFileName("TOLIST") : ""); } -} \ No newline at end of file +} diff --git a/isis/src/base/apps/equalizer/tsts/gain/Makefile b/isis/src/base/apps/equalizer/tsts/gain/Makefile index 24de02e521d68a0d6ff059149173b9d7db2bfe8a..f55593948ffb1459a2484a1527343868e825ed59 100644 --- a/isis/src/base/apps/equalizer/tsts/gain/Makefile +++ b/isis/src/base/apps/equalizer/tsts/gain/Makefile @@ -1,3 +1,6 @@ +equalizerTruth4.cub.TOLERANCE = .00005 +equalizerTruth5.cub.TOLERANCE = .00007 + APPNAME = equalizer include $(ISISROOT)/make/isismake.tsts @@ -10,7 +13,7 @@ commands: > /dev/null; $(MV) I00824006RDR.lev2.equ.cub $(OUTPUT)/equalizerTruth1.cub; $(MV) I01523019RDR.lev2.equ.cub $(OUTPUT)/equalizerTruth2.cub; - $(MV) I02609002RDR.lev2.equ.cub $(OUTPUT)/equalizerTruth3.cub; + $(MV) I02609002RDR.lev2.equ.cub $(OUTPUT)/equalizerTruth3.cub; $(LS) $(INPUT)/EN*.cub > $(OUTPUT)/files.lis; $(LS) $(INPUT)/EN*top*.cub > $(OUTPUT)/hold.lis; $(ECHO) "$(OUTPUT)/equalizerTruth4.cub" > $(OUTPUT)/tolist.lis @@ -19,4 +22,3 @@ commands: $(APPNAME) fromlist=$(OUTPUT)/files.lis holdlist=$(OUTPUT)/hold.lis \ adjust=gain tolist=$(OUTPUT)/tolist.lis > /dev/null; $(RM) $(OUTPUT)/files.lis $(OUTPUT)/hold.lis $(OUTPUT)/tolist.lis; - diff --git a/isis/src/base/apps/equalizer/tsts/nonOverlapRetryBoth/Makefile b/isis/src/base/apps/equalizer/tsts/nonOverlapRetryBoth/Makefile index 4860d96539440fe2cf65e0a28c8fcb9b9b99666b..48ded0bc4ef09fb5ed766249ea4c30913ee2a108 100644 --- a/isis/src/base/apps/equalizer/tsts/nonOverlapRetryBoth/Makefile +++ b/isis/src/base/apps/equalizer/tsts/nonOverlapRetryBoth/Makefile @@ -1,12 +1,14 @@ # This tests calculating statistics for input with non-overlapping files, -# correcting the input list by REMOVING non-overlaps and recalculating to -# determine normalization gains and offsets for equalization, +# correcting the input list by REMOVING non-overlaps and recalculating to +# determine normalization gains and offsets for equalization, # and then applying corrections. # # NOTE: An exception occurs when there are non-overlaps during calculation, # it is handled and the output is sent to nonOverlapError.txt APPNAME = equalizer +I10047011EDR.proj.reduced.cub.TOLERANCE = .00001 + include $(ISISROOT)/make/isismake.tsts commands: diff --git a/isis/src/base/apps/fits2isis/tsts/default/Makefile b/isis/src/base/apps/fits2isis/tsts/default/Makefile index ff2bf1cd351ea223b647c5744531d0e48f9bdb3f..59bdaf73914c27244b6d53230288caff50c1d945 100644 --- a/isis/src/base/apps/fits2isis/tsts/default/Makefile +++ b/isis/src/base/apps/fits2isis/tsts/default/Makefile @@ -4,10 +4,6 @@ include $(ISISROOT)/make/isismake.tsts commands: $(APPNAME) from=$(INPUT)/WFPC2u5780205r_c0fx.fits \ - to=$(OUTPUT)/fitsTruth.cub \ - > /dev/null; - raw2isis from=$(INPUT)/WFPC2u5780205r_c0fx.fits \ - to=$(OUTPUT)/rawTruth.cub \ - SAMPLES=200 LINES=200 BANDS=4 SKIP=23040 \ - BITTYPE=REAL BYTEORDER=MSB \ - > /dev/null; + to=$(OUTPUT)/fitsTruth.cub > /dev/null; + catlab from=$(OUTPUT)/fitsTruth.cub \ + to=$(OUTPUT)/fitsTruth.pvl > /dev/null; diff --git a/isis/src/base/apps/fits2isis/tsts/organization/Makefile b/isis/src/base/apps/fits2isis/tsts/organization/Makefile index 5ca2717b9c3ea29e2479d669731442d382359c8d..bae7569d0c710c10cf5c726981862d5650776234 100644 --- a/isis/src/base/apps/fits2isis/tsts/organization/Makefile +++ b/isis/src/base/apps/fits2isis/tsts/organization/Makefile @@ -4,8 +4,10 @@ include $(ISISROOT)/make/isismake.tsts commands: $(APPNAME) from=$(INPUT)/lsb_0034933739_0x53c_sci_1.fit \ - to=$(OUTPUT)/bilTruth.cub organization=bil imagenumber=1\ - > /dev/null; + to=$(OUTPUT)/bilTruth.cub organization=bil imagenumber=1 > /dev/null; + catlab from=$(OUTPUT)/bilTruth.cub \ + to=$(OUTPUT)/bilTruth.pvl > /dev/null; $(APPNAME) from=$(INPUT)/lsb_0034933739_0x53c_sci_1.fit \ - to=$(OUTPUT)/bsqTruth.cub organization=bsq imagenumber=1 \ - > /dev/null; + to=$(OUTPUT)/bsqTruth.cub organization=bsq imagenumber=1 > /dev/null; + catlab from=$(OUTPUT)/bsqTruth.cub \ + to=$(OUTPUT)/bsqTruth.pvl > /dev/null; diff --git a/isis/src/base/apps/gauss/gauss.cpp b/isis/src/base/apps/gauss/gauss.cpp index d0e50b03768537ca8595c0d22c204bca5ed3042a..3886d90214c82694f3d8f3f79165b840936b9122 100644 --- a/isis/src/base/apps/gauss/gauss.cpp +++ b/isis/src/base/apps/gauss/gauss.cpp @@ -46,7 +46,6 @@ void setFilter(int size, double stdDev) { //Iterate through the input kernel's data values to fill the coefs array const double PI = 3.141592653589793; int i = 0; - cout << exp((double)1.0) << endl; for(double y = -(size / 2) ; y <= (size / 2) ; y++) { for(double x = -(size / 2) ; x <= (size / 2) ; x++) { /* diff --git a/isis/src/base/apps/gauss/gauss.xml b/isis/src/base/apps/gauss/gauss.xml index 1c99acba96d873cb28903a8600d27482fc3eeaa7..1ec80dffa45a56730f563e0625050f35e302360b 100644 --- a/isis/src/base/apps/gauss/gauss.xml +++ b/isis/src/base/apps/gauss/gauss.xml @@ -7,36 +7,36 @@ - This program calculates weight based on the bell-shaped Gaussian + This program calculates weight based on the bell-shaped Gaussian curve. The weight is then applied to an image kernel in such a way as to create a filter that will move a weighted average through the image. The - end result is a blurred image with reduced detail and noise. The Gaussian + end result is a blurred image with reduced detail and noise. The Gaussian function that determines the weight for all of the values in the kernel is as follows
                                                   /   x^2+y^2   \
                                                - |  -----------  |
                 G(x,y) =           1              \ 2(STDDEV)^2 /
-      			    --------------- e^ 
-			    2(pi)(STDDEV)^2 
+      			    --------------- e^
+			    2(pi)(STDDEV)^2
   
This formula creates a kernel that then runs through the image. The center of the kernel is at (0,0). This means that a 3x3 boxcar will be of the form
-        The kernel coordinates	          
+        The kernel coordinates
   (-2,-2) (-1,-2) (0,-2) (1,-2) (2,-2)
-  (-2,-1) (-1,-1) (0,-1) (1,-1)	(2,-1)	
-  (-2, 0) (-1, 0) (0, 0) (1, 0) (2, 0)       
+  (-2,-1) (-1,-1) (0,-1) (1,-1)	(2,-1)
+  (-2, 0) (-1, 0) (0, 0) (1, 0) (2, 0)
   (-2, 1) (-1, 1) (0, 1) (1, 1) (2, 1)
   (-2, 2) (-1, 2) (0, 2) (1, 2) (2, 2)
-  
+
           The kernel values (approx)
        1   4   7   4   1
        4   16  26  16  4
        7   26  41  26  7     x 1/273
        4   16  26  16  4
-       1   4   7   4   1 
-  
+ 1 4 7 4 1 +
@@ -48,15 +48,15 @@ Original version - + Added application test - + Added examples - + Fixed bug in boxcar size @@ -64,6 +64,9 @@ Documentation fixes + + Removed the cout that was outputting e to the terminal. Fixes #5198. + @@ -99,14 +102,14 @@ - + integer 3 - + Size of one side of the boxcar This is the user specified size of the boxcar that @@ -116,7 +119,7 @@ - + double @@ -126,12 +129,12 @@ 0 Standard Deviation - At the most basic level, standard deviation can be thought of in this - context as the intensity of the blur being applied to the image. The + At the most basic level, standard deviation can be thought of in this + context as the intensity of the blur being applied to the image. The higher this value, the more noise and detail will be removed. - At a deeper level, standard deviation is described as the average - distance from any single measurement of a set to the mean of that set. - + At a deeper level, standard deviation is described as the average + distance from any single measurement of a set to the mean of that set. + @@ -139,16 +142,16 @@ - Using a 3 x 3 boxcar + Using a 3 x 3 boxcar - This example shows the use of the default standard deviation (1.0) and the + This example shows the use of the default standard deviation (1.0) and the default boxcar size (3). Since the boxcar must be square in this program, this means that a 3 x 3 boxcar will be used. - from= peaks.cub + from= peaks.cub to=gauss3x3.cub size=3 STDDEV= 1.0 @@ -157,7 +160,7 @@ This example uses all of the default values specified by the program - + @@ -165,67 +168,67 @@ Example GUI - Screenshot of the GUI with parameters set to perform Gaussian + Screenshot of the GUI with parameters set to perform Gaussian smoothing with a 3 x 3 boxcar. - - + Input image before gauss. - This is the image as it was taken originally. + This is the image as it was taken originally. - FROM - + Output image after gauss - This is the image after the gauss filter. Edges of the image are + This is the image after the gauss filter. Edges of the image are now much softer. Detail and noise has been removed. - TO - + - Using a 5 x 5 boxcar + Using a 5 x 5 boxcar - This example shows the use of a larger standard deviation (2.0) and the + This example shows the use of a larger standard deviation (2.0) and the larger boxcar (5). As with the last example, the single value of 5 will be applied to both the line size and sample size of the boxcar. - from= peaks.cub + from= peaks.cub to=bigblur.cub size=5 STDDEV= 2.0 - This example will create a more dramatic blur, as everything is larger + This example will create a more dramatic blur, as everything is larger than in the first example - + @@ -233,40 +236,40 @@ Example GUI - Screenshot of the GUI with parameters set to perform Gaussian + Screenshot of the GUI with parameters set to perform Gaussian smoothing with a 5 x 5 boxcar and 2.0 as the standard deviation. - - + Input image before gauss. - This is the image as it was taken originally. + This is the image as it was taken originally. - FROM - + Output image after gauss - This is the image after the gauss filter. Edges of the image are + This is the image after the gauss filter. Edges of the image are now much softer. The blur is much more noticeable on account both of the larger boxcar and the larger standard deviation. - TO diff --git a/isis/src/base/apps/getsn/getsn.cpp b/isis/src/base/apps/getsn/getsn.cpp index 0af1554c38324d449edf5e13d87d608e93ba752d..3d1d30e1a33514f634cd620736b236921181ecd8 100644 --- a/isis/src/base/apps/getsn/getsn.cpp +++ b/isis/src/base/apps/getsn/getsn.cpp @@ -34,16 +34,12 @@ void IsisMain() { bool WriteObservation = ui.GetBoolean("OBSERVATION"); QString format = ui.GetString("FORMAT"); - bool pvl = true; + bool pvl; if (format == "PVL") { pvl = true; } - else if (format == "FLAT") { - pvl = false; - } else { - QString msg = "Invalid format QString [" + format + "]"; - throw IException(IException::User, msg, _FILEINFO_); + pvl = false; } // Extract label from cube file @@ -51,20 +47,20 @@ void IsisMain() { PvlGroup sn("Results"); - if(WriteFile) sn += PvlKeyword("Filename", from); - if(WriteSN) sn += PvlKeyword("SerialNumber", SerialNumber::Compose(*label, ui.GetBoolean("DEFAULT"))); - if(WriteObservation) sn += PvlKeyword("ObservationNumber", ObservationNumber::Compose(*label, ui.GetBoolean("DEFAULT"))); + if (WriteFile) sn += PvlKeyword("Filename", from); + if (WriteSN) sn += PvlKeyword( "SerialNumber", SerialNumber::Compose( *label, ui.GetBoolean("DEFAULT") ) ); + if (WriteObservation) sn += PvlKeyword( "ObservationNumber", ObservationNumber::Compose( *label, ui.GetBoolean("DEFAULT") ) ); - if(ui.WasEntered("TO")) { + if ( ui.WasEntered("TO") ) { // PVL option if (pvl) { // Create a serial number and observation number for this cube & put it in a pvlgroup for output Pvl pvl; pvl.addGroup(sn); - if(ui.GetBoolean("APPEND")) - pvl.append(ui.GetFileName("TO")); + if ( ui.GetBoolean("APPEND") ) + pvl.append( ui.GetFileName("TO") ); else - pvl.write(ui.GetFileName("TO")); + pvl.write( ui.GetFileName("TO") ); } // FLAT option else { @@ -83,7 +79,7 @@ void IsisMain() { } // Construct a label with the results - if(ui.IsInteractive()) { + if ( ui.IsInteractive() ) { Application::GuiLog(sn); } } diff --git a/isis/src/base/apps/getsn/getsn.xml b/isis/src/base/apps/getsn/getsn.xml index 30251bdab9287fb57e32d372dc9331da1496cbcf..d7375ad626d86613d23d5adb5420eac7d788a4f9 100644 --- a/isis/src/base/apps/getsn/getsn.xml +++ b/isis/src/base/apps/getsn/getsn.xml @@ -27,9 +27,9 @@ Augmented observation number and added TO file with APPEND option - - Added booleans for which keywords to get. If TO parameter is not entered - output will go to console. Added results group to SessionLog and GuiLog + + Added booleans for which keywords to get. If TO parameter is not entered + output will go to console. Added results group to SessionLog and GuiLog (if applicable) @@ -42,6 +42,11 @@ Added FORMAT option to choose between PVL and FLAT format. Effects output file only, default is still PVL. + + Removed unreachable else clause that assumed more than two options are + allowed to be entered in for the parameter FORMAT. Added test to default case + to increase code coverage. + @@ -70,7 +75,7 @@ No Output file will be created - The text file in which the Result Pvl created is either appended or + The text file in which the Result Pvl created is either appended or written to. @@ -82,8 +87,8 @@ TRUE Appends results on output file - Appends the created Results Pvl to the TO parameter output file. If - this is set to false, then it write the results to the output file + Appends the created Results Pvl to the TO parameter output file. If + this is set to false, then it write the results to the output file instead. @@ -95,9 +100,9 @@ FALSE Allows serial number to default to the file name - Within the Result Pvl, if the serial number is not know, then Unknown - is displayed in the keyword SerialNumber. If this parameter is set to - TRUE, then is displays the input cube's filename is displayed in the + Within the Result Pvl, if the serial number is not know, then Unknown + is displayed in the keyword SerialNumber. If this parameter is set to + TRUE, then is displays the input cube's filename is displayed in the keyword SerialNumber instead. @@ -111,7 +116,7 @@ Get the Filename - If this boolean is not checked then the filename will not be part of + If this boolean is not checked then the filename will not be part of the output. @@ -122,7 +127,7 @@ Get the Serial Number - If this boolean is not checked then the Serial Number will not be + If this boolean is not checked then the Serial Number will not be part of the output. @@ -133,7 +138,7 @@ Get the Observation Number - If this boolean is not checked then the Observation Number will not + If this boolean is not checked then the Observation Number will not be part of the output. @@ -145,7 +150,7 @@ PVL Output format - Output format options, either PVL or FLAT may be used to display the + Output format options, either PVL or FLAT may be used to display the selected outputs. @@ -165,7 +170,7 @@ - + diff --git a/isis/src/base/apps/getsn/tsts/default/Makefile b/isis/src/base/apps/getsn/tsts/default/Makefile index 2e1fec900297176c9654b7c3329c5aeaff40188d..531f669de44441dd197c3f5fc7e5b85e68881f57 100644 --- a/isis/src/base/apps/getsn/tsts/default/Makefile +++ b/isis/src/base/apps/getsn/tsts/default/Makefile @@ -4,8 +4,11 @@ include $(ISISROOT)/make/isismake.tsts commands: $(APPNAME) FROM=$(INPUT)/peaks.cub \ - TO=$(OUTPUT)/peaks.pvl FILE=TRUE OBSERVATION=TRUE \ - APPEND=false; + TO=$(OUTPUT)/peaks.pvl FILE=FALSE OBSERVATION=TRUE SN=FALSE \ + APPEND=false; + $(APPNAME) FROM=$(INPUT)/peaks.cub \ + TO=$(OUTPUT)/peaks.pvl FILE=TRUE OBSERVATION=FALSE SN=TRUE \ + APPEND=TRUE; $(APPNAME) FROM=$(INPUT)/hirise.cub \ - TO= $(OUTPUT)/hirise.pvl FILE=TRUE OBSERVATION=TRUE \ - APPEND=false; + TO= $(OUTPUT)/hirise.pvl FILE=TRUE OBSERVATION=TRUE \ + APPEND=false; diff --git a/isis/src/base/apps/handmos/handmos.cpp b/isis/src/base/apps/handmos/handmos.cpp index 83735718a74947e950bdb25d5725bb6187067721..0162f137b63537d7bd62b1a4fa98d48e900937b4 100644 --- a/isis/src/base/apps/handmos/handmos.cpp +++ b/isis/src/base/apps/handmos/handmos.cpp @@ -59,11 +59,7 @@ void IsisMain() { nl = ui.GetInteger("NLINES"); nb = ui.GetInteger("NBANDS"); - // Create the origin band if the Track Flag is set - if (bTrack) { - nb += 1; - } - else if (overlay == ProcessMosaic::AverageImageWithMosaic) { + if (overlay == ProcessMosaic::AverageImageWithMosaic) { nb *= 2; } p.SetCreateFlag(true); diff --git a/isis/src/base/apps/handmos/handmos.xml b/isis/src/base/apps/handmos/handmos.xml index 28665efabeac54d61fe0c2a2bd76bc85f5fff9f4..370e684746eef95b4dee566a634da5d575f9a4d7 100644 --- a/isis/src/base/apps/handmos/handmos.xml +++ b/isis/src/base/apps/handmos/handmos.xml @@ -24,7 +24,7 @@ falls outside of the dimensions of the mosaic, it will be clipped. The line, sample, band dimensions of the output mosaic are required to be specified at the time of creation. This - appication does not require a camera model, Instrument Group or + application does not require a camera model, Instrument Group or Mapping Group keywords as required by the other mosaic applications, mapmos and automos.

@@ -36,7 +36,7 @@

MATCHDEM = FALSE, the default does not check the SHAPEMODEL keyword of the input cube - files and does not propogate what DEM Shapemodel that was used when the input files were + files and does not propagate what DEM Shapemodel that was used when the input files were projected.

@@ -47,19 +47,43 @@ options is explained in the tables and descriptions below.

- The Track feature creates a band in the output mosaic file containing the index - values for every pixel in the output mosaic.The Track-band can only be used appropriately through - the QVIEW-AdvancedTracking tool. As the user interactively pans across the displayed - mosaic band (Band1), for every mosaic pixel location QVIEW-AdvancedTracking will report - the source cube filename that was input to automos. The Track-band cannot be used outside - the QVIEW-AdvancedTracking tool. Hence the file (byte) size of the mosaic is increased due to - the track-band. + The TRACK feature creates a separate tracking cube in addition to the mosaic cube, and + contains information for the source files of every pixel within the output mosaic. + This cube will have the same base-name as the mosaic cube, but will end in + "_tracking.cub". The tracking cube must always reside in the same directory as the + mosaic cube to be properly accessed; this means that if the mosaic cube is copied or + moved, then its associated tracking cube must be copied or moved to the same location. + The tracking cube will always be of type unsigned integer. Depending on the + bit-type of the mosaic cube and/or the number of bands it contains, the tracking cube + may be as much as four times the size of the mosaic cube itself.

- The Track feature works with Priority options ONTOP (with HIGHSATURATION and - LOWSATURATION parameters) and BENEATH for single band input cubes. It does NOT support - multiple band input cubes with these priority options. It does work for multiband cubes - when PRIORITY=BAND. Furthermore, this feature is NOT supported when PRIORITY=AVERAGE. + The tracking cube can be used appropriately through the QVIEW-AdvancedTracking + tool. As the user pans across the displayed mosaic, for every mosaic pixel location, + QVIEW-AdvancedTracking will interactively report the index, the filename and the + serial number of the input cube that was input to handmos for that specific pixel + location. Since the tracking cube is of bit-type unsigned integer, the DN values of + 0, 1 and 2 are reserved for NULL, LRS and LIS, respectively, so valid pixel DN values + will begin at an offset of 3. In other words, a pixel of DN value 3 in the tracking + cube means that this same pixel within the mosaic was taken from the first input + image. The tracking cube cannot be used outside of the QVIEW-AdvancedTracking tool + except as a visual representation of the source cubes for the different pixels. +

+

+ The TRACK feature works with Priority options ONTOP and BENEATH for single band input + cubes. It works for multiband cubes for PRIORITY=ONTOP only when the NULL, + HIGHSATURATION and LOWSATURATION options are set to true. It also works for multiband + cubes when PRIORITY=BAND. Furthermore, this feature is NOT supported when + PRIORITY=AVERAGE. +

+

+ Please Note: Prior to ISIS version 3.6.0, tracking for the various mosaicking apllications + was being handled with an internal tracking band. Tracking is now being handled by an + external tracking cube that contains the associated tracking information. This application + can no longer add to mosaics of the old format. In order to continue to use these + older mosaics with the updated mosaicking applications, you must first use the + trackextract utility application to extract the tracking band and the associated + tracking information into an external tracking cube.

@@ -76,8 +100,17 @@ current input image will appear in the output mosaic (it replaces the output mosaic pixel). Invalid input Special Pixels (NULL,HRS,HIS,LRS,LIS) will NOT - replace an existing Valid output mosaic pixel. Refer to parameters HIGHSATURATION, - LOWSATURATION, and NULL to override replacement of Valid output mosaic pixels. + replace an existing Valid output mosaic pixel unless the optional flags are set. Refer + to parameters HIGHSATURATION,LOWSATURATION, and NULL to override replacement of Valid + output mosaic pixels. +

+ NOTE: When using this priority with multi-band mosaics and with the TRACK + option set, all Special Pixel flags must be set as well. This is because the same + pixel within different bands of a single input image may hold both Valid and Special + Pixel values, and since our Tracking capabilities can only track one input image per + pixel (as it is a single band), it must accept the values for that particular pixel + from every band in the input image being placed on top. +

@@ -106,7 +139,7 @@ Overlapping Valid pixel values from the current input image and output mosaic will be averaged for the new mosaic pixel values. A count-band is created with the output mosaic file. The count-band keeps track of the number of images involved in the - averaging of the input dn values for each pixel in the mosaic. Invalid input pixel + averaging of the input DN values for each pixel in the mosaic. Invalid input pixel values will not be included in the average. In the case where only one Valid pixel exists between the input image pixels or the current mosaic pixel, the Valid pixel is retained in the current output mosaic. Refer to parameters HIGHSATURATION, @@ -436,6 +469,11 @@ group in the cube labels which could impact processing scripts/pipelines. Fixes #1620. References #1623.
+ + Updated code and documentation to reflect new handling of tracking capabilities with an + external tracking cube as well as clarify why special pixel flags are required when + priority=ontop for multiband mosaics. References #2092 + @@ -536,7 +574,7 @@ If the input and mosaic pixel of the priority band, specified by NUMBER or KEYNAME - and KEYVALUE, are valid, a less than or greater than comparison is done. Depending on + and KEYVALUE are valid, a less than or greater than comparison is done. Depending on the CRITERIA selected, the lower or higher of the two pixels is placed on top. Special and NULL pixels are not placed on top unless their flags are set. So, if the comparison of the priority band says that the input pixel should be on top but the @@ -588,7 +626,7 @@