Page 1 of 1

Anyone successfully compiled libdispatch required by modern GNUStep?

Posted: Thu Jul 17, 2025 10:12 pm
by mcarans
I tried following these steps to build GNUStep: https://www.gnustep.org/getit.html. GNUStep has a dependency on https://github.com/swiftlang/swift-corelibs-libdispatch and it checks out that repo as part of its build. Unfortunately it fails to build it. I tried building that library independently using both its own instructions and those supplied by GNUstep here: http://developer.gnustep.org/Guides/Set ... linux.html. Unfortunately, I can't even get the initial cmake step to work :-(.

git clone --branch main https://github.com/apple/swift-corelibs-libdispatch
cd swift-corelibs-libdispatch/
cmake -G Ninja -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ src


The above lines give this output:

CMake Warning (dev) in CMakeLists.txt:
No project() command is present. The top-level CMakeLists.txt file must
contain a literal, direct call to the project() command. Add a line of
code such as

project(ProjectName)

near the top of the file, but after cmake_minimum_required().

CMake is pretending there is a "project(Project)" command on the first
line.
This warning is for project developers. Use -Wno-dev to suppress it.

CMake Warning (dev) in CMakeLists.txt:
cmake_minimum_required() should be called prior to this top-level project()
call. Please see the cmake-commands(7) manual for usage documentation of
both commands.
This warning is for project developers. Use -Wno-dev to suppress it.

-- The C compiler identification is Clang 20.1.2
-- The CXX compiler identification is Clang 20.1.2
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/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/bin/clang++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
CMake Error at CMakeLists.txt:143 (check_c_compiler_flag):
Unknown CMake command "check_c_compiler_flag".


CMake Warning (dev) in CMakeLists.txt:
No cmake_minimum_required command is present. A line of code such as

cmake_minimum_required(VERSION 3.31)

should be added at the top of the file. The version specified may be lower
if you wish to support older CMake versions for this project. For more
information run "cmake --help-policy CMP0000".
This warning is for project developers. Use -Wno-dev to suppress it.

-- Configuring incomplete, errors occurred!


I can't figure out why there is an error Unknown CMake command "check_c_compiler_flag" when I can see this line in the CMakeLists.txt file:

include(CheckCCompilerFlag)

Has anyone successfully built swift-corelibs-libdispatch?

Re: Anyone successfully compiled libdispatch required by modern GNUStep?

Posted: Fri Jul 18, 2025 6:35 pm
by Commander_X
I just downloaded the gnustep-base-1.31.1.tar.gz, configured. and made locally (Slackware 15.0) under gcc/objc, with no libobjc2, nor libdispatch installed locally. It (libdispatch) might only be a requirement for clang toolchain, unfortunately the clang version I have doesn't support objc as packaged, and I cannot try to replace gcc in my attempt.
What error(s) do you get if you tried to configure/compile gnustep-base without libdispatch?

EDIT to add: it might also be worthwhile to try

Code: Select all

--disable-libdispatch
option passed to the configure script, but from what I can tell, if you don't have the library, there shouldn't be any trouble configuring and compiling without.

Re: Anyone successfully compiled libdispatch required by modern GNUStep?

Posted: Sat Jul 19, 2025 1:07 am
by mcarans
Thanks for checking. Good to know that gnustep-base can be built without libdispatch.

I don't recommend trying https://www.gnustep.org/getit.html. The changes that the script made somehow messed up my install so I could no longer compile Oolite at all. I had to painstakingly remove all folders and files with "gnustep" in them and then reinstall all the GNUStep default system packages to get it working again. I think I'll leave GNUStep alone for now!

As for Clang, I'm not sure how to get Oolite's makefile to use it instead of gcc. What would be the advantage of using Clang to build Oolite if it were possible?