Commit a3af91fc authored by Kelvin Rodriguez's avatar Kelvin Rodriguez Committed by jlaura
Browse files

Updating CMAKE compatibility (#298)

* remove gcc from env.yml

* update env file to point prefer krodriguez channel over astro

* Fixed sip issues with bundleadjust.sip being out of sync with source

* removed fortran in find script

* removed build numbers, need to sync MacOS and Linux build numbers

* added to python install rpaths

* readded opengl

* opengl is annoying

* linux is being difficult
parent 79b3762b
Loading
Loading
Loading
Loading
+4 −8
Original line number Diff line number Diff line
name: isis
channels:
  - krodriguez
  - usgs-astrogeology
@@ -7,7 +6,10 @@ channels:
  - anaconda
  - defaults
dependencies:
  - libgfortran==3.0
  - pcl==1.8.1
  - geos==3.5.1
  - protobuf==3.5.2
  - libprotobuf==3.5.2
  - qwt=6.1.3
  - pyqt==5.6.0
  - sip==4.18
@@ -20,8 +22,6 @@ dependencies:
  - xerces-c==3.1.4=0
  - zlib==1.2.11=0
  - blas==1.1=openblas
  - boost==1.65.1
  - boost-cpp==1.65.1
  - bzip2==1.0.6=1
  - cmake==3.9.1=0
  - cspice==66-0
@@ -29,7 +29,6 @@ dependencies:
  - doxygen==1.8.14=0
  - eigen==3.3.3=0
  - embree==2.14.0=0
  - geos==3.5.1=1
  - geotiff==1.4.2=1
  - gmp==6.1.2=0
  - gsl==2.2.1=blas_openblas_3
@@ -57,10 +56,7 @@ dependencies:
  - xorg-kbproto==1.0.7=1
  - xorg-libx11==1.6.4=6
  - bz2file==0.98
  - protobuf==3.5.1
  - libprotobuf==3.2.0=0
  - bullet==2.86.1=0
  - pcl==1.8.1
  - qhull==7.2.0=0
  - qt=5.6.2
  - qwt
+15 −14
Original line number Diff line number Diff line
@@ -153,10 +153,10 @@ endif()
# 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
                       -std=c++11
                       -fPIC
                       -std=c++11
                       -DISIS_LITTLE_ENDIAN=1
                       -fPIC -Wno-unused-parameter
                       -Wno-unused-parameter
                       -Wno-overloaded-virtual
                       -DGMM_USES_SUPERLU
                       -DENABLEJP2K=${JP2KFLAG}
@@ -238,11 +238,6 @@ find_package(PNG REQUIRED)
find_package(Kakadu)
find_package(Geos    3.5.0   REQUIRED)

# Im this case, we specify the version numbers being searched for in the non-traditional installs.
if(APPLE)
  find_package(OpenGL            REQUIRED)
endif(APPLE)

if(pybindings)
 find_package(Python REQUIRED)
 find_package(Sip    REQUIRED)
@@ -296,7 +291,7 @@ if(pybindings)
  if (NOT DEFINED PYINSTALL_DIR)
    set(PYINSTALL_DIR ${PYTHON_SITE_PACKAGES_DIR})
  endif()
  message("PYTHON BINDINGS INSTALL DIR: ${PYINSTALL_DIR}")
  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")
@@ -317,15 +312,21 @@ if(pybindings)
 # 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("Generating C++ code from sip files")

 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
@@ -337,7 +338,7 @@ if(pybindings)
 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)
 set_target_properties(isispy PROPERTIES LINK_DEPENDS isis3 INSTALL_RPATH ${CMAKE_INSTALL_PREFIX})
 add_dependencies(isispy sipfiles)

 install(TARGETS isispy DESTINATION ${PYINSTALL_DIR})
+2 −3
Original line number Diff line number Diff line
@@ -27,10 +27,9 @@ 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: " ${BULLET_DYNAMICS_LIBRARY} )
message(STATUS "BULLET COLLISION: " ${BULLET_COLLISION_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 COMMON: " ${BULLET3_COMMON_LIBRARY} )
message(STATUS "BULLET3 LINEARMATH: "  ${BULLET3_LINEARMATH_LIBRARY} )
+1 −11
Original line number Diff line number Diff line
@@ -16,6 +16,7 @@ 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)
@@ -23,16 +24,6 @@ if(NOT APPLE)
endif()

# Dependencies for lapack

# add gcc location for MacOS
# if(APPLE)
  find_library(FORTRAN_LIBRARY      NAMES gfortran
    NAMES gfortran
  )

  find_library(BLAS_LIBRARY NAMES blas)
# endif(APPLE)

get_filename_component(CHOLMOD_ROOT_INCLUDE_DIR "${CHOLMOD_INCLUDE_DIR}" DIRECTORY)

message(STATUS "CHOLMOD INCLUDE: "  ${CHOLMOD_INCLUDE_DIR} )
@@ -41,7 +32,6 @@ 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 "FORTRAN LIB: "  ${FORTRAN_LIBRARY} )
message(STATUS "BLAS LIB: "  ${BLAS_LIBRARY} )

if(NOT APPLE)
+12 −1
Original line number Diff line number Diff line
@@ -10,6 +10,8 @@ namespace Isis {
    %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<Isis::BundleSettings>, QString, QString, bool)];
    %MethodCode
      int sipErr = 0;
@@ -26,6 +28,15 @@ namespace Isis {
      }
    %End

    Isis::BundleSolutionInfo solveCholeskyBR() throw(Isis::IException) ;
    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
   };
};
Loading