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

Removal of PCL_DEFINITIONS #1685

Open
SergioRAgostinho opened this issue Aug 22, 2016 · 10 comments
Open

Removal of PCL_DEFINITIONS #1685

SergioRAgostinho opened this issue Aug 22, 2016 · 10 comments
Assignees
Labels
kind: proposal Type of issue module: cmake module: common needs: feedback Specify why not closed/merged yet skill: cmake Skills/areas of expertise needed to tackle the issue

Comments

@SergioRAgostinho
Copy link
Member

Just a reminder on the discussion which started at #1478.

The main point, by @Algomorph

It is unclear to me why compile definitions are necessary at all in this case. The file pcl_config.h.in is configured at the time of CMake generation for pcl, and it probably should have all the flags set correctly at that time instead of relying on -DDISABLE_<?> flags and such. Files that rely on these definitions should include the pcl_config.h header. This way, users don't need to use PCL_DEFINTIONS explicitly at all.

@SergioRAgostinho SergioRAgostinho added this to the pcl-1.9.0 milestone Aug 22, 2016
@taketwo taketwo self-assigned this Aug 22, 2016
@stefanbuettner
Copy link
Contributor

stefanbuettner commented Oct 22, 2016

Talking about PCL_DEFINITIONS, there is this issue #1725

When removing PCL_DEFINITIONS, what about instruction set extensions and client code? Is it sufficient to write the compiler generated defines, such as #define AVX into pcl_config.h such that client code will be compiled appropriately? And if so, does it work for all supported compilers?

@efernandez
Copy link

If you remove the PCL_DEFINITIONS then client code has no way to find out the flags (like vectorization extensions) that PCL was compiled with. This information is needed in the CMakeLists.txt file, so those flags are passed to the compiler.

I'm not expert on this, but I've recently run into issues using other software. The client code crashes because of unaligned memory using vectorized operations, unless it's built with the same flags as the library code.

@taketwo
Copy link
Member

taketwo commented Dec 14, 2017

You are right. In fact, we are working on this in #2100. I think this issue can be closed.

@Algomorph
Copy link
Contributor

The client code has to include pcl_config.h, wherein it will find the preprocessor defines. Only the flags that aren't preprocessor defines should be added via CMake, using the target_compile_definitions command, and only if the client code must be required to use the same flags in order to run (I'm no expert on which ones those are), should should those be added using the PUBLIC argument.

@SergioRAgostinho
Copy link
Member Author

[...] target_compile_options [...]

Check the differences between the options vs the definitions here.

@SergioRAgostinho
Copy link
Member Author

Only half of the issue is being addressed in #2100, which is passing the compiler options (and definitions) to downstream targets. We still need to ensure all preprocessed definitions are strictly in pcl_config.

@kunaltyagi
Copy link
Member

Reviving old issue for discussion

PCL_DEFINITIONS are only used in PCLConfig.cmake.in and doc/tutorials/content.

@stale
Copy link

stale bot commented May 19, 2020

Marking this as stale due to 30 days of inactivity. It will be closed in 7 days if no further activity occurs.

@stale stale bot added the status: stale label May 19, 2020
@kunaltyagi kunaltyagi added kind: proposal Type of issue skill: cmake Skills/areas of expertise needed to tackle the issue labels May 19, 2020
@kunaltyagi
Copy link
Member

This is consumer facing code and is potentially creating a breaking change. What should be done here? Keep or remove?

@stale
Copy link

stale bot commented Jun 20, 2020

Marking this as stale due to 30 days of inactivity. It will be closed in 7 days if no further activity occurs.

@stale stale bot added the status: stale label Jun 20, 2020
@kunaltyagi kunaltyagi added the needs: feedback Specify why not closed/merged yet label Jun 22, 2020
@stale stale bot removed the status: stale label Jun 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind: proposal Type of issue module: cmake module: common needs: feedback Specify why not closed/merged yet skill: cmake Skills/areas of expertise needed to tackle the issue
Projects
None yet
Development

No branches or pull requests

6 participants