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

Error in cmake after libtuv update #105

Closed
tylerw1369 opened this issue Feb 14, 2019 · 10 comments
Closed

Error in cmake after libtuv update #105

tylerw1369 opened this issue Feb 14, 2019 · 10 comments
Assignees
Labels
bug Something isn't working
Milestone

Comments

@tylerw1369
Copy link

I try to compile using my de10 nano and get this error .

root@lampa:~/dcurl# make BUILD_FPGA_ACCEL=1
git submodule update --init deps/libtuv
Submodule 'deps/libtuv' (https://github.com/DLTcollab/libtuv.git) registered for path 'deps/libtuv'
Cloning into '/root/dcurl/deps/libtuv'...
Submodule path 'deps/libtuv': checked out '3177b57937056ab5255adc4ad338d5e4ee844eab'
CC build/curl.o
CC build/constants.o
CC build/trinary.o
CC build/dcurl.o
CC build/implcontext.o
CC build/common.o
CC build/pow_c.o
CC build/pow_fpga_accel.o
make -C deps/libtuv TUV_BUILD_TYPE=release TUV_CREATE_PIC_LIB=yes
make[1]: Entering directory '/root/dcurl/deps/libtuv'
mkdir -p ./build/armv7l-linux/release/cmake
cmake -B./build/armv7l-linux/release/cmake -H./ -DCMAKE_TOOLCHAIN_FILE=./cmake/config/config_armv7l-linux.cmake -DCMAKE_BUILD_TYPE=release -DTARGET_PLATFORM=armv7l-linux -DBUILDTESTER=yes -DBUILD_HOST_HELPER=no -DCREATE_SHARED_LIB=no -DCREATE_PIC_LIB=yes -DTUV_FEATURE_PROCESS=ON
CMake Error at /usr/share/cmake-3.7/Modules/CMakeDetermineSystem.cmake:94 (message):
Could not find toolchain file: ./cmake/config/config_armv7l-linux.cmake
Call Stack (most recent call first):
CMakeLists.txt:16 (project)

CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage
-- Configuring incomplete, errors occurred!
Makefile:63: recipe for target 'all' failed
make[1]: *** [all] Error 1
make[1]: Leaving directory '/root/dcurl/deps/libtuv'
mk/submodule.mk:23: recipe for target 'deps/libtuv/build/armv7l-linux/release/lib/libtuv.o' failed
make: *** [deps/libtuv/build/armv7l-linux/release/lib/libtuv.o] Error 2

@marktwtn marktwtn self-assigned this Feb 15, 2019
@jserv jserv modified the milestone: sprint-201902 Feb 16, 2019
@jserv
Copy link
Member

jserv commented Feb 16, 2019

On ARM64 machines, I encountered similar problem:

$ make
make -C deps/libtuv TUV_BUILD_TYPE=release TUV_CREATE_PIC_LIB=yes
make[1]: Entering directory '/home/ubuntu/dcurl/deps/libtuv'
mkdir -p ./build/aarch64-linux/release/cmake
cmake -B./build/aarch64-linux/release/cmake -H./ -DCMAKE_TOOLCHAIN_FILE=./cmake/config/config_aarch64-linux.cmake -DCMAKE_BUILD_TYPE=release -DTARGET_PLATFORM=aarch64-linux -DBUILDTESTER=yes -DBUILD_HOST_HELPER=no -DCREATE_SHARED_LIB=no -DCREATE_PIC_LIB=yes -DTUV_FEATURE_PROCESS=ON
CMake Error at /usr/share/cmake-3.10/Modules/CMakeDetermineSystem.cmake:100 (message):
  Could not find toolchain file: ./cmake/config/config_aarch64-linux.cmake
Call Stack (most recent call first):
  CMakeLists.txt:16 (project)

@jserv
Copy link
Member

jserv commented Feb 16, 2019

@marktwtn, We might have to put pre-configured cmake options in directory libtuv/cmake/option/, otherwise generic armv7l (such as Raspberry Pi 2/3) and aarch64 (I'm using Cavium ThunderX; ARMv8-A) targets could not get compiled.

@jserv
Copy link
Member

jserv commented Feb 16, 2019

After providing two files, I got dcurl built on aarch64 target.

  • File libtuv/cmake/option/option_arm-linux.cmake:
include("cmake/option/option_unix_common.cmake")
include("cmake/option/option_linux_common.cmake")
  • File libtuv/cmake/config/config_aarch64-linux.cmake
set(CMAKE_SYSTEM_NAME Linux)
set(CMAKE_SYSTEM_PROCESSOR arm64)

set(CMAKE_C_COMPILER aarch64-linux-gnu-gcc)

@jserv jserv added the bug Something isn't working label Feb 16, 2019
@jserv
Copy link
Member

jserv commented Feb 16, 2019

Related: #108

@marktwtn
Copy link
Collaborator

The error is caused by the hardware platform mismatching of libtuv used in dcurl
since the way of detecting hardware platform is quite simple.

Here is the modification needs to be done:
dcurl modification

  • Detect and classify the hardware platform of arm and aarch64 correctly.

libutv modification

  • Support more boards of arm-Linux combination. It only supports RPi2 now.
  • Add the cmake files of aarch64.

@marktwtn
Copy link
Collaborator

After providing two files, I got dcurl built on aarch64 target.

* File `libtuv/cmake/option/option_arm-linux.cmake`:

Did you mean the file option_aarch64-linux.cmake?

@jserv
Copy link
Member

jserv commented Feb 17, 2019

After providing two files, I got dcurl built on aarch64 target.

* File `libtuv/cmake/option/option_arm-linux.cmake`:

Did you mean the file option_aarch64-linux.cmake?

Exactly. We can simply enable arm/aarch64 build first, that is crucial for us to prepare new releases. Then, we might contribute back to libtuv upstream.

@marktwtn
Copy link
Collaborator

Take the RPi2 with arm-Linux as example.
It would add the flags in libtuv/cmake/option/option_arm-linux.cmake:

-mcpu=cortex-a7
-mfloat-abi=hard
-mfpu=neon-vfpv4

If we want to support de10 nano, there are two methods:

  1. Support all the boards of arm 32-bit CPU structure without adding the extra C flags like RPi2.
    However, it might have the risk of getting a executable or library which is not optimized or can not be executed.
  2. Support de10 nano only by specifying the target board and add the extra C flags like:
    -mcpu=cortex-a9
    With this method, we have to assign the target board when building the dcurl.

@jserv
Copy link
Member

jserv commented Feb 18, 2019

We don't have to tune board-specific options since the computing is taking place in FPGA rather than Arm side.

@marktwtn
Copy link
Collaborator

Sorry for my misunderstanding of the original problem.

The issue will focus on building the dcurl with FPGA enabled only.
No CPU and libtuv related code will be built together.

And I will open another issue for making dcurl built on aarch64 platform as well.

marktwtn added a commit to marktwtn/dcurl that referenced this issue Feb 20, 2019
The original building process would compile CPU-related code as well
even if we assign the other platform(GPU or FPGA) only.

The current building process can build each platform independently.
If no hardware platform is specified,
the CPU and the supported instruction set would be chose.
The libtuv code would be compiled only if the specified hardware
platforms contain CPU.

Close DLTcollab#105.
marktwtn added a commit to marktwtn/dcurl that referenced this issue Feb 20, 2019
The original building process would compile CPU-related code as well
even if we assign the other platform(GPU or FPGA) only.

The current building process can build each platform independently.
If no hardware platform is specified,
the CPU and the supported instruction set would be chose.
The libtuv code would be compiled only if the specified hardware
platforms contain CPU.

Close DLTcollab#105.
marktwtn added a commit to marktwtn/dcurl that referenced this issue Feb 20, 2019
The original building process would compile CPU-related code as well
even if we assign the other platform(GPU or FPGA) only.

The current building process can build each platform independently.
If no hardware platform is specified,
the CPU and the supported instruction set would be chose.
The libtuv code would be compiled only if the specified hardware
platforms contain CPU.

Close DLTcollab#105.
@jserv jserv added this to the sprint-201902 milestone Feb 20, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants