Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

libReg.a fails to link to Boost in Ubuntu 20.04 #1037

Closed
paskino opened this issue Feb 1, 2022 · 6 comments
Closed

libReg.a fails to link to Boost in Ubuntu 20.04 #1037

paskino opened this issue Feb 1, 2022 · 6 comments
Assignees
Milestone

Comments

@paskino
Copy link
Contributor

paskino commented Feb 1, 2022

In SyneRBI/SIRF-SuperBuild#649 it seems there is a linker error for libReg.a

Apparently boost linking is taken care of by

# Add boost library dependencies
if((CMAKE_VERSION VERSION_LESS 3.5.0) OR (NOT _Boost_IMPORTED_TARGETS))
# This is harder than it should be on older CMake versions to be able to cope with
# spaces in filenames.
foreach(C SYSTEM FILESYSTEM)
target_link_libraries(Reg PUBLIC optimized "${Boost_${C}_LIBRARY_RELEASE}")
target_link_libraries(Reg PUBLIC debug "${Boost_${C}_LIBRARY_DEBUG}")
endforeach()
else()
# Nice and simple for recent CMake (which knows about your Boost version)
target_link_libraries(Reg PUBLIC Boost::system Boost::filesystem)
endif()

The current if statement has been merged in long ago, before we used CMake 3.5.

Given that now we require CMake 3.9 I believe the if is not useful, probably harmful. I suggest to remove them in the 3 places where this is done.

@paskino paskino self-assigned this Feb 1, 2022
paskino added a commit to paskino/SIRF that referenced this issue Feb 1, 2022
@KrisThielemans
Copy link
Member

