Boost is not found when compiling my own code

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

Boost is not found when compiling my own code

Michael Bieri
Hello

I'm currently installing CGAL on different platforms. Normally, it works just fine. But I have one computer where Boost is not installed into the system, but just compiled in a directory. This Boost works properly in combination with other things I'm building, just not with CGAL.

I can compile CGAL using the following Boost-related settings, displayed with ccmake:

 Boost_DEBUG OFF                                                            
 Boost_INCLUDE_DIR /my/boost/boost_1_54_0        
 Boost_LIBRARY_DIR /my/boost/boost_1_54_0/stage/lib
 Boost_SYSTEM_LIBRARY_DEBUG /my/boost/boost_1_54_0/stage/lib
 Boost_SYSTEM_LIBRARY_RELEASE /my/boost/boost_1_54_0/stage/lib
 Boost_THREAD_LIBRARY_DEBUG /my/boost/boost_1_54_0/stage/lib
 Boost_THREAD_LIBRARY_RELEASE /my/boost/boost_1_54_0/stage/lib
 CGAL_Boost_USE_STATIC_LIBS   OFF


Now, I'd like to compile one of my examples. I get the following error: 

*******************************************************

CMake Error at /usr/lib64/boost/Boost.cmake:536 (message):
  The imported target "boost_date_time-static" references the file

     "/usr/lib64/lib64/libboost_date_time.a"

  but this file does not exist.  Possible reasons include:

  * The file was deleted, renamed, or moved to another location.

  * An install or uninstall procedure did not complete successfully.

  * The installation package was faulty and contained

     "/usr/lib64/boost/Boost.cmake"

  but not all the files it references.

*******************************************************

The error itself is not a surprise, because it's a very old Boost there.

Boost-related settings for cmake in my project folder are:

Boost_DEBUG OFF                                                            
Boost_DIR /usr/lib64/boost                                                
Boost_INCLUDE_DIR /usr/include

Whe I change the variables to my own Boost in ccmake, it will also throw the above error and not save the changes.

So I really, really wonder: How do I set Boost properly to compile my own code? (I also tried with environment variables as given in the installation manual, Section 15.7.)

Best regards,
Michael

Reply | Threaded
Open this post in threaded view
|

Re: Boost is not found when compiling my own code

chrism
When compiling against a custom boost with cmake, you can use this in your cmake file to specify the boost directory

set(Boost_NO_SYSTEM_PATHS TRUE)
set(BOOST_ROOT "/my/boost/boost_1_54_0")

the FindBoost.cmake file will then pickup your custom directory 

On 8 August 2017 at 13:14, Michael Bieri <[hidden email]> wrote:
Hello

I'm currently installing CGAL on different platforms. Normally, it works just fine. But I have one computer where Boost is not installed into the system, but just compiled in a directory. This Boost works properly in combination with other things I'm building, just not with CGAL.

I can compile CGAL using the following Boost-related settings, displayed with ccmake:

 Boost_DEBUG OFF                                                            
 Boost_INCLUDE_DIR /my/boost/boost_1_54_0        
 Boost_LIBRARY_DIR /my/boost/boost_1_54_0/stage/lib
 Boost_SYSTEM_LIBRARY_DEBUG /my/boost/boost_1_54_0/stage/lib
 Boost_SYSTEM_LIBRARY_RELEASE /my/boost/boost_1_54_0/stage/lib
 Boost_THREAD_LIBRARY_DEBUG /my/boost/boost_1_54_0/stage/lib
 Boost_THREAD_LIBRARY_RELEASE /my/boost/boost_1_54_0/stage/lib
 CGAL_Boost_USE_STATIC_LIBS   OFF


Now, I'd like to compile one of my examples. I get the following error: 

*******************************************************

CMake Error at /usr/lib64/boost/Boost.cmake:536 (message):
  The imported target "boost_date_time-static" references the file

     "/usr/lib64/lib64/libboost_date_time.a"

  but this file does not exist.  Possible reasons include:

  * The file was deleted, renamed, or moved to another location.

  * An install or uninstall procedure did not complete successfully.

  * The installation package was faulty and contained

     "/usr/lib64/boost/Boost.cmake"

  but not all the files it references.

*******************************************************

The error itself is not a surprise, because it's a very old Boost there.

Boost-related settings for cmake in my project folder are:

Boost_DEBUG OFF                                                            
Boost_DIR /usr/lib64/boost                                                
Boost_INCLUDE_DIR /usr/include

Whe I change the variables to my own Boost in ccmake, it will also throw the above error and not save the changes.

So I really, really wonder: How do I set Boost properly to compile my own code? (I also tried with environment variables as given in the installation manual, Section 15.7.)

Best regards,
Michael


Reply | Threaded
Open this post in threaded view
|

Re: Boost is not found when compiling my own code

Michael Bieri
Hi Chris

Thanks for your answer. Where exactly should I put those lines, and do I need to recompile CGAL afterwards?

Best regards,
Michael

On Tue, Aug 8, 2017 at 9:29 PM, Chris Marsh <[hidden email]> wrote:
When compiling against a custom boost with cmake, you can use this in your cmake file to specify the boost directory

set(Boost_NO_SYSTEM_PATHS TRUE)
set(BOOST_ROOT "/my/boost/boost_1_54_0")

the FindBoost.cmake file will then pickup your custom directory 

On 8 August 2017 at 13:14, Michael Bieri <[hidden email]> wrote:
Hello

I'm currently installing CGAL on different platforms. Normally, it works just fine. But I have one computer where Boost is not installed into the system, but just compiled in a directory. This Boost works properly in combination with other things I'm building, just not with CGAL.

I can compile CGAL using the following Boost-related settings, displayed with ccmake:

 Boost_DEBUG OFF                                                            
 Boost_INCLUDE_DIR /my/boost/boost_1_54_0        
 Boost_LIBRARY_DIR /my/boost/boost_1_54_0/stage/lib
 Boost_SYSTEM_LIBRARY_DEBUG /my/boost/boost_1_54_0/stage/lib
 Boost_SYSTEM_LIBRARY_RELEASE /my/boost/boost_1_54_0/stage/lib
 Boost_THREAD_LIBRARY_DEBUG /my/boost/boost_1_54_0/stage/lib
 Boost_THREAD_LIBRARY_RELEASE /my/boost/boost_1_54_0/stage/lib
 CGAL_Boost_USE_STATIC_LIBS   OFF


Now, I'd like to compile one of my examples. I get the following error: 

*******************************************************

CMake Error at /usr/lib64/boost/Boost.cmake:536 (message):
  The imported target "boost_date_time-static" references the file

     "/usr/lib64/lib64/libboost_date_time.a"

  but this file does not exist.  Possible reasons include:

  * The file was deleted, renamed, or moved to another location.

  * An install or uninstall procedure did not complete successfully.

  * The installation package was faulty and contained

     "/usr/lib64/boost/Boost.cmake"

  but not all the files it references.

*******************************************************

The error itself is not a surprise, because it's a very old Boost there.

Boost-related settings for cmake in my project folder are:

Boost_DEBUG OFF                                                            
Boost_DIR /usr/lib64/boost                                                
Boost_INCLUDE_DIR /usr/include

Whe I change the variables to my own Boost in ccmake, it will also throw the above error and not save the changes.

So I really, really wonder: How do I set Boost properly to compile my own code? (I also tried with environment variables as given in the installation manual, Section 15.7.)

Best regards,
Michael



Reply | Threaded
Open this post in threaded view
|

Re: Boost is not found when compiling my own code

chrism
You put them before the find_package(Boost REQUIRED) call in your cmake file. You will not need to recompile boost.

For example:

set(Boost_NO_SYSTEM_PATHS TRUE)
set(BOOST_ROOT "/my/boost/boost_1_54_0")
find_package(Boost REQUIRED)
message(STATUS "Found boost incl: ${Boost_INCLUDE_DIR}")
message(STATUS "Boost libs to link: ${Boost_LIBRARIES}")
message(STATUS "Found boost lib: ${Boost_LIBRARY_DIRS}")

should print your custom boost library path


On 8 August 2017 at 13:37, Michael Bieri <[hidden email]> wrote:
Hi Chris

Thanks for your answer. Where exactly should I put those lines, and do I need to recompile CGAL afterwards?

Best regards,
Michael

On Tue, Aug 8, 2017 at 9:29 PM, Chris Marsh <[hidden email]> wrote:
When compiling against a custom boost with cmake, you can use this in your cmake file to specify the boost directory

set(Boost_NO_SYSTEM_PATHS TRUE)
set(BOOST_ROOT "/my/boost/boost_1_54_0")

the FindBoost.cmake file will then pickup your custom directory 

On 8 August 2017 at 13:14, Michael Bieri <[hidden email]> wrote:
Hello

I'm currently installing CGAL on different platforms. Normally, it works just fine. But I have one computer where Boost is not installed into the system, but just compiled in a directory. This Boost works properly in combination with other things I'm building, just not with CGAL.

I can compile CGAL using the following Boost-related settings, displayed with ccmake:

 Boost_DEBUG OFF                                                            
 Boost_INCLUDE_DIR /my/boost/boost_1_54_0        
 Boost_LIBRARY_DIR /my/boost/boost_1_54_0/stage/lib
 Boost_SYSTEM_LIBRARY_DEBUG /my/boost/boost_1_54_0/stage/lib
 Boost_SYSTEM_LIBRARY_RELEASE /my/boost/boost_1_54_0/stage/lib
 Boost_THREAD_LIBRARY_DEBUG /my/boost/boost_1_54_0/stage/lib
 Boost_THREAD_LIBRARY_RELEASE /my/boost/boost_1_54_0/stage/lib
 CGAL_Boost_USE_STATIC_LIBS   OFF


Now, I'd like to compile one of my examples. I get the following error: 

*******************************************************

CMake Error at /usr/lib64/boost/Boost.cmake:536 (message):
  The imported target "boost_date_time-static" references the file

     "/usr/lib64/lib64/libboost_date_time.a"

  but this file does not exist.  Possible reasons include:

  * The file was deleted, renamed, or moved to another location.

  * An install or uninstall procedure did not complete successfully.

  * The installation package was faulty and contained

     "/usr/lib64/boost/Boost.cmake"

  but not all the files it references.

*******************************************************

The error itself is not a surprise, because it's a very old Boost there.

Boost-related settings for cmake in my project folder are:

Boost_DEBUG OFF                                                            
Boost_DIR /usr/lib64/boost                                                
Boost_INCLUDE_DIR /usr/include

Whe I change the variables to my own Boost in ccmake, it will also throw the above error and not save the changes.

So I really, really wonder: How do I set Boost properly to compile my own code? (I also tried with environment variables as given in the installation manual, Section 15.7.)

Best regards,
Michael




Reply | Threaded
Open this post in threaded view
|

Re: Boost is not found when compiling my own code

Michael Bieri
Just in the cmake file of my project, or in the cmake file for building CGAL?

On Tue, Aug 8, 2017 at 9:48 PM, Chris Marsh <[hidden email]> wrote:
You put them before the find_package(Boost REQUIRED) call in your cmake file. You will not need to recompile boost.

For example:

set(Boost_NO_SYSTEM_PATHS TRUE)
set(BOOST_ROOT "/my/boost/boost_1_54_0")
find_package(Boost REQUIRED)
message(STATUS "Found boost incl: ${Boost_INCLUDE_DIR}")
message(STATUS "Boost libs to link: ${Boost_LIBRARIES}")
message(STATUS "Found boost lib: ${Boost_LIBRARY_DIRS}")

should print your custom boost library path


On 8 August 2017 at 13:37, Michael Bieri <[hidden email]> wrote:
Hi Chris

Thanks for your answer. Where exactly should I put those lines, and do I need to recompile CGAL afterwards?

Best regards,
Michael

On Tue, Aug 8, 2017 at 9:29 PM, Chris Marsh <[hidden email]> wrote:
When compiling against a custom boost with cmake, you can use this in your cmake file to specify the boost directory

set(Boost_NO_SYSTEM_PATHS TRUE)
set(BOOST_ROOT "/my/boost/boost_1_54_0")

the FindBoost.cmake file will then pickup your custom directory 

On 8 August 2017 at 13:14, Michael Bieri <[hidden email]> wrote:
Hello

I'm currently installing CGAL on different platforms. Normally, it works just fine. But I have one computer where Boost is not installed into the system, but just compiled in a directory. This Boost works properly in combination with other things I'm building, just not with CGAL.

I can compile CGAL using the following Boost-related settings, displayed with ccmake:

 Boost_DEBUG OFF                                                            
 Boost_INCLUDE_DIR /my/boost/boost_1_54_0        
 Boost_LIBRARY_DIR /my/boost/boost_1_54_0/stage/lib
 Boost_SYSTEM_LIBRARY_DEBUG /my/boost/boost_1_54_0/stage/lib
 Boost_SYSTEM_LIBRARY_RELEASE /my/boost/boost_1_54_0/stage/lib
 Boost_THREAD_LIBRARY_DEBUG /my/boost/boost_1_54_0/stage/lib
 Boost_THREAD_LIBRARY_RELEASE /my/boost/boost_1_54_0/stage/lib
 CGAL_Boost_USE_STATIC_LIBS   OFF


Now, I'd like to compile one of my examples. I get the following error: 

*******************************************************

CMake Error at /usr/lib64/boost/Boost.cmake:536 (message):
  The imported target "boost_date_time-static" references the file

     "/usr/lib64/lib64/libboost_date_time.a"

  but this file does not exist.  Possible reasons include:

  * The file was deleted, renamed, or moved to another location.

  * An install or uninstall procedure did not complete successfully.

  * The installation package was faulty and contained

     "/usr/lib64/boost/Boost.cmake"

  but not all the files it references.

*******************************************************

The error itself is not a surprise, because it's a very old Boost there.

Boost-related settings for cmake in my project folder are:

Boost_DEBUG OFF                                                            
Boost_DIR /usr/lib64/boost                                                
Boost_INCLUDE_DIR /usr/include

Whe I change the variables to my own Boost in ccmake, it will also throw the above error and not save the changes.

So I really, really wonder: How do I set Boost properly to compile my own code? (I also tried with environment variables as given in the installation manual, Section 15.7.)

Best regards,
Michael





Reply | Threaded
Open this post in threaded view
|

Re: Boost is not found when compiling my own code

chrism
In your project cmake.

And I would not manually set these variables
Boost_DIR /usr/lib64/boost                                                
Boost_INCLUDE_DIR /usr/include

I would let the find_pacakge call do that for you.


On 8 August 2017 at 13:56, Michael Bieri <[hidden email]> wrote:
Just in the cmake file of my project, or in the cmake file for building CGAL?

On Tue, Aug 8, 2017 at 9:48 PM, Chris Marsh <[hidden email]> wrote:
You put them before the find_package(Boost REQUIRED) call in your cmake file. You will not need to recompile boost.

For example:

set(Boost_NO_SYSTEM_PATHS TRUE)
set(BOOST_ROOT "/my/boost/boost_1_54_0")
find_package(Boost REQUIRED)
message(STATUS "Found boost incl: ${Boost_INCLUDE_DIR}")
message(STATUS "Boost libs to link: ${Boost_LIBRARIES}")
message(STATUS "Found boost lib: ${Boost_LIBRARY_DIRS}")

should print your custom boost library path


On 8 August 2017 at 13:37, Michael Bieri <[hidden email]> wrote:
Hi Chris

Thanks for your answer. Where exactly should I put those lines, and do I need to recompile CGAL afterwards?

Best regards,
Michael

On Tue, Aug 8, 2017 at 9:29 PM, Chris Marsh <[hidden email]> wrote:
When compiling against a custom boost with cmake, you can use this in your cmake file to specify the boost directory

set(Boost_NO_SYSTEM_PATHS TRUE)
set(BOOST_ROOT "/my/boost/boost_1_54_0")

the FindBoost.cmake file will then pickup your custom directory 

On 8 August 2017 at 13:14, Michael Bieri <[hidden email]> wrote:
Hello

I'm currently installing CGAL on different platforms. Normally, it works just fine. But I have one computer where Boost is not installed into the system, but just compiled in a directory. This Boost works properly in combination with other things I'm building, just not with CGAL.

I can compile CGAL using the following Boost-related settings, displayed with ccmake:

 Boost_DEBUG OFF                                                            
 Boost_INCLUDE_DIR /my/boost/boost_1_54_0        
 Boost_LIBRARY_DIR /my/boost/boost_1_54_0/stage/lib
 Boost_SYSTEM_LIBRARY_DEBUG /my/boost/boost_1_54_0/stage/lib
 Boost_SYSTEM_LIBRARY_RELEASE /my/boost/boost_1_54_0/stage/lib
 Boost_THREAD_LIBRARY_DEBUG /my/boost/boost_1_54_0/stage/lib
 Boost_THREAD_LIBRARY_RELEASE /my/boost/boost_1_54_0/stage/lib
 CGAL_Boost_USE_STATIC_LIBS   OFF


Now, I'd like to compile one of my examples. I get the following error: 

*******************************************************

CMake Error at /usr/lib64/boost/Boost.cmake:536 (message):
  The imported target "boost_date_time-static" references the file

     "/usr/lib64/lib64/libboost_date_time.a"

  but this file does not exist.  Possible reasons include:

  * The file was deleted, renamed, or moved to another location.

  * An install or uninstall procedure did not complete successfully.

  * The installation package was faulty and contained

     "/usr/lib64/boost/Boost.cmake"

  but not all the files it references.

*******************************************************

The error itself is not a surprise, because it's a very old Boost there.

Boost-related settings for cmake in my project folder are:

Boost_DEBUG OFF                                                            
Boost_DIR /usr/lib64/boost                                                
Boost_INCLUDE_DIR /usr/include

Whe I change the variables to my own Boost in ccmake, it will also throw the above error and not save the changes.

So I really, really wonder: How do I set Boost properly to compile my own code? (I also tried with environment variables as given in the installation manual, Section 15.7.)

Best regards,
Michael






Reply | Threaded
Open this post in threaded view
|

Re: Boost is not found when compiling my own code

Michael Bieri
Ok, I tried to do this, but I get the following result when running it with --trace:

/my/project/CMakeLists.txt(25):  set(Boost_NO_SYSTEM_PATHS TRUE )
/my/project/CMakeLists.txt(26):  set(BOOST_ROOT /my/boost )
/my/project/CMakeLists.txt(27):  find_package(Boost REQUIRED )
/usr/share/cmake/Modules/FindBoost.cmake(163):  if(NOT Boost_NO_BOOST_CMAKE )
/usr/share/cmake/Modules/FindBoost.cmake(166):  if($ENV{Boost_DIR} STREQUAL  )
/usr/share/cmake/Modules/FindBoost.cmake(167):  if(NOT $ENV{BOOST_ROOT} STREQUAL  )
/usr/share/cmake/Modules/FindBoost.cmake(168):  set(ENV{Boost_DIR} $ENV{BOOST_ROOT} )
/usr/share/cmake/Modules/FindBoost.cmake(177):  find_package(Boost QUIET NO_MODULE )
/usr/lib64/boost/BoostConfigVersion.cmake(12):  if(${PACKAGE_FIND_VERSION_MAJOR}.${PACKAGE_FIND_VERSION_MINOR}.${PACKAGE_FIND_VERSION_PATCH} STREQUAL 1.41.0 )
/usr/lib64/boost/BoostConfig.cmake(20):  set(Boost_VERSION 1.41.0 )
/usr/lib64/boost/BoostConfig.cmake(21):  set(Boost_INCLUDE_DIRS /usr/include )
/usr/lib64/boost/BoostConfig.cmake(22):  set(Boost_INCLUDE_DIR /usr/include CACHE FILEPATH Boost include directory )
/usr/lib64/boost/BoostConfig.cmake(24):  set(Boost_LIBRARY_DIRS /usr/lib64 )

