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

Unable to run get_externals.lua #131

Open
zshift opened this issue Jun 8, 2021 · 3 comments
Open

Unable to run get_externals.lua #131

zshift opened this issue Jun 8, 2021 · 3 comments

Comments

@zshift
Copy link

zshift commented Jun 8, 2021

The guide didn't mention this file, but it contains code that appears to download the glsdk directory, which is needed for framework/framework.lua to run.

I'm able to install the luasocket module to get socket.http calls working, but I can't find anything about the ex or ufs modules. Do these exist anymore?

@zshift
Copy link
Author

zshift commented Jun 8, 2021

This is the error I get after install luasocket

# lua get_externals.lua 
lua: get_externals.lua:8: module 'ex' not found:
        no field package.preload['ex']
        no file '/usr/local/share/lua/5.4/ex.lua'
        no file '/usr/local/share/lua/5.4/ex/init.lua'
        no file '/usr/local/lib/lua/5.4/ex.lua'
        no file '/usr/local/lib/lua/5.4/ex/init.lua'
        no file './ex.lua'
        no file './ex/init.lua'
        no file '/usr/local/lib/lua/5.4/ex.so'
        no file '/usr/local/lib/lua/5.4/loadall.so'
        no file './ex.so'
stack traceback:
        [C]: in function 'require'
        get_externals.lua:8: in main chunk
        [C]: in ?

@homeisfar
Copy link

homeisfar commented Jun 18, 2021

The glsdk directory is included in the git repository. You'll have a much easier time with cloning the repo to build the framework than with downloading the outdated release zip archive. You won't need to invoke Lua to get any external repos.

This is how I would do it from scratch on Fedora Linux:

sudo dnf install @Development-tools premake gcc-c++ libXi-devel freeglut-devel

Then clone the repo and enter the glsdk directory. Emit premake4 gmake and once that's done make -j4 config=release. This will get the framework code built. If you want to do all the premakes and builds for every individual tutorial afterwards, since they are built individually and separate from the glsdk framework code, you can try this in bash from the gltut directory:

dirs=(Tut*)
for dir in "${dirs[@]}"; do pushd . && cd "$dir" && premake4 gmake && make -j4 config=release && popd; done

You can alternatively build the tutorials with config=debug for when you play with the source and need to troubleshoot your bugs.

@homeisfar
Copy link

Another observation: The version of freeglut included in the glsdk directory is extremely old. On my desktop with proprietary nvidia drivers it's been no problem, but on my laptop with Intel drivers it causes trouble on the last few tutorials. The GL window cannot be created and it immediately crashes out.

This is where having a system-installed freeglut was handy. I haven't yet spent time to figure out how to do this for the entire repository (requires modifying glsdk/links.lua), but basically changing the make definition to link the system freeglut instead of the one in glsdk solved the crashing problem.

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

No branches or pull requests

2 participants