Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Looking for collaborators for an OpenModelica ebuild
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Unsupported Software
View previous topic :: View next topic  
Author Message
penetrode
Apprentice
Apprentice


Joined: 29 Dec 2003
Posts: 260
Location: Calgary, Alberta

PostPosted: Tue Apr 14, 2015 4:22 pm    Post subject: Looking for collaborators for an OpenModelica ebuild Reply with quote

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
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 33579
Location: 56N 3W

PostPosted: Tue Apr 14, 2015 8:26 pm    Post subject: Reply with quote

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
View user's profile Send private message
penetrode
Apprentice
Apprentice


Joined: 29 Dec 2003
Posts: 260
Location: Calgary, Alberta

PostPosted: Wed Apr 15, 2015 7:48 am    Post subject: Reply with quote

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
View user's profile Send private message
steveL
Advocate
Advocate


Joined: 13 Sep 2006
Posts: 3767
Location: The Peanut Gallery

PostPosted: Wed Apr 15, 2015 11:50 am    Post subject: Reply with quote

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
View user's profile Send private message
Naib
Advocate
Advocate


Joined: 21 May 2004
Posts: 4464
Location: Removed by Neddy

PostPosted: Thu Apr 16, 2015 7:00 pm    Post subject: Reply with quote

I would be up for helping as I am trying to use Modelica as there is an industry drive to steer away from Matlab
_________________
The best argument against democracy is a five-minute conversation with the average voter
Great Britain is a republic, with a hereditary president, while the United States is a monarchy with an elective king
Back to top
View user's profile Send private message
John R. Graham
Administrator
Administrator


Joined: 08 Mar 2005
Posts: 8480
Location: Somewhere over Atlanta, Georgia

PostPosted: Thu Apr 16, 2015 7:21 pm    Post subject: Reply with quote

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 999 National Security Letters.
Back to top
View user's profile Send private message
Naib
Advocate
Advocate


Joined: 21 May 2004
Posts: 4464
Location: Removed by Neddy

PostPosted: Thu Apr 16, 2015 9:09 pm    Post subject: Reply with quote

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
_________________
The best argument against democracy is a five-minute conversation with the average voter
Great Britain is a republic, with a hereditary president, while the United States is a monarchy with an elective king
Back to top
View user's profile Send private message
penetrode
Apprentice
Apprentice


Joined: 29 Dec 2003
Posts: 260
Location: Calgary, Alberta

PostPosted: Thu Apr 16, 2015 9:21 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Unsupported Software All times are GMT
Page 1 of 1

 
Jump to:  
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