Hi all,
I have a working package for linux, including fortran 95 code compiled with
g95,
that I need to port to OS X. The package works on Linux and seems to load on
the Mac,
but when I try to run a function that calls C or Fortran I'm told that the
symbol is not loaded.
I'm developing via a shell account on an OS X system, I don't have
access to
a desktop.
The set up is:
R 2.1.0 Patched (2005-05-12).
Darwin Kernel Version 8.1.0
G95 (GCC 4.0.0 20050124 (experimental) (g95!) 06/20/05)
Here is the Makefile:
F90_FILES=\
dbest_dbase_class.f90 \
...
r_estimate.f90 \
FORTRAN_FILES=\
dgletc.f \
...
mecdf.f
C_FILES=init.c
CFLAGS=-g -fPIC
%.o: %.f90
g95 -c -g $<
%.o: %.f
g95 -c -g $<
%.o: %.c
gcc -c -g $<
bpkg.so: $(F90_FILES:%.f90=%.o) $(C_FILES:%.c=%.o) $(FORTRAN_FILES:%.f=%.o)
g95 -L/Library/Frameworks -o $@ $^ -L/Library/Frameworks/R.framewo\
rk/Resources
-----end makefile------------------------
Here is the relevant output of R CMD CHECK:
* checking for working latex ...sh: line 1: latex: command not found
NO
* using log directory '/Users/jbremson/dev/bpkg.Rcheck'
* using R version 2.1.0, 2005-05-12
* checking for file 'bpkg/DESCRIPTION' ... OK
* this is package 'bpkg' version '1.0-1'
* checking if this is a source package ... OK
* Installing *source* package 'bpkg' ...
** libs
g95 -c -g dbest_dbase_class.f90
g95 -c -g cm_class.f90
...
gcc -c -g init.c
init.c: In function 'R_g95_init':
init.c:22: warning: incompatible implicit declaration of built-in function
'strdup'
g95 -c -g dgletc.f
g95 -c -g dglfgb.f
g95 -c -g dglfg.f
g95 -c -g dglfgb.f
g95 -c -g dglfg.f
g95 -c -g dmdc.f
g95 -c -g mecdf.f
g95 -shared -L/Library/Frameworks -o bpkg.so dbest_dbase_class.o cm_class.o
bgw_cla\
ss.o cm_mle_class.o pcm_dglg_o1.o cm_main.o r_estimate.o init.o dgletc.o
dglfgb.o dg\
lfg.o dmdc.o mecdf.o -L/Library/Frameworks/R.framework/Resources
g95: unrecognized option '-shared'
** R
** data
** help>>> Building/Updating help pages for package 'bpkg'
Formats: text html latex example
estimate.model text html latex example
** building package indices ...
* DONE (bpkg)
* checking package directory ... OK
* checking for portable file names ... OK
* checking for sufficient/correct file permissions ... OK
* checking DESCRIPTION meta-information ... OK
* checking package dependencies ... OK
* checking index information ... WARNING
Empty file 'INDEX'.
See the information on INDEX files and package subdirectories in section
'Creating R packages' of the 'Writing R Extensions' manual.
* checking package subdirectories ... OK
* checking R files for syntax errors ... OK
* checking R files for library.dynam ... OK
* checking S3 generic/method consistency ... WARNING
Error: package/namespace load failed for 'bpkg'
Call sequence:
2: stop(gettextf("package/namespace load failed for '%s'",
libraryPkgName(package)),\
call. = FALSE, domain = NA)
1: library(package, lib.loc = lib.loc, character.only = TRUE, verbose =
FALSE)
Execution halted
See section 'Generic functions and methods' of the 'Writing R
Extensions'
manual.
See section 'Generic functions and methods' of the 'Writing R
Extensions'
manual.
* checking replacement functions ... WARNING
Error: package/namespace load failed for 'bpkg'
Call sequence:
2: stop(gettextf("package/namespace load failed for '%s'",
libraryPkgName(package)),\
call. = FALSE, domain = NA)
1: library(package, lib.loc = lib.loc, character.only = TRUE, verbose =
FALSE)
Execution halted
In R, the argument of a replacement function which corresponds to the right
hand side must be named 'value'.
* checking foreign function calls ... WARNING
Error: package/namespace load failed for 'bpkg'
Call sequence:
2: stop(gettextf("package/namespace load failed for '%s'",
libraryPkgName(package)),\
call. = FALSE, domain = NA)
1: library(package, lib.loc = lib.loc, character.only = TRUE, verbose =
FALSE)
Execution halted
See section 'System and foreign language interfaces' of the 'Writing
R
Extensions' manual.
* checking Rd files ... OK
* checking for missing documentation entries ... ERROR
Error: package/namespace load failed for 'bpkg'
-----EOF----
Obviously, there is a package/namespace load filed. I looked at the
mentioned R documentation and didn't find anything I thought relevant. Here
is the NAMESPACE file for good measure. The package is called bpkg.
-------------------------------
useDynLib(bpkg)
export(dummy,estimate.model,em2)
-----EOF-------------------
I have checked the bpkg.so file with nm and the symbols for all functions
are present.
How can I get R to see the symbols for the package?
Regards,
Joel Bremson
Graduate Student
UC Davis
[[alternative HTML version deleted]]