From 337dc9c1580af3ccb97fcb4d4b6b6c87fdd55ab4 Mon Sep 17 00:00:00 2001 From: Ryan Burns <47790121+rtburns-jpl@users.noreply.github.com> Date: Mon, 14 Sep 2020 10:57:10 -0700 Subject: [PATCH] Fix python extension linking (#168) * Silence annoying FindFFTW warnings * Fix linker errors at import-time Python extensions are weakly linked, so linker errors can only be caught at runtime. This commit fixes any such broken extensions, and adds automated import testing to ctests to prevent future regressions. It also adds a helper function `isce2_add_staticlib` which creates a position-independent static library suitable for usage in multiple python extensions. This matches the SCons build scripts more closely and allows for future extensions to be declared in a more terse and hygienic fashion. * Update utilLib scripts * Update combinedLib scripts * Update offoutliers lib scripts * Add asa_im_decode cdll * Update alos lib scripts * Show ctest output upon failure * Update DataAccessor scripts * Remove TARGET_FILE_BASE_NAME * Remove incomplete stdproc modules (require stanford code) Co-authored-by: Ryan Burns --- .circleci/config.yml | 2 +- .cmake/FindFFTW.cmake | 2 - .cmake/isce2_helpers.cmake | 34 ++++++++ CMakeLists.txt | 14 ++- README.md | 2 +- .../isceobj/LineAccessor/CMakeLists.txt | 7 +- components/isceobj/Orbit/CMakeLists.txt | 2 +- components/isceobj/Sensor/CMakeLists.txt | 8 +- components/isceobj/Util/CMakeLists.txt | 85 ++----------------- .../isceobj/Util/offoutliers/CMakeLists.txt | 3 + .../Util/offoutliers/src/CMakeLists.txt | 7 ++ components/isceobj/Util/src/CMakeLists.txt | 62 ++++++++++++++ components/iscesys/ImageApi/CMakeLists.txt | 22 ++--- .../ImageApi/DataAccessor/CMakeLists.txt | 0 components/iscesys/StdOE/CMakeLists.txt | 14 +++ components/iscesys/StdOEL/CMakeLists.txt | 22 ++--- components/iscesys/StdOEL/src/CMakeLists.txt | 7 ++ components/mroipac/aikima/CMakeLists.txt | 2 +- components/mroipac/ampcor/CMakeLists.txt | 4 +- components/mroipac/correlation/CMakeLists.txt | 2 +- components/mroipac/dopiq/CMakeLists.txt | 2 +- components/mroipac/doppler/CMakeLists.txt | 2 +- components/mroipac/filter/CMakeLists.txt | 2 +- components/mroipac/fitoff/CMakeLists.txt | 4 +- components/mroipac/formimage/CMakeLists.txt | 4 +- components/mroipac/geolocate/CMakeLists.txt | 2 +- components/mroipac/getPegInfo/CMakeLists.txt | 5 ++ components/mroipac/grass/CMakeLists.txt | 2 +- components/mroipac/icu/CMakeLists.txt | 4 +- components/mroipac/looks/CMakeLists.txt | 2 +- .../alosreformat/ALOS_fbd2fbs/CMakeLists.txt | 4 +- .../alosreformat/ALOS_fbs2fbd/CMakeLists.txt | 4 +- .../stdproc/alosreformat/CMakeLists.txt | 6 +- .../stdproc/rectify/geocode/CMakeLists.txt | 8 +- components/stdproc/stdproc/CMakeLists.txt | 26 +----- .../stdproc/stdproc/correct/CMakeLists.txt | 13 --- .../stdproc/correct/src/CMakeLists.txt | 0 .../stdproc/stdproc/crossmul/CMakeLists.txt | 4 + .../stdproc/stdproc/estamb/CMakeLists.txt | 10 --- .../stdproc/stdproc/formslc/CMakeLists.txt | 18 ---- .../stdproc/stdproc/formslcLib/CMakeLists.txt | 18 ++++ .../stdproc/stdproc/mocompTSX/CMakeLists.txt | 20 ----- .../stdproc/stdproc/offsetpoly/CMakeLists.txt | 17 ++-- .../stdproc/stdproc/resamp/CMakeLists.txt | 5 +- .../stdproc/stdproc/resampLib/CMakeLists.txt | 1 + .../stdproc/resampLib/src/CMakeLists.txt | 8 ++ .../stdproc/resamp_amps/CMakeLists.txt | 4 + .../stdproc/resamp_image/CMakeLists.txt | 7 +- .../stdproc/resamp_only/CMakeLists.txt | 5 ++ .../stdproc/stdproc/resamp_slc/CMakeLists.txt | 5 +- .../stdproc/stdproc/topo/CMakeLists.txt | 20 ----- components/zerodop/GPUampcor/CMakeLists.txt | 2 +- components/zerodop/GPUgeo2rdr/CMakeLists.txt | 2 +- components/zerodop/geo2rdr/CMakeLists.txt | 6 +- components/zerodop/geozero/CMakeLists.txt | 6 +- components/zerodop/topozero/CMakeLists.txt | 6 +- contrib/Snaphu/CMakeLists.txt | 2 +- contrib/alos2proc/CMakeLists.txt | 2 +- contrib/demUtils/CMakeLists.txt | 12 +-- contrib/geo_autoRIFT/geogrid/CMakeLists.txt | 2 +- contrib/splitSpectrum/CMakeLists.txt | 8 +- 61 files changed, 291 insertions(+), 290 deletions(-) create mode 100644 components/isceobj/Util/offoutliers/CMakeLists.txt create mode 100644 components/isceobj/Util/offoutliers/src/CMakeLists.txt create mode 100644 components/isceobj/Util/src/CMakeLists.txt create mode 100644 components/iscesys/ImageApi/DataAccessor/CMakeLists.txt create mode 100644 components/iscesys/StdOEL/src/CMakeLists.txt create mode 100644 components/stdproc/stdproc/correct/src/CMakeLists.txt create mode 100644 components/stdproc/stdproc/formslcLib/CMakeLists.txt create mode 100644 components/stdproc/stdproc/resampLib/CMakeLists.txt create mode 100644 components/stdproc/stdproc/resampLib/src/CMakeLists.txt diff --git a/.circleci/config.yml b/.circleci/config.yml index 6406804..183cbec 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -47,7 +47,7 @@ jobs: set -ex cd /root/project/src/build . /opt/conda/bin/activate root - ctest + ctest --output-on-failure ISCE2DIR=$(python3 -c "import os, isce2; print(os.path.dirname(isce2.__file__))" | tail -n 1) export PATH=$ISCE2DIR/applications:$PATH topsApp.py --help --steps diff --git a/.cmake/FindFFTW.cmake b/.cmake/FindFFTW.cmake index d516136..d34650a 100644 --- a/.cmake/FindFFTW.cmake +++ b/.cmake/FindFFTW.cmake @@ -131,8 +131,6 @@ foreach(dtype Float Double LongDouble) # Tell find_package whether this component was found set(FFTW_${component}_FIND_QUIETLY TRUE) - find_package_handle_standard_args(FFTW_${component} - HANDLE_COMPONENTS REQUIRED_VARS ${libvar} FFTW_INCLUDE_DIRS) # Also set the value of the legacy library-variable # (Will be set to *-NOTFOUND if not found) set(${libvar} ${FFTW_${component}}) diff --git a/.cmake/isce2_helpers.cmake b/.cmake/isce2_helpers.cmake index 8e67efa..69c7cca 100644 --- a/.cmake/isce2_helpers.cmake +++ b/.cmake/isce2_helpers.cmake @@ -10,6 +10,40 @@ macro(isce2_get_dir_prefix) string(REPLACE "/" "." dir_prefix ${dir_prefix}) endmacro() +# Usage: isce2_add_staticlib(name [sources ...]) +# Creates a SCons-like isce2 intermediate library. +# The actual target will also be available via the namespaced isce2:: alias. +macro(isce2_add_staticlib name) + add_library(${name} STATIC ${ARGN}) + set_target_properties(${name} PROPERTIES + OUTPUT_NAME ${name} + POSITION_INDEPENDENT_CODE ON + ) + # add alias matching exported target + add_library(isce2::${name} ALIAS ${name}) +endmacro() + +# Usage: isce2_add_cdll(libname [sources ...]) +# These libraries are loaded using a hardcoded filename, so this +# macro simplifies adding target properties to make that possible. +macro(isce2_add_cdll target) + add_library(${target} SHARED ${ARGN}) + set_target_properties(${target} PROPERTIES + PREFIX "" + OUTPUT_NAME ${target} + SUFFIX .so) + + # If we're the root cmake project (e.g. not add_subdirectory): + if("${CMAKE_SOURCE_DIR}" STREQUAL "${PROJECT_SOURCE_DIR}") + # override this to also test the resulting extension + add_test(NAME load_cdll_${target} + COMMAND ${Python_EXECUTABLE} -c + "from ctypes import cdll; \ + cdll.LoadLibrary('$')" + ) + endif() +endmacro() + # Usage: # add_exe_test(main.cpp helpers.F [additional_source.c ...] ) # or diff --git a/CMakeLists.txt b/CMakeLists.txt index 7529e8a..cb19355 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.12 FATAL_ERROR) +cmake_minimum_required(VERSION 3.13...3.18) project(isce2 LANGUAGES C CXX Fortran) @@ -26,6 +26,18 @@ include(TargetMotif) include(TargetX11) include(UseCython) +# If we're the root cmake project (e.g. not add_subdirectory): +if("${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_CURRENT_LIST_DIR}") + # override this to also test the resulting extension + function(Python_add_library target) + _Python_add_library(${target} ${ARGN}) + add_test(NAME import_${target} + COMMAND ${Python_EXECUTABLE} -c + "import ${target}" + ) + endfunction() +endif() + if(NOT DEFINED PYTHON_MODULE_DIR) set(PYTHON_MODULE_DIR packages CACHE PATH "Python module directory (relative to install prefix)") diff --git a/README.md b/README.md index e72ab49..4ae7ab7 100644 --- a/README.md +++ b/README.md @@ -296,7 +296,7 @@ and then try "scons install" again. ### CMake (experimental) Make sure you have the following prerequisites: -* CMake ≥ 3.12 +* CMake ≥ 3.13 * GCC ≥ 4.8 (with C++11 support) * Python ≥ 3.5 * Cython diff --git a/components/isceobj/LineAccessor/CMakeLists.txt b/components/isceobj/LineAccessor/CMakeLists.txt index 4358334..2f64ef1 100644 --- a/components/isceobj/LineAccessor/CMakeLists.txt +++ b/components/isceobj/LineAccessor/CMakeLists.txt @@ -1,15 +1,14 @@ -add_library(LineAccessor_static STATIC +isce2_add_staticlib(LineAccessorLib src/ImageAccessor.cpp src/LineAccessor.cpp src/LineAccessorF.cpp ) -target_include_directories(LineAccessor_static PUBLIC include) -set_property(TARGET LineAccessor_static PROPERTY POSITION_INDEPENDENT_CODE ON) +target_include_directories(LineAccessorLib PUBLIC include) Python_add_library(LineAccessor MODULE bindings/LineAccessormodule.cpp ) -target_link_libraries(LineAccessor PUBLIC LineAccessor_static) +target_link_libraries(LineAccessor PRIVATE isce2::LineAccessorLib) InstallSameDir( LineAccessor diff --git a/components/isceobj/Orbit/CMakeLists.txt b/components/isceobj/Orbit/CMakeLists.txt index 7050e0a..a16b8b1 100644 --- a/components/isceobj/Orbit/CMakeLists.txt +++ b/components/isceobj/Orbit/CMakeLists.txt @@ -1,4 +1,4 @@ -Python_add_library(orbitHermite MODULE +isce2_add_cdll(orbitHermite src/orbitHermiteC.c src/orbithermite.F ) diff --git a/components/isceobj/Sensor/CMakeLists.txt b/components/isceobj/Sensor/CMakeLists.txt index 452afaf..896cf99 100644 --- a/components/isceobj/Sensor/CMakeLists.txt +++ b/components/isceobj/Sensor/CMakeLists.txt @@ -2,11 +2,7 @@ add_subdirectory(db) add_subdirectory(TOPS) add_subdirectory(MultiMode) -add_library(asa_im_decode src/asa_im_decode/asa_im_decode.c) -set_target_properties(asa_im_decode PROPERTIES - PREFIX "" - OUTPUT_NAME envisat - SUFFIX .so) +isce2_add_cdll(asa_im_decode src/asa_im_decode/asa_im_decode.c) set(installfiles asa_im_decode @@ -94,6 +90,6 @@ target_include_directories(alos PUBLIC include src/ALOS_pre_process ) -target_link_libraries(alos PUBLIC DataAccessor_static) +target_link_libraries(alos PUBLIC isce2::DataAccessorLib) InstallSameDir(${installfiles}) diff --git a/components/isceobj/Util/CMakeLists.txt b/components/isceobj/Util/CMakeLists.txt index 1975968..a8005b8 100644 --- a/components/isceobj/Util/CMakeLists.txt +++ b/components/isceobj/Util/CMakeLists.txt @@ -1,83 +1,14 @@ add_subdirectory(ImageUtil) add_subdirectory(geo) +add_subdirectory(offoutliers) Python_add_library(offoutliers MODULE offoutliers/bindings/offoutliersmodule.cpp - offoutliers/src/offoutliers.F - offoutliers/src/offoutliersAllocateDeallocate.F - offoutliers/src/offoutliersGetState.F - offoutliers/src/offoutliersSetState.F - offoutliers/src/offoutliersState.F - ) -target_include_directories(offoutliers PUBLIC offoutliers/include) -target_link_libraries(offoutliers PUBLIC - stdoel_static ) +target_link_libraries(offoutliers PRIVATE isce2::offoutliersLib) add_definitions(-DHAVE_CONFIG_H -DHAVE_FFTW=1) - -add_library(utilLib SHARED - src/akima_reg.F - src/args_roi.F - src/besseldiffs.F - src/bilinear.F - src/cfft1d_jpl.F - src/cfft2d.F - src/cffts.F - src/config.h - src/convert_schdot_to_xyzdot.F - src/convert_sch_to_xyz.F - src/cross.F - src/curvature.F - src/derampc.F - src/dop.F - src/dot.F - src/enubasis.F - src/fc.F - src/fc.f.org - src/fftw3stub.c - src/fftw3stub.cc - src/fortranUtils.f90 - src/fourn.F - src/fournnr.F - src/getangs.F - src/gettcn_tcvec.F - src/hunt.F - src/inter_motion.F - src/interp.F - src/intp_coef.f90 - src/intpcoefnorm.F - src/io.c - src/latlon.F - src/latlon_nostruct.F - #src/lfit.F - src/linalg.f90 - src/lincomb.F - src/lookvec.F - src/lsq.f90 - src/matmat.F - src/matvec.F - src/norm.F - src/orrmread1.F - src/polint.F - src/PowerOfTwo.cc - src/quadfit.f90 - src/radar_to_xyz.F - src/rdf_common.inc - src/roi_exit.cc - src/schbasis.F - src/second.c - src/sfftw_import.c - src/spline.f - #src/svd.F - #src/svdvecfit9.F - #src/svdvecfit.F - src/tranmat.F - src/uniform_interp.f90 - src/unitvec.F - src/utmtoll.F - src/zbrent.F - ) +add_subdirectory(src) target_include_directories(utilLib PUBLIC include ) @@ -85,7 +16,7 @@ target_link_libraries(utilLib PRIVATE FFTW::Float ) -add_library(combinedLib SHARED +isce2_add_staticlib(combinedLib Library/geometry/src/geometryModule.F Library/linalg3/src/linalg3Module.F Library/linalg3/src/linalg3.c @@ -112,7 +43,7 @@ target_include_directories(combinedlibmodule PUBLIC Library/include ) target_link_libraries(combinedlibmodule PUBLIC - combinedLib + isce2::combinedLib ) # Set up fortran module paths @@ -127,12 +58,6 @@ target_include_directories(combinedLib INTERFACE $<$:${mdir}> ) -install(TARGETS - utilLib - combinedLib - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} - ) - InstallSameDir( combinedlibmodule offoutliers diff --git a/components/isceobj/Util/offoutliers/CMakeLists.txt b/components/isceobj/Util/offoutliers/CMakeLists.txt new file mode 100644 index 0000000..ee4865a --- /dev/null +++ b/components/isceobj/Util/offoutliers/CMakeLists.txt @@ -0,0 +1,3 @@ +add_subdirectory(src) +target_include_directories(offoutliersLib PUBLIC include) +target_link_libraries(offoutliersLib PRIVATE isce2::stdoelLib) diff --git a/components/isceobj/Util/offoutliers/src/CMakeLists.txt b/components/isceobj/Util/offoutliers/src/CMakeLists.txt new file mode 100644 index 0000000..07732d6 --- /dev/null +++ b/components/isceobj/Util/offoutliers/src/CMakeLists.txt @@ -0,0 +1,7 @@ +isce2_add_staticlib(offoutliersLib STATIC + offoutliers.F + offoutliersAllocateDeallocate.F + offoutliersGetState.F + offoutliersSetState.F + offoutliersState.F + ) diff --git a/components/isceobj/Util/src/CMakeLists.txt b/components/isceobj/Util/src/CMakeLists.txt new file mode 100644 index 0000000..74fb533 --- /dev/null +++ b/components/isceobj/Util/src/CMakeLists.txt @@ -0,0 +1,62 @@ +isce2_add_staticlib(utilLib + akima_reg.F + args_roi.F + besseldiffs.F + bilinear.F + cfft1d_jpl.F + cfft2d.F + cffts.F + config.h + convert_schdot_to_xyzdot.F + convert_sch_to_xyz.F + cross.F + curvature.F + derampc.F + dop.F + dot.F + enubasis.F + fc.F + fc.f.org + fftw3stub.c + fftw3stub.cc + fortranUtils.f90 + fourn.F + fournnr.F + getangs.F + gettcn_tcvec.F + hunt.F + inter_motion.F + interp.F + intp_coef.f90 + intpcoefnorm.F + io.c + latlon.F + latlon_nostruct.F + lfit.F + linalg.f90 + lincomb.F + lookvec.F + lsq.f90 + matmat.F + matvec.F + norm.F + orrmread1.F + polint.F + PowerOfTwo.cc + quadfit.f90 + radar_to_xyz.F + rdf_common.inc + roi_exit.cc + schbasis.F + second.c + sfftw_import.c + spline.f + svd.F + svdvecfit9.F + svdvecfit.F + tranmat.F + uniform_interp.f90 + unitvec.F + utmtoll.F + zbrent.F + ) diff --git a/components/iscesys/ImageApi/CMakeLists.txt b/components/iscesys/ImageApi/CMakeLists.txt index a638d41..377339d 100644 --- a/components/iscesys/ImageApi/CMakeLists.txt +++ b/components/iscesys/ImageApi/CMakeLists.txt @@ -1,8 +1,4 @@ -# TODO (subdir-staticlib) -# This library is in a subdirectory but used by other libraries, -# so it's compiled as a static library so we don't need to worry -# about RPATH. Is there a better way to this? -add_library(DataAccessor_static STATIC +isce2_add_staticlib(DataAccessorLib DataAccessor/src/DataAccessorCaster.cpp DataAccessor/src/DataAccessor.cpp DataAccessor/src/DataAccessorF.cpp @@ -18,33 +14,31 @@ add_library(DataAccessor_static STATIC InterleavedAccessor/src/Poly1dInterpolator.cpp InterleavedAccessor/src/Poly2dInterpolator.cpp ) - -set_property(TARGET DataAccessor_static PROPERTY POSITION_INDEPENDENT_CODE ON) -target_include_directories(DataAccessor_static PUBLIC +target_include_directories(DataAccessorLib PUBLIC DataAccessor/include DataCaster/include Factories/include InterleavedAccessor/include ) -target_link_libraries(DataAccessor_static PUBLIC - combinedLib +target_link_libraries(DataAccessorLib PUBLIC + isce2::combinedLib ) if(TARGET GDAL::GDAL) - target_sources(DataAccessor_static PRIVATE + target_sources(DataAccessorLib PRIVATE InterleavedAccessor/src/GDALAccessor.cpp ) - target_link_libraries(DataAccessor_static PUBLIC + target_link_libraries(DataAccessorLib PUBLIC GDAL::GDAL ) else() - target_compile_definitions(DataAccessor_static PRIVATE -DHAVE_GDAL=0) + target_compile_definitions(DataAccessorLib PRIVATE -DHAVE_GDAL=0) endif() Python_add_library(DataAccessor MODULE DataAccessor/bindings/DataAccessormodule.cpp ) -target_link_libraries(DataAccessor PRIVATE DataAccessor_static) +target_link_libraries(DataAccessor PRIVATE isce2::DataAccessorLib) InstallSameDir( Factories/CasterFactory.py diff --git a/components/iscesys/ImageApi/DataAccessor/CMakeLists.txt b/components/iscesys/ImageApi/DataAccessor/CMakeLists.txt new file mode 100644 index 0000000..e69de29 diff --git a/components/iscesys/StdOE/CMakeLists.txt b/components/iscesys/StdOE/CMakeLists.txt index 7a1384b..8416495 100644 --- a/components/iscesys/StdOE/CMakeLists.txt +++ b/components/iscesys/StdOE/CMakeLists.txt @@ -2,3 +2,17 @@ InstallSameDir( __init__.py StdOEPy.py ) + +isce2_add_staticlib(stdoeLib + src/StdOE.cpp + src/StdOEDefaults.cpp + src/StdOEF.cpp + ) +target_include_directories(stdoeLib PUBLIC + include + ) + +Python_add_library(StdOE MODULE + bindings/StdOEmodule.cpp + ) +target_link_libraries(StdOE PRIVATE isce2::stdoeLib) diff --git a/components/iscesys/StdOEL/CMakeLists.txt b/components/iscesys/StdOEL/CMakeLists.txt index 5726e8d..2e4666c 100644 --- a/components/iscesys/StdOEL/CMakeLists.txt +++ b/components/iscesys/StdOEL/CMakeLists.txt @@ -1,17 +1,10 @@ -add_library(stdoel_static STATIC - src/ScreenWriter.cpp - src/StdOELF.cpp - src/FileWriter.cpp - src/StdOEL.cpp - src/WriterFactory.cpp - ) -set_property(TARGET stdoel_static PROPERTY POSITION_INDEPENDENT_CODE ON) -target_include_directories(stdoel_static PUBLIC include) +add_subdirectory(src) +target_include_directories(stdoelLib PUBLIC include) Python_add_library(StdOEL MODULE bindings/StdOELmodule.cpp ) -target_link_libraries(StdOEL PUBLIC stdoel_static) +target_link_libraries(StdOEL PUBLIC isce2::stdoelLib) InstallSameDir( StdOEL @@ -19,12 +12,7 @@ InstallSameDir( StdOELPy.py ) -add_executable(testStdOEL test/testStdOEL.cpp - src/ScreenWriter.cpp - src/StdOELF.cpp - src/FileWriter.cpp - src/StdOEL.cpp - src/WriterFactory.cpp - ) +add_executable(testStdOEL test/testStdOEL.cpp) target_include_directories(testStdOEL PUBLIC include) +target_link_libraries(testStdOEL PRIVATE isce2::stdoelLib) add_exe_test(testStdOEL) diff --git a/components/iscesys/StdOEL/src/CMakeLists.txt b/components/iscesys/StdOEL/src/CMakeLists.txt new file mode 100644 index 0000000..64d5c15 --- /dev/null +++ b/components/iscesys/StdOEL/src/CMakeLists.txt @@ -0,0 +1,7 @@ +isce2_add_staticlib(stdoelLib + ScreenWriter.cpp + StdOELF.cpp + FileWriter.cpp + StdOEL.cpp + WriterFactory.cpp + ) diff --git a/components/mroipac/aikima/CMakeLists.txt b/components/mroipac/aikima/CMakeLists.txt index 03e2bdb..f5e5c29 100644 --- a/components/mroipac/aikima/CMakeLists.txt +++ b/components/mroipac/aikima/CMakeLists.txt @@ -7,7 +7,7 @@ Python_add_library(aikima MODULE ) target_include_directories(aikima PUBLIC include) target_link_libraries(aikima PUBLIC - DataAccessor_static + isce2::DataAccessorLib ) InstallSameDir( diff --git a/components/mroipac/ampcor/CMakeLists.txt b/components/mroipac/ampcor/CMakeLists.txt index 6b8625d..dea69c3 100644 --- a/components/mroipac/ampcor/CMakeLists.txt +++ b/components/mroipac/ampcor/CMakeLists.txt @@ -9,8 +9,8 @@ Python_add_library(ampcor MODULE ) target_include_directories(ampcor PUBLIC include) target_link_libraries(ampcor PUBLIC - utilLib - DataAccessor_static + isce2::utilLib + isce2::DataAccessorLib ) InstallSameDir( diff --git a/components/mroipac/correlation/CMakeLists.txt b/components/mroipac/correlation/CMakeLists.txt index b35aff7..87ee70b 100644 --- a/components/mroipac/correlation/CMakeLists.txt +++ b/components/mroipac/correlation/CMakeLists.txt @@ -5,7 +5,7 @@ Python_add_library(correlationlib MODULE ) target_include_directories(correlationlib PUBLIC include) target_link_libraries(correlationlib PRIVATE - DataAccessor_static + isce2::DataAccessorLib ) InstallSameDir( diff --git a/components/mroipac/dopiq/CMakeLists.txt b/components/mroipac/dopiq/CMakeLists.txt index bec211a..0c813c4 100644 --- a/components/mroipac/dopiq/CMakeLists.txt +++ b/components/mroipac/dopiq/CMakeLists.txt @@ -7,7 +7,7 @@ Python_add_library(dopiq MODULE src/dopiqState.f ) target_include_directories(dopiq PUBLIC include) -target_link_libraries(dopiq PUBLIC DataAccessor_static) +target_link_libraries(dopiq PUBLIC isce2::DataAccessorLib) InstallSameDir( dopiq diff --git a/components/mroipac/doppler/CMakeLists.txt b/components/mroipac/doppler/CMakeLists.txt index 268076b..c9cdfc5 100644 --- a/components/mroipac/doppler/CMakeLists.txt +++ b/components/mroipac/doppler/CMakeLists.txt @@ -7,7 +7,7 @@ Python_add_library(doppler MODULE src/dopplerState.f ) target_include_directories(doppler PUBLIC include) -target_link_libraries(doppler PUBLIC DataAccessor_static) +target_link_libraries(doppler PUBLIC isce2::DataAccessorLib) InstallSameDir( doppler diff --git a/components/mroipac/filter/CMakeLists.txt b/components/mroipac/filter/CMakeLists.txt index f9e0976..5b2d0c1 100644 --- a/components/mroipac/filter/CMakeLists.txt +++ b/components/mroipac/filter/CMakeLists.txt @@ -1,4 +1,4 @@ -Python_add_library(libfilter MODULE +isce2_add_cdll(libfilter src/rescale_magnitude.c src/psfilt.c src/timing.c diff --git a/components/mroipac/fitoff/CMakeLists.txt b/components/mroipac/fitoff/CMakeLists.txt index 64b3541..df442ac 100644 --- a/components/mroipac/fitoff/CMakeLists.txt +++ b/components/mroipac/fitoff/CMakeLists.txt @@ -8,8 +8,8 @@ Python_add_library(fitoff MODULE ) target_include_directories(fitoff PUBLIC include) target_link_libraries(fitoff PUBLIC - combinedLib - utilLib + isce2::combinedLib + isce2::utilLib ) InstallSameDir( diff --git a/components/mroipac/formimage/CMakeLists.txt b/components/mroipac/formimage/CMakeLists.txt index 8e299b0..d9a2d06 100644 --- a/components/mroipac/formimage/CMakeLists.txt +++ b/components/mroipac/formimage/CMakeLists.txt @@ -13,11 +13,11 @@ target_include_directories(formslc PUBLIC formslc/include ) target_link_libraries(formslc PRIVATE - DataAccessor_static + isce2::DataAccessorLib ) target_link_libraries(formslc PUBLIC - utilLib + isce2::utilLib ) InstallSameDir( diff --git a/components/mroipac/geolocate/CMakeLists.txt b/components/mroipac/geolocate/CMakeLists.txt index 5b836b6..634c170 100644 --- a/components/mroipac/geolocate/CMakeLists.txt +++ b/components/mroipac/geolocate/CMakeLists.txt @@ -1,4 +1,4 @@ -Python_add_library(libgeolocate MODULE +isce2_add_cdll(libgeolocate src/geolocate_wrapper.c src/geolocate.f ) diff --git a/components/mroipac/getPegInfo/CMakeLists.txt b/components/mroipac/getPegInfo/CMakeLists.txt index dfd6bcc..cd1b40f 100644 --- a/components/mroipac/getPegInfo/CMakeLists.txt +++ b/components/mroipac/getPegInfo/CMakeLists.txt @@ -7,6 +7,11 @@ Python_add_library(get_peg_info MODULE src/get_peg_infoState.F ) target_include_directories(get_peg_info PUBLIC include) +target_link_libraries(get_peg_info PRIVATE + isce2::utilLib + isce2::stdoelLib + isce2::stdoeLib + ) InstallSameDir( get_peg_info diff --git a/components/mroipac/grass/CMakeLists.txt b/components/mroipac/grass/CMakeLists.txt index 1599605..befa4d4 100644 --- a/components/mroipac/grass/CMakeLists.txt +++ b/components/mroipac/grass/CMakeLists.txt @@ -1,4 +1,4 @@ -Python_add_library(libgrass MODULE +isce2_add_cdll(libgrass src/corr_flag.c src/grass.c src/trees.c diff --git a/components/mroipac/icu/CMakeLists.txt b/components/mroipac/icu/CMakeLists.txt index ec5b79c..f4f81a9 100644 --- a/components/mroipac/icu/CMakeLists.txt +++ b/components/mroipac/icu/CMakeLists.txt @@ -22,8 +22,8 @@ Python_add_library(icu MODULE ) target_include_directories(icu PUBLIC include) target_link_libraries(icu PUBLIC - DataAccessor_static - utilLib + isce2::DataAccessorLib + isce2::utilLib ) InstallSameDir( diff --git a/components/mroipac/looks/CMakeLists.txt b/components/mroipac/looks/CMakeLists.txt index 597a137..8841107 100644 --- a/components/mroipac/looks/CMakeLists.txt +++ b/components/mroipac/looks/CMakeLists.txt @@ -3,7 +3,7 @@ Python_add_library(looks MODULE ) target_include_directories(looks PUBLIC include) target_link_libraries(looks PRIVATE - DataAccessor_static + isce2::DataAccessorLib ) InstallSameDir( diff --git a/components/stdproc/alosreformat/ALOS_fbd2fbs/CMakeLists.txt b/components/stdproc/alosreformat/ALOS_fbd2fbs/CMakeLists.txt index 21f2130..f544e2c 100644 --- a/components/stdproc/alosreformat/ALOS_fbd2fbs/CMakeLists.txt +++ b/components/stdproc/alosreformat/ALOS_fbd2fbs/CMakeLists.txt @@ -3,8 +3,8 @@ Python_add_library(ALOS_fbd2fbs MODULE ) target_include_directories(ALOS_fbd2fbs PUBLIC include) target_link_libraries(ALOS_fbd2fbs PUBLIC - alos_lib - utilLib + isce2::alosLib + isce2::utilLib ) InstallSameDir( diff --git a/components/stdproc/alosreformat/ALOS_fbs2fbd/CMakeLists.txt b/components/stdproc/alosreformat/ALOS_fbs2fbd/CMakeLists.txt index 15d0c79..a5d3042 100644 --- a/components/stdproc/alosreformat/ALOS_fbs2fbd/CMakeLists.txt +++ b/components/stdproc/alosreformat/ALOS_fbs2fbd/CMakeLists.txt @@ -3,8 +3,8 @@ Python_add_library(ALOS_fbs2fbd MODULE ) target_include_directories(ALOS_fbs2fbd PUBLIC include) target_link_libraries(ALOS_fbs2fbd PUBLIC - alos_lib - utilLib + isce2::alosLib + isce2::utilLib ) InstallSameDir( diff --git a/components/stdproc/alosreformat/CMakeLists.txt b/components/stdproc/alosreformat/CMakeLists.txt index 7d2dbe8..05e32cc 100644 --- a/components/stdproc/alosreformat/CMakeLists.txt +++ b/components/stdproc/alosreformat/CMakeLists.txt @@ -1,9 +1,8 @@ -add_library(alos_lib STATIC +isce2_add_staticlib(alosLib ALOS_lib/src/cfft1d.c ALOS_lib/src/find_fft_length.c ALOS_lib/src/utils.c ALOS_lib/src/ALOS_ldr_orbit.c - ALOS_lib/src/SConscript ALOS_lib/src/calc_dop.c ALOS_lib/src/cfft1d_fftpack.c ALOS_lib/src/fftpack.c @@ -14,8 +13,7 @@ add_library(alos_lib STATIC ALOS_lib/src/read_ALOS_sarleader.c ALOS_lib/src/rng_compress.c ) -target_include_directories(alos_lib PUBLIC include) -set_property(TARGET alos_lib PROPERTY POSITION_INDEPENDENT_CODE ON) +target_include_directories(alosLib PUBLIC include) add_subdirectory(ALOS_fbd2fbs) add_subdirectory(ALOS_fbs2fbd) diff --git a/components/stdproc/rectify/geocode/CMakeLists.txt b/components/stdproc/rectify/geocode/CMakeLists.txt index c535ae1..0341052 100644 --- a/components/stdproc/rectify/geocode/CMakeLists.txt +++ b/components/stdproc/rectify/geocode/CMakeLists.txt @@ -11,11 +11,11 @@ Python_add_library(geocode MODULE ) target_include_directories(geocode PUBLIC include) target_link_libraries(geocode PUBLIC - DataAccessor_static + isce2::DataAccessorLib OpenMP::OpenMP_CXX - stdoel_static - combinedLib - utilLib + isce2::stdoelLib + isce2::combinedLib + isce2::utilLib ) InstallSameDir( diff --git a/components/stdproc/stdproc/CMakeLists.txt b/components/stdproc/stdproc/CMakeLists.txt index ff94ecf..1067d5e 100644 --- a/components/stdproc/stdproc/CMakeLists.txt +++ b/components/stdproc/stdproc/CMakeLists.txt @@ -1,27 +1,5 @@ -# TODO (subdir-staticlib) -# This library is in a subdirectory but used by other libraries, -# so it's compiled as a static library so we don't need to worry -# about RPATH. Is there a better way to this? -add_library(formslcLib SHARED - formslcLib/src/arraymodule.f90 - formslcLib/src/get_frate.f90 - formslcLib/src/io.c - ) -set_property(TARGET formslcLib PROPERTY POSITION_INDEPENDENT_CODE ON) -target_link_libraries(formslcLib PUBLIC - utilLib - ) -if(TARGET OpenMP::OpenMP_Fortran) - target_link_libraries(formslcLib PUBLIC - OpenMP::OpenMP_Fortran - ) -endif() - -set(mdir ${CMAKE_CURRENT_BINARY_DIR}/formslc_fortran_modules) -set_property(TARGET formslcLib PROPERTY Fortran_MODULE_DIRECTORY ${mdir}) -target_include_directories(formslcLib INTERFACE - $<$:${mdir}> - ) +add_subdirectory(formslcLib) +add_subdirectory(resampLib) add_subdirectory(correct) add_subdirectory(crossmul) diff --git a/components/stdproc/stdproc/correct/CMakeLists.txt b/components/stdproc/stdproc/correct/CMakeLists.txt index 6e6779b..2336724 100644 --- a/components/stdproc/stdproc/correct/CMakeLists.txt +++ b/components/stdproc/stdproc/correct/CMakeLists.txt @@ -1,17 +1,4 @@ -Python_add_library(correct MODULE - bindings/correctmodule.cpp - src/correctAllocateDeallocate.f - src/correctSetState.f - src/correctState.f - ) -target_include_directories(correct PUBLIC include) -if(TARGET OpenMP::OpenMP_Fortran) - target_link_libraries(correct PUBLIC - OpenMP::OpenMP_Fortran - ) -endif() InstallSameDir( - correct __init__.py Correct.py ) diff --git a/components/stdproc/stdproc/correct/src/CMakeLists.txt b/components/stdproc/stdproc/correct/src/CMakeLists.txt new file mode 100644 index 0000000..e69de29 diff --git a/components/stdproc/stdproc/crossmul/CMakeLists.txt b/components/stdproc/stdproc/crossmul/CMakeLists.txt index 8f69a26..83d5765 100644 --- a/components/stdproc/stdproc/crossmul/CMakeLists.txt +++ b/components/stdproc/stdproc/crossmul/CMakeLists.txt @@ -4,6 +4,10 @@ Python_add_library(crossmul MODULE src/crossmul.f90 ) target_include_directories(crossmul PUBLIC include) +target_link_libraries(crossmul PRIVATE + isce2::utilLib + isce2::DataAccessorLib + ) if(TARGET OpenMP::OpenMP_Fortran) target_link_libraries(crossmul PUBLIC OpenMP::OpenMP_Fortran diff --git a/components/stdproc/stdproc/estamb/CMakeLists.txt b/components/stdproc/stdproc/estamb/CMakeLists.txt index a729fea..1d31785 100644 --- a/components/stdproc/stdproc/estamb/CMakeLists.txt +++ b/components/stdproc/stdproc/estamb/CMakeLists.txt @@ -1,14 +1,4 @@ -Python_add_library(estamb MODULE - bindings/estambmodule.cpp - src/estambAllocateDeallocate.F - src/estambGetState.F - src/estambSetState.F - src/estambStateSoi.f90 - ) -target_include_directories(estamb PUBLIC include) - InstallSameDir( - estamb __init__.py Estamb.py ) diff --git a/components/stdproc/stdproc/formslc/CMakeLists.txt b/components/stdproc/stdproc/formslc/CMakeLists.txt index aee2a7e..83e8864 100644 --- a/components/stdproc/stdproc/formslc/CMakeLists.txt +++ b/components/stdproc/stdproc/formslc/CMakeLists.txt @@ -1,22 +1,4 @@ -Python_add_library(stdproc_formslc MODULE - bindings/formslcmodule.cpp - src/formslcAllocateDeallocate.F - src/formslcGetState.F - src/formslcSetState.F - src/formslcStateSoi.f90 - ) -target_include_directories(stdproc_formslc PUBLIC include) -target_link_libraries(stdproc_formslc PUBLIC - combinedLib - formslcLib - utilLib - ) - -set_target_properties(stdproc_formslc - PROPERTIES OUTPUT_NAME formslc) - InstallSameDir( - stdproc_formslc __init__.py Formslc.py ) diff --git a/components/stdproc/stdproc/formslcLib/CMakeLists.txt b/components/stdproc/stdproc/formslcLib/CMakeLists.txt new file mode 100644 index 0000000..932a7b9 --- /dev/null +++ b/components/stdproc/stdproc/formslcLib/CMakeLists.txt @@ -0,0 +1,18 @@ +isce2_add_staticlib(formslcLib + src/arraymodule.f90 + src/get_frate.f90 + src/io.c + ) +target_link_libraries(formslcLib PUBLIC + isce2::utilLib + ) +if(TARGET OpenMP::OpenMP_Fortran) + target_link_libraries(formslcLib PUBLIC + OpenMP::OpenMP_Fortran + ) +endif() +set(mdir ${CMAKE_CURRENT_BINARY_DIR}/formslc_fortran_modules) +set_property(TARGET formslcLib PROPERTY Fortran_MODULE_DIRECTORY ${mdir}) +target_include_directories(formslcLib INTERFACE + $<$:${mdir}> + ) diff --git a/components/stdproc/stdproc/mocompTSX/CMakeLists.txt b/components/stdproc/stdproc/mocompTSX/CMakeLists.txt index d887cf0..5fc6259 100644 --- a/components/stdproc/stdproc/mocompTSX/CMakeLists.txt +++ b/components/stdproc/stdproc/mocompTSX/CMakeLists.txt @@ -1,24 +1,4 @@ -Python_add_library(mocompTSX MODULE - bindings/mocompTSXmodule.cpp - src/mocompTSXAllocateDeallocate.f - src/mocompTSXGetState.f - src/mocompTSXSetState.f - src/mocompTSXState.f - ) -target_include_directories(mocompTSX PUBLIC include) -target_link_libraries(mocompTSX - PUBLIC - combinedLib - formslcLib - utilLib - ) -if(TARGET OpenMP::OpenMP_Fortran) - target_link_libraries(mocompTSX PUBLIC - OpenMP::OpenMP_Fortran - ) -endif() InstallSameDir( - mocompTSX __init__.py MocompTSX.py ) diff --git a/components/stdproc/stdproc/offsetpoly/CMakeLists.txt b/components/stdproc/stdproc/offsetpoly/CMakeLists.txt index 3e6a0af..8425d0b 100644 --- a/components/stdproc/stdproc/offsetpoly/CMakeLists.txt +++ b/components/stdproc/stdproc/offsetpoly/CMakeLists.txt @@ -1,15 +1,22 @@ -Python_add_library(offsetpoly MODULE - bindings/offsetpolymodule.cpp +isce2_add_staticlib(offsetpolyLib src/offsetpolyState.F src/offsetpoly.f90 src/offsetpolySetState.F src/offsetpolyAllocateDeallocate.F src/offsetpolyGetState.F ) +target_link_libraries(offsetpolyLib PRIVATE + isce2::utilLib + ) + +Python_add_library(offsetpoly MODULE + bindings/offsetpolymodule.cpp + ) target_include_directories(offsetpoly PUBLIC include) -target_link_libraries(offsetpoly PUBLIC - combinedLib - utilLib +target_link_libraries(offsetpoly PRIVATE + isce2::offsetpolyLib + isce2::resampLib + isce2::stdoelLib ) if(TARGET OpenMP::OpenMP_Fortran) target_link_libraries(offsetpoly PUBLIC diff --git a/components/stdproc/stdproc/resamp/CMakeLists.txt b/components/stdproc/stdproc/resamp/CMakeLists.txt index af22079..3654fc1 100644 --- a/components/stdproc/stdproc/resamp/CMakeLists.txt +++ b/components/stdproc/stdproc/resamp/CMakeLists.txt @@ -8,7 +8,10 @@ Python_add_library(resamp MODULE ) target_include_directories(resamp PUBLIC include) target_link_libraries(resamp PUBLIC - utilLib + isce2::resampLib + isce2::utilLib + isce2::stdoelLib + isce2::DataAccessorLib ) if(TARGET OpenMP::OpenMP_Fortran) target_link_libraries(resamp PUBLIC diff --git a/components/stdproc/stdproc/resampLib/CMakeLists.txt b/components/stdproc/stdproc/resampLib/CMakeLists.txt new file mode 100644 index 0000000..febd4f0 --- /dev/null +++ b/components/stdproc/stdproc/resampLib/CMakeLists.txt @@ -0,0 +1 @@ +add_subdirectory(src) diff --git a/components/stdproc/stdproc/resampLib/src/CMakeLists.txt b/components/stdproc/stdproc/resampLib/src/CMakeLists.txt new file mode 100644 index 0000000..c0aeac4 --- /dev/null +++ b/components/stdproc/stdproc/resampLib/src/CMakeLists.txt @@ -0,0 +1,8 @@ +isce2_add_staticlib(resampLib + poly_funcs.f90 + svd.f + svdvecfit.f + ) +target_link_libraries(resampLib PRIVATE + isce2::utilLib + ) diff --git a/components/stdproc/stdproc/resamp_amps/CMakeLists.txt b/components/stdproc/stdproc/resamp_amps/CMakeLists.txt index a8c3edb..04e9e57 100644 --- a/components/stdproc/stdproc/resamp_amps/CMakeLists.txt +++ b/components/stdproc/stdproc/resamp_amps/CMakeLists.txt @@ -7,6 +7,10 @@ Python_add_library(resamp_amps MODULE src/resamp_ampsState.F ) target_include_directories(resamp_amps PUBLIC include) +target_link_libraries(resamp_amps PRIVATE + isce2::DataAccessorLib + isce2::resampLib + ) InstallSameDir( resamp_amps diff --git a/components/stdproc/stdproc/resamp_image/CMakeLists.txt b/components/stdproc/stdproc/resamp_image/CMakeLists.txt index c5966e5..4bd5594 100644 --- a/components/stdproc/stdproc/resamp_image/CMakeLists.txt +++ b/components/stdproc/stdproc/resamp_image/CMakeLists.txt @@ -1,3 +1,5 @@ +set(CMAKE_POSITION_INDEPENDENT_CODE ON) + Python_add_library(resamp_image MODULE bindings/resamp_imagemodule.cpp src/resamp_imageState.F @@ -7,7 +9,10 @@ Python_add_library(resamp_image MODULE ) target_include_directories(resamp_image PUBLIC include) target_link_libraries(resamp_image PUBLIC - utilLib + isce2::DataAccessorLib + isce2::resampLib + isce2::utilLib + isce2::stdoelLib ) InstallSameDir( diff --git a/components/stdproc/stdproc/resamp_only/CMakeLists.txt b/components/stdproc/stdproc/resamp_only/CMakeLists.txt index add4b5d..cb862f4 100644 --- a/components/stdproc/stdproc/resamp_only/CMakeLists.txt +++ b/components/stdproc/stdproc/resamp_only/CMakeLists.txt @@ -7,6 +7,11 @@ Python_add_library(resamp_only MODULE src/resamp_onlyState.F ) target_include_directories(resamp_only PUBLIC include) +target_link_libraries(resamp_only PRIVATE + isce2::DataAccessorLib + isce2::resampLib + isce2::stdoelLib + ) InstallSameDir( resamp_only diff --git a/components/stdproc/stdproc/resamp_slc/CMakeLists.txt b/components/stdproc/stdproc/resamp_slc/CMakeLists.txt index 10753c5..688e257 100644 --- a/components/stdproc/stdproc/resamp_slc/CMakeLists.txt +++ b/components/stdproc/stdproc/resamp_slc/CMakeLists.txt @@ -7,8 +7,9 @@ Python_add_library(resamp_slc MODULE ) target_include_directories(resamp_slc PUBLIC include) target_link_libraries(resamp_slc PUBLIC - combinedLib - utilLib + isce2::combinedLib + isce2::utilLib + isce2::DataAccessorLib ) target_compile_options(resamp_slc PRIVATE -ffree-line-length-none diff --git a/components/stdproc/stdproc/topo/CMakeLists.txt b/components/stdproc/stdproc/topo/CMakeLists.txt index 5533a8f..c9c1ee7 100644 --- a/components/stdproc/stdproc/topo/CMakeLists.txt +++ b/components/stdproc/stdproc/topo/CMakeLists.txt @@ -1,24 +1,4 @@ -Python_add_library(topo MODULE - bindings/topomodule.cpp - src/topoAllocateDeallocate.f - src/topoGetState.f - src/topoMethods.f - src/topoSetState.f - src/topoState.f - ) -target_include_directories(topo PUBLIC include) -target_link_libraries(topo PUBLIC - combinedLib - utilLib - ) -if(TARGET OpenMP::OpenMP_Fortran) - target_link_libraries(topo PUBLIC - OpenMP::OpenMP_Fortran - ) -endif() - InstallSameDir( - topo __init__.py Topo.py ) diff --git a/components/zerodop/GPUampcor/CMakeLists.txt b/components/zerodop/GPUampcor/CMakeLists.txt index 42d6f62..6c6b95a 100644 --- a/components/zerodop/GPUampcor/CMakeLists.txt +++ b/components/zerodop/GPUampcor/CMakeLists.txt @@ -16,7 +16,7 @@ target_include_directories(GPUampcor PUBLIC ) target_link_libraries(GPUampcor PRIVATE CUDA::cublas - DataAccessor_static + isce2::DataAccessorLib FFTW::Float ) InstallSameDir( diff --git a/components/zerodop/GPUgeo2rdr/CMakeLists.txt b/components/zerodop/GPUgeo2rdr/CMakeLists.txt index 78afd24..b86b3c6 100644 --- a/components/zerodop/GPUgeo2rdr/CMakeLists.txt +++ b/components/zerodop/GPUgeo2rdr/CMakeLists.txt @@ -12,7 +12,7 @@ target_include_directories(GPUgeo2rdr PUBLIC include ) target_link_libraries(GPUgeo2rdr PRIVATE - DataAccessor_static + isce2::DataAccessorLib ) if(TARGET OpenMP::OpenMP_CXX) target_link_libraries(GPUgeo2rdr PRIVATE OpenMP::OpenMP_CXX) diff --git a/components/zerodop/geo2rdr/CMakeLists.txt b/components/zerodop/geo2rdr/CMakeLists.txt index 747b0a3..78e8d48 100644 --- a/components/zerodop/geo2rdr/CMakeLists.txt +++ b/components/zerodop/geo2rdr/CMakeLists.txt @@ -6,9 +6,9 @@ Python_add_library(geo2rdr MODULE ) target_include_directories(geo2rdr PUBLIC include) target_link_libraries(geo2rdr PUBLIC - DataAccessor_static - combinedLib - utilLib + isce2::DataAccessorLib + isce2::combinedLib + isce2::utilLib ) if(TARGET OpenMP::OpenMP_Fortran) diff --git a/components/zerodop/geozero/CMakeLists.txt b/components/zerodop/geozero/CMakeLists.txt index b54f763..72c88b7 100644 --- a/components/zerodop/geozero/CMakeLists.txt +++ b/components/zerodop/geozero/CMakeLists.txt @@ -10,9 +10,9 @@ Python_add_library(geozero MODULE ) target_include_directories(geozero PUBLIC include) target_link_libraries(geozero PUBLIC - DataAccessor_static - combinedLib - utilLib + isce2::DataAccessorLib + isce2::combinedLib + isce2::utilLib OpenMP::OpenMP_Fortran ) diff --git a/components/zerodop/topozero/CMakeLists.txt b/components/zerodop/topozero/CMakeLists.txt index 5ed4bd4..35aba31 100644 --- a/components/zerodop/topozero/CMakeLists.txt +++ b/components/zerodop/topozero/CMakeLists.txt @@ -8,9 +8,9 @@ Python_add_library(topozero MODULE ) target_include_directories(topozero PUBLIC include) target_link_libraries(topozero PRIVATE - combinedLib - utilLib - DataAccessor_static + isce2::combinedLib + isce2::utilLib + isce2::DataAccessorLib ) set_source_files_properties(src/topozero.f90 PROPERTIES COMPILE_OPTIONS -cpp) if(TARGET OpenMP::OpenMP_Fortran) diff --git a/contrib/Snaphu/CMakeLists.txt b/contrib/Snaphu/CMakeLists.txt index cd87cb1..63995d5 100644 --- a/contrib/Snaphu/CMakeLists.txt +++ b/contrib/Snaphu/CMakeLists.txt @@ -10,7 +10,7 @@ Python_add_library(snaphu MODULE ) target_include_directories(snaphu PUBLIC include) target_link_libraries(snaphu PUBLIC - DataAccessor_static + isce2::DataAccessorLib ) InstallSameDir( diff --git a/contrib/alos2proc/CMakeLists.txt b/contrib/alos2proc/CMakeLists.txt index c98e1da..6c2489d 100644 --- a/contrib/alos2proc/CMakeLists.txt +++ b/contrib/alos2proc/CMakeLists.txt @@ -1,4 +1,4 @@ -Python_add_library(libalos2proc MODULE +isce2_add_cdll(libalos2proc MODULE src/rg_filter.c src/lib_file.c src/lib_cpx.c diff --git a/contrib/demUtils/CMakeLists.txt b/contrib/demUtils/CMakeLists.txt index de5e950..ff1d03f 100644 --- a/contrib/demUtils/CMakeLists.txt +++ b/contrib/demUtils/CMakeLists.txt @@ -8,12 +8,12 @@ target_include_directories(correct_geoid_i2_srtm PUBLIC correct_geoid_i2_srtm/include ) target_link_libraries(correct_geoid_i2_srtm PUBLIC - DataAccessor_static - stdoel_static - utilLib + isce2::DataAccessorLib + isce2::stdoelLib + isce2::utilLib ) -Python_add_library(demStitch MODULE +isce2_add_cdll(demStitch demstitcher/bindings/demStitch.c ) @@ -27,7 +27,9 @@ target_include_directories(upsampledem PRIVATE upsampledem/include ) target_link_libraries(upsampledem PRIVATE - utilLib + isce2::DataAccessorLib + isce2::stdoelLib + isce2::utilLib ) Python_add_library(watermask MODULE diff --git a/contrib/geo_autoRIFT/geogrid/CMakeLists.txt b/contrib/geo_autoRIFT/geogrid/CMakeLists.txt index d155e28..0fe68dd 100644 --- a/contrib/geo_autoRIFT/geogrid/CMakeLists.txt +++ b/contrib/geo_autoRIFT/geogrid/CMakeLists.txt @@ -7,7 +7,7 @@ target_include_directories(geogrid PRIVATE ) target_link_libraries(geogrid PRIVATE GDAL::GDAL - combinedLib + isce2::combinedLib ) InstallSameDir( diff --git a/contrib/splitSpectrum/CMakeLists.txt b/contrib/splitSpectrum/CMakeLists.txt index fde6ae5..24d8861 100644 --- a/contrib/splitSpectrum/CMakeLists.txt +++ b/contrib/splitSpectrum/CMakeLists.txt @@ -2,11 +2,15 @@ InstallSameDir(__init__.py) if(CYTHON_EXECUTABLE AND TARGET GDAL::GDAL) cython_add_module(splitSpectrum - pyx/splitRangeSpectrum.pyx + pyx/splitSpectrum.pyx src/splitRangeSpectrum.cc ) target_include_directories(splitSpectrum PUBLIC include) - target_link_libraries(splitSpectrum PUBLIC GDAL::GDAL FFTW::Float OpenMP::OpenMP_CXX) + target_link_libraries(splitSpectrum PUBLIC + GDAL::GDAL + FFTW::FloatThreads + OpenMP::OpenMP_CXX + ) InstallSameDir(splitSpectrum) endif()