# -*- 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 cmake 1.1 PortGroup compiler_blacklist_versions 1.0 PortGroup compilers 1.0 PortGroup github 1.0 PortGroup legacysupport 1.1 PortGroup linear_algebra 1.0 # _strnlen, getline legacysupport.newest_darwin_requires_legacy 10 # Remember to keep qt4 as a fallback until qt5 is available on old systems. github.setup ElmerCSC elmerfem d43454ba4d468084421073dbcc24fc4ff63092c3 version 2024.04.03 revision 0 categories science license GPL-2 maintainers {@barracuda156 gmail.com:vital.had} openmaintainer description Elmer is a tool that can solve a large number of partial differential equations long_description {*}${description} making it an ideal tool for multiphysical problems. \ It includes models for structural mechanics, fluid dynamics, heat transfer, \ electromagnetics and beyond. Elmer can also be used on massively parallel HPC platforms. homepage https://www.elmerfem.org checksums rmd160 39e4fb5b23a26a5dfa0d8ef33a93fc0632944e57 \ sha256 53f11eae67b8c705a4323df3a249a4f8a6267f927debcff3bb6a2fc8e74d2486 \ size 72854303 github.tarball_from archive compilers.choose fc f90 compilers.setup require_fortran compiler.blacklist-append \ {*gcc-[34].*} {macports-gcc-[56]} {clang < 500} if {${os.platform} eq "darwin" && ${os.major} > 9} { # CMakeLists check for a version of CXX compiler, assuming a coherent build with GCC. # However since Macports uses Clangs on x86, the check does not do what was intended. # Just remove it for all systems with a default GCC > 9, i.e. everything but 10.4 and 10.5, # so that the needed Fortran flag is actually used. patchfiles-append \ patch-fix-gfortran-with-clang.diff } post-patch { reinplace "s,@CC@,${configure.cc}," ${worksrcpath}/CMakeLists.txt reinplace "s,@CXX@,${configure.cxx}," ${worksrcpath}/CMakeLists.txt reinplace "s,@FC@,${configure.fc}," ${worksrcpath}/CMakeLists.txt reinplace "s,CMAKE_SYSTEM_PROCESSOR,CMAKE_OSX_ARCHITECTURES,g" ${worksrcpath}/cpack/ElmerCPack.cmake } # See: https://trac.macports.org/ticket/67502 configure.pre_args-delete \ -DCMAKE_INSTALL_NAME_DIR="${cmake.install_prefix}/lib" pre-configure { if {[variant_isset openblas]} { configure.args-append \ -DBLAS_LIBRARIES=${prefix}/lib/libopenblas.dylib \ -DLAPACK_LIBRARIES=${prefix}/lib/libopenblas.dylib } elseif {[variant_isset accelerate]} { configure.args-append \ -DBLAS_LIBRARIES="-framework Accelerate" \ -DLAPACK_LIBRARIES="-framework Accelerate" } } set qt4_dir ${prefix}/libexec/qt4 if {${os.platform} eq "darwin" && ${os.major} < 13} { PortGroup qt4 1.0 configure.args-append \ -DQt4_LIBRARIES=${qt4_dir}/lib \ -DQWT_INCLUDE_DIR=${qt4_dir}/include/qwt \ -DQWT_LIBRARY=${qt4_dir}/lib/libqwt.dylib \ -DWITH_QT5=OFF depends_lib-append port:qwt61 } else { PortGroup qt5 1.0 qt5.depends_component qtscript qtsvg qttools configure.args-append \ -DQWT_INCLUDE_DIR=${qt_dir}/lib/qwt.framework/Versions/6/Headers \ -DQWT_LIBRARY=${qt_dir}/lib/qwt.framework/qwt \ -DWITH_QT5=ON depends_lib-append port:qwt-qt5 } # TODO: add variant to support MPICH, Hypre and Mumps. configure.args-append \ -DCMAKE_Fortran_COMPILER=${configure.fc} \ -DGLX_INCLUDE_DIR=${prefix}/include \ -DUSE_CONTIGUOUS=OFF \ -DWITH_CONTRIB=OFF \ -DWITH_ELMERGUI=ON \ -DWITH_ELMERGUITESTER=OFF \ -DWITH_ELMERGUILOGGER=ON \ -DWITH_ElmerIce=OFF \ -DWITH_ELMERPOST=OFF \ -DWITH_FETI4I=OFF \ -DWITH_Hypre=OFF \ -DWITH_LUA=OFF \ -DWITH_MKL=OFF \ -DWITH_MMG=OFF \ -DWITH_MPI=OFF \ -DWITH_Mumps=OFF \ -DWITH_NETCDF=OFF \ -DWITH_OCC=OFF \ -DWITH_OpenMP=OFF \ -DWITH_QWT=ON \ -DWITH_Trilinos=OFF \ -DWITH_XIOS=OFF \ -DWITH_Zoltan=OFF if {[string match macports-gcc* ${configure.compiler}]} { configure.args-replace \ -DWITH_OpenMP=OFF -DWITH_OpenMP=ON } if {[string match *clang* ${configure.compiler}]} { # Load.c: error: call to undeclared function 'var_copy_transpose'; ISO C99 and later do not support implicit function declarations configure.cflags-append \ -Wno-error=implicit-function-declaration } variant ice description "Enable ElmerIce with support for NetCDF and HDF5" { depends_lib-append \ port:hdf5 \ port:netcdf \ port:netcdf-fortran configure.args-replace \ -DWITH_ElmerIce=OFF -DWITH_ElmerIce=ON \ -DWITH_NETCDF=OFF -DWITH_NETCDF=ON }