Comments (11)
It seems that your compiler or R might not have been set up properly. Would you please try whether you can properly compile any C code using R CMD SHLIB?
Many thanks!
Bee-Chung
from latent-factor-models.
It works well using R CMD SHLIB to compile C code.
Appreciated!
guozhi.zou
from latent-factor-models.
Could you copy paste the output of a successful run of R CMD SHLIB of any C code?
Could you try R CMD SHLIB src/C/util.c?
from latent-factor-models.
nalideMacBook-Pro:C nali$ R CMD SHLIB util.c
clang -dynamiclib -Wl,-headerpad_max_install_names -undefined dynamic_lookup -single_module -multiply_defined suppress -L/Library/Frameworks/R.framework/Resources/lib -L/usr/local/lib -o util.so util.o -F/Library/Frameworks/R.framework/.. -framework R -Wl,-framework -Wl,CoreFoundation
It runs well with R CMD SHLIB src/C/util.c
Thanks!
guozhi.zou
from latent-factor-models.
It's so weird! I can compile util.c or factor_model_util.c under directory src/C, but it got a error when Under root directory.
from latent-factor-models.
Got it! Editing R Makeconf to specify your own compiler directory.
from latent-factor-models.
Hi @xinyuwuhenZZ , I got the same issue compiling C in Terminal Program. Would you mind expanding a bit more how you sorting out this error?
from latent-factor-models.
I edited R Makeconf (/Library/Frameworks/R.framework/Versions/3.3/Resources/etc/Makeconf ) to my own gcc name (CC = gcc-5 )
Good luck!
from latent-factor-models.
I am not sure what I did wrong - I tried compiling the program under directory src/C, it runs well. Yet, it doesn't work under top level directory (following is error shown up from the Terminal:)
ld: warning: directory not found for option '-L/usr/local/lib/gcc/x86_64-apple-darwin13.0.0/4.8.2'
ld: library not found for -lgfortran
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[1]: *** [lib/c_funcs.so] Error 1
make: *** [c_funcs] Error 1
i have made changes in R makeconf from like
# configure
...
'CC=clang' 'CXX=clang++' 'OBJC=clang' 'F77=gfortran-4.8' 'FC=gfortran-4.8' 'CFLAGS=-Wall -mtune=core2 -g -O2' 'CXXFLAGS=-Wall -mtune=core2 -g -O2' 'OBJCFLAGS=-Wall -mtune=core2 -g -O2' 'FCFLAGS=-Wall -g -O2' 'F77FLAGS=-Wall -g -O2' '--with-system-zlib' '--enable-memory-profiling' 'CPPFLAGS=-I/usr/local/include -I/usr/local/include/freetype2 -I/opt/X11/include' '--x-libraries=/opt/X11/lib' '--x-includes=/usr/local/include' '--enable-R-framework'/
....
CC = clang
to become as follows
# configure
...
'CC=gcc-6.1.0' 'CXX=clang++' 'OBJC=clang' 'F77=gfortran-4.8' 'FC=gfortran-4.8' 'CFLAGS=-Wall -mtune=core2 -g -O2' 'CXXFLAGS=-Wall -mtune=core2 -g -O2' 'OBJCFLAGS=-Wall -mtune=core2 -g -O2' 'FCFLAGS=-Wall -g -O2' 'F77FLAGS=-Wall -g -O2' '--with-system-zlib' '--enable-memory-profiling' 'CPPFLAGS=-I/usr/local/include -I/usr/local/include/freetype2 -I/opt/X11/include' '--x-libraries=/opt/X11/lib' '--x-includes=/usr/local/include' '--enable-R-framework'/
....
CC = gcc-6.1.0
Yet it still could not compile the C program. This is my setup gcc:
gcc: stable 6.1.0 (bottled), HEAD
GNU compiler collection
https://gcc.gnu.org
and my systems :
ProductName: Mac OS X
ProductVersion: 10.11.1
BuildVersion: 15B42
from latent-factor-models.
CXX=gcc++-6.1.0
from latent-factor-models.
finally thanks @xinyuwuhenZZ , it did work now. Really appreciate ur help!
from latent-factor-models.
Related Issues (15)
- reduce warning messages
- Error while compiling... Absent file 'src/arslogistic/arms.c', needed by `arslogistic' HOT 3
- Running Error HOT 7
- running error
- Running error: Symbol not found: _compute_szuBv_c_single_dense
- Statistical Methods for Recommender Systems (English Edition) HOT 1
- setting issue in multicontext function
- Save indexing info in the model file HOT 1
- Add sample quickstart code to BST-tutorial code
- Remove text redundancy in the tutorial
- Add instruction for all the initial values of variance components in model fitting details
- test.data=null fails HOT 2
- Error in running the tutorial-BST.R code HOT 5
- Error running tutorial
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from latent-factor-models.