This will then again lead to the same error as before.

It seems that cmake absolutely wants to go into /usr/share/cmake/Modules/FindBoost.cmake and then /usr/lib64/boost/BoostConfig.cmake, no matter wheter I set Boost_NO_SYSTEM_PATHS TRUE. 

Best regards,
Michael



On Tue, Aug 8, 2017 at 10:00 PM, Chris Marsh <[hidden email]> wrote:
In your project cmake.

And I would not manually set these variables
Boost_DIR /usr/lib64/boost                                                
Boost_INCLUDE_DIR /usr/include

I would let the find_pacakge call do that for you.


On 8 August 2017 at 13:56, Michael Bieri <[hidden email]> wrote:
Just in the cmake file of my project, or in the cmake file for building CGAL?

On Tue, Aug 8, 2017 at 9:48 PM, Chris Marsh <[hidden email]> wrote:
You put them before the find_package(Boost REQUIRED) call in your cmake file. You will not need to recompile boost.

For example:

set(Boost_NO_SYSTEM_PATHS TRUE)
set(BOOST_ROOT "/my/boost/boost_1_54_0")
find_package(Boost REQUIRED)
message(STATUS "Found boost incl: ${Boost_INCLUDE_DIR}")
message(STATUS "Boost libs to link: ${Boost_LIBRARIES}")
message(STATUS "Found boost lib: ${Boost_LIBRARY_DIRS}")

should print your custom boost library path


On 8 August 2017 at 13:37, Michael Bieri <[hidden email]> wrote:
Hi Chris

Thanks for your answer. Where exactly should I put those lines, and do I need to recompile CGAL afterwards?

Best regards,
Michael

On Tue, Aug 8, 2017 at 9:29 PM, Chris Marsh <[hidden email]> wrote:
When compiling against a custom boost with cmake, you can use this in your cmake file to specify the boost directory

set(Boost_NO_SYSTEM_PATHS TRUE)
set(BOOST_ROOT "/my/boost/boost_1_54_0")

the FindBoost.cmake file will then pickup your custom directory 

On 8 August 2017 at 13:14, Michael Bieri <[hidden email]> wrote:
Hello

I'm currently installing CGAL on different platforms. Normally, it works just fine. But I have one computer where Boost is not installed into the system, but just compiled in a directory. This Boost works properly in combination with other things I'm building, just not with CGAL.

I can compile CGAL using the following Boost-related settings, displayed with ccmake:

 Boost_DEBUG OFF                                                            
 Boost_INCLUDE_DIR /my/boost/boost_1_54_0        
 Boost_LIBRARY_DIR /my/boost/boost_1_54_0/stage/lib
 Boost_SYSTEM_LIBRARY_DEBUG /my/boost/boost_1_54_0/stage/lib
 Boost_SYSTEM_LIBRARY_RELEASE /my/boost/boost_1_54_0/stage/lib
 Boost_THREAD_LIBRARY_DEBUG /my/boost/boost_1_54_0/stage/lib
 Boost_THREAD_LIBRARY_RELEASE /my/boost/boost_1_54_0/stage/lib
 CGAL_Boost_USE_STATIC_LIBS   OFF


Now, I'd like to compile one of my examples. I get the following error: 

*******************************************************

CMake Error at /usr/lib64/boost/Boost.cmake:536 (message):
  The imported target "boost_date_time-static" references the file

     "/usr/lib64/lib64/libboost_date_time.a"

  but this file does not exist.  Possible reasons include:

  * The file was deleted, renamed, or moved to another location.

  * An install or uninstall procedure did not complete successfully.

  * The installation package was faulty and contained

     "/usr/lib64/boost/Boost.cmake"

  but not all the files it references.

*******************************************************

The error itself is not a surprise, because it's a very old Boost there.

Boost-related settings for cmake in my project folder are:

Boost_DEBUG OFF                                                            
Boost_DIR /usr/lib64/boost                                                
Boost_INCLUDE_DIR /usr/include

Whe I change the variables to my own Boost in ccmake, it will also throw the above error and not save the changes.

So I really, really wonder: How do I set Boost properly to compile my own code? (I also tried with environment variables as given in the installation manual, Section 15.7.)

Best regards,
Michael







Reply | Threaded
Open this post in threaded view
|

Re: Boost is not found when compiling my own code

Jesse Blankenship
can I get removed from the list?

Jesse Coors-Blankenship

CEO
FRUSTUM INC.
New York:  212.812.1446
Boulder:     303.317.6188
Fax:           303.279.0414

On Tue, Aug 8, 2017 at 2:10 PM, Michael Bieri <[hidden email]> wrote:
Ok, I tried to do this, but I get the following result when running it with --trace:

/my/project/CMakeLists.txt(25):  set(Boost_NO_SYSTEM_PATHS TRUE )
/my/project/CMakeLists.txt(26):  set(BOOST_ROOT /my/boost )
/my/project/CMakeLists.txt(27):  find_package(Boost REQUIRED )
/usr/share/cmake/Modules/FindBoost.cmake(163):  if(NOT Boost_NO_BOOST_CMAKE )
/usr/share/cmake/Modules/FindBoost.cmake(166):  if($ENV{Boost_DIR} STREQUAL  )
/usr/share/cmake/Modules/FindBoost.cmake(167):  if(NOT $ENV{BOOST_ROOT} STREQUAL  )
/usr/share/cmake/Modules/FindBoost.cmake(168):  set(ENV{Boost_DIR} $ENV{BOOST_ROOT} )
/usr/share/cmake/Modules/FindBoost.cmake(177):  find_package(Boost QUIET NO_MODULE )
/usr/lib64/boost/BoostConfigVersion.cmake(12):  if(${PACKAGE_FIND_VERSION_MAJOR}.${PACKAGE_FIND_VERSION_MINOR}.${PACKAGE_FIND_VERSION_PATCH} STREQUAL 1.41.0 )
/usr/lib64/boost/BoostConfig.cmake(20):  set(Boost_VERSION 1.41.0 )
/usr/lib64/boost/BoostConfig.cmake(21):  set(Boost_INCLUDE_DIRS /usr/include )
/usr/lib64/boost/BoostConfig.cmake(22):  set(Boost_INCLUDE_DIR /usr/include CACHE FILEPATH Boost include directory )
/usr/lib64/boost/BoostConfig.cmake(24):  set(Boost_LIBRARY_DIRS /usr/lib64 )

This will then again lead to the same error as before.

It seems that cmake absolutely wants to go into /usr/share/cmake/Modules/FindBoost.cmake and then /usr/lib64/boost/BoostConfig.cmake, no matter wheter I set Boost_NO_SYSTEM_PATHS TRUE. 

Best regards,
Michael



On Tue, Aug 8, 2017 at 10:00 PM, Chris Marsh <[hidden email]> wrote:
In your project cmake.

And I would not manually set these variables
Boost_DIR /usr/lib64/boost                                                
Boost_INCLUDE_DIR /usr/include

I would let the find_pacakge call do that for you.


On 8 August 2017 at 13:56, Michael Bieri <[hidden email]> wrote:
Just in the cmake file of my project, or in the cmake file for building CGAL?

On Tue, Aug 8, 2017 at 9:48 PM, Chris Marsh <[hidden email]> wrote:
You put them before the find_package(Boost REQUIRED) call in your cmake file. You will not need to recompile boost.

For example:

set(Boost_NO_SYSTEM_PATHS TRUE)
set(BOOST_ROOT "/my/boost/boost_1_54_0")
find_package(Boost REQUIRED)
message(STATUS "Found boost incl: ${Boost_INCLUDE_DIR}")
message(STATUS "Boost libs to link: ${Boost_LIBRARIES}")
message(STATUS "Found boost lib: ${Boost_LIBRARY_DIRS}")

should print your custom boost library path


On 8 August 2017 at 13:37, Michael Bieri <[hidden email]> wrote:
Hi Chris

Thanks for your answer. Where exactly should I put those lines, and do I need to recompile CGAL afterwards?

Best regards,
Michael

On Tue, Aug 8, 2017 at 9:29 PM, Chris Marsh <[hidden email]> wrote:
When compiling against a custom boost with cmake, you can use this in your cmake file to specify the boost directory

set(Boost_NO_SYSTEM_PATHS TRUE)
set(BOOST_ROOT "/my/boost/boost_1_54_0")

the FindBoost.cmake file will then pickup your custom directory 

On 8 August 2017 at 13:14, Michael Bieri <[hidden email]> wrote:
Hello

I'm currently installing CGAL on different platforms. Normally, it works just fine. But I have one computer where Boost is not installed into the system, but just compiled in a directory. This Boost works properly in combination with other things I'm building, just not with CGAL.

I can compile CGAL using the following Boost-related settings, displayed with ccmake:

 Boost_DEBUG OFF                                                            
 Boost_INCLUDE_DIR /my/boost/boost_1_54_0        
 Boost_LIBRARY_DIR /my/boost/boost_1_54_0/stage/lib
 Boost_SYSTEM_LIBRARY_DEBUG /my/boost/boost_1_54_0/stage/lib
 Boost_SYSTEM_LIBRARY_RELEASE /my/boost/boost_1_54_0/stage/lib
 Boost_THREAD_LIBRARY_DEBUG /my/boost/boost_1_54_0/stage/lib
 Boost_THREAD_LIBRARY_RELEASE /my/boost/boost_1_54_0/stage/lib
 CGAL_Boost_USE_STATIC_LIBS   OFF


Now, I'd like to compile one of my examples. I get the following error: 

*******************************************************

CMake Error at /usr/lib64/boost/Boost.cmake:536 (message):
  The imported target "boost_date_time-static" references the file

     "/usr/lib64/lib64/libboost_date_time.a"

  but this file does not exist.  Possible reasons include:

  * The file was deleted, renamed, or moved to another location.

  * An install or uninstall procedure did not complete successfully.

  * The installation package was faulty and contained

     "/usr/lib64/boost/Boost.cmake"

  but not all the files it references.

*******************************************************

The error itself is not a surprise, because it's a very old Boost there.

Boost-related settings for cmake in my project folder are:

Boost_DEBUG OFF                                                            
Boost_DIR /usr/lib64/boost                                                
Boost_INCLUDE_DIR /usr/include

Whe I change the variables to my own Boost in ccmake, it will also throw the above error and not save the changes.

So I really, really wonder: How do I set Boost properly to compile my own code? (I also tried with environment variables as given in the installation manual, Section 15.7.)

Best regards,
Michael








Reply | Threaded
Open this post in threaded view
|

Re: Boost is not found when compiling my own code

Michael Bieri
In reply to this post by Michael Bieri
Ok, I think I finally got it when setting one more variable, Boost_NO_BOOST_CMAKE:

set(Boost_NO_SYSTEM_PATHS TRUE)
set(Boost_NO_BOOST_CMAKE TRUE)
set(BOOST_ROOT "/my/boost/boost_1_54_0")
find_package(Boost REQUIRED)

Best regards,
Michael


On Tue, Aug 8, 2017 at 10:10 PM, Michael Bieri <[hidden email]> wrote:
Ok, I tried to do this, but I get the following result when running it with --trace:

/my/project/CMakeLists.txt(25):  set(Boost_NO_SYSTEM_PATHS TRUE )
/my/project/CMakeLists.txt(26):  set(BOOST_ROOT /my/boost )
/my/project/CMakeLists.txt(27):  find_package(Boost REQUIRED )
/usr/share/cmake/Modules/FindBoost.cmake(163):  if(NOT Boost_NO_BOOST_CMAKE )
/usr/share/cmake/Modules/FindBoost.cmake(166):  if($ENV{Boost_DIR} STREQUAL  )
/usr/share/cmake/Modules/FindBoost.cmake(167):  if(NOT $ENV{BOOST_ROOT} STREQUAL  )
/usr/share/cmake/Modules/FindBoost.cmake(168):  set(ENV{Boost_DIR} $ENV{BOOST_ROOT} )
/usr/share/cmake/Modules/FindBoost.cmake(177):  find_package(Boost QUIET NO_MODULE )
/usr/lib64/boost/BoostConfigVersion.cmake(12):  if(${PACKAGE_FIND_VERSION_MAJOR}.${PACKAGE_FIND_VERSION_MINOR}.${PACKAGE_FIND_VERSION_PATCH} STREQUAL 1.41.0 )
/usr/lib64/boost/BoostConfig.cmake(20):  set(Boost_VERSION 1.41.0 )
/usr/lib64/boost/BoostConfig.cmake(21):  set(Boost_INCLUDE_DIRS /usr/include )
/usr/lib64/boost/BoostConfig.cmake(22):  set(Boost_INCLUDE_DIR /usr/include CACHE FILEPATH Boost include directory )
/usr/lib64/boost/BoostConfig.cmake(24):  set(Boost_LIBRARY_DIRS /usr/lib64 )

This will then again lead to the same error as before.

It seems that cmake absolutely wants to go into /usr/share/cmake/Modules/FindBoost.cmake and then /usr/lib64/boost/BoostConfig.cmake, no matter wheter I set Boost_NO_SYSTEM_PATHS TRUE. 

Best regards,
Michael



On Tue, Aug 8, 2017 at 10:00 PM, Chris Marsh <[hidden email]> wrote:
In your project cmake.

And I would not manually set these variables
Boost_DIR /usr/lib64/boost                                                
Boost_INCLUDE_DIR /usr/include

I would let the find_pacakge call do that for you.


On 8 August 2017 at 13:56, Michael Bieri <[hidden email]> wrote:
Just in the cmake file of my project, or in the cmake file for building CGAL?

On Tue, Aug 8, 2017 at 9:48 PM, Chris Marsh <[hidden email]> wrote:
You put them before the find_package(Boost REQUIRED) call in your cmake file. You will not need to recompile boost.

For example:

set(Boost_NO_SYSTEM_PATHS TRUE)
set(BOOST_ROOT "/my/boost/boost_1_54_0")
find_package(Boost REQUIRED)
message(STATUS "Found boost incl: ${Boost_INCLUDE_DIR}")
message(STATUS "Boost libs to link: ${Boost_LIBRARIES}")
message(STATUS "Found boost lib: ${Boost_LIBRARY_DIRS}")

should print your custom boost library path


On 8 August 2017 at 13:37, Michael Bieri <[hidden email]> wrote:
Hi Chris

Thanks for your answer. Where exactly should I put those lines, and do I need to recompile CGAL afterwards?

Best regards,
Michael

On Tue, Aug 8, 2017 at 9:29 PM, Chris Marsh <[hidden email]> wrote:
When compiling against a custom boost with cmake, you can use this in your cmake file to specify the boost directory

set(Boost_NO_SYSTEM_PATHS TRUE)
set(BOOST_ROOT "/my/boost/boost_1_54_0")

the FindBoost.cmake file will then pickup your custom directory 

On 8 August 2017 at 13:14, Michael Bieri <[hidden email]> wrote:
Hello

I'm currently installing CGAL on different platforms. Normally, it works just fine. But I have one computer where Boost is not installed into the system, but just compiled in a directory. This Boost works properly in combination with other things I'm building, just not with CGAL.

I can compile CGAL using the following Boost-related settings, displayed with ccmake:

 Boost_DEBUG OFF                                                            
 Boost_INCLUDE_DIR /my/boost/boost_1_54_0        
 Boost_LIBRARY_DIR /my/boost/boost_1_54_0/stage/lib
 Boost_SYSTEM_LIBRARY_DEBUG /my/boost/boost_1_54_0/stage/lib
 Boost_SYSTEM_LIBRARY_RELEASE /my/boost/boost_1_54_0/stage/lib
 Boost_THREAD_LIBRARY_DEBUG /my/boost/boost_1_54_0/stage/lib
 Boost_THREAD_LIBRARY_RELEASE /my/boost/boost_1_54_0/stage/lib
 CGAL_Boost_USE_STATIC_LIBS   OFF


Now, I'd like to compile one of my examples. I get the following error: 

*******************************************************

CMake Error at /usr/lib64/boost/Boost.cmake:536 (message):
  The imported target "boost_date_time-static" references the file

     "/usr/lib64/lib64/libboost_date_time.a"

  but this file does not exist.  Possible reasons include:

  * The file was deleted, renamed, or moved to another location.

  * An install or uninstall procedure did not complete successfully.

  * The installation package was faulty and contained

     "/usr/lib64/boost/Boost.cmake"

  but not all the files it references.

*******************************************************

The error itself is not a surprise, because it's a very old Boost there.

Boost-related settings for cmake in my project folder are:

Boost_DEBUG OFF                                                            
Boost_DIR /usr/lib64/boost                                                
Boost_INCLUDE_DIR /usr/include

Whe I change the variables to my own Boost in ccmake, it will also throw the above error and not save the changes.

So I really, really wonder: How do I set Boost properly to compile my own code? (I also tried with environment variables as given in the installation manual, Section 15.7.)

Best regards,
Michael








Reply | Threaded
Open this post in threaded view
|

Re: Boost is not found when compiling my own code

chrism
In reply to this post by Michael Bieri
CMake caches a lot of values, and my guess is you're still seeing these cached values. If you place your CMakeLists.txt file (for your project) in a clean folder, does it work?

Alternatively, I use this in a bash script to clean out all the cmake's files to start fresh

#!/bin/bash
CMAKECACHE=`find . -type f  -name "CMakeCache.txt"`
rm -rf $CMAKECACHE

CMAKEFILES=`find . -type d -name "CMakeFiles"`
rm -rf $CMAKEFILES

MAKEFILES=`find . -type f -name "Makefile"`
rm -rf $MAKEFILES

CMAKEINSTALL=`find . -type f -name "cmake_install.cmake"`
rm -rf $CMAKEINSTALL 

CMAKETEST=`find .  -type f -name "CTestTestfile.cmake"`
rm -rf $CMAKETEST

Chris Marsh
PhD Candidate
chrismarsh.ca

13 Kirk Hall
University of Saskatchewan

On 8 August 2017 at 14:10, Michael Bieri <[hidden email]> wrote:
Ok, I tried to do this, but I get the following result when running it with --trace:

/my/project/CMakeLists.txt(25):  set(Boost_NO_SYSTEM_PATHS TRUE )
/my/project/CMakeLists.txt(26):  set(BOOST_ROOT /my/boost )
/my/project/CMakeLists.txt(27):  find_package(Boost REQUIRED )
/usr/share/cmake/Modules/FindBoost.cmake(163):  if(NOT Boost_NO_BOOST_CMAKE )
/usr/share/cmake/Modules/FindBoost.cmake(166):  if($ENV{Boost_DIR} STREQUAL  )
/usr/share/cmake/Modules/FindBoost.cmake(167):  if(NOT $ENV{BOOST_ROOT} STREQUAL  )
/usr/share/cmake/Modules/FindBoost.cmake(168):  set(ENV{Boost_DIR} $ENV{BOOST_ROOT} )
/usr/share/cmake/Modules/FindBoost.cmake(177):  find_package(Boost QUIET NO_MODULE )
/usr/lib64/boost/BoostConfigVersion.cmake(12):  if(${PACKAGE_FIND_VERSION_MAJOR}.${PACKAGE_FIND_VERSION_MINOR}.${PACKAGE_FIND_VERSION_PATCH} STREQUAL 1.41.0 )
/usr/lib64/boost/BoostConfig.cmake(20):  set(Boost_VERSION 1.41.0 )
/usr/lib64/boost/BoostConfig.cmake(21):  set(Boost_INCLUDE_DIRS /usr/include )
/usr/lib64/boost/BoostConfig.cmake(22):  set(Boost_INCLUDE_DIR /usr/include CACHE FILEPATH Boost include directory )
/usr/lib64/boost/BoostConfig.cmake(24):  set(Boost_LIBRARY_DIRS /usr/lib64 )

