Various build errors on FreeBSD

Bug #1866057 reported by Alexei
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
gEDA
Fix Released
Undecided
Unassigned

Bug Description

Sorry I'm not familiar with autotools or makefiles so can't submit any patches, only displayed errors and how I solve them. Maybe this info will help improve gEDA and in future it will builds on FreeBSD more easily. I guess that's why gEDA port on FreeBSD is terribly outdated...

Build system: FreeBSD 12-1 RELEASE amd64, No GCC, guile2-2.2.6_1 installed
gEDA/gaf version to be built: 1.10.0-20191008

Build commands used:
./configure --without-libfam --prefix=/usr/local
make
make install

---

1. Build process requires FAM to be installed, even if configure script started with '--without-libfam' option:

log:
gschem_change_notification.c:70:10: fatal error: 'fam.h' file not found

---

2. Configure in XORN failed, it can't detect guile (upper-level configure script detects guile without problems):

log:
checking for GUILE... no
configure: error: Package requirements (guile-2.0 >= 2.0.10) were not met:
Package 'guile-2.0', required by 'virtual:world', not found

I solve this by manual replacement of all "guile-2.0 >= 2.0.10" entries in configure script with "guile-2.2 >= 2.2.6"

---

3. Make don't know how to make gschem/src/actions.decl.h

This error solved by renaming actions.decl.h to actions.decl.c, then changing of Makefile rule:

actions.decl.x: actions.decl.h actions.c Makefile -> actions.decl.x: actions.decl.c actions.c Makefile

(note same rule exist for 'actions.init.c' file, but this file have '.c' extension originally).
---

4. Gsymcheck linking failed. 17 undefined reference errors when linking of gsymcheck like this one:

ld: error: ../../libgeda/src/.libs/libgeda.so: undefined reference to g_file_get_parse_name

I do not know nothing about this. Linker command line is too long to be posted here, but it seems to be correct.
This error gone only after installing GCC, adding CC=GCC to /etc/make.conf, and rebuilding gEDA

---

At last, build stage finishes without errors. But...

5. make install errors (path not found):

