Page 3 of 3 FirstFirst 123
Results 21 to 28 of 28

Thread: Makefile applications from Github won't run, open as text document

  1. #21
    Join Date
    May 2021
    Beans
    18

    Re: Makefile applications from Github won't run, open as text document

    Quote Originally Posted by ActionParsnip View Post
    Instead of screenshots of text. Just copy and paste the text in the forum instead. A forum is a text based system.....
    Yeah, it was already addressed a few post earlier on, sorry for that.

    Any ‘on topic’ suggestions on how to get this application installed would be much appreciated!
    Last edited by michelvandegaer; May 20th, 2021 at 04:43 PM.

  2. #22
    Join Date
    Aug 2011
    Location
    51.8° N 5.8° E
    Beans
    5,919
    Distro
    Xubuntu 20.04 Focal Fossa

    Re: Makefile applications from Github won't run, open as text document

    You ran
    Code:
    sudo make all
    to compile the program. I wouldn't use sudo for that. You need sudo to install the program system wide, not to compile it. As a general rule, only run the things that really need it with root privileges. As you ran make with sudo, the resulting executable is owned by root and your ordinary user has limited access to it. For example, I don't think you can right now compile it again without sudo, as the tools would attempt to overwrite your executable and have no permission to do so.

    You can change ownership of the executable to yourself using chown. You can also delete it, then compile again, but now without the sudo. To delete files, you only need write access to the directory, not to the file itself. But on the other hand, if you want to install it system wide, you can simply move the executable to /usr/local/bin/ or wherever you want it (but that's the suggested location). Stuff there should be owned by root.

    I suggest you create a directory to experiment in, maybe create a few more users and groups, and play a bit with permissions. The permission system on Linux is actually really simple.

  3. #23
    Join Date
    May 2021
    Beans
    18

    Re: Makefile applications from Github won't run, open as text document

    Oh man this sucks so hard.

    Isn't there a tool that the author can use that extracts everything related into one install file?

    What a bunch of misery just to run one application. Horror.

    I am going to do an erase-install of this laptop ... and start again without the "sudo make all"

    To be continued ... brrrr

  4. #24
    Join Date
    May 2021
    Beans
    18

    Re: Makefile applications from Github won't run, open as text document

    Hi Impavidus,

    I'm back, sorry for venting some frustration.

    I just did a clean-erase install and installed all the dependencies (I hope) and downloaded the two programs TinyEngine (not sure if this is now the right version) and DynamicFoam.

    Now I followed your advice doing the make without the "sudo all" and go this prompt that permission was denied:

    Code:
    chimel@chimel-ThinkPad-X240:~$ cd ~/Desktop/TinyEngine-master
    chimel@chimel-ThinkPad-X240:~/Desktop/TinyEngine-master$ make
    Copying Core Header Files ...
    mkdir: cannot create directory ‘/usr/local/include/TinyEngine’: Permission denied
    make: *** [makefile:23: setup] Error 1
    chimel@chimel-ThinkPad-X240:~/Desktop/TinyEngine-master$
    So I guess I have no other option than to install this under "Sudo -s"?

    BTW I didn't really understand your point of "move the executable to /usr/local/bin/" do you mean with this to put the whole downloaded applications folders over there instead of just leaving them on the Desktop, and how do I do that, that location seems to be hidden.

    ----

    Edit: This was the code suggested by Holger to download directly from git but it had the Sudo make all:

    Code:
    sudo rm -rf /usr/local/include/TinyEngine/
    sudo rm /usr/local/lib/libTinyEngine.a
    mkdir ~/src/
    cd ~/src
    git clone -b working https://github.com/weigert/TinyEngine.git
    cd TinyEngine
    sudo make all
    cd ..
    What should I use?
    Last edited by michelvandegaer; May 20th, 2021 at 09:48 PM.

  5. #25
    Join Date
    Dec 2014
    Beans
    1,805

    Re: Makefile applications from Github won't run, open as text document

    Better makefiles have separate targets for compiling and installing. The one for TinyEngine doesn't, it's 'install' target compiles the library and copies it to '/usr/local/lib/' and '/usr/local/include/'. The one for DynamicFoam doesn't have a target for installation, it only compiles the program. So use 'sudo make all' for TinyEngine and just 'make' for DynamicFoam.

    Holger

  6. #26
    Join Date
    May 2021
    Beans
    18

    Re: Makefile applications from Github won't run, open as text document

    Alright, thanks Holger. I’m going to give it an other go tomorrow.

    BTW have you been able to run it … have you seen the comments from the author on page 2?

    I also got this feedback later today from him:
    Try compiling the TinyEngine example programs. Use the makefiles in the example folder (sudo make all).

    The main file should be compiled any way, dont worry if it disappears.

    Getting a dedicated server makes no sense.

    The standard procedure is to install all dependencies, then clone the repo and then follow the installation instructions.

    If there is no folder main, then you can not CD into main. To check the files / directories, use "ls". The dynamicfoam repo should not have a folder main, just an executable. If its missing you can regenerate it using make.

    Let me know if the example programs compile. Otherwise I can roll back the GL version to compatibility profiles.
    Note, the part about a dedicated server was as an alternative to run it on, would that make sense to you?



    You also say ‘better makefiles’ is there anything specific that you have in mind / advise that would make it (a whole lot) better?
    Last edited by michelvandegaer; May 21st, 2021 at 07:48 AM.

  7. #27
    Join Date
    Aug 2011
    Location
    51.8° N 5.8° E
    Beans
    5,919
    Distro
    Xubuntu 20.04 Focal Fossa

    Re: Makefile applications from Github won't run, open as text document

    Proper makefiles have separate rules for compiling and installing and only the rules for installing need sudo. It appears that this isn't one of those proper makefiles. In any case, when your file manager shows any file with a lock on it, it means you (as in your ordinary user) have only limited permissions on it. Probably because you're not the owner (root is) and only the owner has write permissions. A proper makefile would avoid this, but it's easy to fix with chown. All files in your home directory (including any subdirectories) should be owned by you, unless you've something special in mind.

    Yes, installing software takes quite a bit of knowledge if you don't have a proper installer.

  8. #28
    Join Date
    May 2021
    Beans
    18

    Re: Makefile applications from Github won't run, open as text document

    Hey,

    I'm back, good news I got the issue solved last week with the help of the author Nick McDonald.

    I thought I pass by with an update:

    He removed spurious dependencies and reduced the shader version, the new versions can be downloaded at:

    https://github.com/weigert/TinyEngine (The underlying engine)
    https://github.com/weigert/DynamicFoam (The actual program)

    ---

    For installation these three steps are needed to get started:

    I. Installing dependencies:


    • OpenGL3: apt-get install libglu1-mesa-dev
    • SDL2: apt-get install libsdl2-dev libsdl2-ttf-dev libsdl2-mixer-dev libsdl2-image-dev
    • GLEW: apt-get install libglew-dev
    • Boost: apt-get install libboost-system-dev libboost-filesystem-dev
    • GLM: apt-get install libglm-dev



    II. For the TinyEngine:


    Code:
    cd ~sudo rm -rf TinyEngine
    git clone https://github.com/weigert/TinyEngine
    cd TinyEngine
    sudo make all
    cd examples/0_Empty
    make all
    ./main
    It downloads the code and installs it on your computer.


    III. For the DynamicFoam app:

    Download the Zip file and unzip it to your computer:

    https://github.com/weigert/DynamicFo...heads/main.zip

    Next run

    Code:
    cd ~/Desktop/DynamicFoam-main/
    
    ./main
    The first line is to go to the map (I had placed it on my Desktop), and ./main (+Enter) is to run the app.

    Note: I had to first delete in the 'Makefile' in the DynamicFoam-folder these two from the linker line:
    • -lnoise
    • -lboost_serialization


    ---

    Once the program runs press 'P' to toggle the paused state of the simulation and 'ESC' to view the simulation control.

    Here are two sample-clips with how it looks:

    https://vimeo.com/557182750
    https://vimeo.com/557181751 (inverse colors)

    Have fun if you would like to give try it,
    and thanks for all the support!

    Best,

    M.


    p.s. I'm adding below all the communication to get it to work.


    The makefile does not perform an "install", therefore that comment is redundant. Installing means copying an executable from the compilation location to a location where the shell looks for executables, e.g. /usr/bin/. This makefile only compiles. And we executed with privilege as a debugging measure since you were having compilation issues. Otherwise it is not necessary to compile as root.

    I merged the TinyEngine working branch so you can just clone the main branch to your location of choice (your home folder):

    cd ~
    git clone https://github.com/weigert/TinyEngine
    cd TinyEngine

    It will be cloned into a folder called "TinyEngine". Don't worry about uninstalling it first - if it exists, it will be overwritten. We then use the makefile to perform a build + install. It builds in a folder called TinyEngine/tmp/ which is made and then deleted after install. We run this as privilege so the copy can happen. The file ownership does not matter for the linked libraries.

    sudo make all

    The files are now installed in the correct locations, which you can read at the top of the makefile.

    Finally, we try to compile the example programs (without privilege because without install) and see if we can get a window to open.

    cd examples
    make all

    The executables will remain in the folders of the example programs. We can test example program zero:

    cd 0_Empty
    ./main

    This output should then give you the glx error. Don't do anything else, just please confirm that it gives you the "missing glx visual" error. We can then debug from there.

    —————

    I have removed any spurious dependencies in the main branch (libnoise, boost serialization - they were indeed not required but an artefact in the makefile), so just use the one-liner provided in TinyEngine readme:

    sudo apt-get install libglu1-mesa-dev libsdl2-dev libsdl2-ttf-dev libsdl2-mixer-dev libsdl2-image-dev libglew-dev libboost-system-dev libboost-filesystem-dev libglm-dev

    On Ubuntu this should be all that you need. If you have installed correctly, this command should also tell you "0 new installed". If not, send me what it tells you is failing.

    —————

    You were missing the SDL TTF dependency - running the command I sent does exactly what you found in that forum.

    Also I JUST fixed the spurious dependencies - so make sure to delete the repo folder, reclone and repeat the steps. Execute the dependency install first / before running the makefile.

    —————

    It appears you have installed all dependencies correctly as the programs have compiled. This might be an issue with how TinyEngine tries to create a GL context. I will try to reduce to a compatibility version to see if it works, I will update you in a moment.

    Also try the following:

    glxgears

    and tell me if the program runs correctly, and then:

    sudo apt-get install libx11-dev

    And then recompile install TinyEngine and the example file using the makefiles

    cd INSTALLFOLDER
    sudo make all
    cd examples/0_Empty
    make all
    ./main

    —————

    Can you please check if you are using Ubuntu / Gnome on X11 or Wayland?

    echo $XDG_SESSION_TYPE

    Result: X11

    ————

    With INSTALLFOLDER I meant for you to replace it with your install folder, because you told me you were not installing it in your home folder. That's why none of the subsequent commands worked.

    When you get the error with "already exists", just type:

    sudo rm -rf TinyEngine.

    This removes the folder and its contents recursively. Then you can repeat the steps.

    It is interesting that glxgears only ran after you installed something else:

    sudo apt install mesa-utils

    I suggest cleaning the install (i.e. delete the TinyEngine folder - the additional steps that holger adds are not strictly necessary), recloning the working branch, installing and attempting to run the example.

    In other words, while you are running an X11 session:

    cd ~
    sudo rm -rf TinyEngine
    git clone https://github.com/weigert/TinyEngine
    cd TinyEngine
    sudo make all
    cd examples/0_Empty
    make all
    ./main

    ——————

    Remove the folder again, but this time try cloning the working branch, because I have reduced to a compatibility version.

    cd ~
    sudo rm -rf TinyEngine
    git clone -b working https://github.com/weigert/TinyEngine
    cd TinyEngine
    sudo make all
    cd examples/0_Empty
    make all
    ./main


    Result:

    SDL_Error: Couldn't find matching GLX visual

    I ran:

    export SDL_VIDEO_X11_VISUALID=

    This causes SDL to go down a different code path to find the visual. You can also try hardcoding the visual to the visual id from glxinfo:

    export SDL_VIDEO_X11_VISUALID=0x022

    Ref. https://stackoverflow.com/questions/...ing-glx-visual

    ——————

    Can you please give me the full output of glxinfo?

    Apparently your card should support the latest GL: https://superuser.com/questions/5611...s-card-support

    Otherwise I have further reduced the compatibility version. You can try recompiling again just like you did with the working branch to see if anything has changed.

    ——————

    Can you try running:

    sudo apt-get install mesa-utils xserver-xorg-video-intel

    and confirm that nothing new is installed, then run

    sudo ldconfig

    ——————


    I tried:

    export MESA_GL_VERSION_OVERRIDE=3.3

    via https://stackoverflow.com/questions/...ubuntu-18-04-c

    ——————

    You need to do the following:

    sudo nano /etc/modprobe.d/default.conf

    Then enter the line:

    options snd_hda_intel index=1

    then hit ctrl+x, then y and enter (this saves the file), then restart your computer.

    To run the julia example go to the julia set example folder:

    cd ~/Desktop/TinyEngine-master/examples/4_Julia/

    and then compile and run:

    make all
    ./main

    (... and Enter)

    git clone -b working https://github.com/weigert/TinyEngine

    ——————

    You should be able to fix this quickly by opening the Makefile and deleting the -lnoise and -lboost_serialization from the linker line.

    Then recompile and run.

    The dependencies are deprecated.

    ——————

    There’s a a minor visual bug with the triangles that I haven't fixed yet because of an opengl feature you might be missing on the compatibility version, but everything else should work.

    The large triangle is the graphical bug and results from the fact that the compatibility profile of opengl with version 1.3 GLSL shaders does not support shader storage buffer objects. This is the feature I use to render the triangles with properties, which then defaults to that position as it fails. This also causes some irregular segmentation faults - if the program crashes just restart it. This does not happen when the core profile is used (like on my computer).

    Your graphics card apparently supports a core profile but some of the tests which I had you do previously apparently failed to load the core profile and resulted in the GLX bug. I am not quite sure why.

    ——————

    Download the updated compatibility version of DynamiFoam.

    ——————

    To generate the executable you simply need to compile. Enter the directory and type "make all".

    The main file is definitely generated via compilation


    The reason you dont typically ship software with a compiled binary is because of potentially different linked library locations or other compatibility problems, i.e. the binary needs to be compiled on the target platform.

    The instructions for compilation are in the makefile, and so typing make all generates the binary on your computer.

Page 3 of 3 FirstFirst 123

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •