Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

compile issue with rnp and retroshare on macos #2307

Open
defnax opened this issue Dec 30, 2024 · 63 comments
Open

compile issue with rnp and retroshare on macos #2307

defnax opened this issue Dec 30, 2024 · 63 comments

Comments

@defnax
Copy link

defnax commented Dec 30, 2024

Hello, im not able compile libretroshare with rnp on macos, i get a issue with Botan 2
i installed with brew, json-c and botan@2 and the needed depencies

Warning: botan@2 2.19.5 is already installed and up-to-date.
To reinstall 2.19.5, run:
brew reinstall botan@2

here is the definition for macos platform to find the libs/include:

	macx-* {
		# bzip2
		LIBRNP_CMAKE_PARAMS *= "-DBZIP2_INCLUDE_DIR=$$clean_path(/usr/local/opt/bzip2/include)"
		LIBRNP_CMAKE_PARAMS *= "-DBZIP2_LIBRARY_RELEASE=$$clean_path(/usr/local/opt/bzip2/lib/libbz2.a)"
		# zlib
		LIBRNP_CMAKE_PARAMS *= "-DZLIB_INCLUDE_DIR=$$clean_path(/usr/local/opt/zlib/include)"
		LIBRNP_CMAKE_PARAMS *= "-DZLIB_LIBRARY=$$clean_path(/usr/local/opt/zlib/lib/libz.a)"
		# json-c
		LIBRNP_CMAKE_PARAMS *= "-DJSON-C_INCLUDE_DIR=$$clean_path(/usr/local/opt/json-c/include)"
		LIBRNP_CMAKE_PARAMS *= "-DJSON-C_LIBRARY=$$clean_path(/usr/local/opt/json-c/lib/libjson-c.a)"
		LIBRNP_CMAKE_PARAMS *= "-DJSON-C_VERSION=0.18"
		# botan
		LIBRNP_CMAKE_PARAMS *= "-DBOTAN_INCLUDE_DIR=$$clean_path(/usr/local/opt/botan@2/include)"
		LIBRNP_CMAKE_PARAMS *= "-DBOTAN_LIBRARY=$$clean_path(/usr/local/opt/botan@2/lib/libbotan-2.a)"
	}

-- Found no annotated tags.
-- RNP_VERSION: 0.17.1
-- RNP_VERSION_NCOMMITS: 0
-- RNP_VERSION_GIT_REV: ec78117
-- RNP_VERSION_IS_DIRTY: FALSE
-- RNP_VERSION_COMMIT_TIMESTAMP: 1735042232
-- RNP_VERSION_SUFFIX: +git20241230.ec78117
-- RNP_VERSION_FULL: 0.17.1+git20241230.ec78117
CMake Warning at cmake/Modules/AdocMan.cmake:51 (message):
  AsciiDoc processor not found, man pages will not be generated.  Install
  asciidoctor or use the CMAKE_PROGRAM_PATH variable.
Call Stack (most recent call first):
  CMakeLists.txt:194 (include)


-- Found version.txt with 0.9.0
-- Found annotated tag v0.9.0-0-gc641a2f
-- SEXPP_VERSION: 0.9.0
-- SEXPP_VERSION_NCOMMITS: 0
-- SEXPP_VERSION_GIT_REV: c641a2f
-- SEXPP_VERSION_IS_DIRTY: FALSE
-- SEXPP_VERSION_COMMIT_TIMESTAMP: 0
-- SEXPP_MAJOR_VERSION: 0
-- SEXPP_VERSION_SUFFIX: 
-- SEXPP_VERSION_FULL: 0.9.0
-- Building STATIC library
-- Building Release configuration
-- Found BZip2: /usr/local/opt/bzip2/lib/libbz2.a (found version "1.0.8")
-- Found ZLIB: /usr/local/opt/zlib/lib/libz.a (found version "1.3.1")
CMake Error at src/lib/CMakeLists.txt:178 (message):
  A required botan feature is missing: BIGINT

make[1]: *** [../../supportlibs/librnp/Build/src/lib/rnp/rnp_export.h] Error 1
make[1]: *** Waiting for unfinished jobs....```

how i can solve the issue with BIGINT?


@ni4
Copy link
Contributor

ni4 commented Dec 31, 2024

@defnax this is because Botan headers are not found. Most likely because the include path should have botan-2 at the end. Btw, botan 2 goes EOL today as far as I remember, and RNP supports Botan 3.0.

@defnax
Copy link
Author

defnax commented Dec 31, 2024

Thank you for the tip, i has changed i get same errors
but the lib is found correctly

LIBRNP_CMAKE_PARAMS *= "-DBOTAN_INCLUDE_DIR=$$clean_path(/usr/local/opt/botan@2/include/botan-2)"
LIBRNP_CMAKE_PARAMS *= "-DBOTAN_LIBRARY=$$clean_path(/usr/local/opt/botan@2/lib/libbotan-2.a)"
-- Building STATIC library
-- Building Release configuration
-- Found Botan: /usr/local/opt/botan@2/lib/libbotan-2.a (found suitable version "2.19.5", minimum required is "2.14.0")
CMake Error at src/lib/CMakeLists.txt:178 (message):
  A required botan feature is missing: BIGINT

i has tested with the direct path, get same errors
LIBRNP_CMAKE_PARAMS *= "-DBOTAN_INCLUDE_DIR=$$clean_path(/usr/local/Cellar/botan@2/2.19.5/include/botan-2)"

@ni4
Copy link
Contributor

ni4 commented Dec 31, 2024

Just re-checked: RNP uses FindBotan.cmake (from the cmake/modules/FindBotan.cmake) which accepts as a hint only BOTAN_ROOT_DIR. Also afterwards it sets BOTAN_INCLUDE_DIRS variable (notice the S at the end).

@defnax
Copy link
Author

defnax commented Jan 14, 2025

i doesnt found yet a solution
with BOTAN_ROOT_DIR get the same issues

LIBRNP_CMAKE_PARAMS *= "-DBOTAN_ROOT_DIR=$$clean_path(/usr/local/opt/botan@2)"
LIBRNP_CMAKE_PARAMS *= "-DBOTAN_INCLUDE_DIR=$$escape_expand($$clean_path(/usr/local/opt/botan@2/include/botan-2))"
LIBRNP_CMAKE_PARAMS *= "-DBOTAN_LIBRARY=$$clean_path(/usr/local/opt/botan@2/lib/libbotan-2.a)"

@ni4
Copy link
Contributor

ni4 commented Jan 15, 2025

@defnax Hm, maybe the problem is with extra defines: locally I build it with botan-2 via the single define -DBOTAN_ROOT_DIR=/usr/local/opt/botan@2/. Could you try it without the -DBOTAN_INCLUDE_DIR and -DBOTAN_LIBRARY?

@ni4
Copy link
Contributor

ni4 commented Jan 15, 2025

However, for me it works even with these variables. Could you provide CMake command which is executed for rnp build?
I use the following:

/usr/local/bin/cmake -DBUILD_SHARED_LIBS=Off \
  -DCMAKE_BUILD_TYPE=Release \
  -DBUILD_TESTING=Off \
  -DCRYPTO_BACKEND=botan \
  -DBOTAN_ROOT_DIR=/usr/local/opt/botan@2/ \
  -DBOTAN_INCLUDE_DIR=/usr/local/opt/botan@2/include/botan-2 \
  -DBOTAN_LIBRARY=/usr/local/opt/botan@2/lib/libbotan-2.a \
  -DDOWNLOAD_GTEST=Off \
  -DCMAKE_EXPORT_COMPILE_COMMANDS=TRUE \
  -S./../rnp -B./build -G "Unix Makefiles"

@defnax
Copy link
Author

defnax commented Jan 15, 2025

@defnax Hm, maybe the problem is with extra defines: locally I build it with botan-2 via the single define -DBOTAN_ROOT_DIR=/usr/local/opt/botan@2/. Could you try it without the -DBOTAN_INCLUDE_DIR and -DBOTAN_LIBRARY?

thx, i will look later, need test it

@defnax
Copy link
Author

defnax commented Jan 15, 2025

i has tested get same error with bigint

here is the librnp compile section its in ouer libretroshare.pro project file
https://github.com/RetroShare/libretroshare/blob/650ee8a77ee2f01bc12e234ef194cdbde012a2e8/src/libretroshare.pro#L1135

rs_rnplib {
message("In rnp_rnplib precompilation code")
    DUMMYQMAKECOMPILERINPUT = FORCE

    # Generate header file rnp_export.h
    librnp_header.name = Generating librnp header.
    librnp_header.input = DUMMYQMAKECOMPILERINPUT
    librnp_header.output = $$clean_path($${LIBRNP_BUILD_PATH}/src/lib/rnp/rnp_export.h)
    librnp_header.variable_out = HEADERS

	LIBRNP_CMAKE_CXXFLAGS =
    LIBRNP_CMAKE_PARAMS =

	macx-* {
		# bzip2
		LIBRNP_CMAKE_PARAMS *= "-DBZIP2_INCLUDE_DIR=$$clean_path(/usr/local/opt/bzip2/include)"
		LIBRNP_CMAKE_PARAMS *= "-DBZIP2_LIBRARY_RELEASE=$$clean_path(/usr/local/opt/bzip2/lib/libbz2.a)"
		# zlib
		LIBRNP_CMAKE_PARAMS *= "-DZLIB_INCLUDE_DIR=$$clean_path(/usr/local/opt/zlib/include)"
		LIBRNP_CMAKE_PARAMS *= "-DZLIB_LIBRARY=$$clean_path(/usr/local/opt/zlib/lib/libz.a)"
		# json-c
		LIBRNP_CMAKE_PARAMS *= "-DJSON-C_INCLUDE_DIR=$$clean_path(/usr/local/opt/json-c/include/json-c)"
		LIBRNP_CMAKE_PARAMS *= "-DJSON-C_LIBRARY=$$clean_path(/usr/local/opt/json-c/lib/libjson-c.a)"
		LIBRNP_CMAKE_PARAMS *= "-DJSON-C_VERSION=0.18"
		# botan
		LIBRNP_CMAKE_PARAMS *= "-DBOTAN_ROOT_DIR=$$clean_path(/usr/local/opt/botan@2)"
		#LIBRNP_CMAKE_PARAMS *= "-DBOTAN_INCLUDE_DIR=$$clean_path(/usr/local/opt/botan@2/include/botan-2)"
		#LIBRNP_CMAKE_PARAMS *= "-DBOTAN_LIBRARY=$$clean_path(/usr/local/opt/botan@2/lib/libbotan-2.a)"
	}

    CONFIG(debug, debug|release) {
        # Debug
        LIBRNP_CMAKE_CXXFLAGS *= $${QMAKE_CXXFLAGS_DEBUG}
        LIBRNP_CMAKE_PARAMS *= -DCMAKE_BUILD_TYPE=Debug
    } else {
        # Release
        LIBRNP_CMAKE_CXXFLAGS *= $${QMAKE_CXXFLAGS_RELEASE}
        LIBRNP_CMAKE_PARAMS *= -DCMAKE_BUILD_TYPE=Release
    }

    librnp_shared {
        # Use librnp as shared library
        LIBRNP_CMAKE_PARAMS += -DBUILD_SHARED_LIBS=yes
    }

    win32-g++:isEmpty(QMAKE_SH) {
        # Windows native build
        !isEmpty(EXTERNAL_LIB_DIR) {
            LIBRNP_CMAKE_CXXFLAGS *= -D__MINGW_USE_VC2005_COMPAT -D__STDC_FORMAT_MACROS
            # Causes compilation error
            LIBRNP_CMAKE_CXXFLAGS -= -fno-omit-frame-pointer
            # bzip2
            LIBRNP_CMAKE_PARAMS *= "-DBZIP2_INCLUDE_DIR=$$escape_expand($$clean_path($$EXTERNAL_LIB_DIR/include))"
            LIBRNP_CMAKE_PARAMS *= "-DBZIP2_LIBRARY_RELEASE=$$escape_expand($$clean_path($$EXTERNAL_LIB_DIR/lib/libbz2.a))"
            # zlib
            LIBRNP_CMAKE_PARAMS *= "-DZLIB_INCLUDE_DIR=$$escape_expand($$clean_path($$EXTERNAL_LIB_DIR/include))"
            LIBRNP_CMAKE_PARAMS *= "-DZLIB_LIBRARY=$$escape_expand($$clean_path($$EXTERNAL_LIB_DIR/lib/libz.a))"
            # json-c
            LIBRNP_CMAKE_PARAMS *= "-DJSON-C_INCLUDE_DIR=$$escape_expand($$clean_path($$EXTERNAL_LIB_DIR/include/json-c))"
            LIBRNP_CMAKE_PARAMS *= "-DJSON-C_LIBRARY=$$escape_expand($$clean_path($$EXTERNAL_LIB_DIR/lib/libjson-c.a))"
            # botan
            LIBRNP_CMAKE_PARAMS *= "-DBOTAN_INCLUDE_DIR=$$escape_expand($$clean_path($$EXTERNAL_LIB_DIR/include/botan-2))"
            LIBRNP_CMAKE_PARAMS *= "-DBOTAN_LIBRARY=$$escape_expand($$clean_path($$EXTERNAL_LIB_DIR/lib/libbotan-2.a))"
        }

        librnp_header.commands = \
            cd /D $$shell_path($${RS_SRC_PATH}) && git submodule update --init supportlibs/librnp || cd . $$escape_expand(\\n\\t) \
            cd /D $$shell_path($${LIBRNP_SRC_PATH}) && git submodule update --init src/libsexpp || cd . $$escape_expand(\\n\\t) \
            $(CHK_DIR_EXISTS) $$shell_path($$LIBRNP_BUILD_PATH) $(MKDIR) $$shell_path($${LIBRNP_BUILD_PATH}) $$escape_expand(\\n\\t)
    } else {
        librnp_header.commands = \
            cd $${RS_SRC_PATH} && \
            (git submodule update --init supportlibs/librnp || true ) && \
            cd $${LIBRNP_SRC_PATH} && git submodule update --init src/libsexpp && \
            mkdir -p $${LIBRNP_BUILD_PATH} &&
    }
    librnp_header.commands += cd $$shell_path($${LIBRNP_BUILD_PATH}) && \
        cmake \
        -Wno-dev \
        -DCMAKE_C_COMPILER=$$fixQmakeCC($$QMAKE_CC) \
        -DCMAKE_CXX_COMPILER=$$QMAKE_CXX \
        $${LIBRNP_CMAKE_PARAMS} \
        -DBUILD_TESTING=off \
        -DCMAKE_CXX_FLAGS=\"$${LIBRNP_CMAKE_CXXFLAGS}\" \
        $${CMAKE_GENERATOR_OVERRIDE} \
        -DENABLE_COVERAGE=Off \
        -DCMAKE_INSTALL_PREFIX=. -B. \
        -H$$shell_path($${LIBRNP_SRC_PATH})

    QMAKE_EXTRA_COMPILERS += librnp_header

    librnp.name = Generating librnp.
    librnp.input = DUMMYQMAKECOMPILERINPUT
    librnp.output = $$clean_path($${LIBRNP_BUILD_PATH}/src/lib/librnp.a)
    librnp.CONFIG += target_predeps combine
    librnp.variable_out = PRE_TARGETDEPS
    librnp.depends = $${librnp_header.output}
    librnp.commands += cd $$shell_path($${LIBRNP_BUILD_PATH}) && $(MAKE) rnp

    QMAKE_EXTRA_COMPILERS += librnp

    libretroshare_shared {
        # libretroshare is used as a shared library. Link the external libraries to libretroshare only.
        LIBS *= $${LIBRNP_LIBS}
    }
}

i has added for macos compile the mac params, its not yet on master

@ni4
Copy link
Contributor

ni4 commented Jan 15, 2025

@defnax could you please provide the cmake invocation for rnp, i.e. with which exact parameters it was called, not just the output?

@defnax
Copy link
Author

defnax commented Jan 15, 2025

i dont know yet need ask other devs too if they put somewhere cmake defines

what i found is this too:
https://github.com/RetroShare/libretroshare/blob/master/src/use_libretroshare.pri

rs_rnplib {
    LIBRNP_SRC_PATH=$$clean_path($${RS_SRC_PATH}/supportlibs/librnp)
    LIBRNP_BUILD_PATH=$$clean_path($${RS_BUILD_PATH}/supportlibs/librnp/Build)
    INCLUDEPATH *= $$clean_path($${LIBRNP_SRC_PATH}/include/)
    INCLUDEPATH *= $$clean_path($${LIBRNP_BUILD_PATH}/src/lib/)
    DEPENDPATH *= $$clean_path($${LIBRNP_BUILD_PATH})
    QMAKE_LIBDIR *= $$clean_path($${LIBRNP_BUILD_PATH}/src/lib/)
#    INCLUDEPATH *= $$clean_path($${LIBRNP_SRC_PATH}/src/lib/)
#    DEPENDPATH *= $$clean_path($${LIBRNP_BUILD_PATH}/include/)
#    QMAKE_LIBDIR *= $$clean_path($${LIBRNP_BUILD_PATH}/)

    LIBRNP_LIBS = -L$$clean_path($${LIBRNP_BUILD_PATH}/src/lib) -lrnp
    LIBRNP_LIBS *= -L$$clean_path($${LIBRNP_BUILD_PATH}/src/libsexpp) -lsexpp
    LIBRNP_LIBS *= -lbz2 -lz -ljson-c

    # botan
    win32-g++|win32-clang-g++:!isEmpty(QMAKE_SH) {
        # Windows msys2
        LIBRNP_LIBS *= -lbotan-3
    } else {
        LIBRNP_LIBS *= -lbotan-2
    }

    win32-g++|win32-clang-g++ {
        # Use librnp as shared library for Windows
        CONFIG += librnp_shared
    }

    !libretroshare_shared {
        # libretroshare is used as a static library. Link the external libraries to the executable.
        LIBS *= $${LIBRNP_LIBS}
    }

	#PRE_TARGETDEPS += $$clean_path($${LIBRNP_BUILD_PATH}/src/lib/librnp.a)

    message("Using librnp. Configuring paths for submodule.")
    message("      LIBRNP_SRC_PATH   = "$${LIBRNP_SRC_PATH})
    message("      LIBRNP_BUILD_PATH = "$${LIBRNP_BUILD_PATH})
    message("      INCLUDEPATH      *= "$$clean_path($${LIBRNP_SRC_PATH}/include/))
    message("      INCLUDEPATH      *= "$$clean_path($${LIBRNP_SRC_PATH}/src/lib/))
}

@defnax
Copy link
Author

defnax commented Jan 15, 2025

i think i posted full cmake function

but i see this here maybe this is what you mean?
https://github.com/RetroShare/libretroshare/blob/650ee8a77ee2f01bc12e234ef194cdbde012a2e8/src/libretroshare.pro#L1194

    librnp_header.commands += cd $$shell_path($${LIBRNP_BUILD_PATH}) && \
        cmake \
        -Wno-dev \
        -DCMAKE_C_COMPILER=$$fixQmakeCC($$QMAKE_CC) \
        -DCMAKE_CXX_COMPILER=$$QMAKE_CXX \
        $${LIBRNP_CMAKE_PARAMS} \
        -DBUILD_TESTING=off \
        -DCMAKE_CXX_FLAGS=\"$${LIBRNP_CMAKE_CXXFLAGS}\" \
        $${CMAKE_GENERATOR_OVERRIDE} \
        -DENABLE_COVERAGE=Off \
        -DCMAKE_INSTALL_PREFIX=. -B. \
        -H$$shell_path($${LIBRNP_SRC_PATH})

    QMAKE_EXTRA_COMPILERS += librnp_header

i has tested with this get exact same bigint issue

    librnp_header.commands += cd $$shell_path($${LIBRNP_BUILD_PATH}) && \
        cmake \
        -Wno-dev \
        -DCMAKE_C_COMPILER=$$fixQmakeCC($$QMAKE_CC) \
        -DCMAKE_CXX_COMPILER=$$QMAKE_CXX \
        $${LIBRNP_CMAKE_PARAMS} \
	-DCRYPTO_BACKEND=botan \
	-DBOTAN_ROOT_DIR=/usr/local/opt/botan@2/ \
	-DBOTAN_INCLUDE_DIR=/usr/local/opt/botan@2/include/botan-2 \
	-DBOTAN_LIBRARY=/usr/local/opt/botan@2/lib/libbotan-2.a \
        -DBUILD_TESTING=off \
        -DCMAKE_CXX_FLAGS=\"$${LIBRNP_CMAKE_CXXFLAGS}\" \
        $${CMAKE_GENERATOR_OVERRIDE} \
        -DENABLE_COVERAGE=Off \
	-DDOWNLOAD_GTEST=Off \
	-DCMAKE_EXPORT_COMPILE_COMMANDS=TRUE \
        -DCMAKE_INSTALL_PREFIX=. -B. \
        -H$$shell_path($${LIBRNP_SRC_PATH})

@ni4
Copy link
Contributor

ni4 commented Jan 16, 2025

@defnax I mean the full command with expanded variable values. Looking at https://github.com/RetroShare/libretroshare/blob/650ee8a77ee2f01bc12e234ef194cdbde012a2e8/src/libretroshare.pro#L1163 it seems that RNP path variables are set only for Windows build, or am I wrong?

@defnax
Copy link
Author

defnax commented Jan 17, 2025

There is nothing for macos set, i created myself the cmake params only

Im not sure if i need set something?

@ni4
Copy link
Contributor

ni4 commented Jan 17, 2025

What if you just run the following command from the $${RS_SRC_PATH}/supportlibs/librnp folder:

/usr/local/bin/cmake -DBUILD_SHARED_LIBS=Off \
  -DCMAKE_BUILD_TYPE=Release \
  -DBUILD_TESTING=Off \
  -DCRYPTO_BACKEND=botan \
  -DBOTAN_ROOT_DIR=/usr/local/opt/botan@2/ \
  -DDOWNLOAD_GTEST=Off \
  -DCMAKE_EXPORT_COMPILE_COMMANDS=TRUE \
  -S./../rnp -B./build -G "Unix Makefiles"

@defnax
Copy link
Author

defnax commented Jan 17, 2025

i need to test it tonight

@defnax
Copy link
Author

defnax commented Jan 17, 2025

thank you it seems it helps little bit i get this now

../../supportlibs/librnp/include/rnp/rnp.h:28:10: fatal error: 'rnp/rnp_export.h' file not found
#include <rnp/rnp_export.h>
	librnp_header.commands += cd $$shell_path($${RS_SRC_PATH}/supportlibs/librnp) && \
        cmake \
	-Wno-dev \
        -DCMAKE_C_COMPILER=$$fixQmakeCC($$QMAKE_CC) \
        -DCMAKE_CXX_COMPILER=$$QMAKE_CXX \
        $${LIBRNP_CMAKE_PARAMS} \
        -DBUILD_TESTING=off \
        -DCMAKE_CXX_FLAGS=\"$${LIBRNP_CMAKE_CXXFLAGS}\" \
        $${CMAKE_GENERATOR_OVERRIDE} \
        -DENABLE_COVERAGE=Off \
	-DDOWNLOAD_GTEST=Off \
	-DCMAKE_EXPORT_COMPILE_COMMANDS=TRUE \
        -DCMAKE_INSTALL_PREFIX=. -B. \
        -H$$shell_path($${LIBRNP_SRC_PATH})

maybe the include path is broken now? when i changed it

Image

@thunder2 ?

@thunder2
Copy link
Contributor

@defnax
Please check if the file rnp_export.h is created in the build directory "supportlibs\librnp\Build\src\lib\rnp\rnp_export.h" after the cmake call.

@defnax
Copy link
Author

defnax commented Jan 18, 2025

@thunder2 no the file rnp_export.h is not created, that folder is empty

@ni4
Copy link
Contributor

ni4 commented Jan 18, 2025

rnp_export.h is generated via the generate_export_header() cmake call, and probably should be somewhere around the install path.

@defnax
Copy link
Author

defnax commented Jan 18, 2025

i has copied manually that file "supportlibs\librnp\src\lib\rnp" to the build dir "supportlibs\librnp\Build\src\lib\rnp\rnp_export.h"
but last error now
make[2]: *** No rule to make target `rnp'. Stop.
make[1]: *** [../../supportlibs/librnp/Build/src/lib/librnp.a] Error 2
make[1]: *** Waiting for unfinished jobs....

