Skip to content

Commit 5272d1d

Browse files
committed
-Now it does not need any library from R
1 parent 3127a82 commit 5272d1d

File tree

3 files changed

+3
-59
lines changed

3 files changed

+3
-59
lines changed

README.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ The development version of DAUMI is at this [page](https://github.com/xiyupeng/A
2828
# Prerequisites <a name = "prerequisites" />
2929

3030
- AmpliCI requires [cmake](https://cmake.org) (3.3.0 or higher version) and [gcc](https://gcc.gnu.org) (5.4.0 or higher version).
31-
- AmpliCI requires some C and FORTRAN libraries provided by R. You can download and install R from [https://www.r-project.org](https://www.r-project.org).
3231

3332

3433
# Installation <a name = "installation" />
@@ -333,6 +332,8 @@ export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/your/full/path/to/library
333332

334333
- AmpliCI contains LOESS regression for error estimation, the original file is available at [https://www.netlib.org/a/dloess](https://www.netlib.org/a/dloess). However, we modified and used related code from R, which derives from the above.
335334

335+
- AmpliCI uses some C and FORTRAN libraries provided by R. The relative codes have been cooperated in the software.
336+
336337
- We used the hash implemented in [uthash.h](https://troydhanson.github.io/uthash/userguide.html).
337338

338339
# Citation <a name = "citation" />

src/CMakeLists.txt

-57
Original file line numberDiff line numberDiff line change
@@ -14,63 +14,6 @@ include(FindPackageHandleStandardArgs)
1414
enable_language(Fortran)
1515
set(CMAKE_FORTRAN_COMPILER gfortran)
1616

17-
# below modified from RStudio's FindLibR.cmake to find R include and lib path
18-
# https://github.com/rstudio/rstudio/blob/master/cmake/modules/FindLibR.cmake
19-
if(APPLE) # mac
20-
21-
find_library(LIBR_LIBRARIES R)
22-
23-
if(LIBR_LIBRARIES MATCHES ".*\\.framework")
24-
set(LIBR_HOME "${LIBR_LIBRARIES}/Resources" CACHE PATH "R home directory")
25-
set(LIBR_INCLUDE_DIRS "${LIBR_HOME}/include" CACHE PATH "R include directory")
26-
set(LIBR_EXECUTABLE "${LIBR_HOME}/bin/R" CACHE PATH "R executable")
27-
else()
28-
get_filename_component(_LIBR_LIBRARIES "${LIBR_LIBRARIES}" REALPATH)
29-
get_filename_component(_LIBR_LIBRARIES_DIR "${_LIBR_LIBRARIES}" PATH)
30-
set(LIBR_EXECUTABLE "${_LIBR_LIBRARIES_DIR}/../bin/R")
31-
execute_process(
32-
COMMAND ${LIBR_EXECUTABLE} "--slave" "--vanilla" "-e" "cat(R.home())"
33-
OUTPUT_VARIABLE LIBR_HOME
34-
)
35-
set(LIBR_HOME ${LIBR_HOME} CACHE PATH "R home directory")
36-
set(LIBR_INCLUDE_DIRS "${LIBR_HOME}/include" CACHE PATH "R include directory")
37-
endif()
38-
39-
else() # UNIX
40-
# find executable
41-
find_program(LIBR_EXECUTABLE R)
42-
43-
# ask R for the home path
44-
if(NOT LIBR_HOME)
45-
execute_process(
46-
COMMAND ${LIBR_EXECUTABLE} "--slave" "--vanilla" "-e" "cat(R.home())"
47-
OUTPUT_VARIABLE LIBR_HOME
48-
)
49-
if(LIBR_HOME)
50-
set(LIBR_HOME ${LIBR_HOME} CACHE PATH "R home directory")
51-
endif()
52-
endif()
53-
54-
# ask R for the include dir
55-
if(NOT LIBR_INCLUDE_DIRS)
56-
execute_process(
57-
COMMAND ${LIBR_EXECUTABLE} "--slave" "--no-save" "-e" "cat(R.home('include'))"
58-
OUTPUT_VARIABLE LIBR_INCLUDE_DIRS
59-
)
60-
if(LIBR_INCLUDE_DIRS)
61-
set(LIBR_INCLUDE_DIRS ${LIBR_INCLUDE_DIRS} CACHE PATH "R include directory")
62-
endif()
63-
endif()
64-
65-
# sometimes lib and include are not under R.home()
66-
get_filename_component(_LIBR_EXECUTABLE "${LIBR_EXECUTABLE}" PATH)
67-
get_filename_component(_LIBR_EXECUTABLE_DIR "${_LIBR_EXECUTABLE}" PATH)
68-
#message(STATUS "Found R upper directory: ${_LIBR_EXECUTABLE_DIR}")
69-
70-
endif()
71-
72-
include_directories(${LIBR_INCLUDE_DIRS})
73-
7417
## loess library
7518
set(F_OBJ ./libblas_lite.f ./linpack_lite.f ./loessf.f)
7619
set(C_OBJ_LOESS ./loessc.c)

src/libamplici.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -259,4 +259,4 @@ int amplici_core(data_t **dmat, data_t **qmat, size_t sample_size, double low_bo
259259
free_options(opt);
260260

261261
return err;
262-
}/* amplici_core */
262+
}/* amplici_core */

0 commit comments

Comments
 (0)