GithubHelp home page GithubHelp logo

Comments (11)

bradbell avatar bradbell commented on July 23, 2024

Thanks for this bug report.

Looking at the code in
https://github.com/coin-or/CppAD/blob/master/configure.ac
you will see the code
AC_SUBST(cppad_has_colpack, 0)
This means that the autotools version never has colpack. For this reason cppad_lib is not needed.
One also sees the line
cppad_pkgconfig_libs_value="$cppad_pkgconfig_libs_value -lcppad_ipopt"
which I think needs to be removed to fix one of your problem. Would you please test this change.

As for the final location of cppad.pc, you could change this by adding an AC_CONFIG_COMMAND at the end of configure.ac.

Please suggest any changes you would like to configure.ac and I will make the changes.

It seems that cppad_pkgconfig_libs is not set to empty by pkgconfig/CMakeLists.txt when colpack is not avialable and I need to fix this. As for the final location of cppad.pc in the cmake version, it is given by:
INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/cppad.pc DESTINATION ${cppad_abs_datadir}/pkgconfig )

P.S.
It is intended that all the cppad include files be referenced starting with cppad/, so the include directory should be <build_dir>/include.

from cppad.

tkralphs avatar tkralphs commented on July 23, 2024

At the moment, this shouldn't have anything to do with your configure.ac. The string -lcppad_lib is hard-coded and the variable @cppad_BINARY_DIR@ is never actually defined in configure.ac so changing configure.ac will not affect what ends up in cppad-uninstalled.pc.

Now that I'm looking at it, though, I guess that you might want

Libs:         @cppad_pkgconfig_libs@
Requires:     @cppad_pkgconfig_requires@

in cppad-uninstalled.pc.in as you have in cppad.pc.in. This would also make the Libs line empty (at least for the build I'm doing) and would at least make cppad.pc and cppad-uninstalled.pc consistent in terms of the libraries they pull in and the packages they require.

Also, the reason your .pc files are not installed in COIN's default location is actually because of the line

pkgconfigdir = $(datadir)/pkgconfig

in makefile.am, not because of anything in configure.ac. This line should be changed to

pkgconfigdir = $(libdir)/pkgconfig

if you want to be consistent with other COIN packages.

from cppad.

bradbell avatar bradbell commented on July 23, 2024

I see. I was looking at cppad.pc.in and you were referring to cppad-uninstalled.pc.in You are indeed correct that it needs to be fixed.

In addition, perhaps you are right and libdir is a better location than datadir for the *.pc files. I will try to get to these changes soon.

from cppad.

bradbell avatar bradbell commented on July 23, 2024

I think that I have fixed the issue in the cmake install of CppAD see;
8706c1

The three files in the directory below are the ones to look at.
https://github.com/coin-or/CppAD/tree/master/pkgconfig

Would you please do the conversion of CppAD's configure.ac to (with pkgconfig/CMakeLists.txt as a guide).

When converting to the autotools, cppad_SOURCE_DIR in cmake is top_srcdir in autotools and cppad_BINARY_DIR is top_builddir.

P.S.
The autotools install of cppad does not support the colpack addon, so the complicate case (cppad_has_colpack in pkgconfig/CMakeLists.txt) is not relevant.

from cppad.

tkralphs avatar tkralphs commented on July 23, 2024

Thanks! I think you missed the change to makefile.am. In the meantime, I'll test what's there.

from cppad.

tkralphs avatar tkralphs commented on July 23, 2024

The fix for cppad-uninstalled.pc.in doesn't work because @cppad_pkgconfig_cflags_uninstalled@ and etc. are not defined in configure.ac like the corresponding variables @cppad_pkgconfig_cflags@ and etc. are. Since the list of libraries and requirements are the same in either case, what I suggested above should work fine for those if you don't mind using the same variables in each case.

Libs:         @cppad_pkgconfig_libs@
Requires:     @cppad_pkgconfig_requires@

For the cflags, what you already had there should work fine for the uninstalled headers (as long as that variable is defined) or you can use something like

Cflags: -I@abs_source_dir@ -I@ABSBUILDDIR@

which is what most other projects currently do. There's a chance that the above variables are custom variables and not autotools variables, I'm not sure.

from cppad.

bradbell avatar bradbell commented on July 23, 2024

Since the autotools install of CppAD is only used by coin, I was hoping that you would edit the configure.ac file, test your changes, and send me a pull request.

from cppad.

bradbell avatar bradbell commented on July 23, 2024

Do you have a pull request, or some other way to identify the changes you would like to see ?

from cppad.

tkralphs avatar tkralphs commented on July 23, 2024

It's not really that straightforward for me to do a PR. As you know, we still use a very old version of the autotools that is probably incompatible with your setup. I also don't really know what variables you prefer to use. You had been using custom-defined variables, while the other COIN packages are using what I think are built-in autotools variables for the directories. I suggested alternatives above. Changes needed are only in

  • cppad-uninstalled.pc with the options recommended discussed here, and
  • Makefile.am with the options discussed here.

I guess it will be easier for both of us if you make the changes in the style that you like and build it with the version of the autotools you are using.

from cppad.

bradbell avatar bradbell commented on July 23, 2024

I have made an attempt in the commit
626cf0

The changes were automatically transferred to the non-source autotools files in the repository; see
7e9064
using the command
./bin/autotools.sh automake

Please take a look at this, see if it works for you, or if you would like some modifications.

from cppad.

tkralphs avatar tkralphs commented on July 23, 2024

This seems to work now, thanks!

from cppad.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.