DaemonForums  

Go Back   DaemonForums > OpenBSD > OpenBSD Packages and Ports

OpenBSD Packages and Ports Installation and upgrading of packages and ports on OpenBSD.

Reply
 
Thread Tools Display Modes
  #1   (View Single Post)  
Old 24th December 2021
juhal juhal is offline
Real Name: Justin DeWitt Hall
New User
 
Join Date: Dec 2021
Location: Portland Oregon
Posts: 8
Default gnofract4d will not launch

Hello everyone. This is my second post ever. I am having a bit of trouble with the package gnofract4d. This is not a big deal, I can live without this application. However as I am new to openBSD I thought troubleshooting this could be a good learning experience. As package managers go I am familiar with dnf, apt, and Slackware's installpkg. I have installed gnofract4d using the pkg_add utility. However when I launch the program from a terminal I get the following output shown below


Puffy-Chicken$ gnofract4d
A fatal error occurred:
Error reported by C compiler:sh: gcc: not found


Traceback (most recent call last):
File "/usr/local/bin/gnofract4d", line 152, in <module>
main(sys.argv[1:])
File "/usr/local/bin/gnofract4d", line 81, in main
gtkmain(opts)
File "/usr/local/bin/gnofract4d", line 128, in gtkmain
mainWindow = main_window.MainWindow()
File "/usr/local/lib/python2.7/site-packages/fract4dgui/main_window.py", line 69, in __init__
self.f = gtkfractal.T(self.compiler,self)
File "/usr/local/lib/python2.7/site-packages/fract4dgui/gtkfractal.py", line 447, in __init__
Hidden.__init__(self,comp,width,height)
File "/usr/local/lib/python2.7/site-packages/fract4dgui/gtkfractal.py", line 73, in __init__
self.try_init_fractal()
File "/usr/local/lib/python2.7/site-packages/fract4dgui/gtkfractal.py", line 88, in try_init_fractal
self.f.compile()
File "/usr/local/lib/python2.7/site-packages/fract4d/fractal.py", line 624, in compile
self.compiler_options)
File "/usr/local/lib/python2.7/site-packages/fract4d/fc.py", line 278, in compile_all
outputfile = os.path.abspath(self.generate_code(t, cg))
File "/usr/local/lib/python2.7/site-packages/fract4d/fc.py", line 430, in generate_code
"Error reported by C compiler:%s" % output)
fract4d.fracttypes.TranslationError: Error reported by C compiler:sh: gcc: not found


I have installed gcc choosing option 1 which installs version 8.4. I also tried version 11.2. Neither however has any impact, I still get the exact same error. Have to say I am bit confused. I thought these were binaries and gcc is a compiler right? Why would it be a dependency? Anyway any help or pointers in the right direction would be greatly appreciated.
Reply With Quote
  #2   (View Single Post)  
Old 25th December 2021
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 7,983
Default

From what I can tell, this application does compile source code: the output of -h shows how to pass flags to the C compiler.


This port/package is out-of-date. It's version 3.14.1, and was last updated in 2015 when OpenBSD still had the gcc compiler in base on all architectures, and that's what it's looking for. (The most current release of the app is 4.3.)

When you install gcc from packages, the binary is called "egcc" to avoid conflicts with the base gcc. However, gcc was replaced by clang on most architectures, and is not in base any longer on these.
Reply With Quote
  #3   (View Single Post)  
Old 26th December 2021
juhal juhal is offline
Real Name: Justin DeWitt Hall
New User
 
Join Date: Dec 2021
Location: Portland Oregon
Posts: 8
Default

Erg... Ok so basically I am out of luck. Even if I went old school on this and downloaded the source and tried make && make install it would still fail as it is looking for gcc, not clang.
Reply With Quote
  #4   (View Single Post)  
Old 26th December 2021
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 7,983
Default

This circumvention works for me:
  1. Install the gcc package (I chose gcc-8.4.0).
  2. Create a symbolic link to the gcc executable in your $PATH. I used $ ln -s /usr/local/bin/egcc $HOME/bin/gcc, which works with my $PATH.
Reply With Quote
  #5   (View Single Post)  
Old 26th December 2021
juhal juhal is offline
Real Name: Justin DeWitt Hall
New User
 
Join Date: Dec 2021
Location: Portland Oregon
Posts: 8
Default

Thanks. Yes I too installed the gcc-8.4.0 version. I created the link but that does not appear to alter the result for me. Am I missing something? Bit confused, would not /usr/local/bin already be in the path?
Reply With Quote
  #6   (View Single Post)  
Old 27th December 2021
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 7,983
Default

Either you did not copy or link the "egcc" file as "gcc" into a directory in your $PATH, or, you are using a shell which needs to update its executable hash table, such as bash or tcsh.

Check the directories listed in $PATH with $ echo $PATH, confirm the file exists in the intended directory with ls(1), and if needed, issue $ hash gcc or $ rehash, or restart your shell.
Reply With Quote
  #7   (View Single Post)  
Old 27th December 2021
juhal juhal is offline
Real Name: Justin DeWitt Hall
New User
 
Join Date: Dec 2021
Location: Portland Oregon
Posts: 8
Default

jggimi you are awesome! Yes I got it. Lessons learned. I got gnofract4d to launch.
Reply With Quote
  #8   (View Single Post)  
Old 27th December 2021
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 7,983
Default

I don't know anything about this application ... but I may try to update the port to the most recent release. If I'm successful, I'll post here.
Reply With Quote
  #9   (View Single Post)  
Old 27th December 2021
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 7,983
Default

And, while I've got the new release ported, it still has "gcc" hard-coded as the name of the compiler to use. In multiple places. I'll work up patches to use the built-in compiler per architecture.
Reply With Quote
Old 28th December 2021
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 7,983
Default

Hmmm. On clang architectures (such as amd64), a working "gcc" is needed in order to get the application running. Once running, you can change the compiler in Edit...Preferences to egcc or to cc or clang. Then the "gcc" executable is no longer needed. But on gcc architectures (such as sparc64), there's a working "gcc" and no circumvention is needed.

I can differentiate between these architectures with the Ports infrastructure's $GCC4_ARCHS and $CLANG_ARCHS ... the struggle will be applying a patch only when the package build is on a clang architecture.
Reply With Quote
Old 28th December 2021
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 7,983
Default

I've got it! The patches will only be applied on clang archs.

For anyone who is interested in how ... I used the bsd.port.arch.mk $PROPERTIES test, which is described in the bsd.port.mk(5) man page, and set a "clang-only" patch directory that will be ignored on other (gcc) architectures:
Code:
.include <bsd.port.arch.mk>
.if ${PROPERTIES:Mclang}
PATCHDIR =              patches-clang
.endif
I've got some cleanup to do of the updated port before I submit it to the ports@ mailing list for review.
Reply With Quote
Old 29th December 2021
juhal juhal is offline
Real Name: Justin DeWitt Hall
New User
 
Join Date: Dec 2021
Location: Portland Oregon
Posts: 8
Default

jggimi, I really appreciate the effort you have put into this. The program is just a simple fun fractal generator. I have used it for about 14 odd years to make random wallpaper for whatever window manager I am using, usually openbox. What you are doing I contemplated. I thought, just edit the code to point to the desired compiler. However the most I have ever done is editing slackbuild scripts to use newer source code or to use extra dependencies or options. What you are doing I am sorry to say is a bit over my head. Thanks again, much appreciated.
Reply With Quote
Old 29th December 2021
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 7,983
Default

It was just an interesting exercise for me, having never heard of the application before.

The third party packages you install on OpenBSD are built through OpenBSD's Ports Tree. Each "leaf" of the tree contains a set of instructions to build packages -- install dependencies, download source code, build, and package the application.

I've prepared an updated "leaf" for the Ports Tree -- the port that builds the gnofract4d package. My port -- or leaf -- contains the instructions to download and build a package from the most recent release of the application. The unique change for this update is to leave "gcc" hardcoded as the default compiler on architectures that have a "gcc" compiler, and switch this to "cc" as the hardcoded default compiler that have a "cc" clang compiler.

The update may not be acceptable to the OpenBSD Project as-is. This patch-by-architecture mechanism is not used on any other port in the tree. If not accepted, it may be sent back to me with advice for rework.

Here's my post to the ports@ mailing list, containing a patch in unified diff(1) format to the graphics/gnofract4d port -- or "leaf" of the Ports Tree, removing and replacing lines in the instructions for building and packaging the port. There are revisions to the Makefile (instructions), distinfo (checksums for the source code), pkg/PLIST (packing list for the package), and 4 new patch files to switch "gcc" to "cc" when the package is being built on one of the clang architectures. https://marc.info/?l=openbsd-ports&m...4142328973&w=2
Reply With Quote
Old 30th December 2021
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 7,983
Default

The port is in active review, with several changes recommended. If it gets committed, packages of it will be available with 7.1-release. I might be able to "backport" it to build packages for 7.0-release. Success will depend on the changes since 7.0 that were made to how the Ports Tree manages python applications like this one. (The gory details are in the python-module(5) man page.)
Reply With Quote
Old 31st December 2021
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 7,983
Default

It's been committed. The major change was to make the hardcoded "gcc" convert to "cc" on all architectures unconditionally; all of them have a /usr/bin/cc executable.

Packages will be available shortly for -current users as the cycle of snapshot packages are built for most architectures. And of course, it will be available for 7.1-release.

I've tested the port on a 7.0-release/amd64 system. No changes were needed to build the package, install, and run.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
occasional application crashes, usually at launch brudan OpenBSD General 7 5th April 2019 02:16 PM
Changes to dates of launch of new releases? betweendayandnight OpenBSD General 1 12th August 2016 10:28 PM
Tomorrow is World IPv6 Launch Day J65nko News 1 5th June 2012 04:21 PM
World IPv6 Launch on 6 June J65nko News 0 19th January 2012 11:57 PM
How launch script or command from icewm? aleunix General software and network 8 8th June 2008 09:12 PM


All times are GMT. The time now is 09:09 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick