# -*- 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 boost 1.0 PortGroup cmake 1.1 PortGroup compilers 1.0 PortGroup github 1.0 PortGroup legacysupport 1.1 boost.version 1.81 github.setup m-a-d-n-e-s-s madness a112c57fc5b9fc2a222c81ed531c2c11d429348a version 2024.04.10 revision 0 categories science math license GPL-2 maintainers {@barracuda156 gmail.com:vital.had} openmaintainer description Multiresolution Adaptive Numerical Environment for Scientific Simulation long_description MADNESS provides a high-level environment for the solution \ of integral and differential equations in many dimensions \ using adaptive, fast methods with guaranteed precision \ based on multi-resolution analysis and novel separated representations. checksums rmd160 d9241d1bc207e12ea857938cf1ac111ce2acba83 \ sha256 bbef0cacd92c5bbf546212914d11c269a2e6224078a2f67e43e2a58b5e2803df \ size 36799675 github.tarball_from archive set py_ver 3.11 set py_ver_nodot [string map {. {}} ${py_ver}] depends_build-append \ port:python${py_ver_nodot} configure.python ${prefix}/bin/python${py_ver} # On new systems finding OpenBLAS is broken with this port for some reason recently, # so let them use Accelerate. On non-Darwin OSs there is no Accelerate: OpenBLAS is the only option. if {(${os.platform} eq "darwin" && ${os.major} < 20) || ${os.platform} ne "darwin"} { # For now, using OpenBLAS instead of PG choice, due to this: # https://github.com/m-a-d-n-e-s-s/madness/issues/458 depends_lib-append \ path:lib/libopenblas.dylib:OpenBLAS require_active_variants \ path:lib/libopenblas.dylib:OpenBLAS lapack # We need LAPACK_LIBRARIES to be set: https://trac.macports.org/ticket/68721 configure.pre_args-append \ -DLAPACK_LIBRARIES=OpenBLAS } patch.pre_args-replace -p0 -p1 # Temporarily avoid building chemistry part: # https://github.com/m-a-d-n-e-s-s/madness/issues/459 patchfiles 0001-CMakeLists-support-ppc.patch \ 0002-Do-not-build-chem-it-is-broken.patch \ 0003-Do-not-build-apps-they-depend-on-chem.patch # We do not use these at the moment, but let’s fix them anyway: post-patch { reinplace "s,/usr/bin/env python3,${configure.python}," \ {*}[glob ${worksrcpath}/src/apps/cc2/*.py] \ {*}[glob ${worksrcpath}/src/apps/cis/*.py] \ {*}[glob ${worksrcpath}/src/apps/moldft/*.py] \ {*}[glob ${worksrcpath}/src/apps/mp2/*.py] \ {*}[glob ${worksrcpath}/src/apps/nemo/*.py] \ {*}[glob ${worksrcpath}/src/apps/oep/*.py] \ {*}[glob ${worksrcpath}/src/apps/znemo/*.py] } compiler.cxx_standard 2017 compiler.thread_local_storage yes compilers.setup require_fortran # oneTBB task backend not yet fixed: https://github.com/m-a-d-n-e-s-s/madness/issues/366 # It is unclear whether MPI works, therefore disabling for now. # Please do not enable without testing, and do not enable by default on PPC. configure.args-append \ -DBUILD_SHARED_LIBS=ON \ -DBUILD_TESTING=OFF \ -DENABLE_ACML=OFF \ -DENABLE_BOOST=ON \ -DENABLE_ELEMENTAL=OFF \ -DENABLE_GENTENSOR=OFF \ -DENABLE_GPERFTOOLS=OFF \ -DENABLE_LIBUNWIND=OFF \ -DENABLE_LIBXC=OFF \ -DENABLE_MKL=OFF \ -DENABLE_MPI=OFF \ -DENABLE_NEVER_SPIN=OFF \ -DENABLE_PAPI=OFF \ -DENABLE_PCM=OFF \ -DENABLE_SPINLOCKS=ON \ -DENABLE_TCMALLOC_MINIMAL=OFF \ -DFORTRAN_INTEGER_SIZE=4 \ -DMADNESS_TASK_BACKEND="Pthreads" \ -DPython3_EXECUTABLE=${configure.python} legacysupport.newest_darwin_requires_legacy 16 legacysupport.use_mp_libcxx yes platform darwin { # dqueue.h:221:17: error: aligned deallocation function # of type 'void (void *, std::align_val_t) noexcept' # is only available on macOS 10.13 or newer if {${os.major} <= 16} { # gcc does not recognize -fno-aligned-allocation if {[string match *clang* ${configure.compiler}]} { configure.cxxflags-append \ -fno-aligned-allocation } } if {[string match *gcc* ${configure.compiler}]} { # https://github.com/m-a-d-n-e-s-s/madness/issues/456 configure.cxxflags-append \ -fpermissive } } # Build auto-detects ccache if it is installed and attempts to write # to CCACHE_DIR, which is not allowed if configure.ccache=off. # Set CCACHE_DIR to the build directory instead. if {![option configure.ccache]} { configure.env-append CCACHE_DIR=${workpath}/.ccache build.env-append CCACHE_DIR=${workpath}/.ccache destroot.env-append CCACHE_DIR=${workpath}/.ccache } # Make this a variant due to: https://trac.macports.org/ticket/68775 variant gperftools description "Build with gperftools support" { depends_lib-append \ port:gperftools configure.args-replace \ -DENABLE_GPERFTOOLS=OFF -DENABLE_GPERFTOOLS=ON } variant tests description "Build and run tests" { # Tests 54–65 are expected to fail presently, since they depend on libMADchem, which we disable; see above. configure.pre_args-replace \ -DCMAKE_BUILD_WITH_INSTALL_RPATH:BOOL=ON \ -DCMAKE_BUILD_WITH_INSTALL_RPATH:BOOL=OFF configure.args-replace \ -DBUILD_TESTING=OFF -DBUILD_TESTING=ON pre-test { # test infrastructure uses /bin/ps, which is forbidden by sandboxing append portsandbox_profile " (allow process-exec (literal \"/bin/ps\") (with no-profile))" } test.run yes }