brummer10/Mamba

libxputty/xputty/header/xwidget-platform.h:84:1: error: unknown type name 'Display'

Opened this issue · 21 comments

Build fails:

c++: warning: optimization flag '-fstrength-reduce' is not supported [-Wignored-optimization-argument]
c++: warning: optimization flag '-fschedule-insns' is not supported [-Wignored-optimization-argument]
In file included from MidiKeyBoard.cpp:22:
In file included from ./MidiKeyBoard.h:55:
In file included from /usr/ports/audio/mamba/work/Mamba-2.6/libxputty/xputty/header/xwidgets.h:40:
In file included from /usr/ports/audio/mamba/work/Mamba-2.6/libxputty/xputty/header/widgets/xbutton.h:26:
In file included from /usr/ports/audio/mamba/work/Mamba-2.6/libxputty/xputty/header/xputty.h:200:
In file included from /usr/ports/audio/mamba/work/Mamba-2.6/libxputty/xputty/header/xwidget.h:34:
/usr/ports/audio/mamba/work/Mamba-2.6/libxputty/xputty/header/xwidget-platform.h:84:1: error: unknown type name 'Display'
   84 | Display *os_open_display(char *display_name);
      | ^
/usr/ports/audio/mamba/work/Mamba-2.6/libxputty/xputty/header/xwidget-platform.h:91:23: error: unknown type name 'Display'
   91 | void os_close_display(Display *dpy);
      |                       ^
/usr/ports/audio/mamba/work/Mamba-2.6/libxputty/xputty/header/xwidget-platform.h:101:1: error: unknown type name 'Window'
  101 | Window os_get_root_window(Xputty *main, int flag);
      | ^
/usr/ports/audio/mamba/work/Mamba-2.6/libxputty/xputty/header/xwidget-platform.h:119:39: error: unknown type name 'Window'
  119 | void os_translate_coords(Widget_t *w, Window from_window, Window to_window,
      |                                       ^
/usr/ports/audio/mamba/work/Mamba-2.6/libxputty/xputty/header/xwidget-platform.h:119:59: error: unknown type name 'Window'
  119 | void os_translate_coords(Widget_t *w, Window from_window, Window to_window,
      |                                                           ^
/usr/ports/audio/mamba/work/Mamba-2.6/libxputty/xputty/header/xwidget-platform.h:147:21: error: unknown type name 'Display'
  147 | void os_move_window(Display *dpy, Widget_t *w, int x, int y);
      |                     ^
/usr/ports/audio/mamba/work/Mamba-2.6/libxputty/xputty/header/xwidget-platform.h:156:23: error: unknown type name 'Display'

Version: 2.6
FreeBSD 14.0

Hi @yurivict

Hopefully that is fixed now with the latest commit. Let me know please if it works now for BSD/clang.

The build of the last tag 3a814f5 fails:

===>  Building for mamba-2.6
for         
with        cc
using       gold
and         xxd -i
gmake[1]: warning: -j1 forced in submake: resetting jobserver mode.
cat: /proc/cpuinfo: No such file or directory
cat: /proc/cpuinfo: No such file or directory
cat: /proc/cpuinfo: No such file or directory
cat: /proc/cpuinfo: No such file or directory
 Building object file build/MidiKeyBoard.o 
c++: warning: optimization flag '-fstrength-reduce' is not supported [-Wignored-optimization-argument]
c++: warning: optimization flag '-fschedule-insns' is not supported [-Wignored-optimization-argument]
In file included from MidiKeyBoard.cpp:22:
./MidiKeyBoard.h:55:10: fatal error: 'xwidgets.h' file not found
   55 | #include "xwidgets.h"
      |          ^~~~~~~~~~~~
1 error generated.
gmake[1]: *** [Makefile:156: build/MidiKeyBoard.o] Error 1

After adding a few include paths, it fails to find the header:

In file included from MidiKeyBoard.cpp:22:
In file included from ./MidiKeyBoard.h:55:
In file included from /usr/ports/audio/mamba/work/Mamba-3a814f5/libxputty/xputty/header/xwidgets.h:40:
In file included from /usr/ports/audio/mamba/work/Mamba-3a814f5/libxputty/xputty/header/widgets/xbutton.h:26:
In file included from /usr/ports/audio/mamba/work/Mamba-3a814f5/libxputty/xputty/header/xputty.h:210:
/usr/ports/audio/mamba/work/Mamba-3a814f5/libxputty/xputty/header/xpngloader.h:109:10: fatal error: 'xresources.h' file not found
  109 | #include "xresources.h"
      |          ^~~~~~~~~~~~~~
1 error generated.

xresources.h isn't in the source tree.

These include paths were missing:

CXXFLAGS+=      -I${WRKSRC}/libxputty/xputty/header \
                -I${WRKSRC}/libxputty/xputty/header/widgets

for
with cc
using gold
and xxd -i

That's the issue, it should read
for FreeBSD
to set the needed flags and include path. I've pushed a Fix for it now, please check if the last commit works now for you.

The revision 4b6bd9c fails:

===>  Building for mamba-2.5
Makefile:2: libxputty/Build/Makefile.base: No such file or directory
gmake: *** No rule to make target 'libxputty/Build/Makefile.base'.  Stop.

you must run
git submodule update --init --recursive
before make.

Hi. I am trying to update mamba to v2.6 from v2.5 and using 62a6146 commit for libxputty and it fails to build.

Here is the log of make.

===>  Building for mamba-2.6
for         �[38;5;3mFreeBSD�[m
with        �[38;5;3mcc�[m
using       �[38;5;3mgold�[m
and         �[38;5;3mxxd -i�[m
gmake[1]: warning: -j1 forced in submake: resetting jobserver mode.
cat: /proc/cpuinfo: No such file or directory
cat: /proc/cpuinfo: No such file or directory
cat: /proc/cpuinfo: No such file or directory
cat: /proc/cpuinfo: No such file or directory
�[38;5;5m Building object file build/MidiKeyBoard.o �[m
c++: warning: optimization flag '-fstrength-reduce' is not supported [-Wignored-optimization-argument]
c++: warning: optimization flag '-fschedule-insns' is not supported [-Wignored-optimization-argument]
In file included from MidiKeyBoard.cpp:22:
In file included from ./MidiKeyBoard.h:22:
In file included from /usr/include/c++/v1/stdio.h:101:
/usr/include/c++/v1/__config:519:14: fatal error: 'features.h' file not found
  519 | #    include <features.h>
      |              ^~~~~~~~~~~~
1 error generated.
gmake[1]: *** [Makefile:152: build/MidiKeyBoard.o] Error 1
gmake: *** [Makefile:33: src] Error 2
===> Compilation failed unexpectedly.
Try to set MAKE_JOBS_UNSAFE=yes and rebuild before reporting the failure to
the maintainer.
*** Error code 1

Stop.
make: stopped in /home/yusuf/Documents/ports/audio/mamba

Thanks.

Could you try git head instead the latest release? There are some fixes already related to FreeBSD. In special, we need to link against lstd++ when build with clang++
Would be great if you let me know if that works, as I'm working already on the next release.

Thanks for taking time replying. I don't know much about compilers, excuse my ignorance. I tried Latest tag with commit hash 4b6bd9c and got likely same result.

===>  License BSD0CLAUSE accepted by the user
===>   mamba-l depends on file: /usr/local/sbin/pkg - found
===> Fetching all distfiles required by mamba-l for building
===>  Extracting for mamba-l
=> SHA256 Checksum OK for brummer10-Mamba-Latest-4b6bd9c_GH0.tar.gz.
=> SHA256 Checksum OK for brummer10-libxputty-62a6146_GH0.tar.gz.
===>  Patching for mamba-l
===>   mamba-l depends on executable: xxd - found
===>   mamba-l depends on executable: update-desktop-database - found
===>   mamba-l depends on package: gmake>=4.4.1 - found
===>   mamba-l depends on package: pkgconf>=1.3.0_1 - found
===>   mamba-l depends on file: /usr/local/libdata/pkgconfig/x11.pc - found
===>   mamba-l depends on shared library: libasound.so - found (/usr/local/lib/libasound.so)
===>   mamba-l depends on shared library: libfluidsynth.so - found (/usr/local/lib/libfluidsynth.so)
===>   mamba-l depends on shared library: libjack.so - found (/usr/local/lib/libjack.so)
===>   mamba-l depends on shared library: liblo.so - found (/usr/local/lib/liblo.so)
===>   mamba-l depends on shared library: libsmf.so - found (/usr/local/lib/libsmf.so)
===>   mamba-l depends on shared library: libcairo.so - found (/usr/local/lib/libcairo.so)
===>   mamba-l depends on shared library: libglib-2.0.so - found (/usr/local/lib/libglib-2.0.so)
===>   mamba-l depends on shared library: libintl.so - found (/usr/local/lib/libintl.so)
===>   mamba-l depends on shared library: libsigc-2.0.so - found (/usr/local/lib/libsigc-2.0.so)
===>  Configuring for mamba-l
===>  Building for mamba-l
for         �[38;5;3mFreeBSD�[m
with        �[38;5;3mcc�[m
using       �[38;5;3mgold�[m
and         �[38;5;3mxxd -i�[m
gmake[1]: warning: -j1 forced in submake: resetting jobserver mode.
cat: /proc/cpuinfo: No such file or directory
cat: /proc/cpuinfo: No such file or directory
cat: /proc/cpuinfo: No such file or directory
cat: /proc/cpuinfo: No such file or directory
�[38;5;5m Building object file build/MidiKeyBoard.o �[m
c++: warning: optimization flag '-fstrength-reduce' is not supported [-Wignored-optimization-argument]
c++: warning: optimization flag '-fschedule-insns' is not supported [-Wignored-optimization-argument]
In file included from MidiKeyBoard.cpp:22:
In file included from ./MidiKeyBoard.h:22:
In file included from /usr/include/c++/v1/stdio.h:101:
/usr/include/c++/v1/__config:519:14: fatal error: 'features.h' file not found
  519 | #    include <features.h>
      |              ^~~~~~~~~~~~
1 error generated.
gmake[1]: *** [Makefile:156: build/MidiKeyBoard.o] Error 1
gmake: *** [Makefile:33: src] Error 2
===> Compilation failed unexpectedly.
Try to set MAKE_JOBS_UNSAFE=yes and rebuild before reporting the failure to
the maintainer.
*** Error code 1

Stop.
make: stopped in /home/yusuf/Documents/ports/audio/mamba

Okay, I see.
I've now a FreeBSD installation in a VirtualBox, gimme a day and I'll make it work.

Okay, very thanks. No need to hurry 🙏

Did a quick check on FreeBSD and it turns out that we just need to update libxputty to the latest version. I'll push the fix tomorrow.

Great. Have a good one.

So I've pushed a update to the repository, git head should now compile clean on FreeBSD. Let me know if any issue exist.

Now I am getting a different error, it complains about 'xwidgets.h' file not found.

===>  License BSD0CLAUSE accepted by the user
===>   mamba-2.6 depends on file: /usr/local/sbin/pkg - found
===> Fetching all distfiles required by mamba-2.6 for building
===>  Extracting for mamba-2.6
=> SHA256 Checksum OK for brummer10-Mamba-v2.6-5f0cf4b_GH0.tar.gz.
=> SHA256 Checksum OK for brummer10-libxputty-2a365c1_GH0.tar.gz.
===>  Patching for mamba-2.6
===>   mamba-2.6 depends on executable: xxd - found
===>   mamba-2.6 depends on executable: update-desktop-database - found
===>   mamba-2.6 depends on package: gmake>=4.4.1 - found
===>   mamba-2.6 depends on package: pkgconf>=1.3.0_1 - found
===>   mamba-2.6 depends on file: /usr/local/libdata/pkgconfig/x11.pc - found
===>   mamba-2.6 depends on shared library: libasound.so - found (/usr/local/lib/libasound.so)
===>   mamba-2.6 depends on shared library: libfluidsynth.so - found (/usr/local/lib/libfluidsynth.so)
===>   mamba-2.6 depends on shared library: libjack.so - found (/usr/local/lib/libjack.so)
===>   mamba-2.6 depends on shared library: liblo.so - found (/usr/local/lib/liblo.so)
===>   mamba-2.6 depends on shared library: libsmf.so - found (/usr/local/lib/libsmf.so)
===>   mamba-2.6 depends on shared library: libcairo.so - found (/usr/local/lib/libcairo.so)
===>   mamba-2.6 depends on shared library: libglib-2.0.so - found (/usr/local/lib/libglib-2.0.so)
===>   mamba-2.6 depends on shared library: libintl.so - found (/usr/local/lib/libintl.so)
===>   mamba-2.6 depends on shared library: libsigc-2.0.so - found (/usr/local/lib/libsigc-2.0.so)
===>  Configuring for mamba-2.6
===>  Building for mamba-2.6
for         �[38;5;3mFreeBSD�[m
with        �[38;5;3mcc�[m
using       �[38;5;3mgold�[m
and         �[38;5;3mxxd -i�[m
gmake[1]: warning: -j1 forced in submake: resetting jobserver mode.
�[38;5;5m Building object file build/MidiKeyBoard.o �[m
In file included from MidiKeyBoard.cpp:22:
./MidiKeyBoard.h:55:10: fatal error: 'xwidgets.h' file not found
   55 | #include "xwidgets.h"
      |          ^~~~~~~~~~~~
1 error generated.
gmake[1]: *** [Makefile:181: build/MidiKeyBoard.o] Error 1
gmake: *** [Makefile:36: src] Error 2
===> Compilation failed unexpectedly.
Try to set MAKE_JOBS_UNSAFE=yes and rebuild before reporting the failure to
the maintainer.
*** Error code 1

Stop.
make: stopped in /home/yusuf/Documents/ports/audio/mamba

root@hale/usr/ports/audio/mamba# find . -name xwidgets.h
./work/Mamba-5f0cf4b/libxputty/xputty/header/xwidgets.h

Same issue in #55

Try to set MAKE_JOBS_UNSAFE=yes

Mamba requires to build libxputty static library before compiling Mamba. Hence it set the -j1 flag.
It seems that in your build environment that isn't respected, and there are running two build threads parallel. Hence gmake[1]. To avoid that you must set the MAKE_JOBS_UNSAFE flag to force building in a single thread.

I did set the environment variable to yes and ran make again after cleaning but result didn't change.

===>  Building for mamba-2.6
for         �[38;5;3mFreeBSD�[m
with        �[38;5;3mcc�[m
using       �[38;5;3mgold�[m
and         �[38;5;3mxxd -i�[m
�[38;5;5m Building object file build/MidiKeyBoard.o �[m
In file included from MidiKeyBoard.cpp:22:
./MidiKeyBoard.h:55:10: fatal error: 'xwidgets.h' file not found
   55 | #include "xwidgets.h"
      |          ^~~~~~~~~~~~
1 error generated.
gmake[1]: *** [Makefile:181: build/MidiKeyBoard.o] Error 1
gmake: *** [Makefile:36: src] Error 2
*** Error code 1

Stop.
make: stopped in /home/yusuf/Documents/ports/audio/mamba

It's defiantly a issue with parallel jobs.
maybe
gmake -j 1
helps. True, it builds here on FreeBSD 14.1-RELEASE-p5 flawless without setting the extra jobs flag.
Do you run plain gmake, or do you use some extra build script?

I never cloned the git head manually, standalone and tried building.

Maybe try that. That's what work here flawless with simple gmake.