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

Fixed MSVC linker crash. #350

Merged
merged 1 commit into from
Nov 8, 2013

Conversation

kwaegel
Copy link

@kwaegel kwaegel commented Nov 5, 2013

  • Linking pcl_features hit 4GB memory limit in release mode. Disabled whole program optimization and link-time code generation as a workaround.

Addresses issue #349.

* Linking pcl_features hit 4GB memory limit in release mode. Disabled whole program optimization and link-time code generation as a workaround.
@jspricke
Copy link
Member

jspricke commented Nov 5, 2013

@kwaegel
Copy link
Author

kwaegel commented Nov 5, 2013

That would turn off optimization for everything. It is only pcl_features that is having a problem, so I was trying to keep my changes localized to that module.

@jspricke
Copy link
Member

jspricke commented Nov 5, 2013

But it would still turn it of globally, so I don't see the point of hiding it in there. Also, we should not disable it for people with enough RAM ;).

@kwaegel
Copy link
Author

kwaegel commented Nov 5, 2013

This patch does not turn optimization off globally. Overwriting the variables in CMake only sets them for the current directory and sub-directories (unless the PARENT_SCOPE option is used during SET).

This bug is not due to limited system memory. Selecting "Visual Studio 11 Win64" in CMake defaults to using the x86_amd64 cross-compiler, which is a 32-bit process and can only access 4GB of RAM.

Just discovered:
Visual studio does have a native amd64 compiler, but I can't find a standard way to set that in CMake. This StackOverflow post describes how to change the default toolset to native amd64, but this method was non-obvious (for me) and does not address problems with using the defaults.

Ideally we would only turn this option off if a 32-bit linker is detected, but I'm not sure how to check for that.

@nizar-sallem
Copy link
Contributor

This post suggests that there is a way around that without touching PCL http://stackoverflow.com/questions/14319247/cmake-is-unable-to-configure-project-for-visual-studios-10-amd64 but I can not test it since I don't have a windows machine.

@jspricke
Copy link
Member

jspricke commented Nov 8, 2013

@kwaegel I wasn't aware of that, sorry. Thanks for the patch

jspricke added a commit that referenced this pull request Nov 8, 2013
@jspricke jspricke merged commit 9d8eca6 into PointCloudLibrary:master Nov 8, 2013
@kwaegel kwaegel deleted the msvc_linker_fix branch November 8, 2013 17:18
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