我想用仁金编译units
软件包,目前在在线存储库中不起作用,请参见http://packages.renjin.org/package/org.renjin.cran/units/0.6-3/build/5
pom.xml
,请参见https://github.com/nuest/renjin-docker/blob/master/geospatial-packages/units/pom.xml library('org.renjin.cran:Rcpp')
,但是当我在mvn clean install
上运行units
时,出现以下错误:< / li>
[...]
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
有人知道如何告诉Renjin在哪里找到Rcpp.h
吗?
有关我咨询的资源的更多详细信息,请参见GitHub问题:https://github.com/nuest/renjin-docker/issues/4
答案 0 :(得分:1)
如果您使用Maven构建软件包,则还需要添加Rcpp标头作为依赖项:
public partial class Form1 : Form
{
private TableLayoutPanel _tableLayout;
private int _selectedRow = -1;
public Form1()
{
InitializeComponent();
var button = new Button()
{
Text = "Add Text"
};
button.MouseClick += AddText;
this.Controls.Add(button);
_tableLayout = new TableLayoutPanel()
{
Dock = DockStyle.Fill,
AutoScroll = true,
AutoSize = true,
AutoSizeMode = AutoSizeMode.GrowAndShrink,
CellBorderStyle = TableLayoutPanelCellBorderStyle.Single
};
_tableLayout.MouseClick += SelectRow;
this.Controls.Add(_tableLayout);
}
private void SelectRow(object sender, MouseEventArgs e)
{
_selectedRow = GetRowColIndex(_tableLayout, e.Location).Value.Y;
}
private void AddText(object sender, MouseEventArgs e)
{
_tableLayout.ColumnStyles.Add(new ColumnStyle() { SizeType = SizeType.AutoSize });
_tableLayout.RowStyles.Add(new RowStyle() { SizeType = SizeType.AutoSize });
_tableLayout.Controls.Add(new TextBox(), 0, _selectedRow);
}
Point? GetRowColIndex(TableLayoutPanel tlp, Point point)
{
if (point.X > tlp.Width || point.Y > tlp.Height)
return null;
int w = tlp.Width;
int h = tlp.Height;
int[] widths = tlp.GetColumnWidths();
int i;
for (i = widths.Length - 1; i >= 0 && point.X < w; i--)
w -= widths[i];
int col = i + 1;
int[] heights = tlp.GetRowHeights();
for (i = heights.Length - 1; i >= 0 && point.Y < h; i--)
h -= heights[i];
int row = i + 1;
return new Point(col, row);
}
}
您可以使用plyr的pom文件作为示例。
请注意,如果您只想构建与Renjin一起使用的软件包,则命令行工具要简单得多:
<dependency>
<groupId>org.renjin.cran</groupId>
<artifactId>Rcpp</artifactId>
<version>0.12.13-renjin-15</version>
<classifier>headers</classifier>
<scope>provided</scope>
</dependency>
这将负责下载所需的依赖项并生成一个jar文件。
请注意,Renjin不支持依赖于外部本机库的软件包。您可以从automated build logs中看到,由于依赖udunits2,units软件包将失败。
这就是在我们的打包站点中单位打包为labeled as incompatible的原因。