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

Select the suitable ARM compiler of de10-nano board for dcurl + libtuv #150

Closed
marktwtn opened this issue May 9, 2019 · 7 comments · Fixed by #155
Closed

Select the suitable ARM compiler of de10-nano board for dcurl + libtuv #150

marktwtn opened this issue May 9, 2019 · 7 comments · Fixed by #155
Assignees
Milestone

Comments

@marktwtn
Copy link
Collaborator

marktwtn commented May 9, 2019

The structure of de10-nano board would be recognized by dcurl or libtuv as arm-linux.

The default arm-linux compiler of building libtuv is arm-linux-gnueabihf-gcc.
However, the de10-nano environment set up by @ajblane only contains the compiler of arm-linux-gnueabi-gcc.

To build libtuv successfully on de10-nano board, the current workaround includes:

  • Set the compiler from arm-linux-gnueabihf-gcc to arm-linux-gnueabi-gcc.
  • Remove the compiler flag -mfloat-abi=hard since we do not have the header file gnu/stubs-hard.h and we use the compiler without hf(hard floating point).

In my opinion, the hardware floating point calculation is not really necessary in dcurl + libtuv.

There are two possible ways to make dcurl + libtuv work on de10-nano board:

  1. The environment of de10-nano should contain the compiler arm-linux-gnueabihf-gcc and the corresponding header files.
  2. Modify the libtuv compiler and flags as mentioned before.
@marktwtn marktwtn self-assigned this May 9, 2019
@ajblane
Copy link
Collaborator

ajblane commented May 9, 2019

Using arm-linux-gnueabihf-gcc can work for crossing compiling as refers to Exploring the HPS and FPGA onboard the Terasic DE10-Nano.

For modifying the libtuv compiler and flags, It can detect if arm-linux-gnueabihf-gcc exists. If arm-linux-gnueabihf-gcc does not exist, it then uses arm-linux-gnueabi-gcc. What do you think?

@marktwtn
Copy link
Collaborator Author

marktwtn commented May 9, 2019

If arm-linux-gnueabihf-gcc does not exist, it then uses arm-linux-gnueabi-gcc. What do you think?

It sounds workable.
The find_program() command of cmake can be used to help us.

@marktwtn
Copy link
Collaborator Author

To @ajblane
The libtuv branch arm-linux-detect-compiler can be used to detect the compiler.
Please use the branch in libtuv submodule, compile it on the de10-nano board and report the result.

@ajblane
Copy link
Collaborator

ajblane commented May 13, 2019

There is an error:

make -C deps/libtuv TUV_BUILD_TYPE=release TUV_CREATE_PIC_LIB=yes TUV_PLATFORM==
make[1]: Entering directory '/root/mark/dcurl/deps/libtuv'                      
make[1]: Warning: File 'Makefile' has modification time 1557708913 s in the fute
mkdir -p ./build/arm-linux/release/cmake                                        
cmake -B./build/arm-linux/release/cmake -H./ -DCMAKE_TOOLCHAIN_FILE=./cmake/con=
-- The C compiler identification is GNU 6.3.0                                   
-- Check for working C compiler: /usr/bin/arm-linux-gnueabi-gcc                 
-- Check for working C compiler: /usr/bin/arm-linux-gnueabi-gcc -- works        
-- Detecting C compiler ABI info                                                
-- Detecting C compiler ABI info - done                                         
-- Detecting C compile features                                                 
-- Detecting C compile features - done                                          
CMake Error at cmake/option/option_arm-linux.cmake:21 (if):                     
  if given arguments:                                                           
                                                                                
    "STREQUAL" "rpi2"                                                           
                                                                                
  Unknown arguments specified                                                   
Call Stack (most recent call first):                                            
  cmake/options.cmake:40 (include)                                              
  CMakeLists.txt:33 (include)                                                   
                                                                                
                                                                                
-- Configuring incomplete, errors occurred!                                     
See also "/root/mark/dcurl/deps/libtuv/build/arm-linux/release/cmake/CMakeFiles.
Makefile:63: recipe for target 'all' failed       
``

@marktwtn
Copy link
Collaborator Author

marktwtn commented May 13, 2019

@ajblane , I can not get the full command you used.
Did you specify the BOARD?

@ajblane
Copy link
Collaborator

ajblane commented May 13, 2019

I specify the BUILD_BOARD. I try to specify the BOARD.

@ajblane
Copy link
Collaborator

ajblane commented May 13, 2019