_Boost_IMPORTED_TARGETS. is set by CMake https://github.com/Kitware/CMake/blob/9d439dfd1b7f8599905e687005dd8dc69921f4d2/Modules/FindBoost.cmake#L1391
I would guess that it never happens for us as our Boost and CMake version combination should always give them, (see here so you could get rid of the if I believe. You can check in which branch of the if it goes.

However, I think the problem is with filesystem. I see 2 possibly causes:

@paskino
Copy link
Contributor Author

paskino commented Feb 1, 2022

We do install libboost-filesystem-dev

It is arguably a problem with the Boost version? I don't think so because I'm building with USE_SYSTEM_Boost=ON so there shouldn't be another Boost around?

Ubuntu 18.04 should have 1.65, but in some messages during the build I could see 1.36 (STIR's CMake output during config) and 1.48, which buffles me.

@KrisThielemans
Copy link
Member

We do install libboost-filesystem-dev

great

We do install libboost-filesystem-dev

It is arguably a problem with the Boost version? I don't think so because I'm building with USE_SYSTEM_Boost=ON so there shouldn't be another Boost around?

Ubuntu 18.04 should have 1.65, but in some messages during the build I could see 1.36 (STIR's CMake output during config) and 1.48,

We require 1.36, which is probably what you see. Maybe STIR requires 1.48. not sure. Of course, I think we likely need more recent boost...

Not sure what's going on. I guess you'' find out if we really use the boost::filesystem et al. targets. If we do, I guess you want to do a make VERBOSE=ON after the first failure.

@KrisThielemans KrisThielemans added this to the v3.2 milestone Feb 17, 2022
@KrisThielemans
Copy link
Member

I wonder now if this is because the Boost version was more recent than the CMake version (as discussed in SyneRBI/SIRF-SuperBuild#667). Which CMake and Boost version was this using?

@evgueni-ovtchinnikov evgueni-ovtchinnikov modified the milestones: v3.2, v3.3 Mar 17, 2022
@KrisThielemans KrisThielemans modified the milestones: v3.4, v3.3 Apr 28, 2022
@KrisThielemans KrisThielemans modified the milestones: v3.3, v3.4 May 12, 2022
paskino added a commit to paskino/SIRF that referenced this issue May 21, 2022
@paskino
Copy link
Contributor Author

paskino commented Sep 26, 2022

@KrisThielemans is this still relevant?
AFAIK, the SuperBuild builds on Ubuntu 20.04 both on GHA and docker?

@KrisThielemans
Copy link
Member

AFAIK, the SuperBuild builds on Ubuntu 20.04 both on GHA and docker?

yes. In fact, GHA is on ubuntu-latest I believe, which could be 22.04 by now.

I first thought we could merge db4479d via a PR to simplify our files, but I now think that this code could cover the case where CMake is older than Boost (in which case FindBOOST.cmake gives up and doesn't define the targets I think). I'm not 100% sure, but unless you want to investigate that, it might be easiest to just leave it in.

Of course, I have no idea what happened when you had this problem, so there might be some problem lurking somewhere, but finding out is going to be tough.

Summary : I'm fine with closing this issue.

evgueni-ovtchinnikov added a commit that referenced this issue Apr 8, 2024
* implemented basic-functionality listmode data class in C++ and Python

* added objective function type for lismode reconstruction

* introduced abstract base class PETScanData for all raw data objects

* [ci skip] interfaced PETScanData into Python

* Minimal backbone for LM recons

* New test for LM data (test6)

* fix

* Working test6

* Generalize the paths in test6

* Minor renaming

* simplify link library to Boost

closes #1037

* remove dangling endif

* [ci skip] moved data folder TBPET out of SIRF repo

* removed unused stuff from cstir_test6.cpp

* restored backward compatibility of run_test6.cpp

* implemented C interface for list mode reconstruction objective function

* started interfacing reconstruction from listmode into Python

* implemented minimal Python interface for reconstruction from listmode data

* resolved some issues raised by Kris

* small amendments in STIR.py

* removed cstir_test6 from ctest tests

* minor fixes to listmode classes

* removed some unneeded data_sptr() methods

* replaced cache_path quick fix with a more proper handling

* [ci skip] corrected copyrights in cSTIR/tests/test6.cpp

* make listmode recon compatible with STIR 5.1.0

* rename PETScanData to ScanData(Python) or STIRScanData (C++)

This is consistent with our renaming of AcquisitionData

* No longer derive ListmodeData from DataContainer

* update listmode test (WIP)

- update to recent SIRF
- use sample data in STIR
- still quite slow as it's precomputing the sensitivity

* Derive DataContainer from ContainerBase

This allows us to check the type of a container using standard C++ RTTI.

* speed-up listmode recon test and use SIRF example data

we had some listmode example data in SIRFdata already, so use that.

reduce segment etc such that the test doesn't take too long

* attended to Codacy issues

* attended to further Codacy issues

* fix ListmodeData hierarchy and add get_info to STIR containers

- derive ListmodeData from ContainerBase
- add ListmodeData to C wrappers
- add get_info() to STIRImageData and ListmodeData
- expand STIRAcquisitionData::get_info() to add exam-info string
- minimal documentation

This now works fine through Python, but demos still need work.

* renamed ListmodeData to STIRListmodeData for consistency

* add set_acquisition_model to listmode obj-fun

* minor doc corrections

* listmode recon improvements

- add ListmodeData::acquisition_data_template()
- let ListmodeToSinograms::set_input() cope with either filename or ListmodeData object

* minor fix in demo

* fix storing filename of listmode file

* add SIRF_DATA_PATH to STIR C++ test

* fixed bugs and issues found in lmrecontest2

* [ci skip] got rid of gpu stuff in reconstruct_from_listmode.py

* [ci skip] removed osem_lm_reconstruction.py, superseded by listmode_reconstruction.py

* [ci skip] updated CHANGES.md

---------

Co-authored-by: Nikos Efthimiou <[email protected]>
Co-authored-by: Edoardo Pasca <[email protected]>
Co-authored-by: Nikos Efthimiou <[email protected]>
Co-authored-by: Kris Thielemans <[email protected]>
Co-authored-by: Kris Thielemans <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants