Darling: fatal error: 'float.h' file not found

Created on 26 Mar 2019  路  13Comments  路  Source: darlinghq/darling

I have been trying to get Daring to compile on my Fedora 29 machine, but I am currently running into issue where it can't find float.h. I tried to use dnf provides "*/include/float.h", but it wasn't exactly obvious what package I was suppose to install.

Here is the entire log if you want to look at it. I also made sure to have all the dependencies installed (as stated from the wiki). Does anyone know what I need to do to fix this issue?

Build

Most helpful comment

You will still have to apply bugaevc's patch, since he has not submitted a fix to the master branch at the time of this writing.

Sorry for that; I'm busy this month (or procrastinating when not busy) and just don't have time to commit that patch or finish some other fixes/improvements (xtrace, O2) that I have locally.

All 13 comments

The file is /usr/lib64/clang/7.0.1/include/float.h, provided by the clang-libs package (which is a dependency of clang package, which is a dependency of Darling as listed on the wiki).

You're likely to have other problems building Darling on F29 however due to this. I'm using a F28 version of clang (6.0), installable on F29 with dnf downgrade clang --releasever=28.

The weird this is that the file does exist:

$ test -e /usr/lib64/clang/7.0.1/include/float.h && echo file exists || echo file does not exist
file exists

dnf also states that clang-libs is already installed:

$ sudo dnf install clang-libs
Last metadata expiration check: 0:00:07 ago on Tue 26 Mar 2019 07:43:55 AM PDT.
Package clang-libs-7.0.1-6.fc29.x86_64 is already installed.
Dependencies resolved.
Nothing to do.
Complete!

Yet, I still get the same error when I run make -j8. Could this be a cmake issue? Also, I noticed that the bug report said that the issue was fixed. Was it not fixed for 7.0.1?

Hmm, now I can reproduce this. /usr/lib64/clang/8.0.0/include/stdatomic.h exists, but I get

../src/external/libpthread/src/internal.h:74:10: fatal error: 'stdatomic.h' file not found
#include <stdatomic.h>
         ^~~~~~~~~~~~~

Does this workaround fix it for you?

diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index a426392e..b5c32e93 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -41,7 +41,7 @@ include_directories("${CMAKE_CURRENT_SOURCE_DIR}/include")
 include(compiler_include)
 GetCompilerInclude(COMPILER_INC_PATH)
 message(STATUS "Compiler include path detected as ${COMPILER_INC_PATH}")
-include_directories(${COMPILER_INC_PATH})
+include_directories(/usr/..${COMPILER_INC_PATH})

 find_package(BISON)
 find_package(FLEX)

@bugaevc I can confirm that the float.h issue is fixed. With that being said, I am still not able to compile daring because of an unrelated issue (#497).

Should I close this issue?

Should I close this issue?

Not yet, I'll commit the workaround and that will close it

@CuriousTommy with the combination of this fix on the new master (which includes the 497 fix), the rpms compile and work now.

@CuriousTommy with the combination of this fix on the new master (which includes the 497 fix), the rpms compile and work now.

I pardon my ignorance, but what do you mean by "new master"? Following the build instructions provided I still have this issue on Fedora 29. I've not attempted to downgrade Clang however.

@Newbie13XD The master branch was update to fix the javascript building issue (https://github.com/darlinghq/darling/commit/9fc61ce83101f7005e1bf29cf184a9b4f907d51f).

You will still have to apply bugaevc's patch, since he has not submitted a fix to the master branch at the time of this writing.

You will still have to apply bugaevc's patch, since he has not submitted a fix to the master branch at the time of this writing.

Sorry for that; I'm busy this month (or procrastinating when not busy) and just don't have time to commit that patch or finish some other fixes/improvements (xtrace, O2) that I have locally.

Strangly i'have this error to. But i'm on Archlinux and the file exist in /usr/lib/clang/9.0.0/include/float.h.

@Eragonfr the workaround @bugaevc used has been broken by recent CMake versions. 24f09b59e300183230c8c2e5356a81948ea48cae should fix this issue permanently by disabling CMake from filtering out "system" paths from our includes.

It seems to be good.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Arucard1983 picture Arucard1983  路  3Comments

wusikijeronii picture wusikijeronii  路  4Comments

fervi picture fervi  路  3Comments

mrtino picture mrtino  路  3Comments

seanballais picture seanballais  路  6Comments