Success by using $ make BUILD_REMOTE=1 BUILD_BOARD=de10nano BUILD_FPGA_ACCEL=1

  CC    build/dcurl.o                                                                                                              
  CC    build/implcontext.o                                                                                                        
  CC    build/common.o                                                                                                             
  CC    build/pow_fpga_accel.o                                                                                                     
  CC    build/remote_common.o                                                                                                      
  CC    build/remote_interface.o                                                                                                   
make -C deps/libtuv TUV_BUILD_TYPE=release TUV_CREATE_PIC_LIB=yes TUV_PLATFORM=arm-linux TUV_BOARD=de10nano                        
make[1]: Entering directory '/root/mark/dcurl/deps/libtuv'                                                                         
make[1]: Warning: File 'Makefile' has modification time 1557708715 s in the future                                                 
mkdir -p ./build/arm-linux/release/cmake                                                                                           
cmake -B./build/arm-linux/release/cmake -H./ -DCMAKE_TOOLCHAIN_FILE=./cmake/config/config_arm-linux.cmake -DCMAKE_BUILD_TYPE=releao
-- Build Type: [release]                                                                                                           
-- Configuring done                                                                                                                
-- Generating done                                                                                                                 
-- Build files have been written to: /root/mark/dcurl/deps/libtuv/build/arm-linux/release/cmake                                    
make -C ./build/arm-linux/release/cmake                                                                                            
make[2]: Entering directory '/root/mark/dcurl/deps/libtuv/build/arm-linux/release/cmake'                                           
-- Build Type: [release]                                                                                                           
-- Configuring done                                                                                                                
-- Generating done                                                                                                                 
-- Build files have been written to: /root/mark/dcurl/deps/libtuv/build/arm-linux/release/cmake                                    
make[3]: Entering directory '/root/mark/dcurl/deps/libtuv/build/arm-linux/release/cmake'                                           
make[4]: Entering directory '/root/mark/dcurl/deps/libtuv/build/arm-linux/release/cmake'                                           
Scanning dependencies of target tuv                                                                                                
make[4]: Leaving directory '/root/mark/dcurl/deps/libtuv/build/arm-linux/release/cmake'                                            
make[4]: Entering directory '/root/mark/dcurl/deps/libtuv/build/arm-linux/release/cmake'                                           
make[4]: Warning: File '../../../../src/fs-poll.c' has modification time 1557708713 s in the future                                
[  2%] Building C object CMakeFiles/tuv.dir/src/fs-poll.c.o                                                                        
[  4%] Building C object CMakeFiles/tuv.dir/src/inet.c.o                                                                           
[  6%] Building C object CMakeFiles/tuv.dir/src/threadpool.c.o                                                                     
[  8%] Building C object CMakeFiles/tuv.dir/src/uv-common.c.o                                                                      
[ 10%] Building C object CMakeFiles/tuv.dir/src/tuv_debuglog.c.o                                                                   
[ 13%] Building C object CMakeFiles/tuv.dir/src/unix/async.c.o                                                                     
[ 15%] Building C object CMakeFiles/tuv.dir/src/unix/core.c.o                                                                      
[ 17%] Building C object CMakeFiles/tuv.dir/src/unix/fs.c.o                                                                        
[ 19%] Building C object CMakeFiles/tuv.dir/src/unix/getaddrinfo.c.o                                                               
[ 21%] Building C object CMakeFiles/tuv.dir/src/unix/loop.c.o                                                                      
[ 23%] Building C object CMakeFiles/tuv.dir/src/unix/loop-watcher.c.o                                                              
[ 26%] Building C object CMakeFiles/tuv.dir/src/unix/poll.c.o                                                                      
[ 28%] Building C object CMakeFiles/tuv.dir/src/unix/process.c.o                                                                   
[ 30%] Building C object CMakeFiles/tuv.dir/src/unix/stream.c.o                                                                    
[ 32%] Building C object CMakeFiles/tuv.dir/src/unix/tcp.c.o                                                                       
[ 34%] Building C object CMakeFiles/tuv.dir/src/unix/thread.c.o                                                                    
[ 36%] Building C object CMakeFiles/tuv.dir/src/unix/timer.c.o                                                                     
[ 39%] Building C object CMakeFiles/tuv.dir/src/unix/udp.c.o                                                                       
[ 41%] Building C object CMakeFiles/tuv.dir/src/unix/pipe.c.o                                                                      
[ 43%] Building C object CMakeFiles/tuv.dir/src/unix/signal.c.o                                                                    
[ 45%] Building C object CMakeFiles/tuv.dir/src/unix/linux-core.c.o                                                                
[ 47%] Building C object CMakeFiles/tuv.dir/src/unix/linux-syscalls.c.o                                                            
[ 50%] Linking C static library ../lib/libtuv.a                                                                                    
make[4]: warning:  Clock skew detected.  Your build may be incomplete.                                                             
make[4]: Leaving directory '/root/mark/dcurl/deps/libtuv/build/arm-linux/release/cmake'                                            
[ 50%] Built target tuv                                                                                                            
make[4]: Entering directory '/root/mark/dcurl/deps/libtuv/build/arm-linux/release/cmake'                                           
Scanning dependencies of target tuv_pic                                                                                            
make[4]: Leaving directory '/root/mark/dcurl/deps/libtuv/build/arm-linux/release/cmake'                                            
make[4]: Entering directory '/root/mark/dcurl/deps/libtuv/build/arm-linux/release/cmake'                                           
make[4]: Warning: File '../../../../src/fs-poll.c' has modification time 1557708686 s in the future                                
[ 52%] Building C object CMakeFiles/tuv_pic.dir/src/fs-poll.c.o                                                                    
[ 54%] Building C object CMakeFiles/tuv_pic.dir/src/inet.c.o                                                                       
[ 56%] Building C object CMakeFiles/tuv_pic.dir/src/threadpool.c.o                                                                 
[ 58%] Building C object CMakeFiles/tuv_pic.dir/src/uv-common.c.o                                                                  
[ 60%] Building C object CMakeFiles/tuv_pic.dir/src/tuv_debuglog.c.o                                                               
[ 63%] Building C object CMakeFiles/tuv_pic.dir/src/unix/async.c.o                                                                 
[ 65%] Building C object CMakeFiles/tuv_pic.dir/src/unix/core.c.o                                                                  
[ 67%] Building C object CMakeFiles/tuv_pic.dir/src/unix/fs.c.o                                                                    
[ 69%] Building C object CMakeFiles/tuv_pic.dir/src/unix/getaddrinfo.c.o                                                           
[ 71%] Building C object CMakeFiles/tuv_pic.dir/src/unix/loop.c.o                                                                  
[ 73%] Building C object CMakeFiles/tuv_pic.dir/src/unix/loop-watcher.c.o                                                          
[ 76%] Building C object CMakeFiles/tuv_pic.dir/src/unix/poll.c.o                                                                  
[ 78%] Building C object CMakeFiles/tuv_pic.dir/src/unix/process.c.o                                                               
[ 80%] Building C object CMakeFiles/tuv_pic.dir/src/unix/stream.c.o                                                                
[ 82%] Building C object CMakeFiles/tuv_pic.dir/src/unix/tcp.c.o                                                                   
[ 84%] Building C object CMakeFiles/tuv_pic.dir/src/unix/thread.c.o                                                                
[ 86%] Building C object CMakeFiles/tuv_pic.dir/src/unix/timer.c.o                                                                 
[ 89%] Building C object CMakeFiles/tuv_pic.dir/src/unix/udp.c.o                                                                   
[ 91%] Building C object CMakeFiles/tuv_pic.dir/src/unix/pipe.c.o                                                                  
[ 93%] Building C object CMakeFiles/tuv_pic.dir/src/unix/signal.c.o                                                                
[ 95%] Building C object CMakeFiles/tuv_pic.dir/src/unix/linux-core.c.o                                                            
[ 97%] Building C object CMakeFiles/tuv_pic.dir/src/unix/linux-syscalls.c.o                                                        
[100%] Linking C static library ../lib/libtuv.o                                                                                    
make[4]: warning:  Clock skew detected.  Your build may be incomplete.                                                             
make[4]: Leaving directory '/root/mark/dcurl/deps/libtuv/build/arm-linux/release/cmake'                                            
[100%] Built target tuv_pic                                                                                                        
make[3]: Leaving directory '/root/mark/dcurl/deps/libtuv/build/arm-linux/release/cmake'                                            
make[2]: Leaving directory '/root/mark/dcurl/deps/libtuv/build/arm-linux/release/cmake'                                            
make[1]: warning:  Clock skew detected.  Your build may be incomplete.                                                             
make[1]: Leaving directory '/root/mark/dcurl/deps/libtuv'                                                                          
  CC    build/test-trinary.o                                                                                                       
...

@wusyong wusyong added this to the Azalea milestone May 13, 2019
marktwtn added a commit to marktwtn/dcurl that referenced this issue May 14, 2019
The compiler of the board DE10-nano on arm-linux environment
is different from the default compiler assigned by libtuv.
The commit fix the problem and allow libtuv to detect and use
the suitable compiler.

Close DLTcollab#150.
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

Successfully merging a pull request may close this issue.

3 participants