javacpp-presets icon indicating copy to clipboard operation
javacpp-presets copied to clipboard

Failed to configure openssl

Open xiaos opened this issue 3 years ago • 10 comments

I am building the ffmpeg library on Ubuntu 22, with NDK 23. It failed when build openssl.

Here is the build log: `Configuring OpenSSL version 3.0.2 for target android-arm64 Using os-specific seed configuration

Failure! build file wasn't produced. Please read INSTALL.md and associated NOTES-* files. You may also have to look over your available compiler tool chain or change your configuration.

$ANDROID_NDK=/home/ubuntu/Android/android-ndk-r23c is invalid at (eval 10) line 27.`

xiaos avatar Jul 01 '22 14:07 xiaos

Try with NDK r21e instead.

saudet avatar Jul 01 '22 14:07 saudet

Thanks @saudet

Can proceed the build now, but got this error: Is it because pthread_getname_np not found?

`-- Checking for pthread_(g/s)etname_np in 'pthread_np.h': -- Looking for pthread_getname_np -- Looking for pthread_getname_np - not found -- Looking for pthread_setname_np -- Looking for pthread_setname_np - not found -- Checking for pthread_(g/s)etname_np in 'pthread.h': -- Looking for pthread_getname_np -- Looking for pthread_getname_np - not found -- Looking for pthread_setname_np -- Looking for pthread_setname_np - found CMake Error at /usr/share/cmake-3.22/Modules/FindPackageHandleStandardArgs.cmake:230 (message): Could NOT find OpenSSL, try to set the path to OpenSSL root folder in the system variable OPENSSL_ROOT_DIR (missing: OPENSSL_CRYPTO_LIBRARY OPENSSL_INCLUDE_DIR) Call Stack (most recent call first): /usr/share/cmake-3.22/Modules/FindPackageHandleStandardArgs.cmake:594 (_FPHSA_FAILURE_MESSAGE) /usr/share/cmake-3.22/Modules/FindOpenSSL.cmake:574 (find_package_handle_standard_args) CMakeLists.txt:363 (find_package)

-- Configuring incomplete, errors occurred! See also "/home/ubuntu/Workspace/javacpp-presets/ffmpeg/cppbuild/android-arm64/srt-1.4.4/CMakeFiles/CMakeOutput.log". See also "/home/ubuntu/Workspace/javacpp-presets/ffmpeg/cppbuild/android-arm64/srt-1.4.4/CMakeFiles/CMakeError.log". [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 02:40 min [INFO] Finished at: 2022-07-01T15:12:15Z [INFO] ------------------------------------------------------------------------`

xiaos avatar Jul 01 '22 15:07 xiaos

It sounds like OpenSSL still isn't getting built properly. What do you get in cppbuild/android-arm64/lib? There should be libcrypto.a and libssl.a in there.

saudet avatar Jul 02 '22 00:07 saudet

@saudet i can see these artifacts in /lib folder:

cmake libcrypto.a libmp3lame.a libmp3lame.la libopencore-amrnb.a libopencore-amrnb.la libopencore-amrwb.a libopencore-amrwb.la libopus.a libopus.la libspeex.a libspeex.la libssl.a libvo-amrwbenc.a libvo-amrwbenc.la libxml2.a libxml2.la libz.a pkgconfig xml2Conf.sh

xiaos avatar Jul 02 '22 12:07 xiaos

Try with CMake 3.16

saudet avatar Jul 02 '22 12:07 saudet

@saudet I just tried, the same error:

CMake Error at /usr/local/share/cmake-3.16/Modules/FindPackageHandleStandardArgs.cmake:146 (message): Could NOT find OpenSSL, try to set the path to OpenSSL root folder in the system variable OPENSSL_ROOT_DIR (missing: OPENSSL_CRYPTO_LIBRARY OPENSSL_INCLUDE_DIR) Call Stack (most recent call first): /usr/local/share/cmake-3.16/Modules/FindPackageHandleStandardArgs.cmake:393 (_FPHSA_FAILURE_MESSAGE) /usr/local/share/cmake-3.16/Modules/FindOpenSSL.cmake:449 (find_package_handle_standard_args) CMakeLists.txt:363 (find_package)

-- Configuring incomplete, errors occurred! See also "/home/ubuntu/Workspace/javacpp-presets/ffmpeg/cppbuild/android-arm64/srt-1.4.4/CMakeFiles/CMakeOutput.log". See also "/home/ubuntu/Workspace/javacpp-presets/ffmpeg/cppbuild/android-arm64/srt-1.4.4/CMakeFiles/CMakeError.log".

xiaos avatar Jul 02 '22 13:07 xiaos

It works on CentOS, so it sounds like there's something it doesn't like about Ubuntu...

saudet avatar Jul 02 '22 13:07 saudet

@saudet Ok thanks, i will try with CentOS then.

xiaos avatar Jul 02 '22 13:07 xiaos

Hi @saudet , which version of maven are you using? Now i am getting this error:

Jul 02, 2022 3:09:41 PM org.sonatype.guice.bean.reflect.Logs$JULSink warn WARNING: Error injecting: org.moditect.mavenplugin.add.AddModuleInfoMojo com.google.inject.ProvisionException: Guice provision errors:

  1. No implementation for org.eclipse.aether.RepositorySystem was bound. while locating org.moditect.mavenplugin.add.AddModuleInfoMojo

1 error at com.google.inject.internal.InjectorImpl$2.get(InjectorImpl.java:1006) at com.google.inject.internal.InjectorImpl.getInstance(InjectorImpl.java:1032) at org.sonatype.guice.bean.reflect.AbstractDeferredClass.get(AbstractDeferredClass.java:45) at com.google.inject.internal.ProviderInternalFactory.provision(ProviderInternalFactory.java:86) at com.google.inject.internal.InternalFactoryToInitializableAdapter.provision(InternalFactoryToInitializableAdapter.java:55) at com.google.inject.internal.ProviderInternalFactory$1.call(ProviderInternalFactory.java:70) at com.google.inject.internal.ProvisionListenerStackCallback$Provision.provision(ProvisionListenerStackCallback.java:100) at org.sonatype.guice.plexus.lifecycles.PlexusLifecycleManager.onProvision(PlexusLifecycleManager.java:138) at com.google.inject.internal.ProvisionListenerStackCallback$Provision.provision(ProvisionListenerStackCallback.java:109) at com.google.inject.internal.ProvisionListenerStackCallback.provision(ProvisionListenerStackCallback.java:55) at com.google.inject.internal.ProviderInternalFactory.circularGet(ProviderInternalFactory.java:68) at com.google.inject.internal.InternalFactoryToInitializableAdapter.get(InternalFactoryToInitializableAdapter.java:47) at com.google.inject.internal.InjectorImpl$2$1.call(InjectorImpl.java:997) at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1047) at com.google.inject.internal.InjectorImpl$2.get(InjectorImpl.java:993) at com.google.inject.Scopes$1$1.get(Scopes.java:59) at org.sonatype.guice.bean.locators.LazyBeanEntry.getValue(LazyBeanEntry.java:83) at org.sonatype.guice.plexus.locators.LazyPlexusBean.getValue(LazyPlexusBean.java:49) at org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:253) at org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:245) at org.apache.maven.plugin.internal.DefaultMavenPluginManager.getConfiguredMojo(DefaultMavenPluginManager.java:455) at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:92) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59) at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183) at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161) at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320) at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156) at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537) at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196) at org.apache.maven.cli.MavenCli.main(MavenCli.java:141) 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:290) at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230) at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:414) at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:357)

[INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 10:17.254s [INFO] Finished at: Sat Jul 02 15:09:41 UTC 2022 [INFO] Final Memory: 32M/478M [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal org.moditect:moditect-maven-plugin:1.0.0.RC2:add-module-info (add-module-infos) on project ffmpeg: Execution add-module-infos of goal org.moditect:moditect-maven-plugin:1.0.0.RC2:add-module-info failed: Unable to load the mojo 'add-module-info' (or one of its required components) from the plugin 'org.moditect:moditect-maven-plugin:1.0.0.RC2': com.google.inject.ProvisionException: Guice provision errors: [ERROR] [ERROR] 1) No implementation for org.eclipse.aether.RepositorySystem was bound. [ERROR] while locating org.moditect.mavenplugin.add.AddModuleInfoMojo [ERROR] at ClassRealm[plugin>org.moditect:moditect-maven-plugin:1.0.0.RC2, parent: sun.misc.Launcher$AppClassLoader@7852e922] [ERROR] while locating org.apache.maven.plugin.Mojo annotated with @com.google.inject.name.Named(value=org.moditect:moditect-maven-plugin:1.0.0.RC2:add-module-info) [ERROR] [ERROR] 1 error [ERROR] role: org.apache.maven.plugin.Mojo [ERROR] roleHint: org.moditect:moditect-maven-plugin:1.0.0.RC2:add-module-info [ERROR] -> [Help 1] [ERROR] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. [ERROR] Re-run Maven using the -X switch to enable full debug logging. [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/PluginContainerException

xiaos avatar Jul 02 '22 15:07 xiaos

updated the maven, and now build successfully in CentOS, thanks.

xiaos avatar Jul 02 '22 16:07 xiaos