[J-core] nextpnr build failed with weird cmake error?
Rob Landley
rob at landley.net
Wed Sep 16 08:13:23 UTC 2020
On 9/15/20 5:36 AM, Rob Landley wrote:
> Jeff, I'm trying to add icestorm and nextpnr to the toolchain build, following
> your model, and I got:
Alas, Jeff is on a plane back to Japan (finally!) in something like 6 hours so
can't help debug this one, but he confirmed on the phone that he hasn't seen it
on a mac and two linux boxes. So...
> -- Looking for sys/types.h
> CMake Error at /usr/share/cmake-3.7/Modules/CheckIncludeFile.cmake:56 (try_compile):
> Unknown extension ".c" for file
>
> /home/landley/yogh2/sub2/nextpnr/CMakeFiles/CMakeTmp/CheckIncludeFile.c
>
> try_compile() works only for enabled languages. Currently these are:
>
> CXX
>
> Does this sound familiar? (This is _after_ I installed
> libboost{,thread,system,iostreams,rogram-options,filesystem}-dev libeigen3-dev
> for this monster...)
>
> It's using more or less your build invocation:
>
> cd nextpnr &&
> cmake . -DARCH="ice40" -DCMAKE_INSTALL_PREFIX="$PREFIX" \
> -DICESTORM_INSTALL_PREFIX="$PREFIX" -DBUILD_GUI=OFF -DBUILD_PYTHON=OFF \
> -DSTATIC_BUILD=ON &&
> make -j $(nproc) &&
> cd .. || exit 1
According to http://www.grokit.ca/cnt/CMakeProblemsSolutions/ the fix is to add
ENABLE_LANGUAGE(C) to the CMakeLists.txt file (if your system's cmake install
doesn't have that installed in the global overrides). The problem is there isn't
one. Or more accurately, there isn't JUST one:
$ find nextpnr -name CMakeLists.txt | wc -l
32
Ok, cmake man page... let's try adding -P<(echo "ENABLE_LANGUAGE(C)") and:
CMake Error: Error processing file: -DARCH=ice40
Really? REALLY? The cmake command line parser can't understand -PFILE it needs
-P FILE with a space? Yes, that would appear to be the case...
CMake Error at /dev/fd/63:1 (ABLE_LANGUAGE):
Unknown CMake command "ABLE_LANGUAGE".
And it wants a seekable file, because of course it does...
CMake Error at /dev/fd/63:1 (ENABLE_LANGUAGE):
Command enable_language() is not scriptable
Sigh. Ok, digging back... I need to add C to the project() language list at the
top level, and it should get inherited? Ok, that built.
I should submit a pull request...
Rob
More information about the J-core
mailing list