This will then again lead to the same error as before.

It seems that cmake absolutely wants to go into /usr/share/cmake/Modules/FindBoost.cmake and then /usr/lib64/boost/BoostConfig.cmake, no matter wheter I set Boost_NO_SYSTEM_PATHS TRUE. 

Best regards,
Michael



On Tue, Aug 8, 2017 at 10:00 PM, Chris Marsh <[hidden email]> wrote:
In your project cmake.

And I would not manually set these variables
Boost_DIR /usr/lib64/boost                                                
Boost_INCLUDE_DIR /usr/include

I would let the find_pacakge call do that for you.


On 8 August 2017 at 13:56, Michael Bieri <[hidden email]> wrote:
Just in the cmake file of my project, or in the cmake file for building CGAL?

On Tue, Aug 8, 2017 at 9:48 PM, Chris Marsh <[hidden email]> wrote:
You put them before the find_package(Boost REQUIRED) call in your cmake file. You will not need to recompile boost.

For example:

set(Boost_NO_SYSTEM_PATHS TRUE)
set(BOOST_ROOT "/my/boost/boost_1_54_0")
find_package(Boost REQUIRED)
message(STATUS "Found boost incl: ${Boost_INCLUDE_DIR}")
message(STATUS "Boost libs to link: ${Boost_LIBRARIES}")
message(STATUS "Found boost lib: ${Boost_LIBRARY_DIRS}")

should print your custom boost library path


On 8 August 2017 at 13:37, Michael Bieri <[hidden email]> wrote:
Hi Chris

Thanks for your answer. Where exactly should I put those lines, and do I need to recompile CGAL afterwards?

Best regards,
Michael

On Tue, Aug 8, 2017 at 9:29 PM, Chris Marsh <[hidden email]> wrote:
When compiling against a custom boost with cmake, you can use this in your cmake file to specify the boost directory

set(Boost_NO_SYSTEM_PATHS TRUE)
set(BOOST_ROOT "/my/boost/boost_1_54_0")

the FindBoost.cmake file will then pickup your custom directory 

On 8 August 2017 at 13:14, Michael Bieri <[hidden email]> wrote:
Hello

I'm currently installing CGAL on different platforms. Normally, it works just fine. But I have one computer where Boost is not installed into the system, but just compiled in a directory. This Boost works properly in combination with other things I'm building, just not with CGAL.

I can compile CGAL using the following Boost-related settings, displayed with ccmake:

 Boost_DEBUG OFF                                                            
 Boost_INCLUDE_DIR /my/boost/boost_1_54_0        
 Boost_LIBRARY_DIR /my/boost/boost_1_54_0/stage/lib
 Boost_SYSTEM_LIBRARY_DEBUG /my/boost/boost_1_54_0/stage/lib
 Boost_SYSTEM_LIBRARY_RELEASE /my/boost/boost_1_54_0/stage/lib
 Boost_THREAD_LIBRARY_DEBUG /my/boost/boost_1_54_0/stage/lib
 Boost_THREAD_LIBRARY_RELEASE /my/boost/boost_1_54_0/stage/lib
 CGAL_Boost_USE_STATIC_LIBS   OFF


Now, I'd like to compile one of my examples. I get the following error: 

*******************************************************

CMake Error at /usr/lib64/boost/Boost.cmake:536 (message):
  The imported target "boost_date_time-static" references the file

     "/usr/lib64/lib64/libboost_date_time.a"

  but this file does not exist.  Possible reasons include:

  * The file was deleted, renamed, or moved to another location.

  * An install or uninstall procedure did not complete successfully.

  * The installation package was faulty and contained

     "/usr/lib64/boost/Boost.cmake"

  but not all the files it references.

*******************************************************

The error itself is not a surprise, because it's a very old Boost there.

Boost-related settings for cmake in my project folder are:

Boost_DEBUG OFF                                                            
Boost_DIR /usr/lib64/boost                                                
Boost_INCLUDE_DIR /usr/include

Whe I change the variables to my own Boost in ccmake, it will also throw the above error and not save the changes.

So I really, really wonder: How do I set Boost properly to compile my own code? (I also tried with environment variables as given in the installation manual, Section 15.7.)

Best regards,
Michael








Reply | Threaded
Open this post in threaded view
|

Re: Boost is not found when compiling my own code

chrism
In reply to this post by Jesse Blankenship
you can unsub here
https://sympa.inria.fr/sympa/sigrequest/cgal-discuss


On 8 August 2017 at 14:10, Jesse Blankenship <[hidden email]> wrote:
can I get removed from the list?

Jesse Coors-Blankenship

CEO
FRUSTUM INC.
New York:  <a href="tel:(212)%20812-1446" value="+12128121446" target="_blank">212.812.1446
Boulder:     <a href="tel:(303)%20317-6188" value="+13033176188" target="_blank">303.317.6188
Fax:           <a href="tel:(303)%20279-0414" value="+13032790414" target="_blank">303.279.0414

On Tue, Aug 8, 2017 at 2:10 PM, Michael Bieri <[hidden email]> wrote:
Ok, I tried to do this, but I get the following result when running it with --trace:

/my/project/CMakeLists.txt(25):  set(Boost_NO_SYSTEM_PATHS TRUE )
/my/project/CMakeLists.txt(26):  set(BOOST_ROOT /my/boost )
/my/project/CMakeLists.txt(27):  find_package(Boost REQUIRED )
/usr/share/cmake/Modules/FindBoost.cmake(163):  if(NOT Boost_NO_BOOST_CMAKE )
/usr/share/cmake/Modules/FindBoost.cmake(166):  if($ENV{Boost_DIR} STREQUAL  )
/usr/share/cmake/Modules/FindBoost.cmake(167):  if(NOT $ENV{BOOST_ROOT} STREQUAL  )
/usr/share/cmake/Modules/FindBoost.cmake(168):  set(ENV{Boost_DIR} $ENV{BOOST_ROOT} )
/usr/share/cmake/Modules/FindBoost.cmake(177):  find_package(Boost QUIET NO_MODULE )
/usr/lib64/boost/BoostConfigVersion.cmake(12):  if(${PACKAGE_FIND_VERSION_MAJOR}.${PACKAGE_FIND_VERSION_MINOR}.${PACKAGE_FIND_VERSION_PATCH} STREQUAL 1.41.0 )
/usr/lib64/boost/BoostConfig.cmake(20):  set(Boost_VERSION 1.41.0 )
/usr/lib64/boost/BoostConfig.cmake(21):  set(Boost_INCLUDE_DIRS /usr/include )
/usr/lib64/boost/BoostConfig.cmake(22):  set(Boost_INCLUDE_DIR /usr/include CACHE FILEPATH Boost include directory )
/usr/lib64/boost/BoostConfig.cmake(24):  set(Boost_LIBRARY_DIRS /usr/lib64 )

This will then again lead to the same error as before.

It seems that cmake absolutely wants to go into /usr/share/cmake/Modules/FindBoost.cmake and then /usr/lib64/boost/BoostConfig.cmake, no matter wheter I set Boost_NO_SYSTEM_PATHS TRUE. 

Best regards,
Michael



On Tue, Aug 8, 2017 at 10:00 PM, Chris Marsh <[hidden email]> wrote:
In your project cmake.

And I would not manually set these variables
Boost_DIR /usr/lib64/boost                                                
Boost_INCLUDE_DIR /usr/include

I would let the find_pacakge call do that for you.


On 8 August 2017 at 13:56, Michael Bieri <[hidden email]> wrote:
Just in the cmake file of my project, or in the cmake file for building CGAL?

On Tue, Aug 8, 2017 at 9:48 PM, Chris Marsh <[hidden email]> wrote:
You put them before the find_package(Boost REQUIRED) call in your cmake file. You will not need to recompile boost.

For example:

set(Boost_NO_SYSTEM_PATHS TRUE)
set(BOOST_ROOT "/my/boost/boost_1_54_0")
find_package(Boost REQUIRED)
message(STATUS "Found boost incl: ${Boost_INCLUDE_DIR}")
message(STATUS "Boost libs to link: ${Boost_LIBRARIES}")
message(STATUS "Found boost lib: ${Boost_LIBRARY_DIRS}")

should print your custom boost library path


On 8 August 2017 at 13:37, Michael Bieri <[hidden email]> wrote:
Hi Chris

Thanks for your answer. Where exactly should I put those lines, and do I need to recompile CGAL afterwards?

Best regards,
Michael

On Tue, Aug 8, 2017 at 9:29 PM, Chris Marsh <[hidden email]> wrote:
When compiling against a custom boost with cmake, you can use this in your cmake file to specify the boost directory

set(Boost_NO_SYSTEM_PATHS TRUE)
set(BOOST_ROOT "/my/boost/boost_1_54_0")

the FindBoost.cmake file will then pickup your custom directory 

On 8 August 2017 at 13:14, Michael Bieri <[hidden email]> wrote:
Hello

I'm currently installing CGAL on different platforms. Normally, it works just fine. But I have one computer where Boost is not installed into the system, but just compiled in a directory. This Boost works properly in combination with other things I'm building, just not with CGAL.

I can compile CGAL using the following Boost-related settings, displayed with ccmake:

 Boost_DEBUG OFF                                                            
 Boost_INCLUDE_DIR /my/boost/boost_1_54_0        
 Boost_LIBRARY_DIR /my/boost/boost_1_54_0/stage/lib
 Boost_SYSTEM_LIBRARY_DEBUG /my/boost/boost_1_54_0/stage/lib
 Boost_SYSTEM_LIBRARY_RELEASE /my/boost/boost_1_54_0/stage/lib
 Boost_THREAD_LIBRARY_DEBUG /my/boost/boost_1_54_0/stage/lib
 Boost_THREAD_LIBRARY_RELEASE /my/boost/boost_1_54_0/stage/lib
 CGAL_Boost_USE_STATIC_LIBS   OFF


Now, I'd like to compile one of my examples. I get the following error: 

*******************************************************

CMake Error at /usr/lib64/boost/Boost.cmake:536 (message):
  The imported target "boost_date_time-static" references the file

     "/usr/lib64/lib64/libboost_date_time.a"

  but this file does not exist.  Possible reasons include:

  * The file was deleted, renamed, or moved to another location.

  * An install or uninstall procedure did not complete successfully.

  * The installation package was faulty and contained

     "/usr/lib64/boost/Boost.cmake"

  but not all the files it references.

*******************************************************

The error itself is not a surprise, because it's a very old Boost there.

Boost-related settings for cmake in my project folder are:

Boost_DEBUG OFF                                                            
Boost_DIR /usr/lib64/boost                                                
Boost_INCLUDE_DIR /usr/include

Whe I change the variables to my own Boost in ccmake, it will also throw the above error and not save the changes.

So I really, really wonder: How do I set Boost properly to compile my own code? (I also tried with environment variables as given in the installation manual, Section 15.7.)

Best regards,
Michael









Reply | Threaded
Open this post in threaded view
|

Re: Boost is not found when compiling my own code

chrism
In reply to this post by Michael Bieri
Ah could be; I've never build boost with the cmake builder and only have used the b2 engine. I guess it behaves differently? Good to know.


On 8 August 2017 at 14:23, Michael Bieri <[hidden email]> wrote:
Ok, I think I finally got it when setting one more variable, Boost_NO_BOOST_CMAKE:

set(Boost_NO_SYSTEM_PATHS TRUE)
set(Boost_NO_BOOST_CMAKE TRUE)
set(BOOST_ROOT "/my/boost/boost_1_54_0")
find_package(Boost REQUIRED)

Best regards,
Michael


On Tue, Aug 8, 2017 at 10:10 PM, Michael Bieri <[hidden email]> wrote:
Ok, I tried to do this, but I get the following result when running it with --trace:

/my/project/CMakeLists.txt(25):  set(Boost_NO_SYSTEM_PATHS TRUE )
/my/project/CMakeLists.txt(26):  set(BOOST_ROOT /my/boost )
/my/project/CMakeLists.txt(27):  find_package(Boost REQUIRED )
/usr/share/cmake/Modules/FindBoost.cmake(163):  if(NOT Boost_NO_BOOST_CMAKE )
/usr/share/cmake/Modules/FindBoost.cmake(166):  if($ENV{Boost_DIR} STREQUAL  )
/usr/share/cmake/Modules/FindBoost.cmake(167):  if(NOT $ENV{BOOST_ROOT} STREQUAL  )
/usr/share/cmake/Modules/FindBoost.cmake(168):  set(ENV{Boost_DIR} $ENV{BOOST_ROOT} )
/usr/share/cmake/Modules/FindBoost.cmake(177):  find_package(Boost QUIET NO_MODULE )
/usr/lib64/boost/BoostConfigVersion.cmake(12):  if(${PACKAGE_FIND_VERSION_MAJOR}.${PACKAGE_FIND_VERSION_MINOR}.${PACKAGE_FIND_VERSION_PATCH} STREQUAL 1.41.0 )
/usr/lib64/boost/BoostConfig.cmake(20):  set(Boost_VERSION 1.41.0 )
/usr/lib64/boost/BoostConfig.cmake(21):  set(Boost_INCLUDE_DIRS /usr/include )
/usr/lib64/boost/BoostConfig.cmake(22):  set(Boost_INCLUDE_DIR /usr/include CACHE FILEPATH Boost include directory )
/usr/lib64/boost/BoostConfig.cmake(24):  set(Boost_LIBRARY_DIRS /usr/lib64 )

This will then again lead to the same error as before.

It seems that cmake absolutely wants to go into /usr/share/cmake/Modules/FindBoost.cmake and then /usr/lib64/boost/BoostConfig.cmake, no matter wheter I set Boost_NO_SYSTEM_PATHS TRUE. 

Best regards,
Michael



On Tue, Aug 8, 2017 at 10:00 PM, Chris Marsh <[hidden email]> wrote:
In your project cmake.

And I would not manually set these variables
Boost_DIR /usr/lib64/boost                                                
Boost_INCLUDE_DIR /usr/include

I would let the find_pacakge call do that for you.


On 8 August 2017 at 13:56, Michael Bieri <[hidden email]> wrote:
Just in the cmake file of my project, or in the cmake file for building CGAL?

On Tue, Aug 8, 2017 at 9:48 PM, Chris Marsh <[hidden email]> wrote:
You put them before the find_package(Boost REQUIRED) call in your cmake file. You will not need to recompile boost.

For example:

set(Boost_NO_SYSTEM_PATHS TRUE)
set(BOOST_ROOT "/my/boost/boost_1_54_0")
find_package(Boost REQUIRED)
message(STATUS "Found boost incl: ${Boost_INCLUDE_DIR}")
message(STATUS "Boost libs to link: ${Boost_LIBRARIES}")
message(STATUS "Found boost lib: ${Boost_LIBRARY_DIRS}")

should print your custom boost library path


On 8 August 2017 at 13:37, Michael Bieri <[hidden email]> wrote:
Hi Chris

Thanks for your answer. Where exactly should I put those lines, and do I need to recompile CGAL afterwards?

Best regards,
Michael

On Tue, Aug 8, 2017 at 9:29 PM, Chris Marsh <[hidden email]> wrote:
When compiling against a custom boost with cmake, you can use this in your cmake file to specify the boost directory

set(Boost_NO_SYSTEM_PATHS TRUE)
set(BOOST_ROOT "/my/boost/boost_1_54_0")

the FindBoost.cmake file will then pickup your custom directory 

On 8 August 2017 at 13:14, Michael Bieri <[hidden email]> wrote:
Hello

I'm currently installing CGAL on different platforms. Normally, it works just fine. But I have one computer where Boost is not installed into the system, but just compiled in a directory. This Boost works properly in combination with other things I'm building, just not with CGAL.

I can compile CGAL using the following Boost-related settings, displayed with ccmake:

 Boost_DEBUG OFF                                                            
 Boost_INCLUDE_DIR /my/boost/boost_1_54_0        
 Boost_LIBRARY_DIR /my/boost/boost_1_54_0/stage/lib
 Boost_SYSTEM_LIBRARY_DEBUG /my/boost/boost_1_54_0/stage/lib
 Boost_SYSTEM_LIBRARY_RELEASE /my/boost/boost_1_54_0/stage/lib
 Boost_THREAD_LIBRARY_DEBUG /my/boost/boost_1_54_0/stage/lib
 Boost_THREAD_LIBRARY_RELEASE /my/boost/boost_1_54_0/stage/lib
 CGAL_Boost_USE_STATIC_LIBS   OFF


Now, I'd like to compile one of my examples. I get the following error: 

*******************************************************

CMake Error at /usr/lib64/boost/Boost.cmake:536 (message):
  The imported target "boost_date_time-static" references the file

     "/usr/lib64/lib64/libboost_date_time.a"

  but this file does not exist.  Possible reasons include:

  * The file was deleted, renamed, or moved to another location.

  * An install or uninstall procedure did not complete successfully.

  * The installation package was faulty and contained

     "/usr/lib64/boost/Boost.cmake"

  but not all the files it references.

*******************************************************

The error itself is not a surprise, because it's a very old Boost there.

Boost-related settings for cmake in my project folder are:

Boost_DEBUG OFF                                                            
Boost_DIR /usr/lib64/boost                                                
Boost_INCLUDE_DIR /usr/include

Whe I change the variables to my own Boost in ccmake, it will also throw the above error and not save the changes.

So I really, really wonder: How do I set Boost properly to compile my own code? (I also tried with environment variables as given in the installation manual, Section 15.7.)

Best regards,
Michael









Reply | Threaded
Open this post in threaded view
|

Re: Boost is not found when compiling my own code

Michael Bieri
I built it a long time ago, and as far as I know, I also used the b2 engine. I see no CMake stuff in that boost directory.

So currently, it just works but I do not really understand what's going on.

On Tue, Aug 8, 2017 at 10:26 PM, Chris Marsh <[hidden email]> wrote:
Ah could be; I've never build boost with the cmake builder and only have used the b2 engine. I guess it behaves differently? Good to know.


On 8 August 2017 at 14:23, Michael Bieri <[hidden email]> wrote:
Ok, I think I finally got it when setting one more variable, Boost_NO_BOOST_CMAKE:

set(Boost_NO_SYSTEM_PATHS TRUE)
set(Boost_NO_BOOST_CMAKE TRUE)
set(BOOST_ROOT "/my/boost/boost_1_54_0")
find_package(Boost REQUIRED)

Best regards,
Michael


On Tue, Aug 8, 2017 at 10:10 PM, Michael Bieri <[hidden email]> wrote:
Ok, I tried to do this, but I get the following result when running it with --trace:

/my/project/CMakeLists.txt(25):  set(Boost_NO_SYSTEM_PATHS TRUE )
/my/project/CMakeLists.txt(26):  set(BOOST_ROOT /my/boost )
/my/project/CMakeLists.txt(27):  find_package(Boost REQUIRED )
/usr/share/cmake/Modules/FindBoost.cmake(163):  if(NOT Boost_NO_BOOST_CMAKE )
/usr/share/cmake/Modules/FindBoost.cmake(166):  if($ENV{Boost_DIR} STREQUAL  )
/usr/share/cmake/Modules/FindBoost.cmake(167):  if(NOT $ENV{BOOST_ROOT} STREQUAL  )
/usr/share/cmake/Modules/FindBoost.cmake(168):  set(ENV{Boost_DIR} $ENV{BOOST_ROOT} )
/usr/share/cmake/Modules/FindBoost.cmake(177):  find_package(Boost QUIET NO_MODULE )
/usr/lib64/boost/BoostConfigVersion.cmake(12):  if(${PACKAGE_FIND_VERSION_MAJOR}.${PACKAGE_FIND_VERSION_MINOR}.${PACKAGE_FIND_VERSION_PATCH} STREQUAL 1.41.0 )
/usr/lib64/boost/BoostConfig.cmake(20):  set(Boost_VERSION 1.41.0 )
/usr/lib64/boost/BoostConfig.cmake(21):  set(Boost_INCLUDE_DIRS /usr/include )
/usr/lib64/boost/BoostConfig.cmake(22):  set(Boost_INCLUDE_DIR /usr/include CACHE FILEPATH Boost include directory )
/usr/lib64/boost/BoostConfig.cmake(24):  set(Boost_LIBRARY_DIRS /usr/lib64 )

This will then again lead to the same error as before.

It seems that cmake absolutely wants to go into /usr/share/cmake/Modules/FindBoost.cmake and then /usr/lib64/boost/BoostConfig.cmake, no matter wheter I set Boost_NO_SYSTEM_PATHS TRUE. 

Best regards,
Michael



On Tue, Aug 8, 2017 at 10:00 PM, Chris Marsh <[hidden email]> wrote:
In your project cmake.

And I would not manually set these variables
Boost_DIR /usr/lib64/boost                                                
Boost_INCLUDE_DIR /usr/include

I would let the find_pacakge call do that for you.


On 8 August 2017 at 13:56, Michael Bieri <[hidden email]> wrote:
Just in the cmake file of my project, or in the cmake file for building CGAL?

On Tue, Aug 8, 2017 at 9:48 PM, Chris Marsh <[hidden email]> wrote:
You put them before the find_package(Boost REQUIRED) call in your cmake file. You will not need to recompile boost.

For example:

set(Boost_NO_SYSTEM_PATHS TRUE)
set(BOOST_ROOT "/my/boost/boost_1_54_0")
find_package(Boost REQUIRED)
message(STATUS "Found boost incl: ${Boost_INCLUDE_DIR}")
message(STATUS "Boost libs to link: ${Boost_LIBRARIES}")
message(STATUS "Found boost lib: ${Boost_LIBRARY_DIRS}")

should print your custom boost library path


On 8 August 2017 at 13:37, Michael Bieri <[hidden email]> wrote:
Hi Chris

Thanks for your answer. Where exactly should I put those lines, and do I need to recompile CGAL afterwards?

Best regards,
Michael

On Tue, Aug 8, 2017 at 9:29 PM, Chris Marsh <[hidden email]> wrote:
When compiling against a custom boost with cmake, you can use this in your cmake file to specify the boost directory

set(Boost_NO_SYSTEM_PATHS TRUE)
set(BOOST_ROOT "/my/boost/boost_1_54_0")

the FindBoost.cmake file will then pickup your custom directory 

On 8 August 2017 at 13:14, Michael Bieri <[hidden email]> wrote:
Hello

I'm currently installing CGAL on different platforms. Normally, it works just fine. But I have one computer where Boost is not installed into the system, but just compiled in a directory. This Boost works properly in combination with other things I'm building, just not with CGAL.

I can compile CGAL using the following Boost-related settings, displayed with ccmake:

 Boost_DEBUG OFF                                                            
 Boost_INCLUDE_DIR /my/boost/boost_1_54_0        
 Boost_LIBRARY_DIR /my/boost/boost_1_54_0/stage/lib
 Boost_SYSTEM_LIBRARY_DEBUG /my/boost/boost_1_54_0/stage/lib
 Boost_SYSTEM_LIBRARY_RELEASE /my/boost/boost_1_54_0/stage/lib
 Boost_THREAD_LIBRARY_DEBUG /my/boost/boost_1_54_0/stage/lib
 Boost_THREAD_LIBRARY_RELEASE /my/boost/boost_1_54_0/stage/lib
 CGAL_Boost_USE_STATIC_LIBS   OFF


Now, I'd like to compile one of my examples. I get the following error: 

*******************************************************

CMake Error at /usr/lib64/boost/Boost.cmake:536 (message):
  The imported target "boost_date_time-static" references the file

     "/usr/lib64/lib64/libboost_date_time.a"

  but this file does not exist.  Possible reasons include:

  * The file was deleted, renamed, or moved to another location.

  * An install or uninstall procedure did not complete successfully.

  * The installation package was faulty and contained

     "/usr/lib64/boost/Boost.cmake"

  but not all the files it references.

*******************************************************

The error itself is not a surprise, because it's a very old Boost there.

Boost-related settings for cmake in my project folder are:

Boost_DEBUG OFF                                                            
Boost_DIR /usr/lib64/boost                                                
Boost_INCLUDE_DIR /usr/include

Whe I change the variables to my own Boost in ccmake, it will also throw the above error and not save the changes.

So I really, really wonder: How do I set Boost properly to compile my own code? (I also tried with environment variables as given in the installation manual, Section 15.7.)

Best regards,
Michael










Reply | Threaded
Open this post in threaded view
|

Re: Boost is not found when compiling my own code

chrism
I can only speak from experience in that for my custom built CGAL with a custom boost install, the instructions I linked works. Perhaps you are finding CGAL prior to setting the BOOST no system root?  That being said I've seen some strange differences between cmake on different machines, so I share your frustration. I guess as long as it works ....


On 8 August 2017 at 14:34, Michael Bieri <[hidden email]> wrote:
I built it a long time ago, and as far as I know, I also used the b2 engine. I see no CMake stuff in that boost directory.

So currently, it just works but I do not really understand what's going on.

On Tue, Aug 8, 2017 at 10:26 PM, Chris Marsh <[hidden email]> wrote:
Ah could be; I've never build boost with the cmake builder and only have used the b2 engine. I guess it behaves differently? Good to know.


On 8 August 2017 at 14:23, Michael Bieri <[hidden email]> wrote:
Ok, I think I finally got it when setting one more variable, Boost_NO_BOOST_CMAKE:

set(Boost_NO_SYSTEM_PATHS TRUE)
set(Boost_NO_BOOST_CMAKE TRUE)
set(BOOST_ROOT "/my/boost/boost_1_54_0")
find_package(Boost REQUIRED)

Best regards,
Michael


On Tue, Aug 8, 2017 at 10:10 PM, Michael Bieri <[hidden email]> wrote:
Ok, I tried to do this, but I get the following result when running it with --trace:

/my/project/CMakeLists.txt(25):  set(Boost_NO_SYSTEM_PATHS TRUE )
/my/project/CMakeLists.txt(26):  set(BOOST_ROOT /my/boost )
/my/project/CMakeLists.txt(27):  find_package(Boost REQUIRED )
/usr/share/cmake/Modules/FindBoost.cmake(163):  if(NOT Boost_NO_BOOST_CMAKE )
/usr/share/cmake/Modules/FindBoost.cmake(166):  if($ENV{Boost_DIR} STREQUAL  )
/usr/share/cmake/Modules/FindBoost.cmake(167):  if(NOT $ENV{BOOST_ROOT} STREQUAL  )
/usr/share/cmake/Modules/FindBoost.cmake(168):  set(ENV{Boost_DIR} $ENV{BOOST_ROOT} )
/usr/share/cmake/Modules/FindBoost.cmake(177):  find_package(Boost QUIET NO_MODULE )
/usr/lib64/boost/BoostConfigVersion.cmake(12):  if(${PACKAGE_FIND_VERSION_MAJOR}.${PACKAGE_FIND_VERSION_MINOR}.${PACKAGE_FIND_VERSION_PATCH} STREQUAL 1.41.0 )
/usr/lib64/boost/BoostConfig.cmake(20):  set(Boost_VERSION 1.41.0 )
/usr/lib64/boost/BoostConfig.cmake(21):  set(Boost_INCLUDE_DIRS /usr/include )
/usr/lib64/boost/BoostConfig.cmake(22):  set(Boost_INCLUDE_DIR /usr/include CACHE FILEPATH Boost include directory )
/usr/lib64/boost/BoostConfig.cmake(24):  set(Boost_LIBRARY_DIRS /usr/lib64 )

This will then again lead to the same error as before.

It seems that cmake absolutely wants to go into /usr/share/cmake/Modules/FindBoost.cmake and then /usr/lib64/boost/BoostConfig.cmake, no matter wheter I set Boost_NO_SYSTEM_PATHS TRUE. 

Best regards,
Michael



On Tue, Aug 8, 2017 at 10:00 PM, Chris Marsh <[hidden email]> wrote:
In your project cmake.

And I would not manually set these variables
Boost_DIR /usr/lib64/boost                                                
Boost_INCLUDE_DIR /usr/include

I would let the find_pacakge call do that for you.


On 8 August 2017 at 13:56, Michael Bieri <[hidden email]> wrote:
Just in the cmake file of my project, or in the cmake file for building CGAL?

On Tue, Aug 8, 2017 at 9:48 PM, Chris Marsh <[hidden email]> wrote:
You put them before the find_package(Boost REQUIRED) call in your cmake file. You will not need to recompile boost.

For example:

set(Boost_NO_SYSTEM_PATHS TRUE)
set(BOOST_ROOT "/my/boost/boost_1_54_0")
find_package(Boost REQUIRED)
message(STATUS "Found boost incl: ${Boost_INCLUDE_DIR}")
message(STATUS "Boost libs to link: ${Boost_LIBRARIES}")
message(STATUS "Found boost lib: ${Boost_LIBRARY_DIRS}")

should print your custom boost library path


On 8 August 2017 at 13:37, Michael Bieri <[hidden email]> wrote:
Hi Chris

Thanks for your answer. Where exactly should I put those lines, and do I need to recompile CGAL afterwards?

Best regards,
Michael

On Tue, Aug 8, 2017 at 9:29 PM, Chris Marsh <[hidden email]> wrote:
When compiling against a custom boost with cmake, you can use this in your cmake file to specify the boost directory

