eclipse-iceoryx / iceoryx

Eclipse iceoryx™ - true zero-copy inter-process-communication
https://iceoryx.io
Apache License 2.0
1.6k stars 373 forks source link

Add maven and openjdk-14-jdk-headless as build prerequisites #525

Closed yannlabou closed 3 years ago

yannlabou commented 3 years ago

As a first time user, I intuitively build iceoryx with ./tools/iceoryx_build_test.sh debug build-all. This unfortunately fails with

CMake Error at /usr/local/share/cmake-3.18/Modules/FindPackageHandleStandardArgs.cmake:165 (message):
  Could NOT find Maven (missing: Maven_EXECUTABLE Maven_VERSION) (Required is
  at least version "3.0")
Call Stack (most recent call first):
  /usr/local/share/cmake-3.18/Modules/FindPackageHandleStandardArgs.cmake:458 (_FPHSA_FAILURE_MESSAGE)
  idlpp/cmake/modules/FindMaven.cmake:77 (find_package_handle_standard_args)
  idlpp/idlc/CMakeLists.txt:6 (find_package)

-- Configuring incomplete, errors occurred!
See also "/home/lya2abt/dev/iceoryx/build/dependencies/idlpp-cxx/build/CMakeFiles/CMakeOutput.log".
See also "/home/lya2abt/dev/iceoryx/build/dependencies/idlpp-cxx/build/CMakeFiles/CMakeError.log".
CMake Error at /home/lya2abt/dev/iceoryx/cmake/cyclonedds/CMakeLists.txt:77 (message):
  CMake step [configure] for idlpp-cxx failed: 1
Call Stack (most recent call first):
  /home/lya2abt/dev/iceoryx/cmake/cyclonedds/CMakeLists.txt:90 (fetch_and_install)

I agree that it's mentioned in iceoryx/iceoryx_dds/README.md but it's not obvious for non CMake frequent users.

dkroenke commented 3 years ago

Hi, good point, we can test with dpkg -s <packagename> beforehand if the needed dependencies are installed on the system and can print a meaningful error message if not.

elfenpiff commented 3 years ago

@dkroenke We should update the dds docu within this issue, since our DDS docu is still mentioning the build scripts but they should be used only by the internal CI and in our release process. Everyone else should use iceoryx_meta.

@yannlabou Could you please use in the future the following build commands till we updated our documentation:

cd iceoryx
cmake -Bbuild -Hiceoryx_meta -DDDS_GATEWAY=ON -DEXAMPLES=ON
cd build
make
yannlabou commented 3 years ago

@elfenpiff Yes I did. My main issue here is that the build will fail since I'm on Ubuntu 18.04 with openjdk-11. DDS_GATEWAY requires openjdk-14. It might be good to document it in the main README.

dkroenke commented 3 years ago

The error message is coming from the external dependency idlpp-cxx because they have there a CMake file which search for maven: find_package(Maven 3.0 REQUIRED). This is generating this error message. We could maybe add a dependency check in iceoryx_meta to have an early check if maven and openjdk are installed.

yannlabou commented 3 years ago

Note for my future self and others working in a corporate environment Even after having installed maven and openjdk, I ended up with the following error:

[  1%] Building JAR file /home/lya2abt/dev/iceoryx/build/dependencies/idlpp-cxx/build/idlpp/idlc/target/idlcpp-c-jar-with-dependencies.jar
[ERROR] Plugin org.apache.maven.plugins:maven-antrun-plugin:1.8 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-antrun-plugin:jar:1.8: Could not transfer artifact org.apache.maven.plugins:maven-antrun-plugin:pom:1.8 from/to central (https://repo.maven.apache.org/maven2): repo.maven.apache.org: Name or service not known: Unknown host repo.maven.apache.org: Name or service not known -> [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/PluginResolutionException
idlpp/idlc/CMakeFiles/idlcpp_c.dir/build.make:80: recipe for target 'idlpp/idlc/CMakeFiles/idlcpp_c' failed
make[2]: *** [idlpp/idlc/CMakeFiles/idlcpp_c] Error 1
CMakeFiles/Makefile2:222: recipe for target 'idlpp/idlc/CMakeFiles/idlcpp_c.dir/all' failed
make[1]: *** [idlpp/idlc/CMakeFiles/idlcpp_c.dir/all] Error 2
Makefile:170: recipe for target 'all' failed
make: *** [all] Error 2
CMake Error at /home/lya2abt/dev/iceoryx/cmake/cyclonedds/CMakeLists.txt:84 (message):
  Build step [build and install] for idlpp-cxx failed: 2
Call Stack (most recent call first):
  /home/lya2abt/dev/iceoryx/cmake/cyclonedds/CMakeLists.txt:90 (fetch_and_install)

It turns out I had to configure the proxy settings for maven at /etc/maven/settings.xml.

elBoberido commented 3 years ago

It seems they are working to remove the Java dependency https://github.com/eclipse-cyclonedds/cyclonedds/issues/539 I hope it doesn't take to long

elfenpiff commented 3 years ago

@dkroenke I did take a look at find_package(Maven 3.0 REQUIRED) but as it seems maven does not offer a cmake find_package file. So I will just mention this in our docu.