Failed to patch xorg-libxcb: command execution failed

Versions

Please provide the used software versions.

FLUKA:4.5.1
Flair:3.4.3
Operating system:Sequoia 15.6.1
Compiler:gcc 13.4
Xcode :16.4
Macports:2.11.5
XQuartz:2.8.5 (mannually installed)

Description

The fluka was complied.

An error occurred when I input the command while compling the Flair:

“sudo port install xorg-server xorg“

the prompt shows:

Continue? [Y/n]: Y ---> Applying patches to xorg-libxcb
Error: Failed to patch xorg-libxcb: command execution failed
Error: See /opt/local/var/macports/logs/_Users_Danny_Documents_port_x11_xorg-libxcb/xorg-libxcb/main.log for details.
Error: Follow if you believe there is a bug.
Error: Processing of port xorg-server failed

Input files

Following is the main.log

main.log (179.9 KB)

Thanks in advance!

Hi @songhg19,

I have a similar environment to yours and I couldn’t reproduce this error. If the issue has been fixed at MacPorts level, I suggest you try again.

However, you don’t need to install X server from MacPorts. You already have it installed as an independent package, Xquartz, as recommended in the Mac OSX installation instructions on the Flair website.

Have you managed to compile geoviewer and test Flair? This should work in principle.

Best,
Luigi

Hi @luillo

Thanks for your reply. The geoviewer compilation is failed. After inputting

make install DESTDIR=PATH_FLAIR

the terminal show as follows:

make install DESTDIR=/Users/Danny/Documents/flair/flair-3.4
Traceback (most recent call last):
  File "<string>", line 1, in <module>
    import tkinter;print(tkinter.TkVersion)
    ^^^^^^^^^^^^^^
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/tkinter/__init__.py", line 38, in <module>
    import _tkinter # If this fails your Python may not be configured for Tk
    ^^^^^^^^^^^^^^^
