Files

162 lines
5.9 KiB
Tcl
Raw Permalink Normal View History

# -*- 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
2020-02-01 05:33:49 -07:00
PortSystem 1.0
PortGroup active_variants 1.1
2024-01-04 06:58:18 +08:00
PortGroup cmake 1.1
PortGroup compilers 1.0
PortGroup github 1.0
PortGroup linear_algebra 1.0
2024-01-04 06:01:59 +08:00
github.setup NGSolve ngsolve 6.2.2307 v
revision 0
2020-02-01 05:33:49 -07:00
categories math
license LGPL-2
maintainers {mcalhoun @MarcusCalhoun-Lopez} openmaintainer
description NGSolve Finite Element Library
long_description NGSolve is a general purpose Finite Element Library \
on top of Netgen. With the basic library one can solve \
heat flow equations, Maxwell equations, and solid \
mechanical problems. Several add-ons are available for \
particular application classes.
homepage https://ngsolve.org/
2024-01-04 06:01:59 +08:00
checksums rmd160 5f872b64c2fadbf9e810e35c13de6d55aaf760f1 \
sha256 d67681b341e9c33c409d19303238a72b1da35f3739c6f53693af75b36888af12 \
size 19512935
github.tarball_from archive
2020-02-01 05:33:49 -07:00
compiler.cxx_standard 2017
2024-01-04 06:01:59 +08:00
# Build fails with gcc-13 and Apple clang.
# clang-17 on aarch64 and gcc-12 on powerpc are confirmed to work.
# https://github.com/NGSolve/ngsolve/issues/68
compiler.blacklist-append \
macports-gcc-13
# https://github.com/NGSolve/ngsolve/issues/69
compiler.blacklist-append \
{clang}
2020-02-01 05:33:49 -07:00
compilers.choose cc cxx
compilers.setup
# avoid conflict with atlas
2023-01-16 13:11:08 -07:00
# avoid adding -linterface to link flags
2024-01-04 06:01:59 +08:00
patchfiles-append patch-clapack.h.diff
post-extract {
2020-02-01 05:33:49 -07:00
move ${worksrcpath}/basiclinalg/clapack.h \
${worksrcpath}/basiclinalg/ng_clapack.h
}
2020-03-07 06:45:49 -07:00
# allow the use of other LAPACK libraries
patchfiles-append patch-find-lapack.diff
2020-02-01 05:33:49 -07:00
depends_lib-append port:SuiteSparse_AMD \
port:SuiteSparse_CCOLAMD \
port:SuiteSparse_CHOLMOD \
port:SuiteSparse_UMFPACK \
port:SuiteSparse_config \
2021-01-18 19:53:50 +11:00
path:include/turbojpeg.h:libjpeg-turbo \
2020-02-01 05:33:49 -07:00
port:netgen \
port:zlib
2020-02-01 05:33:49 -07:00
configure.args-append -DNETGEN_DIR=${prefix} \
-DBUILD_UMFPACK=NO \
2023-01-16 13:11:08 -07:00
-DUSE_NATIVE_ARCH=NO \
-DUSE_PYTHON=OFF \
-DUSE_SUPERBUILD=OFF
# avoid depends_lib-append port:bash
configure.args-append -DBASH=/bin/bash
2024-01-04 06:01:59 +08:00
if {[string match *gcc* ${configure.compiler}] && ${configure.build_arch} in [list arm i386 ppc]} {
# https://github.com/NGSolve/ngsolve/issues/67
configure.ldflags-append \
-latomic
}
2020-02-01 05:33:49 -07:00
veclibfort no
2018-11-24 11:25:25 -07:00
pre-configure {
configure.args-append ${cmake_linalglib}
}
2025-11-13 10:09:01 -05:00
set pythonversions {3.10 3.11}
set any_python no
foreach pdv ${pythonversions} {
set pv [join [lrange [split ${pdv} .] 0 1] ""]
set conflist ""
foreach v ${pythonversions} {
if {${v} ne ${pdv}} {
set vv [join [lrange [split ${v} .] 0 1] ""]
set conflist "${conflist} python${vv}"
}
}
variant python${pv} conflicts {*}${conflist} description "Add bindings for Python ${pdv}" {}
if {[variant_isset python${pv}]} {
set any_python yes
}
}
if {!${any_python}} {
2023-01-16 13:11:08 -07:00
default_variants +python311
}
set any_python no
foreach pdv ${pythonversions} {
set pv [join [lrange [split ${pdv} .] 0 1] ""]
if {[variant_isset python${pv}]} {
depends_lib-append port:python${pv}
depends_build-append port:pybind11 \
port:py${pv}-pybind11-stubgen
2023-01-16 13:11:08 -07:00
configure.args-replace -DUSE_PYTHON=OFF \
-DUSE_PYTHON=ON
2021-04-23 06:00:03 -07:00
2023-01-16 13:11:08 -07:00
# for reasons that are not entirely clear, stub files break the build
# see https://ngsolve.org/forum/ngspy-forum/1655-ngsolve-stubs-cmake-error
configure.args-append -DBUILD_STUB_FILES=OFF
destroot.args-append DYLD_LIBRARY_PATH=${destroot}${prefix}/lib \
PYTHONPATH=${destroot}${prefix}/lib/python${pdv}/site-packages
set any_python yes
require_active_variants netgen python${pv}
post-destroot {
xinstall -d -m 0755 \
2023-01-16 13:11:08 -07:00
${destroot}${frameworks_dir}/Python.framework/Versions/${pdv}/lib
move ${destroot}${prefix}/lib/python${pdv} \
${destroot}${frameworks_dir}/Python.framework/Versions/${pdv}/lib
}
2023-01-16 13:09:43 -07:00
break
}
}
if {!${any_python}} {
foreach pdv ${pythonversions} {
set pv [join [lrange [split ${pdv} .] 0 1] ""]
require_active_variants netgen "" python${pv}
}
}
post-destroot {
delete ${destroot}${prefix}/Netgen.icns
2023-01-16 13:11:08 -07:00
if {[file exists ${destroot}${prefix}/bin/pde_tester]} {
# if no Python variant exists, extra binary is installed
delete ${destroot}${prefix}/bin/pde_tester
}
}
2023-01-16 13:09:43 -07:00
variant tests description {Enable tests} {
test.run yes
configure.args-append -DENABLE_UNIT_TESTS=ON
test.args-append DYLD_LIBRARY_PATH=${cmake.build_dir}/solve:${cmake.build_dir}/comp:${cmake.build_dir}/fem:${cmake.build_dir}/linalg:${cmake.build_dir}/basiclinalg:${cmake.build_dir}/ngstd
if {${any_python}} {
# tests fail
# see https://github.com/NGSolve/netgen/issues/77
# this is not good, but it is unclear what PYTHONPATH should be if destroot has not run
target_requires ${org.macports.test} main fetch checksum extract patch configure build destroot
test.args-append PYTHONPATH=${destroot}${frameworks_dir}/Python.framework/Versions/${pdv}/lib/python${pdv}/site-packages
}
}