GLE icon indicating copy to clipboard operation
GLE copied to clipboard

Missing inittex.ini and update to build documentation

Open marekhilton opened this issue 2 years ago • 9 comments

Hello,

I've been trying to make an Arch Linux package from your repository and have been successful in building the code, however, when I try and run a GLE script I get an error opening inittex.ini. Here is the output for one of the example scripts sine-approx.gle. No .eps was created.

$ gle sine-approx.gle 
GLE 4.3.4[sine-approx.gle]-C-R-

>> sine-approx.gle (28) |end graph|
Could not open inittex.ini file 
[sine-approx][.eps]

This file does not seem to have been built anywhere. To build I am using the following:

	cmake -S src -B build\
	      -DCMAKE_INSTALL_PREFIX=/usr/lib/\
	      -DCMAKE_BUILD_TYPE=Release\
	      -DGLE_EXAMPLES_LIBRARY_PATH=path_to_local_lib_repo\
	      -DGLE_USER_MANUAL_PATH=path_to_local_man_repo

        cd build
	make
        make install

The structure of the files when installed is as follows. I created the symlinks after make install.

/
└── usr
    ├── bin
    │   ├── fbuild -> /usr/lib/gle-graphics/bin/fbuild
    │   ├── gle -> /usr/lib/gle-graphics/bin/gle
    │   ├── glebtool -> /usr/lib/gle-graphics/bin/glebtool
    │   ├── makefmt -> /usr/lib/gle-graphics/bin/makefmt
    │   └── qgle -> /usr/lib/gle-graphics/bin/qgle
    ├── lib
    │   └── gle-graphics
    │       ├── bin
    │       │   ├── fbuild
    │       │   ├── gle
    │       │   ├── glebtool
    │       │   ├── makefmt
    │       │   └── qgle
    │       ├── doc
    │       │   ├── ChangeLog.txt
    │       │   ├── LICENSE.txt
    │       │   └── README.txt
    │       ├── font  [114 entries exceeds filelimit, not opening dir]
    │       ├── gleinc  [19 entries exceeds filelimit, not opening dir]
    │       ├── glerc
    │       └── init.tex
    └── share
        └── licenses
            └── gle-graphics
                └── LICENSE

I can run GLE from the CLI and QGLE but both have this error.

Additionally, I just wanted to note that I had to use -DCMAKE_BUILD_TYPE=Release otherwise the only the qgle binary is installed. This is not stated in the README but perhaps is non-obvious to people like me who haven't used cmake?

Thank you for maintaining this project. I've never used it and would like to try it out! :)

marekhilton avatar Mar 10 '23 15:03 marekhilton

Hi Marek,

Thanks for the information and welcome to GLE. The missing file should get made during the install phase of the build.

I have gotten reports that some Linux users experience similar issues as you. Can you search for the inittex.ini file? Maybe it got put in the wrong place. It belongs next to the init.tex file.

Best

Vince


