View previous topic :: View next topic |
Author |
Message |
penetrode Apprentice

Joined: 29 Dec 2003 Posts: 285 Location: Calgary, Alberta
|
Posted: Tue Apr 14, 2015 4:22 pm Post subject: Looking for collaborators for an OpenModelica ebuild |
|
|
I am trying to put together an ebuild for OpenModelica: https://www.openmodelica.org/
There are packages for Debian and Ubuntu, but no ebuild yet for Gentoo, despite that fact that Modelica is gaining traction. The build is a little bit tricky. Before I try and do everything myself, I thought it wise to see if anyone else has an interest so that we might join forces.
A user (ilovekiruna) appeared on IRC a few days ago looking for assistance, but hasn't been back, and I have no way to contact him.
Anyway: if you have used OpenModelica or would like to use OpenModelica and would like to see an ebuild, reply to this message or get in touch with me privately. |
|
Back to top |
|
 |
NeddySeagoon Administrator


Joined: 05 Jul 2003 Posts: 55196 Location: 56N 3W
|
Posted: Tue Apr 14, 2015 8:26 pm Post subject: |
|
|
penetrode,
Someone has made a start. _________________ Regards,
NeddySeagoon
Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail. |
|
Back to top |
|
 |
penetrode Apprentice

Joined: 29 Dec 2003 Posts: 285 Location: Calgary, Alberta
|
Posted: Wed Apr 15, 2015 7:48 am Post subject: |
|
|
Yes, I had seen that one. It's six years old, and OpenModelica looks very different now. It might be better to start from scratch.
The biggest problem with it -- which is likely why there's still no ebuild or maintainer, even after all these years -- is that upstream actually recommends working with nightly builds. That's how "bleeding edge" we are here. So maybe it shouldn't go into the main tree, but into the science overlay instead. And yet, people still use it, and even the developers are running it in Linux (primarily Debian/Ubuntu, however).
But I'm getting ahead of myself. We have to have a working ebuild first, before we can talk about where it belongs  |
|
Back to top |
|
 |
steveL Watchman

Joined: 13 Sep 2006 Posts: 5153 Location: The Peanut Gallery
|
Posted: Wed Apr 15, 2015 11:50 am Post subject: |
|
|
penetrode wrote: | The biggest problem with it -- which is likely why there's still no ebuild or maintainer, even after all these years -- is that upstream actually recommends working with nightly builds. |
Yeah that does sound like a 9999 ebuild, though sometimes it's easier to pull a dated tarball, as it gives a known point of comparison. We did something similar with synfig (also svn-based, using checkout numbers) a few years ago, as there was no point of reference for bug-reporting in the IRC channel.
First thing is, can you build it manually from source, not in ebuild just as a general user running ./configure from the terminal?
You can't automate it til you're somewhat comfortable with that.
It's going to go much quicker if you have some code others can comment on, try out and feedback to you, which I think was what Neddy was getting at. Certainly I had no context for this til I looked at the ebuild he linked (so admittedly I'm not your target here.)
Good luck :) |
|
Back to top |
|
 |
Naib Watchman


