You are not logged in.

#1 2016-05-25 20:39:13

timmo
Member
From: Germany
Registered: 2014-11-10
Posts: 10

[SOLVED] Error building loki-lib from AUR

So I wanted to install loki-libs https://aur.archlinux.org/packages/loki-lib/ from the AUR on my new laptop but it failed.
I did some research but couldn't find something that made a lot of sense to me as I only know a little about programming. All in all I'd be very glad if somebady has a hint and/or solution.

I run Arch x86_64 with enabled Multilib Repository and gcc-multilib, if it matters.


I did the same as always when I install from AUR:

Download the snapshot.
Open a terminal in the folder with the tarball.

tar -vxf loki-lib.tar.gz

change into the directory and then

makepkg -sri

It runs smoothly until it comes to the FunctionTest.



Here are the parts where I "see" errors, as some of the text is red.


In file included from ../../include/loki/SmallObj.h:22:0,
                 from ../../include/loki/Functor.h:24,
                 from ../../include/loki/Function.h:22,
                 from FunctionTest.cpp:50:
../../include/loki/Threads.h: In static member function ‘static void Loki::ObjectLevelLockable<Host, MutexPolicy>::AtomicAssign(volatile IntType&, Loki::ObjectLevelLockable<Host, MutexPolicy>::IntType)’:
../../include/loki/Threads.h:254:20: error: return-statement with a value, in function returning 'void' [-fpermissive]
             return lval;                                                 \
                    ^
../../include/loki/Threads.h:505:9: note: in expansion of macro ‘LOKI_THREADS_ATOMIC_FUNCTIONS’
         LOKI_THREADS_ATOMIC_FUNCTIONS
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../include/loki/Threads.h: In static member function ‘static void Loki::ObjectLevelLockable<Host, MutexPolicy>::AtomicAssign(Loki::ObjectLevelLockable<Host, MutexPolicy>::IntType&, const volatile IntType&)’:
../../include/loki/Threads.h:262:20: error: return-statement with a value, in function returning 'void' [-fpermissive]
             return lval;                                                 \
                    ^
../../include/loki/Threads.h:505:9: note: in expansion of macro ‘LOKI_THREADS_ATOMIC_FUNCTIONS’
         LOKI_THREADS_ATOMIC_FUNCTIONS
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../include/loki/Threads.h: In static member function ‘static void Loki::ClassLevelLockable<Host, MutexPolicy>::AtomicAssign(volatile IntType&, Loki::ClassLevelLockable<Host, MutexPolicy>::IntType)’:
../../include/loki/Threads.h:254:20: error: return-statement with a value, in function returning 'void' [-fpermissive]
             return lval;                                                 \
                    ^
../../include/loki/Threads.h:590:9: note: in expansion of macro ‘LOKI_THREADS_ATOMIC_FUNCTIONS’
         LOKI_THREADS_ATOMIC_FUNCTIONS
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../include/loki/Threads.h: In static member function ‘static void Loki::ClassLevelLockable<Host, MutexPolicy>::AtomicAssign(Loki::ClassLevelLockable<Host, MutexPolicy>::IntType&, const volatile IntType&)’:
../../include/loki/Threads.h:262:20: error: return-statement with a value, in function returning 'void' [-fpermissive]
             return lval;                                                 \
                    ^
In file included from /usr/include/c++/6.1.1/memory:81:0,
                 from ../../include/loki/Singleton.h:30,
                 from ../../include/loki/SmallObj.h:23,
                 from ../../include/loki/Functor.h:24,
                 from ../../include/loki/Function.h:22,
                 from FunctionTest.cpp:50:
/usr/include/c++/6.1.1/bits/unique_ptr.h:49:28: note: declared here
   template<typename> class auto_ptr;
                            ^~~~~~~~
FunctionTest.cpp: In function ‘void test_exception()’:
FunctionTest.cpp:757:11: error: reference to ‘bad_function_call’ is ambiguous
     catch(bad_function_call)
           ^~~~~~~~~~~~~~~~~
In file included from FunctionTest.cpp:13:0:
/usr/include/c++/6.1.1/functional:1436:9: note: candidates are: class std::bad_function_call
   class bad_function_call : public std::exception
         ^~~~~~~~~~~~~~~~~
In file included from ../../include/loki/Function.h:22:0,
                 from FunctionTest.cpp:50:
../../include/loki/Functor.h:1180:11: note:                 class Loki::bad_function_call
     class bad_function_call : public std::runtime_error
           ^~~~~~~~~~~~~~~~~
<builtin>: recipe for target 'FunctionTest.o' failed
make[2]: *** [FunctionTest.o] Error 1
make[2]: Leaving directory '/home/dimmu2k/Downloads/loki-lib/src/loki-0.1.7/test/Function'
Makefile:12: recipe for target 'Function' failed
make[1]: *** [Function] Error 2
make[1]: Leaving directory '/home/dimmu2k/Downloads/loki-lib/src/loki-0.1.7/test'
Makefile:12: recipe for target 'check' failed
make: *** [check] Error 2
==> ERROR: A failure occurred in build().
    Aborting...

Last edited by timmo (2016-05-25 21:02:28)

Offline

#2 2016-05-25 20:57:46

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,525
Website

Re: [SOLVED] Error building loki-lib from AUR

I first thought the PKGBUILD looked odd as the prefix variable is used wrongly and DESTDIR is not used as it should be.  But I found that this is working around really odd use of hand made makefiles from the upstream source which does not use DESTDIR and uses prefix completely incorrectly.

This is also the cause of the failure in the check as it is looking for libs in the wrong place.  A simple workaround is just to not run the check.  This can be acheived with the following change to the PKGBUILD to add the sed line:

build() {
  cd "$srcdir/loki-$pkgver"
  sed -i 's/^\(all:.*\) check/\1/' Makefile
  make
}

Note that this just ignores the checks, which may not be ideal.  But this is necessary until this is fixed upstream with a makefile that is written properly.  Please consider reporting this upstream.

EDIT: note the proper upstream fix would not be to simply remove the check as I have done, this is a less-than-ideal work around.  The proper fix is to use prefix and DESTDIR properly.


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#3 2016-05-25 21:01:23

timmo
Member
From: Germany
Registered: 2014-11-10
Posts: 10

Re: [SOLVED] Error building loki-lib from AUR

Problem Solved. big_smile

Thank you very much

Offline

Board footer

Powered by FluxBB