Author Topic: EDAF80 - Computer Graphics 2018 HT1  (Read 8537 times)

Offline MikeD

  • Full Member
  • ***
  • Posts: 211
EDAF80 - Computer Graphics 2018 HT1
« on: 2018-08-29 06:05:33 »
Welcome to the Computer graphics: Introduction to 3D discussion forum!  :)

Here you may ask questions about the labs or other issues. Teachers/assistants will be present here, but students are highly encouraged to participate.

Course-related announcements might pop up here as well, so make sure to stop by on a regular basis.

Editions from previous years (lots of useful stuff):
2017 forum: http://forum.student.lth.se/index.php/topic,13105.0.html
2016 forum: http://forum.student.lth.se/index.php/topic,12059.0.html
2015 forum: http://forum.student.lth.se/index.php/topic,12020.0.html
2014 forum: http://forum.student.lth.se/index.php/topic,11802.0.html
2013 forum: http://forum.student.lth.se/index.php/topic,1105.0.html
2012 forum: http://forum.student.lth.se/index.php/topic,1057.0.html
2011 forum: http://forum.student.lth.se/index.php/topic,999.0.html
2010 forum: http://forum.student.lth.se/index.php/topic,929.0.html

Offline Pierre Moreau

  • Full Member
  • ***
  • Posts: 202
Re: EDAF80 - Computer Graphics 2018 HT1
« Reply #1 on: 2018-09-03 20:39:38 »
Welcome everyone to the forum!  :)

A few updates regarding the labs:
  • An update has just been pushed to GitHub: it has  a bunch of bug fixes and improvements compared to last year version, so you should definitely consider updating if you have already cloned the labs.
  • Another update will be coming before next week: mainly small improvements to the different assignments

Recap on how to set up everything for the labs (if you are working on the lab computers, otherwise skip straight to step 3. and you don’t have to use Visual Studio: Xcode, Makefile and others are fine as well):
  • Change your environment variables: open “Control Panel”, go to “User Accounts”, then “User Accounts” again, then look on the menu list on the left and select “Change my environment variables”.
    There, edit the TMP variable (not the TEMP one) and replace “AppData\Local” by “Program\CG_Labs”.
  • Create the “Program” folder directly in your home folder (so under “C:\Users\[username]”), as well as the CG_Labs under it
  • Download the code from GitHub, extract it and place the resulting folder under “Program\CG_Labs” and rename it to “code”.
  • Create a “build” folder alongside the ”code” folder.
  • Open CMake-GUI: set the source folder to point to the “code” folder, and the build folder to the ”build” one. Press “Configure” once and select the “Visual Studio14 2015 Win64” option; it will take some time as it downloads and build all dependencies. Press “Configure” a second time once it’s done, and then “Generate”.
    You can now open the generated Visual Studio project found in the build folder; you will no longer need to use CMake-GUI.
  • You are now all set: in the future, you will only need to open the project and hack at the code.

Edit: You can find the above steps illustrated with screenshots in the following guide.

Ask your questions and issues regarding setting up the labs in the forum, and I’ll do my best to help you.
« Last Edit: 2018-09-10 09:47:26 by Pierre Moreau »

Offline tfy14esa

  • Newbie
  • *
  • Posts: 11
Re: EDAF80 - Computer Graphics 2018 HT1
« Reply #2 on: 2018-09-07 16:05:22 »
Hi,
I tried compiling the code package, but for some reason Cmake can't find the appropriate compiler. I believe the compiler is stored under
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.15.26726\bin\Hostx86\x64
but I might be wrong. I tried linking this path by adding it as an entry, but it didn't work. Do you have any suggestions?

Offline Pierre Moreau

  • Full Member
  • ***
  • Posts: 202
Re: EDAF80 - Computer Graphics 2018 HT1
« Reply #3 on: 2018-09-08 14:50:09 »
Hi,
I tried compiling the code package, but for some reason Cmake can't find the appropriate compiler. I believe the compiler is stored under
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.15.26726\bin\Hostx86\x64
but I might be wrong. I tried linking this path by adding it as an entry, but it didn't work. Do you have any suggestions?

If you are trying on the lab computers, make sure you followed the instructions in comment #2.

If you are on your own computer, it’s possible you ended up installing only Visual Studio 2017, without the C++ compiler. Try creating a simple C++ project using the C++ template found when creating a new project, and see if you can compile it.
If it fails as well or you can’t find a C++ template among the suggested templates, you are missing the C++ tools from VIsual Studio. Start the Visual Studio Installer and modify the VS installation you have: this will display a new window where you can add and remove components from your installation. Look for Visual C++ or C++ Tools in the “products”? tab (not the “individual components” one).

