GLVis / glvis

Lightweight OpenGL tool for accurate and flexible finite element visualization
http://glvis.org
BSD 3-Clause "New" or "Revised" License
249 stars 51 forks source link

How to compile GLVis for Windows? #271

Open rozerinyildiz23 opened 7 months ago

rozerinyildiz23 commented 7 months ago

In our project, we want to call GLVis as a library and compile it on Windows. It is recommended to compile it with CMake for Windows, but sufficient explanation is not given. What solution would you suggest regarding this?

justinlaughlin commented 7 months ago

Hello and welcome! What steps have you tried so far? I think CMake-gui or VSC + CMake would be the simplest route. One thing to note is that the GLVis makefile sets some useful environmental variables such as MFEM_DIR which might not be set if only using CMake.

Personally I use WSL for almost everything code related, which has improved significantly over the past several years. Through WSL I can run any graphical application, including GLVis, and it feels like a native Windows tool. I know that is kind of an indirect answer but it is maybe an option to consider.

Cheers, Justin

v-dobrev commented 7 months ago

Did you see this section: https://github.com/GLVis/glvis/blob/84c4ebb1585bfb692758d728f18e01596d5ff18d/INSTALL#L140-L172

v-dobrev commented 7 months ago

Old issues regarding Windows may also be helpful: https://github.com/GLVis/glvis/issues?q=is%3Aissue+windows.

altineller commented 7 months ago

I am very interested to see the solution of this one as well. Is it possible to see the compilation instructions of the binary published?

tzanio commented 7 months ago

@publixsubfan can confirm, but I believe the build is happening in the GitHub CI: https://github.com/GLVis/glvis/blob/master/.github/workflows/builds.yml

v-dobrev commented 6 months ago

Actually, I think the action that creates binaries is this: https://github.com/GLVis/glvis/blob/master/.github/workflows/release.yml. This action builds macOS and Windows binaries and uploads them as artifacts, e.g. see here: https://github.com/GLVis/glvis/actions/runs/6814543178, at the bottom of the page -- unfortunately, the artifacts are kept just for a short time, so the binaries from that build are not available anymore.

Maybe we can upload them as GitHub packages when build, so they can be downloaded from GitHub from the "Packages" section on the right of the main GLVis/glvis repo page. @jandrej is this something that can be easily done? This way we can always have the latest binaries from master available.

By the way, the macOS and Windows binaries available on the GLVis website, https://glvis.org, are stored in the repo https://github.com/GLVis/releases and correspond to the latest release, v4.2, at the moment.

altineller commented 6 months ago

Actually, I think the action that creates binaries is this: https://github.com/GLVis/glvis/blob/master/.github/workflows/release.yml. This action builds macOS and Windows binaries and uploads them as artifacts, e.g. see here: https://github.com/GLVis/glvis/actions/runs/6814543178, at the bottom of the page -- unfortunately, the artifacts are kept just for a short time, so the binaries from that build are not available anymore.

Maybe we can upload them as GitHub packages when build, so they can be downloaded from GitHub from the "Packages" section on the right of the main GLVis/glvis repo page. @jandrej is this something that can be easily done? This way we can always have the latest binaries from master available.

By the way, the macOS and Windows binaries available on the GLVis website, https://glvis.org, are stored in the repo https://github.com/GLVis/releases and correspond to the latest release, v4.2, at the moment.

Hello VDobrev,

We are running glVis on windows from the binary package download, but we are looking for ways to compile glVis under windows. I am a linux user of 25+ years, and I have been lost in windows build process. Almost passed the glew dependency issue, but there are number of dependencies that make this very diffucult in windows. In linux what is just one command, takes hours of blind research on windows.

Best Regards, Can

v-dobrev commented 6 months ago

@altineller, are you using vcpkg to build the dependencies? This is what we recommend in the INSTALL file for windows-native build: https://github.com/GLVis/glvis/blob/84c4ebb1585bfb692758d728f18e01596d5ff18d/INSTALL#L152-L172

Are the issues with the vcpkg installation of the dependencies, or after that when building GLVis with cmake?

altineller commented 6 months ago

@v-dobrev that indeed worked. thank you. the problem was we were trying to install all these dependencies by hand instead of a toolchain file.