Bug 285437 - emulators/rpcs3 fails to find the correct llvm version
Summary: emulators/rpcs3 fails to find the correct llvm version
Status: New
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: amd64 Any
: --- Affects Some People
Assignee: Jan Beich
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-03-15 14:02 UTC by Daniel Toschläger
Modified: 2025-04-17 13:42 UTC (History)
0 users

See Also:
jbeich: maintainer-feedback+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel Toschläger 2025-03-15 14:02:59 UTC
Hi
I try to compile emulators/rpcs3 (version rpcs3-0.0.35) from the ports but is fails to find/to select the right installed llvm compiler system. I have multiple versions installed

llvm12-12.0.1_13
llvm15-15.0.7_10
llvm17-17.0.6_8
llvm19-19.1.7_1

it doesen't get it. There is no switch to use a specific version OR the bundled llvm. rpcs demands a version bigger or equal 18. Like you see I have 19 installed. It finds LLVM 15. and stops the process. This is all info I get

-- RPCS3: Using system FAudio
-- RPCS3: using shared ffmpeg
-- Found FFMPEG or Libav: /usr/local/lib/libavcodec.so;/usr/local/lib/libavformat.so;/usr/local/lib/libavutil.so;/usr/local/lib/libswscale.so;/usr/local/lib/libswresample.so, /usr/local/include
-- Using prebuilt or system LLVM
CMake Error at 3rdparty/llvm/CMakeLists.txt:73 (message):
  Found LLVM version 15.0.7.  Required version 18 or above.  													
  Enable BUILD_LLVM option to build LLVM from included as a git submodule.


-- Configuring incomplete, errors occurred!
*** Error code 1

Stop.
make[1]: stopped in /usr/ports/emulators/rpcs3
*** Error code 1

Stop.
make: stopped in /usr/ports/emulators/rpcs3
Comment 1 Daniel Toschläger 2025-03-16 16:12:52 UTC
looked into the configure part, it finds an appropriate compiler 19.7.1 here the configure messages:

=> SHA256 Checksum OK for RPCS3-rpcs3-v0.0.35-17644-ga108ce8015_GH0.tar.gz.
=> SHA256 Checksum OK for RPCS3-hidapi-hidapi-0.14.0-2-g8b43a97_GH0.tar.gz.
=> SHA256 Checksum OK for RPCS3-soundtouch-2.3.1-68-g394e1f5_GH0.tar.gz.
=> SHA256 Checksum OK for asmjit-asmjit-416f735_GH0.tar.gz.
=> SHA256 Checksum OK for facebook-zstd-v1.5.7_GH0.tar.gz.
=> SHA256 Checksum OK for jbeder-yaml-cpp-0.8.0-11-g456c68f_GH0.tar.gz.
=> SHA256 Checksum OK for KhronosGroup-glslang-13.1.1_GH0.tar.gz.
=> SHA256 Checksum OK for kcat-openal-soft-1.23.1_GH0.tar.gz.
=> SHA256 Checksum OK for kinetiknz-cubeb-cubeb-0.2-1425-g88585b6_GH0.tar.gz.
=> SHA256 Checksum OK for miniupnp-miniupnp-miniupnpd_2_3_6_GH0.tar.gz.
=> SHA256 Checksum OK for nothings-stb-013ac3b_GH0.tar.gz.
=> SHA256 Checksum OK for wolfSSL-wolfssl-v5.7.6-stable_GH0.tar.gz.
=> SHA256 Checksum OK for xioTechnologies-Fusion-v1.2.8_GH0.tar.gz.
=> SHA256 Checksum OK for thestk-rtmidi-6.0.0_GH0.tar.gz.
===>  Patching for rpcs3-0.0.35.17644
===>  Applying FreeBSD patches for rpcs3-0.0.35.17644 from /usr/ports/emulators/rpcs3/files
===>   rpcs3-0.0.35.17644 depends on executable: flatc - found
===>   rpcs3-0.0.35.17644 depends on package: evdev-proto>0 - found
===>   rpcs3-0.0.35.17644 depends on package: jackit>0 - found
===>   rpcs3-0.0.35.17644 depends on package: pulseaudio>0 - found
===>   rpcs3-0.0.35.17644 depends on package: sndio>0 - found
===>   rpcs3-0.0.35.17644 depends on file: /usr/local/include/vulkan/vulkan.h - found
===>   rpcs3-0.0.35.17644 depends on file: /usr/local/bin/cmake - found
===>   rpcs3-0.0.35.17644 depends on executable: ninja - found
===>   rpcs3-0.0.35.17644 depends on package: pkgconf>=1.3.0_1 - found
===>   rpcs3-0.0.35.17644 depends on file: /usr/local/bin/python3.11 - found
===>   rpcs3-0.0.35.17644 depends on package: xorgproto>=0 - found
===>   rpcs3-0.0.35.17644 depends on file: /usr/local/libdata/pkgconfig/x11.pc - found
===>   rpcs3-0.0.35.17644 depends on shared library: libcurl.so - found (/usr/local/lib/libcurl.so)
===>   rpcs3-0.0.35.17644 depends on shared library: libpng.so - found (/usr/local/lib/libpng.so)
===>   rpcs3-0.0.35.17644 depends on shared library: libavcodec.so - found (/usr/local/lib/libavcodec.so)
===>   rpcs3-0.0.35.17644 depends on shared library: libpugixml.so - found (/usr/local/lib/libpugixml.so)
===>   rpcs3-0.0.35.17644 depends on shared library: libevdev.so - found (/usr/local/lib/libevdev.so)
===>   rpcs3-0.0.35.17644 depends on shared library: libudev.so - found (/usr/local/lib/libudev.so)
===>   rpcs3-0.0.35.17644 depends on shared library: libFAudio.so - found (/usr/local/lib/libFAudio.so)
===>   rpcs3-0.0.35.17644 depends on shared library: libjack.so - found (/usr/local/lib/libjack.so)
===>   rpcs3-0.0.35.17644 depends on shared library: libopencv_imgproc.so - found (/usr/local/lib/libopencv_imgproc.so)
===>   rpcs3-0.0.35.17644 depends on shared library: libvulkan.so - found (/usr/local/lib/libvulkan.so)
===>   rpcs3-0.0.35.17644 depends on shared library: libGL.so - found (/usr/local/lib/libGL.so)
===>   rpcs3-0.0.35.17644 depends on shared library: libGLEW.so - found (/usr/local/lib/libGLEW.so)
===>   rpcs3-0.0.35.17644 depends on shared library: libiconv.so - found (/usr/local/lib/libiconv.so)
===>   rpcs3-0.0.35.17644 depends on shared library: libLLVM-19.so - found (/usr/local/llvm19/lib/libLLVM-19.so)
===>   rpcs3-0.0.35.17644 depends on shared library: libopenal.so.1 - found (/usr/local/lib/libopenal.so.1)
===>   rpcs3-0.0.35.17644 depends on shared library: libSDL3.so - found (/usr/local/lib/libSDL3.so)
===>   rpcs3-0.0.35.17644 depends on shared library: libQt6Core.so - found (/usr/local/lib/qt6/libQt6Core.so)
===>   rpcs3-0.0.35.17644 depends on shared library: libQt6Multimedia.so - found (/usr/local/lib/qt6/libQt6Multimedia.so)
===>   rpcs3-0.0.35.17644 depends on shared library: libQt6Svg.so - found (/usr/local/lib/qt6/libQt6Svg.so)
===>  Configuring for rpcs3-0.0.35.17644
===>  Performing out-of-source build
/bin/mkdir -p /usr/ports/emulators/rpcs3/work/.build
-- The C compiler identification is Clang 19.1.7
-- The CXX compiler identification is Clang 19.1.7
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/local/llvm19/bin/clang - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/local/llvm19/bin/clang++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found PkgConfig: /usr/local/bin/pkgconf (found version "2.3.0")
-- RPCS3: Using system ZLIB
-- The ASM compiler identification is Clang with GNU-like command-line
-- Found assembler: /usr/local/llvm19/bin/clang
-- ZSTD VERSION: 1.5.7
-- Performing Test C_FLAG_WALL
-- Performing Test C_FLAG_WALL - Success
-- Performing Test CXX_FLAG_WALL
-- Performing Test CXX_FLAG_WALL - Success
-- Performing Test C_FLAG_WEXTRA
-- Performing Test C_FLAG_WEXTRA - Success
-- Performing Test CXX_FLAG_WEXTRA
-- Performing Test CXX_FLAG_WEXTRA - Success
-- Performing Test C_FLAG_WUNDEF
-- Performing Test C_FLAG_WUNDEF - Success
-- Performing Test CXX_FLAG_WUNDEF
-- Performing Test CXX_FLAG_WUNDEF - Success
-- Performing Test C_FLAG_WSHADOW
-- Performing Test C_FLAG_WSHADOW - Success
-- Performing Test CXX_FLAG_WSHADOW
-- Performing Test CXX_FLAG_WSHADOW - Success
-- Performing Test C_FLAG_WCAST_ALIGN
-- Performing Test C_FLAG_WCAST_ALIGN - Success
-- Performing Test CXX_FLAG_WCAST_ALIGN
-- Performing Test CXX_FLAG_WCAST_ALIGN - Success
-- Performing Test C_FLAG_WCAST_QUAL
-- Performing Test C_FLAG_WCAST_QUAL - Success
-- Performing Test CXX_FLAG_WCAST_QUAL
-- Performing Test CXX_FLAG_WCAST_QUAL - Success
-- Performing Test C_FLAG_WSTRICT_PROTOTYPES
-- Performing Test C_FLAG_WSTRICT_PROTOTYPES - Success
-- Performing Test LD_FLAG_WL_Z_NOEXECSTACK
-- Performing Test LD_FLAG_WL_Z_NOEXECSTACK - Success
-- Performing Test C_FLAG_QUNUSED_ARGUMENTS
-- Performing Test C_FLAG_QUNUSED_ARGUMENTS - Success
-- Performing Test CXX_FLAG_QUNUSED_ARGUMENTS
-- Performing Test CXX_FLAG_QUNUSED_ARGUMENTS - Success
-- Performing Test C_FLAG_WA_NOEXECSTACK
-- Performing Test C_FLAG_WA_NOEXECSTACK - Success
-- Performing Test CXX_FLAG_WA_NOEXECSTACK
-- Performing Test CXX_FLAG_WA_NOEXECSTACK - Success
-- CMAKE_INSTALL_PREFIX: /usr/local
-- CMAKE_INSTALL_LIBDIR: lib
-- ZSTD_LEGACY_SUPPORT defined!
-- ZSTD_MULTITHREAD_SUPPORT is enabled
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- Found Threads: TRUE
-- Checking for module 'flatbuffers>=2.0.0'
--   Found flatbuffers, version 25.1.24
Comment 2 Jan Beich freebsd_committer freebsd_triage 2025-03-17 17:59:02 UTC
I can't reproduce (no clue what influences probe order) and don't know how to fix (specifying version in find_package() would prevent using devel/llvm20 or later).

Workaround: build via poudriere or use prebuilt/binary package.
Comment 3 Daniel Toschläger 2025-04-12 20:48:52 UTC
Hey
I was able to fix it by making a backup pkg of all my installed llvm versions < && > 19. I tried first to leave 18 on my machine, too. But thaen rpcs3 finds 19 and fails. Also 18 failed. Only 19 worked. One time, before it failed again. But nevermind I was able to compile rpcs3 and reinstalled all llvms from my backups. pkg create -o /path/to/backups program_name to Backup and than pkg add /path/to/backup to reinstall.

It seams it is important with wich llvm version the dependenices (maybe jut the graphics drivers) are compiled for a clean compile of rpcs3. 

The internal llvm version detection of rpcs is garbagê. Complete chaoas on a real system.

I hope I did not contribute too much to the chaos.


Kind regards
Daniel
Comment 4 Jan Beich freebsd_committer freebsd_triage 2025-04-13 00:36:23 UTC
(In reply to Daniel Toschläger from comment #3)
> Complete chaoas on a real system.

How did you rule out a pilot error? rpcs3 builds fine for me after installing llvm12, llvm15, llvm17, llvm19. I've also installed llvm11, llvm13, llvm14, llvm16, llvm20... but rpcs3 still builds fine.
Comment 5 Daniel Toschläger 2025-04-17 01:32:35 UTC
Hey
What do you mean by pilot error? Do you think it is somehow my fault? But how? I tried make rmconfig to erase any changes i made. Before every attempt to make any port i do make clean depend in the port dir. I keep everything tidy in the ports. I cloned rpc3 fron git and got the same error, noadequate version of llvm was found and the compile process broke at the same point. 

Tomorrow I will try it again. Like I told one time the complete compilation went fine. It only went well with llvm19. By different ports demmanding different llvm versions i assume some specific features are needed in this versions.

Tell me what you mean? I tried to find the problem with chatgpt before iwrote this bugreport. I tried different variables to export for using a specific version of llvm, manipulating the make.conf and giving commandline instructions after make like WITH_this and that forcexample. But the script always broke at thatpoint to allocate the right version of llvm. 


Kind greetings 
Daniel
Comment 6 Jan Beich freebsd_committer freebsd_triage 2025-04-17 04:35:52 UTC
Every bug starts as a pilot error, especially when NOT using a clean environment like poudriere or fresh install in a VM. comment 0 didn't provide basic details like FreeBSD version, versions of *all* installed packages, environ(7) variables, make.conf(5) content, etc. that are automatically captured by poudriere.

Without ability to reproduce I need more data to narrow down the actual cause, let alone fix it. The port has used system LLVM for 2 years (since ports e7f533b985f3). So far you're the only one having such an issue.
Comment 7 Daniel Toschläger 2025-04-17 13:42:06 UTC
Hi
I use FreeBSD 14.2 p3, latest ports via git pull, physically on a computer with a touchable on/off button. I have a lot (3387) of ports installed, very few problems - never llvm related. I do everyday updates - always from the ports. No hacks. I do not have the capacity left to clone a jail with a clean room system.

# Problem ######################################################
RPCS3 wants llvm >= 18, finds 17, compiles on 19 and recognizes 18 during execution but gives a $%&!

# port build configuration message #############################
===>   rpcs3-0.0.36 depends on shared library: libLLVM-19.so - found (/usr/local/llvm19/lib/libLLVM-19.so)

# error during built directly form llvm configure ##############
-- Using prebuilt or system LLVM
CMake Error at 3rdparty/llvm/CMakeLists.txt:73 (message):
Found LLVM version 17.0.6.  Required version 18 or above.  							

# executing (a well working) rpcs3 (built isolated to llvm19) reports this #########
system llvm is this RPCS3: SYS: LLVM version: 18.1.8
RPCS3: Vulkan Device Enumeration Thread: RSX: Found Vulkan-compatible GPU: 'llvmpipe (LLVM 19.1.7, 256 bits)' running on driver 0.0.1

# My conclusion ###############################################
The llvm configure script finds the wrong llvm (something lower 18) even though 18, 19 and 20 are installed. It is not your fault, the original configure script does not function well enough or is dazzled by BSDs localities.

If you think that is just my problem, I understand that. See it as a well meant constructive warning and close my bugreport. I do not feel insulted. I love BSD! Thanks a lot for bringing rpcs3 to it!


Kind regards
Daniel