<commit_before>cmake_minimum_required (VERSION 2.6)

set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}")
project (Emulator)


########################
###### the install prefix is where the bins and libs get dropped.
#####message("Setting Install prefix to Home folder: $ENV{HOME}")
#####set(CMAKE_INSTALL_PREFIX "$ENV{HOME}/local")
########################


# lets get a version number from git
execute_process(
	#COMMAND git describe --tags --long
	COMMAND ../version.sh
	RESULT_VARIABLE v_result_var
	OUTPUT_VARIABLE v_output_var)

if(${v_result_var} MATCHES "0")
	SET(VERSION_NUMBER ${v_output_var})
	message("Building version: ${VERSION_NUMBER}")
else()
	SET(VERSION_NUMBER 1)
endif(${v_result_var} MATCHES "0")

configure_file (
	"${PROJECT_SOURCE_DIR}/src/buildConfig.h.in"
	"${PROJECT_SOURCE_DIR}/src/buildConfig.h"
)

include_directories("${PROJECT_BINARY_DIR}")

# use, i.e. don't skip the full RPATH for the build tree
SET(CMAKE_SKIP_BUILD_RPATH  FALSE)

# when building, don't use the install RPATH already
# (but later on when installing)
SET(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE) 

# the RPATH to be used when installing
SET(CMAKE_INSTALL_RPATH "")

# don't add the automatically determined parts of the RPATH
# which point to directories outside the build tree to the install RPATH
SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH FALSE)


# make compilation verbose
#SET(CMAKE_VERBOSE_MAKEFILE TRUE)

find_package(GSL REQUIRED)
message("GSL_INCLUDE_DIRS: ${GSL_INCLUDE_DIR}")
message("CMAKE_SOURCE_DIR: ${CMAKE_SOURCE_DIR}")
message("CMAKE_INSTALL_PATH: ${CMAKE_INSTALL_PREFIX}")

INCLUDE_DIRECTORIES(${GSL_INCLUDE_DIR} ${CMAKE_SOURCE_DIR}/libEmu)
MESSAGE("include dirs: ${CMAKE_include_directories}")
SET(libs ${libs} ${GSL_LIBRARIES} ${GSLCBLAS_LIBRARIES})


# make a debug release
#set(CMAKE_BUILD_TYPE debug)

if(APPLE)
	SET(CMAKE_C_FLAGS "-std=gnu99 -DAPPLE")
	SET(CMAKE_C_FLAGS_DEBUG "-O0 -std=gnu99 -g -pg -Wall -Wextra -pedantic -DAPPLE -Wno-unused -DDEBUGPCA")
else()
	SET(CMAKE_C_FLAGS "-std=gnu99")
	SET(CMAKE_C_FLAGS_DEBUG "-O0 --std=gnu99 -g -pg -Wall -Wextra -pedantic -DDEBUGPCA")
endif(APPLE)




if(APPLE)
# we need to use the same compiler as R CMD SHLIB would use
# or we're fucked
SET(CMAKE_C_COMPILER "clang")
endif(APPLE)

MESSAGE("C Compiler: ${CMAKE_C_COMPILER}")

if(${CMAKE_BUILD_TYPE} MATCHES "debug")
 MESSAGE("C DEBUG FLAGS: ${CMAKE_C_FLAGS_DEBUG}")
else()
 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O2")
 MESSAGE("C FLAGS: ${CMAKE_C_FLAGS}")
endif(${CMAKE_BUILD_TYPE} MATCHES "debug")

add_subdirectory(src)

# explicitly install the headers we need, and the r-files				
INSTALL_FILES("/include/libEmu/" FILES src/libEmu/emulate-fns.h src/libEmu/emulator.h src/libEmu/estimate_threaded.h src/libEmu/estimator-fns.h src/libEmu/regression.h)
# # ccs: added the R files we need to use rbind
# we have moved the contents of multivar.R into EmuRbind.R
INSTALL_FILES("/include/libRbind/" FILES src/libRbind/rbind.h src/libRbind/EmuRbind.R 
																	 src/libRbind/emuOverDesign.R src/libRbind/implausOverDesign.R
																	 src/libRbind/testEst.R)<commit_msg>removed clang as the default apple compiler, fixed syntax bug<commit_after>cmake_minimum_required (VERSION 2.6)

set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}")
project (Emulator)


########################
###### the install prefix is where the bins and libs get dropped.
#####message("Setting Install prefix to Home folder: $ENV{HOME}")
#####set(CMAKE_INSTALL_PREFIX "$ENV{HOME}/local")
########################


# lets get a version number from git
execute_process(
	#COMMAND git describe --tags --long
	COMMAND ../version.sh
	RESULT_VARIABLE v_result_var
	OUTPUT_VARIABLE v_output_var)

if(${v_result_var} MATCHES "0")
	SET(VERSION_NUMBER ${v_output_var})
	message("Building version: ${VERSION_NUMBER}")
else()
	SET(VERSION_NUMBER 1)
endif(${v_result_var} MATCHES "0")

configure_file (
	"${PROJECT_SOURCE_DIR}/src/buildConfig.h.in"
	"${PROJECT_SOURCE_DIR}/src/buildConfig.h"
)

include_directories("${PROJECT_BINARY_DIR}")

# use, i.e. don't skip the full RPATH for the build tree
SET(CMAKE_SKIP_BUILD_RPATH  FALSE)

# when building, don't use the install RPATH already
# (but later on when installing)
SET(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE) 

# the RPATH to be used when installing
SET(CMAKE_INSTALL_RPATH "")

# don't add the automatically determined parts of the RPATH
# which point to directories outside the build tree to the install RPATH
SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH FALSE)


# make compilation verbose
#SET(CMAKE_VERBOSE_MAKEFILE TRUE)

find_package(GSL REQUIRED)
message("GSL_INCLUDE_DIRS: ${GSL_INCLUDE_DIR}")
message("CMAKE_SOURCE_DIR: ${CMAKE_SOURCE_DIR}")
message("CMAKE_INSTALL_PATH: ${CMAKE_INSTALL_PREFIX}")

INCLUDE_DIRECTORIES(${GSL_INCLUDE_DIR} ${CMAKE_SOURCE_DIR}/libEmu)
MESSAGE("include dirs: ${CMAKE_include_directories}")
SET(libs ${libs} ${GSL_LIBRARIES} ${GSLCBLAS_LIBRARIES})


# make a debug release
#set(CMAKE_BUILD_TYPE debug)

if(APPLE)
	SET(CMAKE_C_FLAGS "-std=gnu99 -DAPPLE")
	SET(CMAKE_C_FLAGS_DEBUG "-O0 -std=gnu99 -g -pg -Wall -Wextra -pedantic -DAPPLE -Wno-unused -DDEBUGPCA")
else()
	SET(CMAKE_C_FLAGS "-std=gnu99")
	SET(CMAKE_C_FLAGS_DEBUG "-O0 -std=gnu99 -g -pg -Wall -Wextra -pedantic -DDEBUGPCA")
endif(APPLE)




if(APPLE)
# we need to use the same compiler as R CMD SHLIB would use
# or we're fucked
#SET(CMAKE_C_COMPILER "clang")
endif(APPLE)

MESSAGE("C Compiler: ${CMAKE_C_COMPILER}")

if(${CMAKE_BUILD_TYPE} MATCHES "debug")
 MESSAGE("C DEBUG FLAGS: ${CMAKE_C_FLAGS_DEBUG}")
else()
 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O2")
 MESSAGE("C FLAGS: ${CMAKE_C_FLAGS}")
endif(${CMAKE_BUILD_TYPE} MATCHES "debug")

add_subdirectory(src)

# explicitly install the headers we need, and the r-files				
INSTALL_FILES("/include/libEmu/" FILES src/libEmu/emulate-fns.h src/libEmu/emulator.h src/libEmu/estimate_threaded.h src/libEmu/estimator-fns.h src/libEmu/regression.h)
# # ccs: added the R files we need to use rbind
# we have moved the contents of multivar.R into EmuRbind.R
INSTALL_FILES("/include/libRbind/" FILES src/libRbind/rbind.h src/libRbind/EmuRbind.R 
																	 src/libRbind/emuOverDesign.R src/libRbind/implausOverDesign.R
																	 src/libRbind/testEst.R)
{'fraction_non_alphanumeric': 0.13408801020408162, 'fraction_numerical': 0.00510204081632653, 'mean_word_length': 5.825897714907508, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2678475', 'n_tokens_mistral': 2523, 'n_tokens_neox': 2308, 'n_words': 534}