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

How to compile GLVis for Windows? #271

Open
rozerinyildiz23 opened this issue Feb 7, 2024 · 9 comments
Open

How to compile GLVis for Windows? #271

rozerinyildiz23 opened this issue Feb 7, 2024 · 9 comments

Comments

@rozerinyildiz23
Copy link

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
Copy link

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
Copy link
Member

v-dobrev commented Feb 7, 2024

Did you see this section:

glvis/INSTALL

Lines 140 to 172 in 84c4ebb

- On Windows, GLVis can be built in two ways:
1) Via a Linux-compatible environment, such as Cygwin or Windows Subsystem for
Linux (WSL).
Install the required dependencies, following the directions above for your
WSL environment's Linux distribution, then continue with the build method
of your choice.
For WSL, you may also need to install an X server to run GLVis, such as
VcXsrv (https://sourceforge.net/projects/vcxsrv/).
2) As a native Windows executable. This enables support for platform-native
visualization windows, as well as the modern OpenGL backend.
Visual Studio or another Windows-compatible compiler is required.
It is recommended to install dependencies via vcpkg:
vcpkg install fontconfig freetype sdl2 glew glm libpng \
--triplet=x64-windows
After installing, proceed with the CMake configuration process, making sure
to point the CMake variable CMAKE_TOOLCHAIN_FILE to the correct path, based
on the directory where you installed vcpkg. More directions can be found in
the link below:
https://vcpkg.readthedocs.io/en/latest/examples/installing-and-using-packages/#cmake
You may then open the generated Visual Studio project files to build GLVis,
or call the following command from the GLVis project root directory:
cmake --build [build directory] --parallel

@v-dobrev
Copy link
Member

v-dobrev commented Feb 7, 2024

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

@altineller
Copy link

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
Copy link
Member

tzanio commented Feb 8, 2024

@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
Copy link
Member

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
Copy link

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
Copy link
Member

@altineller, are you using vcpkg to build the dependencies? This is what we recommend in the INSTALL file for windows-native build:

glvis/INSTALL

Lines 152 to 172 in 84c4ebb

2) As a native Windows executable. This enables support for platform-native
visualization windows, as well as the modern OpenGL backend.
Visual Studio or another Windows-compatible compiler is required.
It is recommended to install dependencies via vcpkg:
vcpkg install fontconfig freetype sdl2 glew glm libpng \
--triplet=x64-windows
After installing, proceed with the CMake configuration process, making sure
to point the CMake variable CMAKE_TOOLCHAIN_FILE to the correct path, based
on the directory where you installed vcpkg. More directions can be found in
the link below:
https://vcpkg.readthedocs.io/en/latest/examples/installing-and-using-packages/#cmake
You may then open the generated Visual Studio project files to build GLVis,
or call the following command from the GLVis project root directory:
cmake --build [build directory] --parallel

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

@altineller
Copy link

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants