# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4 PortSystem 1.0 PortGroup mpi 1.0 PortGroup active_variants 1.1 PortGroup github 1.0 compilers.choose f90 cxx compilers.setup require_fortran -clang compilers.allow_arguments_mismatch \ yes mpi.setup mpi.enforce_variant netcdf-fortran github.setup esmf-org esmf 8.5.0 v revision 2 checksums rmd160 3d1edb514d5b09b46f1f60047e3f5cd3c0bf7b43 \ sha256 acd0b2641587007cc3ca318427f47b9cae5bfd2da8d2a16ea778f637107c29c4 \ size 14091400 version [string map {_ .} ${github.version}] categories science devel license NCSA maintainers {takeshi @tenomoto} openmaintainer description software for building and coupling weather, climate, and related models long_description The ESMF defines an architecture for composing complex, coupled \ modeling systems and includes data structures \ and utilities for developing individual models. homepage https://earthsystemmodeling.org github.tarball_from archive depends_build bin:ranlib:cctools depends_lib port:netcdf \ port:netcdf-fortran \ port:xercesc3 \ port:yaml-cpp if {${os.platform} eq "darwin" && ${os.major} < 12} { known_fail yes pre-fetch { ui_error "${name} @{version} requires OS X Mountain Lion or later." return -code error "unsupported Mac OS X version" } } patchfiles install_name.patch post-patch { if {[variant_isset openmpi]} { foreach c {g95 gfortran gfortranclang} { reinplace "s| -lmpi_f77||" ${worksrcpath}/build_config/Darwin.${c}.default/build_rules.mk } } } pre-configure { if {${configure.cxx_stdlib} eq "libc++" && ![mpi_variant_isset]} { reinplace "s|stdc++|c++|" ${worksrcpath}/build_config/Darwin.gfortranclang.default/build_rules.mk reinplace "s|stdc++|c++|" ${worksrcpath}/build_config/Darwin.g95.default/build_rules.mk } } if {![variant_isset atlas]} { default_variants +accelerate } use_configure no if {[variant_isset gcc47] || [variant_isset gcc48] || [variant_isset gcc49] || [variant_isset gcc5]} { configure.cxxflags-append -std=c++11 } elseif {[variant_isset gcc44] || [variant_isset gcc45] || [variant_isset gcc46]} { configure.cxxflags-append -std=c++0x } build.target lib pre-build { build.env ESMF_DIR=${worksrcpath} \ ESMF_F90=${configure.f90} \ ESMF_F90COMPILEOPTS=${configure.f90flags} \ ESMF_CXX=${configure.cxx} \ ESMF_CXXCOMPILEOPTS=${configure.cxxflags} \ ESMF_NETCDF=split \ ESMF_NETCDF_INCLUDE=${prefix}/include \ ESMF_NETCDF_LIBPATH=${prefix}/lib \ ESMF_XERCES=standard \ ESMF_XERCES_INCLUDE=${prefix}/include \ ESMF_XERCES_LIBPATH=${prefix}/lib \ ESMF_YAMLCPP=standard \ ESMF_YAMLCPP_INCLUDE=${prefix}/include \ ESMF_YAMLCPP_LIBPATH=${prefix}/lib \ ESMF_INSTALL_LIBDIR=${prefix}/lib if {[variant_isset accelerate]} { build.env-append ESMF_LAPACK=system \ ESMF_LAPACK_LIBS=-lvecLibFort } elseif {[variant_isset atlas]} { build.env-append ESMF_LAPACK=system \ ESMF_LAPACK_LIBS=-lsatlas } if {[variant_isset g95]} { build.env-append ESMF_COMPILER=g95 } else { if {[string match *clang* ${configure.cxx}]} { build.env-append ESMF_COMPILER=gfortranclang } else { build.env-append ESMF_COMPILER=gfortran } } if {[variant_isset mpich] || [variant_isset mpich_devel]} { build.env-append ESMF_COMM=mpich2 } elseif {[variant_isset openmpi] || [variant_isset openmpi_devel]} { build.env-append ESMF_COMM=openmpi } else { build.env-append ESMF_COMM=mpiuni } } pre-destroot { destroot.env ESMF_DIR=${worksrcpath} \ ESMF_F90=${configure.f90} \ ESMF_F90COMPILEOPTS=${configure.f90flags} \ "ESMF_F90LINKOPTS=-L${worksrcpath}/lib ${configure.ldflags}" \ ESMF_CXX=${configure.cxx} \ ESMF_CXXCOMPILEOPTS=${configure.cxxflags} \ "ESMF_CXXLINKOPTS=-L${worksrcpath}/lib ${configure.ldflags}" \ ESMF_NETCDF=split \ ESMF_NETCDF_INCLUDE=${prefix}/include \ ESMF_NETCDF_LIBPATH=${prefix}/lib \ ESMF_XERCES=standard \ ESMF_XERCES_INCLUDE=${prefix}/include \ ESMF_XERCES_LIBPATH=${prefix}/lib \ ESMF_YAMLCPP=standard \ ESMF_YAMLCPP_INCLUDE=${prefix}/include \ ESMF_YAMLCPP_LIBPATH=${prefix}/lib \ ESMF_INSTALL_PREFIX=${destroot}${prefix} \ ESMF_INSTALL_HEADERDIR=${destroot}${prefix}/include/${name} \ ESMF_INSTALL_MODDIR=${destroot}${prefix}/include/${name} \ ESMF_INSTALL_LIBDIR=${destroot}${prefix}/lib \ ESMF_INSTALL_BINDIR=${destroot}${prefix}/bin \ ESMF_INSTALL_DOCDIR=${destroot}${prefix}/share/doc/${name} if {[variant_isset accelerate]} { destroot.env-append ESMF_LAPACK=system \ ESMF_LAPACK_LIBS=-lvecLibFort } elseif {[variant_isset atlas]} { destroot.env-append ESMF_LAPACK=system \ ESMF_LAPACK_LIBS=-lsatlas } if {[variant_isset g95]} { destroot.env-append ESMF_COMPILER=g95 } else { if {[string match *clang* ${configure.cxx}]} { destroot.env-append ESMF_COMPILER=gfortranclang } else { destroot.env-append ESMF_COMPILER=gfortran } } if {[variant_isset mpich] || [variant_isset mpich_devel]} { destroot.env-append ESMF_COMM=mpich2 } elseif {[variant_isset openmpi] || [variant_isset openmpi_devel]} { destroot.env-append ESMF_COMM=openmpi } else { destroot.env-append ESMF_COMM=mpiuni } } variant accelerate conflicts atlas description {use Accelerate framework for LAPACK} { depends_lib-append port:vecLibFort } variant atlas conflicts accelerate description {use Atlas for LAPACK} { depends_lib-append port:atlas } post-destroot { reinplace "s|${destroot}||g" ${destroot}${prefix}/lib/esmf.mk reinplace "s|-L${worksrcpath}/lib||g" ${destroot}${prefix}/lib/esmf.mk reinplace "s|-I${worksrcpath}/src/Infrastructure/stubs|-I${prefix}/share/esmf/src/Infrastructure/stubs|g" ${destroot}${prefix}/lib/esmf.mk reinplace "s|${worksrcpath}|${prefix}/share/esmf|g" ${destroot}${prefix}/lib/esmf.mk xinstall -d ${destroot}${prefix}/share/${name} file copy ${worksrcpath}/src ${destroot}${prefix}/share/${name} system -W ${destroot}${prefix}/lib "ranlib libesmf.a" system -W ${destroot}${prefix}/lib "ranlib libesmftrace_static.a" file delete ${destroot}${prefix}/lib/preload.sh # Adhoc fix foreach f {ESMF_PrintInfo ESMF_Regrid ESMF_Scrip2Unstruct \ ESMF_PrintInfoC ESMF_RegridWeightGen ESMF_WebServController} { system -W ${destroot}${prefix}/bin \ "install_name_tool -change ${destroot}${prefix}/lib/libesmf.dylib ${prefix}/lib/libesmf.dylib ${f}" foreach l {gfortran.5 quadmath.0} { system -W ${destroot}${prefix}/bin \ "install_name_tool -change @rpath/lib${l}.dylib ${prefix}/lib/libgcc/lib${l}.dylib ${f}" } } foreach f {esmf esmftrace_preload esmf_fullylinked} { system -W ${destroot}${prefix}/lib \ "install_name_tool -change @rpath/libgfortran.5.dylib ${prefix}/lib/libgcc/libgfortran.5.dylib lib${f}.dylib" system -W ${destroot}${prefix}/lib \ "install_name_tool -change ${worksrcpath}/lib${f}.dylib ${prefix}/lib/lib${f}.dylib lib${f}.dylib" } } # Exclude pre-release candidates github.livecheck.regex {([0-9.]+)}