-
Notifications
You must be signed in to change notification settings - Fork 27
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
Fix issues on MSVC and update build instructions. #6
base: master
Are you sure you want to change the base?
Conversation
The change in the |
add_library(WaveGrid WaveGrid.cpp Enviroment.cpp Grid.cpp ProfileBuffer.cpp Spectrum.cpp ${Environment_RCS}) | ||
target_link_libraries(WaveGrid Eigen3::Eigen) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Eigen3 does not have any libraries, it's header only?!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's required to setup the correct include paths for the project. Maybe that's a MSVC thing but I don't think it hurts anyway.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
@@ -53,7 +53,7 @@ class WaterSurfaceMesh : public SceneBase3D::Object3D, public SceneGraph::Drawab | |||
// std::vector<VertexData> newData = _data; | |||
|
|||
#pragma omp parallel for | |||
for (size_t i = 0; i < _data.size(); i++) { | |||
for (int i = 0; i < _data.size(); i++) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why? An int
is not safe when iterating on a STL container, size_t
is designed for this.
Ideally you would even use std::vector<Foo>::size_type
(see https://stackoverflow.com/questions/45168636/stdsize-t-or-stdvectorfoosize-type) but most of the time std::size_t
is fine (certainly better than a int).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I found that MSVC even 2019 doesn't support OpenMP 3.0 so all for loops need to use a signed type. I disabled OpenMP on MSVC below in 49b116f, performance seemed very similar. And I reverted this line.
Hello @speps , I encountered the same issue when building this project with MSVC 2019, so I directly cloned your modified version. The project built and compiled successfully, but during runtime, the program crashed inside ImGui with the error message "g was nullptr," as shown in the screenshot below: I haven't modified the source code, and I'm wondering if you've encountered this issue as well? I checked the usage of ImGui in the source code and didn't find any issues. |
I wanted to run the demo in MSVC. Most of the instructions worked but I had some issues with missing ones and some CMake issues where the values were GCC/Clang specific.