ModuleNotFoundError: No module named '_tkinter'
Package x11 was not found in the pkg-config search path.
Perhaps you should add the directory containing `x11.pc'
to the PKG_CONFIG_PATH environment variable
No package 'x11' found
/Applications/Xcode.app/Contents/Developer/usr/bin/make -C viewer
make[1]: Nothing to be done for `all'.
/Applications/Xcode.app/Contents/Developer/usr/bin/make -C farm
make[1]: Nothing to be done for `all'.
/Applications/Xcode.app/Contents/Developer/usr/bin/make -C geometry
make[1]: Nothing to be done for `all'.
/Applications/Xcode.app/Contents/Developer/usr/bin/make -C data
make[1]: Nothing to be done for `all'.
/Applications/Xcode.app/Contents/Developer/usr/bin/make -C graph
make[1]: Nothing to be done for `all'.
/Applications/Xcode.app/Contents/Developer/usr/bin/make -C math
make[1]: Nothing to be done for `all'.
/Applications/Xcode.app/Contents/Developer/usr/bin/make -C tool
make[1]: Nothing to be done for `all'.
/Applications/Xcode.app/Contents/Developer/usr/bin/make -C xdraw
Package x11 was not found in the pkg-config search path.
Perhaps you should add the directory containing `x11.pc'
to the PKG_CONFIG_PATH environment variable
No package 'x11' found
g++ -c ocube.cc -m64 -g -DDarwin -std=c++17 -O3 -funroll-loops -fno-math-errno -DNDEBUG -D_DEBUG=0 -ftree-vectorize -DTHREAD  -pedantic -W -Wall -Wcast-qual -Wextra -Wformat -Wpointer-arith -Wshadow -Wno-write-strings -Wcast-align -Wredundant-decls -Wno-long-long -Wno-non-virtual-dtor -Wno-variadic-macros -Woverloaded-virtual -Wpointer-arith -Wshadow -Wunused -Wuninitialized -Wwrite-strings -Wshadow -pipe -pthread -Wno-class-memaccess -fwrapv -fstack-protector -Wno-vla -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk -fstrict-aliasing -I. -I.. 
ocube.cc:16:10: fatal error: X11/Xlib.h: No such file or directory
   16 | #include <X11/Xlib.h>
      |          ^~~~~~~~~~~~
compilation terminated.
make[1]: *** [ocube.o] Error 1
make: *** [xdraw/libxdraw.a] Error 2

So it comes back to the first question, and also for the installation of tkinter.
I tried different versions of macports and pythons. The problem remains.

Thanks.

Dear @songhg19,

The issue is due to the fact that the X server library are not found at compilation.

Did you followed these instructions from the Flair installation instructions for MacOSX

Since the separation of tk into tk-x11 and tk-quartz ports (on 5 January 2025), the quartz variant is the default. Therefore, tk needs to be installed with the x11 variant in order to work with Flair, as described here.
To do so, please run:
$ sudo port install tk +x11
Then rebuild py3[version]-tkinter from source
port -ns upgrade --force py3[version]-tkinter

If you still have problem, please provide the output of these commands:

  • gfortran -v
  • echo $PATH
  • port echo requested
  • port select --summary

Best, Luigi

Dear @luillo ,
After running
sudo port install tk +x11
the terminal shows:

--->  Computing dependencies for tk
The following dependencies will be installed: 
 Xft2 
 tk-x11 
 xorg-libX11 
 xorg-libXScrnSaver 
 xorg-libXext 
 xorg-libxcb +python38
 xrender 
Continue? [Y/n]: Y
--->  Applying patches to xorg-libxcb
Error: Failed to patch xorg-libxcb: command execution failed
Error: See /opt/local/var/macports/logs/_Users_Danny_Documents_port_x11_xorg-libxcb/xorg-libxcb/main.log for details.
Error: Follow https://guide.macports.org/#project.tickets if you believe there
is a bug.
Error: Processing of port tk failed

The output of commands shows as follows:

gfortran -v 
Using built-in specs. COLLECT_GCC=gfortran COLLECT_LTO_WRAPPER=/opt/local/libexec/gcc/aarch64-apple-darwin24/13.4.0/lto-wrapper Target: aarch64-apple-darwin24 Configured with: /opt/local/var/macports/build/gcc13-a82e608c/work/gcc-13.4.0/configure --prefix=/opt/local --build=aarch64-apple-darwin24 --enable-languages=c,c++,objc,obj-c++,lto,fortran,m2,jit --libdir=/opt/local/lib/gcc13 --infodir=/opt/local/share/info --mandir=/opt/local/share/man --datarootdir=/opt/local/share/gcc-13 --with-local-prefix=/opt/local --with-system-zlib --disable-nls --program-suffix=-mp-13 --with-gxx-include-dir=/opt/local/include/gcc13/c++/ --with-gmp=/opt/local --with-mpfr=/opt/local --with-mpc=/opt/local --with-isl=/opt/local --with-zstd=/opt/local --enable-checking=release --disable-multilib --enable-lto --enable-libstdcxx-time --with-build-config=bootstrap-debug --with-as=/opt/local/bin/as --with-ld=/opt/local/bin/ld --with-ar=/opt/local/bin/ar --with-bugurl=https://trac.macports.org/newticket --enable-host-shared --with-darwin-extra-rpath=/opt/local/lib/libgcc --with-libiconv-prefix=/opt/local --disable-tls --with-gxx-libcxx-include-dir=/opt/local/libexec/gcc13/libc++/include/c++/v1 --with-pkgversion='MacPorts gcc13 13.4.0_1+stdlib_flag' --with-sysroot=/Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk Thread model: posix Supported LTO compression algorithms: zlib zstd gcc version 13.4.0 (MacPorts gcc13 13.4.0_1+stdlib_flag)
echo $PATH
/Users/Danny/Documents/Anaconda/anaconda3/condabin:/Users/Danny/Library/Python/3.9/bin:/opt/local/bin:/opt/local/sbin:/Library/Frameworks/Python.framework/Versions/3.13/bin:/opt/local/bin:/opt/local/sbin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/opt/X11/bin:/Library/Apple/usr/bin:/opt/homebrew/bin:/Users/Danny/Documents/Fluka/fluka4-5.1/bin
port echo requested
gcc13                          @13.4.0_1+stdlib_flag 
python313                      @3.13.7_0+lto+optimizations
port select --summary
Name       Selected       Options
====       ========       =======
fonttools  fonttools-313  fonttools-313 none
gcc        mp-gcc13       mp-gcc13 none
geant4     geant4.10.5    none
python     python313      python313 python38 none
python3    python313      python313 python38 none

Best, songhg

Dear @songhg19 ,

Your PATH variable contains the path to Anaconda at the beginning, which causes conflicts between different Python environments.
You should correct this in your shell configuration file. For example, in my ~/.bash_profile I have this function that I initialised before I use Flair.

set_MacPorts() {
    export PATH="/opt/local/bin:/opt/local/sbin:$PATH”
}

Once you have a clean environment for MacPorts, I suggest that you issue the command sudo port install tk +x11 again and, if there are no errors, you can try to compile geoviewer again.

In case of error (which is likely since you have not followed carefully the Installation Instructions), I think the MacPort installation is corrupted and so you need to remove all ports with the command sudo port -fp uninstall installed and then follow again the Mac OSX installation instructions in the Flair website.

In particular, note that you need to install Python with these variants (as documented in the installation instructions)
sudo port install py3[version]-matplotlib +tkinter +x11

Since you have XQuartz as a standalone package, there is no need to install it via MacPorts.

Best, Luigi

Dear @luillo
The xorg-libxcb is still not installed.
So I re-install the OS, and installed the fluke and flair.
However, the interface of the flair seems not normal, show as follow:


Best, songhg