LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 08-05-2018, 04:20 PM   #1
olevenets2
LQ Newbie
 
Registered: Mar 2018
Distribution: Slackware64 14.2
Posts: 11

Rep: Reputation: Disabled
cmake: how to set libdir=/usr/local/lib64?


hello, I'm trying to compile a libvibble library:

https://packages.debian.org/ru/sid/libwibble-dev

on my Slackware, it uses cmake and when building the package uses usr/local/lib/pkgconfig/, ignoring the system settings $ PKG_CONFIG_PATH . How can I get it to use /usr/local/lib64? The LIB_SUFFIX configuration is not supported by this project.
 
Old 08-05-2018, 04:35 PM   #2
jostber
Member
 
Registered: Jul 2001
Location: Skien, Norway
Distribution: Slackware 14.2 64-bit
Posts: 457

Rep: Reputation: 142Reputation: 142
Will these commands work?

https://stackoverflow.com/questions/...m-command-line
 
Old 08-05-2018, 04:36 PM   #3
Didier Spaier
LQ Addict
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slint64-14.2.1 on Lenovo Thinkpad W520
Posts: 8,581

Rep: Reputation: Disabled
from the root of the tree, mkdir build && cd build && ccmake ..
Pressing c to configure, it displays:
Code:
 CMAKE_BACKWARDS_COMPATIBILITY   *2.4                                          
 CMAKE_BUILD_TYPE                *                                             
 CMAKE_INSTALL_PREFIX            */usr/local                                   
 EXECUTABLE_OUTPUT_PATH          *                                             
 HAVE_TUT                        *OFF                                          
 LIBRARY_OUTPUT_PATH             *                                             
 RX_PATH                         */usr/include
So I assume that you need this option when running cmake: -DCMAKE_INSTALL_PREFIX=/usr

Last edited by Didier Spaier; 08-05-2018 at 04:40 PM.
 
Old 08-05-2018, 04:52 PM   #4
olevenets2
LQ Newbie
 
Registered: Mar 2018
Distribution: Slackware64 14.2
Posts: 11

Original Poster
Rep: Reputation: Disabled
Hmm, i do not see any effect in two cases.

You can try to change my slackbuild, maybe I made a mistake somewhere:

https://paste.ee/p/G0AFV

Last edited by olevenets2; 08-05-2018 at 05:27 PM.
 
Old 08-05-2018, 05:14 PM   #5
Didier Spaier
LQ Addict
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slint64-14.2.1 on Lenovo Thinkpad W520
Posts: 8,581

Rep: Reputation: Disabled
I just built and installed a package using your SalckBuild with no issue and ran the binary at random against a header with no issue. So, what's wrong? I attach the content of the package.
Code:
didier[/tmp]$ wibble-test-genrunner header module_utils.h 
#undef NDEBUG
#include "module_utils.h"
#define RUN(x,y) x().y()
Attached Files
File Type: txt libwibble-1.1-x86_64-1_deb.txt (4.0 KB, 6 views)
 
Old 08-05-2018, 05:19 PM   #6
olevenets2
LQ Newbie
 
Registered: Mar 2018
Distribution: Slackware64 14.2
Posts: 11

Original Poster
Rep: Reputation: Disabled
Quote:
usr/lib/
usr/lib/libwibble.a
usr/lib/pkgconfig/
usr/lib/pkgconfig/libwibble.pc
for 64-bit systems this should be usr/lib64
 
Old 08-05-2018, 05:35 PM   #7
Didier Spaier
LQ Addict
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slint64-14.2.1 on Lenovo Thinkpad W520
Posts: 8,581

Rep: Reputation: Disabled
Does that really matter? The thing works.

But you can just move these files after having in the SlackBuild after make install if you want.
 
Old 08-05-2018, 05:40 PM   #8
USUARIONUEVO
Member
 
Registered: Apr 2015
Posts: 988

Rep: Reputation: 306Reputation: 306Reputation: 306Reputation: 306
Quote:
Originally Posted by Didier Spaier View Post
Does that really matter? The thing works.

But you can just move these files after having in the SlackBuild after make install if you want.
not good ide, this file contains filepaths


Code:
usr/lib/pkgconfig/libwibble.pc
-DLIBRARY_OUTPUT_PATH=/usr/lib64 ???
 
Old 08-05-2018, 05:42 PM   #9
olevenets2
LQ Newbie
 
Registered: Mar 2018
Distribution: Slackware64 14.2
Posts: 11

Original Poster
Rep: Reputation: Disabled
This is necessary, otherwise other programs that depend on the libwibble library will not work because of the incorrect libdir.

Could you make changes to the script? I also think that libwibble.pc also needs to fix libdir
 
Old 08-05-2018, 05:46 PM   #10
olevenets2
LQ Newbie
 
Registered: Mar 2018
Distribution: Slackware64 14.2
Posts: 11

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by USUARIONUEVO View Post
-DLIBRARY_OUTPUT_PATH=/usr/lib64 ???
does not work
 
Old 08-05-2018, 08:22 PM   #11
orbea
Senior Member
 
Registered: Feb 2015
Distribution: Slackware64-current
Posts: 1,426

Rep: Reputation: Disabled
Quote:
Originally Posted by olevenets2 View Post
hello, I'm trying to compile a libvibble library:

https://packages.debian.org/ru/sid/libwibble-dev

on my Slackware, it uses cmake and when building the package uses usr/local/lib/pkgconfig/, ignoring the system settings $ PKG_CONFIG_PATH . How can I get it to use /usr/local/lib64? The LIB_SUFFIX configuration is not supported by this project.
The short answer is that you can't. Whoever wrote this CMakeLists.txt never considered this use case and it would need to be fixed. See the lines in wibble/CMakeLists.txt which contain "DESTINATION".
 
Old 08-06-2018, 03:24 AM   #12
a4z
Senior Member
 
Registered: Feb 2009
Posts: 1,727

Rep: Reputation: 739Reputation: 739Reputation: 739Reputation: 739Reputation: 739Reputation: 739Reputation: 739
you would need to fix the cmake

if this is the source of this lib, than I guess here for the generated pkg-config file

https://github.com/metux/libwibble/b...eLists.txt#L68

and here
https://github.com/metux/libwibble/b...eLists.txt#L76

for the install location


what does this lib actually do?
 
Old 08-06-2018, 04:11 AM   #13
phenixia2003
Member
 
Registered: May 2006
Location: France
Distribution: Slackware
Posts: 831

Rep: Reputation: 701Reputation: 701Reputation: 701Reputation: 701Reputation: 701Reputation: 701Reputation: 701
Hello,

The patch below should do the trick:
Code:
--- wibble/CMakeLists.txt.orig	2018-08-06 10:04:02.959164066 +0200
+++ wibble/CMakeLists.txt	2018-08-06 10:07:29.051173261 +0200
@@ -65,20 +65,31 @@
 
 set( prefix "${CMAKE_INSTALL_PREFIX}" )
 set( exec_prefix "${prefix}/bin" )
+
+if (DEFINED WIBBLE_LIBARCH) 
+  if (NOT DEFINED libdir)
+    set ( libdir "${prefix}/lib${WIBBLE_LIBARCH}" )
+  endif ()
+  set ( WIBBLE_DESTINATION "lib${WIBBLE_LIBARCH}" )
+else ()
+  set(WIBBLE_DESTINATION "lib/${CMAKE_LIBRARY_ARCHITECTURE}")
+endif()
+
 if (NOT DEFINED libdir)
 	set( libdir "${prefix}/lib" )
 endif()
 set( includedir "${prefix}/include" )
 
+
 # cmake-time configuration
 configure_file( ${wibble_SOURCE_DIR}/libwibble.pc.in
                 ${wibble_BINARY_DIR}/libwibble.pc @ONLY )
 
 # make install
-install( TARGETS wibble DESTINATION lib/${CMAKE_LIBRARY_ARCHITECTURE} COMPONENT wibble_dev )
+install( TARGETS wibble DESTINATION ${WIBBLE_DESTINATION} COMPONENT wibble_dev )
 
 if( NOT WIN32 )
-install( FILES ${wibble_BINARY_DIR}/libwibble.pc DESTINATION lib/${CMAKE_LIBRARY_ARCHITECTURE}/pkgconfig COMPONENT wibble_dev )
+install( FILES ${wibble_BINARY_DIR}/libwibble.pc DESTINATION ${WIBBLE_DESTINATION}/pkgconfig COMPONENT wibble_dev )
 install( FILES libwibble.m4 DESTINATION share/aclocal COMPONENT wibble_dev )
 install( FILES wibble-test-genrunner.1 DESTINATION share/man/man1 COMPONENT wibble_dev )
 endif( NOT WIN32 )
This patch adds the variable WIBBLE_LIBARCH which allows to specify the architecture.

Sample usage :

Code:
$ cd libwibble-1.1
$ patch -p0< /path/to/wibble.patch

$ mkdir _build
$ cd _build
$ cmake -DCMAKE_INSTALL_PREFIX=/usr -DWIBBLE_ARCH=64 ..
...
$ make install DESTDIR=./TEST
$ ls TEST/usr
bin  include  lib64  share

$ ls TEST/usr/lib64
libwibble.a  pkgconfig

$ cat TEST/usr/lib64/pkgconfig
prefix=/usr
exec_prefix=/usr/bin
libdir=/usr/lib64
includedir=/usr/include

Name: libwibble
Description: Library of useful C++ code
Version: 1.1
Libs: -L${libdir} -lwibble
Cflags: -I${includedir}
--
SeB
 
1 members found this post helpful.
Old 08-06-2018, 05:52 PM   #14
olevenets2
LQ Newbie
 
Registered: Mar 2018
Distribution: Slackware64 14.2
Posts: 11

Original Poster
Rep: Reputation: Disabled
phenixia2003, thank you very much, your patch works fine!
 
  


Reply

Tags
cmake, multilib, slackbuild, slackware64


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
14.2 stable 32-bit alien's libreoffice-dict-XX-6.0.4 installs in /usr/lib and /usr/lib64 burdi01 Slackware 4 05-19-2018 04:33 AM
Slackware-current: /usr/share/cmake and /usr/share/cmake-3.3 directories igor29768 Slackware 1 11-07-2015 01:37 AM
cmake: changing libdir hydraMax Programming 1 05-02-2012 12:01 AM
Need surefire way to build 64-bit libs with cmake -> /usr/lib64 H_TeXMeX_H Linux - Software 1 03-21-2010 02:01 AM
/usr/local/lib or /usr/local/lib64 rigelan Slackware 9 07-24-2009 07:32 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 03:15 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration