The CMAKE system is broken when CMAKE_INSTALL_PREFIX is set. It is attempting to install files to /usr/local/lib. It should be installing all files to $PREFIX I also tried it with EIGEN_INCLUDE_INSTALL_DIR set. Same issue. Error message follows: Install the project... -- Install configuration: "Release" -- Up-to-date: /export/home/bright/openscad_deps/include/eigen3/signature_of_eigen3_matrix_library -- Installing: /usr/local/lib/pkgconfig/eigen3.pc CMake Error at cmake_install.cmake:51 (file): file INSTALL cannot copy file "/export/home/bright/openscad_deps/src/eigen-eigen-bdd17ee3b1b3/bin/eigen3.pc" to "/usr/local/lib/pkgconfig/eigen3.pc". Workaround is to simply copy the Eigen directory per the INSTALL file in the top directory. Cmake version is 3.3.2, OS is SunOS naples 5.10, Cmake command is like this: cmake -DCMAKE_INSTALL_PREFIX=/home/don/sys .. See Also https://github.com/openscad/openscad/issues/1125 Thank you.
It looks like CMake is trying to install pkg config files to "$ENV{PKG_CONFIG_LIBDIR}" instead of "${CMAKE_INSTALL_PREFIX}/share". If you have the environment variable PKG_CONFIG_LIBDIR set, unset it and try again. It should use the share folder in this case. If it still doesn't install, set the EIGEN_BUILD_PKGCONFIG option off. If it compiles with this off, then we know it's an issue with the value in ${pkg_config_install_dir}.
This workaround works. cmake -DEIGEN_BUILD_PKGCONFIG=off However the install process should never attempt to write to /usr/local, or any other path that is not CMAKE_INSTALL_PREFIX, regardless of any environment variable. Thanks
I'm glad that you got it working! I agree, it should install to "${CMAKE_INSTALL_PREFIX}/share" for non-root installations. Thanks for pointing this out.
Created attachment 606 [details] use share dir on non-root install This is my first time doing this, so bear with me... This changes the pkg-config path to the ./share directory when the user specifies a non-default install prefix but maintains current behavior otherwise. This allows for non-root installs even when the PKG_CONFIG_LIBDIR variable is set to a root location.
Created attachment 607 [details] refactoring of .pc file installation It seems that the previous patch disable the installation of .pc files for non standard install prefix... Anyway, I think that this part requires some deeper cleanup (naming, windows support, miss usage of PKG_CONFIG_LIBDIR, etc), and the respective install directory must be configurable independently of CMAKE_INSTALL_PREFIX. This is what does the attached patch. I also renamed EIGEN_BUILD_PKGCONFIG to EIGEN_INSTALL_PKGCONFIG. The variable EIGEN_INSTALL_PKGCONFIG_DIR permits to customize the installation directory. Its name is grammatically not very nice, but this permits to have both variables next to each other in cmake's UIs.
Created attachment 608 [details] install pc independent of pkgconfig It would be much simpler and more consistent to install the pc file independently of pkg-config. A user might have multiple local installs of Eigen, as well as a system install, and multiple local installs of pkg-config in addition to a system install. It should be the job of pkg-config and upstream projects to find specific eigen3.pc files in case there are multiple unique builds. By default, pkg-config checks */lib/pkgconfig and */share/pkgconfig so both are equally viable. I left the "if(NOT WIN32)" guard in because I don't have a Windows platform to test on.
Fixed in bug 1100 *** This bug has been marked as a duplicate of bug 1100 ***
-- GitLab Migration Automatic Message -- This bug has been migrated to gitlab.com's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.com/libeigen/eigen/issues/1072.