Joined: 21 May 2004 Posts: 6074 Location: Removed by Neddy
|
Posted: Thu Apr 16, 2015 7:00 pm Post subject: |
|
|
I would be up for helping as I am trying to use Modelica as there is an industry drive to steer away from Matlab _________________ #define HelloWorld int
#define Int main()
#define Return printf
#define Print return
#include <stdio>
HelloWorld Int {
Return("Hello, world!\n");
Print 0; |
|
Back to top |
|
 |
John R. Graham Administrator


Joined: 08 Mar 2005 Posts: 10772 Location: Somewhere over Atlanta, Georgia
|
Posted: Thu Apr 16, 2015 7:21 pm Post subject: |
|
|
Naib wrote: | I would be up for helping as I am trying to use Modelica as there is an industry drive to steer away from Matlab | Interesting. If that's the case, I would be willing to help as well. Gigantic packages tend to have nonstandard build environments, so it's likely nontrivial.
- John _________________ I can confirm that I have received between 0 and 499 National Security Letters. |
|
Back to top |
|
 |
Naib Watchman


Joined: 21 May 2004 Posts: 6074 Location: Removed by Neddy
|
Posted: Thu Apr 16, 2015 9:09 pm Post subject: |
|
|
John R. Graham wrote: | Naib wrote: | I would be up for helping as I am trying to use Modelica as there is an industry drive to steer away from Matlab | Interesting. If that's the case, I would be willing to help as well. Gigantic packages tend to have nonstandard build environments, so it's likely nontrivial.
- John | yer, there are a couple of large EU research projects and the deliverables for them are Modelica models _________________ #define HelloWorld int
#define Int main()
#define Return printf
#define Print return
#include <stdio>
HelloWorld Int {
Return("Hello, world!\n");
Print 0; |
|
Back to top |
|
 |
penetrode Apprentice

Joined: 29 Dec 2003 Posts: 285 Location: Calgary, Alberta
|
Posted: Thu Apr 16, 2015 9:21 pm Post subject: |
|
|
This is good news, I'm glad to see there is interest.
As steveL pointed out, one has to have it building from ordinary sources, first, and at the moment I can't even get that far.
OpenModelica requires antlr, java, qt, and readline, as well as a library called paradiseo (for which I now have a simple ebuild that seems to work), plus LAPACK and BLAS.
I can make omc and mosh, but when I try to build the qtclients it fails:
Code: | /usr/lib/gcc/x86_64-pc-linux-gnu/4.8.4/../../../../x86_64-pc-linux-gnu/bin/ld: warning: libopenblas_openmodelica.so.0, needed by ../../build/lib/omc/libOpenModelicaCompiler.so, not found (try using -rpath or -rpath-link)
../../build/lib/omc/libOpenModelicaCompiler.so: undefined reference to `dorgqr_'
../../build/lib/omc/libOpenModelicaCompiler.so: undefined reference to `dgtsv_'
../../build/lib/omc/libOpenModelicaCompiler.so: undefined reference to `dgesv_'
../../build/lib/omc/libOpenModelicaCompiler.so: undefined reference to `dgegv_'
../../build/lib/omc/libOpenModelicaCompiler.so: undefined reference to `dgelsx_'
../../build/lib/omc/libOpenModelicaCompiler.so: undefined reference to `dgels_'
../../build/lib/omc/libOpenModelicaCompiler.so: undefined reference to `dgbsv_'
../../build/lib/omc/libOpenModelicaCompiler.so: undefined reference to `dgetri_'
../../build/lib/omc/libOpenModelicaCompiler.so: undefined reference to `dgeqpf_'
../../build/lib/omc/libOpenModelicaCompiler.so: undefined reference to `dgglse_'
../../build/lib/omc/libOpenModelicaCompiler.so: undefined reference to `dgetrf_'
../../build/lib/omc/libOpenModelicaCompiler.so: undefined reference to `dgeev_'
../../build/lib/omc/libOpenModelicaCompiler.so: undefined reference to `dgesvd_'
../../build/lib/omc/libOpenModelicaCompiler.so: undefined reference to `dgetrs_'
collect2: error: ld returned 1 exit status
Makefile:315: recipe for target '../bin/OMEdit' failed
make[2]: *** [../bin/OMEdit] Error 1
make[2]: Leaving directory '/home/sfbosch/src/modelica/openmodelica/OMEdit/OMEditGUI'
Makefile.unix:32: recipe for target 'OMEdit' failed
make[1]: *** [OMEdit] Error 2
make[1]: Leaving directory '/home/sfbosch/src/modelica/openmodelica/OMEdit/OMEditGUI'
Makefile:106: recipe for target 'omedit' failed
make: *** [omedit] Error 2
|
OpenModelica gives you the option of using the included BLAS. Here's ./configure --help[/code]:
Code: |
$ ./configure --help
`configure' configures OpenModelica dev to adapt to many kinds of systems.
Usage: ./configure [OPTION]... [VAR=VALUE]...
To assign environment variables (e.g., CC, CFLAGS...), specify them as
VAR=VALUE. See below for descriptions of some of the useful variables.
Defaults for the options are specified in brackets.
Configuration:
-h, --help display this help and exit
--help=short display options specific to this package
--help=recursive display the short help of all the included packages
-V, --version display version information and exit
-q, --quiet, --silent do not print `checking ...' messages
--cache-file=FILE cache test results in FILE [disabled]
-C, --config-cache alias for `--cache-file=config.cache'
-n, --no-create do not create output files
--srcdir=DIR find the sources in DIR [configure dir or `..']
Installation directories:
--prefix=PREFIX install architecture-independent files in PREFIX
[]
--exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
[PREFIX]
By default, `make install' will install all the files in
`/bin', `/lib' etc. You can specify
an installation prefix other than `' using `--prefix',
for instance `--prefix=$HOME'.
For better control, use the options below.
Fine tuning of the installation directories:
--bindir=DIR user executables [EPREFIX/bin]
--sbindir=DIR system admin executables [EPREFIX/sbin]
--libexecdir=DIR program executables [EPREFIX/libexec]
--sysconfdir=DIR read-only single-machine data [PREFIX/etc]
--sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
--localstatedir=DIR modifiable single-machine data [PREFIX/var]
--libdir=DIR object code libraries [EPREFIX/lib]
--includedir=DIR C header files [PREFIX/include]
--oldincludedir=DIR C header files for non-gcc [/usr/include]
--datarootdir=DIR read-only arch.-independent data root [PREFIX/share]
--datadir=DIR read-only architecture-independent data [DATAROOTDIR]
--infodir=DIR info documentation [DATAROOTDIR/info]
--localedir=DIR locale-dependent data [DATAROOTDIR/locale]
--mandir=DIR man documentation [DATAROOTDIR/man]
--docdir=DIR documentation root [DATAROOTDIR/doc/openmodelica]
--htmldir=DIR html documentation [DOCDIR]
--dvidir=DIR dvi documentation [DOCDIR]
--pdfdir=DIR pdf documentation [DOCDIR]
--psdir=DIR ps documentation [DOCDIR]
System types:
--build=BUILD configure for building on BUILD [guessed]
--host=HOST cross-compile to build programs to run on HOST [BUILD]
--target=TARGET configure for building compilers for TARGET [HOST]
Optional Features:
--disable-option-checking ignore unrecognized --enable/--with options
--disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
--enable-FEATURE[=ARG] include FEATURE [ARG=yes]
--enable-non-free-packages Enables you to link non-free packages. But doing so limits your ability to distribute code under GPL3, even to co-workers and the like. If you are an OSMC member you might be allowed to link and ship such libraries if you have a commercial license for the linked packages.
--disable-omshell-terminal Disables compilation of OMShell-terminal (enabled by default)
--disable-python-interface Python interface to omc. Enabled by default if CORBA is enabled.
--disable-modelica3d Modelica3D library (dependencies checked by cmake later on; enabled by default)
--disable-omnotebook OMNotebook is a notebook for Modelica. Enabled by default if CORBA is enabled. Does not work on OSX.
Optional Packages:
--with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
--without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
--with-omc=omc (the installed omc path which we will use to compile omc)
--with-static-readline=DIR (default to dynamic linking; searches /usr if no other directory is provided)
--with-static-lpsolve=DIR (default to dynamic linking; searches /usr if no other directory is provided)
--with-static-sqlite=FILE (default to dynamic linking)
--with-lapack=-llapack -lblas (use -llapack -lblas to use system-provided version instead of OpenBLAS. Use openblas for automatically detected OpenBLAS. Use --with-lapack=openblas-NEHALEM or other OpenBLAS target to compile against a certain architecture. Note that you need to include BLAS in this.)
--without-UMFPACK Disable compilation with UMFPACK, a sparse linear systems solver
--with-MICO=DIR use mico corba installed in DIR (or use mico-config)
--with-omniORB=DIR use omniORB installed in DIR (recommended CORBA implementation)
--with-paradiseo Required for OMOptim. Default searches {PREFIX,/usr,/opt} for {include,lib}/paradiseo
--with-METIS=DIR Compile with Metis graph partitioner in DIR
--with-PATOH=DIR Compile with PATOH hypergraph partitioner in DIR
Some influential environment variables:
CC C compiler command
CFLAGS C compiler flags
LDFLAGS linker flags, e.g. -L<lib dir> if you have libraries in a
nonstandard directory <lib dir>
LIBS libraries to pass to the linker, e.g. -l<library>
CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if
you have headers in a nonstandard directory <include dir>
CXX C++ compiler command
CXXFLAGS C++ compiler flags
CPP C preprocessor
FC Fortran compiler command
FCFLAGS Fortran compiler flags
OMPCC Selects a compiler to be used to compile OpenMP code. Useful if
the main CC does not support OpenMP.
RUNTIMECC Selects a compiler to be used to compile generated code. It is
more important to compile fast than to generate fast code for
the runtime compiler.
RUNTIMECFLAGS
CFLAGS for the selected runtime compiler (defaults to -O0
-falign-functions -march=native -mfpmath=sse -fPIC as long as
neither gives warnings to the CC). Note that heavy optimisations
may cause the run-time to be faster while increasing
compile-time. -O0 is often best.
Use these variables to override the choices made by `configure' or to help
it to find libraries and programs with nonstandard names/locations.
Report bugs to <https://trac.openmodelica.org/OpenModelica>.
OpenModelica home page: <https://openmodelica.org>.
|
The most relevant part to this problem would appear to be
Code: |
--with-lapack=-llapack -lblas (use -llapack -lblas to use system-provided version instead of OpenBLAS. Use openblas for automatically detected OpenBLAS. Use --with-lapack=openblas-NEHALEM or other OpenBLAS target to compile against a certain architecture. Note that you need to include BLAS in this.) |
I have LAPACK and BLAS installed.
LAPACK:
Code: |
$ eix -I lapack
[I] app-eselect/eselect-lapack
Available versions: 0.1
Installed versions: 0.1(12:03:54 04/16/15)
Homepage: http://www.gentoo.org/proj/en/eselect/
Description: LAPACK module for eselect
[I] sci-libs/lapack-reference
Available versions: 3.1.1-r1 ~3.2.1-r1 **3.2.1-r3 ~3.4.2[1] ~3.5.0[1] **9999[1] {doc int64 static-libs test xblas ABI_MIPS="n32 n64 o32" ABI_PPC="32 64" ABI_S390="32 64" ABI_X86="32 64 x32"}
Installed versions: 3.1.1-r1(05:16:18 10/07/12)(-doc)
Homepage: http://www.netlib.org/lapack/
Description: Reference implementation of LAPACK
[I] virtual/lapack
Available versions: 3.0 3.1 ~3.4-r1[1] ~3.5-r1[1] ~3.5-r2[1] {doc int64}
Installed versions: 3.1(05:16:23 10/07/12)
Description: Virtual for Linear Algebra Package FORTRAN 77 implementation
[1] "science" /var/lib/layman/science
Found 3 matches.
|
BLAS:
Code: | $ eix -I blas
[I] sci-libs/blas-reference
Available versions: [M]20070226 [M]~20070226-r2 [M]**20070226-r3 ~20131116[2] (~)20131116-r1[2] **99999999[2] {doc int64 static-libs test ABI_MIPS="n32 n64 o32" ABI_PPC="32 64" ABI_S390="32 64" ABI_X86="32 64 x32"}
Installed versions: 20131116-r1[2](09:46:32 04/16/15)(-int64 -static-libs -test ABI_MIPS="-n32 -n64 -o32" ABI_PPC="-32 -64" ABI_S390="-32 -64" ABI_X86="64 -32 -x32")
Homepage: http://www.netlib.org/lapack/
Description: Reference implementation of BLAS
[I] sci-libs/openblas [2]
Available versions: ~0.2.8 ~0.2.11 (~)0.2.12 **9999 {dynamic int64 openmp static-libs threads ABI_MIPS="n32 n64 o32" ABI_PPC="32 64" ABI_S390="32 64" ABI_X86="32 64 x32"}
Installed versions: 0.2.12(10:01:58 04/16/15)(openmp threads -dynamic -int64 -static-libs ABI_MIPS="-n32 -n64 -o32" ABI_PPC="-32 -64" ABI_S390="-32 -64" ABI_X86="64 -32 -x32")
Homepage: http://xianyi.github.com/OpenBLAS/
Description: Optimized BLAS library based on GotoBLAS2
[I] virtual/blas
Available versions: 1.0 ~2.1-r1[2] ~2.1-r2[2] (~)2.1-r3[2] {doc int64}
Installed versions: 2.1-r3[2](09:46:48 04/16/15)(-doc -int64)
Description: Virtual for FORTRAN 77 BLAS implementation
[I] virtual/cblas
Available versions: 1.0 ~2.0[2] ~2.0-r1[2] (~)2.0-r2[2] {int64}
Installed versions: 2.0-r2[2](10:02:05 04/16/15)(-int64)
Description: Virtual for BLAS C implementation
[1] "kde" /var/lib/layman/kde
[2] "science" /var/lib/layman/science
Found 5 matches.
|
Here we have two BLAS installed, so one is selected with eselect:
Code: | $ eselect blas list
Available providers for blas:
[1] openblas-threads *
[2] reference
|
I'm using the eselect from the science overlay because the one from the main tree is broken for BLAS.
Code: |
$ ./configure --prefix=/usr --with-omniORB --with-paradiseo=/usr/include/paradiseo/ --enable-python-interface
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking target system type... x86_64-unknown-linux-gnu
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking for g++... g++
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking how to run the C preprocessor... gcc -E
checking whether make sets $(MAKE)... yes
checking for flex... flex
checking lex output file root... lex.yy
checking lex library... -lfl
checking whether yytext is a pointer... yes
checking for gfortran... gfortran
checking whether we are using the GNU Fortran compiler... yes
checking whether gfortran accepts -g... yes
checking if -Werror works... ok
checking getconf LONG_BIT = 64 CFLAGS... adding -fPIC
which: no omc in (/usr/local/bin:/usr/bin:/bin:/opt/bin:/usr/x86_64-pc-linux-gnu/gcc-bin/4.8.4:/usr/lib64/subversion/bin:/usr/games/bin:/usr/share/omniORB/bin/scripts)
checking for omc... failed (tried ). Building it through bootstrapping (you might end up unable to recompile omc if you modify source code).
checking for library containing clock_gettime... none required
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking sys/time.h usability... yes
checking sys/time.h presence... yes
checking for sys/time.h... yes
checking for antlr.Tool support... ANTLR Parser Generator Version 2.7.7 (20060906) 1989-2005
yes
checking if the user wants to compile OMShell-terminal... yes
checking readline/readline.h usability... yes
checking readline/readline.h presence... yes
checking for readline/readline.h... yes
checking readline/history.h usability... yes
checking readline/history.h presence... yes
checking for readline/history.h... yes
checking for library containing readline... -lreadline
checking expat.h usability... yes
checking expat.h presence... yes
checking for expat.h... yes
checking for an ANSI C-conforming const... yes
checking for size_t... yes
checking for vprintf... yes
checking for _doprnt... no
checking for getcwd... yes
checking for select... yes
checking for strdup... yes
checking for strerror... yes
checking for scandir... yes
checking for OpenMP... gcc -fopenmp
checking runtime compiler... gcc ok
checking runtime compiler CFLAGS... -fPIC -O0 -falign-functions -march=native
checking for library containing dlopen... -ldl
checking for library containing dlopen... (cached) -ldl
checking for library containing sqrt... -lm
checking for library containing colamd... -lcolamd
checking for library containing make_lp... -llpsolve55
checking lp_lib.h usability... no
checking lp_lib.h presence... no
checking for lp_lib.h... no
checking lpsolve/lp_lib.h usability... yes
checking lpsolve/lp_lib.h presence... yes
checking for lpsolve/lp_lib.h... yes
checking for socket... yes
checking for gethostbyname... yes
checking LAPACK/BLAS flags... configure: error: dgesv (LAPACK) linking failed using -llapack -lblas |
When I try to configure with local LAPACK and BLAS, configure fails. Here's the relevant part of the config log:
Code: | configure:6064: checking LAPACK/BLAS flags
configure:6098: gcc -o conftest -g -O2 -fno-stack-protector -fPIC conftest.c -llapack -lblas >&5
/usr/lib/gcc/x86_64-pc-linux-gnu/4.8.4/../../../../x86_64-pc-linux-gnu/bin/ld: cannot find -lblas
collect2: error: ld returned 1 exit status
configure:6098: $? = 1
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME "OpenModelica"
| #define PACKAGE_TARNAME "openmodelica"
| #define PACKAGE_VERSION "dev"
| #define PACKAGE_STRING "OpenModelica dev"
| #define PACKAGE_BUGREPORT "https://trac.openmodelica.org/OpenModelica"
| #define PACKAGE_URL "https://openmodelica.org"
| #define YYTEXT_POINTER 1
| #define STDC_HEADERS 1
| #define HAVE_SYS_TYPES_H 1
| #define HAVE_SYS_STAT_H 1
| #define HAVE_STDLIB_H 1
| #define HAVE_STRING_H 1
| #define HAVE_MEMORY_H 1
| #define HAVE_STRINGS_H 1
| #define HAVE_INTTYPES_H 1
| #define HAVE_STDINT_H 1
| #define HAVE_UNISTD_H 1
| #define HAVE_SYS_TIME_H 1
| #define HAVE_VPRINTF 1
| #define HAVE_GETCWD 1
| #define HAVE_SELECT 1
| #define HAVE_STRDUP 1
| #define HAVE_STRERROR 1
| #define HAVE_SCANDIR 1
| /* end confdefs.h. */
|
| /* Override any GCC internal prototype to avoid an error.
| Use char because int might match the return type of a GCC
| builtin and then its argument prototype would still apply. */
| #ifdef __cplusplus
| extern "C"
| #endif
| char dgesv_ ();
| int
| main ()
| {
| return dgesv_ ();
| ;
| return 0;
| }
configure:6101: error: dgesv (LAPACK) linking failed using -llapack -lblas |
Why is the linking failing here?
When I compile with the included BLAS (--with-lapack=openblas, configure completes successfully in this case), it fails with the error at the top of the post. |
|
Back to top |
|
 |
leo-recover n00b

Joined: 11 May 2018 Posts: 12 Location: Italy
|
Posted: Sun Jul 28, 2019 10:55 am Post subject: |
|
|
Hi,
I hope this is still the right place to post this.
I've been trying for some time to write a very simple ebuild for the latest openmodelica source code.
I'm able to compile and run the SW on my Gentoo installation by hand. When trying to run the ebuild though it fails.
From what I understood, this is related to the fact that the openmodelica makefile is trying to download from git and patch the modelica libraries during the build phase, and this is not allowed by the ebuild system.
Do you have some suggestions on how to overcome this issue? |
|
Back to top |
|
 |
Hu Administrator

Joined: 06 Mar 2007 Posts: 23364
|
Posted: Sun Jul 28, 2019 3:50 pm Post subject: |
|
|
All required files must be available locally before the build starts. Supporting files can be packaged as an archive, listed in SRC_URI, and then Portage will download them for you at the right time. You then use src_unpack to unpack them to the location the upstream build would have used if you let it do the download. If the upstream build system is polite, it will notice you have already provided the files and simply use them in place. If it is rude, it will ignore you and try to download anyway. In that case, you must patch it to be polite. |
|
Back to top |
|
 |
leo-recover n00b

Joined: 11 May 2018 Posts: 12 Location: Italy
|
Posted: Sun Jul 28, 2019 4:30 pm Post subject: |
|
|
I see, thanks for the explanation. I'm afraid that this will not be an easy task.
The upstream build system is doing this when making the libraries (extract from Makefile.libs):
Code: |
... other target libraries here ...
LibRAS:
# Building git/LibRAS
./checkout-git.sh 'git/LibRAS' 'https://github.com/FishSim/LibRAS.git' 'master' 'fca9de50a484a2213f3ca1b39e275c237c471688'
test ! -d 'build//LibRAS'
cp -a 'git/LibRAS/LibRAS' "$(BUILD_DIR)/LibRAS"
echo '' > "$(BUILD_DIR)/LibRAS.uses"
echo 'gpl3' > "$(BUILD_DIR)/LibRAS.license"
echo '20190213-093248~git~master' > "$(BUILD_DIR)/LibRAS.last_change"
LinearMPC:
# Building git/LinearMPC
./checkout-git.sh 'git/LinearMPC' 'https://github.com/modelica-3rdparty/LinearMPC.git' 'master' 'c16ad1c1970ea581c51158cca0647e165dc4c3b9'
test ! -f 'build//LinearMPC 1.mo'
cp -a 'git/LinearMPC/LinearMPC.mo' "$(BUILD_DIR)/LinearMPC 1.mo"
echo '' > "$(BUILD_DIR)/LinearMPC 1.uses"
echo 'modelica2' > "$(BUILD_DIR)/LinearMPC 1.license"
echo '1.0-16-gc16ad1c' > "$(BUILD_DIR)/LinearMPC 1.last_change"
ManualTracking:
# Building git/ManualTracking
./checkout-git.sh 'git/ManualTracking' 'https://github.com/jjpotterkowski/ManualTracking.git' 'master' 'ab15d4cae19b5e4a1148d1d4b2a05c50864599ba'
test ! -f 'build//ManualTracking.mo'
cp -a 'git/ManualTracking/ManualTracking.mo' "$(BUILD_DIR)/ManualTracking.mo"
echo '' > "$(BUILD_DIR)/ManualTracking.uses"
echo 'modelica2' > "$(BUILD_DIR)/ManualTracking.license"
echo '20150801-224607~git~master' > "$(BUILD_DIR)/ManualTracking.last_change"
ModPowerSystems:
# Building git/ModPowerSystems
./checkout-git.sh 'git/ModPowerSystems' 'https://github.com/modelica-3rdparty/ModPowerSystems.git' 'master' '0f580942b2f15f36e1e33744eca26faff0cd985e'
test ! -d 'build//ModPowerSystems'
cp -a 'git/ModPowerSystems/ModPowerSystems' "$(BUILD_DIR)/ModPowerSystems"
echo '' > "$(BUILD_DIR)/ModPowerSystems.uses"
echo 'modelica2' > "$(BUILD_DIR)/ModPowerSystems.license"
echo '20190220-191955~git~master' > "$(BUILD_DIR)/ModPowerSystems.last_change"
... other target libraries here ...
|
So I guess I should manually update my ebuild for each library since they are checking out specific versions of the libraries
I don't see any way to automate this actually. |
|
Back to top |
|
 |
Hu Administrator

Joined: 06 Mar 2007 Posts: 23364
|
Posted: Sun Jul 28, 2019 8:34 pm Post subject: |
|
|
That Makefile is amazingly bad and unreliable. Whoever wrote it should be ashamed of committing it. You said earlier that the dependent libraries are patched here, which would be even worse. I don't see that in the part you quoted, but on the assumption you were right, we will need to continue letting this project bundle the supporting libraries.
Fortunately, it should be pretty easy to bypass. Add to SRC_URI the zip archives of each of the supporting libraries. In src_unpack, extract those to the directories that this Makefile tries to use. In src_prepare, patch this Makefile to skip the checkout-git.sh call. |
|
Back to top |
|
 |
leo-recover n00b

Joined: 11 May 2018 Posts: 12 Location: Italy
|
Posted: Mon Jul 29, 2019 5:16 pm Post subject: |
|
|
Yes sorry, the part where they are patching the library is the following, for the Modelica library:
Code: |
Modelica:
# Building git/Modelica
./checkout-git.sh 'git/Modelica' 'https://github.com/modelica/Modelica.git' 'v1.6' 'v1.6'
test ! -d 'build//Modelica 1.6'
cp -a 'git/Modelica' "$(BUILD_DIR)/Modelica 1.6"
patch -l -d "$(BUILD_DIR)/" -f -p1 < 'Modelica 1.6.patch'
echo '' > "$(BUILD_DIR)/Modelica 1.6.uses"
echo 'modelica1.1' > "$(BUILD_DIR)/Modelica 1.6.license"
echo '1.6-om1' > "$(BUILD_DIR)/Modelica 1.6.last_change"
rm -rf "$(BUILD_DIR)/Modelica 1.6/.git"*
# Building git/Modelica
./checkout-git.sh 'git/Modelica' 'https://github.com/modelica/Modelica.git' 'maint/2.2.2' 'd442bcd461b8db9873e33b6141bdbd37bcff9de8'
test ! -d 'build//Modelica 2.2.2'
cp -a 'git/Modelica/Modelica' "$(BUILD_DIR)/Modelica 2.2.2"
patch -l -d "$(BUILD_DIR)/" -f -p1 < 'Modelica 2.2.2.patch'
echo '' > "$(BUILD_DIR)/Modelica 2.2.2.uses"
echo 'modelica1.1' > "$(BUILD_DIR)/Modelica 2.2.2.license"
echo '2.2.2-20140315-143534~git~maint-2.2.2-om1' > "$(BUILD_DIR)/Modelica 2.2.2.last_change"
echo 'omlibrary-msl222' > "$(BUILD_DIR)/Modelica 2.2.2.breaks"
# Building git/Modelica
./checkout-git.sh 'git/Modelica' 'https://github.com/modelica/Modelica.git' 'maint/3.1' 'af2a3e1597d648d6826665c89cf9eaf5c2a632bc'
test ! -d 'build//Modelica 3.1'
cp -a 'git/Modelica/Modelica' "$(BUILD_DIR)/Modelica 3.1"
patch -l -d "$(BUILD_DIR)/" -f -p1 < 'Modelica 3.1.patch'
echo '' > "$(BUILD_DIR)/Modelica 3.1.uses"
echo 'modelica2' > "$(BUILD_DIR)/Modelica 3.1.license"
echo '3.1-20140322-174148~git~maint-3.1-om1' > "$(BUILD_DIR)/Modelica 3.1.last_change"
echo 'omlibrary-msl31' > "$(BUILD_DIR)/Modelica 3.1.breaks"
test ! -d 'build//ModelicaServices 1.0'
cp -a 'git/Modelica/ModelicaServices' "$(BUILD_DIR)/ModelicaServices 1.0"
patch -l -d "$(BUILD_DIR)/" -f -p1 < 'ModelicaServices 1.0.patch'
echo > "$(BUILD_DIR)/ModelicaServices 1.0.uses"
echo 'modelica2' > "$(BUILD_DIR)/ModelicaServices 1.0.license"
echo '1.0-20140322-174148~git~maint-3.1-om1' > "$(BUILD_DIR)/ModelicaServices 1.0.last_change"
echo 'omlibrary-msl31' > "$(BUILD_DIR)/ModelicaServices 1.0.breaks"
# Building git/Modelica
./checkout-git.sh 'git/Modelica' 'https://github.com/modelica/Modelica.git' 'maint/3.2.1' '60cb4e48077fa22cc97d02e767baa83ec78aadf9'
test ! -f 'build//Complex 3.2.1.mo'
cp -a 'git/Modelica/Complex.mo' "$(BUILD_DIR)/Complex 3.2.1.mo"
echo '' > "$(BUILD_DIR)/Complex 3.2.1.uses"
echo 'modelica2' > "$(BUILD_DIR)/Complex 3.2.1.license"
echo '3.2.1+build.4-18-g60cb4e4-om1' > "$(BUILD_DIR)/Complex 3.2.1.last_change"
echo 'omlibrary-msl32,omlibrary-reference' > "$(BUILD_DIR)/Complex 3.2.1.breaks"
test ! -d 'build//Modelica 3.2.1'
cp -a 'git/Modelica/Modelica' "$(BUILD_DIR)/Modelica 3.2.1"
rm -rf "$(BUILD_DIR)/Modelica 3.2.1/Resources/Library"
patch -l -d "$(BUILD_DIR)/" -f -p1 < 'Modelica 3.2.1.patch'
echo '' > "$(BUILD_DIR)/Modelica 3.2.1.uses"
echo 'modelica2' > "$(BUILD_DIR)/Modelica 3.2.1.license"
echo '3.2.1+build.4-18-g60cb4e4-om1' > "$(BUILD_DIR)/Modelica 3.2.1.last_change"
echo 'omlibrary-msl32,omlibrary-reference' > "$(BUILD_DIR)/Modelica 3.2.1.breaks"
test ! -d 'build//ModelicaServices 3.2.1'
cp -a 'git/Modelica/ModelicaServices' "$(BUILD_DIR)/ModelicaServices 3.2.1"
patch -l -d "$(BUILD_DIR)/" -f -p1 < 'ModelicaServices 3.2.1.patch'
echo > "$(BUILD_DIR)/ModelicaServices 3.2.1.uses"
echo 'modelica2' > "$(BUILD_DIR)/ModelicaServices 3.2.1.license"
echo '3.2.1+build.4-18-g60cb4e4-om1' > "$(BUILD_DIR)/ModelicaServices 3.2.1.last_change"
echo 'omlibrary-msl32,omlibrary-reference' > "$(BUILD_DIR)/ModelicaServices 3.2.1.breaks"
test ! -d 'build//ModelicaTest 3.2.1'
cp -a 'git/Modelica/ModelicaTest' "$(BUILD_DIR)/ModelicaTest 3.2.1"
echo '' > "$(BUILD_DIR)/ModelicaTest 3.2.1.uses"
echo 'modelica2' > "$(BUILD_DIR)/ModelicaTest 3.2.1.license"
echo '3.2.1+build.4-18-g60cb4e4' > "$(BUILD_DIR)/ModelicaTest 3.2.1.last_change"
echo 'omlibrary-msl32,omlibrary-reference' > "$(BUILD_DIR)/ModelicaTest 3.2.1.breaks"
# Building git/Modelica
./checkout-git.sh 'git/Modelica' 'https://github.com/modelica/Modelica.git' 'maint/3.2.2' 'd992c34ed978241214b4c079fb8ee6cc9e33d909'
test ! -f 'build//Complex 3.2.2.mo'
cp -a 'git/Modelica/Complex.mo' "$(BUILD_DIR)/Complex 3.2.2.mo"
echo '' > "$(BUILD_DIR)/Complex 3.2.2.uses"
echo 'modelica2' > "$(BUILD_DIR)/Complex 3.2.2.license"
echo '3.2.2-237-gd992c34-om1' > "$(BUILD_DIR)/Complex 3.2.2.last_change"
test ! -d 'build//Modelica 3.2.2'
cp -a 'git/Modelica/Modelica' "$(BUILD_DIR)/Modelica 3.2.2"
rm -rf "$(BUILD_DIR)/Modelica 3.2.2/Resources/Library"
patch -l -d "$(BUILD_DIR)/" -f -p1 < 'Modelica 3.2.2.patch'
echo '' > "$(BUILD_DIR)/Modelica 3.2.2.uses"
echo 'modelica2' > "$(BUILD_DIR)/Modelica 3.2.2.license"
echo '3.2.2-237-gd992c34-om3' > "$(BUILD_DIR)/Modelica 3.2.2.last_change"
test ! -d 'build//ModelicaServices 3.2.2'
cp -a 'git/Modelica/ModelicaServices' "$(BUILD_DIR)/ModelicaServices 3.2.2"
patch -l -d "$(BUILD_DIR)/" -f -p1 < 'ModelicaServices 3.2.2.patch'
echo > "$(BUILD_DIR)/ModelicaServices 3.2.2.uses"
echo 'modelica2' > "$(BUILD_DIR)/ModelicaServices 3.2.2.license"
echo '3.2.2-237-gd992c34-om2' > "$(BUILD_DIR)/ModelicaServices 3.2.2.last_change"
test ! -d 'build//ModelicaTest 3.2.2'
cp -a 'git/Modelica/ModelicaTest' "$(BUILD_DIR)/ModelicaTest 3.2.2"
echo '' > "$(BUILD_DIR)/ModelicaTest 3.2.2.uses"
echo 'modelica2' > "$(BUILD_DIR)/ModelicaTest 3.2.2.license"
echo '3.2.2-237-gd992c34' > "$(BUILD_DIR)/ModelicaTest 3.2.2.last_change"
test ! -f 'build//ModelicaTestOverdetermined 3.2.2.mo'
cp -a 'git/Modelica/ModelicaTestOverdetermined.mo' "$(BUILD_DIR)/ModelicaTestOverdetermined 3.2.2.mo"
echo '' > "$(BUILD_DIR)/ModelicaTestOverdetermined 3.2.2.uses"
echo 'modelica2' > "$(BUILD_DIR)/ModelicaTestOverdetermined 3.2.2.license"
echo '3.2.2-237-gd992c34' > "$(BUILD_DIR)/ModelicaTestOverdetermined 3.2.2.last_change"
test ! -f 'build//ObsoleteModelica3.mo'
cp -a 'git/Modelica/ObsoleteModelica3.mo' "$(BUILD_DIR)/ObsoleteModelica3.mo"
echo '' > "$(BUILD_DIR)/ObsoleteModelica3.uses"
echo 'modelica2' > "$(BUILD_DIR)/ObsoleteModelica3.license"
echo '3.2.2-237-gd992c34' > "$(BUILD_DIR)/ObsoleteModelica3.last_change"
# Building git/Modelica
./checkout-git.sh 'git/Modelica' 'https://github.com/modelica/Modelica.git' 'maint/3.2.3' '702eeaa7dc38f8aadf8732316fc3f764d4dc24e5'
test ! -f 'build//Complex 3.2.3.mo'
cp -a 'git/Modelica/Complex.mo' "$(BUILD_DIR)/Complex 3.2.3.mo"
echo '' > "$(BUILD_DIR)/Complex 3.2.3.uses"
echo 'bsd3' > "$(BUILD_DIR)/Complex 3.2.3.license"
echo '3.2.3+build.2-10-g702eeaa' > "$(BUILD_DIR)/Complex 3.2.3.last_change"
test ! -d 'build//Modelica 3.2.3'
cp -a 'git/Modelica/Modelica' "$(BUILD_DIR)/Modelica 3.2.3"
rm -rf "$(BUILD_DIR)/Modelica 3.2.3/Resources/Library"
patch -l -d "$(BUILD_DIR)/" -f -p1 < 'Modelica 3.2.3.patch'
echo '' > "$(BUILD_DIR)/Modelica 3.2.3.uses"
echo 'bsd3' > "$(BUILD_DIR)/Modelica 3.2.3.license"
echo '3.2.3+build.2-10-g702eeaa-om2' > "$(BUILD_DIR)/Modelica 3.2.3.last_change"
test ! -d 'build//ModelicaReference'
cp -a 'git/Modelica/ModelicaReference' "$(BUILD_DIR)/ModelicaReference"
echo '' > "$(BUILD_DIR)/ModelicaReference.uses"
echo 'bsd3' > "$(BUILD_DIR)/ModelicaReference.license"
echo '20190622-105637~git~maint-3.2.3' > "$(BUILD_DIR)/ModelicaReference.last_change"
test ! -d 'build//ModelicaServices 3.2.3'
cp -a 'git/Modelica/ModelicaServices' "$(BUILD_DIR)/ModelicaServices 3.2.3"
patch -l -d "$(BUILD_DIR)/" -f -p1 < 'ModelicaServices 3.2.3.patch'
echo > "$(BUILD_DIR)/ModelicaServices 3.2.3.uses"
echo 'bsd3' > "$(BUILD_DIR)/ModelicaServices 3.2.3.license"
echo '3.2.3+build.2-10-g702eeaa-om2' > "$(BUILD_DIR)/ModelicaServices 3.2.3.last_change"
test ! -d 'build//ModelicaTest 3.2.3'
cp -a 'git/Modelica/ModelicaTest' "$(BUILD_DIR)/ModelicaTest 3.2.3"
echo '' > "$(BUILD_DIR)/ModelicaTest 3.2.3.uses"
echo 'bsd3' > "$(BUILD_DIR)/ModelicaTest 3.2.3.license"
echo '3.2.3+build.2-10-g702eeaa' > "$(BUILD_DIR)/ModelicaTest 3.2.3.last_change"
# Building git/Modelica
./checkout-git.sh 'git/Modelica' 'https://github.com/modelica/Modelica.git' 'master' 'd6ac84c85f7cf8b137017cdb7660aa5699062d13'
test ! -f 'build//Complex trunk.mo'
cp -a 'git/Modelica/Complex.mo' "$(BUILD_DIR)/Complex trunk.mo"
patch -l -d "$(BUILD_DIR)/" -f -p1 < 'Complex trunk.patch'
echo '' > "$(BUILD_DIR)/Complex trunk.uses"
echo 'bsd3' > "$(BUILD_DIR)/Complex trunk.license"
echo '20190623-132927~git~master-om1' > "$(BUILD_DIR)/Complex trunk.last_change"
echo 'omlibrary-msl32,omlibrary-reference' > "$(BUILD_DIR)/Complex trunk.breaks"
test ! -d 'build//Modelica trunk'
cp -a 'git/Modelica/Modelica' "$(BUILD_DIR)/Modelica trunk"
rm -rf "$(BUILD_DIR)/Modelica trunk/Resources/Library"
patch -l -d "$(BUILD_DIR)/" -f -p1 < 'Modelica trunk.patch'
echo '' > "$(BUILD_DIR)/Modelica trunk.uses"
echo 'bsd3' > "$(BUILD_DIR)/Modelica trunk.license"
echo '20190623-132927~git~master-om1' > "$(BUILD_DIR)/Modelica trunk.last_change"
echo 'omlibrary-msl32,omlibrary-reference' > "$(BUILD_DIR)/Modelica trunk.breaks"
test ! -d 'build//ModelicaReference trunk'
cp -a 'git/Modelica/ModelicaReference' "$(BUILD_DIR)/ModelicaReference trunk"
echo '' > "$(BUILD_DIR)/ModelicaReference trunk.uses"
echo 'bsd3' > "$(BUILD_DIR)/ModelicaReference trunk.license"
echo '20190623-132927~git~master' > "$(BUILD_DIR)/ModelicaReference trunk.last_change"
echo 'omlibrary-msl32,omlibrary-reference' > "$(BUILD_DIR)/ModelicaReference trunk.breaks"
test ! -d 'build//ModelicaServices trunk'
cp -a 'git/Modelica/ModelicaServices' "$(BUILD_DIR)/ModelicaServices trunk"
patch -l -d "$(BUILD_DIR)/" -f -p1 < 'ModelicaServices trunk.patch'
echo > "$(BUILD_DIR)/ModelicaServices trunk.uses"
echo 'bsd3' > "$(BUILD_DIR)/ModelicaServices trunk.license"
echo '20190623-132927~git~master-om1' > "$(BUILD_DIR)/ModelicaServices trunk.last_change"
echo 'omlibrary-msl32,omlibrary-reference' > "$(BUILD_DIR)/ModelicaServices trunk.breaks"
test ! -d 'build//ModelicaTest trunk'
cp -a 'git/Modelica/ModelicaTest' "$(BUILD_DIR)/ModelicaTest trunk"
patch -l -d "$(BUILD_DIR)/" -f -p1 < 'ModelicaTest trunk.patch'
echo '' > "$(BUILD_DIR)/ModelicaTest trunk.uses"
echo 'bsd3' > "$(BUILD_DIR)/ModelicaTest trunk.license"
echo '20190623-132927~git~master-om200' > "$(BUILD_DIR)/ModelicaTest trunk.last_change"
echo 'omlibrary-msl32,omlibrary-reference' > "$(BUILD_DIR)/ModelicaTest trunk.breaks"
|
Anyways, I'll try your suggestions and see if it works out well.
Thank you!  |
|
Back to top |
|
 |
vince.ice n00b

Joined: 18 Jan 2019 Posts: 8 Location: Italy
|
Posted: Wed Oct 23, 2019 7:53 am Post subject: |
|
|
Dear all,
here is my openmodelica ebuild. It builds just fine but it needs some expert revision.
What it does is cloning from github and recursively check out the "v1.13.2" tag, which represents the latest stable release.
I left all my comments in the ebuild file, so that it is easier to see what I did.
I also wrote 2 easy patches to fix fome bugs: paradiseo-cmake.patch and sundials-cmake.patch
Here the files, just put them in your local Portage overlay:
PLEASE NOTE: I am not an experienced portage/ebuild programmer. I only managed to write a couple of ebuilds and adapt another couple. So, I expect I made many mistakes. Nevertheless, I wrote the ebuild because I need OpenModelica and it was a pity Gentoo Science doesn't have it. I'd be proud If my attempt can be useful to the community.
Ciao to all |
|
Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|