@thunder2
Copy link
Contributor

@defnax
Then cmake seems to fail.
Please check the compiler output of the cmake call for errors after

-- RNP_VERSION: 0.17.1

At the end you should see

-- Generating done (0.5s)
-- Build files have been written to: ...

@ni4
The install path is in the shadow build directory under supportlibs/librnp/Build
cmake seems to fail before generate_export_header() on macos

Windows native build, Windows msys2 build and Linux build is fine

@defnax
Copy link
Author

defnax commented Jan 18, 2025

-- RNP_VERSION: 0.17.1
-- RNP_VERSION_NCOMMITS: 0
-- RNP_VERSION_GIT_REV: ec78117
-- RNP_VERSION_IS_DIRTY: TRUE
-- RNP_VERSION_COMMIT_TIMESTAMP: 1735042232
-- RNP_VERSION_SUFFIX: +git20250118.ec78117
-- RNP_VERSION_FULL: 0.17.1+git20250118.ec78117
CMake Warning at cmake/Modules/AdocMan.cmake:51 (message):
  AsciiDoc processor not found, man pages will not be generated.  Install
  asciidoctor or use the CMAKE_PROGRAM_PATH variable.
Call Stack (most recent call first):
  CMakeLists.txt:194 (include)


-- Found version.txt with 0.9.0
-- Found annotated tag v0.9.0-0-gc641a2f
-- SEXPP_VERSION: 0.9.0
-- SEXPP_VERSION_NCOMMITS: 0
-- SEXPP_VERSION_GIT_REV: c641a2f
-- SEXPP_VERSION_IS_DIRTY: FALSE
-- SEXPP_VERSION_COMMIT_TIMESTAMP: 0
-- SEXPP_MAJOR_VERSION: 0
-- SEXPP_VERSION_SUFFIX: 
-- SEXPP_VERSION_FULL: 0.9.0
-- Building STATIC library
-- Building Release configuration
-- Configuring done (0.5s)
-- Generating done (0.2s)
-- Build files have been written to: /Users/user/Documents/GitHub/RetroShare-2/supportlibs/librnp
cd /Users/user/Documents/GitHub/RetroShare-2/supportlibs/librnp/Build && /Volumes/Dateien/Applications/Xcode.app/Contents/Developer/usr/bin/make rnp

@ni4
Copy link
Contributor

ni4 commented Jan 18, 2025

Ah, okay, mislooked - rnp_build.h after cmake configuration on macOS must be in ./src/lib/rnp/rnp_export.h starting from the Build directory.

@defnax
Copy link
Author

defnax commented Jan 18, 2025

why iget now this "rnp" stop error?
it comes from this line?
librnp.commands += cd $$shell_path($${LIBRNP_BUILD_PATH}) && $(MAKE) rnp

@ni4
Copy link
Contributor

ni4 commented Jan 18, 2025

I doubt that you should call $(MAKE) rnp, it should be just $(MAKE) with some flags like -j4. That's how it is done in our CI and local builds at least.

@defnax
Copy link
Author

defnax commented Jan 18, 2025

i now using copied the manually "supportlibs\librnp\Build\src\lib\rnp\rnp_export.h"
But solving issue with rnp not solved yet

	librnp_header.commands += cd $$shell_path($${RS_SRC_PATH}/supportlibs/librnp) && \
	#librnp_header.commands += cd $$shell_path($${LIBRNP_SRC_PATH}) && \
	#librnp_header.commands += cd $$shell_path($${LIBRNP_BUILD_PATH}) && \
        cmake \
		-Wno-dev \
        -DCMAKE_C_COMPILER=$$fixQmakeCC($$QMAKE_CC) \
        -DCMAKE_CXX_COMPILER=$$QMAKE_CXX \
        $${LIBRNP_CMAKE_PARAMS} \
        -DBUILD_TESTING=off \
	-DCRYPTO_BACKEND=botan \
	-DBOTAN_ROOT_DIR=/usr/local/opt/botan@2/ \
        -DCMAKE_CXX_FLAGS=\"$${LIBRNP_CMAKE_CXXFLAGS}\" \
        $${CMAKE_GENERATOR_OVERRIDE} \
        -DENABLE_COVERAGE=Off \
	-DDOWNLOAD_GTEST=Off \
	-DCMAKE_EXPORT_COMPILE_COMMANDS=TRUE \
        -DCMAKE_INSTALL_PREFIX=. -B. \
	-H$$shell_path($${LIBRNP_SRC_PATH}) \

    QMAKE_EXTRA_COMPILERS += librnp_header

    librnp.name = Generating librnp.
    librnp.input = DUMMYQMAKECOMPILERINPUT
    librnp.output = $$clean_path($${LIBRNP_BUILD_PATH}/src/lib/librnp.a)
    librnp.CONFIG += target_predeps combine
    librnp.variable_out = PRE_TARGETDEPS
    librnp.depends = $${librnp_header.output}
    librnp.commands += cd $$shell_path($${LIBRNP_BUILD_PATH}) && $(MAKE) rnp
-- Found no annotated tags.
-- RNP_VERSION: 0.17.1
-- RNP_VERSION_NCOMMITS: 0
-- RNP_VERSION_GIT_REV: ec78117
-- RNP_VERSION_IS_DIRTY: TRUE
-- RNP_VERSION_COMMIT_TIMESTAMP: 1735042232
-- RNP_VERSION_SUFFIX: +git20250118.ec78117
-- RNP_VERSION_FULL: 0.17.1+git20250118.ec78117
CMake Warning at cmake/Modules/AdocMan.cmake:51 (message):
  AsciiDoc processor not found, man pages will not be generated.  Install
  asciidoctor or use the CMAKE_PROGRAM_PATH variable.
Call Stack (most recent call first):
  CMakeLists.txt:194 (include)


