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

Create image for building packages #4

Open
nuest opened this issue Nov 15, 2019 · 4 comments
Open

Create image for building packages #4

nuest opened this issue Nov 15, 2019 · 4 comments

Comments

@nuest
Copy link
Owner

nuest commented Nov 15, 2019

I would like to install the sf library to Renjin, and one of the problems is the dependency on units:

Steps:

See mjkallens answer to a similar question here. Basically what you do is

download the source code for the latest version of ctsmr
Unpack to a dir of choice
Add a pom.xml file that calls the renjin maven plugin
Add a Vagrant file similar to the one use to build the Renjin project itself to get the right versions of gcc etc. so that the renjin maven plugin can process the c and fortran sources.
start vagrant and run mvn clean install

That should also be possible in a container...

@nuest
Copy link
Owner Author

nuest commented Nov 15, 2019

Problem:

root@e7afdc5d121c:/packages/units/units# mvn clean install
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by com.google.inject.internal.cglib.core.$ReflectUtils$1 (file:/usr/share/maven/lib/guice.jar) to method java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int,java.security.ProtectionDomain)
WARNING: Please consider reporting this to the maintainers of com.google.inject.internal.cglib.core.$ReflectUtils$1
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
[INFO] Scanning for projects...
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building units 0.6-5
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ units ---
[INFO] Deleting /packages/units/units/target
[INFO] 
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ units ---
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory /packages/units/units/src/main/resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.2:compile (default-compile) @ units ---
[INFO] No sources to compile
[INFO] 
[INFO] --- renjin-maven-plugin:0.9.2726:gnur-compile (gnur-compile) @ units ---
EXECUTING: -print-file-name=plugin
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.430 s
[INFO] Finished at: 2019-11-15T14:27:18+00:00
[INFO] Final Memory: 13M/60M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.renjin:renjin-maven-plugin:0.9.2726:gnur-compile (gnur-compile) on project units: Failed to unpack GCC Bridge Plugin: Cannot run program "gcc-4.7" (in directory "/tmp/1573828038894-0"): error=2, No such file or directory -> [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/MojoExecutionException

_Do I really net to get gcc-4.7 to work?

Looking at renjin's source code, it seems like it, 4.7 is hardcoded into the "gcc-bridge": https://github.com/bedatadriven/renjin/search?q=gcc-4.7&unscoped_q=gcc-4.7



Maybe installing from source is the only option...

@nuest
Copy link
Owner Author

nuest commented Nov 15, 2019

With a Dockerfile based on ubuntu:xenial, I get further:

[...]

Downloaded: https://nexus.bedatadriven.com/content/groups/public/org/sonatype/aether/aether-impl/1.13.1/aether-impl-1.13.1.jar (128 KB at 7.4 KB/sec)
EXECUTING: -print-file-name=plugin
EXECUTING: -shared -xc++ -I/usr/lib/gcc/x86_64-linux-gnu/4.7/plugin/include -fPIC -fno-rtti -O2 plugin.c -lstdc++ -shared-libgcc -o /packages/units/units/target/bridge.so
configure: units: 0.6-4
Warning: unsupported configuration variable CFLAGS
Warning: unsupported configuration variable CPPFLAGS
Warning: unsupported configuration variable LDFLAGS
Warning: unsupported configuration variable CXXFLAGS
checking whether the C++ compiler works... yes
checking for C++ compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C++ compiler... yes
checking whether g++-4.7 accepts -g... yes
checking how to run the C++ preprocessor... g++-4.7 -E
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for stdbool.h that conforms to C99... yes
checking for _Bool... no
checking for error_at_line... yes
checking for gcc... gcc-4.7
checking whether we are using the GNU C compiler... yes
checking whether gcc-4.7 accepts -g... yes
checking for gcc-4.7 option to accept ISO C89... none needed
checking for XML_ParserCreate in -lexpat... no
checking udunits2.h usability... yes
checking udunits2.h presence... yes
checking for udunits2.h... yes
checking for ut_read_xml in -ludunits2... yes
configure: creating ./config.status
config.status: creating src/Makevars
Checking wether in Makevars CXX_STD is set to CXX11... no
g++-4.7 -I/packages/units/units/target/gnur/include -DNDEBUG -DUDUNITS2_DIR=0    -I"/packages/units/units/target/include"    -fpic  -m32 -fplugin=/packages/units/units/target/bridge.so -DRENJIN  -fno-inline-functions  -fdisable-tree-einline -g  -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -g  -c udunits.cpp -o udunits.o
cc1plus: note: disable pass tree-einline for functions in the range of [0, 4294967295]
udunits.cpp:11:18: fatal error: Rcpp.h: No such file or directory
compilation terminated.
/packages/units/units/target/gnur/etc/Makeconf:202: recipe for target 'udunits.o' failed
make: *** [udunits.o] Error 1
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 02:20 min
[INFO] Finished at: 2019-11-15T15:27:52+00:00
[INFO] Final Memory: 17M/445M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.renjin:renjin-maven-plugin:0.9.2726:gnur-compile (gnur-compile) on project units: Compilation of GNU R sources failed: Failed to execute Makefile -> [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/MojoExecutionException
root@987c61d45fbf:/packages/units/units# exit

I did run library('org.renjin.cran:Rcpp') without error before running mvn clean install.

Maybe I need to configure the compilation process, cf. https://github.com/bedatadriven/libxml2/blob/master/pom.xml#L40

@akbertram any idea what might be going wrong here?

nuest added a commit that referenced this issue Nov 15, 2019
@nuest
Copy link
Owner Author

nuest commented Nov 22, 2019

Still no idea how to progress here... asked on SO: https://stackoverflow.com/questions/58996151/rccp-h-not-found-in-renjin-when-compiling-package

@akbertram
Copy link

Answered on stack overflow.

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

No branches or pull requests

2 participants