brummer10 / Mamba

Virtual Midi keyboard and Midi Live Looper for Jack Audio Connection Kit
BSD Zero Clause License
77 stars 5 forks source link

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

Open yurivict opened 8 months ago

yurivict commented 8 months ago

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

brummer10 commented 8 months ago

Hi @yurivict

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

yurivict commented 7 months ago

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
yurivict commented 7 months ago

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.

yurivict commented 7 months ago

These include paths were missing:

CXXFLAGS+=      -I${WRKSRC}/libxputty/xputty/header \
                -I${WRKSRC}/libxputty/xputty/header/widgets
brummer10 commented 7 months ago

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.

yurivict commented 7 months ago

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.
brummer10 commented 7 months ago

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

nxjosephofficial commented 1 month ago

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         FreeBSD
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:
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.

brummer10 commented 1 month ago

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.

nxjosephofficial commented 1 month ago

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         FreeBSD
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:
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
brummer10 commented 1 month ago

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

nxjosephofficial commented 1 month ago

Okay, very thanks. No need to hurry :pray:

brummer10 commented 1 month ago

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.

nxjosephofficial commented 1 month ago

Great. Have a good one.

brummer10 commented 1 month ago

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

nxjosephofficial commented 1 month ago

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         FreeBSD
with        cc
using       gold
and         xxd -i
gmake[1]: warning: -j1 forced in submake: resetting jobserver mode.
 Building object file build/MidiKeyBoard.o 
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

brummer10 commented 1 month ago

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.

nxjosephofficial commented 1 month ago

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         FreeBSD
with        cc
using       gold
and         xxd -i
 Building object file build/MidiKeyBoard.o 
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
brummer10 commented 1 month ago

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?

nxjosephofficial commented 1 month ago

I am directly trying to build through ports framework. Maybe I need to modify the port's makefile, I don't know. Maybe try cloning https://git.freebsd.org/ports.git and going to audio/mamba directory and build it from there through ports framework. I just run make there. I never cloned the git head manually, standalone and tried building.

Sent from Proton Mail Android

-------- Original Message -------- On 10/13/24 1:44 PM, Hermann wrote:

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?

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>

brummer10 commented 1 month ago

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

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