Open moneroexamples opened 5 months ago
Confirm, same issue on updated Arch Linux
@selsta Applied pastebin modifications. Failed at 24%:
[scrubbed]/monero/external/miniupnp/miniupnpc/src/minihttptestserver.c:299:25: error: implicit declaration of function 'usleep'; did you mean 'sleep'? [-Wimplicit-function-declaration]
299 | usleep(10000); /* 10ms */
| ^~~~~~
| sleep
make[2]: *** [external/miniupnp/miniupnpc/CMakeFiles/minihttptestserver.dir/build.make:76: external/miniupnp/miniupnpc/CMakeFiles/minihttptestserver.dir/src/minihttptestserver.c.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:1341: external/miniupnp/miniupnpc/CMakeFiles/minihttptestserver.dir/all] Error 2
Compiled successfully from https://github.com/selsta/monero/tree/miniupnpc-2.2.8
After adding a small print to src/p2p/CMakeLists.txt
:
get_cmake_property(_variableNames VARIABLES)
list (SORT _variableNames)
foreach (_variableName ${_variableNames})
message(STATUS "${_variableName}=${${_variableName}}")
endforeach()
get_target_property(dirs miniupnpc::miniupnpc INCLUDE_DIRECTORIES)
foreach(dir ${dirs})
message(STATUS "miniupnpc::miniupnpc INCLUDE_DIRECTORIES='${dir}'")
endforeach()
get_target_property(dirs miniupnpc::miniupnpc INTERFACE_INCLUDE_DIRECTORIES)
foreach(dir ${dirs})
message(STATUS "miniupnpc::miniupnpc INTERFACE_INCLUDE_DIRECTORIES='${dir}'")
endforeach()
message(WARNING "p2p:")
get_target_property(dirs p2p INCLUDE_DIRECTORIES)
foreach(dir ${dirs})
message(STATUS "p2p INCLUDE_DIRECTORIES='${dir}'")
endforeach()
get_target_property(dirs p2p INTERFACE_INCLUDE_DIRECTORIES)
foreach(dir ${dirs})
message(STATUS "p2p INTERFACE_INCLUDE_DIRECTORIES='${dir}'")
endforeach()
you can see this output (even if you add miniupnpc::miniupnpc
to p2p
as dependency):
-- miniupnpc::miniupnpc INCLUDE_DIRECTORIES='/home/0xfffc/developments/monero/external/rapidjson/include'
-- miniupnpc::miniupnpc INCLUDE_DIRECTORIES='/home/0xfffc/developments/monero/external/easylogging++'
-- miniupnpc::miniupnpc INCLUDE_DIRECTORIES='/home/0xfffc/developments/monero/src'
-- miniupnpc::miniupnpc INCLUDE_DIRECTORIES='/home/0xfffc/developments/monero/contrib/epee/include'
-- miniupnpc::miniupnpc INCLUDE_DIRECTORIES='/home/0xfffc/developments/monero/external'
-- miniupnpc::miniupnpc INCLUDE_DIRECTORIES='/home/0xfffc/developments/monero/external/supercop/include'
-- miniupnpc::miniupnpc INCLUDE_DIRECTORIES='/opt/monero/build-release/x86_64-pc-linux-gnu/include'
-- miniupnpc::miniupnpc INCLUDE_DIRECTORIES='/home/0xfffc/developments/monero/build-release/generated_include'
-- miniupnpc::miniupnpc INCLUDE_DIRECTORIES='/home/0xfffc/developments/monero/build-release/translations'
-- miniupnpc::miniupnpc INCLUDE_DIRECTORIES='$<BUILD_INTERFACE:/home/0xfffc/developments/monero/external/miniupnp/miniupnpc/include>'
-- miniupnpc::miniupnpc INCLUDE_DIRECTORIES='$<INSTALL_INTERFACE:include/miniupnpc>'
-- miniupnpc::miniupnpc INTERFACE_INCLUDE_DIRECTORIES='$<BUILD_INTERFACE:/home/0xfffc/developments/monero/external/miniupnp/miniupnpc/include>'
-- miniupnpc::miniupnpc INTERFACE_INCLUDE_DIRECTORIES='$<INSTALL_INTERFACE:include/miniupnpc>'
-- miniupnpc::miniupnpc INTERFACE_INCLUDE_DIRECTORIES='$<INSTALL_INTERFACE:include>'
CMake Warning at src/p2p/CMakeLists.txt:71 (message):
p2p:
-- p2p INCLUDE_DIRECTORIES='/home/0xfffc/developments/monero/external/rapidjson/include'
-- p2p INCLUDE_DIRECTORIES='/home/0xfffc/developments/monero/external/easylogging++'
-- p2p INCLUDE_DIRECTORIES='/home/0xfffc/developments/monero/src'
-- p2p INCLUDE_DIRECTORIES='/home/0xfffc/developments/monero/contrib/epee/include'
-- p2p INCLUDE_DIRECTORIES='/home/0xfffc/developments/monero/external'
-- p2p INCLUDE_DIRECTORIES='/home/0xfffc/developments/monero/external/supercop/include'
-- p2p INCLUDE_DIRECTORIES='/opt/monero/build-release/x86_64-pc-linux-gnu/include'
-- p2p INCLUDE_DIRECTORIES='/home/0xfffc/developments/monero/build-release/generated_include'
-- p2p INCLUDE_DIRECTORIES='/home/0xfffc/developments/monero/build-release/translations'
-- p2p INCLUDE_DIRECTORIES='/opt/monero/build-release/x86_64-pc-linux-gnu/include'
-- p2p INCLUDE_DIRECTORIES='/home/0xfffc/developments/monero/external/db_drivers/liblmdb'
-- p2p INCLUDE_DIRECTORIES='/opt/monero/build-release/x86_64-pc-linux-gnu/include/hidapi'
-- p2p INCLUDE_DIRECTORIES='/opt/monero/build-release/x86_64-pc-linux-gnu/include'
-- p2p INCLUDE_DIRECTORIES='/opt/monero/build-release/x86_64-pc-linux-gnu/include/libusb-1.0'
-- p2p INCLUDE_DIRECTORIES='/opt/monero/build-release/x86_64-pc-linux-gnu/include'
-- p2p INTERFACE_INCLUDE_DIRECTORIES='dirs-NOTFOUND'
It is obvious for some reason the include path from miniupnpc::miniupnpc
does not propagate to the p2p
target.
And this is the PR causing it: https://github.com/miniupnp/miniupnp/pull/559
In case you want to take a look at early PR, this one is a complete fix, other than a few minor issues I expect it to work without issue https://github.com/0xFFFC0000/monero/pull/23
Once it passed all the tests, I will submit a PR.
@0xFFFC0000 testing
@0xFFFC0000 unable to compile from your branch. Still have error: external/miniupnp/miniupnpc/src/minihttptestserver.c:299:25: error: implicit declaration of function 'usleep'; did you mean 'sleep'? [-Wimplicit-function-declaration]
What I did:
$ git clone https://github.com/0xFFFC0000/monero -b dev/0xfffc/new-miniupnpc && cd monero/
$ git submodule update --init --force
$ make -j 8
Yes. That is their error. Not ours. Even if you compile miniupnpc
in separate environment with same compiler, you will hit it. ( in your spare time please try it if possible and let me know )
Let me double check though, I will find a workaround.
@0xFFFC0000 unable to compile from your branch. Still have error:
external/miniupnp/miniupnpc/src/minihttptestserver.c:299:25: error: implicit declaration of function 'usleep'; did you mean 'sleep'? [-Wimplicit-function-declaration]
What I did:
$ git clone https://github.com/0xFFFC0000/monero -b dev/0xfffc/new-miniupnpc && cd monero/ $ git submodule update --init --force $ make -j 8
Do you use Element? or IRC?
if(NOT MSVC)
add_compile_options(-D_GNU_SOURCE)
endif()
Fixed the issue. Now we have updated miniupnpc
and fixed this compilation issue.
A workaround to compile Monero on Fedora 40 (that ships with gcc 14.x):
dnf install -y gcc13-c++
CC="gcc-13" CXX="g++-13" make -j8 release
An equivalent workaround to @gus4rs's for Debian/Ubuntu (I think this is only an issue for Debian sid, though I'm not sure if trixie or newer ubuntu ships with gcc 14.x) :
apt install -y gcc-13 g++-13
CC="gcc-13" CXX="g++-13" make -j8 release
Regarding:
and