Also, with VIsual Studio 2017, you don’t need to run CMake manually: instead, start VS 2017 and select “Open a Folder”: the folder you want to open is the one containing the README.md, CMakeLists.txt etc. VS 2017 should automatically run CMake once you have selected the correct folder; see https://github.com/LUGGPublic/CG_Labs#visual-studio-2017 for more details.

Offline WillemijnvanWijk

  • Newbie
  • *
  • Posts: 1
Re: EDAF80 - Computer Graphics 2018 HT1
« Reply #4 on: 2018-09-09 15:46:02 »
Hi!

I am looking for a labpartner as well :)


Offline tfy14esa

  • Newbie
  • *
  • Posts: 11
Re: EDAF80 - Computer Graphics 2018 HT1
« Reply #5 on: 2018-09-10 00:54:48 »
Thank you Pierre for the help. I have now run into another problem. I now get the error message in the picture. The problem is that I cannot find the file "Findglfw3.cmake" anywhere. I also tried linking the "glfw3_DIR" to the correct directory, without success.

Offline Pierre Moreau

  • Full Member
  • ***
  • Posts: 202
Re: EDAF80 - Computer Graphics 2018 HT1
« Reply #6 on: 2018-09-10 09:40:52 »
Thank you Pierre for the help. I have now run into another problem. I now get the error message in the picture. The problem is that I cannot find the file "Findglfw3.cmake" anywhere. I also tried linking the "glfw3_DIR" to the correct directory, without success.

Mhm… did you get another error message before that? Try deleting the “dependencies” folder, next to the “CMakeLists.txt” file: the code for detecting whether to clone and build the dependencies is not as resilient as it could.

Offline Pierre Moreau

  • Full Member
  • ***
  • Posts: 202
Re: EDAF80 - Computer Graphics 2018 HT1
« Reply #7 on: 2018-09-10 09:46:23 »
I have written a small guide for setting up everything for the labs, with screenshots for every step; it is targeted for getting things running on the lab computers, so not every step will apply to you if you are working on your own computer.

Also, the lab computers are going to be migrated to Visual Studio 2017 (which means that part of the guide above will no longer be valid) in theory within a few days. Hopefully this will either happen before the first lab or after the last one but not in between.

Offline tfy14esa

  • Newbie
  • *
  • Posts: 11
Re: EDAF80 - Computer Graphics 2018 HT1
« Reply #8 on: 2018-09-10 09:47:55 »
You are correct. I did get another error message before that I believe I solved. The error message is in the attached picture. I solved it by adding the path "C:\Users\sands\Desktop\LTH\LP1\Grafik\CG_Labs\code\dependencies\assimp-source\cmake-modules" as the "CMAKE_MODULE_PATH".
« Last Edit: 2018-09-10 10:04:22 by tfy14esa »

Offline Pierre Moreau

  • Full Member
  • ***
  • Posts: 202
Re: EDAF80 - Computer Graphics 2018 HT1
« Reply #9 on: 2018-09-10 12:22:31 »
You are correct. I did get another error message before that I believe I solved. The error message is in the attached picture. I solved it by adding the path "C:\Users\sands\Desktop\LTH\LP1\Grafik\CG_Labs\code\dependencies\assimp-source\cmake-modules" as the "CMAKE_MODULE_PATH".

Delete the whole “dependencies” folder, as you will be experiencing more issues than the line even with that quirk for assimp, as the library was not built since it couldn’t find the C++ compiler. Deleting the folder will trigger a re-clone, but more importantly, a build of all libraries.

Offline Agy15mpa

  • Newbie
  • *
  • Posts: 1
Re: EDAF80 - Computer Graphics 2018 HT1
« Reply #10 on: 2018-09-10 13:28:05 »
I can't get Visual Studio 2017 to build my code.

I download the zip folder fromgithub, extract it, put the contents into a folder called "code".

I start up VS17, open folder -> code.

CMake starts until it gets to building and installing assimp..

I then get the error:

Severity   Code   Description   Project   File   Line   Suppression State
Error      CMake Error at CMake/InstallAssimp.cmake:55 (message):
  Build step for assimp failed: 1

  Error output:      C:\LTH\DatorGrafik\code\CMake/InstallAssimp.cmake   55   

I do not know how to fix this as for now.

I have tried deleting the folder and making a new one after reseting all imports and exports via VS17, restarting and then trying to build this new folder via VS17, which does not work.


Edit:

I uninstalled VS17, deleted all the folders I had tried to make it work with. Restarted the PC. Re-installed VS17, re-downloaded the code from github.

I opened the folder as before in VS17 and got the same error.

« Last Edit: 2018-09-10 14:20:52 by Agy15mpa »

Offline Pierre Moreau

  • Full Member
  • ***
  • Posts: 202
Re: EDAF80 - Computer Graphics 2018 HT1
« Reply #11 on: 2018-09-10 15:32:38 »
I can't get Visual Studio 2017 to build my code.

I download the zip folder fromgithub, extract it, put the contents into a folder called "code".

I start up VS17, open folder -> code.

CMake starts until it gets to building and installing assimp..

I then get the error:

Severity   Code   Description   Project   File   Line   Suppression State
Error      CMake Error at CMake/InstallAssimp.cmake:55 (message):
  Build step for assimp failed: 1

  Error output:      C:\LTH\DatorGrafik\code\CMake/InstallAssimp.cmake   55   

I do not know how to fix this as for now.

I have tried deleting the folder and making a new one after reseting all imports and exports via VS17, restarting and then trying to build this new folder via VS17, which does not work.


Edit:

I uninstalled VS17, deleted all the folders I had tried to make it work with. Restarted the PC. Re-installed VS17, re-downloaded the code from github.

I opened the folder as before in VS17 and got the same error.

My bad, I forgot to bump the version of Assimp used in the project: it is currently set to 4.0.1, but we want 4.1.0 as it contains a build fix for Visual Studio 2017, which is the issue you are experiencing.
I can’t push a patch right now (will do that in a few hours), but if you open the CMakeLists.txt file, edit the following line to replace "4.0.1" by "4.1.0". Once that is done, delete the dependencies folder again (and just in case, the folder in ${HOME}/CMakeBuilds that Visual Studio created.
And it looks like some variable is not being by Visual Studio either, so you need to also edit src/EDAF80/CMakeLists.txt and replace "${VS_TOOLSET_VERSION}-mt" by "vc140-mtd" (and the same change in "src/EDAN35/CMakeLists.txt". In those two files, a few lines below the previous edit, change "${target_dir}/$<CONFIG>" to just "${target_dir}" (see https://github.com/LUGGPublic/CG_Labs/blob/master/src/EDAN35/CMakeLists.txt#L28).

With those many changes, I can at least build and run the first lab.

It is definitely not convenient, but I can't do better than that right now, besides otherwise telling you to wait for the patch.

Offline Pierre Moreau

  • Full Member
  • ***
  • Posts: 202
Re: EDAF80 - Computer Graphics 2018 HT1
« Reply #12 on: 2018-09-10 20:52:56 »
I have pushed a couple of patches to GitHub, which are needed for configuring, building and running the labs with Visual Studio 2017. Do not forget to delete the “dependencies” folder after updating, to ensure that CMake will rebuild the dependencies properly; you might want to also delete the folder that Visual Studio 2017 automatically creates for storing the binaries and such: you can find it in your home directory, under CMakeBuilds (the folder might be hidden by default).
If you were using Visual Studio 2015 or were on macOS or Linux, you don’t need to update your version of the labs (but you can if you want).

If you are still experiencing some issues after updating (and making sure to delete that “dependencies” folder before rebuilding), please post them here on the forum.

Offline Will

  • Newbie
  • *
  • Posts: 5
Re: EDAF80 - Computer Graphics 2018 HT1
« Reply #13 on: 2018-09-10 23:58:05 »
I still can't get the setup to run on my Windows 10 machine.

I get the following error:

CMake Error at CMake/InstallAssimp.cmake:56 (message):
  Build step for assimp failed: 1
  Error output: ninja: error:
  'C:/Users/-/-/-/-/CG_Labs/dependencies/assimp-source/contrib/zlib/adler32.c',
  needed by 'contrib/zlib/CMakeFiles/zlib.dir/adler32.obj', missing and no
  known rule to make it
Call Stack (most recent call first):
  CMakeLists.txt:46 (include)

I've pulled the latest patches from github and deleted the dependencies folder as well (I'm not sure what folder VS 2017 created to store binaries in, the subfolders I found under CMakeBuilds have nonsensical names so I couldn't tell which one came from visual studio, and I don't know if it's even related to the issue at hand).

I have tried using the clion IDE as well, with similar results.

Offline Shadertoy

  • Newbie
  • *
  • Posts: 1
Re: EDAF80 - Computer Graphics 2018 HT1
« Reply #14 on: 2018-09-11 09:26:18 »
I have succesfully been able to build the project but I am not able to find the solution file. I used CMake in the Visual Studio 2017 interface and build the code within the source directory (although it was recommended to build in a separate folder but I don't know how to do that in VS 2017). Why am I not able to find the sln file after I build the project?