set(Boost_NO_SYSTEM_PATHS TRUE)
set(BOOST_ROOT "/my/boost/boost_1_54_0")

the FindBoost.cmake file will then pickup your custom directory 

On 8 August 2017 at 13:14, Michael Bieri <[hidden email]> wrote:
Hello

I'm currently installing CGAL on different platforms. Normally, it works just fine. But I have one computer where Boost is not installed into the system, but just compiled in a directory. This Boost works properly in combination with other things I'm building, just not with CGAL.

I can compile CGAL using the following Boost-related settings, displayed with ccmake:

 Boost_DEBUG OFF                                                            
 Boost_INCLUDE_DIR /my/boost/boost_1_54_0        
 Boost_LIBRARY_DIR /my/boost/boost_1_54_0/stage/lib
 Boost_SYSTEM_LIBRARY_DEBUG /my/boost/boost_1_54_0/stage/lib
 Boost_SYSTEM_LIBRARY_RELEASE /my/boost/boost_1_54_0/stage/lib
 Boost_THREAD_LIBRARY_DEBUG /my/boost/boost_1_54_0/stage/lib
 Boost_THREAD_LIBRARY_RELEASE /my/boost/boost_1_54_0/stage/lib
 CGAL_Boost_USE_STATIC_LIBS   OFF


Now, I'd like to compile one of my examples. I get the following error: 

*******************************************************

CMake Error at /usr/lib64/boost/Boost.cmake:536 (message):
  The imported target "boost_date_time-static" references the file

     "/usr/lib64/lib64/libboost_date_time.a"

  but this file does not exist.  Possible reasons include:

  * The file was deleted, renamed, or moved to another location.

  * An install or uninstall procedure did not complete successfully.

  * The installation package was faulty and contained

     "/usr/lib64/boost/Boost.cmake"

  but not all the files it references.

*******************************************************

The error itself is not a surprise, because it's a very old Boost there.

Boost-related settings for cmake in my project folder are:

Boost_DEBUG OFF                                                            
Boost_DIR /usr/lib64/boost                                                
Boost_INCLUDE_DIR /usr/include

Whe I change the variables to my own Boost in ccmake, it will also throw the above error and not save the changes.

So I really, really wonder: How do I set Boost properly to compile my own code? (I also tried with environment variables as given in the installation manual, Section 15.7.)

Best regards,
Michael











Reply | Threaded
Open this post in threaded view
|

Re: Boost is not found when compiling my own code

biswajitcse
Hi...

It will solved if you reconfigured Boost library by CMake.

On Wed, Aug 9, 2017 at 2:12 AM, Chris Marsh <[hidden email]> wrote:
I can only speak from experience in that for my custom built CGAL with a custom boost install, the instructions I linked works. Perhaps you are finding CGAL prior to setting the BOOST no system root?  That being said I've seen some strange differences between cmake on different machines, so I share your frustration. I guess as long as it works ....


On 8 August 2017 at 14:34, Michael Bieri <[hidden email]> wrote:
I built it a long time ago, and as far as I know, I also used the b2 engine. I see no CMake stuff in that boost directory.

So currently, it just works but I do not really understand what's going on.

On Tue, Aug 8, 2017 at 10:26 PM, Chris Marsh <[hidden email]> wrote:
Ah could be; I've never build boost with the cmake builder and only have used the b2 engine. I guess it behaves differently? Good to know.


On 8 August 2017 at 14:23, Michael Bieri <[hidden email]> wrote:
Ok, I think I finally got it when setting one more variable, Boost_NO_BOOST_CMAKE:

set(Boost_NO_SYSTEM_PATHS TRUE)
set(Boost_NO_BOOST_CMAKE TRUE)
set(BOOST_ROOT "/my/boost/boost_1_54_0")
find_package(Boost REQUIRED)

Best regards,
Michael


On Tue, Aug 8, 2017 at 10:10 PM, Michael Bieri <[hidden email]> wrote:
Ok, I tried to do this, but I get the following result when running it with --trace:

/my/project/CMakeLists.txt(25):  set(Boost_NO_SYSTEM_PATHS TRUE )
/my/project/CMakeLists.txt(26):  set(BOOST_ROOT /my/boost )
/my/project/CMakeLists.txt(27):  find_package(Boost REQUIRED )
/usr/share/cmake/Modules/FindBoost.cmake(163):  if(NOT Boost_NO_BOOST_CMAKE )
/usr/share/cmake/Modules/FindBoost.cmake(166):  if($ENV{Boost_DIR} STREQUAL  )
/usr/share/cmake/Modules/FindBoost.cmake(167):  if(NOT $ENV{BOOST_ROOT} STREQUAL  )
/usr/share/cmake/Modules/FindBoost.cmake(168):  set(ENV{Boost_DIR} $ENV{BOOST_ROOT} )
/usr/share/cmake/Modules/FindBoost.cmake(177):  find_package(Boost QUIET NO_MODULE )
/usr/lib64/boost/BoostConfigVersion.cmake(12):  if(${PACKAGE_FIND_VERSION_MAJOR}.${PACKAGE_FIND_VERSION_MINOR}.${PACKAGE_FIND_VERSION_PATCH} STREQUAL 1.41.0 )
/usr/lib64/boost/BoostConfig.cmake(20):  set(Boost_VERSION 1.41.0 )
/usr/lib64/boost/BoostConfig.cmake(21):  set(Boost_INCLUDE_DIRS /usr/include )
/usr/lib64/boost/BoostConfig.cmake(22):  set(Boost_INCLUDE_DIR /usr/include CACHE FILEPATH Boost include directory )
/usr/lib64/boost/BoostConfig.cmake(24):  set(Boost_LIBRARY_DIRS /usr/lib64 )

This will then again lead to the same error as before.

It seems that cmake absolutely wants to go into /usr/share/cmake/Modules/FindBoost.cmake and then /usr/lib64/boost/BoostConfig.cmake, no matter wheter I set Boost_NO_SYSTEM_PATHS TRUE. 

Best regards,
Michael



On Tue, Aug 8, 2017 at 10:00 PM, Chris Marsh <[hidden email]> wrote:
In your project cmake.

And I would not manually set these variables
Boost_DIR /usr/lib64/boost                                                
Boost_INCLUDE_DIR /usr/include

I would let the find_pacakge call do that for you.


On 8 August 2017 at 13:56, Michael Bieri <[hidden email]> wrote:
Just in the cmake file of my project, or in the cmake file for building CGAL?

On Tue, Aug 8, 2017 at 9:48 PM, Chris Marsh <[hidden email]> wrote:
You put them before the find_package(Boost REQUIRED) call in your cmake file. You will not need to recompile boost.

For example:

set(Boost_NO_SYSTEM_PATHS TRUE)
set(BOOST_ROOT "/my/boost/boost_1_54_0")
find_package(Boost REQUIRED)
message(STATUS "Found boost incl: ${Boost_INCLUDE_DIR}")
message(STATUS "Boost libs to link: ${Boost_LIBRARIES}")
message(STATUS "Found boost lib: ${Boost_LIBRARY_DIRS}")

should print your custom boost library path


On 8 August 2017 at 13:37, Michael Bieri <[hidden email]> wrote:
Hi Chris

Thanks for your answer. Where exactly should I put those lines, and do I need to recompile CGAL afterwards?

Best regards,
Michael

On Tue, Aug 8, 2017 at 9:29 PM, Chris Marsh <[hidden email]> wrote:
When compiling against a custom boost with cmake, you can use this in your cmake file to specify the boost directory

set(Boost_NO_SYSTEM_PATHS TRUE)
set(BOOST_ROOT "/my/boost/boost_1_54_0")

the FindBoost.cmake file will then pickup your custom directory 

On 8 August 2017 at 13:14, Michael Bieri <[hidden email]> wrote:
Hello

I'm currently installing CGAL on different platforms. Normally, it works just fine. But I have one computer where Boost is not installed into the system, but just compiled in a directory. This Boost works properly in combination with other things I'm building, just not with CGAL.

I can compile CGAL using the following Boost-related settings, displayed with ccmake:

 Boost_DEBUG OFF                                                            
 Boost_INCLUDE_DIR /my/boost/boost_1_54_0        
 Boost_LIBRARY_DIR /my/boost/boost_1_54_0/stage/lib
 Boost_SYSTEM_LIBRARY_DEBUG /my/boost/boost_1_54_0/stage/lib
 Boost_SYSTEM_LIBRARY_RELEASE /my/boost/boost_1_54_0/stage/lib
 Boost_THREAD_LIBRARY_DEBUG /my/boost/boost_1_54_0/stage/lib
 Boost_THREAD_LIBRARY_RELEASE /my/boost/boost_1_54_0/stage/lib
 CGAL_Boost_USE_STATIC_LIBS   OFF


Now, I'd like to compile one of my examples. I get the following error: 

*******************************************************

CMake Error at /usr/lib64/boost/Boost.cmake:536 (message):
  The imported target "boost_date_time-static" references the file

     "/usr/lib64/lib64/libboost_date_time.a"

  but this file does not exist.  Possible reasons include:

  * The file was deleted, renamed, or moved to another location.

  * An install or uninstall procedure did not complete successfully.

  * The installation package was faulty and contained

     "/usr/lib64/boost/Boost.cmake"

  but not all the files it references.

*******************************************************

The error itself is not a surprise, because it's a very old Boost there.

Boost-related settings for cmake in my project folder are:

Boost_DEBUG OFF                                                            
Boost_DIR /usr/lib64/boost                                                
Boost_INCLUDE_DIR /usr/include

Whe I change the variables to my own Boost in ccmake, it will also throw the above error and not save the changes.

So I really, really wonder: How do I set Boost properly to compile my own code? (I also tried with environment variables as given in the installation manual, Section 15.7.)

Best regards,
Michael














--
thanks and regards 
mobile:9163016823