-- Found version.txt with 0.9.0
-- Found annotated tag v0.9.0-0-gc641a2f
-- SEXPP_VERSION: 0.9.0
-- SEXPP_VERSION_NCOMMITS: 0
-- SEXPP_VERSION_GIT_REV: c641a2f
-- SEXPP_VERSION_IS_DIRTY: FALSE
-- SEXPP_VERSION_COMMIT_TIMESTAMP: 0
-- SEXPP_MAJOR_VERSION: 0
-- SEXPP_VERSION_SUFFIX: 
-- SEXPP_VERSION_FULL: 0.9.0
-- Building STATIC library
-- Building Release configuration
-- Configuring done (0.5s)
-- Generating done (0.2s)
-- Build files have been written to: /Users/user/Documents/GitHub/RetroShare-2/supportlibs/librnp
cd /Users/user/Documents/GitHub/RetroShare-2/supportlibs/librnp/Build && /Volumes/Dateien/Applications/Xcode.app/Contents/Developer/usr/bin/make rnp
/Volumes/Dateien/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -c -pipe -stdlib=libc++ -Wno-deprecated -Wno-deprecated-declarations -Wno-cpp -Wno-inconsistent-missing-override -O0 -g -fno-omit-frame-pointer -Wall -Wextra -Wno-misleading-indentation -Wno-dangling-else -Wno-nullability-completeness -fPIC -Dfseeko64=fseeko -Dftello64=ftello -Dfopen64=fopen -Dvstatfs64=vstatfs -O2 -fPIC -std=gnu++1y  -arch x86_64 -isysroot /Volumes/Dateien/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk -mmacosx-version-min=11.1 -Wall -Wextra -DV07_NON_BACKWARD_COMPATIBLE_CHANGE_001 -DV07_NON_BACKWARD_COMPATIBLE_CHANGE_002 -DV07_NON_BACKWARD_COMPATIBLE_CHANGE_003 -DRS_MAJOR_VERSION=0 -DRS_MINOR_VERSION=6 -DRS_MINI_VERSION=7 -DRS_EXTRA_VERSION=\"a-203-g50da732c1\" -DRS_USE_GXS_DISTANT_SYNC -DRS_ENABLE_GXS -DRS_GXS_SEND_ALL -DRS_SERVICE_TERMINAL_WEBUI_PASSWORD -DRS_SERVICE_TERMINAL_LOGIN -DRS_AUTOLOGIN -DRS_NO_WARN_DEPRECATED -DRS_NO_WARN_CPP -DRS_GXS_TRANS -DRS_USE_BITDHT -DRS_DIRECT_CHAT -DRS_NATIVEDIALOGS -DRS_BROADCAST_DISCOVERY -DRS_USE_I2P_SAM3 -DRS_I2P_SAM3_BOB_COMPAT -DRS_USE_I2P_SAM3_LIBSAM3 -DUSE_RNP_LIB -DRS_USE_LIBMINIUPNPC -DRS_USE_DHT_STUNNER -DPLUGIN_DIR="\"\"" -DRS_DATA_DIR="\"\"" -DSQLITE_HAS_CODEC -DGXS_ENABLE_SYNC_MSGS -I. -I/usr/local/include -I/usr/local/opt/openssl/include -I/usr/local/opt/libxml2/include/libxml2 -I/usr/local/opt/libxslt/include -I. -I../../libbitdht/src -I../../supportlibs/librnp/include -I../../supportlibs/librnp/Build/src/lib -I../../supportlibs/udp-discovery-cpp -I../../supportlibs/libsam3/src/libsam3 -I. -I../../libbitdht/src -I. -I../../.. -I/usr/local/Qt-5.15.16/mkspecs/macx-clang -o temp/obj/pqissl.o pqi/pqissl.cc
/Volumes/Dateien/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -c -pipe -stdlib=libc++ -Wno-deprecated -Wno-deprecated-declarations -Wno-cpp -Wno-inconsistent-missing-override -O0 -g -fno-omit-frame-pointer -Wall -Wextra -Wno-misleading-indentation -Wno-dangling-else -Wno-nullability-completeness -fPIC -Dfseeko64=fseeko -Dftello64=ftello -Dfopen64=fopen -Dvstatfs64=vstatfs -O2 -fPIC -std=gnu++1y  -arch x86_64 -isysroot /Volumes/Dateien/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk -mmacosx-version-min=11.1 -Wall -Wextra -DV07_NON_BACKWARD_COMPATIBLE_CHANGE_001 -DV07_NON_BACKWARD_COMPATIBLE_CHANGE_002 -DV07_NON_BACKWARD_COMPATIBLE_CHANGE_003 -DRS_MAJOR_VERSION=0 -DRS_MINOR_VERSION=6 -DRS_MINI_VERSION=7 -DRS_EXTRA_VERSION=\"a-203-g50da732c1\" -DRS_USE_GXS_DISTANT_SYNC -DRS_ENABLE_GXS -DRS_GXS_SEND_ALL -DRS_SERVICE_TERMINAL_WEBUI_PASSWORD -DRS_SERVICE_TERMINAL_LOGIN -DRS_AUTOLOGIN -DRS_NO_WARN_DEPRECATED -DRS_NO_WARN_CPP -DRS_GXS_TRANS -DRS_USE_BITDHT -DRS_DIRECT_CHAT -DRS_NATIVEDIALOGS -DRS_BROADCAST_DISCOVERY -DRS_USE_I2P_SAM3 -DRS_I2P_SAM3_BOB_COMPAT -DRS_USE_I2P_SAM3_LIBSAM3 -DUSE_RNP_LIB -DRS_USE_LIBMINIUPNPC -DRS_USE_DHT_STUNNER -DPLUGIN_DIR="\"\"" -DRS_DATA_DIR="\"\"" -DSQLITE_HAS_CODEC -DGXS_ENABLE_SYNC_MSGS -I. -I/usr/local/include -I/usr/local/opt/openssl/include -I/usr/local/opt/libxml2/include/libxml2 -I/usr/local/opt/libxslt/include -I. -I../../libbitdht/src -I../../supportlibs/librnp/include -I../../supportlibs/librnp/Build/src/lib -I../../supportlibs/udp-discovery-cpp -I../../supportlibs/libsam3/src/libsam3 -I. -I../../libbitdht/src -I. -I../../.. -I/usr/local/Qt-5.15.16/mkspecs/macx-clang -o temp/obj/pqissllistener.o pqi/pqissllistener.cc
/Volumes/Dateien/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -c -pipe -stdlib=libc++ -Wno-deprecated -Wno-deprecated-declarations -Wno-cpp -Wno-inconsistent-missing-override -O0 -g -fno-omit-frame-pointer -Wall -Wextra -Wno-misleading-indentation -Wno-dangling-else -Wno-nullability-completeness -fPIC -Dfseeko64=fseeko -Dftello64=ftello -Dfopen64=fopen -Dvstatfs64=vstatfs -O2 -fPIC -std=gnu++1y  -arch x86_64 -isysroot /Volumes/Dateien/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk -mmacosx-version-min=11.1 -Wall -Wextra -DV07_NON_BACKWARD_COMPATIBLE_CHANGE_001 -DV07_NON_BACKWARD_COMPATIBLE_CHANGE_002 -DV07_NON_BACKWARD_COMPATIBLE_CHANGE_003 -DRS_MAJOR_VERSION=0 -DRS_MINOR_VERSION=6 -DRS_MINI_VERSION=7 -DRS_EXTRA_VERSION=\"a-203-g50da732c1\" -DRS_USE_GXS_DISTANT_SYNC -DRS_ENABLE_GXS -DRS_GXS_SEND_ALL -DRS_SERVICE_TERMINAL_WEBUI_PASSWORD -DRS_SERVICE_TERMINAL_LOGIN -DRS_AUTOLOGIN -DRS_NO_WARN_DEPRECATED -DRS_NO_WARN_CPP -DRS_GXS_TRANS -DRS_USE_BITDHT -DRS_DIRECT_CHAT -DRS_NATIVEDIALOGS -DRS_BROADCAST_DISCOVERY -DRS_USE_I2P_SAM3 -DRS_I2P_SAM3_BOB_COMPAT -DRS_USE_I2P_SAM3_LIBSAM3 -DUSE_RNP_LIB -DRS_USE_LIBMINIUPNPC -DRS_USE_DHT_STUNNER -DPLUGIN_DIR="\"\"" -DRS_DATA_DIR="\"\"" -DSQLITE_HAS_CODEC -DGXS_ENABLE_SYNC_MSGS -I. -I/usr/local/include -I/usr/local/opt/openssl/include -I/usr/local/opt/libxml2/include/libxml2 -I/usr/local/opt/libxslt/include -I. -I../../libbitdht/src -I../../supportlibs/librnp/include -I../../supportlibs/librnp/Build/src/lib -I../../supportlibs/udp-discovery-cpp -I../../supportlibs/libsam3/src/libsam3 -I. -I../../libbitdht/src -I. -I../../.. -I/usr/local/Qt-5.15.16/mkspecs/macx-clang -o temp/obj/pqistreamer.o pqi/pqistreamer.cc
make[2]: *** No rule to make target `rnp'.  Stop.
make[1]: *** [../../supportlibs/librnp/Build/src/lib/librnp.a] Error 2
make[1]: *** Waiting for unfinished jobs....

@thunder2
Copy link
Contributor

You changed the copy directory where cmake is called?

librnp_header.commands += cd $$shell_path($${RS_SRC_PATH}/supportlibs/librnp) && \

It should be

librnp_header.commands += cd $$shell_path($${LIBRNP_BUILD_PATH}) && \

because the install path is set to ..

-DCMAKE_INSTALL_PREFIX=.


    librnp_header.commands += cd $$shell_path($${LIBRNP_BUILD_PATH}) && \
        cmake \
        -Wno-dev \
        -DCMAKE_C_COMPILER=$$fixQmakeCC($$QMAKE_CC) \
        -DCMAKE_CXX_COMPILER=$$QMAKE_CXX \
        $${LIBRNP_CMAKE_PARAMS} \
        -DBUILD_TESTING=off \
        -DCMAKE_CXX_FLAGS=\"$${LIBRNP_CMAKE_CXXFLAGS}\" \
        $${CMAKE_GENERATOR_OVERRIDE} \
        -DENABLE_COVERAGE=Off \
        -DCMAKE_INSTALL_PREFIX=. -B. \
        -H$$shell_path($${LIBRNP_SRC_PATH})

Therefore the file rnp_export.h is created in the wrong directory.

@defnax
Copy link
Author

defnax commented Jan 18, 2025

i copied manually the rnp_export.h to solve issue with this include file

when i set back :

`	librnp_header.commands += cd $$shell_path($${LIBRNP_BUILD_PATH}) && \
        cmake \
	-Wno-dev \
        -DCMAKE_C_COMPILER=$$fixQmakeCC($$QMAKE_CC) \
        -DCMAKE_CXX_COMPILER=$$QMAKE_CXX \
        $${LIBRNP_CMAKE_PARAMS} \
        -DBUILD_TESTING=off \
        -DCMAKE_CXX_FLAGS=\"$${LIBRNP_CMAKE_CXXFLAGS}\" \
        $${CMAKE_GENERATOR_OVERRIDE} \
        -DENABLE_COVERAGE=Off \
        -DCMAKE_INSTALL_PREFIX=. -B. \
	-H$$shell_path($${LIBRNP_SRC_PATH})

