Skip to content

Conversation

2maz
Copy link
Member

@2maz 2maz commented Apr 4, 2019

@doudou Any suggestions to make the Opaques part truely optional. Right now I assume I have to adapt touch orogen to permit injection of extra build flags in base-typekit.pc.in?

@2maz
Copy link
Member Author

2maz commented Apr 4, 2019

Depends on orocos-toolchain/orogen/pull/117

@doudou
Copy link
Member

doudou commented Apr 5, 2019

I guess one way would be to define something in the opaque wrapper, and use this in the Opaques.cpp code. In any case, I don't see a way to not have to define something.

@2maz
Copy link
Member Author

2maz commented Apr 8, 2019

@doudou any comments then on the current approach, which requires also a minimal change in orogen?

base.orogen Outdated
if has_library?('base-lib')
sisl_available = has_library?('base-lib-sisl')

if sisl_available
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is inconsistent with the next line. It's either both base-lib or both base-lib-sisl.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ack

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changed it to base-types-sisl

CMakeLists.txt Outdated
list(APPEND TOOLKIT_ADDITIONAL_SOURCES ${CMAKE_SOURCE_DIR}/src/spline.cpp)
list(APPEND TOOLKIT_ADDITIONAL_LIBRARIES ${BASELIB_LIBRARIES} ${SISL_LIBRARIES})
list(APPEND TOOLKIT_ADDITIONAL_LIBRARIES ${SISL_LIBRARIES})
list(APPEND PKG_CFLAGS "-DWITH_SISL=1")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rather than this being done implicitly. I would actually prefer adding an explicit add_definition to OroGen's typekit definition, and have it code-generate the add_definitions. Same for the additional sources. It would place all of the logic in the orogen file, which feels better somehow.

The addition of SISL in TOOLKIT_ADDITIONAL_LIBRARIES feels weird here by the way ... Since we're using_library it should not be needed - which would simplify the whole block to only be adding src/spline.cpp.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rather than this being done implicitly. I would actually prefer adding an explicit add_definition to OroGen's typekit definition, and have it code-generate the add_definitions. Same for the additional sources. It would place all of the logic in the orogen file, which feels better somehow.

You mean the following way:

using_library 'base-lib-sisl'
typekit.add_definition("WITH_SISL",1)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Something like that, yes.

CMakeLists.txt Outdated

pkg_check_modules(BASELIB REQUIRED "base-lib")
include_directories(${BASELIB_INCLUDE_DIRS})
list(APPEND TOOLKIT_ADDITIONAL_LIBRARIES ${BASELIB_LIBRARIES})
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This toolkit_additional_libraries is puzzling me ...

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This has been part of the previously sisl-dependent block. Since it is not optional anymore I updated it. So 'puzzling' means 'is not needed'?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I got that it was there ... but I wonder why (if ?) it is needed.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All types are contained in base-types library. So I removed the base-lib part.

@planthaber
Copy link
Member

planthaber commented Apr 16, 2019

Is this flag really needed in the rock context?

I mean SISL is an additional, mostly not needed dependency when you want to use base-types with a library outside rock e.g. https://github.com/envire/envire-envire_core

This is why it should be truely optional in the base-types repo, but i don't see why it should be in the orogen component, the manifest.xml of base-types lists it as optional, but it is defined in the package_set, so it is installes automatically and availabel anyways.

@2maz
Copy link
Member Author

2maz commented Apr 17, 2019

Is this flag really needed in the rock context?

I do not have a real use case, but was only fixing the existing setup.

but it is defined in the package_set, so it is installes automatically and availabel anyways.

You can still control the dependencies that you install via exclude_packages in the manifest. So that is not a good reason.

This is why it should be truely optional in the base-types repo, but i don't see why it should be in the orogen component, the manifest.xml of base-types lists it as optional, but it is defined in the package_set, so it is installes automatically and availabel anyways.

Depends whether other reasons are brought up to support this optionality.
I prefer to reduce complexity and we could make base/orogen/types depend directly on base-types-sisl.

@doudou
Copy link
Member

doudou commented Apr 17, 2019

I prefer to reduce complexity and we could make base/orogen/types depend directly on base-types-sisl.

Since the consensus it to remove the optionality on base/orogen/types, then let's. SISL is part of "Core Rock", base/orogen/types should depend on it unconditionally.

If all in agreement, please close this PR.

@2maz 2maz force-pushed the fix_optional_exports branch from 89dedf3 to 2c527ab Compare April 17, 2019 15:13
@2maz
Copy link
Member Author

2maz commented Apr 17, 2019

Updated the PR to do the 'cleanup' of the optional parts

@doudou
Copy link
Member

doudou commented Apr 24, 2019

Would it make sense to add an explicit dependency on external/sisl ? With a comment to explain why ?

@planthaber
Copy link
Member

Good question.

It would prevent a failing build without explanation in case someone writes a new package_set including base/types and base/orogen/types, but how likely is this?

@2maz
Copy link
Member Author

2maz commented Apr 24, 2019

Would it make sense to add an explicit dependency on external/sisl ? With a comment to explain why ?

Explanation definitely makes sense.
So how about going back to

using_library 'base-types'

add 'external/sisl' to the manifest.xml,
and add the check for base-types-sisl in the CMakeLists.txt to output the proper failure, explanation and error handling to the user.

@doudou
Copy link
Member

doudou commented Apr 24, 2019

Would it make sense to add an explicit dependency on external/sisl ? With a comment to explain why ?

Explanation definitely makes sense.
So how about going back to

using_library 'base-types'

add 'external/sisl' to the manifest.xml,
and add the check for base-types-sisl in the CMakeLists.txt to output the proper failure, explanation and error handling to the user.

Sounds good

@2maz 2maz force-pushed the fix_optional_exports branch from 2c527ab to 01cbf60 Compare April 25, 2019 11:41
@2maz 2maz force-pushed the fix_optional_exports branch from 01cbf60 to d7f7b39 Compare April 25, 2019 11:44
@2maz
Copy link
Member Author

2maz commented Apr 25, 2019

Updated

@doudou doudou merged commit ccd43fe into master Apr 25, 2019
@doudou doudou deleted the fix_optional_exports branch April 25, 2019 22:04
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

Successfully merging this pull request may close these issues.

3 participants