log:
( cd '/usr/local/share/gEDA/sym/gnetman' && rm -f pmos4.sym capacitor-1.sym vss.sym inductor-1.sym idc-1.sym ... etc ...
cd: /usr/local/share/gEDA/sym/gnetman: No such file or directory

Total three pathes not exist and should be created manually prior issuing 'make install' command:

mkdir /usr/local/share/gEDA/sym/gnetman
mkdir /usr/local/share/gEDA/sym/verilog
mkdir /usr/local/share/gEDA/sym/vhdl
make install

Revision history for this message
Roland Lutz (rlutz) wrote :

Thank you for reporting these problems!

> 1. Build process requires FAM to be installed, even if configure script started with '--without-libfam' option
> 2. Configure in XORN failed, it can't detect guile (upper-level configure script detects guile without problems)

These are fixed in current master (commits 77e7077 and 45abe02, respectively). I guess I should bring out a bugfix release soon...

> 3. Make don't know how to make gschem/src/actions.decl.h
> This error solved by renaming actions.decl.h to actions.decl.c, then changing of Makefile rule

That's weird. Could you please post the original, unmodified Makefile?

> 4. Gsymcheck linking failed. 17 undefined reference errors when linking of gsymcheck

Which C compiler did you use?

'g_file_get_parse_name' is used in libgeda, which means all gEDA/gaf binaries must be linked against libgio-2.0. Apparently, gcc and clang figure this out automatically while the C compiler you used doesn't.

Could you please try if the following fix works?

--- a/gsymcheck/src/Makefile.am
+++ b/gsymcheck/src/Makefile.am
@@ -19,3 +19,3
-gsymcheck_CFLAGS = $(GCC_CFLAGS) $(MINGW_CFLAGS) $(GLIB_CFLAGS) \
+gsymcheck_CFLAGS = $(GCC_CFLAGS) $(MINGW_CFLAGS) $(GLIB_CFLAGS) $(GIO_CFLAGS) \
        $(GUILE_CFLAGS) $(GDK_PIXBUF_CFLAGS)
-gsymcheck_LDFLAGS = $(GLIB_LIBS) $(GUILE_LIBS) $(GDK_PIXBUF_LIBS)
+gsymcheck_LDFLAGS = $(GLIB_LIBS) $(GIO_LIBS) $(GUILE_LIBS) $(GDK_PIXBUF_LIBS)

> 5. make install errors (path not found)
> mkdir /usr/local/share/gEDA/sym/gnetman
> mkdir /usr/local/share/gEDA/sym/verilog
> mkdir /usr/local/share/gEDA/sym/vhdl

These are the old installation directories for the gnetman, Verilog, and VHDL symbols (see commit 800b5e6). If they exist, "make install" tries to remove the old symbols in order to make sure there aren't any duplicates left from an older installation.

It appears that shell exit codes work slightly different on FreeBSD. Could you please try if the following fix makes "make install" work if the three directories don't exist?

--- a/symbols/Makefile.am
+++ b/symbols/Makefile.am
@@ -102,1 +102,1 @@ install-data-local:
- (cd "$(DESTDIR)$(datasymdir)/$$lib" && rm -f $$list); \
+ (cd "$(DESTDIR)$(datasymdir)/$$lib" && rm -f $$list || true); \

Revision history for this message
Alexei (386th) wrote :

My compiler is Clang version 8.0.1, it comes with FreeBSD out of the box as far as I know.

>> 3. Make don't know how to make gschem/src/actions.decl.h
>> This error solved by renaming actions.decl.h to actions.decl.c, then changing of Makefile rule

>That's weird. Could you please post the original, unmodified Makefile?

Original gschem/src/Makefile part related to actions.decl.h:

actions.decl.x: actions.decl.h actions.c Makefile
  $(AM_V_GEN)$(CPP) -I$(srcdir) -c $< | \
  sed -e '/^.*KEEP_LINE /!d' -e 's/^.*KEEP_LINE //' > $@.tmp && \
  >mv $@.tmp $@

Compiler message log:

cc -E -I. -c | sed -e '/^.*KEEP_LINE /!d' -e 's/^.*KEEP_LINE //' > actions.decl.x.tmp && mv actions.decl.x.tmp actions.decl.x
cc: error: no input files

As I wrote before, I simply rename actions.decl.h file in gschem/src to actions.decl.c, and also in first line of Makefile rule 'actions.decl.h' replaced with 'actions.decl.c'. Not only Clang shows this error, GCC too!

Revision history for this message
Alexei (386th) wrote :

>> 4. Gsymcheck linking failed. 17 undefined reference errors when linking of gsymcheck

> Which C compiler did you use?
> Could you please try if the following fix works?

Clang 8.0.1 is used!

It seems Your fix works, but I cannot test it, since I simply don't know how to regenerate Makefiles after modifying .am files (automake wants configure.ac, running it from root dir does nothing in subdirs)... :( BUT! Problem was solved by manually adding $(GIO_LIBS) and $(GIO_CFLAGS) to corresponding Makefiles, so I consider this patch will work. After I fix gsymcheck, same problem appeared with the gnetlist-legacy, then with utils/gschlas... It seems ALL .am files in all 'src' subdirs must be modified.

--- a/gsymcheck/src/Makefile.am
+++ b/gsymcheck/src/Makefile.am
@@ -19,3 +19,3
-gsymcheck_CFLAGS = $(GCC_CFLAGS) $(MINGW_CFLAGS) $(GLIB_CFLAGS) \
+gsymcheck_CFLAGS = $(GCC_CFLAGS) $(MINGW_CFLAGS) $(GLIB_CFLAGS) $(GIO_CFLAGS) \
        $(GUILE_CFLAGS) $(GDK_PIXBUF_CFLAGS)
-gsymcheck_LDFLAGS = $(GLIB_LIBS) $(GUILE_LIBS) $(GDK_PIXBUF_LIBS)
+gsymcheck_LDFLAGS = $(GLIB_LIBS) $(GIO_LIBS) $(GUILE_LIBS) $(GDK_PIXBUF_LIBS)

Revision history for this message
Alexei (386th) wrote :

>> 5. make install errors (path not found)
>> mkdir /usr/local/share/gEDA/sym/gnetman
>> mkdir /usr/local/share/gEDA/sym/verilog
>> mkdir /usr/local/share/gEDA/sym/vhdl

> It appears that shell exit codes work slightly different on FreeBSD. Could you please try if the following fix makes "make install" work if the three directories don't exist?

--- a/symbols/Makefile.am
+++ b/symbols/Makefile.am
@@ -102,1 +102,1 @@ install-data-local:
- (cd "$(DESTDIR)$(datasymdir)/$$lib" && rm -f $$list); \
+ (cd "$(DESTDIR)$(datasymdir)/$$lib" && rm -f $$list || true); \

Yes, installation works with this path. Errors are gone.

Revision history for this message
dmn (graahnul.grom) wrote :

Alexei, you may take a look at cad/lepton-eda in the FreeBSD
Ports Collection, where all the problems with clang, guile 2.2,
bsd make, etc. are solved. I use it everyday on my system:
FreeBSD 11.3-STABLE amd64.

Regards,
Dmitry.

Revision history for this message
Roland Lutz (rlutz) wrote :

I fixed errors 4 and 5 in the ‘stable-1.10’ branch, which leaves error 3.

> Compiler message log:
>
> cc -E -I. -c | sed -e '/^.*KEEP_LINE /!d' -e 's/^.*KEEP_LINE //' > actions.decl.x.tmp && mv actions.decl.x.tmp actions.decl.x
> cc: error: no input files

If I interpret this correctly, this is a problem with ‘make’. Please create the following test Makefile in an empty directory:

test.c.out: test.c
 cc -E -o test.c.out $<
test.h.out: test.h
 cc -E -o test.h.out $<

(This is one tab character for indentation, not spaces.)

Then run the following three commands:

$ touch test.c test.h
$ make test.c.out
cc -E -o test.c.out test.c
$ make test.h.out
cc -E -o test.h.out test.h

Does this work as expected and produce the output shown above?

Revision history for this message
Roland Lutz (rlutz) wrote :

@Dmitry Most of the problems Alexei reported regard features which aren't present in lepton-eda (file change notifications, Python API, and the unified action mechanism); only problem 4 for gschlas has been solved.

It would be more helpful if you could point to the specific commits where relevant issues have been addressed (in this case, commit d994191).

Changed in geda:
status: New → In Progress
milestone: none → 1.10.1
Revision history for this message
Alexei (386th) wrote :

> Alexei, you may take a look at cad/lepton-eda in the FreeBSD
Ports Collection, where all the problems with clang, guile 2.2,
bsd make, etc. are solved.

I am very glad to know that there is another similar project. Judging by the description, many long-awaited changes are implemented there, such as regular syntax configuration files and many more. I wantet to try using it, but lepton-schematic crashes when File->Print menu is selected, so I just cannot test its full functionality. I've been using gEDA for some years and know well what to expect from it, while lepton-eda is something new for me. I will definitely test it later. Thanks again.

Revision history for this message
Alexei (386th) wrote :

Makefile:

test.c.out: test.c
<-->cc -E -o test.c.out $<
test.h.out: test.h
<-->cc -E -o test.h.out $<

% make test.c.out
cc -E -o test.c.out
cc: error: no input files

%make test.h.out
cc -E -o test.h.out
cc: error: no input files

Revision history for this message
Alexei (386th) wrote :

UPDATE: It seems it's really problem with make, it all works using gmake! GNU make and BSD make both use different syntax I think...

Revision history for this message
dmn (graahnul.grom) wrote :

BSD make doesn't support "implied source" variable $<
in explicit rules. It is defined only in implicit
(i.e. suffix-transformation) rules.

Revision history for this message
dmn (graahnul.grom) wrote :

The "target" variable ($@) could be used instead, see, for
example, this lepton-eda commit:

https://github.com/lepton-eda/lepton-eda/commit/1b71e63169df8a3932e359be978d7c5b42779fd6

Revision history for this message
dmn (graahnul.grom) wrote :

Roland, in my message I wasn't talking about particular
program features, but about portability problems.

Revision history for this message
dmn (graahnul.grom) wrote :

Alexei, the problem with File->Print was solved quite
some time ago [1], though I never managed to reproduce
it myself on either FreeBSD or Linux, lucky you. :-)
I would recommend to install the latest version from
git, rather than from ports:

$ git clone https://github.com/lepton-eda/lepton-eda.git

The list of changes can be found in the NEWS.md file [2].
My humble web page [3] where I collect links to various
lepton/geda resources may be of help, too (I hope).

[1] https://github.com/lepton-eda/lepton-eda/commit/ad4ada5edfc25ff204bfbe3adad5d0b2895393b3

[2] https://github.com/lepton-eda/lepton-eda/blob/master/NEWS.md

[3] https://graahnul-grom.github.io

Revision history for this message
Roland Lutz (rlutz) wrote :

fixed in gEDA/gaf 1.10.1

Changed in geda:
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.