Skip to content

Commit

Permalink
saga: remove PG mpi, just detect path to mpi.h if hdf5 needs it
Browse files Browse the repository at this point in the history
  • Loading branch information
nilason committed Dec 19, 2023
1 parent 2c067c6 commit 8ba78a8
Showing 1 changed file with 14 additions and 19 deletions.
33 changes: 14 additions & 19 deletions gis/saga/Portfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:filetype=tcl:et:sw=4:ts=4:sts=4

PortSystem 1.0
PortGroup active_variants 1.1
PortGroup cmake 1.1
PortGroup mpi 1.0
PortGroup wxWidgets 1.0

wxWidgets.use wxWidgets-3.2
Expand Down Expand Up @@ -47,8 +47,6 @@ depends_lib-append port:${wxWidgets.port} \
port:curl \
port:tiff

mpi.setup

compiler.cxx_standard 2014

configure.pkg_config_path-append \
Expand Down Expand Up @@ -93,26 +91,23 @@ if {![variant_isset unixodbc] && ![variant_isset iodbc]} {
}

variant vigra description "Add VIGRA support" {
if {![catch {set result [active_variants hdf5 openmpi]}]} {
if {$result} {
if {![variant_isset openmpi]} {
return -code error "HDF5 has openmpi enabled, please use the same variant."
pre-configure {
# If HDF5 is built with a mpi variant, we need to know the path to "mpi.h".
# Figure out HDF5's mpi include directory:
set mpl_include_dir ""
if {![catch {set result [active_variants hdf5 openmpi]}]} {
if {$result} {
set mpl_include_dir "-I${prefix}/include/openmpi-mp"
}
}
}

if {![catch {set result [active_variants hdf5 mpi]}]} {
if {$result} {
if {![variant_isset mpi]} {
return -code error "HDF5 has mpi enabled, please use the same variant."
if {![catch {set result [active_variants hdf5 mpich]}]} {
if {$result} {
set mpl_include_dir "-I${prefix}/include/mpich-mp"
}
}
}

if {[variant_isset mpich] || [variant_isset mpich-devel] || \
[variant_isset openmpi] || [variant_isset openmpi_devel]} {

mpi.enforce_variant hdf5
if {$mpl_include_dir ne ""} {
configure.cxxflags-append ${mpl_include_dir}
}
}

configure.args-replace -DWITH_TOOLS_VIGRA=OFF -DWITH_TOOLS_VIGRA=ON \
Expand Down

0 comments on commit 8ba78a8

Please sign in to comment.