find_library not finding libraries - why?

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

find_library not finding libraries - why?

cornelis

In a CMakeLists.txt I have the following lines of code:

# with this the user will be asked for a path that has then
# lib64 other subdirectories that are specified below

FIND_PATH(CLP_DIR libClp)

SET(CLP_LIB ${CLP_DIR}/lib64)


# after the user specified CLP_DIR this shows what is expected:
# the full path to the libraries, but...

message(AUTHOR_WARNING ${CLP_LIB})

# with the following I think I cannot indicate more clearly where the libraries actually are:
FIND_LIBRARY(CLP_LIBRARY       NAMES libClp       PATHS ${CLP_LIB} NO_DEFAULT_PATH)
FIND_LIBRARY(COINUTILS_LIBRARY NAMES libCoinUtils PATHS ${CLP_LIB} NO_DEFAULT_PATH)
FIND_LIBRARY(OSI_LIBRARY       NAMES libOsi       PATHS ${CLP_LIB} NO_DEFAULT_PATH)
FIND_LIBRARY(OSICLP_LIBRARY    NAMES libOsiClp    PATHS ${CLP_LIB} NO_DEFAULT_PATH)


# ...here everything comes as -NOTFOUND
message(AUTHOR_WARNING ${CLP_LIBRARY})
message(AUTHOR_WARNING ${COINUTILS_LIBRARY})
message(AUTHOR_WARNING ${OSI_LIBRARY})
message(AUTHOR_WARNING ${OSICLP_LIBRARY})


A dir for the indicated directory shows the following files:

-rwxrwxrwx 1 cornelis users     907  8. Nov 18:37 libClp.la
lrwxrwxrwx 1 cornelis users      42  8. Nov 18:37 libClp.so -> libClp.so.1.13.11
lrwxrwxrwx 1 cornelis users      42  8. Nov 18:37 libClp.so.1 -> libClp.so.1.13.11
-rwxrwxrwx 1 cornelis users 1887336  8. Nov 18:37 libClp.so.1.13.11
-rwxrwxrwx 1 cornelis users    1010  8. Nov 18:37 libClpSolver.la
lrwxrwxrwx 1 cornelis users      54  8. Nov 18:37 libClpSolver.so -> libClpSolver.so.1.13.11
lrwxrwxrwx 1 cornelis users      54  8. Nov 18:37 libClpSolver.so.1 -> libClpSolver.so.1.13.11
-rwxrwxrwx 1 cornelis users  415224  8. Nov 18:37 libClpSolver.so.1.13.11
-rwxrwxrwx 1 cornelis users     870  8. Nov 18:37 libCoinUtils.la
lrwxrwxrwx 1 cornelis users      54  8. Nov 18:37 libCoinUtils.so -> libCoinUtils.so.3.10.14
lrwxrwxrwx 1 cornelis users      54  8. Nov 18:37 libCoinUtils.so.3 -> libCoinUtils.so.3.10.14
-rwxrwxrwx 1 cornelis users 1416632  8. Nov 18:37 libCoinUtils.so.3.10.14
-rwxrwxrwx 1 cornelis users    1059  8. Nov 18:37 libOsiClp.la
lrwxrwxrwx 1 cornelis users      48  8. Nov 18:37 libOsiClp.so -> libOsiClp.so.1.13.11
lrwxrwxrwx 1 cornelis users      48  8. Nov 18:37 libOsiClp.so.1 -> libOsiClp.so.1.13.11
-rwxrwxrwx 1 cornelis users  350080  8. Nov 18:37 libOsiClp.so.1.13.11
-rwxrwxrwx 1 cornelis users    1038  8. Nov 18:37 libOsiCommonTests.la
lrwxrwxrwx 1 cornelis users      62  8. Nov 18:37 libOsiCommonTests.so -> libOsiCommonTests.so.1.12.9
lrwxrwxrwx 1 cornelis users      62  8. Nov 18:37 libOsiCommonTests.so.1 -> libOsiCommonTests.so.1.12.9
-rwxrwxrwx 1 cornelis users  619392  8. Nov 18:37 libOsiCommonTests.so.1.12.9
-rwxrwxrwx 1 cornelis users     905  8. Nov 18:37 libOsi.la
lrwxrwxrwx 1 cornelis users      40  8. Nov 18:37 libOsi.so -> libOsi.so.1.12.9
lrwxrwxrwx 1 cornelis users      40  8. Nov 18:37 libOsi.so.1 -> libOsi.so.1.12.9
-rwxrwxrwx 1 cornelis users  400776  8. Nov 18:37 libOsi.so.1.12.9
drwxrwxrwx 1 cornelis users    4096  8. Nov 18:37 pkgconfig


so the libraries are obviously there!

Questions:
What am I doing wrong?
What did I possibly misunderstand regarding the find_library command?


Thanks for any helpful hints!
Cornelis


--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

Re: [Digital Signature Failure] find_library not finding libraries - why?

Dvir Yitzchaki

I think you should either use the full file name, e.g. libClp.so or just use Clp.

See https://cmake.org/cmake/help/latest/command/find_library.html

 

Regards,

Dvir

 

From: CMake [mailto:[hidden email]] On Behalf Of [hidden email]
Sent: Thursday, November 9, 2017 01:03
To: [hidden email]
Subject: [Digital Signature Failure] [CMake] find_library not finding libraries - why?

 

In a CMakeLists.txt I have the following lines of code:

# with this the user will be asked for a path that has then
# lib64 other subdirectories that are specified below

FIND_PATH(CLP_DIR libClp)

SET(CLP_LIB ${CLP_DIR}/lib64)


# after the user specified CLP_DIR this shows what is expected:
# the full path to the libraries, but...

message(AUTHOR_WARNING ${CLP_LIB})

# with the following I think I cannot indicate more clearly where the libraries actually are:
FIND_LIBRARY(CLP_LIBRARY       NAMES libClp       PATHS ${CLP_LIB} NO_DEFAULT_PATH)
FIND_LIBRARY(COINUTILS_LIBRARY NAMES libCoinUtils PATHS ${CLP_LIB} NO_DEFAULT_PATH)
FIND_LIBRARY(OSI_LIBRARY       NAMES libOsi       PATHS ${CLP_LIB} NO_DEFAULT_PATH)
FIND_LIBRARY(OSICLP_LIBRARY    NAMES libOsiClp    PATHS ${CLP_LIB} NO_DEFAULT_PATH)


# ...here everything comes as -NOTFOUND
message(AUTHOR_WARNING ${CLP_LIBRARY})
message(AUTHOR_WARNING ${COINUTILS_LIBRARY})
message(AUTHOR_WARNING ${OSI_LIBRARY})
message(AUTHOR_WARNING ${OSICLP_LIBRARY})


A dir for the indicated directory shows the following files:

-rwxrwxrwx 1 cornelis users     907  8. Nov 18:37 libClp.la
lrwxrwxrwx 1 cornelis users      42  8. Nov 18:37 libClp.so -> libClp.so.1.13.11
lrwxrwxrwx 1 cornelis users      42  8. Nov 18:37 libClp.so.1 -> libClp.so.1.13.11
-rwxrwxrwx 1 cornelis users 1887336  8. Nov 18:37 libClp.so.1.13.11
-rwxrwxrwx 1 cornelis users    1010  8. Nov 18:37 libClpSolver.la
lrwxrwxrwx 1 cornelis users      54  8. Nov 18:37 libClpSolver.so -> libClpSolver.so.1.13.11
lrwxrwxrwx 1 cornelis users      54  8. Nov 18:37 libClpSolver.so.1 -> libClpSolver.so.1.13.11
-rwxrwxrwx 1 cornelis users  415224  8. Nov 18:37 libClpSolver.so.1.13.11
-rwxrwxrwx 1 cornelis users     870  8. Nov 18:37 libCoinUtils.la
lrwxrwxrwx 1 cornelis users      54  8. Nov 18:37 libCoinUtils.so -> libCoinUtils.so.3.10.14
lrwxrwxrwx 1 cornelis users      54  8. Nov 18:37 libCoinUtils.so.3 -> libCoinUtils.so.3.10.14
-rwxrwxrwx 1 cornelis users 1416632  8. Nov 18:37 libCoinUtils.so.3.10.14
-rwxrwxrwx 1 cornelis users    1059  8. Nov 18:37 libOsiClp.la
lrwxrwxrwx 1 cornelis users      48  8. Nov 18:37 libOsiClp.so -> libOsiClp.so.1.13.11
lrwxrwxrwx 1 cornelis users      48  8. Nov 18:37 libOsiClp.so.1 -> libOsiClp.so.1.13.11
-rwxrwxrwx 1 cornelis users  350080  8. Nov 18:37 libOsiClp.so.1.13.11
-rwxrwxrwx 1 cornelis users    1038  8. Nov 18:37 libOsiCommonTests.la
lrwxrwxrwx 1 cornelis users      62  8. Nov 18:37 libOsiCommonTests.so -> libOsiCommonTests.so.1.12.9
lrwxrwxrwx 1 cornelis users      62  8. Nov 18:37 libOsiCommonTests.so.1 -> libOsiCommonTests.so.1.12.9
-rwxrwxrwx 1 cornelis users  619392  8. Nov 18:37 libOsiCommonTests.so.1.12.9
-rwxrwxrwx 1 cornelis users     905  8. Nov 18:37 libOsi.la
lrwxrwxrwx 1 cornelis users      40  8. Nov 18:37 libOsi.so -> libOsi.so.1.12.9
lrwxrwxrwx 1 cornelis users      40  8. Nov 18:37 libOsi.so.1 -> libOsi.so.1.12.9
-rwxrwxrwx 1 cornelis users  400776  8. Nov 18:37 libOsi.so.1.12.9
drwxrwxrwx 1 cornelis users    4096  8. Nov 18:37 pkgconfig


so the libraries are obviously there!

Questions:
What am I doing wrong?
What did I possibly misunderstand regarding the find_library command?


Thanks for any helpful hints!
Cornelis


--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

Re: find_library not finding libraries - why?

CHEVRIER, Marc
In reply to this post by cornelis

The problem is on NAMES argument. You have to specify library names without prefix. So Clp must be used rather than libClp.

FIND_LIBRARY(CLP_LIBRARY       NAMES Clp       PATHS ${CLP_LIB} NO_DEFAULT_PATH)

 

From: CMake <[hidden email]> on behalf of "[hidden email]" <[hidden email]>
Date: Thursday 9 November 2017 at 00:09
To: "[hidden email]" <[hidden email]>
Subject: [CMake] find_library not finding libraries - why?

 

In a CMakeLists.txt I have the following lines of code:

# with this the user will be asked for a path that has then
# lib64 other subdirectories that are specified below

FIND_PATH(CLP_DIR libClp)

SET(CLP_LIB ${CLP_DIR}/lib64)


# after the user specified CLP_DIR this shows what is expected:
# the full path to the libraries, but...

message(AUTHOR_WARNING ${CLP_LIB})

# with the following I think I cannot indicate more clearly where the libraries actually are:
FIND_LIBRARY(CLP_LIBRARY       NAMES libClp       PATHS ${CLP_LIB} NO_DEFAULT_PATH)
FIND_LIBRARY(COINUTILS_LIBRARY NAMES libCoinUtils PATHS ${CLP_LIB} NO_DEFAULT_PATH)
FIND_LIBRARY(OSI_LIBRARY       NAMES libOsi       PATHS ${CLP_LIB} NO_DEFAULT_PATH)
FIND_LIBRARY(OSICLP_LIBRARY    NAMES libOsiClp    PATHS ${CLP_LIB} NO_DEFAULT_PATH)


# ...here everything comes as -NOTFOUND
message(AUTHOR_WARNING ${CLP_LIBRARY})
message(AUTHOR_WARNING ${COINUTILS_LIBRARY})
message(AUTHOR_WARNING ${OSI_LIBRARY})
message(AUTHOR_WARNING ${OSICLP_LIBRARY})


A dir for the indicated directory shows the following files:

-rwxrwxrwx 1 cornelis users     907  8. Nov 18:37 libClp.la
lrwxrwxrwx 1 cornelis users      42  8. Nov 18:37 libClp.so -> libClp.so.1.13.11
lrwxrwxrwx 1 cornelis users      42  8. Nov 18:37 libClp.so.1 -> libClp.so.1.13.11
-rwxrwxrwx 1 cornelis users 1887336  8. Nov 18:37 libClp.so.1.13.11
-rwxrwxrwx 1 cornelis users    1010  8. Nov 18:37 libClpSolver.la
lrwxrwxrwx 1 cornelis users      54  8. Nov 18:37 libClpSolver.so -> libClpSolver.so.1.13.11
lrwxrwxrwx 1 cornelis users      54  8. Nov 18:37 libClpSolver.so.1 -> libClpSolver.so.1.13.11
-rwxrwxrwx 1 cornelis users  415224  8. Nov 18:37 libClpSolver.so.1.13.11
-rwxrwxrwx 1 cornelis users     870  8. Nov 18:37 libCoinUtils.la
lrwxrwxrwx 1 cornelis users      54  8. Nov 18:37 libCoinUtils.so -> libCoinUtils.so.3.10.14
lrwxrwxrwx 1 cornelis users      54  8. Nov 18:37 libCoinUtils.so.3 -> libCoinUtils.so.3.10.14
-rwxrwxrwx 1 cornelis users 1416632  8. Nov 18:37 libCoinUtils.so.3.10.14
-rwxrwxrwx 1 cornelis users    1059  8. Nov 18:37 libOsiClp.la
lrwxrwxrwx 1 cornelis users      48  8. Nov 18:37 libOsiClp.so -> libOsiClp.so.1.13.11
lrwxrwxrwx 1 cornelis users      48  8. Nov 18:37 libOsiClp.so.1 -> libOsiClp.so.1.13.11
-rwxrwxrwx 1 cornelis users  350080  8. Nov 18:37 libOsiClp.so.1.13.11
-rwxrwxrwx 1 cornelis users    1038  8. Nov 18:37 libOsiCommonTests.la
lrwxrwxrwx 1 cornelis users      62  8. Nov 18:37 libOsiCommonTests.so -> libOsiCommonTests.so.1.12.9
lrwxrwxrwx 1 cornelis users      62  8. Nov 18:37 libOsiCommonTests.so.1 -> libOsiCommonTests.so.1.12.9
-rwxrwxrwx 1 cornelis users  619392  8. Nov 18:37 libOsiCommonTests.so.1.12.9
-rwxrwxrwx 1 cornelis users     905  8. Nov 18:37 libOsi.la
lrwxrwxrwx 1 cornelis users      40  8. Nov 18:37 libOsi.so -> libOsi.so.1.12.9
lrwxrwxrwx 1 cornelis users      40  8. Nov 18:37 libOsi.so.1 -> libOsi.so.1.12.9
-rwxrwxrwx 1 cornelis users  400776  8. Nov 18:37 libOsi.so.1.12.9
drwxrwxrwx 1 cornelis users    4096  8. Nov 18:37 pkgconfig


so the libraries are obviously there!

Questions:
What am I doing wrong?
What did I possibly misunderstand regarding the find_library command?


Thanks for any helpful hints!
Cornelis


--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

Re: find_library not finding libraries - why?

cornelis
Thanks - that was it! Now CMake is happy - just a question of seconds...

Regarcs, Cornelis

Am Donnerstag, den 09.11.2017, 09:30 +0000 schrieb CHEVRIER, Marc:

The problem is on NAMES argument. You have to specify library names without prefix. So Clp must be used rather than libClp.

FIND_LIBRARY(CLP_LIBRARY       NAMES Clp       PATHS ${CLP_LIB} NO_DEFAULT_PATH)

 

From: CMake <[hidden email]> on behalf of "[hidden email]" <[hidden email]>
Date: Thursday 9 November 2017 at 00:09
To: "[hidden email]" <[hidden email]>
Subject: [CMake] find_library not finding libraries - why?

 

In a CMakeLists.txt I have the following lines of code:

# with this the user will be asked for a path that has then
# lib64 other subdirectories that are specified below

FIND_PATH(CLP_DIR libClp)

SET(CLP_LIB ${CLP_DIR}/lib64)


# after the user specified CLP_DIR this shows what is expected:
# the full path to the libraries, but...

message(AUTHOR_WARNING ${CLP_LIB})

# with the following I think I cannot indicate more clearly where the libraries actually are:
FIND_LIBRARY(CLP_LIBRARY       NAMES libClp       PATHS ${CLP_LIB} NO_DEFAULT_PATH)
FIND_LIBRARY(COINUTILS_LIBRARY NAMES libCoinUtils PATHS ${CLP_LIB} NO_DEFAULT_PATH)
FIND_LIBRARY(OSI_LIBRARY       NAMES libOsi       PATHS ${CLP_LIB} NO_DEFAULT_PATH)
FIND_LIBRARY(OSICLP_LIBRARY    NAMES libOsiClp    PATHS ${CLP_LIB} NO_DEFAULT_PATH)


# ...here everything comes as -NOTFOUND
message(AUTHOR_WARNING ${CLP_LIBRARY})
message(AUTHOR_WARNING ${COINUTILS_LIBRARY})
message(AUTHOR_WARNING ${OSI_LIBRARY})
message(AUTHOR_WARNING ${OSICLP_LIBRARY})


A dir for the indicated directory shows the following files:

-rwxrwxrwx 1 cornelis users     907  8. Nov 18:37 libClp.la
lrwxrwxrwx 1 cornelis users      42  8. Nov 18:37 libClp.so -> libClp.so.1.13.11
lrwxrwxrwx 1 cornelis users      42  8. Nov 18:37 libClp.so.1 -> libClp.so.1.13.11
-rwxrwxrwx 1 cornelis users 1887336  8. Nov 18:37 libClp.so.1.13.11
-rwxrwxrwx 1 cornelis users    1010  8. Nov 18:37 libClpSolver.la
lrwxrwxrwx 1 cornelis users      54  8. Nov 18:37 libClpSolver.so -> libClpSolver.so.1.13.11
lrwxrwxrwx 1 cornelis users      54  8. Nov 18:37 libClpSolver.so.1 -> libClpSolver.so.1.13.11
-rwxrwxrwx 1 cornelis users  415224  8. Nov 18:37 libClpSolver.so.1.13.11
-rwxrwxrwx 1 cornelis users     870  8. Nov 18:37 libCoinUtils.la
lrwxrwxrwx 1 cornelis users      54  8. Nov 18:37 libCoinUtils.so -> libCoinUtils.so.3.10.14
lrwxrwxrwx 1 cornelis users      54  8. Nov 18:37 libCoinUtils.so.3 -> libCoinUtils.so.3.10.14
-rwxrwxrwx 1 cornelis users 1416632  8. Nov 18:37 libCoinUtils.so.3.10.14
-rwxrwxrwx 1 cornelis users    1059  8. Nov 18:37 libOsiClp.la
lrwxrwxrwx 1 cornelis users      48  8. Nov 18:37 libOsiClp.so -> libOsiClp.so.1.13.11
lrwxrwxrwx 1 cornelis users      48  8. Nov 18:37 libOsiClp.so.1 -> libOsiClp.so.1.13.11
-rwxrwxrwx 1 cornelis users  350080  8. Nov 18:37 libOsiClp.so.1.13.11
-rwxrwxrwx 1 cornelis users    1038  8. Nov 18:37 libOsiCommonTests.la
lrwxrwxrwx 1 cornelis users      62  8. Nov 18:37 libOsiCommonTests.so -> libOsiCommonTests.so.1.12.9
lrwxrwxrwx 1 cornelis users      62  8. Nov 18:37 libOsiCommonTests.so.1 -> libOsiCommonTests.so.1.12.9
-rwxrwxrwx 1 cornelis users  619392  8. Nov 18:37 libOsiCommonTests.so.1.12.9
-rwxrwxrwx 1 cornelis users     905  8. Nov 18:37 libOsi.la
lrwxrwxrwx 1 cornelis users      40  8. Nov 18:37 libOsi.so -> libOsi.so.1.12.9
lrwxrwxrwx 1 cornelis users      40  8. Nov 18:37 libOsi.so.1 -> libOsi.so.1.12.9
-rwxrwxrwx 1 cornelis users  400776  8. Nov 18:37 libOsi.so.1.12.9
drwxrwxrwx 1 cornelis users    4096  8. Nov 18:37 pkgconfig


so the libraries are obviously there!

Questions:
What am I doing wrong?
What did I possibly misunderstand regarding the find_library command?


Thanks for any helpful hints!
Cornelis


--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake