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:

larry-tais-mac-mini:~/dev jbremson$ R CMD CHECK bpkg
* 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 ... WARNING
Subdirectory 'bpkg/src' contains object files.

* Installing *source* package 'bpkg' ...
** libs
g95 -L/Library/Frameworks -o bpkg.so dbest_dbase_class.o cm_class.o 
bgw_class.o cm_mle_class.o pcm_dglg_o1.o cm_main.o r_estimate.o init.o 
dgletc.o dglfgb.o dglfg.o dmdc.o
mecdf.o-L/Library/Frameworks/R.framework/Resources
** 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.
* 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

I was told to use the .dylib extension instead of .so but the R CMD CHECK 
doesn't
get as far and there is an error message about how it "can't copy bpkg.so" 
even though the
makefile target is for bpkg.dylib. 



How can I get R to load the namespace for the package?

Also, any tips on how to proceed in general would be appreciated. I'm new
to development for the mac and would like to find good online references.


Regards,

Joel Bremson
Graduate Student
UC Davis

	[[alternative HTML version deleted]]

