From nobody Mon Dec 12 20:41:15 2022 X-Original-To: dev-commits-ports-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4NWD701C2fz4Y5f6; Mon, 12 Dec 2022 20:41:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4NWD700nJyz4Flv; Mon, 12 Dec 2022 20:41:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1670877676; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=WsG4rwHXE29Ed/Q1+fywxw9lPJCY1Yn96suspBUoz08=; b=aFTCBSM+NBRQ9PnrxAevQkxxhwR0GrL4NYPi/FX5vGxqUJrsRpzGrqvWpgxWnKw61+SIbb shpu3YP+HxkJaYTb293ue6WdOwFam5Fk4pkTj9mTTQ/YjK6VVaLikn4p84B8vzwNkTx25R OmREpFV0zHyjIs6TQXJ4MxAqnClNMrau9ok0Or1ZJJ1oQOCHNYhfRc0OxcZQREsH4e6+n1 toBB+aIinYRVwwNMdrSGRmQxUqcE850wSd6VQLC9QxfedmOPAAcGgrEWsTYo5m23ogWgaH PqiLeRWU4Ayq1ZDOmByq+imSu5MIDy3+VrDrRKxaRlr8Z+SAQBvDMfTjSAzaPw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1670877676; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=WsG4rwHXE29Ed/Q1+fywxw9lPJCY1Yn96suspBUoz08=; b=VxXWTKxqZmbkqGRD1KkkQGP9TenfIWHxOl28r5Thi9cTp0ApCEEPNER9QoGy5lk3kL/lkS q1fOkF65Lf+etbuFZwjaBAoNPWs06GXiHu25+uuwx18l02uRdHAWNnUIhapse1roUXpkqC Hw4tSlRbmF8qTTCmQqN9OOEGHCWq8wBlU6tb8BtIUoO75DHbj8OlYDd2ZYVvwZNdcahD9T 36TT7qne7EdXnaFe+YDK5JYLEfw3j0Ik8qXribjuO6NmujhMU/gWQLN3G94MHUEk8mAMEZ w3Wzn8cufJbuzpvGVdeR34epdf0nqXGvJvHQMD2qHFX4FsJn97OTPARi9Nyx3w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1670877676; a=rsa-sha256; cv=none; b=k8e9haNZXMDaCzmDnQL/kqInTKxOTY+lyHT90kkX6r0SDhY/gg+89dRJS0IZxvb74Op/PK XJe3hpD7g3zXbQnl9rNFN+zWYP+oSRgOwVD9LQXsIkrPaFruol5AYEXwkn0P9pfie3N1V5 zcSRuk0KqQlzc3y0EagfCwDnxXqna4JKjxGnbIomgWsVn8OVqmGAlnpWG9USBy8Opu6nLW j41MMVo21lmfg9gVEf3LLz3FXn+HeF1bpbdmsX512CMFIWtUPvdOXTc7Tre8/2lDBcUNmr OMjM3hYF76x9zfZwUG1KyG5B5HEPa3Ns7yOQeUCx5bCxDtzh6xG03EjAValnNg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4NWD6z6sQczncD; Mon, 12 Dec 2022 20:41:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 2BCKfFHo096694; Mon, 12 Dec 2022 20:41:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 2BCKfFIF096693; Mon, 12 Dec 2022 20:41:15 GMT (envelope-from git) Date: Mon, 12 Dec 2022 20:41:15 GMT Message-Id: <202212122041.2BCKfFIF096693@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Yuri Victorovich Subject: git: a51acec18b0e - main - science/openmodelica: New port: Modelica-based modeling and simulation environment List-Id: Commit messages for all branches of the ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-ports-all@freebsd.org X-BeenThere: dev-commits-ports-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: yuri X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a51acec18b0e393659f8d346b37fb75b43f3c31b Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by yuri: URL: https://cgit.FreeBSD.org/ports/commit/?id=a51acec18b0e393659f8d346b37fb75b43f3c31b commit a51acec18b0e393659f8d346b37fb75b43f3c31b Author: Yuri Victorovich AuthorDate: 2022-12-12 15:44:12 +0000 Commit: Yuri Victorovich CommitDate: 2022-12-12 20:41:12 +0000 science/openmodelica: New port: Modelica-based modeling and simulation environment --- science/Makefile | 1 + science/openmodelica/Makefile | 111 ++ science/openmodelica/distinfo | 23 + science/openmodelica/files/example-hello-world.mo | 5 + .../files/example-second-order-system.mo | 30 + science/openmodelica/files/gcc.sh | 3 + ...MIL_ThirdParty_Expat_expat-2.1.0_CMakeLists.txt | 10 + ...ty_Ipopt-3.13.4_ThirdParty_MUMPS_CMakeLists.txt | 11 + .../patch-OMCompiler_Compiler_boot_CMakeLists.txt | 13 + ...atch-OMCompiler_Compiler_runtime_CMakeLists.txt | 15 + ...atch-OMCompiler_Compiler_runtime_settingsimpl.c | 20 + .../patch-OMCompiler_Compiler_runtime_systemimpl.c | 21 + ...OMEditLIB_Simulation_SimulationOutputWidget.cpp | 13 + .../patch-OMEdit_OMEditLIB_Util_Utilities.cpp | 11 + ...ch-OMSimulator_OMTLMSimulator_3rdParty_Makefile | 11 + .../patch-OMSimulator_OMTLMSimulator_Makefile.head | 15 + ...LMSimulator_common_Communication_TLMCommUtil.cc | 11 + ...atch-OMSimulator_OMTLMSimulator_common_Makefile | 24 + science/openmodelica/pkg-descr | 7 + science/openmodelica/pkg-message | 16 + science/openmodelica/pkg-plist | 1105 ++++++++++++++++++++ 21 files changed, 1476 insertions(+) diff --git a/science/Makefile b/science/Makefile index 66c51566ca33..60c62f11692a 100644 --- a/science/Makefile +++ b/science/Makefile @@ -218,6 +218,7 @@ SUBDIR += openems SUBDIR += openkim-models SUBDIR += openmc + SUBDIR += openmodelica SUBDIR += openmolcas SUBDIR += openmx SUBDIR += opensim-core diff --git a/science/openmodelica/Makefile b/science/openmodelica/Makefile new file mode 100644 index 000000000000..f04c2a539bab --- /dev/null +++ b/science/openmodelica/Makefile @@ -0,0 +1,111 @@ +PORTNAME= openmodelica +DISTVERSIONPREFIX= v +DISTVERSION= 1.20.0 +CATEGORIES= science cad java +MASTER_SITES= https://build.openmodelica.org/omc/bootstrap/:bootstrap +DISTFILES= sources.tar.gz:bootstrap +DIST_SUBDIR= ${PORTNAME}-${PORTVERSION} + +MAINTAINER= yuri@FreeBSD.org +COMMENT= Modelica-based modeling and simulation environment +WWW= https://openmodelica.org/ + +LICENSE= OSMC-PL +LICENSE_NAME= Public license for OpenModelica +LICENSE_TEXT= See https://github.com/OpenModelica/OpenModelica/blob/master/OSMC-License.txt +LICENSE_PERMS= auto-accept dist-mirror dist-sell pkg-mirror pkg-sell + +BUILD_DEPENDS= asciidoc:textproc/asciidoc \ + autoconf>0:devel/autoconf \ + automake:devel/automake \ + gmake:devel/gmake \ + libtool>0:devel/libtool \ + ${LOCALBASE}/include/readline/readline.h:devel/readline +LIB_DEPENDS= \ + libboost_filesystem.so:devel/boost-libs \ + libcurl.so:ftp/curl \ + libosg.so:graphics/osg \ + libuuid.so:misc/e2fsprogs-libuuid +RUN_DEPENDS= bash:shells/bash \ + gmake:devel/gmake + +USES= cmake compiler:c++14-lang dos2unix iconv fortran gettext-runtime gl gnome blaslapack localbase:ldflags qt:5 pkgconfig python:build shebangfix +USE_QT= concurrent core gui network opengl printsupport svg webkit widgets xml xmlpatterns buildtools:build qmake:build +USE_GL= gl opengl +USE_GNOME= libxml2 +USE_JAVA= yes +USE_LDCONFIG= ${PREFIX}/lib/omc ${PREFIX}/lib/omc/OMSimulator ${PREFIX}/lib/omc/cpp ${PREFIX}/lib/omc/ffi # https://github.com/OpenModelica/OpenModelica/issues/9925 + +USE_GITHUB= yes +GH_ACCOUNT= OpenModelica +GH_PROJECT= OpenModelica + +DOS2UNIX_FILES= OMSimulator/OMTLMSimulator/3rdParty/Makefile \ + OMCompiler/3rdParty/FMIL/ThirdParty/Expat/expat-2.1.0/CMakeLists.txt + +SHEBANG_GLOB= *.sh *.in *.ac +SHEBANG_FILES= OMSimulator/OMTLMSimulator/OMFMISimulatorWrapper/StartTLMOMFMISimulatorWrapper \ + OMSimulator/OMTLMSimulator/Hopsan/StartTLMHopsan \ + OMSimulator/testsuite/tlm/StartTLMFmiWrapper \ + OMSimulator/OMTLMSimulator/FMIWrapper/StartTLMFmiWrapper \ + OMSimulator/OMTLMSimulator/OpenModelica/StartTLMOpenModelica + +GH_TUPLE= \ + OpenModelica:OMOptim:4116ef7:OMOptim/OMOptim \ + OpenModelica:OpenModelica-common:08a0180:OMOptim_common/OMOptim/common \ + OpenModelica:OMSimulator:af996ad:OMSimulator/OMSimulator \ + OpenModelica:OMSimulator-3rdParty:6202ca1:OMSimulator_3rdParty/OMSimulator/3rdParty \ + OpenModelica:OMTLMSimulator:07d5353:OMSimulator_OMTLMSimulator/OMSimulator/OMTLMSimulator \ + OpenModelica:OMCompiler-3rdParty:a60ba6c:OMCompiler_3rdParty/OMCompiler/3rdParty \ + OpenModelica:OMSens:66b920b:OMSens/OMSens \ + OpenModelica:OMSens_Qt:ef85128:OMSens_Qt/OMSens_Qt \ + OpenModelica:OpenModelica-common:08a0180:OMSens_Qt_common/OMSens_Qt/common + +# this should change make program everywhere, but it doesn't, +# hence the patches in OMCompiler/Compiler/runtime/CMakeLists.txt, OMEdit/OMEditLIB/Simulation/SimulationOutputWidget.cpp +CMAKE_ARGS= -DCMAKE_MAKE_PROGRAM=gmake \ + -DPython_EXECUTABLE=${PYTHON_CMD} + +LDFLAGS+= -lexecinfo -lintl -pthread + +BINARY_ALIAS= make=${GMAKE} gcc=${FILESDIR}/gcc.sh git=false + +CONFLICTS_BUILD= sundials + +post-extract: + # remove stray *.orig files + @${FIND} ${WRKSRC} -name "*.orig" -delete + # remove rtime that isn't used on FreeBSD + @${RM} -r ${WRKSRC}/OMSimulator/OMTLMSimulator/3rdParty/rtime + # create symlink for sources.tar.gz + @${MKDIR} ${WRKSRC}/OMCompiler/Compiler/boot/bomc + @${LN} -s ${DISTDIR}/${DIST_SUBDIR}/sources.tar.gz ${WRKSRC}/OMCompiler/Compiler/boot/bomc/sources.tar.gz + +post-patch: + # fix bash shebangs + @${REINPLACE_CMD} -e 's|#!/bin/bash|#!${LOCALBASE}/bin/bash|' \ + ${WRKSRC}/OMCompiler/Examples/GenerateDoc.mos \ + ${WRKSRC}/OMCompiler/3rdParty/tbb/build/generate_tbbvars.sh + # add path to libgfortran to link flags for OM internal builds + @${REINPLACE_CMD} \ + -e 's|@RT_LDFLAGS_GENERATED_CODE_SIM@|& -L${LOCALBASE}/lib/gcc${FC:S/gfortran//}|' \ + ${WRKSRC}/OMCompiler/Compiler/Util/Autoconf.mo.in + +post-install: + # workaround for https://github.com/OpenModelica/OpenModelica/issues/9919 + cd ${STAGEDIR}${PREFIX} && ${CHMOD} +x \ + bin/OMSimulator bin/OMSimulatorPython3 bin/StartTLMFmiWrapper + # remove unnecessary files + ${RM} -r \ + ${STAGEDIR}${PREFIX}/share/zmq \ + ${STAGEDIR}${PREFIX}/doc \ + ${STAGEDIR}${PREFIX}/share/doc + # remove empty directories + ${FIND} ${STAGEDIR}${PREFIX}/include -type d -empty -delete + # strip binaries + cd ${STAGEDIR}${PREFIX} && ${STRIP_CMD} \ + bin/OMSimulator bin/FMIWrapper \ + lib/omc/OMSimulator/libomtlmsimulator.so lib/omc/OMSimulator/libOMSimulator.so \ + lib/omc/libomtlmsimulator.so lib/omc/libOMSimulator.so + +.include diff --git a/science/openmodelica/distinfo b/science/openmodelica/distinfo new file mode 100644 index 000000000000..d80c68babd09 --- /dev/null +++ b/science/openmodelica/distinfo @@ -0,0 +1,23 @@ +TIMESTAMP = 1670827690 +SHA256 (openmodelica-1.20.0/sources.tar.gz) = d41b20ccb9395189fa1edd6dd86ae09023571876f2504904366a91d3491a8c19 +SIZE (openmodelica-1.20.0/sources.tar.gz) = 3322762 +SHA256 (openmodelica-1.20.0/OpenModelica-OpenModelica-v1.20.0_GH0.tar.gz) = 0b04923cc4d0b5d9e29679864a1d1b8e6ec8ecd7f456779dfe5212886f644f5c +SIZE (openmodelica-1.20.0/OpenModelica-OpenModelica-v1.20.0_GH0.tar.gz) = 92236817 +SHA256 (openmodelica-1.20.0/OpenModelica-OMOptim-4116ef7_GH0.tar.gz) = 6562015ccf8c8042fe7a8b881bdd3d4237dea4b6d4ed95e1eadeb5338521a911 +SIZE (openmodelica-1.20.0/OpenModelica-OMOptim-4116ef7_GH0.tar.gz) = 4021972 +SHA256 (openmodelica-1.20.0/OpenModelica-OpenModelica-common-08a0180_GH0.tar.gz) = ef6045612777ede7cab882ca1bd665ba5c6d5ebfa4760be3bf797558d71fd9fe +SIZE (openmodelica-1.20.0/OpenModelica-OpenModelica-common-08a0180_GH0.tar.gz) = 36101 +SHA256 (openmodelica-1.20.0/OpenModelica-OMSimulator-af996ad_GH0.tar.gz) = ba33fed5de32e0957060caef6742048037f0f47cd90f6bb7630efb4ba0944740 +SIZE (openmodelica-1.20.0/OpenModelica-OMSimulator-af996ad_GH0.tar.gz) = 87888293 +SHA256 (openmodelica-1.20.0/OpenModelica-OMSimulator-3rdParty-6202ca1_GH0.tar.gz) = f1c7320dd8b8bf491a8fe24157e7b79a879740834422b418654f8ccea06f329f +SIZE (openmodelica-1.20.0/OpenModelica-OMSimulator-3rdParty-6202ca1_GH0.tar.gz) = 12841559 +SHA256 (openmodelica-1.20.0/OpenModelica-OMTLMSimulator-07d5353_GH0.tar.gz) = 0ae4867efb68e6452f55470c35f8b10ce4ff374a57204595225e0ac75f7acec3 +SIZE (openmodelica-1.20.0/OpenModelica-OMTLMSimulator-07d5353_GH0.tar.gz) = 45578453 +SHA256 (openmodelica-1.20.0/OpenModelica-OMCompiler-3rdParty-a60ba6c_GH0.tar.gz) = cca8f2516d8c4f84c5bf5199e1c7c9ff36165f6ed97f27c7679550178c9655a7 +SIZE (openmodelica-1.20.0/OpenModelica-OMCompiler-3rdParty-a60ba6c_GH0.tar.gz) = 41909764 +SHA256 (openmodelica-1.20.0/OpenModelica-OMSens-66b920b_GH0.tar.gz) = f0982350a9ea20a24e1be408fbadd9562373a29cbdecb8a9981a5562b24af73c +SIZE (openmodelica-1.20.0/OpenModelica-OMSens-66b920b_GH0.tar.gz) = 8870024 +SHA256 (openmodelica-1.20.0/OpenModelica-OMSens_Qt-ef85128_GH0.tar.gz) = a6db8a107098a1f2c999923e020a5f337485a00057771ac9407a8af373278493 +SIZE (openmodelica-1.20.0/OpenModelica-OMSens_Qt-ef85128_GH0.tar.gz) = 210584 +SHA256 (openmodelica-1.20.0/OpenModelica-OpenModelica-common-08a0180_GH0.tar.gz) = ef6045612777ede7cab882ca1bd665ba5c6d5ebfa4760be3bf797558d71fd9fe +SIZE (openmodelica-1.20.0/OpenModelica-OpenModelica-common-08a0180_GH0.tar.gz) = 36101 diff --git a/science/openmodelica/files/example-hello-world.mo b/science/openmodelica/files/example-hello-world.mo new file mode 100644 index 000000000000..05c71e79f69d --- /dev/null +++ b/science/openmodelica/files/example-hello-world.mo @@ -0,0 +1,5 @@ +class HelloWorld "A simple equation" + Real x(start=1); +equation + der(x)= -x; +end HelloWorld; diff --git a/science/openmodelica/files/example-second-order-system.mo b/science/openmodelica/files/example-second-order-system.mo new file mode 100644 index 000000000000..b90c4466d1f9 --- /dev/null +++ b/science/openmodelica/files/example-second-order-system.mo @@ -0,0 +1,30 @@ +model SecondOrderSystem "A second order rotational system" + type Angle=Real(unit="rad"); + type AngularVelocity=Real(unit="rad/s"); + type Inertia=Real(unit="kg.m2"); + type Stiffness=Real(unit="N.m/rad"); + type Damping=Real(unit="N.m.s/rad"); + parameter Inertia J1=0.4 "Moment of inertia for inertia 1"; + parameter Inertia J2=1.0 "Moment of inertia for inertia 2"; + parameter Stiffness c1=11 "Spring constant for spring 1"; + parameter Stiffness c2=5 "Spring constant for spring 2"; + parameter Damping d1=0.2 "Damping for damper 1"; + parameter Damping d2=1.0 "Damping for damper 2"; + Angle phi1 "Angle for inertia 1"; + Angle phi2 "Angle for inertia 2"; + AngularVelocity omega1 "Velocity of inertia 1"; + AngularVelocity omega2 "Velocity of inertia 2"; +initial equation + phi1 = 0; + phi2 = 1; + omega1 = 0; + omega2 = 0; +equation + // Equations for inertia 1 + omega1 = der(phi1); + J1*der(omega1) = c1*(phi2-phi1)+d1*der(phi2-phi1); + // Equations for inertia 2 + omega2 = der(phi2); + J2*der(omega2) = c1*(phi1-phi2)+d1*der(phi1-phi2)-c2*phi2-d2*der(phi2); +end SecondOrderSystem; + diff --git a/science/openmodelica/files/gcc.sh b/science/openmodelica/files/gcc.sh new file mode 100755 index 000000000000..c9ce337f84fd --- /dev/null +++ b/science/openmodelica/files/gcc.sh @@ -0,0 +1,3 @@ +#!/bin/sh + +/usr/bin/cc "$@" -I/usr/local/include -L/usr/local/lib diff --git a/science/openmodelica/files/patch-OMCompiler_3rdParty_FMIL_ThirdParty_Expat_expat-2.1.0_CMakeLists.txt b/science/openmodelica/files/patch-OMCompiler_3rdParty_FMIL_ThirdParty_Expat_expat-2.1.0_CMakeLists.txt new file mode 100644 index 000000000000..ca01e0fea225 --- /dev/null +++ b/science/openmodelica/files/patch-OMCompiler_3rdParty_FMIL_ThirdParty_Expat_expat-2.1.0_CMakeLists.txt @@ -0,0 +1,10 @@ +--- OMCompiler/3rdParty/FMIL/ThirdParty/Expat/expat-2.1.0/CMakeLists.txt.orig 2022-12-10 10:46:09 UTC ++++ OMCompiler/3rdParty/FMIL/ThirdParty/Expat/expat-2.1.0/CMakeLists.txt +@@ -62,6 +62,7 @@ else(BUILD_shared) + endif(BUILD_shared) + + add_library(expat ${_SHARED} ${expat_SRCS}) ++target_include_directories(expat PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/lib) + + if(NOT BUILD_shared) + target_compile_definitions(expat PUBLIC XML_STATIC) diff --git a/science/openmodelica/files/patch-OMCompiler_3rdParty_Ipopt-3.13.4_ThirdParty_MUMPS_CMakeLists.txt b/science/openmodelica/files/patch-OMCompiler_3rdParty_Ipopt-3.13.4_ThirdParty_MUMPS_CMakeLists.txt new file mode 100644 index 000000000000..4bc9b79ee2e1 --- /dev/null +++ b/science/openmodelica/files/patch-OMCompiler_3rdParty_Ipopt-3.13.4_ThirdParty_MUMPS_CMakeLists.txt @@ -0,0 +1,11 @@ +--- OMCompiler/3rdParty/Ipopt-3.13.4/ThirdParty/MUMPS/CMakeLists.txt.orig 2022-12-09 19:22:30 UTC ++++ OMCompiler/3rdParty/Ipopt-3.13.4/ThirdParty/MUMPS/CMakeLists.txt +@@ -143,7 +143,7 @@ endif () + target_link_libraries(coinmumps PUBLIC ${LAPACK_LIBRARIES}) + + if(THREADS_HAVE_PTHREAD_ARG) +- target_compile_options(coinmumps PUBLIC pthread) ++ target_compile_options(coinmumps PUBLIC ${CMAKE_THREAD_LIBS_INIT}) + endif() + if(CMAKE_THREAD_LIBS_INIT) + target_link_libraries(coinmumps PUBLIC ${CMAKE_THREAD_LIBS_INIT}) diff --git a/science/openmodelica/files/patch-OMCompiler_Compiler_boot_CMakeLists.txt b/science/openmodelica/files/patch-OMCompiler_Compiler_boot_CMakeLists.txt new file mode 100644 index 000000000000..3ceec5fe1769 --- /dev/null +++ b/science/openmodelica/files/patch-OMCompiler_Compiler_boot_CMakeLists.txt @@ -0,0 +1,13 @@ +--- OMCompiler/Compiler/boot/CMakeLists.txt.orig 2022-12-12 07:29:42 UTC ++++ OMCompiler/Compiler/boot/CMakeLists.txt +@@ -9,9 +9,9 @@ else() + file(MAKE_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/bomc/) + file(DOWNLOAD https://build.openmodelica.org/omc/bootstrap/sources.tar.gz + ${CMAKE_CURRENT_SOURCE_DIR}/bomc/sources.tar.gz SHOW_PROGRESS) ++endif() + execute_process(COMMAND tar xzf sources.tar.gz + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/bomc/) +-endif() + + # OpenModelicaBootstrappingHeader.h should probably be added to source control and + # updated just like the bootstrap-source c files. diff --git a/science/openmodelica/files/patch-OMCompiler_Compiler_runtime_CMakeLists.txt b/science/openmodelica/files/patch-OMCompiler_Compiler_runtime_CMakeLists.txt new file mode 100644 index 000000000000..5ea89f69a1c1 --- /dev/null +++ b/science/openmodelica/files/patch-OMCompiler_Compiler_runtime_CMakeLists.txt @@ -0,0 +1,15 @@ +--- OMCompiler/Compiler/runtime/CMakeLists.txt.orig 2022-12-11 22:46:50 UTC ++++ OMCompiler/Compiler/runtime/CMakeLists.txt +@@ -242,7 +242,11 @@ endif() + if (MINGW) + set(OMC_MAKE_EXE "mingw32-make") + else() +- set(OMC_MAKE_EXE "make") ++ if(CMAKE_HOST_SYSTEM_NAME STREQUAL "FreeBSD") ++ set(OMC_MAKE_EXE "gmake") ++ else() ++ set(OMC_MAKE_EXE "make") ++ endif() + endif() + + set(OMC_CMAKE_EXE "${CMAKE_COMMAND}") diff --git a/science/openmodelica/files/patch-OMCompiler_Compiler_runtime_settingsimpl.c b/science/openmodelica/files/patch-OMCompiler_Compiler_runtime_settingsimpl.c new file mode 100644 index 000000000000..f00d516472ef --- /dev/null +++ b/science/openmodelica/files/patch-OMCompiler_Compiler_runtime_settingsimpl.c @@ -0,0 +1,20 @@ +--- OMCompiler/Compiler/runtime/settingsimpl.c.orig 2022-12-10 10:59:38 UTC ++++ OMCompiler/Compiler/runtime/settingsimpl.c +@@ -90,7 +90,7 @@ const char* SettingsImpl__getInstallationDirectoryPath + return path &&*path ? path : "OPENMODELICA_BOOTSTRAPPING_STAGE_NO_OPENMODELICAHOME"; + } + #else +-#if (defined(__linux__) || defined(__APPLE_CC__)) ++#if (defined(__linux__) || defined(__APPLE_CC__) || defined(__FreeBSD__)) + /* Helper function to strip /bin/... or /lib/... from the executable path of omc */ + static void stripbinpath(char *omhome) + { +@@ -112,7 +112,7 @@ static void stripbinpath(char *omhome) + #endif + + /* Do not free or modify the returned variable of getInstallationDirectoryPath. It's part of the environment! */ +-#if defined(__linux__) || defined(__APPLE_CC__) ++#if defined(__linux__) || defined(__APPLE_CC__) || defined(__FreeBSD__) + #include + + const char* SettingsImpl__getInstallationDirectoryPath(void) { diff --git a/science/openmodelica/files/patch-OMCompiler_Compiler_runtime_systemimpl.c b/science/openmodelica/files/patch-OMCompiler_Compiler_runtime_systemimpl.c new file mode 100644 index 000000000000..c54f136f2489 --- /dev/null +++ b/science/openmodelica/files/patch-OMCompiler_Compiler_runtime_systemimpl.c @@ -0,0 +1,21 @@ +- make it single-threaded as a workaround for https://github.com/OpenModelica/OpenModelica/issues/9922 + +--- OMCompiler/Compiler/runtime/systemimpl.c.orig 2022-12-11 20:16:40 UTC ++++ OMCompiler/Compiler/runtime/systemimpl.c +@@ -775,6 +775,7 @@ char* System_popen(threadData_t *threadData, const cha + + int System_numProcessors(void) + { ++#if 0 + #if WITH_HWLOC==1 + hwloc_topology_t topology; + if (0==hwloc_topology_init(&topology) && 0==hwloc_topology_load(topology)) { +@@ -793,6 +794,8 @@ int System_numProcessors(void) + #else + return intMax(sysconf(_SC_NPROCESSORS_ONLN), 1); + #endif ++#endif ++ return 1; + } + + struct systemCallWorkerThreadArgs { diff --git a/science/openmodelica/files/patch-OMEdit_OMEditLIB_Simulation_SimulationOutputWidget.cpp b/science/openmodelica/files/patch-OMEdit_OMEditLIB_Simulation_SimulationOutputWidget.cpp new file mode 100644 index 000000000000..a80b0dd09db8 --- /dev/null +++ b/science/openmodelica/files/patch-OMEdit_OMEditLIB_Simulation_SimulationOutputWidget.cpp @@ -0,0 +1,13 @@ +--- OMEdit/OMEditLIB/Simulation/SimulationOutputWidget.cpp.orig 2022-12-12 04:38:34 UTC ++++ OMEdit/OMEditLIB/Simulation/SimulationOutputWidget.cpp +@@ -577,8 +577,8 @@ void SimulationOutputWidget::compileModel() + args << "-j" + numProcs; + } + args << "-f" << mSimulationOptions.getOutputFileName() + ".makefile"; +- writeCompilationOutput(QString("%1 %2\n").arg("make").arg(args.join(" ")), Qt::blue); +- mpCompilationProcess->start("make", args); ++ writeCompilationOutput(QString("%1 %2\n").arg("gmake").arg(args.join(" ")), Qt::blue); ++ mpCompilationProcess->start("gmake", args); + #endif + } + diff --git a/science/openmodelica/files/patch-OMEdit_OMEditLIB_Util_Utilities.cpp b/science/openmodelica/files/patch-OMEdit_OMEditLIB_Util_Utilities.cpp new file mode 100644 index 000000000000..b90236c4886e --- /dev/null +++ b/science/openmodelica/files/patch-OMEdit_OMEditLIB_Util_Utilities.cpp @@ -0,0 +1,11 @@ +--- OMEdit/OMEditLIB/Util/Utilities.cpp.orig 2022-12-11 19:01:44 UTC ++++ OMEdit/OMEditLIB/Util/Utilities.cpp +@@ -1012,7 +1012,7 @@ QIcon Utilities::FileIconProvider::FileIconProviderImp + // Get icon from OS. + QIcon icon; + // File icons are unknown on linux systems. +-#if defined(Q_OS_LINUX) ++#if defined(Q_OS_UNIX) + icon = isDir ? QFileIconProvider::icon(fileInfo) : mUnknownFileIcon; + #else + icon = QFileIconProvider::icon(fileInfo); diff --git a/science/openmodelica/files/patch-OMSimulator_OMTLMSimulator_3rdParty_Makefile b/science/openmodelica/files/patch-OMSimulator_OMTLMSimulator_3rdParty_Makefile new file mode 100644 index 000000000000..42b3257f4054 --- /dev/null +++ b/science/openmodelica/files/patch-OMSimulator_OMTLMSimulator_3rdParty_Makefile @@ -0,0 +1,11 @@ +--- OMSimulator/OMTLMSimulator/3rdParty/Makefile.orig 2022-12-11 02:57:08 UTC ++++ OMSimulator/OMTLMSimulator/3rdParty/Makefile +@@ -8,7 +8,7 @@ ifeq ($(detected_OS),Darwin) + #Dont build rtime on Mac + buildlibs=misc/src + else +- buildlibs=misc/src rtime ++ buildlibs=misc/src + endif + else + # This is for BEAST diff --git a/science/openmodelica/files/patch-OMSimulator_OMTLMSimulator_Makefile.head b/science/openmodelica/files/patch-OMSimulator_OMTLMSimulator_Makefile.head new file mode 100644 index 000000000000..3449b2493dad --- /dev/null +++ b/science/openmodelica/files/patch-OMSimulator_OMTLMSimulator_Makefile.head @@ -0,0 +1,15 @@ +--- OMSimulator/OMTLMSimulator/Makefile.head.orig 2022-12-11 03:25:38 UTC ++++ OMSimulator/OMTLMSimulator/Makefile.head +@@ -100,7 +100,12 @@ ifeq ($(detected_OS),Darwin) + EXTRAFLAGS += -DNO_RTIME + RTIMELIB = + else ++ifeq ($(detected_OS),FreeBSD) ++EXTRAFLAGS += -DNO_RTIME ++RTIMELIB = ++else + RTIMELIB = -lrtime ++endif + endif + + override CC += $(CFLAGS) $(EXTRAFLAGS) diff --git a/science/openmodelica/files/patch-OMSimulator_OMTLMSimulator_common_Communication_TLMCommUtil.cc b/science/openmodelica/files/patch-OMSimulator_OMTLMSimulator_common_Communication_TLMCommUtil.cc new file mode 100644 index 000000000000..3c92ea110570 --- /dev/null +++ b/science/openmodelica/files/patch-OMSimulator_OMTLMSimulator_common_Communication_TLMCommUtil.cc @@ -0,0 +1,11 @@ +--- OMSimulator/OMTLMSimulator/common/Communication/TLMCommUtil.cc.orig 2022-12-11 03:21:23 UTC ++++ OMSimulator/OMTLMSimulator/common/Communication/TLMCommUtil.cc +@@ -42,7 +42,7 @@ void TLMCommUtil::SendMessage(TLMMessage& mess) { + TLMCommUtil::ByteSwap(&mess.Header.TLMInterfaceID, sizeof(mess.Header.TLMInterfaceID)); + } + +-#if defined( WIN32) || defined(__APPLE__) ++#if defined( WIN32) || defined(__APPLE__) || defined(__FreeBSD__) + const int MSG_MORE = 0; + #endif + diff --git a/science/openmodelica/files/patch-OMSimulator_OMTLMSimulator_common_Makefile b/science/openmodelica/files/patch-OMSimulator_OMTLMSimulator_common_Makefile new file mode 100644 index 000000000000..0d4c1a538ad5 --- /dev/null +++ b/science/openmodelica/files/patch-OMSimulator_OMTLMSimulator_common_Makefile @@ -0,0 +1,24 @@ +--- OMSimulator/OMTLMSimulator/common/Makefile.orig 2022-12-11 03:01:49 UTC ++++ OMSimulator/OMTLMSimulator/common/Makefile +@@ -13,7 +13,7 @@ endif + include $(MAKEFILEHEADHOME)/Makefile.head + + MISCHOME = ../3rdParty/misc +-TIMEHOME = ../3rdParty/rtime ++#TIMEHOME = ../3rdParty/rtime + + SRCCLT= Plugin/PluginImplementer.cc \ + Plugin/MonitoringPluginImplementer.cc \ +@@ -74,11 +74,10 @@ OBJS = $(SRC:%.cc=$(ABI)/%.o) + + INCLUDES= -I. \ + -I$(MISCHOME)/include \ +- -I$(TIMEHOME) \ ++ -DNO_RTIME \ + $(INCLPTHREAD) + + LIBS = -L$(MISCHOME)/lib/$(ABI) \ +- -L$(TIMEHOME)/lib/$(ABI) \ + -L$(ABI) \ + -lmisc $(RTIMELIB) + diff --git a/science/openmodelica/pkg-descr b/science/openmodelica/pkg-descr new file mode 100644 index 000000000000..5bb5d3be6940 --- /dev/null +++ b/science/openmodelica/pkg-descr @@ -0,0 +1,7 @@ +OPENMODELICA is an open-source Modelica-based modeling and simulation +environment intended for industrial and academic usage. + +The goal with the OpenModelica effort is to create a comprehensive Open Source +Modelica modeling, compilation and simulation environment based on free software +distributed in binary and source code form for research, teaching, and +industrial usage. diff --git a/science/openmodelica/pkg-message b/science/openmodelica/pkg-message new file mode 100644 index 000000000000..ebc964b40671 --- /dev/null +++ b/science/openmodelica/pkg-message @@ -0,0 +1,16 @@ +[ +{ type: install + message: <