diff --git a/science/cantera/Makefile b/science/cantera/Makefile index 8afdca022e34..fecbcdeaf46b 100644 --- a/science/cantera/Makefile +++ b/science/cantera/Makefile @@ -1,77 +1,80 @@ PORTNAME= cantera DISTVERSIONPREFIX= v DISTVERSION= 2.6.0 CATEGORIES= science # chemistry physics MAINTAINER= yuri@FreeBSD.org COMMENT= Chemical kinetics, thermodynamics, and transport tool suite LICENSE= BSD3CLAUSE LICENSE_FILE= ${WRKSRC}/License.txt BUILD_DEPENDS= googletest>0:devel/googletest \ ${LOCALBASE}/include/boost/algorithm/string.hpp:devel/boost-libs LIB_DEPENDS= libfmt.so:devel/libfmt \ libyaml-cpp.so:devel/yaml-cpp USES= compiler:c++11-lang eigen:3 scons USE_LDCONFIG= yes USE_GITHUB= yes GH_ACCOUNT= Cantera GH_TUPLE= LLNL:sundials:887af43:sundials/ext/sundials # bundled sundials is only needed for the Octave option MAKE_ARGS= system_eigen='y' \ system_sundials='n' \ system_fmt='y' \ system_yamlcpp='y' \ googletest='system' \ sundials_include='${LOCALBASE}/include/sundials' \ extra_inc_dirs="${LOCALBASE}/include:${LOCALBASE}/include/eigen3" \ extra_lib_dirs="${LOCALBASE}/lib" \ debug='no' \ cc_flags="${CXXFLAGS}" \ prefix="${PREFIX}" ALL_TARGET= build TEST_TARGET= test # some tests fail, see https://github.com/Cantera/cantera/issues/1095 OPTIONS_DEFINE= OCTAVE PYTHON OPTIONS_DEFAULT= # PYTHON is broken; OCTAVE is off by default because Octave interface is not as frequently requested feature OPTIONS_SUB= yes OCTAVE_DESC= Octave support OCTAVE_MAKE_ARGS= matlab_toolbox=y matlab_path=${LOCALBASE} -OCTAVE_CXXFLAGS= -I${LOCALBASE}/include/octave-6.4.0/octave +OCTAVE_CXXFLAGS= -I${LOCALBASE}/include/octave-${OCTAVE_VERSION}/octave OCTAVE_LIB_DEPENDS= liboctave.so:math/octave OCTAVE_SUB_FILES= pkg-message-octave -OCTAVE_BROKEN= Path set for 'matlab_path' is not correct. (https://github.com/Cantera/cantera/issues/1270) +.include "../../math/octave/Makefile.version" # for OCTAVE_VERSION PYTHON_USES= python:3.6+ PYTHON_USE= PYTHON=cython PYTHON_MAKE_ARGS= python_cmd=${PYTHON_CMD} python_package=full PYTHON_MAKE_ARGS_OFF= python_package="none" PYTHON_BUILD_DEPENDS= ${PYNUMPY} PYTHON_RUN_DEPENDS= ${PYNUMPY} \ ${PYTHON_PKGNAMEPREFIX}h5py>0:science/py-h5py@${PY_FLAVOR} \ ${PYTHON_PKGNAMEPREFIX}matplotlib>0:math/py-matplotlib@${PY_FLAVOR} \ ${PYTHON_PKGNAMEPREFIX}pandas>0:math/py-pandas@${PY_FLAVOR} \ ${PYTHON_PKGNAMEPREFIX}ruamel.yaml>0:devel/py-ruamel.yaml@${PY_FLAVOR} \ ${PYTHON_PKGNAMEPREFIX}scipy>0:science/py-scipy@${PY_FLAVOR} PYTHON_BROKEN= https://github.com/Cantera/cantera/issues/1269 do-install: cd ${WRKSRC} && \ ${MAKE_CMD} install \ stage_dir="${STAGEDIR}" @${STRIP_CMD} ${STAGEDIR}${PREFIX}/lib/libcantera_shared.so.2.6.0 do-install-PYTHON-on: @${STRIP_CMD} ${STAGEDIR}${PYTHON_SITELIBDIR}/cantera/_cantera.cpython-${PYTHON_VER:S/.//}.so +post-patch-OCTAVE-on: # adjust Octave version in SConscript (python styled os.environ['OCTAVE_VERSION'] somehow doesn't work for this) + @${REINPLACE_CMD} -e "s|, 'bin', 'glnx.*')|, 'lib', 'octave', '${OCTAVE_VERSION}')|" ${WRKSRC}/src/matlab/SConscript + post-install-OCTAVE-on: # adjust .mex file name @${MV} \ ${STAGEDIR}${PREFIX}/lib/cantera/matlab/toolbox/ctmethods.mexa64 \ ${STAGEDIR}${PREFIX}/lib/cantera/matlab/toolbox/ctmethods.mex .include diff --git a/science/cantera/files/patch-SConstruct b/science/cantera/files/patch-SConstruct index 0a31558a42b2..de5294d25f39 100644 --- a/science/cantera/files/patch-SConstruct +++ b/science/cantera/files/patch-SConstruct @@ -1,27 +1,44 @@ --- SConstruct.orig 2022-05-01 15:31:54 UTC +++ SConstruct @@ -805,6 +805,9 @@ elif "icx" in env.subst("$CC"): elif "clang" in env.subst("$CC"): config.select("clang") +elif "cc" in env.subst("$CC"): + config.select("clang") + else: print(f"WARNING: Unrecognized C compiler '{env['CC']}'") @@ -869,10 +872,10 @@ if "sdist" in COMMAND_LINE_TARGETS: logger.info("'sdist' target was specified. Setting 'use_pch' to False.") env["use_pch"] = False -for arg in ARGUMENTS: - if arg not in config: - logger.error(f"Encountered unexpected command line option: '{arg}'") - sys.exit(1) +#for arg in ARGUMENTS: +# if arg not in config: +# logger.error(f"Encountered unexpected command line option: '{arg}'") +# sys.exit(1) env["cantera_version"] = "2.6.0" # For use where pre-release tags are not permitted (MSI, sonames) +@@ -1673,11 +1676,11 @@ if env["matlab_toolbox"] == "y": + "SUNDIALS libraries and skip building the Matlab toolbox.") + sys.exit(1) + +- if not (os.path.isdir(matlab_path) and +- os.path.isdir(pjoin(matlab_path, "extern"))): +- logger.error( +- f"Path set for 'matlab_path' is not correct. Path was '{matlab_path}'") +- sys.exit(1) ++ #if not (os.path.isdir(matlab_path) and ++ # os.path.isdir(pjoin(matlab_path, "extern"))): ++ # logger.error( ++ # f"Path set for 'matlab_path' is not correct. Path was '{matlab_path}'") ++ # sys.exit(1) + + + # ********************************************** diff --git a/science/cantera/files/patch-src_matlab_SConscript b/science/cantera/files/patch-src_matlab_SConscript index 69adee147fa9..300ee07c6df6 100644 --- a/science/cantera/files/patch-src_matlab_SConscript +++ b/science/cantera/files/patch-src_matlab_SConscript @@ -1,19 +1,11 @@ ---- src/matlab/SConscript.orig 2021-09-17 15:33:57 UTC +--- src/matlab/SConscript.orig 2022-05-01 15:31:54 UTC +++ src/matlab/SConscript -@@ -42,13 +42,13 @@ elif localenv['OS'] == 'Darwin': +@@ -42,7 +42,7 @@ elif localenv['OS'] == 'Darwin': elif os.name == 'posix': linklibs = list(env['cantera_libs']) - linklibs += ['mx', 'mex', 'mat'] + env['LIBM'] + linklibs += ['octave', 'octinterp'] + env['LIBM'] if localenv['OS_BITS'] == 64: -- matlab_libs = pjoin(localenv['matlab_path'], 'bin', 'glnxa64') -+ matlab_libs = pjoin(localenv['matlab_path'], 'lib', 'octave', '6.4.0') - mexSuffix = '.mexa64' - else: -- matlab_libs = pjoin(localenv['matlab_path'], 'bin', 'glnx86') -+ matlab_libs = pjoin(localenv['matlab_path'], 'lib', 'octave', '6.4.0') - mexSuffix = '.mexglx' - - linkflags.extend(['-Wl,--no-undefined', + matlab_libs = pjoin(localenv['matlab_path'], 'bin', 'glnxa64')