Skip to content

Commit

Permalink
Merge pull request #12 from ralmond/Netica-607
Browse files Browse the repository at this point in the history
Netica 607
  • Loading branch information
ralmond authored Apr 16, 2020
2 parents 7826fd0 + 10c5410 commit de6b5d5
Show file tree
Hide file tree
Showing 16 changed files with 530 additions and 119 deletions.
23 changes: 23 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#*#
*.o
*~
.Rproj.user
.Rhistory
.RData
.Ruserdata
src/*.o
src/*.so
src/*.dll

autom4te.cache
config.log
config.status

Makevars

aclocal.m4
./
config.h
#DESCRIPTION#
.Rbuildignore
symbols.rds
12 changes: 12 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
2020-04-16 Russell Almond <ralmond@pei>

* src/Makevars.in (PKG_CFLAGS): Added -DNETICA_VERSION here. I still don't understand autoconf.

* src/Experience.c (NewLearner_rn): Added switch for Ascent/descent

2020-04-16 Russell Almond <ralmond@Cherry>

* configure.ac: Changed compile procedure to (a) use pkg-config
when available and (b) use a NETICA_VERSION flag, as NETICA
doesn't seem to supply this.

2020-03-09 Russell Almond <ralmond@Cherry>

* R/Networks.R ("NetworkName<-"): Same problem, different place.
Expand Down
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: RNetica
Version: 0.8-2
Date: 2020/03/09
Date: 2020/04/16
Title: R interface to Netica(R) Bayesian Network Engine
Author: Russell Almond
Maintainer: Russell Almond <ralmond@fsu.edu>
Expand Down
62 changes: 59 additions & 3 deletions INSTALLATION
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,81 @@ rather than the object version of RNetica.

The current version does not automatically download the Netica API,
you need to download and unzip it yourself. You also need to point
the installation at the place where it is located.
the installation at the place where it is located.

The current latest versions are:
Linux: https://norsys.com/downloads/NeticaAPI_Linux_607.zip
Windows: https://norsys.com/downloads/NeticaAPI_Win_510.zip
MacOS: https://norsys.com/downloads/NeticaAPI_Mac.zip
or https://norsys.com/downloads/NeticaJ_MacOSX10.7_504.zip


Linux and MacOS X. The appropriate libnetica.so file from the Netica
tarball needs to be copied into a directory where R can find it when
loading. Under Ubuntu 18.04, the choices seem to be /usr/lib,
/usr/share/lib, and ${R_HOME}/lib.

=====================================

As of 2020, Norsys is making available a version 6.07 of the API,
currenlty only out for Linux, but probably available soon for MacOS
and Windows. There are some slight difference in the header files and
shared library locations between the two, so it is necessary for the
configuration file to pickup which version you are using.

The best way to do this is using the pkg-config mechanism. This works
on all three platforms, but may need to be installed.

I have included a netica.pc config file, this should be (a) edited so
the first line points to where the Netica API lives (in my case in a
directory under my home directory) and then (b) moved to somewhere
where pkg-config can find it. (If pkg-config is configured correctly,
then `pkg-config -variable pc_path pkg-config` should reveal the
localtion of the pkg-config packages.

The file netica504.pc is for the older version of the API (still most
recent for MacOS and Windows). If you are using that version, then
rename the files (so it will be easy to replace when you upgrade).
Netica_5.04 is not recommended because of the bug in the absorb nodes
function, but it is still necesary until Norsys releases new
versions of the DLL/shared library for Windows/MacOS.

================================================================

These describe the older mechanism, now replaced by pkg-config.

On Linux and Unix (including Mac OS X) distributions you do that with
the "--with-netica" switch to configure. Thus I compile with

R CMD INSTALL RNetica --configure-args='--with-netica=/home/ralmond/software/Netica_API_607'
R CMD INSTALL RNetica --configure-args='--with-netica=/home/ralmond/software/Netica_API_504'

To check I run with

R CMD check RNetica --install-args="--configure-args='--with-netica=/home/ralmond/software/Netica_API_607'"
R CMD check RNetica --install-args="--configure-args='--with-netica=/home/ralmond/software/Netica_API_504'"

For Windows installations, set an environmental variable NETICA_HOME
with the path in which you unpacked the Netica API. R will give a
warning about manual configuration, this is the necessary manual
configuration.

===================================================


If you have obtained a valid Netica API license key from Norsys, you
can insert it in the variable NeticaLicenseKey in the main workspace.
RNetica will then consult this value when loading the Netica DLL. All
of the functions in the man pages work in the unlicensed version, so R
CMD check RNetica does not require a license key.

As of version 0.6, the startup mechanism now requires the program to
explicitly call:
sess <- NeticaSession()
startSession(sess)

In particular, this exposes the session object which contains
references to all available networks. The licence key can be passed
as an optional argument to NeticaSession:
sess <- NeticaSession(LicenseKey=NeticaLicenceKey).

I've been keeping the license key in a file NeticaLicense.R in my home
directory, which I source at the begining of each session.
37 changes: 20 additions & 17 deletions RNetica.Rproj
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@
Version: 1.0

RestoreWorkspace: Default
SaveWorkspace: Default
AlwaysSaveHistory: Default

EnableCodeIndexing: Yes
UseSpacesForTab: Yes
NumSpacesForTab: 2
Encoding: UTF-8

RnwWeave: Sweave
LaTeX: pdfLaTeX

BuildType: Package
PackageUseDevtools: Yes
PackageInstallArgs: --no-multiarch --with-keep.source
Version: 1.0

RestoreWorkspace: Default
SaveWorkspace: Default
AlwaysSaveHistory: Default

EnableCodeIndexing: Yes
UseSpacesForTab: Yes
NumSpacesForTab: 2
Encoding: UTF-8

RnwWeave: Sweave
LaTeX: pdfLaTeX

BuildType: Package
PackageUseDevtools: Yes
PackageInstallArgs: --no-multiarch --with-keep.source --configure-args='--with-netica=/home/ralmond/software/Netica_API_607'
PackageBuildArgs: --configure-args='--with-netica=/home/ralmond/software/Netica_API_607'
PackageBuildBinaryArgs: --configure-args='--with-netica=/home/ralmond/software/Netica_API_607'
PackageCheckArgs: --install-args="--configure-args='--with-netica=/home/ralmond/software/Netica_API_607'"
2 changes: 1 addition & 1 deletion cleanup
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/bin/sh

rm -f *~ src/*~ src/*.o src/*.so src/symbols.rds man/*~ R/*~ config.* src/Makevars
rm -f *~ src/*~ src/*.o src/*.so src/symbols.rds man/*~ R/*~ config.* src/Makevars src/config.h
Loading

0 comments on commit de6b5d5

Please sign in to comment.