Issue 118906

Summary: Support system libraries for apr, apr-util, serf, coinmp.
Product: Build Tools Reporter: Andre <awf.aoo>
Component: external prerequisitesAssignee: Andre <awf.aoo>
Status: CLOSED FIXED QA Contact:
Severity: Normal    
Priority: P3 CC: issues, pfg
Version: 4.0.0-dev   
Target Milestone: 4.0.0   
Hardware: All   
OS: All   
Issue Type: ENHANCEMENT Latest Confirmation in: ---
Developer Difficulty: ---
Attachments:
Description Flags
Initial patch for detecting system coinmp none

Description Andre 2012-02-14 08:21:04 UTC
Several external libraries where added recently.  On some systems they are already installed outside AOO.

Add --with-system-<module> switches to use the system installed versions.
Comment 1 Pedro Giffuni 2012-02-14 16:35:39 UTC
Thanks for creating this issue. It is important.

FWIW, While updating Apache Tomcat, I noted Tomcat
appears to use APR. No idea if we should be reusing the
same or let Tomcat use it's own: for now permitting the
code replication is just less trouble.
Comment 2 Pedro Giffuni 2012-02-14 18:05:40 UTC
(In reply to comment #1)
> 
> FWIW, While updating Apache Tomcat, I noted Tomcat
> appears to use APR. No idea if we should be reusing the
> same or let Tomcat use it's own: for now permitting the
> code replication is just less trouble.

Nevermind... the Tomcat documentation mentions APR but
we don't use it in our build.
Comment 3 Pedro Giffuni 2012-06-06 19:50:35 UTC
Created attachment 78073 [details]
Initial patch for detecting system coinmp

CoinMP is Category-B so it would be particularly interesting to make it possible to use the system libraries.
I made an initial try but still missing is the change to add the .dll in
main/postprocess/rebase/coffbase.txt

I don't know what memory addresses should be used there.
Comment 4 Andre 2012-06-07 06:37:12 UTC
If I read the rebase.pl in the same directory as coffbase.txt correctly, then all DLLs that are not explicitly mentioned in coffbase.txt (or no_rebase.txt) then the address is calculated automatically.  The fixed addresses in coffbase.txt are only important for binary patches to installed releases, which we do not have anymore.  For creating a full installation set, the fixed addresses are not necessary.

I also looked at your patch.  Looks good.  Just one question and one remark:
Q: In the changes to configure.in I saw the lines
    # some systems need this. Like Ubuntu....
    AC_CHECK_LIB(m, floor)
    AC_CHECK_LIB(dl, dlopen)
Can you explain why that is necessary?  And, do we need them in other places, too?

R: Maybe you can add a guard to the makefile of coinmp that excludes building the external library when system CoinMP is used.  That should not be strictly necessary (with adding COINMP only conditionally to BUILD_TYPE) but we have these guards in other modules.
Comment 5 Pedro Giffuni 2012-06-07 06:59:46 UTC
Hi Andre;

To be honest, all I did was to review the lp_solve removal and adapt it to coinmp. The tests for Ubunto were there, along with an attempt to grok a function in the library. I think we can leave them out and wait for someone with Ubuntu to complain ;).

Concerning the check, Lp_solve seemed to take the decision in calc/makefile.mk. I am unsure if I shouldve used an "else" there. Further checks are certainly better but I couldnt find them in the deprecated lp_solve.

The patch is still untested: I have to do other changes in configure.in for
binary blobs and I am yet undecided how to go around testing all of it since builds take so long.

Once its done, this patch should also be a good guideline to do the same with apr and serf, of course.
Comment 6 Andre 2012-06-26 14:45:08 UTC
Added the switches
    --with-system-apr
    --with-system-apr-util
    --with-system-serf
    --with-system-coinmp
to allow the use of system libraries for the respective modules.

I have tested the build without the switches (but, of course, with the changes) on Windows,Linux,Mac.  I could test the active switches only on Linux because on Windows or Mac I could not install the system libraries.

There may be issues with OS/2.

SVN revision 1354035.
Comment 7 Andre 2012-06-26 14:55:09 UTC
Thanks Pedro for the patch.  I used it as the basis for the CoinMP part.
Comment 8 Andre 2012-06-27 09:29:00 UTC
Had to fix the dependency of scp2 on apr-util.  The aprutil_version.mk has to be delivered even when system apr-util is used and ext_libraries/apr-util is not build.

Thanks to Yuri Dario for finding this bug.

SVN revision is 1354384.
Comment 9 Andre 2012-06-28 08:16:35 UTC
And some more fixes to unify the use of underscores in APRUTIL/APR_UTIL.

SVN revision 1354845.
Comment 10 Pedro Giffuni 2012-07-05 15:13:53 UTC
Maho has updated the FreeBSD port to use coinmp, serf and apr and it works fine.

Thanks!
Comment 11 Andre 2012-07-06 07:11:44 UTC
That is great to hear.  Thanks for the feedback.