Archived OpenModelica forums. Posting is disabled.

Alternative forums include GitHub discussions or StackOverflow (make sure to read the Stack Overflow rules; you need to have well-formed questions)


Forgot password? | Forgot username? | Register

Compiling on Arch Linux with PKGBUILDs

Compiling on Arch Linux with PKGBUILDs

I'm trying to compile and run OpenModelica on Arch Linux and, in the process, create PKGBUILDs for it (if you're not familiar, PKGBUILDs are shell scripts that get used to automatically compile and package software for Arch).  There is an existing OpenModelica package, but it's three years out-of-date.  And it depends on an RML package that's equally out-of-date.  So I'm having a go at making it work.

I successfully created an RML package, built from the latest Subversion source.  I then tried to create an OpenModelica package, but several hours of compiling resulted in a confusing error.  But even if it worked, it fails early unless I start with a "make distclean".  And I still don't know what software is needed to build it versus what is needed to run it, as the instructions are unclear on the distinction.

Eventually, I gave up and created a PKGBUILD that simply packages the pre-compiled binaries.  It runs, but having to create symlinks for external libraries probably limits its public utility.  Not to mention that I'm still unsure of all its dependencies.

If anyone can offer advice on getting this running, I would be very grateful.

Re: Compiling on Arch Linux with PKGBUILDs

What is your "java -version"? I use (ArchLinux build 7.u5_2.2.1-1-x86_64) and the ANTLR stuff runs fine for me. I assume you have tried make clean?

Re: Compiling on Arch Linux with PKGBUILDs

Or do you perhaps have an ANTLR2 jar-file in your CLASSPATH? That could possibly screw things up.

Re: Compiling on Arch Linux with PKGBUILDs

My java was from openjdk6, but I replaced it with jre7-openjdk to match your version string.  It looks like it's now getting past the ANTLR stuff, but fails at:

Code:

rm -f libomcruntime.a

ar -s -r libomcruntime.a Error_omc.o Print_omc.o System_omc.o Settings_omc.o IOStreamExt_omc.o ErrorMessage.o FMI_rml.o systemimplmisc.o UnitParserExt_omc.o unitparser.o BackendDAEEXT_omc.o Socket_omc.o matching.o matching_cheap.o Database_omc.o Dynload_omc.o SimulationResults_omc.o ptolemyio_omc.o Lapack_omc.o omc_communication.o omc_communication_impl.o Corba_omc.o
ar: creating libomcruntime.a
cp libomcruntime.a ../../build/lib/omc/
make[4]: Leaving directory `/home/randy/aur/openmodelica-svn/src/trunk/Compiler/runtime'
make[3]: Leaving directory `/home/randy/aur/openmodelica-svn/src/trunk/Compiler/omc_release'
make[2]: *** [all] Error 2
make[2]: Leaving directory `/home/randy/aur/openmodelica-svn/src/trunk/Compiler/omc_release'
make[1]: *** [omc_release] Error 2
make[1]: Leaving directory `/home/randy/aur/openmodelica-svn/src/trunk/Compiler'
make: *** [omc] Error 2

I can't even see what's causing the error in there.

I have set up the PKGBUILD to run "make distclean" between each build, because it otherwise fails very early on.  And I don't know enough about java to understand what you mean about having an ANTLR2 jar-file in my CLASSPATH.  But I do appreciate the help.

Re: Compiling on Arch Linux with PKGBUILDs

The actual error is higher up in the log since it looks like you are making a parallel build. In principle I would need to complete log-file as it is out of order.

Re: Compiling on Arch Linux with PKGBUILDs

Hello,

I have been successful at building openmodelica about 4 mnt. ago from trunk. Probably the code have changed
so that some adaptations are needed, but you could give it a try: https://gist.github.com/3324725

There where some trouble with paradiseo so that the OMOptim is not build. I could not figure which
version of paradiseo to use.

The link contains PKGBUILD's for openmodelica, rml & smlnj.

Icons and desktop files are missing.

Give it a try and perhaps the AUR PKGBUILD's could be updated.

Best regards
Runar Tenfjord

Re: Compiling on Arch Linux with PKGBUILDs

Noone can figure out paradiseo. I am convinced it requires gcc 4.2~4.4 is required to build it (it being the latest *beta*). And damn it's slow using ARCH CFLAGS and default compiler. GCC 4.4 is probably 5 times faster. The openmodelica.profile I am pretty sure is not required, and there are better icons used in the current deb-packages (which you can extract using file-roller or ar and tar).

But it turns out someone was silly enough to add omoptimbasis as a dependency even if omoptim was disabled (this used to work earlier). I blame myself. But the build should work now. I made some modifications as I already have rml-mmc. I also didn't fully re-run the test.