get stuck here with big int and configuration stopped

-- Found no annotated tags.
-- RNP_VERSION: 0.17.1
-- RNP_VERSION_NCOMMITS: 0
-- RNP_VERSION_GIT_REV: ec78117
-- RNP_VERSION_IS_DIRTY: TRUE
-- RNP_VERSION_COMMIT_TIMESTAMP: 1735042232
-- RNP_VERSION_SUFFIX: +git20250118.ec78117
-- RNP_VERSION_FULL: 0.17.1+git20250118.ec78117
CMake Warning at cmake/Modules/AdocMan.cmake:51 (message):
  AsciiDoc processor not found, man pages will not be generated.  Install
  asciidoctor or use the CMAKE_PROGRAM_PATH variable.
Call Stack (most recent call first):
  CMakeLists.txt:194 (include)


-- Found version.txt with 0.9.0
-- Found annotated tag v0.9.0-0-gc641a2f
-- SEXPP_VERSION: 0.9.0
-- SEXPP_VERSION_NCOMMITS: 0
-- SEXPP_VERSION_GIT_REV: c641a2f
-- SEXPP_VERSION_IS_DIRTY: FALSE
-- SEXPP_VERSION_COMMIT_TIMESTAMP: 0
-- SEXPP_MAJOR_VERSION: 0
-- SEXPP_VERSION_SUFFIX: 
-- SEXPP_VERSION_FULL: 0.9.0
-- Building STATIC library
-- Building Release configuration
CMake Error at src/lib/CMakeLists.txt:178 (message):
  A required botan feature is missing: BIGINT


-- Configuring incomplete, errors occurred!
make[1]: *** [../../supportlibs/librnp/Build/src/lib/rnp/rnp_export.h] Error 1
make: *** [sub-libretroshare-src-libretroshare-pro-make_first] Error 2
20:34:46: The process "/usr/bin/make" exited with code 2.

i dont what i need to change to not get stuck at big int issue

@ni4
Copy link
Contributor

ni4 commented Jan 19, 2025

@defnax

  • Does botan headers are actually available at the /usr/local/opt/botan@2/include/botan-2/botan, including build.h?
  • Does it contain BOTAN_HAS_BIGINT define?
  • Which exact command is run for CMake, with all of the variables substituted, i.e. like in my example at compile issue with rnp and retroshare on macos #2307 (comment)?

@defnax
Copy link
Author

defnax commented Jan 19, 2025

@defnax

  • Does botan headers are actually available at the /usr/local/opt/botan@2/include/botan-2/botan, including build.h?

yes its there

  • Does it contain BOTAN_HAS_BIGINT define?
    yes

Image

i use this

macx-* {
		# bzip2
		LIBRNP_CMAKE_PARAMS *= "-DBZIP2_INCLUDE_DIR=$$clean_path(/usr/local/opt/bzip2/include)"
		LIBRNP_CMAKE_PARAMS *= "-DBZIP2_LIBRARY_RELEASE=$$clean_path(/usr/local/opt/bzip2/lib/libbz2.a)"
		# zlib
		LIBRNP_CMAKE_PARAMS *= "-DZLIB_INCLUDE_DIR=$$clean_path(/usr/local/opt/zlib/include)"
		LIBRNP_CMAKE_PARAMS *= "-DZLIB_LIBRARY=$$clean_path(/usr/local/opt/zlib/lib/libz.a)"
		# json-c
		LIBRNP_CMAKE_PARAMS *= "-DJSON-C_INCLUDE_DIR=$$clean_path(/usr/local/opt/json-c/include/json-c)"
		LIBRNP_CMAKE_PARAMS *= "-DJSON-C_LIBRARY=$$clean_path(/usr/local/opt/json-c/lib/libjson-c.a)"
		LIBRNP_CMAKE_PARAMS *= "-DJSON-C_VERSION=0.18"
		# botan
		#LIBRNP_CMAKE_PARAMS *= "-DBOTAN_ROOT_DIR=$$clean_path(/usr/local/opt/botan@2)"
		LIBRNP_CMAKE_PARAMS *= "-DBOTAN_INCLUDE_DIR=$$clean_path(/usr/local/opt/botan@2/include/botan-2)"
		LIBRNP_CMAKE_PARAMS *= "-DBOTAN_LIBRARY=$$clean_path(/usr/local/opt/botan@2/lib/libbotan-2.a)"
	}
	librnp_header.commands += cd $$shell_path($${LIBRNP_BUILD_PATH}) && \
		cmake \
		-Wno-dev \
		-DCMAKE_C_COMPILER=$$fixQmakeCC($$QMAKE_CC) \
		-DCMAKE_CXX_COMPILER=$$QMAKE_CXX \
		-DCRYPTO_BACKEND=botan \
		-DBOTAN_ROOT_DIR=/usr/local/opt/botan@2/ \
		$${LIBRNP_CMAKE_PARAMS} \
		-DBUILD_TESTING=off \
		-DCMAKE_CXX_FLAGS=\"$${LIBRNP_CMAKE_CXXFLAGS}\" \
		$${CMAKE_GENERATOR_OVERRIDE} \
		-DENABLE_COVERAGE=Off \
		-DCMAKE_INSTALL_PREFIX=. -B. \
		-H$$shell_path($${LIBRNP_SRC_PATH})

but when i use RS_SRC_PATH, cmake conifiguration is done without errors as i posted last day
librnp_header.commands += cd $$shell_path($${RS_SRC_PATH}/supportlibs/librnp) && \
#2307 (comment)

@defnax
Copy link
Author

defnax commented Jan 20, 2025

after delete seems it worked:

librnp % cmake -DBUILD_SHARED_LIBS=Off \
  -DCMAKE_BUILD_TYPE=Release \
  -DBUILD_TESTING=Off \
  -DCRYPTO_BACKEND=botan \
  -DBOTAN_ROOT_DIR=/usr/local/opt/botan@2/ \
  -DDOWNLOAD_GTEST=Off \
  -DCMAKE_EXPORT_COMPILE_COMMANDS=TRUE \
  -S./../librnp -B./build -G "Unix Makefiles"
-- Found version.txt with 0.17.1
-- Found Git: /usr/bin/git (found version "2.24.3 (Apple Git-128)")
-- Found no annotated tags.
-- RNP_VERSION: 0.17.1
-- RNP_VERSION_NCOMMITS: 0
-- RNP_VERSION_GIT_REV: ec78117
-- RNP_VERSION_IS_DIRTY: TRUE
-- RNP_VERSION_COMMIT_TIMESTAMP: 1735042232
-- RNP_VERSION_SUFFIX: +git20250120.ec78117
-- RNP_VERSION_FULL: 0.17.1+git20250120.ec78117
-- The C compiler identification is AppleClang 12.0.0.12000032
-- The CXX compiler identification is AppleClang 12.0.0.12000032
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /Volumes/Dateien/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc - 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: /Volumes/Dateien/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
CMake Warning at cmake/Modules/AdocMan.cmake:51 (message):
  AsciiDoc processor not found, man pages will not be generated.  Install
  asciidoctor or use the CMAKE_PROGRAM_PATH variable.
Call Stack (most recent call first):
  CMakeLists.txt:194 (include)


-- Found version.txt with 0.9.0
-- Found annotated tag v0.9.0-0-gc641a2f
-- SEXPP_VERSION: 0.9.0
-- SEXPP_VERSION_NCOMMITS: 0
-- SEXPP_VERSION_GIT_REV: c641a2f
-- SEXPP_VERSION_IS_DIRTY: FALSE
-- SEXPP_VERSION_COMMIT_TIMESTAMP: 0
-- SEXPP_MAJOR_VERSION: 0
-- SEXPP_VERSION_SUFFIX: 
-- SEXPP_VERSION_FULL: 0.9.0
-- Building STATIC library
-- Building Release configuration
-- Found BZip2: /Volumes/Dateien/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk/usr/lib/libbz2.tbd (found version "1.0.6")
-- Looking for BZ2_bzCompressInit
-- Looking for BZ2_bzCompressInit - found
-- Found ZLIB: /Volumes/Dateien/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk/usr/lib/libz.tbd (found version "1.2.11")
-- Found JSON-C: /usr/local/Cellar/json-c/0.18/lib/libjson-c.dylib (found suitable version "0.18", minimum required is "0.11")
-- Found Botan: /usr/local/opt/botan@2/lib/libbotan-2.dylib (found suitable version "2.19.5", minimum required is "2.14.0")
-- Looking for C++ include fcntl.h
-- Looking for C++ include fcntl.h - found
-- Looking for C++ include inttypes.h
-- Looking for C++ include inttypes.h - found
-- Looking for C++ include limits.h
-- Looking for C++ include limits.h - found
-- Looking for C++ include stdint.h
-- Looking for C++ include stdint.h - found
-- Looking for C++ include string.h
-- Looking for C++ include string.h - found
-- Looking for C++ include sys/cdefs.h
-- Looking for C++ include sys/cdefs.h - found
-- Looking for C++ include sys/cdefs.h
-- Looking for C++ include sys/cdefs.h - found
-- Looking for C++ include sys/resource.h
-- Looking for C++ include sys/resource.h - found
-- Looking for C++ include sys/stat.h
-- Looking for C++ include sys/stat.h - found
-- Looking for C++ include sys/types.h
-- Looking for C++ include sys/types.h - found
-- Looking for C++ include sys/param.h
-- Looking for C++ include sys/param.h - found
-- Looking for C++ include unistd.h
-- Looking for C++ include unistd.h - found
-- Looking for C++ include sys/wait.h
-- Looking for C++ include sys/wait.h - found
-- Looking for mkdtemp
-- Looking for mkdtemp - found
-- Looking for mkstemp
-- Looking for mkstemp - found
-- Looking for realpath
-- Looking for realpath - found
-- Looking for O_BINARY
-- Looking for O_BINARY - not found
-- Looking for _O_BINARY
-- Looking for _O_BINARY - not found
-- Looking for _tempnam
-- Looking for _tempnam - not found
-- Looking for BOTAN_HAS_BIGINT
-- Looking for BOTAN_HAS_BIGINT - found
-- Looking for BOTAN_HAS_FFI
-- Looking for BOTAN_HAS_FFI - found
-- Looking for BOTAN_HAS_HEX_CODEC
-- Looking for BOTAN_HAS_HEX_CODEC - found
-- Looking for BOTAN_HAS_PGP_S2K
-- Looking for BOTAN_HAS_PGP_S2K - found
-- Looking for BOTAN_HAS_BLOCK_CIPHER
-- Looking for BOTAN_HAS_BLOCK_CIPHER - found
-- Looking for BOTAN_HAS_AES
-- Looking for BOTAN_HAS_AES - found
-- Looking for BOTAN_HAS_CAMELLIA
-- Looking for BOTAN_HAS_CAMELLIA - found
-- Looking for BOTAN_HAS_DES
-- Looking for BOTAN_HAS_DES - found
-- Looking for BOTAN_HAS_MODE_CBC
-- Looking for BOTAN_HAS_MODE_CBC - found
-- Looking for BOTAN_HAS_MODE_CFB
-- Looking for BOTAN_HAS_MODE_CFB - found
-- Looking for BOTAN_HAS_AUTO_RNG
-- Looking for BOTAN_HAS_AUTO_RNG - found
-- Looking for BOTAN_HAS_AUTO_SEEDING_RNG
-- Looking for BOTAN_HAS_AUTO_SEEDING_RNG - found
-- Looking for BOTAN_HAS_HMAC
-- Looking for BOTAN_HAS_HMAC - found
-- Looking for BOTAN_HAS_HMAC_DRBG
-- Looking for BOTAN_HAS_HMAC_DRBG - found
-- Looking for BOTAN_HAS_CRC24
-- Looking for BOTAN_HAS_CRC24 - found
-- Looking for BOTAN_HAS_HASH
-- Looking for BOTAN_HAS_HASH - found
-- Looking for BOTAN_HAS_MD5
-- Looking for BOTAN_HAS_MD5 - found
-- Looking for BOTAN_HAS_SHA1
-- Looking for BOTAN_HAS_SHA1 - found
-- Looking for BOTAN_HAS_SHA2_32
-- Looking for BOTAN_HAS_SHA2_32 - found
-- Looking for BOTAN_HAS_SHA2_64
-- Looking for BOTAN_HAS_SHA2_64 - found
-- Looking for BOTAN_HAS_SHA3
-- Looking for BOTAN_HAS_SHA3 - found
-- Looking for BOTAN_HAS_DL_GROUP
-- Looking for BOTAN_HAS_DL_GROUP - found
-- Looking for BOTAN_HAS_ECC_GROUP
-- Looking for BOTAN_HAS_ECC_GROUP - found
-- Looking for BOTAN_HAS_ECC_PUBLIC_KEY_CRYPTO
-- Looking for BOTAN_HAS_ECC_PUBLIC_KEY_CRYPTO - found
-- Looking for BOTAN_HAS_PUBLIC_KEY_CRYPTO
-- Looking for BOTAN_HAS_PUBLIC_KEY_CRYPTO - found
-- Looking for BOTAN_HAS_CURVE_25519
-- Looking for BOTAN_HAS_CURVE_25519 - found
-- Looking for BOTAN_HAS_DSA
-- Looking for BOTAN_HAS_DSA - found
-- Looking for BOTAN_HAS_ECDH
-- Looking for BOTAN_HAS_ECDH - found
-- Looking for BOTAN_HAS_ECDSA
-- Looking for BOTAN_HAS_ECDSA - found
-- Looking for BOTAN_HAS_ED25519
-- Looking for BOTAN_HAS_ED25519 - found
-- Looking for BOTAN_HAS_ELGAMAL
-- Looking for BOTAN_HAS_ELGAMAL - found
-- Looking for BOTAN_HAS_RSA
-- Looking for BOTAN_HAS_RSA - found
-- Looking for BOTAN_HAS_EME_PKCS1v15
-- Looking for BOTAN_HAS_EME_PKCS1v15 - found
-- Looking for BOTAN_HAS_EMSA_PKCS1
-- Looking for BOTAN_HAS_EMSA_PKCS1 - found
-- Looking for BOTAN_HAS_EMSA_RAW
-- Looking for BOTAN_HAS_EMSA_RAW - found
-- Looking for BOTAN_HAS_KDF_BASE
-- Looking for BOTAN_HAS_KDF_BASE - found
-- Looking for BOTAN_HAS_RFC3394_KEYWRAP
-- Looking for BOTAN_HAS_RFC3394_KEYWRAP - found
-- Looking for BOTAN_HAS_SP800_56A
-- Looking for BOTAN_HAS_SP800_56A - found
-- Looking for BOTAN_HAS_DL_PUBLIC_KEY_FAMILY
-- Looking for BOTAN_HAS_DL_PUBLIC_KEY_FAMILY - found
-- Looking for BOTAN_HAS_SM2
-- Looking for BOTAN_HAS_SM2 - found
-- Looking for BOTAN_HAS_SM3
-- Looking for BOTAN_HAS_SM3 - found
-- Looking for BOTAN_HAS_SM4
-- Looking for BOTAN_HAS_SM4 - found
-- Looking for BOTAN_HAS_AEAD_EAX
-- Looking for BOTAN_HAS_AEAD_EAX - found
-- Looking for BOTAN_HAS_AEAD_OCB
-- Looking for BOTAN_HAS_AEAD_OCB - found
-- Looking for BOTAN_HAS_TWOFISH
-- Looking for BOTAN_HAS_TWOFISH - found
-- Looking for BOTAN_HAS_IDEA
-- Looking for BOTAN_HAS_IDEA - found
-- Looking for BOTAN_HAS_BLOWFISH
-- Looking for BOTAN_HAS_BLOWFISH - found
-- Looking for BOTAN_HAS_CAST_128
-- Looking for BOTAN_HAS_CAST_128 - found
-- Looking for BOTAN_HAS_RIPEMD_160
-- Looking for BOTAN_HAS_RIPEMD_160 - found
-- Performing Test COMPILER_HAS_HIDDEN_VISIBILITY
-- Performing Test COMPILER_HAS_HIDDEN_VISIBILITY - Success
-- Performing Test COMPILER_HAS_HIDDEN_INLINE_VISIBILITY
-- Performing Test COMPILER_HAS_HIDDEN_INLINE_VISIBILITY - Success
-- Performing Test COMPILER_HAS_DEPRECATED_ATTR
-- Performing Test COMPILER_HAS_DEPRECATED_ATTR - Success
-- Found PkgConfig: /usr/local/bin/pkg-config (found version "2.3.0")
-- Configuring done (49.5s)
-- Generating done (0.3s)
-- Build files have been written to: /users/user/Documents/GitHub/RetroShare-2/supportlibs/librnp/build

@defnax
Copy link
Author

defnax commented Jan 20, 2025

but when i did make get this error

def@iMac librnp % make
-- Found version.txt with 0.17.1
-- Found no annotated tags.
-- RNP_VERSION: 0.17.1
-- RNP_VERSION_NCOMMITS: 0
-- RNP_VERSION_GIT_REV: ec78117
-- RNP_VERSION_IS_DIRTY: TRUE
-- RNP_VERSION_COMMIT_TIMESTAMP: 1735042232
-- RNP_VERSION_SUFFIX: +git20250120.ec78117
-- RNP_VERSION_FULL: 0.17.1+git20250120.ec78117
CMake Warning at cmake/Modules/AdocMan.cmake:51 (message):
  AsciiDoc processor not found, man pages will not be generated.  Install
  asciidoctor or use the CMAKE_PROGRAM_PATH variable.
Call Stack (most recent call first):
  CMakeLists.txt:194 (include)

-- Found version.txt with 0.9.0
-- Found annotated tag v0.9.0-0-gc641a2f
-- SEXPP_VERSION: 0.9.0
-- SEXPP_VERSION_NCOMMITS: 0
-- SEXPP_VERSION_GIT_REV: c641a2f
-- SEXPP_VERSION_IS_DIRTY: FALSE
-- SEXPP_VERSION_COMMIT_TIMESTAMP: 0
-- SEXPP_MAJOR_VERSION: 0
-- SEXPP_VERSION_SUFFIX: 
-- SEXPP_VERSION_FULL: 0.9.0
-- Building STATIC library
-- Building Release configuration
-- Configuring done (0.5s)
-- Generating done (0.2s)
-- Build files have been written to: /users/user/Documents/GitHub/RetroShare-2/supportlibs/librnp
[  1%] Building CXX object src/libsexpp/CMakeFiles/sexpp.dir/src/sexp-input.cpp.o
[  2%] Building CXX object src/libsexpp/CMakeFiles/sexpp.dir/src/sexp-output.cpp.o
[  3%] Building CXX object src/libsexpp/CMakeFiles/sexpp.dir/src/sexp-object.cpp.o
[  4%] Building CXX object src/libsexpp/CMakeFiles/sexpp.dir/src/sexp-simple-string.cpp.o
[  5%] Building CXX object src/libsexpp/CMakeFiles/sexpp.dir/src/sexp-char-defs.cpp.o
[  6%] Building CXX object src/libsexpp/CMakeFiles/sexpp.dir/src/sexp-error.cpp.o
[  8%] Building CXX object src/libsexpp/CMakeFiles/sexpp.dir/src/sexp-depth-manager.cpp.o
[  9%] Building CXX object src/libsexpp/CMakeFiles/sexpp.dir/src/ext-key-format.cpp.o
[ 10%] Linking CXX static library libsexpp.a
[ 10%] Built target sexpp
[ 11%] Building CXX object src/lib/CMakeFiles/librnp-obj.dir/__/librepgp/stream-armor.cpp.o
[ 12%] Building CXX object src/lib/CMakeFiles/librnp-obj.dir/__/librepgp/stream-common.cpp.o
[ 13%] Building CXX object src/lib/CMakeFiles/librnp-obj.dir/__/librepgp/stream-ctx.cpp.o
[ 14%] Building CXX object src/lib/CMakeFiles/librnp-obj.dir/__/librepgp/stream-dump.cpp.o
[ 16%] Building CXX object src/lib/CMakeFiles/librnp-obj.dir/__/librepgp/stream-key.cpp.o
/users/user/Documents/GitHub/RetroShare-2/supportlibs/librnp/src/librepgp/stream-key.cpp:421:13: error: 
      use of undeclared identifier 'assert'
            assert(hash->size() == sizeof(hval));
            ^
/users/user/Documents/GitHub/RetroShare-2/supportlibs/librnp/src/librepgp/stream-key.cpp:575:5: error: 
      use of undeclared identifier 'assert'
    assert(sizeof(hval) == hash->size());
    ^