From: Marek Hilton @.***> Sent: Friday, March 10, 2023 7:46 AM To: vlabella/GLE Cc: Subscribed Subject: [vlabella/GLE] Missing inittex.ini and update to build documentation (Issue #10)

Hello,

I've been trying to make an Arch Linux package from your repository and have been successful in building the code, however, when I try and run a GLE script I get an error opening inittex.ini. Here is the output for one of the example scripts sine-approx.gle. No .eps was created.

$ gle sine-approx.gle GLE 4.3.4[sine-approx.gle]-C-R-

sine-approx.gle (28) |end graph| Could not open inittex.ini file [sine-approx][.eps]

This file does not seem to have been built anywhere. To build I am using the following:

    cmake -S src -B build\
          -DCMAKE_INSTALL_PREFIX=/usr/lib/\
          -DCMAKE_BUILD_TYPE=Release\
          -DGLE_EXAMPLES_LIBRARY_PATH=path_to_local_lib_repo\
          -DGLE_USER_MANUAL_PATH=path_to_local_man_repo

    cd build
    make
    make install

The structure of the files when installed is as follows. I created the symlinks after make install.

/ └── usr ├── bin │ ├── fbuild -> /usr/lib/gle-graphics/bin/fbuild │ ├── gle -> /usr/lib/gle-graphics/bin/gle │ ├── glebtool -> /usr/lib/gle-graphics/bin/glebtool │ ├── makefmt -> /usr/lib/gle-graphics/bin/makefmt │ └── qgle -> /usr/lib/gle-graphics/bin/qgle ├── lib │ └── gle-graphics │ ├── bin │ │ ├── fbuild │ │ ├── gle │ │ ├── glebtool │ │ ├── makefmt │ │ └── qgle │ ├── doc │ │ ├── ChangeLog.txt │ │ ├── LICENSE.txt │ │ └── README.txt │ ├── font [114 entries exceeds filelimit, not opening dir] │ ├── gleinc [19 entries exceeds filelimit, not opening dir] │ ├── glerc │ └── init.tex └── share └── licenses └── gle-graphics └── LICENSE

I can run GLE from the CLI and QGLE but both have this error.

Additionally, I just wanted to note that I had to use -DCMAKE_BUILD_TYPE=Release otherwise the only the qgle binary is installed. This is not stated in the README but perhaps is non-obvious to people like me who haven't used cmake?

Thank you for maintaining this project. I've never used it and would like to try it out! :)

— Reply to this email directly, view it on GitHubhttps://github.com/vlabella/GLE/issues/10, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AI4MNRB6DOJQEU6ZNA2PNOTW3NEFFANCNFSM6AAAAAAVWTU35Y. You are receiving this because you are subscribed to this thread.Message ID: @.***>

vlabella avatar Mar 10 '23 19:03 vlabella

Hi Vince,

I'm certain that that file does not exist in either the source or build directories, nor are there any other .ini files.

Best, Marek

marekhilton avatar Mar 10 '23 21:03 marekhilton

Try running

gle --inittex

And see what happens. it should make the file.

I think you may need to run it from the location of the installed binary or the folder above.

Otherwise you can take it from.one of the binary releases.


From: Marek Hilton @.***> Sent: Friday, March 10, 2023 1:08 PM To: vlabella/GLE Cc: Vincent LaBella; Comment Subject: Re: [vlabella/GLE] Missing inittex.ini and update to build documentation (Issue #10)

Hi Vince,

I'm certain that that file does not exist in either the source or build directories, nor are there any other .ini files.

Best, Marek

— Reply to this email directly, view it on GitHubhttps://github.com/vlabella/GLE/issues/10#issuecomment-1464474107, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AI4MNRAQB7XZQQESJCUSOUTW3OJ47ANCNFSM6AAAAAAVWTU35Y. You are receiving this because you commented.Message ID: @.***>

vlabella avatar Mar 10 '23 21:03 vlabella

gle -mkinittex results in a crash.

LE 4.3.4[init.tex]-C-R-
If GLE says 'Saving definitions', then compilation was successful.


>> init.tex (692) |end text|
Saving definitions
Could not create inittex.ini file 
Segmentation fault (core dumped)

Perhaps this is the reason for it not building properly? Maybe the build just fails silently.

However I have got it working by downloading one of the binary releases.

marekhilton avatar Mar 12 '23 17:03 marekhilton

Thanks for the info and glad you got it working. Is aarch Linux a different architecture? I don't know much about it. If so that could be the reason.


From: Marek Hilton @.***> Sent: Sunday, March 12, 2023 1:34 PM To: vlabella/GLE Cc: Vincent LaBella; Comment Subject: Re: [vlabella/GLE] Missing inittex.ini and update to build documentation (Issue #10)

gle -mkinittex results in a crash.

LE 4.3.4[init.tex]-C-R- If GLE says 'Saving definitions', then compilation was successful.

init.tex (692) |end text| Saving definitions Could not create inittex.ini file Segmentation fault (core dumped)

Perhaps this is the reason for it not building properly? Maybe the build just fails silently.

However I have got it working by downloading one of the binary releases.

— Reply to this email directly, view it on GitHubhttps://github.com/vlabella/GLE/issues/10#issuecomment-1465255287, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AI4MNRFE2BTZ3XOCTV4KBQDW3YCLJANCNFSM6AAAAAAVWTU35Y. You are receiving this because you commented.Message ID: @.***>

vlabella avatar Mar 13 '23 01:03 vlabella

I think I know what's not working. It's to do with the folder hierarchy and install process.

I am using cmake -DCMAKE_INSTALL_PREFIX=/usr/lib/${_pkgname} ... to install into a folder that suits the standard folder hierarchy better.

I am then using make DESTDIR="$pkgdir" install to install to a package folder. This is part of the typical packaging process for Arch user packages. This is the main issue.

The issue arises because the command to generate inittex.ini takes into account the first prefix but not the second.

The result is something like execute_process(COMMAND /usr/lib/gle-graphics/bin/gle -mkinittex) but it should be execute_process(COMMAND $pkgdir/usr/lib/gle-graphics/bin/gle -mkinittex)

I had honestly forgot I was doing these steps. For Arch user packages these steps are important because packages are built from source on the users machine.

In any case I can work around the issue by calling GLE_TOP=./gle .gle/gle -mkinittex in the build directory to generate the file before make install.

If you wanted to fix this small inconsistency (from an Arch perspective) you could alter the make files to do likewise but that's up to you whether it is worth the risk of breaking other builds.

As to why the installed version crashes when generating inittex.ini, I do not know. Maybe to do with how I'm symlinking things?

Once I have ironed out some small details I will probably post my package to the Arch User Repo if that's OK with you?

marekhilton avatar Mar 13 '23 15:03 marekhilton

I want to get GLE building out of the box for as many platforms as possible. Your information below will help fix the inittex.ini issue, which others have complained about. Actual a packager for Debian had similar problems.

Yes please post for other users.

If you find changes that work for Arch please submit a pull request.

Best,

Vince

From: Marek Hilton @.> Sent: Monday, March 13, 2023 11:29 AM To: vlabella/GLE @.> Cc: Vincent LaBella @.>; Comment @.> Subject: Re: [vlabella/GLE] Missing inittex.ini and update to build documentation (Issue #10)

I think I know what's not working. It's to do with the folder hierarchy and install process.

I am using cmake -DCMAKE_INSTALL_PREFIX=/usr/lib/${_pkgname} ... to install into a folder that suits the standard folder hierarchy better.

I am then using make DESTDIR="$pkgdir" install to install to a package folder. This is part of the typical packaging process for Arch user packages. This is the main issue.

The issue arises because the command to generate inittex.ini takes into account the first prefix but not the second.

The result is something like execute_process(COMMAND /usr/lib/gle-graphics/bin/gle -mkinittex) but it should be execute_process(COMMAND $pkgdir/usr/lib/gle-graphics/bin/gle -mkinittex)

I had honestly forgot I was doing these steps. For Arch user packages these steps are important because packages are built from source on the users machine.

In any case I can work around the issue by calling GLE_TOP=./gle .gle/gle -mkinittex in the build directory to generate the file before make install.

If you wanted to fix this small inconsistency (from an Arch perspective) you could alter the make files to do likewise but that's up to you whether it is worth the risk of breaking other builds.

As to why the installed version crashes when generating inittex.ini, I do not know. Maybe to do with how I'm symlinking things?

Once I have ironed out some small details I will probably post my package to the Arch User Repo if that's OK with you?

— Reply to this email directly, view it on GitHubhttps://github.com/vlabella/GLE/issues/10#issuecomment-1466367752, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AI4MNRD3XWD4YR46YBYOTV3W344MNANCNFSM6AAAAAAVWTU35Y. You are receiving this because you commented.Message ID: @.@.>>

vlabella avatar Mar 14 '23 13:03 vlabella

gle -mkinittex results in a crash.

For me as well, on macOS 12 x86_64:

% gle -mkinittex 
GLE 4.3.4[init.tex]-C-R-
If GLE says 'Saving definitions', then compilation was successful.


>> init.tex (692) |end text|
Saving definitions
Could not create inittex.ini file 
zsh: segmentation fault  gle -mkinittex

The crash log generated by macOS has this stack trace:

Thread 0 Crashed::  Dispatch queue: com.apple.main-thread
0   libsystem_c.dylib             	    0x7ff81b318acb flockfile + 18
1   libsystem_c.dylib             	    0x7ff81b32dcb6 fwrite + 66
2   gle                           	       0x10d196d38 do_prim(unsigned char**, int*, int*, TexArgStrs*) + 6840
3   gle                           	       0x10d19483f text_topcode(unsigned char*, int*, int*) + 175
4   gle                           	       0x10d19bbce fftext_block(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, double, int) + 286
5   gle                           	       0x10d19b7ba text_block(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, double, int, int) + 122
6   gle                           	       0x10d0dd749 begin_text(int*, int*, int*, double, int) + 249
7   gle                           	       0x10d18a4b9 GLERun::do_pcode(GLESourceLine&, int*, int*, int, int*, bool&) + 46025
8   gle                           	       0x10d0f69ef DrawIt(GLEScript*, GLEFileLocation*, CmdLineObj*, bool) + 4127
9   gle                           	       0x10d0a0372 main + 7154
10  dyld                          	       0x1140e752e start + 462

ryandesign avatar Jul 26 '24 23:07 ryandesign

The problem is that it wants to write inittex.ini in the place where gle has been installed, which is a directory that only root can write to, and I wasn't running gle -mkinittex as root. It correctly detected that it could not open the file there for writing ("Could not create inittex.ini file") but then tried to fwrite the file anyway which of course doesn't work. When I used sudo gle -mkinittex it wrote the file.

ryandesign avatar Jul 27 '24 00:07 ryandesign

I am closing this as it is fixed with pull request.

vlabella avatar Nov 12 '24 23:11 vlabella