[ 
https://issues.apache.org/jira/browse/HADOOP-17708?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17347885#comment-17347885
 ] 

Jonathan mercier commented on HADOOP-17708:
-------------------------------------------

After turn on full log message with the flags {color:#4c9aff}-e -X{color}
{code:bash}
mvn package -Pdist,native -Drequire.snappy=true  -DskipTests -Dtar -e -X
{code}
I can see that the real problem is here:
{code}
Unable to find source-code formatter for language: log. Available languages 
are: actionscript, ada, applescript, bash, c, c#, c++, cpp, css, erlang, go, 
groovy, haskell, html, java, javascript, js, json, lua, none, nyan, objc, perl, 
php, python, r, rainbow, ruby, scala, sh, sql, swift, visualbasic, xml, 
yaml[WARNING] [ 12%] Built target test_bulk_crc32                               
                                                                                
                                                                                
                                                    
[WARNING] make[1]: Leaving directory 
'/hadoop-3.2.2-src/hadoop-common-project/hadoop-common/target/native'           
                                                                                
                                                                                
           
[WARNING] 
/hadoop-3.2.2-src/hadoop-common-project/hadoop-common/src/main/native/src/exception.c:
 In function ‘terror’:                                                          
                                                                                
                                
[WARNING] 
/hadoop-3.2.2-src/hadoop-common-project/hadoop-common/src/main/native/src/exception.c:118:34:
 error: ‘sys_nerr’ undeclared (first use in this function)                      
                                                                                
                         
[WARNING]   118 |   if ((errnum < 0) || (errnum >= sys_nerr)) {                 
                                                                                
                                                                                
                                                
[WARNING]       |                                  ^~~~~~~~                     
                                                                                
                                                                                
                                                
[WARNING] 
/hadoop-3.2.2-src/hadoop-common-project/hadoop-common/src/main/native/src/exception.c:118:34:
 note: each undeclared identifier is reported only once for each function it 
appears in                                                                      
                            
[WARNING] 
/hadoop-3.2.2-src/hadoop-common-project/hadoop-common/src/main/native/src/exception.c:121:10:
 error: ‘sys_errlist’ undeclared (first use in this function)                   
                                                                                
                         
[WARNING]   121 |   return sys_errlist[errnum];                                 
                                                                                
                                                                                
                                                
[WARNING]       |          ^~~~~~~~~~~                                          
                                                                                
                                                                                
                                                
[WARNING] 
/hadoop-3.2.2-src/hadoop-common-project/hadoop-common/src/main/native/src/exception.c:123:1:
 warning: control reaches end of non-void function [-Wreturn-type]              
                                                                                
                          
[WARNING]   123 | }                                                             
                                                                                
                                                                                
                                                
[WARNING]       | ^                                                             
                                                                                
                                                                                
                                                
[WARNING] make[2]: *** [CMakeFiles/hadoop_static.dir/build.make:82: 
CMakeFiles/hadoop_static.dir/main/native/src/exception.c.o] Error 1             
                                                                                
                                                            
[WARNING] make[1]: *** [CMakeFiles/Makefile2:99: 
CMakeFiles/hadoop_static.dir/all] Error 2                                       
                                                                                
                                                                               
[WARNING] make[1]: *** Waiting for unfinished jobs.... 

{code}
So they are no problem with pthreads but the use from hadoop of deprecated 
glibc method {color:#4c9aff}{{sys_errlist}}{color} ref: 
[https://stackoverflow.com/questions/33948508/why-is-sys-errlist-deprecated-in-glibc]

> Fail to build hadoop-common from source on Fedora
> -------------------------------------------------
>
>                 Key: HADOOP-17708
>                 URL: https://issues.apache.org/jira/browse/HADOOP-17708
>             Project: Hadoop Common
>          Issue Type: Bug
>            Reporter: Jonathan mercier
>            Priority: Major
>
> Dear I tried to build hadoop from source with a vanilla fedora 34
> {code:bash}
> dnf group install -y "Development Tools" \
>  && dnf install -y java-1.8.0-openjdk-devel fuse-devel snappy-java 
> snappy-devel jansson-devel protobuf zlib-devel libzstd-devel \
>                    maven-1:3.6.3 cmake gcc-c++ ant protobuf-compiler 
> protobuf-java slf4j 
> export JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.292.b10-0.fc34.x86_64/
> export MAVEN_OPTS="-Xms2048M -Xmx4096M"
> export 
> PATH="/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.292.b10-0.fc34.x86_64/bin/:$PATH"
> export CC=/usr/bin/gcc
> export CXX=/usr/bin/g++
> curl -LO 
> https://apache.mediamirrors.org/hadoop/common/hadoop-3.2.2/hadoop-3.2.2-src.tar.gz
> tar xf hadoop-3.2.2-src.tar.gz && cd hadoop-3.2.2-src
> mvn package -Pdist,native -Drequire.snappy=true  -DskipTests -Dtar
> {code}
> But I have this error
> {code:java}
>     at org.apache.hadoop.maven.plugin.cmakebuilder.CompileMojo.runMake 
> (CompileMojo.java:229)                                                        
>                                                                               
>                                                              
>     at org.apache.hadoop.maven.plugin.cmakebuilder.CompileMojo.execute 
> (CompileMojo.java:98)                                                         
>                                                                               
>                                                              
>     at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo 
> (DefaultBuildPluginManager.java:137)                                          
>                                                                               
>                                                                
>     at org.apache.maven.lifecycle.internal.MojoExecutor.execute 
> (MojoExecutor.java:210)                                                       
>                                                                               
>                                                                     
>     at org.apache.maven.lifecycle.internal.MojoExecutor.execute 
> (MojoExecutor.java:156)                                                       
>                                                                               
>                                                                     
>     at org.apache.maven.lifecycle.internal.MojoExecutor.execute 
> (MojoExecutor.java:148)                                                       
>                                                                               
>                                                                     
>     at 
> org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject 
> (LifecycleModuleBuilder.java:117)                                             
>                                                                               
>                                                      
>     at 
> org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject 
> (LifecycleModuleBuilder.java:81)                                              
>                                                                               
>                                                      
>     at 
> org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build
>  (SingleThreadedBuilder.java:56)                                              
>                                                                               
>                                        
>     at org.apache.maven.lifecycle.internal.LifecycleStarter.execute 
> (LifecycleStarter.java:128)                                                   
>                                                                               
>                                                                 
>     at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)        
>                                                                               
>                                                                               
>                                                       
>     at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)        
>                                                                               
>                                                                               
>                                                       
>     at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)          
>                                                                               
>                                                                               
>                                                       
>     at org.apache.maven.cli.MavenCli.execute (MavenCli.java:957)              
>                                                                               
>                                                                               
>                                                       
>     at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:289)               
>                                                                               
>                                                                               
>                                                       
>     at org.apache.maven.cli.MavenCli.main (MavenCli.java:193)                 
>                                                                               
>                                                                               
>                                                       
>     at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)           
>                                                                               
>                                                                               
>                                                       
>     at sun.reflect.NativeMethodAccessorImpl.invoke 
> (NativeMethodAccessorImpl.java:62)                                            
>                                                                               
>                                                                               
>    
>     at sun.reflect.DelegatingMethodAccessorImpl.invoke 
> (DelegatingMethodAccessorImpl.java:43)                                        
>                                                                               
>                                                                              
>     at java.lang.reflect.Method.invoke (Method.java:498)                      
>                                                                               
>                                                                               
>                                                       
>     at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced 
> (Launcher.java:282)                                                           
>                                                                               
>                                                             
>     at org.codehaus.plexus.classworlds.launcher.Launcher.launch 
> (Launcher.java:225)                                                           
>                                                                               
>                                                                     
>     at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode 
> (Launcher.java:406)                                                           
>                                                                               
>                                                           
>     at org.codehaus.plexus.classworlds.launcher.Launcher.main 
> (Launcher.java:347)                                                           
>                                                                               
>                                                                       
> [ERROR]                                                                       
>                                                                               
>                                                                               
>                                                       
> [ERROR]                                                                       
>                                                                               
>                                                                               
>                                                       
> [ERROR] For more information about the errors and possible solutions, please 
> read the following articles:                                                  
>                                                                               
>                                                        
> [ERROR] [Help 1] 
> http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException       
>                                                                               
>                                                                               
>                                      
> [ERROR]                                                                       
>                                                                               
>                                                                               
>                                                       
> [ERROR] After correcting the problems, you can resume the build with the 
> command                                                                       
>                                                                               
>                                                            
> [ERROR]   mvn <args> -rf :hadoop-common                                       
>                       
> {code}
> If we take a look to cmake log
> I have:
> {code:c}
> gmake[1]: *** [CMakeFiles/cmTC_82239.dir/build.make:106: cmTC_82239] Error 1  
>                                                                               
>                                                                               
>                                                       
> gmake[1]: Leaving directory 
> '/hadoop-3.2.2-src/hadoop-common-project/hadoop-common/target/native/CMakeFiles/CMakeTmp'
>                                                                               
>                                                                               
>                
> gmake: *** [Makefile:140: cmTC_82239/fast] Error 2                            
>                                                                               
>                                                                               
>                                                       
>                                                                               
>                                                                               
>                                                                               
>                                                       
>                                                                               
>                                                                               
>                                                                               
>                                                       
> Source file was:                                                              
>                                                                               
>                                                                               
>                                                       
> #include <pthread.h>                                                          
>                                                                               
>                                                                               
>                                                       
>                                                                               
>                                                                               
>                                                                               
>                                                       
> static void* test_func(void* data)                                            
>                                                                               
>                                                                               
>                                                       
> {                                                                             
>                                                                               
>                                                                               
>                                                       
>   return data;                                                                
>                                                                               
>                                                                               
>                                                       
> }                                                                             
>                                                                               
>                                                                               
>                                                       
>                                                                               
>                                                                               
>                                                                               
>                                                       
> int main(void)                                                                
>                                                                               
>                                                                               
>                                                       
> {                                                                             
>                                                                               
>                                                                               
>                                                       
>   pthread_t thread;                                                           
>                                                                               
>                                                                               
>                                                       
>   pthread_create(&thread, NULL, test_func, NULL);                             
>                                                                               
>                                                                               
>                                                       
>   pthread_detach(thread);                                                     
>                                                                               
>                                                                               
>                                                       
>   pthread_cancel(thread);                                                     
>                                                                               
>                                                                               
>                                                       
>   pthread_join(thread, NULL);                                                 
>                                                                               
>                                                                               
>                                                       
>   pthread_atfork(NULL, NULL, NULL);                                           
>                                                                               
>                                                                               
>                                                       
>   pthread_exit(NULL);                                                         
>                                                                               
>                                                                               
>                                                       
>                                                                               
>                                                                               
>                                                                               
>                                                       
>   return 0;                                                                   
>                                                                               
>                                                                               
>                                                       
> }                                                                             
>                                                                               
>                                                                               
>                                                       
>                                                                               
>                                                                               
>                                                                               
>                                                       
> Determining if the function pthread_create exists in the pthreads failed with 
> the following output:                                                         
>                                                                               
>                                                       
> Change Dir: 
> /hadoop-3.2.2-src/hadoop-common-project/hadoop-common/target/native/CMakeFiles/CMakeTmp
>                                                                               
>                                                                               
>                                  
>                                                                               
>                                                                               
>                                                                               
>                                                       
> Run Build Command(s):/usr/bin/gmake cmTC_2b9ff/fast && /usr/bin/gmake  -f 
> CMakeFiles/cmTC_2b9ff.dir/build.make CMakeFiles/cmTC_2b9ff.dir/build          
>                                                                               
>                                                           
> gmake[1]: Entering directory 
> '/hadoop-3.2.2-src/hadoop-common-project/hadoop-common/target/native/CMakeFiles/CMakeTmp'
>                                                                               
>                                                                               
>               
> Building C object CMakeFiles/cmTC_2b9ff.dir/CheckFunctionExists.c.o           
>                                                                               
>                                                                               
>                                                       
> /usr/bin/cc   -DCHECK_FUNCTION_EXISTS=pthread_create -o 
> CMakeFiles/cmTC_2b9ff.dir/CheckFunctionExists.c.o -c 
> /usr/share/cmake/Modules/CheckFunctionExists.c                                
>                                                                               
>                        
> Linking C executable cmTC_2b9ff                                               
>                                                                               
>                                                                               
>                                                       
> /usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_2b9ff.dir/link.txt 
> --verbose=1                                                                   
>                                                                               
>                                                              
> /usr/bin/cc  -DCHECK_FUNCTION_EXISTS=pthread_create -rdynamic 
> CMakeFiles/cmTC_2b9ff.dir/CheckFunctionExists.c.o -o cmTC_2b9ff  -lpthreads   
>                                                                               
>                                                                       
> /usr/bin/ld: cannot find -lpthreads                                           
>                                                                               
>                                                                               
>                                                       
> collect2: error: ld returned 1 exit status                                    
>                                                                               
>                                                                               
>                                                       
> gmake[1]: *** [CMakeFiles/cmTC_2b9ff.dir/build.make:106: cmTC_2b9ff] Error 1  
>                                                                               
>                                                                               
>                                                       
> gmake[1]: Leaving directory 
> '/hadoop-3.2.2-src/hadoop-common-project/hadoop-common/target/native/CMakeFiles/CMakeTmp'
>                                                                               
>                                                                               
>                
> gmake: *** [Makefile:140: cmTC_2b9ff/fast] Error 2 
> {code}
> and if I create the C code shown above and build with `-lpthread` that works 
> fine
> So as I use cmake 3.19.7, is it an old cmake bug ?
> Thanks for your help
> best regards



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to