Problematic installation directories

Create issue
Issue #75 closed
Marco Maggi created an issue

Just tried to install version 0.5.9, on my x86_64-unknown-linux-gnu. The include files going under $prefix/lib, rather than $prefix/include are a bit annoying, but the libraries going under $prefix/lib, rather than $prefix/lib64, make Sagittarius unwelcome: my system is set up not to search 64-bit libraries under that pathname. Is there a way to configure lib64 as installation directory for libraries?

Comments (23)

  1. Takashi Kato repo owner

    Thank you for reporting!

    The ones in $prefix/lib are different version ones but I understand the annoyingness. I'll think about this. $prefix/include is simply missing, so I'll add.

    Currently there is no way to configure other than modifying src/CMakeLists.txt. My 64 bit Linux doesn't have lib64 directory so I couldn't notice this problem. I'll make install directory name configurable.

  2. Marco Maggi reporter

    Trying the latest commits... I gen an error from cmake about a missing file:

    >>> cmake .. -DLIB_DIR=lib64 -DLIB_INCLUDE=include
    CMake Error at CMakeLists.txt:24 (INCLUDE):
      include could not find load file:
    
        /home/marco/src/devel/scheme/checkouts/sagittarius-scheme/cmake/Parameters.cmake
    
    
    CMake Error at CMakeLists.txt:27 (GET_PARAMETER):
      Unknown CMake command "GET_PARAMETER".
    
  3. Marco Maggi reporter

    After:

    $ hg pull
    $ hg update default
    $ mkdir build
    $ cd build
    $ cmake ..  -DLIB_DIR=lib64 -DLIB_INCLUDE=include
    

    I see:

    -- system processor x86_64
    -- Architecture triple: x86_64-pc-linux
    -- Install prefix: /usr/local
    -- Fixup compiler flags x86_64
    -- operating system: Linux
    -- Adding symbolic link sagittarius -> sash
    -- Stub generator /home/marco/src/devel/scheme/checkouts/sagittarius-scheme/build/sagittarius
    -- HAVE_ZLIB_INFLATE_RESET2 = 1
    -- Sagittarius uses platform libffi
    -- ODBC include dir - /usr/include
    -- ODBC libraries - /usr/lib64/libiodbc.so
    -- Searching odbc - found
    -- Sagittarius supports ODBC
    -- Configuring done
    CMake Error at src/CMakeLists.txt:88 (ADD_LIBRARY):
      Cannot find source file:
    
        regex_stub.c
    
      Tried extensions .c .C .c++ .cc .cpp .cxx .m .M .mm .h .hh .h++ .hm .hpp
      .hxx .in .txx
    
    
    -- Build files have been written to: /home/marco/src/devel/scheme/checkouts/sagittarius-scheme
    
  4. Takashi Kato repo owner

    Probably forgot to run dist.sh gen in the source directory?

    NOTE: building Sagittarius from repository requires current release version. (and I know you are struggling to install it...)

  5. Marco Maggi reporter

    Got it.

    The default for the shell variable SASH in the script dist.sh should be sagittarius now, rather than sash? Anyway there is no mention of this setting in the HACKING file.

    I am used to build Sagittarius with a personal build script that generates a Slackware package taylored for my system. Previously it was working, also from a repository checkout, by building everything under a build subdirectory (running both cmake and make from the build subdirectory, so that the distribution builds files under the build/build subdirectory). If I try it now, I get an error because the makefile is not in the build directory, and if I do:

    make -f ../Makefile
    

    from the build directory I get:

    $ make -f ../Makefile
    -- system processor x86_64
    -- Architecture triple: x86_64-pc-linux
    -- Install prefix: /usr/local
    -- Fixup compiler flags x86_64
    -- operating system: Linux
    -- Adding symbolic link sagittarius -> sash
    -- Stub generator /home/marco/src/devel/scheme/checkouts/sagittarius-scheme/build/sagittarius
    -- HAVE_ZLIB_INFLATE_RESET2 = 1
    -- Sagittarius uses platform libffi
    -- ODBC include dir - /usr/include
    -- ODBC libraries - /usr/lib64/libiodbc.so
    -- Searching odbc - found
    -- Sagittarius supports ODBC
    -- Configuring done
    CMake Warning at ext/ffi/CMakeLists.txt:69 (ADD_LIBRARY):
      Cannot generate a safe runtime search path for target sagittarius--ffi
      because files in some directories may conflict with libraries in implicit
      directories:
    
        runtime library [libgc.so.1] in /usr/lib64 may be hidden by files in:
          /usr/local/lib64
    
      Some of these libraries may not be found correctly.
    
    
    -- Generating done
    -- Build files have been written to: /home/marco/src/devel/scheme/checkouts/sagittarius-scheme
    make[1]: CMakeFiles/Makefile2: No such file or directory
    make[1]: *** No rule to make target `CMakeFiles/Makefile2'.  Stop.
    make: *** [all] Error 2
    

    Is it possible to restore building "out of tree"?

  6. Takashi Kato repo owner

    Ah, yes, I totally forgot to change the value. (And I'll add mention in HACKING file).

    It seems I need the same environment to figure out what I can do. (looks more like there are 2 Boehm GC libraries and complaining but not sure.) Could you maybe tell me how you install required libraries? like libgc, libffi and (probably) libz?

    May take a bit time to resolve this since I'm totally new for Slackware.

  7. Marco Maggi reporter

    First: running all the required commands from the top of the source tree made the installation work, so there are no show-stoppers. Trying to build not-from-the-top fails from a repository checkout, but it worked fine from the release tarball.

    Second: the warning about libraries is just a warning, both the release tarball and the repository checkout build correctly. I have indeed two GC packages and two Libffi packages: the stock packages from Slackware with libraries under /usr/lib64 and custom packages (of newer releases) with libraries under /usr/local/lib64. The linker correctly picks libraries under /usr/local/lib64 for both GC and Libffi, for some cmake reason, I guess.

  8. Takashi Kato repo owner

    I've tried to reproduce the issue on Cygwin and Slackware. However, I couldn't. Could it be your source directory contains CMakeCache.txt?

  9. Marco Maggi reporter

    Yes! Removing CMakeCache.txt made everything work; sorry for this, it is my ignorance on cmake. Now with the following command almost everything works as expected from a subdirectory of the source tree:

    cmake .. \
        -DCMAKE_INSTALL_PREFIX="$prefix"        \
        -DLIB_DIR=lib64                 \
        -DLIB_INCLUDE=include               \
        -DPKGCONFIG_DIR=lib64/pkgconfig
    

    There still are these minor issues:

    • cmake prints a warning about the manually specified variable LIB_INCLUDE not being used.

    • I do not use the option -DINSTALL_SYMLINK=0, but I do not see the symlink being created.

    • The installed scripts sagittarius-package and sagittarius-config still begin with a sharp-bang directive referencing the executable sash.

  10. Takashi Kato repo owner
    • For include directory, it must be INCLUDE_DIR
    • Did you see the message Adding symbolic link sagittarius -> sash during cmake process? NOTE: symbolic link is only created when you install Sagittarius. So it is not there after the build.
    • Thanks, I'll fix this :)
  11. Marco Maggi reporter

    About the symlink: I see an error message while trying to install in a temporary location; the problem is that the file cmake_install.cmake does not use DESTDIR in the commands that create the symbolic link.

  12. Takashi Kato repo owner

    I couldn't reproduce the problem. Could you paste the last 2 commands of cmake_install.cmake (there are bunch of cmake_install.cmake but the one ${your build dir}/build/src/cmake_install.cmake.) It should have ln command with specifying WORKING_DIRECTORY.

  13. Marco Maggi reporter

    The guilty file is ${builddir}/build/src/cmake_install.make and the offending lines should be at the end of the file:

    IF(NOT CMAKE_INSTALL_COMPONENT OR "${CMAKE_INSTALL_COMPONENT}" STREQUAL "Unspecified")
      EXECUTE_PROCESS (
           COMMAND ln -sf sagittarius sash
           WORKING_DIRECTORY /usr/local/bin )
    ENDIF(NOT CMAKE_INSTALL_COMPONENT OR "${CMAKE_INSTALL_COMPONENT}" STREQUAL "Unspecified")
    
    IF(NOT CMAKE_INSTALL_COMPONENT OR "${CMAKE_INSTALL_COMPONENT}" STREQUAL "Unspecified")
      EXECUTE_PROCESS (
           COMMAND ln -sf sagittarius sash
           WORKING_DIRECTORY /usr/local/lib64/sagittarius/0.5.10/x86_64-pc-linux )
    ENDIF(NOT CMAKE_INSTALL_COMPONENT OR "${CMAKE_INSTALL_COMPONENT}" STREQUAL "Unspecified")
    

    Everywhere else I see $ENV{DESTDIR} being used, but not in these lines. The invocation of ln fails on my system because I build with non-root privileges and I have /usr/local/ mounted read-only, so I see twice the error:

    ln: failed to create symbolic link 'sash': Read-only file system
    
  14. Takashi Kato repo owner

    Thanks!

    I've changed to use ${CMAKE_INSTALL_PREFIX} instead of expand the path. Could you try?

  15. Marco Maggi reporter

    It does not work. I see only one error message about ln failing to create the symlink, but this because one of the ln invocations succeeds in creating a link in ${builddir}, yes, in my build directory.

  16. Log in to comment