2 errors generated.
make[2]: *** [src/lib/CMakeFiles/librnp-obj.dir/__/librepgp/stream-key.cpp.o] Error 1
make[1]: *** [src/lib/CMakeFiles/librnp-obj.dir/all] Error 2

@ni4
Copy link
Contributor

ni4 commented Jan 20, 2025

@defnax Glad that it worked, CMake cache is a misterious thing so it should be definitely cleaned sometimes.

P.S. That's strange again, as up-to-date version of stream-key.cpp has #include <cassert>.

@defnax
Copy link
Author

defnax commented Jan 20, 2025

its up to date, but maybe xcode issue? im using xcode 12 on Catalina

Image

in qt creator i get a error display:
stream-key.cpp:52:10: error: 'cassert' file not found

i need this include file maybe i can fix it manually
can i define include dir for cmake? the asser file is there
-I/Library/Developer/CommandLineTools/SDKs/MacOSX11.1.sdk/usr/include \

i tried to add to cmakelist.txt i get more errors with that:
include_directories(/Library/Developer/CommandLineTools/SDKs/MacOSX11.1.sdk/usr/include)

Image
or i need to include this dir?

/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include

@ni4
Copy link
Contributor

ni4 commented Jan 21, 2025

@defnax In our builds we do not specify include path for c++ headers as CMake is able to detect those automatically. In my case it uses the following command to build:

/usr/local/opt/llvm@14/bin/clang++ -DSOURCE_PATH_SIZE=27 -D_GNU_SOURCE -I/Users/user/rnp/src -I/Users/user/rnp/src/lib -I/Users/user/rnp-build/src/lib -I/Users/user/rnp/src/common -I/Users/user/rnp/include -isystem /usr/local/Cellar/json-c/0.17/include/json-c -isystem /usr/local/Cellar/json-c/0.17/include -g3 -O0 -Wsign-compare -Wno-error=sign-compare -fmacro-backtrace-limit=0 -g -std=c++11 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.0.sdk -Wall -Wextra -Wunreachable-code -Wpointer-arith -Wmissing-declarations -Wno-pedantic -Wno-ignored-qualifiers -Wno-unused-parameter -Wno-missing-field-initializers -o CMakeFiles/rnp.dir/__/lib/logging.cpp.o -c /Users/user/rnp/src/lib/logging.cpp

I.e. this should define path to the headers: -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.0.sdk

@ni4
Copy link
Contributor

ni4 commented Jan 21, 2025

...and actual cassert header is available at the path/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.0.sdk/usr/include/c++/v1/cassert

@defnax
Copy link
Author

defnax commented Jan 21, 2025

im not sure why my cmake does not find the c++ headers, here on my xcode sdk 11.1 there is the include here:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1
/Library/Developer/CommandLineTools/usr/include/c++/v1

its not here or they moved in newer version
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include

@ni4
Copy link
Contributor

ni4 commented Jan 22, 2025

@defnax As far as I remember at some macOS version they moved headers from your location to one I have, so this should not be an issue. Could you check compile_commands.json from the build folder for the exact compile commands? This could be also checked by calling make VERBOSE=1.

@defnax
Copy link
Author

defnax commented Jan 22, 2025

hi here:

librnp % make VERBOSE=1
/usr/local/bin/cmake -S/users/defnax/Documents/GitHub/RetroShare-2/supportlibs/librnp -B/users/defnax/Documents/GitHub/RetroShare-2/supportlibs/librnp --check-build-system CMakeFiles/Makefile.cmake 0
/usr/local/bin/cmake -E cmake_progress_start /users/defnax/Documents/GitHub/RetroShare-2/supportlibs/librnp/CMakeFiles /users/defnax/Documents/GitHub/RetroShare-2/supportlibs/librnp//CMakeFiles/progress.marks
/Volumes/Dateien/Applications/Xcode.app/Contents/Developer/usr/bin/make  -f CMakeFiles/Makefile2 all
/Volumes/Dateien/Applications/Xcode.app/Contents/Developer/usr/bin/make  -f src/libsexpp/CMakeFiles/sexpp.dir/build.make src/libsexpp/CMakeFiles/sexpp.dir/depend
cd /users/defnax/Documents/GitHub/RetroShare-2/supportlibs/librnp && /usr/local/bin/cmake -E cmake_depends "Unix Makefiles" /users/defnax/Documents/GitHub/RetroShare-2/supportlibs/librnp /users/defnax/Documents/GitHub/RetroShare-2/supportlibs/librnp/src/libsexpp /users/defnax/Documents/GitHub/RetroShare-2/supportlibs/librnp /users/defnax/Documents/GitHub/RetroShare-2/supportlibs/librnp/src/libsexpp /users/defnax/Documents/GitHub/RetroShare-2/supportlibs/librnp/src/libsexpp/CMakeFiles/sexpp.dir/DependInfo.cmake "--color="
/Volumes/Dateien/Applications/Xcode.app/Contents/Developer/usr/bin/make  -f src/libsexpp/CMakeFiles/sexpp.dir/build.make src/libsexpp/CMakeFiles/sexpp.dir/build
make[2]: Nothing to be done for `src/libsexpp/CMakeFiles/sexpp.dir/build'.
[ 10%] Built target sexpp
/Volumes/Dateien/Applications/Xcode.app/Contents/Developer/usr/bin/make  -f src/lib/CMakeFiles/librnp-obj.dir/build.make src/lib/CMakeFiles/librnp-obj.dir/depend
cd /users/defnax/Documents/GitHub/RetroShare-2/supportlibs/librnp && /usr/local/bin/cmake -E cmake_depends "Unix Makefiles" /users/defnax/Documents/GitHub/RetroShare-2/supportlibs/librnp /users/defnax/Documents/GitHub/RetroShare-2/supportlibs/librnp/src/lib /users/defnax/Documents/GitHub/RetroShare-2/supportlibs/librnp /users/defnax/Documents/GitHub/RetroShare-2/supportlibs/librnp/src/lib /users/defnax/Documents/GitHub/RetroShare-2/supportlibs/librnp/src/lib/CMakeFiles/librnp-obj.dir/DependInfo.cmake "--color="
Dependencies file "src/lib/CMakeFiles/librnp-obj.dir/__/librepgp/stream-armor.cpp.o.d" is newer than depends file "/users/defnax/Documents/GitHub/RetroShare-2/supportlibs/librnp/src/lib/CMakeFiles/librnp-obj.dir/compiler_depend.internal".
Dependencies file "src/lib/CMakeFiles/librnp-obj.dir/__/librepgp/stream-common.cpp.o.d" is newer than depends file "/users/defnax/Documents/GitHub/RetroShare-2/supportlibs/librnp/src/lib/CMakeFiles/librnp-obj.dir/compiler_depend.internal".
Dependencies file "src/lib/CMakeFiles/librnp-obj.dir/__/librepgp/stream-ctx.cpp.o.d" is newer than depends file "/users/defnax/Documents/GitHub/RetroShare-2/supportlibs/librnp/src/lib/CMakeFiles/librnp-obj.dir/compiler_depend.internal".
Dependencies file "src/lib/CMakeFiles/librnp-obj.dir/__/librepgp/stream-dump.cpp.o.d" is newer than depends file "/users/defnax/Documents/GitHub/RetroShare-2/supportlibs/librnp/src/lib/CMakeFiles/librnp-obj.dir/compiler_depend.internal".
Dependencies file "src/lib/CMakeFiles/librnp-obj.dir/__/librepgp/stream-key.cpp.o.d" is newer than depends file "/users/defnax/Documents/GitHub/RetroShare-2/supportlibs/librnp/src/lib/CMakeFiles/librnp-obj.dir/compiler_depend.internal".
Consolidate compiler generated dependencies of target librnp-obj
/Volumes/Dateien/Applications/Xcode.app/Contents/Developer/usr/bin/make  -f src/lib/CMakeFiles/librnp-obj.dir/build.make src/lib/CMakeFiles/librnp-obj.dir/build
[ 11%] Building CXX object src/lib/CMakeFiles/librnp-obj.dir/__/librepgp/stream-key.cpp.o
cd /users/defnax/Documents/GitHub/RetroShare-2/supportlibs/librnp/src/lib && /Volumes/Dateien/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -DRNP_STATIC -D_GNU_SOURCE -I/Library/Developer/CommandLineTools/usr/include -I/users/defnax/Documents/GitHub/RetroShare-2/supportlibs/librnp/src/lib -I/users/defnax/Documents/GitHub/RetroShare-2/supportlibs/librnp/src/common -I/users/defnax/Documents/GitHub/RetroShare-2/supportlibs/librnp/include -I/users/defnax/Documents/GitHub/RetroShare-2/supportlibs/librnp/src -I/users/defnax/Documents/GitHub/RetroShare-2/supportlibs/librnp/src/libsexpp/include -isystem /usr/local/opt/json-c/include/json-c -isystem /usr/local/Cellar/json-c/0.18/include -isystem /usr/local/Cellar/json-c/0.18/include/json-c -isystem /usr/local/opt/botan@2/include/botan-2 -isystem /usr/local/opt/bzip2/include -isystem /usr/local/opt/zlib/include -O2 -O3 -DNDEBUG -std=c++11 -isysroot /Volumes/Dateien/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk -mmacosx-version-min=10.15 -fPIC -fvisibility=hidden -Wall -Wextra -Wunreachable-code -Wpointer-arith -Wmissing-declarations -Wno-pedantic -Wno-ignored-qualifiers -Wno-unused-parameter -Wno-missing-field-initializers -MD -MT src/lib/CMakeFiles/librnp-obj.dir/__/librepgp/stream-key.cpp.o -MF CMakeFiles/librnp-obj.dir/__/librepgp/stream-key.cpp.o.d -o CMakeFiles/librnp-obj.dir/__/librepgp/stream-key.cpp.o -c /users/defnax/Documents/GitHub/RetroShare-2/supportlibs/librnp/src/librepgp/stream-key.cpp
/users/defnax/Documents/GitHub/RetroShare-2/supportlibs/librnp/src/librepgp/stream-key.cpp:421:13: error: 
      use of undeclared identifier 'assert'
            assert(hash->size() == sizeof(hval));
            ^
/users/defnax/Documents/GitHub/RetroShare-2/supportlibs/librnp/src/librepgp/stream-key.cpp:575:5: error: 
      use of undeclared identifier 'assert'
    assert(sizeof(hval) == hash->size());

@ni4
Copy link
Contributor

ni4 commented Jan 23, 2025

Is this something you expected (and containing all the required headers) : -isysroot /Volumes/Dateien/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk ? As paths you posted are on the main drive, not attached volume.

@defnax
Copy link
Author

defnax commented Jan 23, 2025

No i tried last time into cmake it said not allowed to me with -isysroot i need try tonight again
That path not worked i mean the c++ includes are not there
I tested with the other path which i mentioned

@ni4
Copy link
Contributor

ni4 commented Jan 23, 2025

@defnax btw, in you CMake configuration logs compiler and ZLib/BZip2 paths are also picked from /Volumes/Dateien/...:
-- Check for working CXX compiler: /Volumes/Dateien/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ - skipped and so on.

So possibly you have SDKROOT env variable pointing at it or configured in some other way to use by default SDK from /Volumes/.

More on this: https://stackoverflow.com/questions/79285785/cmake-for-macos-how-do-i-set-the-isysroot-variable-according-to-my-default-xcod

@defnax
Copy link
Author

defnax commented Jan 23, 2025

yes i saw it now im not sure why it not taked the defined ones
standalone compile

-- Found BZip2: 
/Volumes/Dateien/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk/usr/lib/libbz2.tbd (found version "1.0.6")
-- Looking for BZ2_bzCompressInit
-- Looking for BZ2_bzCompressInit - found
-- Found ZLIB: /Volumes/Dateien/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk/usr/lib/libz.tbd (found version "1.2.11")
-- Found JSON-C: /usr/local/Cellar/json-c/0.18/lib/libjson-c.dylib (found suitable version "0.18", minimum required is "0.11")
-- Found Botan: /usr/local/opt/botan@2/lib/libbotan-2.dylib (found suitable version "2.19.5", minimum required is "2.14.0")

when compiling in retroshare it uses right one

-- Found BZip2: /usr/local/opt/bzip2/lib/libbz2.a (found version "1.0.8")
-- Looking for BZ2_bzCompressInit
-- Looking for BZ2_bzCompressInit - found
-- Found ZLIB: /usr/local/opt/zlib/lib/libz.a (found version "1.3.1")
-- Found JSON-C: /usr/local/opt/json-c/lib/libjson-c.a (found suitable version "0.18", minimum required is "0.11")
-- Found Botan: /usr/local/opt/botan@2/lib/libbotan-2.a (found suitable version "2.19.5", minimum required is "2.14.0")

@defnax
Copy link
Author

defnax commented Jan 23, 2025

i added this to the CMakelists file

set(CMAKE_OSX_DEPLOYMENT_TARGET )

message(STATUS "CMAKE_OSX_SYSROOT=${CMAKE_OSX_SYSROOT}")

@ni4
Copy link
Contributor

ni4 commented Jan 24, 2025

So does it work now?

@defnax
Copy link
Author

defnax commented Jan 24, 2025

No get error with assert always it does not find the c++ include headers

@defnax
Copy link
Author

defnax commented Jan 24, 2025

i use this cmake include from my other path it dont work

set(CMAKE_OSX_DEPLOYMENT_TARGET )
include_directories("/Library/Developer/CommandLineTools/SDKs/MacOSX11.1.sdk/usr/include")
message(STATUS "CMAKE_OSX_SYSROOT=${CMAKE_OSX_SYSROOT}")
In file included from /users/defnax/Documents/GitHub/RetroShare-2/supportlibs/librnp/src/librepgp/stream-armor.cpp:38:
In file included from /users/defnax/Documents/GitHub/RetroShare-2/supportlibs/librnp/src/librepgp/stream-armor.h:30:
In file included from /users/defnax/Documents/GitHub/RetroShare-2/supportlibs/librnp/src/librepgp/stream-common.h:33:
In file included from /users/defnax/Documents/GitHub/RetroShare-2/supportlibs/librnp/src/lib/types.h:39:
In file included from /users/defnax/Documents/GitHub/RetroShare-2/supportlibs/librnp/src/lib/sec_profile.hpp:31:
In file included from /Volumes/Dateien/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk/usr/include/c++/v1/unordered_map:409:
In file included from /Volumes/Dateien/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk/usr/include/c++/v1/__hash_table:18:
/Volumes/Dateien/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk/usr/include/c++/v1/cmath:324:7: error: no member named 'isgreaterequal' in the global namespace; did you mean
      '::std::greater_equal'?
using ::isgreaterequal;
      ^~
/Volumes/Dateien/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk/usr/include/c++/v1/functional:767:29: note: '::std::greater_equal' declared here
struct _LIBCPP_TEMPLATE_VIS greater_equal : binary_function<_Tp, _Tp, bool>
                            ^
In file included from /users/defnax/Documents/GitHub/RetroShare-2/supportlibs/librnp/src/librepgp/stream-armor.cpp:38:
In file included from /users/defnax/Documents/GitHub/RetroShare-2/supportlibs/librnp/src/librepgp/stream-armor.h:30:
In file included from /users/defnax/Documents/GitHub/RetroShare-2/supportlibs/librnp/src/librepgp/stream-common.h:33:
In file included from /users/defnax/Documents/GitHub/RetroShare-2/supportlibs/librnp/src/lib/types.h:39:
In file included from /users/defnax/Documents/GitHub/RetroShare-2/supportlibs/librnp/src/lib/sec_profile.hpp:31:
In file included from /Volumes/Dateien/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk/usr/include/c++/v1/unordered_map:409:
In file included from /Volumes/Dateien/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk/usr/include/c++/v1/__hash_table:18:
/Volumes/Dateien/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk/usr/include/c++/v1/cmath:325:9: error: no member named 'isless' in the global namespace
using ::isless;
      ~~^
/Volumes/Dateien/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk/usr/include/c++/v1/cmath:326:9: error: no member named 'islessequal' in the global namespace
using ::islessequal;
      ~~^
/Volumes/Dateien/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk/usr/include/c++/v1/cmath:327:9: error: no member named 'islessgreater' in the global namespace
using ::islessgreater;
      ~~^
/Volumes/Dateien/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk/usr/include/c++/v1/cmath:328:9: error: no member named 'isunordered' in the global namespace
using ::isunordered;
      ~~^
/Volumes/Dateien/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk/usr/include/c++/v1/cmath:329:9: error: no member named 'isunordered' in the global namespace
using ::isunordered;

seems i have this same issue like this(https://stackoverflow.com/questions/61741888/i-cannot-compile-a-c-library-using-cmath-on-macos-10-15-4-with-premake5-gmake)
https://forums.swift.org/t/is-anyone-else-getting-this-error-when-building-the-compiler-from-master-on-macos/36113

@ni4
Copy link
Contributor

ni4 commented Jan 30, 2025

@defnax Yeah, it looks like you should update XCode. I barely remember something similar few years ago which forced me to update macOS to be able to download and install latest command line tools, as in Make sure you have downloaded the latest 'Command Line Tools for Xcode 11.4.1' this reply on StackOverflow.

@defnax
Copy link
Author

defnax commented Jan 30, 2025

Hi im not able to downloaded latest, i think i need skip till i bought a new mac
I has macOS catalina on my very old imac

@ni4
Copy link
Contributor

ni4 commented Jan 30, 2025

@defnax you may try (if have some time and intention) to build CI/CD pipeline on Github, which would build it/run it/test it/upload compiled artifact, but that could definitely be time-consuming without ability to build the thing on the real mac. I can help with that as well.

@defnax
Copy link
Author

defnax commented Jan 30, 2025

i never used this, you mean with github actions? how i can configure to build for macos as example?
but it needs then make, cmake and brew for some depencies packages

some years ago we used travis where it was free for macos builds

@ni4
Copy link
Contributor

ni4 commented Jan 30, 2025

@defnax for opensource projects you may use Github actions for free for (Linux, Windows, macOS) CI/CD builds. That would require some learning if you are not familiar with it right now though. As an example you may check out our actions (folder .github/workflows/) which builds and run tests for all the platforms mentioned, including compiling artifacts/packages and so on.

@defnax
Copy link
Author

defnax commented Jan 31, 2025

i has tried on my Virtualbox with xcode 10.15

i get this error at last

Image

@ni4
Copy link
Contributor

ni4 commented Jan 31, 2025

@defnax I don't think that 10.15 is going to work, it's quite outdated. Also Botan 2 is EOLed, so you should try version 3.

@defnax
Copy link
Author

defnax commented Feb 1, 2025

now tested standalone compile on virtualbox

Image

@ni4
Copy link
Contributor

ni4 commented Feb 1, 2025

@defnax Oh, macOS could be run in virtualbox. Didn't know till now, in 2010-14 times it was not possible.

@defnax
Copy link
Author

defnax commented Feb 1, 2025

i installed virtualbox two years ago to use macos catalina for build retroshare and make build packages now need to try if rnp builds from qt creator too with rs itself
https://github.com/myspaghetti/macos-virtualbox
best i need new mac

@defnax
Copy link
Author

defnax commented Feb 1, 2025

in retroshare compile rnp no sucess but but standalone worked error free

Image

@ni4
Copy link
Contributor

ni4 commented Feb 1, 2025

This issue seems to be some regression in XCode, there are multiple cases with other products: https://stackoverflow.com/questions/68095018/dyld-symbol-not-found-darwin-check-fd-set-overflow

@defnax
Copy link
Author

defnax commented Feb 1, 2025

this here used in libretroshare the cmake params

   librnp_header.commands += cd $$shell_path($${LIBRNP_BUILD_PATH}) && \
        cmake \
        -Wno-dev \
        -DCMAKE_C_COMPILER=$$fixQmakeCC($$QMAKE_CC) \
        -DCMAKE_CXX_COMPILER=$$QMAKE_CXX \
        $${LIBRNP_CMAKE_PARAMS} \
        -DCRYPTO_BACKEND=botan \
        -DBOTAN_ROOT_DIR=/usr/local/opt/botan@2/ \
        -DBUILD_TESTING=off \
        -DCMAKE_CXX_FLAGS=\"$${LIBRNP_CMAKE_CXXFLAGS}\" \
        $${CMAKE_GENERATOR_OVERRIDE} \
        -DENABLE_COVERAGE=Off \
        -DCMAKE_INSTALL_PREFIX=. -B. \
        -H$$shell_path($${LIBRNP_SRC_PATH})

without this i get more errors

        -DCRYPTO_BACKEND=botan \
        -DBOTAN_ROOT_DIR=/usr/local/opt/botan@2/ \

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants