Skip to content

Commit

Permalink
Enabling builds with mm 4.x (#256)
Browse files Browse the repository at this point in the history
* mm: removed the obsolete {Make.mm} makefiles; primed the locations of the pyre support files; removed the obsolete {packages/isce} folder; removed {Peg.cpp} that had no body

* mm: removed the section that builds the handmade bindings

* lib/isce: removed {Peg.cpp} from the {cmake} list; {Peg} is fully defined in its header file and had an empty impelementation file that generates noisy warnings on {macos}

* isce::core: removed the duplicate declaration of the {Attitude} destructor

* isce::unwrap: protected the {omp.h} includes with {g++} detection logic; while i'm not sure the fix here takes care of all compilers, {g++} and {clang++} should both compile correctly now

* isce/extensions: adjusted the include paths of our two auxiliary headers so that they are relative to the location of the cython generated main extension file

* cmake: added logic to include MPI support when the HDF5 library requires it

* isce::core: added {Attitude} to the {cmake} list; {Attitude} is an abstract base class with a virtual destructor, and such things are best when not inline

* cmake: added the root of the isce extension to the include path so {except/CyError.h} and {io/H5Error.h} are resolvable relative to the location of the {cython} generated C++ file
  • Loading branch information
aivazis authored and GitHub Enterprise committed Oct 2, 2019
1 parent 7e75517 commit 96ee4a2
Show file tree
Hide file tree
Showing 84 changed files with 471 additions and 3,478 deletions.
8 changes: 7 additions & 1 deletion .cmake/ConfigISCE.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,13 @@ function(CheckHDF5)
message(FATAL_ERROR "Did not find HDF5 version >= 1.10.2")
endif()

# check whether the hdf5 library includes parallel support
if ((HDF5_IS_PARALLEL))
# look for MPI
FIND_PACKAGE(MPI REQUIRED COMPONENTS CXX)
list(APPEND HDF5_INCLUDE_DIRS ${MPI_CXX_INCLUDE_DIRS})
list(APPEND HDF5_CXX_LIBRARIES ${MPI_CXX_LIBRARIES})
endif()
# Use more standard names to propagate variables
set(HDF5_INCLUDE_DIR ${HDF5_INCLUDE_DIRS} CACHE PATH "HDF5 include directory")
set(HDF5_LIBRARY "${HDF5_CXX_LIBRARIES}" CACHE STRING "HDF5 libraries")
Expand Down Expand Up @@ -162,4 +169,3 @@ function(InitInstallDirLayout)
set (ISCE_DOCDIR "doc" CACHE STRING "isce/doc")
endif(NOT ISCE_DOCDIR)
endfunction()

11 changes: 0 additions & 11 deletions .mm/cereal.def

This file was deleted.

43 changes: 0 additions & 43 deletions .mm/isce.def

This file was deleted.

45 changes: 45 additions & 0 deletions .mm/isce.mm
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# -*- Makefile -*-

# project meta-data
isce.major := 3
isce.minor := 0

# isce consists of python packages
isce.packages := isce.pkg
# libraries
isce.libraries := isce.lib cereal.lib
# python extensions
isce.extensions := isce.cython
# and test suites
isce.tests :=

# the isce python package
isce.pkg.stem := isce3
isce.pkg.root := packages/isce3/
isce.pkg.ext := extensions/
isce.pkg.drivers := isce3

# the isce lib meta-data
isce.lib.root := lib/isce/
isce.lib.stem := isce
isce.lib.libstem := isce-$(isce.major).$(isce.minor)
isce.lib.extern := gdal hdf5 mpi fftw pyre
isce.lib.prerequisites := cereal.lib
isce.lib.c++.flags += $($(compiler.c++).std.c++17)

# the isce extension that's built with cython
isce.cython.pkg := isce.pkg
isce.cython.wraps := isce.lib
isce.cython.root := extensions/cython/isce/
isce.cython.stem := isceextension
isce.cython.capsule :=
isce.cython.extern := isce.lib gdal hdf5 mpi numpy pyre python

# the cereal lib meta-data
cereal.lib.root := contrib/cereal/include/cereal/
cereal.lib.stem := cereal

# external package configuration
fftw.flavor := 3 3_threads 3f 3f_threads

# end of file
20 changes: 0 additions & 20 deletions .mm/project.py

This file was deleted.

47 changes: 0 additions & 47 deletions Make.mm

This file was deleted.

53 changes: 53 additions & 0 deletions bin/isce3
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
#!/usr/bin/env python3
#-*- coding: utf-8 -*-

# version check
# python version information is in {sys.version}
import sys
# unwrap
major, minor, _, _, _ = sys.version_info
# check
if major < 3 or (major == 3 and minor < 6):
# complain
raise RuntimeError("isce3 needs python 3.6 or newer")


# check
try:
# whether pyre is available
import pyre
# if this fails
except ImportError:
# we will grab a minimal version from the web
import urllib.request
# the pyre bootstrap
boot = 'pyre-boot.zip'
# lives at
url = f"http://pyre.orthologue.com/{boot}"
# let the user know
print(f"couldn't find pyre; downloading from '{url}'")
# ask the server
with urllib.request.urlopen(url=url) as istream:
# open the local file
with open(boot, mode='wb') as ostream:
# pull and write
ostream.write(istream.read())
# try importing pyre again; if anything bas happens, let it through
import pyre


# get my package; should we attempt to bootstrap a minimal version as well?
import isce3


# boot
if __name__ == "__main__":
# build an instance of the plexus
app = isce3.shells.plexus(name="isce3.plexus")
# invoke it
status = app.run()
# and pass the status on to the shell
raise SystemExit(status)


# end of file
45 changes: 0 additions & 45 deletions contrib/Make.mm

This file was deleted.

39 changes: 0 additions & 39 deletions contrib/cereal/Make.mm

This file was deleted.

39 changes: 0 additions & 39 deletions contrib/cereal/include/Make.mm

This file was deleted.

Loading

0 comments on commit 96ee4a2

Please sign in to comment.