Some suggestions (I didn't try them, but should make things run properly later on; especially prefix is needed to point to the final installation destination):

Code:

build() {

  svn --username anonymous --password none checkout https://openmodelica.org/svn/OpenModelica/trunk/ openmodelica
  msg "SVN checkout done or server timeout"
  msg "Starting make..."

  cd "${srcdir}/openmodelica"

  autoconf || echo 'autoconf fail'

  ./configure --prefix=/opt/openmodelica --with-omniORB --without-paradiseo --disable-python-interface
  make
}

package() {
  cd "${srcdir}/openmodelica"
  make install DESTDIR=${pkgdir}
  install -D -m644 'OSMC-License.txt' "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
  install -D ${srcdir}/${pkgname}.profile ${pkgdir}/etc/profile.d/${pkgname}.sh

  mkdir -p ${pkgdir}/usr/share/icons/
  install -D -m644 ${srcdir}/*.png ${pkgdir}/usr/share/icons/
  mkdir -p ${pkgdir}/usr/share/applications/
  install -D -m644 ${srcdir}/*.desktop ${pkgdir}/usr/share/applications/
}

Snippet from latest deb-package:

Code:

configure: configure.in

        autoconf

config.status: configure
        dh_testdir

        # Add here commands to configure the package.
        RMLHOME=/usr CC="$(CC)" CXX="$(CXX)" CFLAGS="$(CFLAGS)" ./configure \
        --host=$(DEB_HOST_GNU_TYPE) \
        --build=$(DEB_BUILD_GNU_TYPE) \
        --prefix=/usr \
        --with-omniORB=/usr \
        --with-static-lpsolve=/usr \
        --with-static-readline=/usr \
        --with-static-sqlite=/usr/lib/`test -f /usr/lib/$(DEB_HOST_GNU_TYPE)/libsqlite3.a && echo $(DEB_HOST_GNU_TYPE)/`libsqlite3.a \
        --disable-rml-trace

build: build-stamp

build-stamp:  config.status
        dh_testdir

        # Add here commands to compile the package.
        $(MAKE) release mosh omlibrary
        # Qtclients will start make omc again
        # This is a good thing as Susan will then run and regenerate SimCodeC
        ANTLRHOME=/usr $(MAKE) qtclients;
        /usr/bin/time -f "== Testsuite wall-time: %e" $(MAKE) -C testsuite/ > ./build/share/doc/omc/testsuite.txt 2>&1
        touch build-stamp

clean:
        dh_testdir
        dh_testroot
        rm -f build-stamp

        # Add here commands to clean up after the build process.

        dh_clean

install: build
        dh_testdir
        dh_testroot
        dh_prep
        dh_installdirs -popenmodelica -Pdebian/tmp

        # Add here commands to install the package into debian/tmp.
        $(MAKE) install DESTDIR=$(DEST)

Re: Compiling on Arch Linux with PKGBUILDs

I modified the configure line of my PKGBUILD as per sjoelund's suggestion (ie: changed prefix to "/opt/openmodelica" and added "--disable-python-interface"), since they're otherwise effectively the same.  Yet it still fails.

But the binary package is currently working for me, so I'm not personally in a rush to distribute a good PKGBUILD.  But it would eventually be helpful for other Arch users.

Re: Compiling on Arch Linux with PKGBUILDs

I'd make the package depend on qwt (6.0.1-2 in extra) rather than the AUR package. This is because the qwt packages are a hell to get working properly since all distributions rename them... and I made our sources work with the official package current/smile

I could probably make it work with both, but as an arch user at home, it's nicer to not have to recompile everything.

Re: Compiling on Arch Linux with PKGBUILDs

I used the following rml package for myself (should save more than a few minutes every build since mlton creates compiled code instead of interpreted):

Code:

pkgname=rml-mmc-svn

pkgver=20120814
pkgrel=1
pkgdesc="Relational Meta Language and the Meta Modelica Compiler"
arch=('i686' 'x86_64')
url="http://www.ida.liu.se/labs/pelab/rml/"
license=('custom:OSMC')
depends=('mlton' 'sh')
makedepends=('subversion')

_svndir="trunk"
_svnurl="https://openmodelica.org/svn/MetaModelica/$_svndir"

build() {
    cd "$srcdir"
    if [ -d $_svndir/.svn ]; then
        cd $_svndir
        svn --username anonymous --password none --no-auth-cache up
    else
        svn --username anonymous --password none --no-auth-cache co $_svnurl
    fi
    cd "$srcdir/$_svndir"
    ./configure --prefix=/usr --disable-debug --disable-profile \
                --nosmlnj --destdir="$pkgdir"
    make -C runtime
    make -C etc
    make -C compiler rml-mlton
}

package() {
    cd "$srcdir/$_svndir"
    make -C etc install
    make -C runtime install
    make -C compiler install-mlton
}

Re: Compiling on Arch Linux with PKGBUILDs

That's good, thanks.  I had wanted to try that before, but I couldn't even get MLton installed.  Go figure.

Re: Compiling on Arch Linux with PKGBUILDs

Thanks for you suggestions.

I was not successful. rml-mmc-svn failed due to MLton complaining about not finding the libraries.
It also failed with smlnj.

I will have to try more when I get back to the office.

Perhaps it could be an idea to host the correct version of paradiseo in the openmodelica
repo. It is not possible to download the source without registration. This makes problems
for automatic builds etc The CeCILL license is compatible with GPL according to wikipedia.

Best regards
Runar

Re: Compiling on Arch Linux with PKGBUILDs

Sources hard to get? The deb repository has source builds, can pull them all from there:
https://build.openmodelica.org/apt/pool … rig.tar.gz
Or from the official server (don't know if it's direct-linkable, but just click ok without filling in their form and you get where you want)
https://gforge.inria.fr/frs/download.ph … ta2.tar.gz

The build of the mlton package or rml-mmc-svn failed?

Re: Compiling on Arch Linux with PKGBUILDs

Can someone summarize which packages are required from arch repos, which from AUR and which packages must be compiled with other PKGBUILDs (if any) not (yet) present in AUR, in order to have a complete OpenModelica environment on an x86_64 arch system?
Thank you,
Xwang

There are 0 guests and 0 other users also viewing this topic
You are here: