Discussion:
[soci-users] core dependencies incorrect
Philipp Kraus
2013-07-10 15:27:01 UTC
Permalink
Hello,

I build soci under OSX and get the item

SOCI_CORE_DEPENDENCIES = /usr/lib/libdl.dylib /usr/local/lib/libboost_date_time-mt.a

but I have set the items

-DBoost_INCLUDE_DIR:PATH=/Developer/opt/Boost/1.54/include
-DBoost_LIBRARIES:FILEPATH=/Developer/opt/Boost/1.54/lib

to an absolut path of my Boost installation eg /Developer/opt/Boost/1.54
In this case the core dependencies must be also point ti /Developer and not /usr/local.

How can I fix the core dependency for the Boost.Date-Time ?

Thanks

Phil
Mateusz Loskot
2013-07-10 18:56:34 UTC
Permalink
Post by Philipp Kraus
Hello,
I build soci under OSX and get the item
SOCI_CORE_DEPENDENCIES = /usr/lib/libdl.dylib
/usr/local/lib/libboost_date_time-mt.a
but I have set the items
-DBoost_INCLUDE_DIR:PATH=/Developer/opt/Boost/1.54/include
-DBoost_LIBRARIES:FILEPATH=/Developer/opt/Boost/1.54/lib
to an absolut path of my Boost installation eg /Developer/opt/Boost/1.54
In this case the core dependencies must be also point ti /Developer and not /usr/local.
How can I fix the core dependency for the Boost.Date-Time ?
I don't use OSX myself, so I can't test it myself.
First, I'd suggest to confirm that the Boost lookup works,
using minimal example with CMake searching for Boost:

$ cat CMakeLists.txt
make_minimum_required (VERSION 2.8)
project(boost_test)
find_package(Boost 1.53) # change version, add COMPONENTS if desired
if (NOT Boost_FOUND)
message(FATAL_ERROR "Cannot find Boost")
else()
message(STATUS "Boost found")
message(STATUS "Boost_INCLUDE_DIRS=${Boost_INCLUDE_DIRS}")
endif()

IMHO, BOOST_ROOT should be enough:

cmake -DBOOST_ROOT:PATH=/Developer/opt/Boost/1.54

Does it work for you?

Best regards,
--
Mateusz Loskot, http://mateusz.loskot.net
Philipp Kraus
2013-07-11 06:36:45 UTC
Permalink
Post by Mateusz Loskot
Post by Philipp Kraus
Hello,
I build soci under OSX and get the item
SOCI_CORE_DEPENDENCIES = /usr/lib/libdl.dylib
/usr/local/lib/libboost_date_time-mt.a
but I have set the items
-DBoost_INCLUDE_DIR:PATH=/Developer/opt/Boost/1.54/include
-DBoost_LIBRARIES:FILEPATH=/Developer/opt/Boost/1.54/lib
to an absolut path of my Boost installation eg /Developer/opt/Boost/1.54
In this case the core dependencies must be also point ti /Developer and not /usr/local.
How can I fix the core dependency for the Boost.Date-Time ?
I don't use OSX myself, so I can't test it myself.
First, I'd suggest to confirm that the Boost lookup works,
$ cat CMakeLists.txt
make_minimum_required (VERSION 2.8)
project(boost_test)
find_package(Boost 1.53) # change version, add COMPONENTS if desired
if (NOT Boost_FOUND)
message(FATAL_ERROR "Cannot find Boost")
else()
message(STATUS "Boost found")
message(STATUS "Boost_INCLUDE_DIRS=${Boost_INCLUDE_DIRS}")
endif()
cmake -DBOOST_ROOT:PATH=/Developer/opt/Boost/1.54
Does it work for you?
Soci Cmake shows with the BOOST_ROOT option:
-- Boost:
-- Boost_RELEASE_VERSION = 1.54.0
-- Boost_INCLUDE_DIR = /Developer/opt//boost/1.54.0/include
-- Boost_LIBRARIES =

-- SOCI_CORE_DEPENDENCIES = /usr/lib/libdl.dylib /usr/local/lib/libboost_date_time-mt.a

I have disabled alls other boost flags.
Is there also a POSTGRESQL_ROOT? Exists there a documentation for the cmake flags?

Thanks

Phil
Mateusz Loskot
2013-07-11 08:34:42 UTC
Permalink
Post by Philipp Kraus
-- Boost_RELEASE_VERSION = 1.54.0
-- Boost_INCLUDE_DIR = /Developer/opt//boost/1.54.0/include
-- Boost_LIBRARIES =
This looks OK.
Post by Philipp Kraus
-- SOCI_CORE_DEPENDENCIES = /usr/lib/libdl.dylib /usr/local/lib/libboost_date_time-mt.a
This does not looks OK.
FindBoost.cmake variable ${Boost_DATE_TIME_LIBRARY}
is set to /usr/local/lib/libboost_date_time-mt.a for some reason.

You are still testing with SOCI CMake configuration.
I'd suggest, as in previous post, to test minimal CMake
and figure out if you are still getting
Boost_DATE_TIME_LIBRARY=/usr/local/lib/libboost_date_time-mt.a

If you look into src/core/CMakeLists.txt then you can see that it just
reads value of Boost_DATE_TIME_LIBRARY, which is provided
by FindBoost.cmake.
First, you need to confirm that FindBoost.cmake works correctly in your env.
Post by Philipp Kraus
I have disabled alls other boost flags.
Is there also a POSTGRESQL_ROOT?
No.
Post by Philipp Kraus
Exists there a documentation for the cmake flags?
1. CMake documentation
2. SOCI documentation (section Installation)
3. Run CMake GUI in advance mode, you will see all/most of them.

Best regards,
--
Mateusz Loskot, http://mateusz.loskot.net
Philipp Kraus
2013-07-11 13:56:48 UTC
Permalink
Post by Mateusz Loskot
Post by Philipp Kraus
-- Boost_RELEASE_VERSION = 1.54.0
-- Boost_INCLUDE_DIR = /Developer/opt//boost/1.54.0/include
-- Boost_LIBRARIES =
This looks OK.
Post by Philipp Kraus
-- SOCI_CORE_DEPENDENCIES = /usr/lib/libdl.dylib /usr/local/lib/libboost_date_time-mt.a
This does not looks OK.
FindBoost.cmake variable ${Boost_DATE_TIME_LIBRARY}
is set to /usr/local/lib/libboost_date_time-mt.a for some reason.
You are still testing with SOCI CMake configuration.
I'd suggest, as in previous post, to test minimal CMake
and figure out if you are still getting
Boost_DATE_TIME_LIBRARY=/usr/local/lib/libboost_date_time-mt.a
The Boost_DATE_TIME_LIBRARY:FILEPATH cmd options does not seem to work.
If I change the parameter to Boost_DATE_TIME_LIBRARY_RELEASE and set the full path to the boost lib (like my postgresql flag)
it seems to be working

It is a little bit hard to understand the cmake data, because there does not exist any documentation.

Phil
Mateusz Loskot
2013-07-11 14:18:28 UTC
Permalink
Post by Philipp Kraus
-- Boost_RELEASE_VERSION = 1.54.0
-- Boost_INCLUDE_DIR =
/Developer/opt//boost/1.54.0/include
-- Boost_LIBRARIES =
This looks OK.
-- SOCI_CORE_DEPENDENCIES = /usr/lib/libdl.dylib
/usr/local/lib/libboost_date_time-mt.a
This does not looks OK.
FindBoost.cmake variable ${Boost_DATE_TIME_LIBRARY}
is set to /usr/local/lib/libboost_date_time-mt.a for some reason.
You are still testing with SOCI CMake configuration.
I'd suggest, as in previous post, to test minimal CMake
and figure out if you are still getting
Boost_DATE_TIME_LIBRARY=/usr/local/lib/libboost_date_time-mt.a
The Boost_DATE_TIME_LIBRARY:FILEPATH cmd options does not seem to work.
If I change the parameter to Boost_DATE_TIME_LIBRARY_RELEASE and set the
full path to the boost lib (like my postgresql flag)
it seems to be working
You do not set this variable explicitly.
In CMakeLists.txt, you call find_package with COMPONENTS list,
as documented here
http://cmake.org/cmake/help/v2.8.11/cmake.html#module:FindBoost
Post by Philipp Kraus
It is a little bit hard to understand the cmake data, because there does not
exist any documentation.
It's all documented in FindBoost.cmake file (scan your CMake installation,
read the comments in header) and CMake documentation.

If I used OSX, I could test the minimal CMakeLists.txt sample I suggested,
but I don't, so you need to test it yourself.

Best regards,
--
Mateusz Loskot, http://mateusz.loskot.net
Philipp Kraus
2013-07-11 17:25:37 UTC
Permalink
Post by Mateusz Loskot
Post by Philipp Kraus
-- Boost_RELEASE_VERSION = 1.54.0
-- Boost_INCLUDE_DIR =
/Developer/opt//boost/1.54.0/include
-- Boost_LIBRARIES =
This looks OK.
-- SOCI_CORE_DEPENDENCIES = /usr/lib/libdl.dylib
/usr/local/lib/libboost_date_time-mt.a
This does not looks OK.
FindBoost.cmake variable ${Boost_DATE_TIME_LIBRARY}
is set to /usr/local/lib/libboost_date_time-mt.a for some reason.
You are still testing with SOCI CMake configuration.
I'd suggest, as in previous post, to test minimal CMake
and figure out if you are still getting
Boost_DATE_TIME_LIBRARY=/usr/local/lib/libboost_date_time-mt.a
The Boost_DATE_TIME_LIBRARY:FILEPATH cmd options does not seem to work.
If I change the parameter to Boost_DATE_TIME_LIBRARY_RELEASE and set the
full path to the boost lib (like my postgresql flag)
it seems to be working
You do not set this variable explicitly.
In CMakeLists.txt, you call find_package with COMPONENTS list,
as documented here
http://cmake.org/cmake/help/v2.8.11/cmake.html#module:FindBoost
Post by Philipp Kraus
It is a little bit hard to understand the cmake data, because there does not
exist any documentation.
It's all documented in FindBoost.cmake file (scan your CMake installation,
read the comments in header) and CMake documentation.
If I used OSX, I could test the minimal CMakeLists.txt sample I suggested,
but I don't, so you need to test it yourself.
If I set the Boost_Root and Boost_NO_SYSTEM_PATHS the libs are be build, but the
SOCI_CORE_DEPENDENCIES = /usr/lib/libdl.dylib
does not have any information to boost date-time anymore.

Phil
Mateusz Loskot
2013-07-12 08:47:49 UTC
Permalink
Post by Philipp Kraus
If I set the Boost_Root
This is incorrect spelling and I'm sure CMake would warn you about it.
There are only two accepted spellings of boost root/installation prefix,
BOOST_ROOT or BOOSTROOT, as it the documentation specifies
http://cmake.org/cmake/help/v2.8.11/cmake.html#module:FindBoost
Post by Philipp Kraus
and Boost_NO_SYSTEM_PATHS the libs are be build, but
the SOCI_CORE_DEPENDENCIES = /usr/lib/libdl.dylib
does not have any information to boost date-time anymore.
I have an impression there is misunderstanding.
Please, forget SOCI, for a moment and run this simple test

1. Create folder btest
2. Create file btest/CMakeLists.txt
3. Save this as content of btest/CMakeLists.txt

make_minimum_required (VERSION 2.8)
project(btest)
set(Boost_USE_STATIC_LIBS ON)
set(Boost_USE_MULTITHREADED ON)
find_package(Boost 1.53 COMPONENTS date_time) # change version as you wish
message(STATUS "Boost_FOUND=${Boost_FOUND}")
message(STATUS "Boost_INCLUDE_DIRS=${Boost_INCLUDE_DIRS}")
message(STATUS "Boost_DATE_TIME_LIBRARY=${Boost_DATE_TIME_LIBRARY}")

4. mkdir btest/build
5. cd btest/build
6. cmake -DBOOST_ROOT= /Developer/opt/Boost/1.54 ..
7. Verify the output and libraries location is as you expect.

Best regards,
--
Mateusz Loskot, http://mateusz.loskot.net
Loading...